1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253
|
<pre>Internet Engineering Task Force (IETF) B. Claise, Ed.
Request for Comments: 7011 Cisco Systems, Inc.
STD: 77 B. Trammell, Ed.
Obsoletes: <a href="./rfc5101">5101</a> ETH Zurich
Category: Standards Track P. Aitken
ISSN: 2070-1721 Cisco Systems, Inc.
September 2013
<span class="h1">Specification of the IP Flow Information Export (IPFIX) Protocol</span>
<span class="h1">for the Exchange of Flow Information</span>
Abstract
This document specifies the IP Flow Information Export (IPFIX)
protocol, which serves as a means for transmitting Traffic Flow
information over the network. In order to transmit Traffic Flow
information from an Exporting Process to a Collecting Process, a
common representation of flow data and a standard means of
communicating them are required. This document describes how the
IPFIX Data and Template Records are carried over a number of
transport protocols from an IPFIX Exporting Process to an IPFIX
Collecting Process. This document obsoletes <a href="./rfc5101">RFC 5101</a>.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc7011">http://www.rfc-editor.org/info/rfc7011</a>.
<span class="grey">Claise, et al. Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-5">5</a>
<a href="#section-1.1">1.1</a>. Changes since <a href="./rfc5101">RFC 5101</a> .....................................<a href="#page-5">5</a>
<a href="#section-1.2">1.2</a>. IPFIX Documents Overview ...................................<a href="#page-6">6</a>
<a href="#section-2">2</a>. Terminology .....................................................<a href="#page-7">7</a>
<a href="#section-2.1">2.1</a>. Terminology Summary Table .................................<a href="#page-13">13</a>
<a href="#section-3">3</a>. IPFIX Message Format ...........................................<a href="#page-13">13</a>
<a href="#section-3.1">3.1</a>. Message Header Format .....................................<a href="#page-15">15</a>
<a href="#section-3.2">3.2</a>. Field Specifier Format ....................................<a href="#page-16">16</a>
<a href="#section-3.3">3.3</a>. Set and Set Header Format .................................<a href="#page-18">18</a>
<a href="#section-3.3.1">3.3.1</a>. Set Format .........................................<a href="#page-18">18</a>
<a href="#section-3.3.2">3.3.2</a>. Set Header Format ..................................<a href="#page-19">19</a>
<a href="#section-3.4">3.4</a>. Record Format .............................................<a href="#page-20">20</a>
<a href="#section-3.4.1">3.4.1</a>. Template Record Format .............................<a href="#page-20">20</a>
<a href="#section-3.4.2">3.4.2</a>. Options Template Record Format .....................<a href="#page-23">23</a>
<a href="#section-3.4.2.1">3.4.2.1</a>. Scope .....................................<a href="#page-23">23</a>
<a href="#section-3.4.2.2">3.4.2.2</a>. Options Template Record Format ............<a href="#page-24">24</a>
<a href="#section-3.4.3">3.4.3</a>. Data Record Format .................................<a href="#page-27">27</a>
<a href="#section-4">4</a>. Specific Reporting Requirements ................................<a href="#page-28">28</a>
<a href="#section-4.1">4.1</a>. The Metering Process Statistics Options Template ..........<a href="#page-29">29</a>
4.2. The Metering Process Reliability Statistics
Options Template ..........................................<a href="#page-29">29</a>
4.3. The Exporting Process Reliability Statistics
Options Template ..........................................<a href="#page-31">31</a>
<a href="#section-4.4">4.4</a>. The Flow Keys Options Template ............................<a href="#page-32">32</a>
<a href="#section-5">5</a>. Timing Considerations ..........................................<a href="#page-32">32</a>
<a href="#section-5.1">5.1</a>. IPFIX Message Header Export Time and Flow Record Time .....<a href="#page-32">32</a>
<a href="#section-5.2">5.2</a>. Supporting Timestamp Wraparound ...........................<a href="#page-33">33</a>
<span class="grey">Claise, et al. Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<a href="#section-6">6</a>. Linkage with the Information Model .............................<a href="#page-34">34</a>
<a href="#section-6.1">6.1</a>. Encoding of IPFIX Data Types ..............................<a href="#page-34">34</a>
<a href="#section-6.1.1">6.1.1</a>. Integral Data Types ................................<a href="#page-34">34</a>
<a href="#section-6.1.2">6.1.2</a>. Address Types ......................................<a href="#page-34">34</a>
<a href="#section-6.1.3">6.1.3</a>. float32 ............................................<a href="#page-34">34</a>
<a href="#section-6.1.4">6.1.4</a>. float64 ............................................<a href="#page-34">34</a>
<a href="#section-6.1.5">6.1.5</a>. boolean ............................................<a href="#page-35">35</a>
<a href="#section-6.1.6">6.1.6</a>. string and octetArray ..............................<a href="#page-35">35</a>
<a href="#section-6.1.7">6.1.7</a>. dateTimeSeconds ....................................<a href="#page-35">35</a>
<a href="#section-6.1.8">6.1.8</a>. dateTimeMilliseconds ...............................<a href="#page-35">35</a>
<a href="#section-6.1.9">6.1.9</a>. dateTimeMicroseconds ...............................<a href="#page-35">35</a>
<a href="#section-6.1.10">6.1.10</a>. dateTimeNanoseconds ...............................<a href="#page-36">36</a>
<a href="#section-6.2">6.2</a>. Reduced-Size Encoding .....................................<a href="#page-36">36</a>
<a href="#section-7">7</a>. Variable-Length Information Element ............................<a href="#page-37">37</a>
<a href="#section-8">8</a>. Template Management ............................................<a href="#page-38">38</a>
<a href="#section-8.1">8.1</a>. Template Withdrawal and Redefinition ......................<a href="#page-40">40</a>
<a href="#section-8.2">8.2</a>. Sequencing Template Management Actions ....................<a href="#page-42">42</a>
8.3. Additional Considerations for Template Management
over SCTP .................................................<a href="#page-43">43</a>
8.4. Additional Considerations for Template Management
over UDP ..................................................<a href="#page-44">44</a>
<a href="#section-9">9</a>. The Collecting Process's Side ..................................<a href="#page-45">45</a>
<a href="#section-9.1">9.1</a>. Collecting Process Handling of Malformed IPFIX Messages ...<a href="#page-46">46</a>
<a href="#section-9.2">9.2</a>. Additional Considerations for SCTP Collecting Processes ...<a href="#page-46">46</a>
<a href="#section-9.3">9.3</a>. Additional Considerations for UDP Collecting Processes ....<a href="#page-46">46</a>
<a href="#section-10">10</a>. Transport Protocol ............................................<a href="#page-47">47</a>
<a href="#section-10.1">10.1</a>. Transport Compliance and Transport Usage .................<a href="#page-47">47</a>
<a href="#section-10.2">10.2</a>. SCTP .....................................................<a href="#page-48">48</a>
<a href="#section-10.2.1">10.2.1</a>. Congestion Avoidance ..............................<a href="#page-48">48</a>
<a href="#section-10.2.2">10.2.2</a>. Reliability .......................................<a href="#page-49">49</a>
<a href="#section-10.2.3">10.2.3</a>. MTU ...............................................<a href="#page-49">49</a>
<a href="#section-10.2.4">10.2.4</a>. Association Establishment and Shutdown ............<a href="#page-49">49</a>
<a href="#section-10.2.5">10.2.5</a>. Failover ..........................................<a href="#page-50">50</a>
<a href="#section-10.2.6">10.2.6</a>. Streams ...........................................<a href="#page-50">50</a>
<a href="#section-10.3">10.3</a>. UDP ......................................................<a href="#page-50">50</a>
<a href="#section-10.3.1">10.3.1</a>. Congestion Avoidance ..............................<a href="#page-50">50</a>
<a href="#section-10.3.2">10.3.2</a>. Reliability .......................................<a href="#page-51">51</a>
<a href="#section-10.3.3">10.3.3</a>. MTU ...............................................<a href="#page-51">51</a>
<a href="#section-10.3.4">10.3.4</a>. Session Establishment and Shutdown ................<a href="#page-51">51</a>
<a href="#section-10.3.5">10.3.5</a>. Failover and Session Duplication ..................<a href="#page-51">51</a>
<a href="#section-10.4">10.4</a>. TCP ......................................................<a href="#page-52">52</a>
<a href="#section-10.4.1">10.4.1</a>. Congestion Avoidance ..............................<a href="#page-52">52</a>
<a href="#section-10.4.2">10.4.2</a>. Reliability .......................................<a href="#page-52">52</a>
<a href="#section-10.4.3">10.4.3</a>. MTU ...............................................<a href="#page-52">52</a>
<a href="#section-10.4.4">10.4.4</a>. Connection Establishment and Shutdown .............<a href="#page-53">53</a>
<a href="#section-10.4.5">10.4.5</a>. Failover ..........................................<a href="#page-53">53</a>
<span class="grey">Claise, et al. Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<a href="#section-11">11</a>. Security Considerations .......................................<a href="#page-54">54</a>
<a href="#section-11.1">11.1</a>. Applicability of TLS and DTLS ............................<a href="#page-55">55</a>
<a href="#section-11.2">11.2</a>. Usage ....................................................<a href="#page-56">56</a>
<a href="#section-11.3">11.3</a>. Mutual Authentication ....................................<a href="#page-56">56</a>
<a href="#section-11.4">11.4</a>. Protection against DoS Attacks ...........................<a href="#page-57">57</a>
<a href="#section-11.5">11.5</a>. When DTLS or TLS Is Not an Option ........................<a href="#page-58">58</a>
<a href="#section-11.6">11.6</a>. Logging an IPFIX Attack ..................................<a href="#page-58">58</a>
<a href="#section-11.7">11.7</a>. Securing the Collector ...................................<a href="#page-59">59</a>
<a href="#section-11.8">11.8</a>. Privacy Considerations for Collected Data ................<a href="#page-59">59</a>
<a href="#section-12">12</a>. Management Considerations .....................................<a href="#page-60">60</a>
<a href="#section-13">13</a>. IANA Considerations ...........................................<a href="#page-61">61</a>
<a href="#appendix-A">Appendix A</a>. IPFIX Encoding Examples ...............................<a href="#page-62">62</a>
<a href="#appendix-A.1">A.1</a>. Message Header Example ....................................<a href="#page-62">62</a>
<a href="#appendix-A.2">A.2</a>. Template Set Examples .....................................<a href="#page-63">63</a>
<a href="#appendix-A.2.1">A.2.1</a>. Template Set Using IANA Information Elements ..........<a href="#page-63">63</a>
A.2.2. Template Set Using Enterprise-Specific Information
Elements ..............................................<a href="#page-64">64</a>
<a href="#appendix-A.3">A.3</a>. Data Set Example ..........................................<a href="#page-65">65</a>
<a href="#appendix-A.4">A.4</a>. Options Template Set Examples .............................<a href="#page-66">66</a>
<a href="#appendix-A.4.1">A.4.1</a>. Options Template Set Using IANA Information Elements ..66
A.4.2. Options Template Set Using Enterprise-Specific
Information Elements ..................................<a href="#page-66">66</a>
A.4.3. Options Template Set Using an Enterprise-Specific
Scope .................................................<a href="#page-67">67</a>
<a href="#appendix-A.4.4">A.4.4</a>. Data Set Using an Enterprise-Specific Scope ...........<a href="#page-68">68</a>
<a href="#appendix-A.5">A.5</a>. Variable-Length Information Element Examples ..............<a href="#page-69">69</a>
A.5.1. Example of Variable-Length Information Element with
Length Less Than 255 Octets ...........................<a href="#page-69">69</a>
A.5.2. Example of Variable-Length Information Element with
3-Octet Length Encoding ...............................<a href="#page-70">70</a>
Normative References ..............................................<a href="#page-71">71</a>
Informative References ............................................<a href="#page-71">71</a>
Acknowledgments ...................................................<a href="#page-74">74</a>
Contributors ......................................................<a href="#page-75">75</a>
<span class="grey">Claise, et al. Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
Traffic on a data network can be seen as consisting of flows passing
through network elements. For administrative or other purposes, it
is often interesting, useful, or even necessary to have access to
information about these flows that pass through the network elements.
A Collecting Process should be able to receive the Flow information
passing through multiple network elements within the data network.
This requires uniformity in the method of representing the flow
information and the means of communicating the flows from the network
elements to the collection point. This document specifies a protocol
to achieve these requirements. This document specifies in detail the
representation of different flows, as well as the additional data
required for flow interpretation, packet format, transport mechanisms
used, security concerns, etc.
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. Changes since <a href="./rfc5101">RFC 5101</a></span>
This document obsoletes the Proposed Standard revision of the IPFIX
Protocol Specification [<a href="./rfc5101" title=""Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information"">RFC5101</a>]. The protocol specified by this
document is interoperable with the protocol as specified in
[<a href="./rfc5101" title=""Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information"">RFC5101</a>]. The following changes have been made to this document
with respect to the previous document:
- All outstanding technical and editorial errata on [<a href="./rfc5101" title=""Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information"">RFC5101</a>] have
been addressed.
- As the [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>] registry is now the normative reference for all
Information Element definitions (see [<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>]), all definitions of
Information Elements in <a href="#section-4">Section 4</a> have been replaced with
references to that registry.
- The encoding of the dateTimeSeconds, dateTimeMilliseconds,
dateTimeMicroseconds, and dateTimeNanoseconds data types, and the
related encoding of the IPFIX Message Header Export Time field,
have been clarified, especially with respect to the epoch upon
which the timestamp data types are based.
- A new <a href="#section-5.2">Section 5.2</a> has been added to address wraparound of these
timestamp data types after they overflow in the years 2032-2038.
- Clarifications on encoding, especially in <a href="#section-6">Section 6</a>, have been
made: all IPFIX values are encoded in network byte order.
<span class="grey">Claise, et al. Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
- Template management, as described in <a href="#section-8">Section 8</a>, has been simplified
and clarified: the specification has been relaxed with respect to
[<a href="./rfc5101" title=""Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information"">RFC5101</a>], especially concerning potential failures in Template ID
reuse. Additional corner cases in template management have been
addressed. The new template management language is interoperable
with that in [<a href="./rfc5101" title=""Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information"">RFC5101</a>] to the extent that the behavior was defined
in the prior specification.
- <a href="#section-11.3">Section 11.3</a> (Mutual Authentication) has been improved to refer to
current practices in Transport Layer Security (TLS) mutual
authentication; references to Punycode were removed, as these are
covered in [<a href="./rfc6125" title=""Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS)"">RFC6125</a>].
- Editorial improvements, including structural changes to Sections <a href="#section-8">8</a>,
9, and 10 to improve readability, have been applied. Behavior
common to all transport protocols has been separated out, with
exceptions per transport specifically noted. All template
management language (on both Exporting and Collecting Processes)
has been unified in <a href="#section-8">Section 8</a>.
- A new <a href="#section-12">Section 12</a> on management considerations has been added.
<span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a>. IPFIX Documents Overview</span>
The IPFIX protocol provides network administrators with access to IP
Flow information. The architecture for the export of measured IP
Flow information out of an IPFIX Exporting Process to a Collecting
Process is defined in [<a href="./rfc5470" title=""Architecture for IP Flow Information Export"">RFC5470</a>], per the requirements defined in
[<a href="./rfc3917" title=""Requirements for IP Flow Information Export (IPFIX)"">RFC3917</a>]. This document specifies how IPFIX Data Records and
Templates are carried via a number of transport protocols from IPFIX
Exporting Processes to IPFIX Collecting Processes.
Four IPFIX optimizations/extensions are currently specified: a
bandwidth-saving method for the IPFIX protocol [<a href="./rfc5473" title=""Reducing Redundancy in IP Flow Information Export (IPFIX) and Packet Sampling (PSAMP) Reports"">RFC5473</a>], an
efficient method for exporting bidirectional flows [<a href="./rfc5103" title=""Bidirectional Flow Export Using IP Flow Information Export (IPFIX)"">RFC5103</a>], a
method for the definition and export of complex data structures
[<a href="./rfc6313" title=""Export of Structured Data in IP Flow Information Export (IPFIX)"">RFC6313</a>], and the specification of the Protocol on IPFIX Mediators
[<a href="#ref-IPFIX-MED-PROTO">IPFIX-MED-PROTO</a>] based on the IPFIX Mediation Framework [<a href="./rfc6183" title=""IP Flow Information Export (IPFIX) Mediation: Framework"">RFC6183</a>].
A "file-based transport" for IPFIX, which defines how IPFIX Messages
can be stored in files for document-based workflows and for archival
purposes, is discussed in [<a href="./rfc5655" title=""Specification of the IP Flow Information Export (IPFIX) File Format"">RFC5655</a>].
IPFIX has a formal description of IPFIX Information Elements -- their
names, data types, and additional semantic information -- as
specified in [<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>]. The registry is maintained by IANA
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>]. The inline export of the Information Element type
information is specified in [<a href="./rfc5610" title=""Exporting Type Information for IP Flow Information Export (IPFIX) Information Elements"">RFC5610</a>].
<span class="grey">Claise, et al. Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The framework for packet selection and reporting [<a href="./rfc5474" title=""A Framework for Packet Selection and Reporting"">RFC5474</a>] enables
network elements to select subsets of packets by statistical and
other methods, and to export a stream of reports on the selected
packets to a Collector. The set of packet selection techniques
(Sampling, Filtering, and hashing) standardized by the Packet
Sampling (PSAMP) protocol is described in [<a href="./rfc5475" title=""Sampling and Filtering Techniques for IP Packet Selection"">RFC5475</a>]. The PSAMP
protocol [<a href="./rfc5476" title=""Packet Sampling (PSAMP) Protocol Specifications"">RFC5476</a>], which uses IPFIX as its export protocol,
specifies the export of packet information from a PSAMP Exporting
Process to a PSAMP Collector. Instead of exporting PSAMP Packet
Reports, the stream of selected packets may also serve as input to
the generation of IPFIX Flow Records. Like IPFIX, PSAMP has a formal
description of its Information Elements: their names, types, and
additional semantic information. The PSAMP information model is
defined in [<a href="./rfc5477" title=""Information Model for Packet Sampling Exports"">RFC5477</a>].
[<a id="ref-RFC6615">RFC6615</a>] specifies a MIB module for monitoring, and [<a href="./rfc6728" title=""Configuration Data Model for the IP Flow Information Export (IPFIX) and Packet Sampling (PSAMP) Protocols"">RFC6728</a>]
specifies a data model for configuring and monitoring IPFIX and
PSAMP-compliant devices using the Network Configuration Protocol
(NETCONF). [<a href="./rfc6727" title=""Definitions of Managed Objects for Packet Sampling"">RFC6727</a>] specifies the PSAMP MIB module as an extension
of the IPFIX SELECTOR MIB module defined in [<a href="./rfc6615" title=""Definitions of Managed Objects for IP Flow Information Export"">RFC6615</a>].
In terms of development, [<a href="./rfc5153" title=""IP Flow Information Export (IPFIX) Implementation Guidelines"">RFC5153</a>] provides guidelines for the
implementation and use of the IPFIX protocol, while [<a href="./rfc5471" title=""Guidelines for IP Flow Information Export (IPFIX) Testing"">RFC5471</a>]
provides guidelines for testing. Finally, [<a href="./rfc5472" title=""IP Flow Information Export (IPFIX) Applicability"">RFC5472</a>] describes what
types of applications can use the IPFIX protocol and how they can use
the information provided. It furthermore shows how the IPFIX
framework relates to other architectures and frameworks.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Terminology</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
<a href="./rfc2119">RFC 2119</a> [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
The definitions of the basic terms like Traffic Flow, Exporting
Process, Collecting Process, Observation Points, etc. are
semantically identical to those found in the IPFIX requirements
document [<a href="./rfc3917" title=""Requirements for IP Flow Information Export (IPFIX)"">RFC3917</a>]. Some of the terms have been expanded for more
clarity when defining the protocol. Additional terms required for
the protocol have also been defined. Definitions in this document
and in [<a href="./rfc5470" title=""Architecture for IP Flow Information Export"">RFC5470</a>] are equivalent; definitions that are only relevant
to the IPFIX protocol only appear here.
<span class="grey">Claise, et al. Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The terminology summary table in <a href="#section-2.1">Section 2.1</a> gives a quick overview
of the relationships among some of the different terms defined.
Observation Point
An Observation Point is a location in the network where packets
can be observed. Examples include a line to which a probe is
attached; a shared medium, such as an Ethernet-based LAN; a single
port of a router; or a set of interfaces (physical or logical) of
a router.
Note that every Observation Point is associated with an
Observation Domain (defined below) and that one Observation Point
may be a superset of several other Observation Points. For
example, one Observation Point can be an entire line card. That
would be the superset of the individual Observation Points at the
line card's interfaces.
Observation Domain
An Observation Domain is the largest set of Observation Points for
which Flow information can be aggregated by a Metering Process.
For example, a router line card may be an Observation Domain if it
is composed of several interfaces, each of which is an Observation
Point. In the IPFIX Message it generates, the Observation Domain
includes its Observation Domain ID, which is unique per Exporting
Process. That way, the Collecting Process can identify the
specific Observation Domain from the Exporter that sends the IPFIX
Messages. Every Observation Point is associated with an
Observation Domain. It is RECOMMENDED that Observation Domain IDs
also be unique per IPFIX Device.
Packet Treatment
"Packet Treatment" refers to action(s) performed on a packet by a
forwarding device or other middlebox, including forwarding,
dropping, delaying for traffic-shaping purposes, etc.
<span class="grey">Claise, et al. Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Traffic Flow or Flow
There are several definitions of the term 'flow' being used by the
Internet community. Within the context of IPFIX, we use the
following definition:
A Flow is defined as a set of packets or frames passing an
Observation Point in the network during a certain time interval.
All packets belonging to a particular Flow have a set of common
properties. Each property is defined as the result of applying a
function to the values of:
1. one or more packet header fields (e.g., destination IP
address), transport header fields (e.g., destination port
number), or application header fields (e.g., RTP header fields
[<a href="./rfc3550" title=""RTP: A Transport Protocol for Real-Time Applications"">RFC3550</a>]).
2. one or more characteristics of the packet itself (e.g., number
of MPLS labels, etc.).
3. one or more of the fields derived from Packet Treatment (e.g.,
next-hop IP address, the output interface, etc.).
A packet is defined as belonging to a Flow if it completely
satisfies all the defined properties of the Flow.
Note that the set of packets represented by a Flow may be empty;
that is, a Flow may represent zero or more packets. As sampling
is a Packet Treatment, this definition includes packets selected
by a sampling mechanism.
Flow Key
Each of the fields that:
1. belong to the packet header (e.g., destination IP address), or
2. are a property of the packet itself (e.g., packet length), or
3. are derived from Packet Treatment (e.g., Autonomous System (AS)
number),
and that are used to define a Flow (i.e., are the properties
common to all packets in the Flow) are termed Flow Keys. As an
example, the traditional '5-tuple' Flow Key of source and
destination IP address, source and destination transport port, and
transport protocol, groups together all packets belonging to a
single direction of communication on a single socket.
<span class="grey">Claise, et al. Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Flow Record
A Flow Record contains information about a specific Flow that was
observed at an Observation Point. A Flow Record contains measured
properties of the Flow (e.g., the total number of bytes for all
the Flow's packets) and usually contains characteristic properties
of the Flow (e.g., source IP address).
Metering Process
The Metering Process generates Flow Records. Inputs to the
process are packet headers, characteristics, and Packet Treatment
observed at one or more Observation Points.
The Metering Process consists of a set of functions that includes
packet header capturing, timestamping, sampling, classifying, and
maintaining Flow Records.
The maintenance of Flow Records may include creating new records,
updating existing ones, computing Flow statistics, deriving
further Flow properties, detecting Flow expiration, passing Flow
Records to the Exporting Process, and deleting Flow Records.
Exporting Process
The Exporting Process sends IPFIX Messages to one or more
Collecting Processes. The Flow Records in the Messages are
generated by one or more Metering Processes.
Exporter
A device that hosts one or more Exporting Processes is termed an
Exporter.
IPFIX Device
An IPFIX Device hosts at least one Exporting Process. It may host
further Exporting Processes as well as arbitrary numbers of
Observation Points and Metering Processes.
Collecting Process
A Collecting Process receives IPFIX Messages from one or more
Exporting Processes. The Collecting Process might process or
store Flow Records received within these Messages, but such
actions are out of scope for this document.
<span class="grey">Claise, et al. Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Collector
A device that hosts one or more Collecting Processes is termed a
Collector.
Template
A Template is an ordered sequence of <type, length> pairs used to
completely specify the structure and semantics of a particular set
of information that needs to be communicated from an IPFIX Device
to a Collector. Each Template is uniquely identifiable by means
of a Template ID.
IPFIX Message
An IPFIX Message is a message that originates at the Exporting
Process and carries the IPFIX records of this Exporting Process,
and whose destination is a Collecting Process. An IPFIX Message
is encapsulated at the transport layer.
Message Header
The Message Header is the first part of an IPFIX Message; the
Message Header provides basic information about the message, such
as the IPFIX version, length of the message, message sequence
number, etc.
Template Record
A Template Record defines the structure and interpretation of
fields in a Data Record.
Data Record
A Data Record is a record that contains values of the parameters
corresponding to a Template Record.
Options Template Record
An Options Template Record is a Template Record that defines the
structure and interpretation of fields in a Data Record, including
defining how to scope the applicability of the Data Record.
<span class="grey">Claise, et al. Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Set
A Set is a collection of records that have a similar structure,
prefixed by a header. In an IPFIX Message, zero or more Sets
follow the Message Header. There are three different types of
Sets: Template Sets, Options Template Sets, and Data Sets.
Template Set
A Template Set is a collection of one or more Template Records
that have been grouped together in an IPFIX Message.
Options Template Set
An Options Template Set is a collection of one or more Options
Template Records that have been grouped together in an IPFIX
Message.
Data Set
A Data Set is one or more Data Records, of the same type, that are
grouped together in an IPFIX Message. Each Data Record is
previously defined by a Template Record or an Options Template
Record.
Information Element
An Information Element is a protocol- and encoding-independent
description of an attribute that may appear in an IPFIX Record.
Information Elements are defined in the IANA "IPFIX Information
Elements" registry [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>]. The type associated with an
Information Element indicates constraints on what it may contain
and also determines the valid encoding mechanisms for use in
IPFIX.
Transport Session
In the Stream Control Transmission Protocol (SCTP), the Transport
Session is known as the SCTP association, which is uniquely
identified by the SCTP endpoints [<a href="./rfc4960" title=""Stream Control Transmission Protocol"">RFC4960</a>]; in TCP, the Transport
Session is known as the TCP connection, which is uniquely
identified by the combination of IP addresses and TCP ports used.
In UDP, the Transport Session is known as the UDP session, which
is uniquely identified by the combination of IP addresses and UDP
ports used.
<span class="grey">Claise, et al. Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a>. Terminology Summary Table</span>
Figure A shows a summary of IPFIX terminology.
+------------------+---------------------------------------------+
| | Contents |
| +--------------------+------------------------+
| Set | Template | Record |
+------------------+--------------------+------------------------+
| Data Set | / | Data Record(s) |
+------------------+--------------------+------------------------+
| Template Set | Template Record(s) | / |
+------------------+--------------------+------------------------+
| Options Template | Options Template | / |
| Set | Record(s) | |
+------------------+--------------------+------------------------+
Figure A: Terminology Summary Table
A Data Set is composed of Data Record(s). No Template Record is
included. A Template Record or an Options Template Record defines
the Data Record.
A Template Set contains only Template Record(s).
An Options Template Set contains only Options Template Record(s).
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. IPFIX Message Format</span>
An IPFIX Message consists of a Message Header, followed by zero or
more Sets. The Sets can be any of these three possible types:
Data Set, Template Set, or Options Template Set.
The format of the IPFIX Message is shown in Figure B.
+----------------------------------------------------+
| Message Header |
+----------------------------------------------------+
| Set |
+----------------------------------------------------+
| Set |
+----------------------------------------------------+
...
+----------------------------------------------------+
| Set |
+----------------------------------------------------+
Figure B: IPFIX Message Format
<span class="grey">Claise, et al. Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Following are some examples of IPFIX Messages:
1. An IPFIX Message consisting of interleaved Template, Data, and
Options Template Sets, as shown in Figure C. Here, Template and
Options Template Sets are transmitted "on demand", before the
first Data Set whose structure they define.
+--------+--------------------------------------------------------+
| | +----------+ +---------+ +-----------+ +---------+ |
|Message | | Template | | Data | | Options | | Data | |
| Header | | Set | | Set | ... | Template | | Set | |
| | | | | | | Set | | | |
| | +----------+ +---------+ +-----------+ +---------+ |
+--------+--------------------------------------------------------+
Figure C: IPFIX Message: Example 1
2. An IPFIX Message consisting entirely of Data Sets, sent after the
appropriate Template Records have been defined and transmitted to
the Collecting Process, as shown in Figure D.
+--------+----------------------------------------------+
| | +---------+ +---------+ +---------+ |
|Message | | Data | | Data | | Data | |
| Header | | Set | ... | Set | ... | Set | |
| | +---------+ +---------+ +---------+ |
+--------+----------------------------------------------+
Figure D: IPFIX Message: Example 2
3. An IPFIX Message consisting entirely of Template and Options
Template Sets, as shown in Figure E. Such a message can be used
to define or redefine Templates and Options Templates in bulk.
+--------+-------------------------------------------------+
| | +----------+ +----------+ +----------+ |
|Message | | Template | | Template | | Options | |
| Header | | Set | ... | Set | ... | Template | |
| | | | | | | Set | |
| | +----------+ +----------+ +----------+ |
+--------+-------------------------------------------------+
Figure E: IPFIX Message: Example 3
<span class="grey">Claise, et al. Standards Track [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. Message Header Format</span>
The format of the IPFIX Message Header is shown in Figure F.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version Number | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Export Time |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Observation Domain ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure F: IPFIX Message Header Format
Each Message Header field is exported in network byte order. The
fields are defined as follows:
Version
Version of IPFIX to which this Message conforms. The value of
this field is 0x000a for the current version, incrementing by one
the version used in the NetFlow services export version 9
[<a href="./rfc3954" title=""Cisco Systems NetFlow Services Export Version 9"">RFC3954</a>].
Length
Total length of the IPFIX Message, measured in octets, including
Message Header and Set(s).
Export Time
Time at which the IPFIX Message Header leaves the Exporter,
expressed in seconds since the UNIX epoch of 1 January 1970 at
00:00 UTC, encoded as an unsigned 32-bit integer.
<span class="grey">Claise, et al. Standards Track [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Sequence Number
Incremental sequence counter modulo 2^32 of all IPFIX Data Records
sent in the current stream from the current Observation Domain by
the Exporting Process. Each SCTP Stream counts sequence numbers
separately, while all messages in a TCP connection or UDP session
are considered to be part of the same stream. This value can be
used by the Collecting Process to identify whether any IPFIX Data
Records have been missed. Template and Options Template Records
do not increase the Sequence Number.
Observation Domain ID
A 32-bit identifier of the Observation Domain that is locally
unique to the Exporting Process. The Exporting Process uses the
Observation Domain ID to uniquely identify to the Collecting
Process the Observation Domain that metered the Flows. It is
RECOMMENDED that this identifier also be unique per IPFIX Device.
Collecting Processes SHOULD use the Transport Session and the
Observation Domain ID field to separate different export streams
originating from the same Exporter. The Observation Domain ID
SHOULD be 0 when no specific Observation Domain ID is relevant for
the entire IPFIX Message, for example, when exporting the
Exporting Process Statistics, or in the case of a hierarchy of
Collectors when aggregated Data Records are exported.
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>. Field Specifier Format</span>
Vendors need the ability to define proprietary Information Elements,
because, for example, they are delivering a pre-standards product, or
the Information Element is in some way commercially sensitive. This
section describes the Field Specifier format for both IANA-registered
Information Elements [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>] and enterprise-specific Information
Elements.
The Information Elements are identified by the Information Element
identifier. When the Enterprise bit is set to 0, the corresponding
Information Element appears in [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], and the Enterprise
Number MUST NOT be present. When the Enterprise bit is set to 1, the
corresponding Information Element identifier identified an
enterprise-specific Information Element; the Enterprise Number MUST
be present. An example of this is shown in <a href="#appendix-A.2.2">Appendix A.2.2</a>.
<span class="grey">Claise, et al. Standards Track [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The Field Specifier format is shown in Figure G.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|E| Information Element ident. | Field Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure G: Field Specifier Format
Where:
E
Enterprise bit. This is the first bit of the Field Specifier. If
this bit is zero, the Information Element identifier identifies an
Information Element in [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], and the four-octet Enterprise
Number field MUST NOT be present. If this bit is one, the
Information Element identifier identifies an enterprise-specific
Information Element, and the Enterprise Number field MUST be
present.
Information Element identifier
A numeric value that represents the Information Element. Refer to
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>].
Field Length
The length of the corresponding encoded Information Element, in
octets. Refer to [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>]. The Field Length may be smaller
than that listed in [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>] if the reduced-size encoding is
used (see <a href="#section-6.2">Section 6.2</a>). The value 65535 is reserved for variable-
length Information Elements (see <a href="#section-7">Section 7</a>).
Enterprise Number
IANA enterprise number [<a href="#ref-IANA-PEN">IANA-PEN</a>] of the authority defining the
Information Element identifier in this Template Record.
<span class="grey">Claise, et al. Standards Track [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a>. Set and Set Header Format</span>
A Set is a generic term for a collection of records that have a
similar structure. There are three different types of Sets: Template
Sets, Options Template Sets, and Data Sets. Each of these Sets
consists of a Set Header and one or more records. The Set Format and
the Set Header Format are defined in the following sections.
<span class="h4"><a class="selflink" id="section-3.3.1" href="#section-3.3.1">3.3.1</a>. Set Format</span>
A Set has the format shown in Figure H. The record types can be
either Template Records, Options Template Records, or Data Records.
The record types MUST NOT be mixed within a Set.
+--------------------------------------------------+
| Set Header |
+--------------------------------------------------+
| record |
+--------------------------------------------------+
| record |
+--------------------------------------------------+
...
+--------------------------------------------------+
| record |
+--------------------------------------------------+
| Padding (opt.) |
+--------------------------------------------------+
Figure H: Set Format
Set Header
The Set Header Format is defined in <a href="#section-3.3.2">Section 3.3.2</a>.
Record
One of the record formats: Template Record, Options Template
Record, or Data Record format.
Padding
The Exporting Process MAY insert some padding octets, so that the
subsequent Set starts at an aligned boundary. For security
reasons, the padding octet(s) MUST be composed of octets with
value zero (0). The padding length MUST be shorter than any
allowable record in this Set. If padding of the IPFIX Message is
desired in combination with very short records, then the padding
Information Element 'paddingOctets' can be used for padding
<span class="grey">Claise, et al. Standards Track [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
records such that their length is increased to a multiple of 4 or
8 octets. Because Template Sets are always 4-octet aligned by
definition, padding is only needed in the case of other
alignments, e.g., on 8-octet boundaries.
<span class="h4"><a class="selflink" id="section-3.3.2" href="#section-3.3.2">3.3.2</a>. Set Header Format</span>
Every Set contains a common header. This header is defined in
Figure I.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure I: Set Header Format
Each Set Header field is exported in network format. The fields are
defined as follows:
Set ID
Identifies the Set. A value of 2 is reserved for Template Sets.
A value of 3 is reserved for Options Template Sets. Values from 4
to 255 are reserved for future use. Values 256 and above are used
for Data Sets. The Set ID values of 0 and 1 are not used, for
historical reasons [<a href="./rfc3954" title=""Cisco Systems NetFlow Services Export Version 9"">RFC3954</a>].
Length
Total length of the Set, in octets, including the Set Header, all
records, and the optional padding. Because an individual Set MAY
contain multiple records, the Length value MUST be used to
determine the position of the next Set.
<span class="grey">Claise, et al. Standards Track [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a>. Record Format</span>
IPFIX defines three record formats, as defined in the next sections:
the Template Record format, the Options Template Record format, and
the Data Record format.
<span class="h4"><a class="selflink" id="section-3.4.1" href="#section-3.4.1">3.4.1</a>. Template Record Format</span>
One of the essential elements in the IPFIX record format is the
Template Record. Templates greatly enhance the flexibility of the
record format because they allow the Collecting Process to process
IPFIX Messages without necessarily knowing the interpretation of all
Data Records. A Template Record contains any combination of IANA-
assigned and/or enterprise-specific Information Element identifiers.
The format of the Template Record is shown in Figure J. It consists
of a Template Record Header and one or more Field Specifiers. Field
Specifiers are defined in Figure G above.
+--------------------------------------------------+
| Template Record Header |
+--------------------------------------------------+
| Field Specifier |
+--------------------------------------------------+
| Field Specifier |
+--------------------------------------------------+
...
+--------------------------------------------------+
| Field Specifier |
+--------------------------------------------------+
Figure J: Template Record Format
The format of the Template Record Header is shown in Figure K.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID (> 255) | Field Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure K: Template Record Header Format
<span class="grey">Claise, et al. Standards Track [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The Template Record Header Field definitions are as follows:
Template ID
Each Template Record is given a unique Template ID in the range
256 to 65535. This uniqueness is local to the Transport Session
and Observation Domain that generated the Template ID. Since
Template IDs are used as Set IDs in the Sets they describe (see
<a href="#section-3.4.3">Section 3.4.3</a>), values 0-255 are reserved for special Set types
(e.g., Template Sets themselves), and Templates and Options
Templates (see <a href="#section-3.4.2">Section 3.4.2</a>) cannot share Template IDs within a
Transport Session and Observation Domain. There are no
constraints regarding the order of the Template ID allocation. As
Exporting Processes are free to allocate Template IDs as they see
fit, Collecting Processes MUST NOT assume incremental Template
IDs, or anything about the contents of a Template based on its
Template ID alone.
Field Count
Number of fields in this Template Record.
<span class="grey">Claise, et al. Standards Track [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The example in Figure L shows a Template Set with mixed IANA-assigned
and enterprise-specific Information Elements. It consists of a Set
Header, a Template Header, and several Field Specifiers.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 2 | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID = 256 | Field Count = N |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1| Information Element id. 1.1 | Field Length 1.1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise Number 1.1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| Information Element id. 1.2 | Field Length 1.2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1| Information Element id. 1.N | Field Length 1.N |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise Number 1.N |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID = 257 | Field Count = M |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| Information Element id. 2.1 | Field Length 2.1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1| Information Element id. 2.2 | Field Length 2.2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise Number 2.2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1| Information Element id. 2.M | Field Length 2.M |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise Number 2.M |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Padding (opt) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure L: Template Set Example
Information Element id.s 1.2 and 2.1 appear in [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>]
(Enterprise bit = 0) and therefore do not need an Enterprise Number
to identify them.
<span class="grey">Claise, et al. Standards Track [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h4"><a class="selflink" id="section-3.4.2" href="#section-3.4.2">3.4.2</a>. Options Template Record Format</span>
Thanks to the notion of scope, The Options Template Record gives the
Exporter the ability to provide additional information to the
Collector that would not be possible with Flow Records alone.
See <a href="#section-4">Section 4</a> for specific Options Templates used for reporting
metadata about IPFIX Exporting and Metering Processes.
<span class="h5"><a class="selflink" id="section-3.4.2.1" href="#section-3.4.2.1">3.4.2.1</a>. Scope</span>
The scope, which is only available in the Options Template Set, gives
the context of the reported Information Elements in the Data Records.
The scope is one or more Information Elements, specified in the
Options Template Record. At a minimum, Collecting Processes SHOULD
support as scope the observationDomainId, exportingProcessId,
meteringProcessId, templateId, lineCardId, exporterIPv4Address,
exporterIPv6Address, and ingressInterface Information Elements. The
IPFIX protocol doesn't prevent the use of any Information Elements
for scope. However, some Information Element types don't make sense
if specified as scope (for example, the counter Information
Elements).
The IPFIX Message Header already contains the Observation Domain ID.
If not zero, this Observation Domain ID can be considered as an
implicit scope for the Data Records in the IPFIX Message.
Multiple Scope Fields MAY be present in the Options Template Record,
in which case the composite scope is the combination of the scopes.
For example, if the two scopes are meteringProcessId and templateId,
the combined scope is this Template for this Metering Process. If a
different order of Scope Fields would result in a Record having a
different semantic meaning, then the order of Scope Fields MUST be
preserved by the Exporting Process. For example, in the context of
PSAMP [<a href="./rfc5476" title=""Packet Sampling (PSAMP) Protocol Specifications"">RFC5476</a>], if the first scope defines the filtering function,
while the second scope defines the sampling function, the order of
the scope is important. Applying the sampling function first,
followed by the filtering function, would lead to potentially
different Data Records than applying the filtering function first,
followed by the sampling function.
<span class="grey">Claise, et al. Standards Track [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h5"><a class="selflink" id="section-3.4.2.2" href="#section-3.4.2.2">3.4.2.2</a>. Options Template Record Format</span>
An Options Template Record contains any combination of IANA-assigned
and/or enterprise-specific Information Element identifiers.
The format of the Options Template Record is shown in Figure M. It
consists of an Options Template Record Header and one or more Field
Specifiers. Field Specifiers are defined in Figure G above.
+--------------------------------------------------+
| Options Template Record Header |
+--------------------------------------------------+
| Field Specifier |
+--------------------------------------------------+
| Field Specifier |
+--------------------------------------------------+
...
+--------------------------------------------------+
| Field Specifier |
+--------------------------------------------------+
Figure M: Options Template Record Format
The format of the Options Template Record Header is shown in
Figure N.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID (> 255) | Field Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope Field Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure N: Options Template Record Header Format
<span class="grey">Claise, et al. Standards Track [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The Options Template Record Header Field definitions are as follows:
Template ID
Each Options Template Record is given a unique Template ID in the
range 256 to 65535. This uniqueness is local to the Transport
Session and Observation Domain that generated the Template ID.
Since Template IDs are used as Set IDs in the sets they describe
(see <a href="#section-3.4.3">Section 3.4.3</a>), values 0-255 are reserved for special Set
types (e.g., Template Sets themselves), and Templates and Options
Templates cannot share Template IDs within a Transport Session and
Observation Domain. There are no constraints regarding the order
of the Template ID allocation. As Exporting Processes are free to
allocate Template IDs as they see fit, Collecting Processes MUST
NOT assume incremental Template IDs, or anything about the
contents of an Options Template based on its Template ID alone.
Field Count
Number of all fields in this Options Template Record, including
the Scope Fields.
Scope Field Count
Number of scope fields in this Options Template Record. The Scope
Fields are normal Fields, except that they are interpreted as
scope at the Collector. A scope field count of N specifies that
the first N Field Specifiers in the Template Record are Scope
Fields. The Scope Field Count MUST NOT be zero.
<span class="grey">Claise, et al. Standards Track [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The example in Figure O shows an Options Template Set with mixed
IANA-assigned and enterprise-specific Information Elements. It
consists of a Set Header, an Options Template Header, and several
Field Specifiers.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 3 | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID = 258 | Field Count = N + M |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope Field Count = N |0| Scope 1 Infor. Element id. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope 1 Field Length |0| Scope 2 Infor. Element id. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope 2 Field Length | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |1| Scope N Infor. Element id. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope N Field Length | Scope N Enterprise Number ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... Scope N Enterprise Number |1| Option 1 Infor. Element id. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option 1 Field Length | Option 1 Enterprise Number ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... Option 1 Enterprise Number | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |0| Option M Infor. Element id. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option M Field Length | Padding (optional) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure O: Options Template Set Example
<span class="grey">Claise, et al. Standards Track [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h4"><a class="selflink" id="section-3.4.3" href="#section-3.4.3">3.4.3</a>. Data Record Format</span>
The Data Records are sent in Data Sets. The format of the Data
Record is shown in Figure P. It consists only of one or more Field
Values. The Template ID to which the Field Values belong is encoded
in the Set Header field "Set ID", i.e., "Set ID" = "Template ID".
+--------------------------------------------------+
| Field Value |
+--------------------------------------------------+
| Field Value |
+--------------------------------------------------+
...
+--------------------------------------------------+
| Field Value |
+--------------------------------------------------+
Figure P: Data Record Format
Note that Field Values do not necessarily have a length of 16 bits.
Field Values are encoded according to their data type as specified in
[<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>].
Interpretation of the Data Record format can be done only if the
Template Record corresponding to the Template ID is available at the
Collecting Process.
<span class="grey">Claise, et al. Standards Track [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The example in Figure Q shows a Data Set. It consists of a Set
Header and several Field Values.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = Template ID | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Record 1 - Field Value 1 | Record 1 - Field Value 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Record 1 - Field Value 3 | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Record 2 - Field Value 1 | Record 2 - Field Value 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Record 2 - Field Value 3 | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Record 3 - Field Value 1 | Record 3 - Field Value 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Record 3 - Field Value 3 | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... | Padding (optional) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure Q: Data Set, Containing Data Records
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Specific Reporting Requirements</span>
Some specific Options Templates and Options Template Records are
necessary to provide extra information about the Flow Records and
about the Metering Process.
The Options Template and Options Template Records defined in these
subsections, which impose some constraints on the Metering Process
and Exporting Process implementations, MAY be implemented. If
implemented, the specific Options Templates SHOULD be implemented as
specified in these subsections.
The minimum set of Information Elements is always specified in these
Specific IPFIX Options Templates. Nevertheless, extra Information
Elements may be used in these specific Options Templates.
The Collecting Process MUST check the possible combinations of
Information Elements within the Options Template Records to correctly
interpret the following Options Templates.
<span class="grey">Claise, et al. Standards Track [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. The Metering Process Statistics Options Template</span>
The Metering Process Statistics Options Template specifies the
structure of a Data Record for reporting Metering Process statistics.
It SHOULD contain the following Information Elements, as defined in
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>]:
(scope) observationDomainId
This Information Element MUST be defined as a Scope Field and
MUST be present, unless the Observation Domain ID of the
enclosing Message is non-zero.
(scope) meteringProcessId
If present, this Information Element MUST be defined as a Scope
Field.
exportedMessageTotalCount
exportedFlowRecordTotalCount
exportedOctetTotalCount
The Exporting Process SHOULD export the Data Record specified by the
Metering Process Statistics Options Template on a regular basis or
based on some export policy. This periodicity or export policy
SHOULD be configurable.
Note that if several Metering Processes are available on the Exporter
Observation Domain, the Information Element meteringProcessId MUST be
specified as an additional Scope Field.
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. The Metering Process Reliability Statistics Options Template</span>
The Metering Process Reliability Statistics Options Template
specifies the structure of a Data Record for reporting lack of
reliability in the Metering Process. It SHOULD contain the following
Information Elements, as defined in [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>]:
(scope) observationDomainId
This Information Element MUST be defined as a Scope Field and
MUST be present, unless the Observation Domain ID of the
enclosing Message is non-zero.
<span class="grey">Claise, et al. Standards Track [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
(scope) meteringProcessId
If present, this Information Element MUST be defined as a Scope
Field.
ignoredPacketTotalCount
ignoredOctetTotalCount
time first packet ignored
The timestamp of the first packet that was ignored by the
Metering Process. For this timestamp, any of the following
timestamp Information Elements can be used:
observationTimeSeconds,
observationTimeMilliseconds,
observationTimeMicroseconds, or
observationTimeNanoseconds.
time last packet ignored
The timestamp of the last packet that was ignored by the
Metering Process. For this timestamp, any of the following
timestamp Information Elements can be used:
observationTimeSeconds,
observationTimeMilliseconds,
observationTimeMicroseconds, or
observationTimeNanoseconds.
The Exporting Process SHOULD export the Data Record specified by the
Metering Process Reliability Statistics Options Template on a regular
basis or based on some export policy. This periodicity or export
policy SHOULD be configurable.
Note that if several Metering Processes are available on the Exporter
Observation Domain, the Information Element meteringProcessId MUST be
specified as an additional Scope Field.
Since the Metering Process Reliability Statistics Options Template
contains two identical timestamp Information Elements, and since the
order of the Information Elements in the Template Records is not
guaranteed, the Collecting Process interprets the time interval of
ignored packets as the range between the two values; see <a href="#section-5.2">Section 5.2</a>
for wraparound considerations.
<span class="grey">Claise, et al. Standards Track [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a>. The Exporting Process Reliability Statistics Options Template</span>
The Exporting Process Reliability Statistics Options Template
specifies the structure of a Data Record for reporting lack of
reliability in the Exporting Process. It SHOULD contain the
following Information Elements, as defined in [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>]:
(scope) Exporting Process Identifier
The identifier of the Exporting Process for which reliability
is reported. Any of the exporterIPv4Address,
exporterIPv6Address, or exportingProcessId Information Elements
can be used for this field. This Information Element MUST be
defined as a Scope Field.
notSentFlowTotalCount
notSentPacketTotalCount
notSentOctetTotalCount
time first flow dropped
The time at which the first Flow Record was dropped by the
Exporting Process. For this timestamp, any of the following
timestamp Information Elements can be used:
observationTimeSeconds,
observationTimeMilliseconds,
observationTimeMicroseconds, or
observationTimeNanoseconds.
time last flow dropped
The time at which the last Flow Record was dropped by the
Exporting Process. For this timestamp, any of the following
timestamp Information Elements can be used:
observationTimeSeconds,
observationTimeMilliseconds,
observationTimeMicroseconds, or
observationTimeNanoseconds.
The Exporting Process SHOULD export the Data Record specified by the
Exporting Process Reliability Statistics Options Template on a
regular basis or based on some export policy. This periodicity or
export policy SHOULD be configurable.
<span class="grey">Claise, et al. Standards Track [Page 31]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Since the Exporting Process Reliability Statistics Options Template
contains two identical timestamp Information Elements, and since the
order of the Information Elements in the Template Records is not
guaranteed, the Collecting Process interprets the time interval of
dropped packets as the range between the two values; see <a href="#section-5.2">Section 5.2</a>
for wraparound considerations.
<span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a>. The Flow Keys Options Template</span>
The Flow Keys Options Template specifies the structure of a Data
Record for reporting the Flow Keys of reported Flows. A Flow Keys
Data Record extends a particular Template Record that is referenced
by its templateId. The Template Record is extended by specifying
which of the Information Elements contained in the corresponding Data
Records describe Flow properties that serve as Flow Keys of the
reported Flow.
The Flow Keys Options Template SHOULD contain the following
Information Elements, as defined in [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>]:
(scope) templateId
This Information Element MUST be defined as a Scope Field.
flowKeyIndicator
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Timing Considerations</span>
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. IPFIX Message Header Export Time and Flow Record Time</span>
The IPFIX Message Header Export Time field is the time at which the
IPFIX Message Header leaves the Exporter, using the same encoding as
the dateTimeSeconds abstract data type [<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>], i.e., expressed in
seconds since the UNIX epoch, 1 January 1970 at 00:00 UTC, encoded as
an unsigned 32-bit integer.
Certain time-related Information Elements may be expressed as an
offset from this Export Time. For example, Data Records requiring a
microsecond precision can export the flow start and end times with
the flowStartMicroseconds and flowEndMicroseconds Information
Elements, which encode the absolute time in microseconds in terms of
the NTP epoch, 1 January 1900 at 00:00 UTC, in a 64-bit field. An
alternate solution is to export the flowStartDeltaMicroseconds and
flowEndDeltaMicroseconds Information Elements in the Data Record,
which respectively report the flow start and end time as negative
offsets from the Export Time, as an unsigned 32-bit integer. This
latter solution lowers the export bandwidth requirement, saving
four bytes per timestamp, while increasing the load on the Exporter,
<span class="grey">Claise, et al. Standards Track [Page 32]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
as the Exporting Process must calculate the
flowStartDeltaMicroseconds and flowEndDeltaMicroseconds of every
single Data Record before exporting the IPFIX Message.
It must be noted that timestamps based on the Export Time impose some
time constraints on the Data Records contained within the IPFIX
Message. In the example of flowStartDeltaMicroseconds and
flowEndDeltaMicroseconds Information Elements, the Data Record can
only contain records with timestamps within 71 minutes of the Export
Time. Otherwise, the 32-bit counter would not be sufficient to
contain the flow start time offset.
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. Supporting Timestamp Wraparound</span>
The dateTimeSeconds abstract data type [<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>] and the Export Time
Message Header field (<a href="#section-3.1">Section 3.1</a>) are encoded as 32-bit unsigned
integers, expressed as seconds since the UNIX epoch, 1 January 1970
at 00:00 UTC, as defined in [<a href="#ref-POSIX.1" title=""IEEE Standard for Information Technology - Portable Operating System Interface (POSIX(R))"">POSIX.1</a>]. These values will wrap around
on 7 February 2106 at 06:28:16 UTC.
In order to support continued use of the IPFIX protocol beyond this
date, Exporting Processes SHOULD export dateTimeSeconds values and
the Export Time Message Header field as the number of seconds since
the UNIX epoch, 1 January 1970 at 00:00 UTC, modulo 2^32. Collecting
Processes SHOULD use the current date, or other contextual
information, to properly interpret dateTimeSeconds values and the
Export Time Message Header field.
There are similar considerations for the NTP-based
dateTimeMicroseconds and dateTimeNanoseconds abstract data types
[<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>]. Exporting Processes SHOULD export dateTimeMicroseconds
and dateTimeNanoseconds values as if the NTP era [<a href="./rfc5905" title=""Network Time Protocol Version 4: Protocol and Algorithms Specification"">RFC5905</a>] is
implicit; Collecting Processes SHOULD use the current date, or other
contextual information, to determine the NTP era in order to properly
interpret dateTimeMicroseconds and dateTimeNanoseconds values in
received Data Records.
The dateTimeMilliseconds abstract data type will wrap around in
approximately 500 billion years; the specification of the behavior of
this abstract data type after that time is left as a subject of a
future revision of this specification.
The long-term storage of files [<a href="./rfc5655" title=""Specification of the IP Flow Information Export (IPFIX) File Format"">RFC5655</a>] for archival purposes is
affected by timestamp wraparound, as the use of the current date to
interpret timestamp values in files stored on the order of multiple
decades in the past may lead to incorrect values; therefore, it is
RECOMMENDED that such files be stored with contextual information to
assist in the interpretation of these timestamps.
<span class="grey">Claise, et al. Standards Track [Page 33]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Linkage with the Information Model</span>
As with values in the IPFIX Message Header and Set Header, values of
all Information Elements [<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>], except for those of the string
and octetArray data types, are encoded in canonical format in network
byte order (also known as big-endian byte ordering).
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. Encoding of IPFIX Data Types</span>
The following sections define the encoding of the data types
specified in [<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>].
<span class="h4"><a class="selflink" id="section-6.1.1" href="#section-6.1.1">6.1.1</a>. Integral Data Types</span>
Integral data types -- unsigned8, unsigned16, unsigned32, unsigned64,
signed8, signed16, signed32, and signed64 -- MUST be encoded using
the default canonical format in network byte order. Signed integral
data types are represented in two's complement notation.
<span class="h4"><a class="selflink" id="section-6.1.2" href="#section-6.1.2">6.1.2</a>. Address Types</span>
Address types -- macAddress, ipv4Address, and ipv6Address -- MUST be
encoded the same way as the integral data types, as six, four, and
sixteen octets in network byte order, respectively.
<span class="h4"><a class="selflink" id="section-6.1.3" href="#section-6.1.3">6.1.3</a>. float32</span>
The float32 data type MUST be encoded as an IEEE binary32 floating
point type as specified in [<a href="#ref-IEEE.754.2008">IEEE.754.2008</a>], in network byte order as
specified in <a href="./rfc1014#section-3.6">Section 3.6 of [RFC1014]</a>. Note that on little-endian
machines, byte swapping of the native representation is necessary
before export. Note that the method for doing this may be
implementation platform dependent.
<span class="h4"><a class="selflink" id="section-6.1.4" href="#section-6.1.4">6.1.4</a>. float64</span>
The float64 data type MUST be encoded as an IEEE binary64 floating
point type as specified in [<a href="#ref-IEEE.754.2008">IEEE.754.2008</a>], in network byte order as
specified in <a href="./rfc1014#section-3.7">Section 3.7 of [RFC1014]</a>. Note that on little-endian
machines, byte swapping of the native representation is necessary
before export. Note that the method for doing this may be
implementation platform dependent.
<span class="grey">Claise, et al. Standards Track [Page 34]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h4"><a class="selflink" id="section-6.1.5" href="#section-6.1.5">6.1.5</a>. boolean</span>
The boolean data type is specified according to the TruthValue in
[<a href="./rfc2579" title=""Textual Conventions for SMIv2"">RFC2579</a>]. It is encoded as a single-octet integer per
<a href="#section-6.1.1">Section 6.1.1</a>, with the value 1 for true and value 2 for false.
Every other value is undefined.
<span class="h4"><a class="selflink" id="section-6.1.6" href="#section-6.1.6">6.1.6</a>. string and octetArray</span>
The "string" data type represents a finite-length string of valid
characters of the Unicode character encoding set. The string data
type MUST be encoded in UTF-8 [<a href="./rfc3629" title=""UTF-8, a transformation format of ISO 10646"">RFC3629</a>] format. The string is sent
as an array of zero or more octets using an Information Element of
fixed or variable length. IPFIX Exporting Processes MUST NOT send
IPFIX Messages containing ill-formed UTF-8 string values for
Information Elements of the string data type; Collecting Processes
SHOULD detect and ignore such values. See [<a href="#ref-UTF8-EXPLOIT">UTF8-EXPLOIT</a>] for
background on this issue.
The octetArray data type has no encoding rules; it represents a raw
array of zero or more octets, with the interpretation of the octets
defined in the Information Element definition.
<span class="h4"><a class="selflink" id="section-6.1.7" href="#section-6.1.7">6.1.7</a>. dateTimeSeconds</span>
The dateTimeSeconds data type is an unsigned 32-bit integer in
network byte order containing the number of seconds since the UNIX
epoch, 1 January 1970 at 00:00 UTC, as defined in [<a href="#ref-POSIX.1" title=""IEEE Standard for Information Technology - Portable Operating System Interface (POSIX(R))"">POSIX.1</a>].
dateTimeSeconds is encoded identically to the IPFIX Message Header
Export Time field. It can represent dates between 1 January 1970 and
7 February 2106 without wraparound; see <a href="#section-5.2">Section 5.2</a> for wraparound
considerations.
<span class="h4"><a class="selflink" id="section-6.1.8" href="#section-6.1.8">6.1.8</a>. dateTimeMilliseconds</span>
The dateTimeMilliseconds data type is an unsigned 64-bit integer in
network byte order containing the number of milliseconds since the
UNIX epoch, 1 January 1970 at 00:00 UTC, as defined in [<a href="#ref-POSIX.1" title=""IEEE Standard for Information Technology - Portable Operating System Interface (POSIX(R))"">POSIX.1</a>]. It
can represent dates beginning on 1 January 1970 and for approximately
the next 500 billion years without wraparound.
<span class="h4"><a class="selflink" id="section-6.1.9" href="#section-6.1.9">6.1.9</a>. dateTimeMicroseconds</span>
The dateTimeMicroseconds data type is a 64-bit field encoded
according to the NTP Timestamp format as defined in <a href="./rfc5905#section-6">Section 6 of
[RFC5905]</a>. This field is made up of two unsigned 32-bit integers in
network byte order: Seconds and Fraction. The Seconds field is the
number of seconds since the NTP epoch, 1 January 1900 at 00:00 UTC.
<span class="grey">Claise, et al. Standards Track [Page 35]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The Fraction field is the fractional number of seconds in units of
1/(2^32) seconds (approximately 233 picoseconds). It can represent
dates between 1 January 1900 and 8 February 2036 in the current
NTP era; see <a href="#section-5.2">Section 5.2</a> for wraparound considerations.
Note that dateTimeMicroseconds and dateTimeNanoseconds share an
identical encoding. The dateTimeMicroseconds data type is intended
only to represent timestamps of microsecond precision. Therefore,
the bottom 11 bits of the Fraction field SHOULD be zero and MUST
be ignored for all Information Elements of this data type
(as 2^11 x 233 picoseconds = .477 microseconds).
<span class="h4"><a class="selflink" id="section-6.1.10" href="#section-6.1.10">6.1.10</a>. dateTimeNanoseconds</span>
The dateTimeNanoseconds data type is a 64-bit field encoded according
to the NTP Timestamp format as defined in <a href="./rfc5905#section-6">Section 6 of [RFC5905]</a>.
This field is made up of two unsigned 32-bit integers in network byte
order: Seconds and Fraction. The Seconds field is the number of
seconds since the NTP epoch, 1 January 1900 at 00:00 UTC. The
Fraction field is the fractional number of seconds in units of
1/(2^32) seconds (approximately 233 picoseconds). It can represent
dates between 1 January 1900 and 8 February 2036 in the current
NTP era; see <a href="#section-5.2">Section 5.2</a> for wraparound considerations.
Note that dateTimeMicroseconds and dateTimeNanoseconds share an
identical encoding. There is no restriction on the interpretation of
the Fraction field for the dateTimeNanoseconds data type.
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a>. Reduced-Size Encoding</span>
Information Elements encoded as signed, unsigned, or float data types
MAY be encoded using fewer octets than those implied by their type in
the information model definition, based on the assumption that the
smaller size is sufficient to carry any value the Exporter may need
to deliver. This reduces the network bandwidth requirement between
the Exporter and the Collector. Note that the Information Element
definitions [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>] always define the maximum encoding size.
For instance, the information model defines octetDeltaCount as an
unsigned64 type, which would require 64 bits. However, if the
Exporter will never locally encounter the need to send a value larger
than 4294967295, it may choose to send the value as unsigned32
instead.
This behavior is indicated by the Exporter by specifying a size in
the Template with a smaller length than that associated with the
assigned type of the Information Element. In the example above, the
Exporter would place a length of 4 versus 8 in the Template.
<span class="grey">Claise, et al. Standards Track [Page 36]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Reduced-size encoding MAY be applied to the following integer types:
unsigned64, signed64, unsigned32, signed32, unsigned16, and signed16.
The signed versus unsigned property of the reported value MUST be
preserved. The reduction in size can be to any number of octets
smaller than the original type if the data value still fits, i.e., so
that only leading zeroes are dropped. For example, an unsigned64 can
be reduced in size to 7, 6, 5, 4, 3, 2, or 1 octet(s).
Reduced-size encoding MAY be used to reduce float64 to float32. The
float32 not only has a reduced number range but, due to the smaller
mantissa, is also less precise. In this case, the float64 would be
reduced in size to 4 octets.
Reduced-size encoding MUST NOT be applied to any other data type
defined in [<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>] that implies a fixed length, as these types
either have internal structure (such as ipv4Address or
dateTimeMicroseconds) or restricted ranges that are not suitable for
reduced-size encoding (such as dateTimeMilliseconds).
Information Elements of type octetArray and string may be exported
using any length, subject to restrictions on length specific to each
Information Element, as noted in that Information Element's
description.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Variable-Length Information Element</span>
The IPFIX Template mechanism is optimized for fixed-length
Information Elements [<a href="./rfc7012" title=""Information Model for IP Flow Information Export (IPFIX)"">RFC7012</a>]. Where an Information Element has a
variable length, the following mechanism MUST be used to carry the
length information for both the IANA-assigned and enterprise-specific
Information Elements.
In the Template Set, the Information Element Field Length is recorded
as 65535. This reserved length value notifies the Collecting Process
that the length value of the Information Element will be carried in
the Information Element content itself.
<span class="grey">Claise, et al. Standards Track [Page 37]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
In most cases, the length of the Information Element will be less
than 255 octets. The following length-encoding mechanism optimizes
the overhead of carrying the Information Element length in this more
common case. The length is carried in the octet before the
Information Element, as shown in Figure R.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Length (< 255)| Information Element |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... continuing as needed |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure R: Variable-Length Information Element (IE)
(Length < 255 Octets)
The length may also be encoded into 3 octets before the Information
Element, allowing the length of the Information Element to be greater
than or equal to 255 octets. In this case, the first octet of the
Length field MUST be 255, and the length is carried in the second and
third octets, as shown in Figure S.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 255 | Length (0 to 65535) | IE |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... continuing as needed |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure S: Variable-Length Information Element (IE)
(Length 0 to 65535 Octets)
The octets carrying the length (either the first or the first
three octets) MUST NOT be included in the length of the Information
Element.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Template Management</span>
This section describes the management of Templates and Options
Templates at the Exporting and Collecting Processes. The goal of
Template management is to ensure, to the extent possible, that the
Exporting Process and Collecting Process have a consistent view of
the Templates and Options Templates used to encode and decode the
Records sent from the Exporting Process to the Collecting Process.
<span class="grey">Claise, et al. Standards Track [Page 38]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Achieving this goal is complicated somewhat by two factors: 1) the
need to support the reuse of Template IDs within a Transport Session
and 2) the need to support unreliable transmission for Templates when
UDP is used as the transport protocol for IPFIX Messages.
The Template Management mechanisms defined in this section apply to
the export of IPFIX Messages on SCTP, TCP, or UDP. Additional
considerations specific to SCTP and UDP transport are given in
Sections <a href="#section-8.3">8.3</a> and <a href="#section-8.4">8.4</a>, respectively.
The Exporting Process assigns and maintains Template IDs per
Transport Session and Observation Domain. A newly created Template
Record is assigned an unused Template ID by the Exporting Process.
The Collecting Process MUST store all received Template Record
information for the duration of each Transport Session until reuse or
withdrawal as described in <a href="#section-8.1">Section 8.1</a>, or expiry over UDP as
described in <a href="#section-8.4">Section 8.4</a>, so that it can interpret the corresponding
Data Records.
The Collecting Process MUST NOT assume that the Template IDs from a
given Exporting Process refer to the same Templates as they did in
previous Transport Sessions from the same Exporting Process; a
Collecting Process MUST NOT use Templates from one Transport Session
to decode Data Sets in a subsequent Transport Session.
If a specific Information Element is required by a Template but is
not present in observed packets, the Exporting Process MAY choose to
export Flow Records without this Information Element in a Data Record
described by a new Template.
If an Information Element is required more than once in a Template,
the different occurrences of this Information Element SHOULD follow
the logical order of their treatments by the Metering Process. For
example, if a selected packet goes through two hash functions, and if
the two hash values are sent within a single Template, the first
occurrence of the hash value should belong to the first hash function
in the Metering Process. For example, when exporting the two source
IP addresses of an IPv4-in-IPv4 packet, the first sourceIPv4Address
Information Element occurrence should be the IPv4 address of the
outer header, while the second occurrence should be the address of
the inner header. Collecting Processes MUST properly handle
Templates with multiple identical Information Elements.
The Exporting Process SHOULD transmit the Template Set and Options
Template Set in advance of any Data Sets that use that (Options)
Template ID, to help ensure that the Collector has the Template
Record before receiving the first Data Record. Data Records that
correspond to a Template Record MAY appear in the same and/or
<span class="grey">Claise, et al. Standards Track [Page 39]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
subsequent IPFIX Message(s). However, a Collecting Process MUST NOT
assume that the Data Set and the associated Template Set (or Options
Template Set) are exported in the same IPFIX Message.
Though a Collecting Process normally receives Template Records from
the Exporting Process before receiving Data Records, this is not
always the case, e.g., in the case of reordering or Collecting
Process restart over UDP. In these cases, the Collecting Process MAY
buffer Data Records for which it has no Templates, to wait for
Template Records describing them; however, note that in the presence
of Template withdrawal and redefinition (<a href="#section-8.1">Section 8.1</a>) this may lead
to incorrect interpretation of Data Records.
Different Observation Domains within a Transport Session MAY use the
same Template ID value to refer to different Templates; Collecting
Processes MUST properly handle this case.
Options Templates and Templates that are related or interdependent
(e.g., by sharing common properties as described in [<a href="./rfc5473" title=""Reducing Redundancy in IP Flow Information Export (IPFIX) and Packet Sampling (PSAMP) Reports"">RFC5473</a>]) SHOULD
be sent together in the same IPFIX Message.
<span class="h3"><a class="selflink" id="section-8.1" href="#section-8.1">8.1</a>. Template Withdrawal and Redefinition</span>
Templates that will not be used further by an Exporting Process MAY
be withdrawn by sending a Template Withdrawal. After receiving a
Template Withdrawal, a Collecting Process MUST stop using the
Template to interpret subsequently exported Data Sets. Note that
this mechanism does not apply when UDP is used to transport IPFIX
Messages; for that case, see <a href="#section-8.4">Section 8.4</a>.
A Template Withdrawal consists of a Template Record for the Template
ID to be withdrawn, with a Field Count of 0. The format of a
Template Withdrawal is shown in Figure T.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = (2 or 3) | Length = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID N | Field Count = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID ... | Field Count = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID M | Field Count = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure T: Template Withdrawal Format
<span class="grey">Claise, et al. Standards Track [Page 40]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The Set ID field MUST contain the value 2 for Template Set Withdrawal
or the value 3 for Options Template Set Withdrawal. Multiple
Template IDs MAY be withdrawn with a single Template Withdrawal; in
that case, padding MAY be used.
Template Withdrawals MAY appear interleaved with Template Sets,
Options Template Sets, and Data Sets within an IPFIX Message. In
this case, the Templates and Template Withdrawals shall be
interpreted as taking effect in the order in which they appear in the
IPFIX Message. An Exporting Process SHOULD NOT send a Template
Withdrawal until sufficient time has elapsed to allow receipt and
processing of any Data Records described by the withdrawn Templates;
see <a href="#section-8.2">Section 8.2</a> for details regarding the sequencing of Template
management actions.
The end of a Transport Session implicitly withdraws all the Templates
used within the Transport Session, and Templates must be resent
during subsequent Transport Sessions between an Exporting Process and
Collecting Process. This applies to SCTP and TCP only; see
Sections <a href="#section-8.4">8.4</a> and <a href="#section-10.3.4">10.3.4</a> for discussions of Transport Session and
Template lifetime over UDP.
All Templates for a given Observation Domain MAY also be withdrawn
using an All Templates Withdrawal, as shown in Figure U. All Options
Templates for a given Observation Domain MAY likewise be withdrawn
using an All Options Templates Withdrawal, as shown in Figure V.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 2 | Length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID = 2 | Field Count = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure U: All Templates Withdrawal Set Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 3 | Length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID = 3 | Field Count = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure V: All Options Templates Withdrawal Set Format
<span class="grey">Claise, et al. Standards Track [Page 41]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-42" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Template IDs MAY be reused for new Templates by sending a new
Template Record or Options Template Record for a given Template ID
after withdrawing the Template.
If a Collecting Process receives a Template Withdrawal for a Template
or Options Template it does not presently have stored, this indicates
a malfunctioning or improperly implemented Exporting Process. The
continued receipt and interpretation of Data Records are still
possible, but the Collecting Process MUST ignore the Template
Withdrawal and SHOULD log the error.
If a Collecting Process receives a new Template Record or Options
Template Record for an already-allocated Template ID, and that
Template or Options Template is identical to the already-received
Template or Options Template, it SHOULD log the retransmission;
however, this is not an error condition, as it does not affect the
interpretation of Data Records.
If a Collecting Process receives a new Template Record or Options
Template Record for an already-allocated Template ID, and that
Template or Options Template is different from the already-received
Template or Options Template, this indicates a malfunctioning or
improperly implemented Exporting Process. The continued receipt and
unambiguous interpretation of Data Records for this Template ID are
no longer possible, and the Collecting Process SHOULD log the error.
Further Collecting Process actions are out of scope for this
specification.
<span class="h3"><a class="selflink" id="section-8.2" href="#section-8.2">8.2</a>. Sequencing Template Management Actions</span>
Since there is no guarantee of the ordering of exported IPFIX
Messages across SCTP Streams or over UDP, an Exporting Process MUST
sequence all Template management actions (i.e., Template Records
defining new Templates and Template Withdrawals withdrawing them)
using the Export Time field in the IPFIX Message Header.
An Exporting Process MUST NOT export a Data Set described by a new
Template in an IPFIX Message with an Export Time before the Export
Time of the IPFIX Message containing that Template. If a new
Template and a Data Set described by it appear in the same IPFIX
Message, the Template Set containing the Template MUST appear before
the Data Set in the Message.
An Exporting Process MUST NOT export any Data Sets described by a
withdrawn Template in IPFIX Messages with an Export Time after the
Export Time of the IPFIX Message containing the Template Withdrawal
withdrawing that Template.
<span class="grey">Claise, et al. Standards Track [Page 42]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-43" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Put another way, a Template describes Data Records contained in IPFIX
Messages when the Export Time of such messages is between a specific
start and end time, inclusive. The start time is the Export Time of
the IPFIX Message containing the Template Record. The end time is
one of two times: if the template is withdrawn during the session,
then it is the Export Time of the IPFIX Message containing the
Template Withdrawal for the template; otherwise, it is the end of the
Transport Session.
Even if sent in order, IPFIX Messages containing Template management
actions could arrive at the Collecting Process out of order, i.e., if
sent via UDP or via different SCTP Streams. Given this, Template
Withdrawals and subsequent reuse of Template IDs can significantly
complicate the problem of determining Template lifetimes at the
Collecting Process. A Collecting Process MAY implement a buffer and
use Export Time information to disambiguate the order of Template
management actions. This buffer, if implemented, SHOULD be
configurable to impart a delay on the order of the maximum reordering
delay experienced at the Collecting Process. Note, in this case,
that the Collecting Process's clock is irrelevant: it is only
comparing the Export Times of Messages to each other.
<span class="h3"><a class="selflink" id="section-8.3" href="#section-8.3">8.3</a>. Additional Considerations for Template Management over SCTP</span>
The specifications in this section apply only to SCTP; in cases of
contradiction with specifications in <a href="#section-8">Section 8</a> or <a href="#section-8.1">Section 8.1</a>, this
section takes precedence.
Template Sets and Options Template Sets MAY be sent on any SCTP
Stream. Data Sets sent on a given SCTP Stream MAY be represented by
Template Records exported on any SCTP Stream.
Template Sets and Options Template Sets MUST be sent reliably, using
SCTP ordered delivery.
Template Withdrawals MAY be sent on any SCTP Stream. Template
Withdrawals MUST be sent reliably, using SCTP ordered delivery.
Template IDs MAY be reused by sending a Template Withdrawal and/or a
new Template Record on a different SCTP Stream than the stream on
which the original Template was sent.
Additional Template Management considerations are provided in
[<a href="./rfc6526" title=""IP Flow Information Export (IPFIX) Per Stream Control Transmission Protocol (SCTP) Stream"">RFC6526</a>], which specifies an extension to explicitly link Templates
with SCTP Streams. In exchange for more restrictive rules on the
assignment of Template Records to SCTP Streams, this extension allows
fast, reliable reuse of Template IDs and estimation of Data Record
loss per Template.
<span class="grey">Claise, et al. Standards Track [Page 43]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-44" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-8.4" href="#section-8.4">8.4</a>. Additional Considerations for Template Management over UDP</span>
The specifications in this section apply only to UDP; in cases of
contradiction with specifications in <a href="#section-8">Section 8</a> or <a href="#section-8.1">Section 8.1</a>, this
section takes precedence.
Since UDP provides no method for reliable transmission of Templates,
Exporting Processes using UDP as the transport protocol MUST
periodically retransmit each active Template at regular intervals.
The Template retransmission interval MUST be configurable via, for
example, the templateRefreshTimeout and optionsTemplateRefreshTimeout
parameters as defined in [<a href="./rfc6728" title=""Configuration Data Model for the IP Flow Information Export (IPFIX) and Packet Sampling (PSAMP) Protocols"">RFC6728</a>]. Default settings for these
values are deployment- and application-specific.
Before exporting any Data Records described by a given Template
Record or Options Template Record, especially in the case of Template
ID reuse as described in <a href="#section-8.1">Section 8.1</a>, the Exporting Process SHOULD
send multiple copies of the Template Record in a separate IPFIX
Message, in order to help ensure that the Collecting Process has
received it.
In order to minimize resource requirements for Templates that are no
longer being used by the Exporting Process, the Collecting Process
MAY associate a lifetime with each Template received in a Transport
Session. Templates not refreshed by the Exporting Process within the
lifetime can then be discarded by the Collecting Process. The
Template lifetime at the Collecting Process MAY be exposed by a
configuration parameter or MAY be derived from observation of the
interval of periodic Template retransmissions from the Exporting
Process. In this latter case, the Template lifetime SHOULD default
to at least 3 times the observed retransmission rate.
Template Withdrawals (<a href="#section-8.1">Section 8.1</a>) MUST NOT be sent by Exporting
Processes exporting via UDP and MUST be ignored by Collecting
Processes collecting via UDP. Template IDs MAY be reused by
Exporting Processes by exporting a new Template for the Template ID
after waiting at least 3 times the retransmission delay. Note that
Template ID reuse may lead to incorrect interpretation of Data
Records if the retransmission and lifetime are not properly
configured.
When a Collecting Process receives a new Template Record or Options
Template Record via UDP for an already-allocated Template ID, and
that Template or Options Template is identical to the already-
received Template or Options Template, it SHOULD NOT log the
retransmission, as this is the normal operation of Template refresh
over UDP.
<span class="grey">Claise, et al. Standards Track [Page 44]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-45" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
When a Collecting Process receives a new Template Record or Options
Template Record for an already-allocated Template ID, and that
Template or Options Template is different from the already-received
Template or Options Template, the Collecting Process MUST replace the
Template or Options Template for that Template ID with the newly
received Template or Options Template. This is the normal operation
of Template ID reuse over UDP.
As Template IDs are unique per UDP session and per Observation
Domain, at any given time, the Collecting Process SHOULD maintain the
following for all the current Template Records and Options Template
Records: <IPFIX Device, Exporter source UDP port, Collector IP
address, Collector destination UDP port, Observation Domain ID,
Template ID, Template Definition, Last Received>.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. The Collecting Process's Side</span>
This section describes the handling of the IPFIX protocol at the
Collecting Process common to all transport protocols. Additional
considerations for SCTP and UDP are provided in Sections <a href="#section-9.2">9.2</a> and <a href="#section-9.3">9.3</a>,
respectively. Template management at Collecting Processes is covered
in <a href="#section-8">Section 8</a>.
The Collecting Process MUST listen for association requests /
connections to start new Transport Sessions from the Exporting
Process.
The Collecting Process MUST note the Information Element identifier
of any Information Element that it does not understand and MAY
discard that Information Element from received Data Records.
The Collecting Process MUST accept padding in Data Records and
Template Records. The padding size is the Set Length minus the size
of the Set Header (4 octets for the Set ID and the Set Length),
modulo the minimum Record size deduced from the Template Record.
The IPFIX protocol has a Sequence Number field in the Export header
that increases with the number of IPFIX Data Records in the IPFIX
Message. A Collector can detect out-of-sequence, dropped, or
duplicate IPFIX Messages by tracking the Sequence Number. A
Collector SHOULD provide a logging mechanism for tracking out-of-
sequence IPFIX Messages. Such out-of-sequence IPFIX Messages may be
due to Exporter resource exhaustion where it cannot transmit messages
at their creation rate, an Exporting Process reset, congestion on the
network link between the Exporter and Collector, Collector resource
exhaustion where it cannot process the IPFIX Messages at their
arrival rate, out-of-order packet reception, duplicate packet
reception, or an attacker injecting false messages.
<span class="grey">Claise, et al. Standards Track [Page 45]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-46" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-9.1" href="#section-9.1">9.1</a>. Collecting Process Handling of Malformed IPFIX Messages</span>
If the Collecting Process receives a malformed IPFIX Message, it MUST
discard the IPFIX Message and SHOULD log the error. A malformed
IPFIX Message is one that cannot be interpreted due to nonsensical
length values (e.g., a variable-length Information Element longer
than its enclosing Set, a Set longer than its enclosing IPFIX
Message, or an IPFIX Message shorter than an IPFIX Message Header) or
a reserved Version value (which may indicate that a future version of
IPFIX is being used for export but in practice occurs most often when
non-IPFIX data is sent to an IPFIX Collecting Process). Note that
non-zero Set padding does not constitute a malformed IPFIX Message.
As the most likely cause of malformed IPFIX Messages is a poorly
implemented Exporting Process, or the sending of non-IPFIX data to an
IPFIX Collecting Process, human intervention is likely necessary to
correct the issue. In the meantime, the Collecting Process MAY
attempt to rectify the situation any way it sees fit, including:
- terminating the TCP connection or SCTP connection
- using the receiver window to reduce network load from the
malfunctioning Exporting Process
- buffering and saving malformed IPFIX Message(s) to assist in
diagnosis
- attempting to resynchronize the stream, e.g., as described in
<a href="./rfc5655#section-10.3">Section 10.3 of [RFC5655]</a>
Resynchronization should only be attempted if the Collecting Process
has reason to believe that the error is transient. On the other
hand, the Collecting Process SHOULD stop processing IPFIX Messages
from clearly malfunctioning Exporting Processes (e.g., those from
which the last few IPFIX Messages have been malformed).
<span class="h3"><a class="selflink" id="section-9.2" href="#section-9.2">9.2</a>. Additional Considerations for SCTP Collecting Processes</span>
As an Exporting Process may request and support more than one stream
per SCTP association, the Collecting Process MUST support the opening
of multiple SCTP Streams.
<span class="h3"><a class="selflink" id="section-9.3" href="#section-9.3">9.3</a>. Additional Considerations for UDP Collecting Processes</span>
A Transport Session for IPFIX Messages transported over UDP is
defined from the point of view of the Exporting Process and roughly
corresponds to the time during which a given Exporting Process sends
IPFIX Messages over UDP to a given Collecting Process. Since this is
<span class="grey">Claise, et al. Standards Track [Page 46]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-47" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
difficult to detect at the Collecting Process, the Collecting Process
MAY discard all Transport Session state after no IPFIX Messages are
received from a given Exporting Process within a given Transport
Session during a configurable idle timeout.
The Collecting Process SHOULD accept Data Records without the
associated Template Record (or other definitions such as Common
Properties) required to decode the Data Record. If the Template
Records or other definitions have not been received at the time Data
Records are received, the Collecting Process MAY store the Data
Records for a short period of time and decode them after the Template
Records or other definitions are received, comparing Export Times of
IPFIX Messages containing the Template Records with those containing
the Data Records as discussed in <a href="#section-8.2">Section 8.2</a>. Note that this
mechanism may lead to incorrectly interpreted records in the presence
of Template ID reuse or other identifiers with limited lifetimes.
<span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. Transport Protocol</span>
The IPFIX Protocol Specification has been designed to be transport
protocol independent. Note that the Exporter can export to multiple
Collecting Processes using independent transport protocols.
The IPFIX Message Header 16-bit Length field limits the length of an
IPFIX Message to 65535 octets, including the header. A Collecting
Process MUST be able to handle IPFIX Message lengths of up to
65535 octets.
While an Exporting Process or Collecting Process may support multiple
transport protocols, Transport Sessions are bound to a transport
protocol. Transport Session state MUST NOT be migrated by an
Exporting Process or Collecting Process among Transport Sessions
using different transport protocols between the same Exporting
Process and Collecting Process pair. In other words, an Exporting
Process supporting multiple transport protocols is conceptually
multiple Exporting Processes, one per supported transport protocol.
Likewise, a Collecting Process supporting multiple transport
protocols is conceptually multiple Collecting Processes, one per
supported transport protocol.
<span class="h3"><a class="selflink" id="section-10.1" href="#section-10.1">10.1</a>. Transport Compliance and Transport Usage</span>
SCTP [<a href="./rfc4960" title=""Stream Control Transmission Protocol"">RFC4960</a>] using the Partially Reliable SCTP (PR-SCTP) extension
as specified in [<a href="./rfc3758" title=""Stream Control Transmission Protocol (SCTP) Partial Reliability Extension"">RFC3758</a>] MUST be implemented by all compliant
implementations. UDP [<a href="#ref-UDP" title=""User Datagram Protocol"">UDP</a>] MAY also be implemented by compliant
implementations. TCP [<a href="#ref-TCP" title=""Transmission Control Protocol"">TCP</a>] MAY also be implemented by compliant
implementations.
<span class="grey">Claise, et al. Standards Track [Page 47]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-48" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
SCTP should be used in deployments where Exporters and Collectors are
communicating over links that are susceptible to congestion. SCTP is
capable of providing any required degree of reliability when used
with the PR-SCTP extension.
TCP may be used in deployments where Exporters and Collectors
communicate over links that are susceptible to congestion, but SCTP
is preferred, due to its ability to limit back pressure on Exporters
and its message-versus-stream orientation.
UDP may be used, although it is not a congestion-aware protocol.
However, in this case the IPFIX traffic between the Exporter and
Collector must be separately contained or provisioned to minimize the
risk of congestion-related loss.
By default, the Collecting Process listens for connections on SCTP,
TCP, and/or UDP port 4739. By default, the Collecting Process
listens for secure connections on SCTP, TCP, and/or UDP port 4740
(refer to the Security Considerations section). By default, the
Exporting Process attempts to connect to one of these ports. It MUST
be possible to configure both the Exporting and Collecting Processes
to use different ports than the default.
<span class="h3"><a class="selflink" id="section-10.2" href="#section-10.2">10.2</a>. SCTP</span>
This section describes how IPFIX is transported over SCTP [<a href="./rfc4960" title=""Stream Control Transmission Protocol"">RFC4960</a>]
using the PR-SCTP [<a href="./rfc3758" title=""Stream Control Transmission Protocol (SCTP) Partial Reliability Extension"">RFC3758</a>] extension.
<span class="h4"><a class="selflink" id="section-10.2.1" href="#section-10.2.1">10.2.1</a>. Congestion Avoidance</span>
SCTP provides the required level of congestion avoidance by design.
SCTP detects congestion in the end-to-end path between the IPFIX
Exporting Process and the IPFIX Collecting Process, and limits the
transfer rate accordingly. When an IPFIX Exporting Process has
records to export but detects that transmission by SCTP is
temporarily impossible, it can either wait until sending is possible
again or decide to drop the record. In the latter case, the dropped
export data SHOULD be accounted for, so that the amount of dropped
export data can be reported using the mechanism described in
<a href="#section-4.3">Section 4.3</a>.
<span class="grey">Claise, et al. Standards Track [Page 48]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-49" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h4"><a class="selflink" id="section-10.2.2" href="#section-10.2.2">10.2.2</a>. Reliability</span>
The SCTP transport protocol is by default reliable but has the
capability to deliver messages with partial reliability [<a href="./rfc3758" title=""Stream Control Transmission Protocol (SCTP) Partial Reliability Extension"">RFC3758</a>].
Using reliable SCTP messages for IPFIX export is not in itself a
guarantee that all Data Records will be delivered. If there is
congestion on the link from the Exporting Process to the Collecting
Process, or if a significant number of retransmissions are required,
the send queues on the Exporting Process may fill up; the Exporting
Process MAY either suspend, export, or discard the IPFIX Messages.
If Data Records are discarded, the IPFIX Sequence Numbers used for
export MUST reflect the loss of data.
<span class="h4"><a class="selflink" id="section-10.2.3" href="#section-10.2.3">10.2.3</a>. MTU</span>
SCTP provides the required IPFIX Message fragmentation service based
on Path MTU (PMTU) discovery.
<span class="h4"><a class="selflink" id="section-10.2.4" href="#section-10.2.4">10.2.4</a>. Association Establishment and Shutdown</span>
The IPFIX Exporting Process initiates an SCTP association with the
IPFIX Collecting Process. The Exporting Process MAY establish more
than one association (connection "bundle" in SCTP terminology) to the
Collecting Process.
An Exporting Process MAY support more than one active association to
different Collecting Processes (including the case of different
Collecting Processes on the same host).
When an Exporting Process is shut down, it SHOULD shut down the SCTP
association.
When a Collecting Process no longer wants to receive IPFIX Messages,
it SHOULD shut down its end of the association. The Collecting
Process SHOULD continue to receive and process IPFIX Messages until
the Exporting Process has closed its end of the association.
When a Collecting Process detects that the SCTP association has been
abnormally terminated, it MUST continue to listen for a new
association establishment.
When an Exporting Process detects that the SCTP association to the
Collecting Process is abnormally terminated, it SHOULD try to
re-establish the association.
Association timeouts SHOULD be configurable.
<span class="grey">Claise, et al. Standards Track [Page 49]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-50" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h4"><a class="selflink" id="section-10.2.5" href="#section-10.2.5">10.2.5</a>. Failover</span>
If the Collecting Process does not acknowledge an attempt by the
Exporting Process to establish an association, SCTP will
automatically retry association establishment using exponential
backoff. The Exporter MAY log an alarm if the underlying SCTP
association establishment times out; this timeout should be
configurable on the Exporter.
The Exporting Process MAY open a backup SCTP association to a
Collecting Process in advance, if it supports Collecting Process
failover.
<span class="h4"><a class="selflink" id="section-10.2.6" href="#section-10.2.6">10.2.6</a>. Streams</span>
An Exporting Process MAY request more than one SCTP Stream per
association. Each of these streams may be used for the transmission
of IPFIX Messages containing Data Sets, Template Sets, and/or Options
Template Sets.
Depending on the requirements of the application, the Exporting
Process may send Data Sets with full or partial reliability, using
ordered or out-of-order delivery, over any SCTP Stream established
during SCTP association setup.
An IPFIX Exporting Process MAY use any PR-SCTP service definition as
per <a href="#section-4">Section 4</a> of the PR-SCTP specification [<a href="./rfc3758" title=""Stream Control Transmission Protocol (SCTP) Partial Reliability Extension"">RFC3758</a>] when using
partial reliability to transmit IPFIX Messages containing only
Data Sets.
However, Exporting Processes SHOULD mark such IPFIX Messages for
retransmission for as long as resource or other constraints allow.
<span class="h3"><a class="selflink" id="section-10.3" href="#section-10.3">10.3</a>. UDP</span>
This section describes how IPFIX is transported over UDP [<a href="#ref-UDP" title=""User Datagram Protocol"">UDP</a>].
<span class="h4"><a class="selflink" id="section-10.3.1" href="#section-10.3.1">10.3.1</a>. Congestion Avoidance</span>
UDP has no integral congestion-avoidance mechanism. Its use over
congestion-sensitive network paths is therefore not recommended. UDP
MAY be used in deployments where Exporters and Collectors always
communicate over dedicated links that are not susceptible to
congestion, i.e., links that are over-provisioned compared to the
maximum export rate from the Exporters.
<span class="grey">Claise, et al. Standards Track [Page 50]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-51" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h4"><a class="selflink" id="section-10.3.2" href="#section-10.3.2">10.3.2</a>. Reliability</span>
UDP is not a reliable transport protocol and cannot guarantee
delivery of messages. IPFIX Messages sent from the Exporting Process
to the Collecting Process using UDP may therefore be lost. UDP MUST
NOT be used unless the application can tolerate some loss of IPFIX
Messages.
The Collecting Process SHOULD deduce the loss and reordering of IPFIX
Data Records by looking at the discontinuities in the IPFIX Sequence
Number. In the case of UDP, the IPFIX Sequence Number contains the
total number of IPFIX Data Records sent for the Transport Session
prior to the receipt of this IPFIX Message, modulo 2^32. A Collector
SHOULD detect out-of-sequence, dropped, or duplicate IPFIX Messages
by tracking the Sequence Number.
Exporting Processes exporting IPFIX Messages via UDP MUST include a
valid UDP checksum [<a href="#ref-UDP" title=""User Datagram Protocol"">UDP</a>] in UDP datagrams including IPFIX Messages.
<span class="h4"><a class="selflink" id="section-10.3.3" href="#section-10.3.3">10.3.3</a>. MTU</span>
The maximum size of exported messages MUST be configured such that
the total packet size does not exceed the PMTU. If the PMTU is
unknown, a maximum packet size of 512 octets SHOULD be used.
<span class="h4"><a class="selflink" id="section-10.3.4" href="#section-10.3.4">10.3.4</a>. Session Establishment and Shutdown</span>
As UDP is a connectionless protocol, there is no real session
establishment or shutdown for IPFIX over UDP. An Exporting Process
starts sending IPFIX Messages to a Collecting Process at one point in
time and stops sending them at another point in time. This can lead
to some complications in Template management, as outlined in
<a href="#section-8.4">Section 8.4</a> above.
<span class="h4"><a class="selflink" id="section-10.3.5" href="#section-10.3.5">10.3.5</a>. Failover and Session Duplication</span>
Because UDP is not a connection-oriented protocol, the Exporting
Process is unable to determine from the transport protocol that the
Collecting Process is no longer able to receive the IPFIX Messages.
Therefore, it cannot invoke a failover mechanism. However, the
Exporting Process MAY duplicate the IPFIX Message to several
Collecting Processes.
<span class="grey">Claise, et al. Standards Track [Page 51]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-52" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-10.4" href="#section-10.4">10.4</a>. TCP</span>
This section describes how IPFIX is transported over TCP [<a href="#ref-TCP" title=""Transmission Control Protocol"">TCP</a>].
<span class="h4"><a class="selflink" id="section-10.4.1" href="#section-10.4.1">10.4.1</a>. Congestion Avoidance</span>
TCP controls the rate at which data can be sent from the Exporting
Process to the Collecting Process, using a mechanism that takes into
account both congestion in the network and the capabilities of the
receiver.
Therefore, an IPFIX Exporting Process may not be able to send IPFIX
Messages at the rate that the Metering Process generates them, either
because of congestion in the network or because the Collecting
Process cannot handle IPFIX Messages fast enough. As long as
congestion is transient, the Exporting Process can buffer IPFIX
Messages for transmission. But such buffering is necessarily
limited, both because of resource limitations and because of
timeliness requirements, so ongoing and/or severe congestion may lead
to a situation where the Exporting Process is blocked.
When an Exporting Process has Data Records to export but the
transmission buffer is full, and it wants to avoid blocking, it can
decide to drop some Data Records. The dropped Data Records MUST be
accounted for, so that the number of lost records can later be
reported as described in <a href="#section-4.3">Section 4.3</a>.
<span class="h4"><a class="selflink" id="section-10.4.2" href="#section-10.4.2">10.4.2</a>. Reliability</span>
TCP ensures reliable delivery of data from the Exporting Process to
the Collecting Process.
<span class="h4"><a class="selflink" id="section-10.4.3" href="#section-10.4.3">10.4.3</a>. MTU</span>
As TCP offers a stream service instead of a datagram or sequential
packet service, IPFIX Messages transported over TCP are instead
separated using the Length field in the IPFIX Message Header. The
Exporting Process can choose any valid length for exported IPFIX
Messages, as TCP handles segmentation.
Exporting Processes may choose IPFIX Message lengths lower than the
maximum in order to ensure timely export of Data Records.
<span class="grey">Claise, et al. Standards Track [Page 52]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-53" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h4"><a class="selflink" id="section-10.4.4" href="#section-10.4.4">10.4.4</a>. Connection Establishment and Shutdown</span>
The IPFIX Exporting Process initiates a TCP connection to the
Collecting Process. An Exporting Process MAY support more than one
active connection to different Collecting Processes (including the
case of different Collecting Processes on the same host). An
Exporting Process MAY support more than one active connection to the
same Collecting Process to avoid head-of-line blocking across
Observation Domains.
The Exporter MAY log an alarm if the underlying TCP connection
establishment times out; this timeout should be configurable on the
Exporter.
When an Exporting Process is shut down, it SHOULD shut down the TCP
connection.
When a Collecting Process no longer wants to receive IPFIX Messages,
it SHOULD close its end of the connection. The Collecting Process
SHOULD continue to read IPFIX Messages until the Exporting Process
has closed its end.
When a Collecting Process detects that the TCP connection to the
Exporting Process has terminated abnormally, it MUST continue to
listen for a new connection.
When an Exporting Process detects that the TCP connection to the
Collecting Process has terminated abnormally, it SHOULD try to
re-establish the connection. Connection timeouts and retry schedules
SHOULD be configurable. In the default configuration, an Exporting
Process MUST NOT attempt to establish a connection more frequently
than once per minute.
<span class="h4"><a class="selflink" id="section-10.4.5" href="#section-10.4.5">10.4.5</a>. Failover</span>
If the Collecting Process does not acknowledge an attempt by the
Exporting Process to establish a connection, TCP will automatically
retry connection establishment using exponential backoff. The
Exporter MAY log an alarm if the underlying TCP connection
establishment times out; this timeout should be configurable on the
Exporter.
The Exporting Process MAY open a backup TCP connection to a
Collecting Process in advance, if it supports Collecting Process
failover.
<span class="grey">Claise, et al. Standards Track [Page 53]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-54" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h2"><a class="selflink" id="section-11" href="#section-11">11</a>. Security Considerations</span>
The security considerations for the IPFIX protocol have been derived
from an analysis of potential security threats, as discussed in the
Security Considerations section of the IPFIX requirements document
[<a href="./rfc3917" title=""Requirements for IP Flow Information Export (IPFIX)"">RFC3917</a>]. The requirements for IPFIX security are as follows:
1. IPFIX must provide a mechanism to ensure the confidentiality of
IPFIX data transferred from an Exporting Process to a Collecting
Process, in order to prevent disclosure of Flow Records
transported via IPFIX.
2. IPFIX must provide a mechanism to ensure the integrity of IPFIX
data transferred from an Exporting Process to a Collecting
Process, in order to prevent the injection of incorrect data or
control information (e.g., Templates), or the duplication of
Messages, in an IPFIX Message stream.
3. IPFIX must provide a mechanism to authenticate IPFIX Collecting
and Exporting Processes, to prevent the collection of data from an
unauthorized Exporting Process or the export of data to an
unauthorized Collecting Process.
Because IPFIX can be used to collect information for network
forensics and billing purposes, attacks designed to confuse, disable,
or take information from an IPFIX collection system may be seen as a
prime objective during a sophisticated network attack.
An attacker in a position to inject false messages into an IPFIX
Message stream can affect either the application using IPFIX (by
falsifying data) or the IPFIX Collecting Process itself (by modifying
or revoking Templates, or changing options); for this reason, IPFIX
Message integrity is important.
The IPFIX Messages themselves may also contain information of value
to an attacker, including information about the configuration of the
network as well as end-user traffic and payload data, so care must be
taken to confine their visibility to authorized users. When an
Information Element containing end-user payload information is
exported, it SHOULD be transmitted to the Collecting Process using a
means that secures its contents against eavesdropping. Suitable
mechanisms include the use of either a direct point-to-point
connection assumed to be unavailable to attackers, or the use of an
encryption mechanism. It is the responsibility of the Collecting
Process to provide a satisfactory degree of security for this
collected data, including, if necessary, encryption and/or
anonymization of any reported data; see <a href="#section-11.8">Section 11.8</a>.
<span class="grey">Claise, et al. Standards Track [Page 54]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-55" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-11.1" href="#section-11.1">11.1</a>. Applicability of TLS and DTLS</span>
Transport Layer Security (TLS) [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>] and Datagram Transport Layer
Security (DTLS) [<a href="./rfc6347" title=""Datagram Transport Layer Security Version 1.2"">RFC6347</a>] were designed to provide the
confidentiality, integrity, and authentication assurances required by
the IPFIX protocol, without the need for pre-shared keys.
IPFIX Exporting Processes and Collecting Processes using TCP MUST
support TLS version 1.1 and SHOULD support TLS version 1.2 [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>],
including the mandatory ciphersuite(s) specified in each version.
IPFIX Exporting Processes and Collecting Processes using UDP or SCTP
MUST support DTLS version 1.0 and SHOULD support DTLS version 1.2
[<a href="./rfc6347" title=""Datagram Transport Layer Security Version 1.2"">RFC6347</a>], including the mandatory ciphersuite(s) specified in each
version.
Note that DTLS is selected as the security mechanism for SCTP.
Though TLS bindings to SCTP are defined in [<a href="./rfc3436" title=""Transport Layer Security over Stream Control Transmission Protocol"">RFC3436</a>], they require
that all communication be over reliable, bidirectional streams, and
they also require one TLS connection per stream. This arrangement is
not compatible with the rationale behind the choice of SCTP as an
IPFIX transport protocol.
Note that using DTLS has a man-in-the-middle vulnerability not
present in TLS, allowing a message to be removed from the stream
without the knowledge of either the sender or receiver.
Additionally, when using DTLS over SCTP, an attacker could inject
SCTP control information and shut down the SCTP association, causing
a loss of IPFIX Messages if those messages are buffered outside of
the SCTP association. Techniques such as those described in
[<a href="./rfc6083" title=""Datagram Transport Layer Security (DTLS) for Stream Control Transmission Protocol (SCTP)"">RFC6083</a>] could be used to overcome these vulnerabilities.
When using DTLS over SCTP, the Exporting Process MUST ensure that
each IPFIX Message is sent over the same SCTP Stream that would be
used when sending the same IPFIX Message directly over SCTP. Note
that DTLS may send its own control messages on stream 0 with full
reliability; however, this will not interfere with the processing of
stream 0 IPFIX Messages at the Collecting Process, because DTLS
consumes its own control messages before passing IPFIX Messages up to
the application layer.
When using DTLS over SCTP or UDP, the Heartbeat Extension [<a href="./rfc6520" title=""Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) Heartbeat Extension"">RFC6520</a>]
SHOULD be used, especially on long-lived Transport Sessions, to
ensure that the association remains active.
Exporting and Collecting Processes MUST NOT request, offer, or use
any version of the Secure Socket Layer (SSL), or any version of TLS
prior to 1.1, due to known security vulnerabilities in prior versions
of TLS; see <a href="./rfc5246#appendix-E">Appendix E of [RFC5246]</a> for more information.
<span class="grey">Claise, et al. Standards Track [Page 55]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-56" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-11.2" href="#section-11.2">11.2</a>. Usage</span>
The IPFIX Exporting Process initiates the communication to the IPFIX
Collecting Process and acts as a TLS or DTLS client according to
[<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>] and [<a href="./rfc6347" title=""Datagram Transport Layer Security Version 1.2"">RFC6347</a>], while the IPFIX Collecting Process acts as a
TLS or DTLS server. The DTLS client opens a secure connection on
SCTP port 4740 of the DTLS server if SCTP is selected as the
transport protocol. The TLS client opens a secure connection on TCP
port 4740 of the TLS server if TCP is selected as the transport
protocol. The DTLS client opens a secure connection on UDP port 4740
of the DTLS server if UDP is selected as the transport protocol.
<span class="h3"><a class="selflink" id="section-11.3" href="#section-11.3">11.3</a>. Mutual Authentication</span>
When using TLS or DTLS, IPFIX Exporting Processes and IPFIX
Collecting Processes SHOULD be identified by a certificate containing
the DNS-ID as discussed in <a href="./rfc6125#section-6.4">Section 6.4 of [RFC6125]</a>; the inclusion of
Common Names (CN-IDs) in certificates identifying IPFIX Exporting
Processes or Collecting Processes is NOT RECOMMENDED.
To prevent man-in-the-middle attacks from impostor Exporting or
Collecting Processes, the acceptance of data from an unauthorized
Exporting Process, or the export of data to an unauthorized
Collecting Process, mutual authentication MUST be used for both TLS
and DTLS. Exporting Processes MUST verify the reference identifiers
of the Collecting Processes to which they are exporting IPFIX
Messages against those stored in the certificates. Likewise,
Collecting Processes MUST verify the reference identifiers of the
Exporting Processes from which they are receiving IPFIX Messages
against those stored in the certificates. Exporting Processes MUST
NOT export to non-verified Collecting Processes, and Collecting
Processes MUST NOT accept IPFIX Messages from non-verified Exporting
Processes.
Exporting Processes and Collecting Processes MUST support the
verification of certificates against an explicitly authorized list of
peer certificates identified by Common Name and SHOULD support the
verification of reference identifiers by matching the DNS-ID or CN-ID
with a DNS lookup of the peer.
IPFIX Exporting Processes and Collecting Processes MUST use non-NULL
ciphersuites for authentication, integrity, and confidentiality.
<span class="grey">Claise, et al. Standards Track [Page 56]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-57" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="section-11.4" href="#section-11.4">11.4</a>. Protection against DoS Attacks</span>
An attacker may mount a denial-of-service (DoS) attack against an
IPFIX collection system either directly, by sending large amounts of
traffic to a Collecting Process, or indirectly, by generating large
amounts of traffic to be measured by a Metering Process.
Direct DoS attacks can also involve state exhaustion, whether at the
transport layer (e.g., by creating a large number of pending
connections) or within the IPFIX Collecting Process itself (e.g., by
sending Flow Records pending Template or scope information, or a
large amount of Options Template Records, etc.).
SCTP mandates a cookie-exchange mechanism designed to defend against
SCTP state exhaustion DoS attacks. Similarly, TCP provides the "SYN
cookie" mechanism to mitigate state exhaustion; SYN cookies SHOULD be
used by any Collecting Process accepting TCP connections. DTLS also
provides cookie exchange to protect against DTLS server state
exhaustion.
The reader should note that there is no way to prevent fake IPFIX
Message processing (and state creation) for UDP and SCTP
communication. The use of TLS and DTLS can obviously prevent the
creation of fake states, but they are themselves prone to state
exhaustion attacks. Therefore, Collector rate limiting SHOULD be
used to protect TLS and DTLS (like limiting the number of new TLS or
DTLS sessions per second to a sensible number).
IPFIX state exhaustion attacks can be mitigated by limiting the rate
at which new connections or associations will be opened by the
Collecting Process; limiting the rate at which IPFIX Messages will be
accepted by the Collecting Process; and adaptively limiting the
amount of state kept, particularly for records waiting for Templates.
These rate and state limits MAY be provided by a Collecting Process,
and if provided, the limits SHOULD be user configurable.
Additionally, an IPFIX Collecting Process can eliminate the risk of
state exhaustion attacks from untrusted nodes by requiring TLS or
DTLS mutual authentication, causing the Collecting Process to accept
IPFIX Messages only from trusted sources.
With respect to indirect denial of service, the behavior of IPFIX
under overload conditions depends on the transport protocol in use.
For IPFIX over TCP, TCP congestion control would cause the flow of
IPFIX Messages to back off and eventually stall, blinding the IPFIX
system. SCTP improves upon this situation somewhat, as some IPFIX
Messages would continue to be received by the Collecting Process due
to the avoidance of head-of-line blocking by SCTP's multiple streams
<span class="grey">Claise, et al. Standards Track [Page 57]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-58" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
and partial reliability features, possibly affording some visibility
of the attack. The situation is similar with UDP, as some datagrams
may continue to be received at the Collecting Process, effectively
applying sampling to the IPFIX Message stream and implying that some
information about the attack will be available.
To minimize IPFIX Message loss under overload conditions, some
mechanism for service differentiation could be used to prioritize
IPFIX traffic over other traffic on the same link. Alternatively,
IPFIX Messages can be transported over a dedicated network. In this
case, care must be taken to ensure that the dedicated network can
handle the expected peak IPFIX Message traffic.
<span class="h3"><a class="selflink" id="section-11.5" href="#section-11.5">11.5</a>. When DTLS or TLS Is Not an Option</span>
The use of DTLS or TLS might not be possible in some cases, due to
performance issues or other operational concerns.
Without TLS or DTLS mutual authentication, IPFIX Exporting Processes
and Collecting Processes can fall back on using IP source addresses
to authenticate their peers. A policy of allocating Exporting
Process and Collecting Process IP addresses from specified address
ranges, and using ingress filtering to prevent spoofing, can improve
the usefulness of this approach. Again, completely segregating IPFIX
traffic on a dedicated network, where possible, can improve security
even further. In any case, the use of open Collecting Processes
(those that will accept IPFIX Messages from any Exporting Process
regardless of IP address or identity) is discouraged.
Modern TCP and SCTP implementations are resistant to blind insertion
attacks (see [<a href="./rfc4960" title=""Stream Control Transmission Protocol"">RFC4960</a>] and [<a href="./rfc6528" title=""Defending against Sequence Number Attacks"">RFC6528</a>]); however, UDP offers no such
protection. For this reason, IPFIX Message traffic transported via
UDP and not secured via DTLS SHOULD be protected via segregation to a
dedicated network.
<span class="h3"><a class="selflink" id="section-11.6" href="#section-11.6">11.6</a>. Logging an IPFIX Attack</span>
IPFIX Collecting Processes MUST detect potential IPFIX Message
insertion or loss conditions by tracking the IPFIX Sequence Number
and SHOULD provide a logging mechanism for reporting out-of-sequence
messages. Note that an attacker may be able to exploit the handling
of out-of-sequence messages at the Collecting Process, so care should
be taken in handling these conditions. For example, a Collecting
Process that simply resets the expected Sequence Number upon receipt
of a later Sequence Number could be temporarily blinded by deliberate
injection of later Sequence Numbers.
<span class="grey">Claise, et al. Standards Track [Page 58]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-59" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
IPFIX Exporting and Collecting Processes SHOULD log any connection
attempt that fails due to authentication failure, whether due to
being presented an unauthorized or mismatched certificate during TLS
or DTLS mutual authentication, or due to a connection attempt from an
unauthorized IP address when TLS or DTLS is not in use.
IPFIX Exporting and Collecting Processes SHOULD detect and log any
SCTP association reset or TCP connection reset.
<span class="h3"><a class="selflink" id="section-11.7" href="#section-11.7">11.7</a>. Securing the Collector</span>
The security of the Collector and its implementation is important to
achieve overall security; however, a complete set of security
guidelines for Collector implementation is outside the scope of this
document.
As IPFIX uses length-prefix encodings, Collector implementors should
take care to ensure the detection of inconsistent values that could
impact IPFIX Message decoding, and proper operation in the presence
of such inconsistent values.
Specifically, IPFIX Message, Set, and variable-length Information
Element lengths must be checked for consistency to avoid buffer-
sizing vulnerabilities.
Collector implementors should also pay special attention to UTF-8
encoding of string data types, as vulnerabilities may exist in the
interpretation of ill-formed UTF-8 values; see <a href="#section-6.1.6">Section 6.1.6</a>.
<span class="h3"><a class="selflink" id="section-11.8" href="#section-11.8">11.8</a>. Privacy Considerations for Collected Data</span>
Flow data exported by Exporting Processes and collected by Collecting
Processes typically contains information about traffic on the
observed network. This information may be personally identifiable
and privacy-sensitive. The storage of this data must be protected
via technical as well as policy means to ensure that the privacy of
the users of the measured network is protected. A complete
specification of such means is out of scope for this document and is
specific to the application and storage technology used.
<span class="grey">Claise, et al. Standards Track [Page 59]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-60" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h2"><a class="selflink" id="section-12" href="#section-12">12</a>. Management Considerations</span>
[<a id="ref-RFC6615">RFC6615</a>] specifies a MIB module that defines managed objects for
monitoring IPFIX Devices, including basic configuration. This MIB
can be used to measure the impact of IPFIX export on the monitoring
network; it contains tables covering:
Transport Session,
Cache definition,
Observation Point definition,
Template and Options Template definition,
export features (failover, load-balancing, duplicate), and
export statistics per Process, Session, and Template
From an operational aspect, an important function of this MIB module
is provided by the Transport Session Statistical table, which
contains the rate (in bytes per second) at which the Collector
receives or the Exporter sends out IPFIX Messages. Of particular
interest to operations, the Transport Session Statistical table in
<a href="#section-5.8.1">Section 5.8.1</a> of this MIB module exposes the rate of collection or
export of IPFIX Messages, which allows the measurement of the
bandwidth used by IPFIX export.
[<a id="ref-RFC6727">RFC6727</a>] describes extensions to the IPFIX-SELECTOR-MIB module
specified in [<a href="./rfc6615" title=""Definitions of Managed Objects for IP Flow Information Export"">RFC6615</a>] and contains managed objects for providing
information on applied packet selection functions and their
parameters (filtering and sampling).
Since the IPFIX-SELECTOR-MIB [<a href="./rfc6615" title=""Definitions of Managed Objects for IP Flow Information Export"">RFC6615</a>] and PSAMP-MIB [<a href="./rfc6727" title=""Definitions of Managed Objects for Packet Sampling"">RFC6727</a>]
modules only contain read-only objects, they cannot be used for
configuration of IPFIX Devices. [<a href="./rfc6728" title=""Configuration Data Model for the IP Flow Information Export (IPFIX) and Packet Sampling (PSAMP) Protocols"">RFC6728</a>] specifies a configuration
data model for the IPFIX and PSAMP protocols, using the Network
Configuration Protocol (NETCONF). This data model covers Selection
Processes, Caches, Exporting Processes, and Collecting Processes on
IPFIX and PSAMP Devices, and is defined using UML (Unified Modeling
Language) class diagrams and formally specified using YANG. The
configuration data is encoded in Extensible Markup Language (XML).
A few mechanisms specified alongside the IPFIX protocol can help
monitor and reduce bandwidth used for IPFIX Export:
- a bandwidth-saving method for exporting redundant information in
IPFIX [<a href="./rfc5473" title=""Reducing Redundancy in IP Flow Information Export (IPFIX) and Packet Sampling (PSAMP) Reports"">RFC5473</a>]
- an efficient method for exporting bidirectional flows [<a href="./rfc5103" title=""Bidirectional Flow Export Using IP Flow Information Export (IPFIX)"">RFC5103</a>]
- a method for the definition and export of complex data structures
[<a href="./rfc6313" title=""Export of Structured Data in IP Flow Information Export (IPFIX)"">RFC6313</a>]
<span class="grey">Claise, et al. Standards Track [Page 60]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-61" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Alternatively, PSAMP [<a href="./rfc5474" title=""A Framework for Packet Selection and Reporting"">RFC5474</a>] can be used to export packets sampled
by statistical and other methods, which may be applicable to many
monitoring areas for which IPFIX is also suited. PSAMP also provides
control over the impact on the measured network through its sampling
rate. The set of packet selection techniques (Sampling, Filtering,
and hashing) standardized by PSAMP is described in [<a href="./rfc5475" title=""Sampling and Filtering Techniques for IP Packet Selection"">RFC5475</a>]. PSAMP
also defines an explicitly configurable export rate limit in
<a href="./rfc5474#section-8.4">Section 8.4 of [RFC5474]</a>.
<span class="h2"><a class="selflink" id="section-13" href="#section-13">13</a>. IANA Considerations</span>
IANA has updated the "IPFIX Information Elements" registry
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>] so that all references that previously pointed to
<a href="./rfc5101">RFC 5101</a> now point to this document instead.
IPFIX Messages use two fields with assigned values. These are the
IPFIX Version Number, indicating which version of the IPFIX protocol
was used to export an IPFIX Message, and the IPFIX Set ID, indicating
the type for each set of information within an IPFIX Message.
The Information Elements used by IPFIX, and sub-registries of
Information Element values, are managed by IANA [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], as are
the Private Enterprise Numbers used by enterprise-specific
Information Elements [<a href="#ref-IANA-PEN">IANA-PEN</a>]. This document makes no changes to
these registries.
The IPFIX Version Number value of 0x000a (10) is reserved for the
IPFIX protocol specified in this document. Set ID values of 0 and 1
are not used, for historical reasons [<a href="./rfc3954" title=""Cisco Systems NetFlow Services Export Version 9"">RFC3954</a>]. The Set ID value of
2 is reserved for the Template Set. The Set ID value of 3 is
reserved for the Options Template Set. All other Set ID values from
4 to 255 are reserved for future use. Set ID values above 255 are
used for Data Sets.
New assignments in either the "IPFIX Version Number" or "IPFIX Set
IDs" sub-registries require a Standards Action [<a href="./rfc5226" title="">RFC5226</a>], i.e., they
are to be made via Standards Track RFCs approved by the IESG.
<span class="grey">Claise, et al. Standards Track [Page 61]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-62" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. IPFIX Encoding Examples</span>
This appendix, which is a not a normative reference, contains IPFIX
encoding examples.
Let's consider the example of an IPFIX Message composed of a Template
Set, a Data Set (which contains three Data Records), an Options
Template Set, and another Data Set (which contains two Data Records
related to the previous Options Template Record).
IPFIX Message:
+--------+------------------------------------------. . .
| | +--------------+ +------------------+
|Message | | Template | | Data |
| Header | | Set | | Set | . . .
| | | (1 Template) | | (3 Data Records) |
| | +--------------+ +------------------+
+--------+------------------------------------------. . .
. . .-------------------------------------------+
+------------------+ +------------------+ |
| Options | | Data | |
. . . | Template Set | | Set | |
| (1 Template) | | (2 Data Records) | |
+------------------+ +------------------+ |
. . .-------------------------------------------+
<span class="h3"><a class="selflink" id="appendix-A.1" href="#appendix-A.1">A.1</a>. Message Header Example</span>
The Message Header is composed of:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version = 0x000a | Length = 152 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Export Time |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Observation Domain ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="grey">Claise, et al. Standards Track [Page 62]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-63" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="appendix-A.2" href="#appendix-A.2">A.2</a>. Template Set Examples</span>
<span class="h4"><a class="selflink" id="appendix-A.2.1" href="#appendix-A.2.1">A.2.1</a>. Template Set Using IANA Information Elements</span>
We want to report the following Information Elements:
- IPv4 source IP address: sourceIPv4Address [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a
length of 4 octets
- IPv4 destination IP address: destinationIPv4Address [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>],
with a length of 4 octets
- Next-hop IP address (IPv4): ipNextHopIPv4Address [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with
a length of 4 octets
- Number of packets of the Flow: packetDeltaCount [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with
a length of 4 octets
- Number of octets of the Flow: octetDeltaCount [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a
length of 4 octets
Therefore, the Template Set will be composed of the following:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 2 | Length = 28 octets |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID 256 | Field Count = 5 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| sourceIPv4Address = 8 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| destinationIPv4Address = 12 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| ipNextHopIPv4Address = 15 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| packetDeltaCount = 2 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| octetDeltaCount = 1 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="grey">Claise, et al. Standards Track [Page 63]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-64" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h4"><a class="selflink" id="appendix-A.2.2" href="#appendix-A.2.2">A.2.2</a>. Template Set Using Enterprise-Specific Information Elements</span>
We want to report the following Information Elements:
- IPv4 source IP address: sourceIPv4Address [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a
length of 4 octets
- IPv4 destination IP address: destinationIPv4Address [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>],
with a length of 4 octets
- An enterprise-specific Information Element representing proprietary
information, with a type of 15 and a length of 4 octets
- Number of packets of the Flow: packetDeltaCount [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with
a length of 4 octets
- Number of octets of the Flow: octetDeltaCount [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a
length of 4 octets
Therefore, the Template Set will be composed of the following:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 2 | Length = 32 octets |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID 257 | Field Count = 5 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| sourceIPv4Address = 8 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| destinationIPv4Address = 12 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1| Information Element id. = 15| Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| packetDeltaCount = 2 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0| octetDeltaCount = 1 | Field Length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="grey">Claise, et al. Standards Track [Page 64]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-65" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="appendix-A.3" href="#appendix-A.3">A.3</a>. Data Set Example</span>
In this example, we report the following three Flow Records:
Src IP Addr. | Dst IP Addr. | Next-Hop Addr. | Packet | Octets
| | | Number | Number
----------------------------------------------------------------
192.0.2.12 | 192.0.2.254 | 192.0.2.1 | 5009 | 5344385
192.0.2.27 | 192.0.2.23 | 192.0.2.2 | 748 | 388934
192.0.2.56 | 192.0.2.65 | 192.0.2.3 | 5 | 6534
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 256 | Length = 64 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.12 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.254 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 5009 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 5344385 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.27 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.23 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 748 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 388934 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.56 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.65 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 192.0.2.3 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 5 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 6534 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Note that padding is not necessary in this example.
<span class="grey">Claise, et al. Standards Track [Page 65]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-66" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="appendix-A.4" href="#appendix-A.4">A.4</a>. Options Template Set Examples</span>
<span class="h4"><a class="selflink" id="appendix-A.4.1" href="#appendix-A.4.1">A.4.1</a>. Options Template Set Using IANA Information Elements</span>
Per line card (the router being composed of two line cards), we want
to report the following Information Elements:
- Total number of IPFIX Messages: exportedMessageTotalCount
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a length of 2 octets
- Total number of exported Flows: exportedFlowRecordTotalCount
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a length of 2 octets
The line card, which is represented by the lineCardId Information
Element [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], is used as the Scope Field.
Therefore, the Options Template Set will be:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 3 | Length = 24 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID 258 | Field Count = 3 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope Field Count = 1 |0| lineCardId = 141 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope 1 Field Length = 4 |0|exportedMessageTotalCount=41 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Field Length = 2 |0|exportedFlowRecordTotalCo.=42|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Field Length = 2 | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="h4"><a class="selflink" id="appendix-A.4.2" href="#appendix-A.4.2">A.4.2</a>. Options Template Set Using Enterprise-Specific Information</span>
Elements
Per line card (the router being composed of two line cards), we want
to report the following Information Elements:
- Total number of IPFIX Messages: exportedMessageTotalCount
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a length of 2 octets
- An enterprise-specific number of exported Flows, with a type of 42
and a length of 4 octets
The line card, which is represented by the lineCardId Information
Element [<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], is used as the Scope Field.
<span class="grey">Claise, et al. Standards Track [Page 66]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-67" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The format of the Options Template Set is as follows:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 3 | Length = 28 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID 259 | Field Count = 3 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope Field Count = 1 |0| lineCardId = 141 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope 1 Field Length = 4 |0|exportedMessageTotalCount=41 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Field Length = 2 |1|Information Element id. = 42 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Field Length = 4 | Enterprise number ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... Enterprise number | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="h4"><a class="selflink" id="appendix-A.4.3" href="#appendix-A.4.3">A.4.3</a>. Options Template Set Using an Enterprise-Specific Scope</span>
In this example, we want to export the same information as in the
example in <a href="#appendix-A.4.1">Appendix A.4.1</a>:
- Total number of IPFIX Messages: exportedMessageTotalCount
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a length of 2 octets
- Total number of exported Flows: exportedFlowRecordTotalCount
[<a href="#ref-IANA-IPFIX">IANA-IPFIX</a>], with a length of 2 octets
But this time, the information pertains to a proprietary scope,
identified by enterprise-specific Information Element number 123.
<span class="grey">Claise, et al. Standards Track [Page 67]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-68" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
The format of the Options Template Set is now as follows:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 3 | Length = 28 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Template ID 260 | Field Count = 3 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope Field Count = 1 |1|Scope 1 Infor. El. id. = 123 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Scope 1 Field Length = 4 | Enterprise Number ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... Enterprise Number |0|exportedMessageTotalCount=41 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Field Length = 2 |0|exportedFlowRecordTotalCo.=42|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Field Length = 2 | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="h4"><a class="selflink" id="appendix-A.4.4" href="#appendix-A.4.4">A.4.4</a>. Data Set Using an Enterprise-Specific Scope</span>
In this example, we report the following two Data Records:
Enterprise field 123 | IPFIX Message | Exported Flow Records
---------------------------------------------------------------
1 | 345 | 10201
2 | 690 | 20402
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Set ID = 260 | Length = 20 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 345 | 10201 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 690 | 20402 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="grey">Claise, et al. Standards Track [Page 68]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-69" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
<span class="h3"><a class="selflink" id="appendix-A.5" href="#appendix-A.5">A.5</a>. Variable-Length Information Element Examples</span>
<span class="h4"><a class="selflink" id="appendix-A.5.1" href="#appendix-A.5.1">A.5.1</a>. Example of Variable-Length Information Element with Length</span>
Less Than 255 Octets
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 5 | 5-octet Information Element |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="h4"><a class="selflink" id="appendix-A.5.2" href="#appendix-A.5.2">A.5.2</a>. Example of Variable-Length Information Element with 3-Octet</span>
Length Encoding
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 255 | 1000 | IE ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 1000-octet Information Element |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
: ... :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... IE |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="grey">Claise, et al. Standards Track [Page 69]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-70" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Normative References
[<a id="ref-IANA-IPFIX">IANA-IPFIX</a>]
IANA, "IP Flow Information Export (IPFIX) Entities",
<<a href="http://www.iana.org/assignments/ipfix/">http://www.iana.org/assignments/ipfix/</a>>.
[<a id="ref-RFC1014">RFC1014</a>] Sun Microsystems, Inc., "XDR: External Data Representation
Standard", <a href="./rfc1014">RFC 1014</a>, June 1987.
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC3436">RFC3436</a>] Jungmaier, A., Rescorla, E., and M. Tuexen, "Transport
Layer Security over Stream Control Transmission Protocol",
<a href="./rfc3436">RFC 3436</a>, December 2002.
[<a id="ref-RFC3629">RFC3629</a>] Yergeau, F., "UTF-8, a transformation format of
ISO 10646", STD 63, <a href="./rfc3629">RFC 3629</a>, November 2003.
[<a id="ref-RFC3758">RFC3758</a>] Stewart, R., Ramalho, M., Xie, Q., Tuexen, M., and P.
Conrad, "Stream Control Transmission Protocol (SCTP)
Partial Reliability Extension", <a href="./rfc3758">RFC 3758</a>, May 2004.
[<a id="ref-RFC4960">RFC4960</a>] Stewart, R., Ed., "Stream Control Transmission Protocol",
<a href="./rfc4960">RFC 4960</a>, September 2007.
[<a id="ref-RFC5226">RFC5226</a>] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", <a href="https://www.rfc-editor.org/bcp/bcp26">BCP 26</a>, <a href="./rfc5226">RFC 5226</a>,
May 2008.
[<a id="ref-RFC5246">RFC5246</a>] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", <a href="./rfc5246">RFC 5246</a>, August 2008.
[<a id="ref-RFC5905">RFC5905</a>] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch,
"Network Time Protocol Version 4: Protocol and Algorithms
Specification", <a href="./rfc5905">RFC 5905</a>, June 2010.
[<a id="ref-RFC6125">RFC6125</a>] Saint-Andre, P. and J. Hodges, "Representation and
Verification of Domain-Based Application Service Identity
within Internet Public Key Infrastructure Using X.509
(PKIX) Certificates in the Context of Transport Layer
Security (TLS)", <a href="./rfc6125">RFC 6125</a>, March 2011.
[<a id="ref-RFC6347">RFC6347</a>] Rescorla, E. and N. Modadugu, "Datagram Transport Layer
Security Version 1.2", <a href="./rfc6347">RFC 6347</a>, January 2012.
<span class="grey">Claise, et al. Standards Track [Page 70]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-71" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
[<a id="ref-RFC6520">RFC6520</a>] Seggelmann, R., Tuexen, M., and M. Williams, "Transport
Layer Security (TLS) and Datagram Transport Layer Security
(DTLS) Heartbeat Extension", <a href="./rfc6520">RFC 6520</a>, February 2012.
[<a id="ref-RFC7012">RFC7012</a>] Claise, B., Ed., and B. Trammell, Ed., "Information Model
for IP Flow Information Export (IPFIX)", <a href="./rfc7012">RFC 7012</a>,
September 2013.
[<a id="ref-TCP">TCP</a>] Postel, J., "Transmission Control Protocol", STD 7,
<a href="./rfc793">RFC 793</a>, September 1981.
[<a id="ref-UDP">UDP</a>] Postel, J., "User Datagram Protocol", STD 6, <a href="./rfc768">RFC 768</a>,
August 1980.
Informative References
[<a id="ref-IEEE.754.2008">IEEE.754.2008</a>]
Institute of Electrical and Electronics Engineers, "IEEE
Standard for Floating-Point Arithmetic", IEEE
Standard 754, August 2008.
[<a id="ref-IPFIX-MED-PROTO">IPFIX-MED-PROTO</a>]
Claise, B., Kobayashi, A., and B. Trammell, "Operation of
the IP Flow Information Export (IPFIX) Protocol on IPFIX
Mediators", Work in Progress, July 2013.
[<a id="ref-IANA-PEN">IANA-PEN</a>]
IANA, "Private Enterprise Numbers",
<<a href="http://www.iana.org/assignments/enterprise-numbers/">http://www.iana.org/assignments/enterprise-numbers/</a>>.
[<a id="ref-POSIX.1">POSIX.1</a>] IEEE 1003.1-2008, "IEEE Standard for Information
Technology - Portable Operating System Interface
(POSIX(R))", 2008.
[<a id="ref-RFC2579">RFC2579</a>] McCloghrie, K., Ed., Perkins, D., Ed., and J.
Schoenwaelder, Ed., "Textual Conventions for SMIv2",
STD 58, <a href="./rfc2579">RFC 2579</a>, April 1999.
[<a id="ref-RFC3550">RFC3550</a>] Schulzrinne, H., Casner, S., Frederick, R., and V.
Jacobson, "RTP: A Transport Protocol for Real-Time
Applications", STD 64, <a href="./rfc3550">RFC 3550</a>, July 2003.
[<a id="ref-RFC3917">RFC3917</a>] Quittek, J., Zseby, T., Claise, B., and S. Zander,
"Requirements for IP Flow Information Export (IPFIX)",
<a href="./rfc3917">RFC 3917</a>, October 2004.
[<a id="ref-RFC3954">RFC3954</a>] Claise, B., Ed., "Cisco Systems NetFlow Services Export
Version 9", <a href="./rfc3954">RFC 3954</a>, October 2004.
<span class="grey">Claise, et al. Standards Track [Page 71]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-72" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
[<a id="ref-RFC5101">RFC5101</a>] Claise, B., Ed., "Specification of the IP Flow Information
Export (IPFIX) Protocol for the Exchange of IP Traffic
Flow Information", <a href="./rfc5101">RFC 5101</a>, January 2008.
[<a id="ref-RFC5103">RFC5103</a>] Trammell, B. and E. Boschi, "Bidirectional Flow Export
Using IP Flow Information Export (IPFIX)", <a href="./rfc5103">RFC 5103</a>,
January 2008.
[<a id="ref-RFC5153">RFC5153</a>] Boschi, E., Mark, L., Quittek, J., Stiemerling, M., and P.
Aitken, "IP Flow Information Export (IPFIX) Implementation
Guidelines", <a href="./rfc5153">RFC 5153</a>, April 2008.
[<a id="ref-RFC5470">RFC5470</a>] Sadasivan, G., Brownlee, N., Claise, B., and J. Quittek,
"Architecture for IP Flow Information Export", <a href="./rfc5470">RFC 5470</a>,
March 2009.
[<a id="ref-RFC5471">RFC5471</a>] Schmoll, C., Aitken, P., and B. Claise, "Guidelines for IP
Flow Information Export (IPFIX) Testing", <a href="./rfc5471">RFC 5471</a>,
March 2009.
[<a id="ref-RFC5472">RFC5472</a>] Zseby, T., Boschi, E., Brownlee, N., and B. Claise, "IP
Flow Information Export (IPFIX) Applicability", <a href="./rfc5472">RFC 5472</a>,
March 2009.
[<a id="ref-RFC5473">RFC5473</a>] Boschi, E., Mark, L., and B. Claise, "Reducing Redundancy
in IP Flow Information Export (IPFIX) and Packet Sampling
(PSAMP) Reports", <a href="./rfc5473">RFC 5473</a>, March 2009.
[<a id="ref-RFC5474">RFC5474</a>] Duffield, N., Ed., Chiou, D., Claise, B., Greenberg, A.,
Grossglauser, M., and J. Rexford, "A Framework for Packet
Selection and Reporting", <a href="./rfc5474">RFC 5474</a>, March 2009.
[<a id="ref-RFC5475">RFC5475</a>] Zseby, T., Molina, M., Duffield, N., Niccolini, S., and F.
Raspall, "Sampling and Filtering Techniques for IP Packet
Selection", <a href="./rfc5475">RFC 5475</a>, March 2009.
[<a id="ref-RFC5476">RFC5476</a>] Claise, B., Ed., Johnson, A., and J. Quittek, "Packet
Sampling (PSAMP) Protocol Specifications", <a href="./rfc5476">RFC 5476</a>,
March 2009.
[<a id="ref-RFC5477">RFC5477</a>] Dietz, T., Claise, B., Aitken, P., Dressler, F., and G.
Carle, "Information Model for Packet Sampling Exports",
<a href="./rfc5477">RFC 5477</a>, March 2009.
[<a id="ref-RFC5610">RFC5610</a>] Boschi, E., Trammell, B., Mark, L., and T. Zseby,
"Exporting Type Information for IP Flow Information Export
(IPFIX) Information Elements", <a href="./rfc5610">RFC 5610</a>, July 2009.
<span class="grey">Claise, et al. Standards Track [Page 72]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-73" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
[<a id="ref-RFC5655">RFC5655</a>] Trammell, B., Boschi, E., Mark, L., Zseby, T., and A.
Wagner, "Specification of the IP Flow Information Export
(IPFIX) File Format", <a href="./rfc5655">RFC 5655</a>, October 2009.
[<a id="ref-RFC6083">RFC6083</a>] Tuexen, M., Seggelmann, R., and E. Rescorla, "Datagram
Transport Layer Security (DTLS) for Stream Control
Transmission Protocol (SCTP)", <a href="./rfc6083">RFC 6083</a>, January 2011.
[<a id="ref-RFC6183">RFC6183</a>] Kobayashi, A., Claise, B., Muenz, G., and K. Ishibashi,
"IP Flow Information Export (IPFIX) Mediation: Framework",
<a href="./rfc6183">RFC 6183</a>, April 2011.
[<a id="ref-RFC6313">RFC6313</a>] Claise, B., Dhandapani, G., Aitken, P., and S. Yates,
"Export of Structured Data in IP Flow Information Export
(IPFIX)", <a href="./rfc6313">RFC 6313</a>, July 2011.
[<a id="ref-RFC6526">RFC6526</a>] Claise, B., Aitken, P., Johnson, A., and G. Muenz, "IP
Flow Information Export (IPFIX) Per Stream Control
Transmission Protocol (SCTP) Stream", <a href="./rfc6526">RFC 6526</a>,
March 2012.
[<a id="ref-RFC6528">RFC6528</a>] Gont, F. and S. Bellovin, "Defending against Sequence
Number Attacks", <a href="./rfc6528">RFC 6528</a>, February 2012.
[<a id="ref-RFC6615">RFC6615</a>] Dietz, T., Ed., Kobayashi, A., Claise, B., and G. Muenz,
"Definitions of Managed Objects for IP Flow Information
Export", <a href="./rfc6615">RFC 6615</a>, June 2012.
[<a id="ref-RFC6727">RFC6727</a>] Dietz, T., Ed., Claise, B., and J. Quittek, "Definitions
of Managed Objects for Packet Sampling", <a href="./rfc6727">RFC 6727</a>,
October 2012.
[<a id="ref-RFC6728">RFC6728</a>] Muenz, G., Claise, B., and P. Aitken, "Configuration Data
Model for the IP Flow Information Export (IPFIX) and
Packet Sampling (PSAMP) Protocols", <a href="./rfc6728">RFC 6728</a>,
October 2012.
[<a id="ref-UTF8-EXPLOIT">UTF8-EXPLOIT</a>]
Davis, M. and M. Suignard, "Unicode Technical Report #36:
Unicode Security Considerations", The Unicode Consortium,
July 2012.
<span class="grey">Claise, et al. Standards Track [Page 73]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-74" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Acknowledgments
We would like to thank Ganesh Sadasivan for his significant
contribution during the initial phases of the protocol specification.
Additional thanks go to Juergen Quittek for coordination between
IPFIX and PSAMP; Nevil Brownlee, Dave Plonka, and Andrew Johnson for
the thorough reviews; Randall Stewart and Peter Lei for their SCTP
expertise and contributions; Martin Djernaes for the first essay on
the SCTP section; Michael Behringer and Eric Vyncke for their advice
and knowledge in security; Michael Tuexen for his help regarding the
DTLS section; Elisa Boschi for her contribution regarding the
improvement of SCTP sections; Mark Fullmer, Sebastian Zander, Jeff
Meyer, Maurizio Molina, Carter Bullard, Tal Givoly, Lutz Mark, David
Moore, Robert Lowe, Paul Calato, Andrew Feren, Gerhard Muenz, Sue
Hares, and many more, for the technical reviews and feedback.
Finally, a special mention to Adrian Farrel for his attention to
management and operational aspects.
<span class="grey">Claise, et al. Standards Track [Page 74]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-75" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Contributors
Stewart Bryant
Cisco Systems
10 New Square, Bedfont Lakes
Feltham, Middlesex TW18 8HA
United Kingdom
EMail: stbryant@cisco.com
Simon Leinen
SWITCH
Werdstrasse 2
P.O. Box 8021
Zurich
Switzerland
Phone: +41 44 268 1536
EMail: simon.leinen@switch.ch
Thomas Dietz
NEC Europe Ltd.
NEC Laboratories Europe
Network Research Division
Kurfuersten-Anlage 36
69115 Heidelberg
Germany
Phone: +49 6221 4342-128
EMail: Thomas.Dietz@nw.neclab.eu
<span class="grey">Claise, et al. Standards Track [Page 75]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-76" ></span>
<span class="grey"><a href="./rfc7011">RFC 7011</a> IPFIX Protocol Specification September 2013</span>
Authors' Addresses
Benoit Claise (editor)
Cisco Systems, Inc.
De Kleetlaan 6a b1
1831 Diegem
Belgium
Phone: +32 2 704 5622
EMail: bclaise@cisco.com
Brian Trammell (editor)
Swiss Federal Institute of Technology Zurich
Gloriastrasse 35
8092 Zurich
Switzerland
Phone: +41 44 632 70 13
EMail: trammell@tik.ee.ethz.ch
Paul Aitken
Cisco Systems, Inc.
96 Commercial Quay
Commercial Street, Edinburgh EH6 6LX
United Kingdom
Phone: +44 131 561 3616
EMail: paitken@cisco.com
Claise, et al. Standards Track [Page 76]
</pre>
|