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
|
<pre>Network Working Group P. Phaal
Request for Comments: 3176 S. Panchen
Category: Informational N. McKee
InMon Corp.
September 2001
<span class="h1">InMon Corporation's sFlow: A Method for Monitoring Traffic in</span>
<span class="h1">Switched and Routed Networks</span>
Status of this Memo
This memo provides information for the Internet community. It does
not specify an Internet standard of any kind. Distribution of this
memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2001). All Rights Reserved.
Abstract
This memo defines InMon Coporation's sFlow system. sFlow is a
technology for monitoring traffic in data networks containing
switches and routers. In particular, it defines the sampling
mechanisms implemented in an sFlow Agent for monitoring traffic, the
sFlow MIB for controlling the sFlow Agent, and the format of sample
data used by the sFlow Agent when forwarding data to a central data
collector.
Table of Contents
<a href="#section-1">1</a>. Overview ..................................................... <a href="#page-2">2</a>
<a href="#section-2">2</a>. Sampling Mechanisms .......................................... <a href="#page-2">2</a>
<a href="#section-2.1">2.1</a> Sampling of Switched Flows ............................... <a href="#page-3">3</a>
<a href="#section-2.1.1">2.1.1</a> Distributed Switching .............................. <a href="#page-4">4</a>
<a href="#section-2.1.2">2.1.2</a> Random Number Generation ........................... <a href="#page-4">4</a>
<a href="#section-2.2">2.2</a> Sampling of Network Interface Statistics ................. <a href="#page-4">4</a>
<a href="#section-3">3</a>. sFlow MIB .................................................... <a href="#page-5">5</a>
<a href="#section-3.1">3.1</a> The SNMP Management Framework ............................ <a href="#page-5">5</a>
<a href="#section-3.2">3.2</a> Definitions .............................................. <a href="#page-6">6</a>
<a href="#section-4">4</a>. sFlow Datagram Format ........................................ <a href="#page-14">14</a>
<a href="#section-5">5</a>. Security Considerations ...................................... <a href="#page-25">25</a>
<a href="#section-5.1">5.1</a> Control .................................................. <a href="#page-26">26</a>
<a href="#section-5.2">5.2</a> Transport ................................................ <a href="#page-26">26</a>
<a href="#section-5.3">5.3</a> Confidentiality .......................................... <a href="#page-26">26</a>
<a href="#section-6">6</a>. References ................................................... <a href="#page-27">27</a>
<a href="#section-7">7</a>. Authors' Addresses ........................................... <a href="#page-29">29</a>
<span class="grey">Phaal, et al. Informational [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
<a href="#section-8">8</a>. Intellectual Property Statement .............................. <a href="#page-30">30</a>
<a href="#section-9">9</a>. Full Copyright Statement ..................................... <a href="#page-31">31</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Overview</span>
sFlow is a technology for monitoring traffic in data networks
containing switches and routers. In particular, it defines the
sampling mechanisms implemented in an sFlow Agent for monitoring
traffic, the sFlow MIB for controlling the sFlow Agent, and the
format of sample data used by the sFlow Agent when forwarding data to
a central data collector.
The architecture and sampling techniques used in the sFlow monitoring
system are designed to provide continuous site-wide (and network-
wide) traffic monitoring for high speed switched and routed networks.
The design specifically addresses issues associated with:
o Accurately monitoring network traffic at Gigabit speeds and higher.
o Scaling to manage tens of thousands of agents from a single point.
o Extremely low cost agent implementation.
The sFlow monitoring system consists of an sFlow Agent (embedded in a
switch or router or in a stand alone probe) and a central data
collector, or sFlow Analyzer.
The sFlow Agent uses sampling technology to capture traffic
statistics from the device it is monitoring. sFlow Datagrams are
used to immediately forward the sampled traffic statistics to an
sFlow Analyzer for analysis.
This document describes the sampling mechanisms used by the sFlow
Agent, the SFLOW MIB used by the sFlow Analyzer to control the sFlow
Agent, and the sFlow Datagram Format used by the sFlow Agent to send
traffic data to the sFlow Analyzer.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Sampling Mechanisms</span>
The sFlow Agent uses two forms of sampling: statistical packet-based
sampling of switched flows, and time-based sampling of network
interface statistics.
<span class="grey">Phaal, et al. Informational [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a> Sampling of Switched Flows</span>
A flow is defined as all the packets that are received on one
interface, enter the Switching/Routing Module and are sent to another
interface. In the case of a one-armed router, the source and
destination interface could be the same. In the case of a broadcast
or multicast packet there may be multiple destination interfaces.
The sampling mechanism must ensure that any packet involved in a flow
has an equal chance of being sampled, irrespective of the flow to
which it belongs.
Sampling flows is accomplished as follows: When a packet arrives on
an interface, a filtering decision is made that determines whether
the packet should be dropped. If the packet is not filtered a
destination interface is assigned by the switching/routing function.
At this point a decision is made on whether or not to sample the
packet. The mechanism involves a counter that is decremented with
each packet. When the counter reaches zero a sample is taken.
Whether or not a sample is taken, the counter Total_Packets is
incremented. Total_Packets is a count of all the packets that could
have been sampled.
Taking a sample involves either copying the packet's header, or
extracting features from the packet (see sFlow Datagram Format for a
description of the different forms of sample). Every time a sample
is taken, the counter Total_Samples, is incremented. Total_Samples
is a count of the number of samples generated. Samples are sent by
the sampling entity to the sFlow Agent for processing. The sample
includes the packet information, and the values of the Total_Packets
and Total_Samples counters.
When a sample is taken, the counter indicating how many packets to
skip before taking the next sample should be reset. The value of the
counter should be set to a random integer where the sequence of
random integers used over time should be such that
(1) Total_Packets/Total_Samples = Rate
An alternative strategy for packet sampling is to generate a random
number for each packet, compare the random number to a preset
threshold and take a sample whenever the random number is smaller
than the threshold value. Calculation of an appropriate threshold
value depends on the characteristics of the random number generator,
however, the resulting sample stream must still satisfy (1).
<span class="grey">Phaal, et al. Informational [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
<span class="h4"><a class="selflink" id="section-2.1.1" href="#section-2.1.1">2.1.1</a> Distributed Switching</span>
The SFLOW MIB permits separate sampling entities to be associated
with different physical or logical elements of the switch (such as
interfaces, backplanes or VLANs). Each sampling engine has its own
independent state (i.e., Total_Packets, Total_Samples, Skip and
Rate), and forwards its own sample messages to the sFlow Agent. The
sFlow Agent is responsible for packaging the samples into datagrams
for transmission to an sFlow Analyzer.
<span class="h4"><a class="selflink" id="section-2.1.2" href="#section-2.1.2">2.1.2</a> Random Number Generation</span>
The essential property of the random number generator is that the
mean value of the numbers it generates converges to the required
sampling rate.
A uniform distribution random number generator is very effective.
The range of skip counts (the variance) does not significantly affect
results; variation of +-10% of the mean value is sufficient.
The random number generator must ensure that all numbers in the range
between its maximum and minimum values of the distribution are
possible; a random number generator only capable of generating even
numbers, or numbers with any common divisor is unsuitable.
A new skip value is only required every time a sample is taken.
<span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a> Sampling of Network Interface Statistics</span>
The objective of the counter sampling is to efficiently, periodically
poll each data source on the device and extract key statistics.
For efficiency and scalability reasons, the sFlow System implements
counter polling in the sFlow Agent. A maximum polling interval is
assigned to the agent, but the agent is free to schedule polling in
order maximize internal efficiency.
Flow sampling and counter sampling are designed as part of an
integrated system. Both types of samples are combined in sFlow
Datagrams. Since flow sampling will cause a steady, but random,
stream of datagrams to be sent to the sFlow Analyzer, counter samples
may be taken opportunistically in order to fill these datagrams.
One strategy for counter sampling has the sFlow Agent keep a list of
counter sources being sampled. When a flow sample is generated the
sFlow Agent examines the list and adds counters to the sample
datagram, least recently sampled first. Counters are only added to
the datagram if the sources are within a short period, 5 seconds say,
<span class="grey">Phaal, et al. Informational [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
of failing to meet the required sampling interval (see
sFlowCounterSamplingInterval in SFLOW MIB). Whenever a counter
source's statistics are added to a sample datagram, the time the
counter source was last sampled is updated and the counter source is
placed at the end of the list. Periodically, say every second, the
sFlow Agent examines the list of counter sources and sends any
counters that need to be sent to meet the sampling interval
requirement.
Alternatively, if the agent regularly schedules counter sampling,
then it should schedule each counter source at a different start time
(preferably randomly) so that counter sampling is not synchronized
within an agent or between agents.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. sFlow MIB</span>
The sFlow MIB defines a control interface for an sFlow Agent. This
interface provides a standard mechanism for remotely controlling and
configuring an sFlow Agent.
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a> The SNMP Management Framework</span>
The SNMP Management Framework presently consists of five major
components:
o An overall architecture, described in <a href="./rfc2571">RFC 2571</a> [<a href="#ref-2" title=""An Architecture for Describing SNMP Management Frameworks"">2</a>].
o Mechanisms for describing and naming objects and events for the
purpose of management. The first version of this Structure of
Management Information (SMI) is called SMIv1 and described in STD
16,
<a href="./rfc1155">RFC 1155</a> [<a href="#ref-3" title=""Structure and Identification of Management Information for TCP/IP-based Internets"">3</a>], STD 16, <a href="./rfc1212">RFC 1212</a> [<a href="#ref-4" title=""Concise MIB Definitions"">4</a>] and <a href="./rfc1215">RFC 1215</a> [<a href="#ref-5" title=""A Convention for Defining Traps for use with the SNMP"">5</a>]. The second
version, called SMIv2, is described in STD 58, <a href="./rfc2578">RFC 2578</a> [<a href="#ref-6" title=""Structure of Management Information Version 2 (SMIv2)"">6</a>], STD
58, <a href="./rfc2579">RFC 2579</a> [<a href="#ref-7" title=""Textual Conventions for SMIv2"">7</a>] and STD 58, <a href="./rfc2580">RFC 2580</a> [<a href="#ref-8" title=""Conformance Statements for SMIv2"">8</a>].
o Message protocols for transferring management information. The
first version of the SNMP message protocol is called SNMPv1 and
described in STD 15, <a href="./rfc1157">RFC 1157</a> [<a href="#ref-9" title=""Simple Network Management Protocol"">9</a>]. A second version of the SNMP
message protocol, which is not an Internet standards track
protocol, is called SNMPv2c and described in <a href="./rfc1901">RFC 1901</a> [<a href="#ref-10" title=""Introduction to Community-based SNMPv2"">10</a>] and <a href="./rfc1906">RFC</a>
<a href="./rfc1906">1906</a> [<a href="#ref-11" title=""Transport Mappings for Version 2 of the Simple Network Management Protocol (SNMPv2)"">11</a>]. The third version of the message protocol is called
SNMPv3 and described in <a href="./rfc1906">RFC 1906</a> [<a href="#ref-11" title=""Transport Mappings for Version 2 of the Simple Network Management Protocol (SNMPv2)"">11</a>], <a href="./rfc2572">RFC 2572</a> [<a href="#ref-12" title=""Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)"">12</a>] and <a href="./rfc2574">RFC 2574</a>
[<a href="#ref-13" title=""User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)"">13</a>].
<span class="grey">Phaal, et al. Informational [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
o Protocol operations for accessing management information. The
first set of protocol operations and associated PDU formats is
described in STD 15, <a href="./rfc1157">RFC 1157</a> [<a href="#ref-9" title=""Simple Network Management Protocol"">9</a>]. A second set of protocol
operations and associated PDU formats is described in <a href="./rfc1905">RFC 1905</a>
[<a href="#ref-14" title=""Protocol Operations for Version 2 of the Simple Network Management Protocol (SNMPv2)"">14</a>].
o A set of fundamental applications described in <a href="./rfc2573">RFC 2573</a> [<a href="#ref-15" title=""SNMPv3 Applications"">15</a>] and
the view-based access control mechanism described in <a href="./rfc2575">RFC 2575</a>
[<a href="#ref-16" title=""View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)"">16</a>].
A more detailed introduction to the current SNMP Management Framework
can be found in <a href="./rfc2570">RFC 2570</a> [<a href="#ref-17" title=""Introduction to Version 3 of the Internet-standard Network Management Framework"">17</a>].
Managed objects are accessed via a virtual information store, termed
the Management Information Base or MIB. Objects in the MIB are
defined using the mechanisms defined in the SMI.
This memo specifies a MIB module that is compliant to the SMIv2. A
MIB conforming to the SMIv1 can be produced through the appropriate
translations. The resulting translated MIB must be semantically
equivalent, except where objects or events are omitted because no
translation is possible (use of Counter64). Some machine readable
information in SMIv2 will be converted into textual descriptions in
SMIv1 during the translation process. However, this loss of machine
readable information is not considered to change the semantics of the
MIB.
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a> Definitions</span>
SFLOW-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, Integer32, enterprises
FROM SNMPv2-SMI
SnmpAdminString
FROM SNMP-FRAMEWORK-MIB
OwnerString
FROM RMON-MIB
InetAddressType, InetAddress
FROM INET-ADDRESS-MIB
MODULE-COMPLIANCE, OBJECT-GROUP
FROM SNMPv2-CONF;
sFlowMIB MODULE-IDENTITY
LAST-UPDATED "200105150000Z" -- May 15, 2001
ORGANIZATION "InMon Corp."
CONTACT-INFO
<span class="grey">Phaal, et al. Informational [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
"Peter Phaal
InMon Corp.
<a href="http://www.inmon.com/">http://www.inmon.com/</a>
Tel: +1-415-661-6343
Email: peter_phaal@inmon.com"
DESCRIPTION
"The MIB module for managing the generation and transportation
of sFlow data records."
--
-- Revision History
--
REVISION "200105150000Z" -- May 15, 2001
DESCRIPTION
"Version 1.2
Brings MIB into SMI v2 compliance."
REVISION "200105010000Z" -- May 1, 2001
DESCRIPTION
"Version 1.1
Adds sFlowDatagramVersion."
::= { enterprises 4300 1 }
sFlowAgent OBJECT IDENTIFIER ::= { sFlowMIB 1 }
sFlowVersion OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Uniquely identifies the version and implementation of this MIB.
The version string must have the following structure:
<MIB Version>;<Organization>;<Software Revision>
where:
<MIB Version> must be '1.2', the version of this MIB.
<Organization> the name of the organization responsible
for the agent implementation.
<Revision> the specific software build of this agent.
As an example, the string '1.2;InMon Corp.;2.1.1' indicates
that this agent implements version '1.2' of the SFLOW MIB, that
it was developed by 'InMon Corp.' and that the software build
is '2.1.1'.
The MIB Version will change with each revision of the SFLOW
<span class="grey">Phaal, et al. Informational [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
MIB.
Management entities must check the MIB Version and not attempt
to manage agents with MIB Versions greater than that for which
they were designed.
Note: The sFlow Datagram Format has an independent version
number which may change independently from <MIB Version>.
<MIB Version> applies to the structure and semantics of
the SFLOW MIB only."
DEFVAL { "1.2;;" }
::= { sFlowAgent 1 }
sFlowAgentAddressType OBJECT-TYPE
SYNTAX InetAddressType
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The address type of the address associated with this agent.
Only ipv4 and ipv6 types are supported."
::= { sFlowAgent 2 }
sFlowAgentAddress OBJECT-TYPE
SYNTAX InetAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The IP address associated with this agent. In the case of a
multi-homed agent, this should be the loopback address of the
agent. The sFlowAgent address must provide SNMP connectivity
to the agent. The address should be an invariant that does not
change as interfaces are reconfigured, enabled, disabled,
added or removed. A manager should be able to use the
sFlowAgentAddress as a unique key that will identify this
agent over extended periods of time so that a history can
be maintained."
::= { sFlowAgent 3 }
sFlowTable OBJECT-TYPE
SYNTAX SEQUENCE OF SFlowEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"A table of the sFlow samplers within a device."
::= { sFlowAgent 4 }
sFlowEntry OBJECT-TYPE
SYNTAX SFlowEntry
<span class="grey">Phaal, et al. Informational [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"Attributes of an sFlow sampler."
INDEX { sFlowDataSource }
::= { sFlowTable 1 }
SFlowEntry ::= SEQUENCE {
sFlowDataSource OBJECT IDENTIFIER,
sFlowOwner OwnerString,
sFlowTimeout Integer32,
sFlowPacketSamplingRate Integer32,
sFlowCounterSamplingInterval Integer32,
sFlowMaximumHeaderSize Integer32,
sFlowMaximumDatagramSize Integer32,
sFlowCollectorAddressType InetAddressType,
sFlowCollectorAddress InetAddress,
sFlowCollectorPort Integer32,
sFlowDatagramVersion Integer32
}
sFlowDataSource OBJECT-TYPE
SYNTAX OBJECT IDENTIFIER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Identifies the source of the data for the sFlow sampler.
The following data source types are currently defined:
- ifIndex.<I>
DataSources of this traditional form are called 'port-based'.
Ideally the sampling entity will perform sampling on all flows
originating from or destined to the specified interface.
However, if the switch architecture only permits input or
output sampling then the sampling agent is permitted to only
sample input flows input or output flows. Each packet must
only be considered once for sampling, irrespective of the
number of ports it will be forwarded to.
Note: Port 0 is used to indicate that all ports on the device
are represented by a single data source.
- sFlowPacketSamplingRate applies to all ports on the
device capable of packet sampling.
- sFlowCounterSamplingInterval applies to all ports.
- smonVlanDataSource.<V>
A dataSource of this form refers to a 'Packet-based VLAN'
and is called a 'VLAN-based' dataSource. <V> is the VLAN
<span class="grey">Phaal, et al. Informational [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
ID as defined by the IEEE 802.1Q standard. The
value is between 1 and 4094 inclusive, and it represents
an 802.1Q VLAN-ID with global scope within a given
bridged domain.
Sampling is performed on all packets received that are part
of the specified VLAN (no matter which port they arrived on).
Each packet will only be considered once for sampling,
irrespective of the number of ports it will be forwarded to.
- entPhysicalEntry.<N>
A dataSource of this form refers to a physical entity within
the agent (e.g., entPhysicalClass = backplane(4)) and is called
an 'entity-based' dataSource.
Sampling is performed on all packets entering the resource (e.g.
If the backplane is being sampled, all packets transmitted onto
the backplane will be considered as single candidates for
sampling irrespective of the number of ports they ultimately
reach).
Note: Since each DataSource operates independently, a packet
that crosses multiple DataSources may generate multiple
flow records."
::= { sFlowEntry 1 }
sFlowOwner OBJECT-TYPE
SYNTAX OwnerString
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The entity making use of this sFlow sampler. The empty string
indicates that the sFlow sampler is currently unclaimed.
An entity wishing to claim an sFlow sampler must make sure
that the sampler is unclaimed before trying to claim it.
The sampler is claimed by setting the owner string to identify
the entity claiming the sampler. The sampler must be claimed
before any changes can be made to other sampler objects.
In order to avoid a race condition, the entity taking control
of the sampler must set both the owner and a value for
sFlowTimeout in the same SNMP set request.
When a management entity is finished using the sampler,
it should set its value back to unclaimed. The agent
must restore all other entities this row to their
default values when the owner is set to unclaimed.
This mechanism provides no enforcement and relies on the
cooperation of management entities in order to ensure that
<span class="grey">Phaal, et al. Informational [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
competition for a sampler is fairly resolved."
DEFVAL { "" }
::= { sFlowEntry 2 }
sFlowTimeout OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The time (in seconds) remaining before the sampler is released
and stops sampling. When set, the owner establishes control
for the specified period. When read, the remaining time in the
interval is returned.
A management entity wanting to maintain control of the sampler
is responsible for setting a new value before the old one
expires.
When the interval expires, the agent is responsible for
restoring all other entities in this row to their default
values."
DEFVAL { 0 }
::= { sFlowEntry 3 }
sFlowPacketSamplingRate OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The statistical sampling rate for packet sampling from this
source.
Set to N to sample 1/Nth of the packets in the monitored flows.
An agent should choose its own algorithm introduce variance
into the sampling so that exactly every Nth packet is not
counted. A sampling rate of 1 counts all packets. A sampling
rate of 0 disables sampling.
The agent is permitted to have minimum and maximum allowable
values for the sampling rate. A minimum rate lets the agent
designer set an upper bound on the overhead associated with
sampling, and a maximum rate may be the result of hardware
restrictions (such as counter size). In addition not all values
between the maximum and minimum may be realizable as the
sampling rate (again because of implementation considerations).
When the sampling rate is set the agent is free to adjust the
value so that it lies between the maximum and minimum values
<span class="grey">Phaal, et al. Informational [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
and has the closest achievable value.
When read, the agent must return the actual sampling rate it
will be using (after the adjustments previously described). The
sampling algorithm must converge so that over time the number
of packets sampled approaches 1/Nth of the total number of
packets in the monitored flows."
DEFVAL { 0 }
::= { sFlowEntry 4 }
sFlowCounterSamplingInterval OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The maximum number of seconds between successive samples of the
counters associated with this data source. A sampling interval
of 0 disables counter sampling."
DEFVAL { 0 }
::= { sFlowEntry 5 }
sFlowMaximumHeaderSize OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The maximum number of bytes that should be copied from a
sampled packet. The agent may have an internal maximum and
minimum permissible sizes. If an attempt is made to set this
value outside the permissible range then the agent should
adjust the value to the closest permissible value."
DEFVAL { 128 }
::= { sFlowEntry 6 }
sFlowMaximumDatagramSize OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The maximum number of data bytes that can be sent in a single
sample datagram. The manager should set this value to avoid
fragmentation of the sFlow datagrams."
DEFVAL { 1400 }
::= { sFlowEntry 7 }
sFlowCollectorAddressType OBJECT-TYPE
SYNTAX InetAddressType
MAX-ACCESS read-write
<span class="grey">Phaal, et al. Informational [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
STATUS current
DESCRIPTION
"The type of sFlowCollectorAddress."
DEFVAL { ipv4 }
::= { sFlowEntry 8 }
sFlowCollectorAddress OBJECT-TYPE
SYNTAX InetAddress
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The IP address of the sFlow collector.
If set to 0.0.0.0 all sampling is disabled."
DEFVAL { "0.0.0.0" }
::= { sFlowEntry 9 }
sFlowCollectorPort OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The destination port for sFlow datagrams."
DEFVAL { 6343 }
::= { sFlowEntry 10 }
sFlowDatagramVersion OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The version of sFlow datagrams that should be sent.
When set to a value not support by the agent, the agent should
adjust the value to the highest supported value less than the
requested value, or return an error if no such values exist."
DEFVAL { 4 }
::= { sFlowEntry 11 }
--
-- Compliance Statements
--
sFlowMIBConformance OBJECT IDENTIFIER ::= { sFlowMIB 2 }
sFlowMIBGroups OBJECT IDENTIFIER ::= { sFlowMIBConformance 1 }
sFlowMIBCompliances OBJECT IDENTIFIER ::= { sFlowMIBConformance 2 }
sFlowCompliance MODULE-COMPLIANCE
STATUS current
<span class="grey">Phaal, et al. Informational [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
DESCRIPTION
"Compliance statements for the sFlow Agent."
MODULE -- this module
MANDATORY-GROUPS { sFlowAgentGroup }
OBJECT sFlowAgentAddressType
SYNTAX InetAddressType { ipv4(1) }
DESCRIPTION
"Agents need only support ipv4."
OBJECT sFlowCollectorAddressType
SYNTAX InetAddressType { ipv4(1) }
DESCRIPTION
"Agents need only support ipv4."
::= { sFlowMIBCompliances 1 }
sFlowAgentGroup OBJECT-GROUP
OBJECTS { sFlowVersion, sFlowAgentAddressType, sFlowAgentAddress,
sFlowDataSource, sFlowOwner, sFlowTimeout,
sFlowPacketSamplingRate, sFlowCounterSamplingInterval,
sFlowMaximumHeaderSize, sFlowMaximumDatagramSize,
sFlowCollectorAddressType, sFlowCollectorAddress,
sFlowCollectorPort, sFlowDatagramVersion }
STATUS current
DESCRIPTION
"A collection of objects for managing the generation and
transportation of sFlow data records."
::= { sFlowMIBGroups 1 }
END
The sFlow MIB references definitions from a number of existing RFCs
[<a href="#ref-18" title=""Remote Network Monitoring Management Information Base"">18</a>], [<a href="#ref-19" title=""Remote Network Monitoring MIB Extensions for Switched Networks Version 1.0"">19</a>], [<a href="#ref-20" title=""Textual Conventions for Internet Network Addresses"">20</a>] and [<a href="#ref-21" title=""Traffic Flow Measurement: Meter MIB"">21</a>].
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. sFlow Datagram Format</span>
The sFlow datagram format specifies a standard format for the sFlow
Agent to send sampled data to a remote data collector.
The format of the sFlow datagram is specified using the XDR standard
[<a href="#ref-1" title=""XDR: External Data Representation Standard"">1</a>]. XDR is more compact than ASN.1 and simpler for the sFlow Agent
to encode and the sFlow Analyzer to decode.
Samples are sent as UDP packets to the host and port specified in the
SFLOW MIB. The lack of reliability in the UDP transport mechanism
does not significantly affect the accuracy of the measurements
obtained from an sFlow Agent.
<span class="grey">Phaal, et al. Informational [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
o If counter samples are lost then new values will be sent during
the next polling interval. The chance of an undetected counter
wrap is negligible. The sFlow datagram specifies 64 bit octet
counters, and with typical counter polling intervals between 20 to
120 seconds, the chance of a long enough sequence of sFlow
datagrams being lost to hide a counter wrap is very small.
o The net effect of lost flow samples is a slight reduction in the
effective sampling rate.
The use of UDP reduces the amount of memory required to buffer data.
UDP also provides a robust means of delivering timely traffic
information during periods of intense traffic (such as a denial of
service attack). UDP is more robust than a reliable transport
mechanism because under overload the only effect on overall system
performance is a slight increase in transmission delay and a greater
number of lost packets, neither of which has a significant effect on
an sFlow-based monitoring system. If a reliable transport mechanism
were used then an overload would introduce long transmission delays
and require large amounts of buffer memory on the agent.
While the sFlow Datagram structure permits multiple samples to be
included in each datagram, the sampling agent must not wait for a
buffer to fill with samples before sending the sample datagram.
sFlow sampling is intended to provide timely information on traffic.
The agent may at most delay a sample by 1 second before it is
required to send the datagram.
The agent should try to piggyback counter samples on the datagram
stream resulting from flow sampling. Before sending out a datagram
the remaining space in the buffer can be filled with counter samples.
The agent has discretion in the timing of its counter polling, the
specified counter sampling intervals sFlowCounterSamplingInterval is
a maximum, so the agent is free to sample counters early if it has
space in a datagram. If counters must be sent in order to satisfy
the maximum sampling interval then a datagram must be sent containing
the outstanding counters.
The following is the XDR description of an sFlow Datagram:
/* sFlow Datagram Version 4 */
/* Revision History
- version 4 adds support BGP communities
- version 3 adds support for extended_url information
*/
/* sFlow Sample types */
<span class="grey">Phaal, et al. Informational [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
/* Address Types */
typedef opaque ip_v4[4];
typedef opaque ip_v6[16];
enum address_type {
IP_V4 = 1,
IP_V6 = 2
}
union address (address_type type) {
case IP_V4:
ip_v4;
case IP_V6:
ip_v6;
}
/* Packet header data */
const MAX_HEADER_SIZE = 256; /* The maximum sampled header size. */
/* The header protocol describes the format of the sampled header */
enum header_protocol {
ETHERNET-ISO8023 = 1,
ISO88024-TOKENBUS = 2,
ISO88025-TOKENRING = 3,
FDDI = 4,
FRAME-RELAY = 5,
X25 = 6,
PPP = 7,
SMDS = 8,
AAL5 = 9,
AAL5-IP = 10, /* e.g., Cisco AAL5 mux */
IPv4 = 11,
IPv6 = 12,
MPLS = 13
}
struct sampled_header {
header_protocol protocol; /* Format of sampled header */
unsigned int frame_length; /* Original length of packet before
sampling */
opaque header<MAX_HEADER_SIZE>; /* Header bytes */
}
/* Packet IP version 4 data */
struct sampled_ipv4 {
<span class="grey">Phaal, et al. Informational [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
unsigned int length; /* The length of the IP packet excluding
lower layer encapsulations */
unsigned int protocol; /* IP Protocol type
(for example, TCP = 6, UDP = 17) */
ip_v4 src_ip; /* Source IP Address */
ip_v4 dst_ip; /* Destination IP Address */
unsigned int src_port; /* TCP/UDP source port number or
equivalent */
unsigned int dst_port; /* TCP/UDP destination port number or
equivalent */
unsigned int tcp_flags; /* TCP flags */
unsigned int tos; /* IP type of service */
}
/* Packet IP version 6 data */
struct sampled_ipv6 {
unsigned int length; /* The length of the IP packet excluding
lower layer encapsulations */
unsigned int protocol; /* IP next header
(for example, TCP = 6, UDP = 17) */
ip_v6 src_ip; /* Source IP Address */
ip_v6 dst_ip; /* Destination IP Address */
unsigned int src_port; /* TCP/UDP source port number or
equivalent */
unsigned int dst_port; /* TCP/UDP destination port number or
equivalent */
unsigned int tcp_flags; /* TCP flags */
unsigned int priority; /* IP priority */
}
/* Packet data */
enum packet_information_type {
HEADER = 1, /* Packet headers are sampled */
IPV4 = 2, /* IP version 4 data */
IPV6 = 3 /* IP version 6 data */
}
union packet_data_type (packet_information_type type) {
case HEADER:
sampled_header header;
case IPV4:
sampled_ipv4 ipv4;
case IPV6:
sampled_ipv6 ipv6;
}
<span class="grey">Phaal, et al. Informational [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
/* Extended data types */
/* Extended switch data */
struct extended_switch {
unsigned int src_vlan; /* The 802.1Q VLAN id of incoming frame */
unsigned int src_priority; /* The 802.1p priority of incoming
frame */
unsigned int dst_vlan; /* The 802.1Q VLAN id of outgoing frame */
unsigned int dst_priority; /* The 802.1p priority of outgoing
frame */
}
/* Extended router data */
struct extended_router {
address nexthop; /* IP address of next hop router */
unsigned int src_mask; /* Source address prefix mask bits */
unsigned int dst_mask; /* Destination address prefix mask bits */
}
/* Extended gateway data */
enum as_path_segment_type {
AS_SET = 1, /* Unordered set of ASs */
AS_SEQUENCE = 2 /* Ordered set of ASs */
}
union as_path_type (as_path_segment_type) {
case AS_SET:
unsigned int as_set<>;
case AS_SEQUENCE:
unsigned int as_sequence<>;
}
struct extended_gateway {
unsigned int as; /* Autonomous system number of router */
unsigned int src_as; /* Autonomous system number of source */
unsigned int src_peer_as; /* Autonomous system number of source
peer */
as_path_type dst_as_path<>; /* Autonomous system path to the
destination */
unsigned int communities<>; /* Communities associated with this
route */
unsigned int localpref; /* LocalPref associated with this
route */
}
<span class="grey">Phaal, et al. Informational [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
/* Extended user data */
struct extended_user {
string src_user<>; /* User ID associated with packet
source */
string dst_user<>; /* User ID associated with packet
destination */
}
/* Extended URL data */
enum url_direction {
src = 1, /* URL is associated with source
address */
dst = 2 /* URL is associated with destination
address */
}
struct extended_url {
url_direction direction; /* URL associated with packet source */
string url<>; /* URL associated with the packet flow */
}
/* Extended data */
enum extended_information_type {
SWITCH = 1, /* Extended switch information */
ROUTER = 2, /* Extended router information */
GATEWAY = 3, /* Extended gateway router information */
USER = 4, /* Extended TACACS/RADIUS user information */
URL = 5 /* Extended URL information */
}
union extended_data_type (extended_information_type type) {
case SWITCH:
extended_switch switch;
case ROUTER:
extended_router router;
case GATEWAY:
extended_gateway gateway;
case USER:
extended_user user;
case URL:
extended_url url;
}
/* Format of a single flow sample */
<span class="grey">Phaal, et al. Informational [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
struct flow_sample {
unsigned int sequence_number; /* Incremented with each flow sample
generated by this source_id */
unsigned int source_id; /* sFlowDataSource encoded as follows:
The most significant byte of the
source_id is used to indicate the
type of sFlowDataSource
(0 = ifIndex,
1 = smonVlanDataSource,
2 = entPhysicalEntry) and the
lower three bytes contain the
relevant index value.*/
unsigned int sampling_rate; /* sFlowPacketSamplingRate */
unsigned int sample_pool; /* Total number of packets that could
have been sampled (i.e., packets
skipped by sampling process + total
number of samples) */
unsigned int drops; /* Number times a packet was dropped
due to lack of resources */
unsigned int input; /* SNMP ifIndex of input interface.
0 if interface is not known. */
unsigned int output; /* SNMP ifIndex of output interface,
0 if interface is not known.
Set most significant bit to
indicate multiple destination
interfaces (i.e., in case of
broadcast or multicast)
and set lower order bits to
indicate number of destination
interfaces.
Examples:
0x00000002 indicates ifIndex =
2
0x00000000 ifIndex unknown.
0x80000007 indicates a packet
sent to 7
interfaces.
0x80000000 indicates a packet
sent to an unknown
number of interfaces
greater than 1. */
packet_data_type packet_data; /* Information about sampled
packet */
extended_data_type extended_data<>; /* Extended flow information */
}
<span class="grey">Phaal, et al. Informational [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
/* Counter types */
/* Generic interface counters - see <a href="./rfc2233">RFC 2233</a> */
struct if_counters {
unsigned int ifIndex;
unsigned int ifType;
unsigned hyper ifSpeed;
unsigned int ifDirection; /* derived from MAU MIB (<a href="./rfc2668">RFC 2668</a>)
0 = unknown, 1=full-duplex,
2=half-duplex, 3 = in, 4=out */
unsigned int ifStatus; /* bit field with the following bits
assigned
bit 0 = ifAdminStatus
(0 = down, 1 = up)
bit 1 = ifOperStatus
(0 = down, 1 = up) */
unsigned hyper ifInOctets;
unsigned int ifInUcastPkts;
unsigned int ifInMulticastPkts;
unsigned int ifInBroadcastPkts;
unsigned int ifInDiscards;
unsigned int ifInErrors;
unsigned int ifInUnknownProtos;
unsigned hyper ifOutOctets;
unsigned int ifOutUcastPkts;
unsigned int ifOutMulticastPkts;
unsigned int ifOutBroadcastPkts;
unsigned int ifOutDiscards;
unsigned int ifOutErrors;
unsigned int ifPromiscuousMode;
}
/* Ethernet interface counters - see <a href="./rfc2358">RFC 2358</a> */
struct ethernet_counters {
if_counters generic;
unsigned int dot3StatsAlignmentErrors;
unsigned int dot3StatsFCSErrors;
unsigned int dot3StatsSingleCollisionFrames;
unsigned int dot3StatsMultipleCollisionFrames;
unsigned int dot3StatsSQETestErrors;
unsigned int dot3StatsDeferredTransmissions;
unsigned int dot3StatsLateCollisions;
unsigned int dot3StatsExcessiveCollisions;
unsigned int dot3StatsInternalMacTransmitErrors;
unsigned int dot3StatsCarrierSenseErrors;
unsigned int dot3StatsFrameTooLongs;
<span class="grey">Phaal, et al. Informational [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
unsigned int dot3StatsInternalMacReceiveErrors;
unsigned int dot3StatsSymbolErrors;
}
/* FDDI interface counters - see <a href="./rfc1512">RFC 1512</a> */
struct fddi_counters {
if_counters generic;
}
/* Token ring counters - see <a href="./rfc1748">RFC 1748</a> */
struct tokenring_counters {
if_counters generic;
unsigned int dot5StatsLineErrors;
unsigned int dot5StatsBurstErrors;
unsigned int dot5StatsACErrors;
unsigned int dot5StatsAbortTransErrors;
unsigned int dot5StatsInternalErrors;
unsigned int dot5StatsLostFrameErrors;
unsigned int dot5StatsReceiveCongestions;
unsigned int dot5StatsFrameCopiedErrors;
unsigned int dot5StatsTokenErrors;
unsigned int dot5StatsSoftErrors;
unsigned int dot5StatsHardErrors;
unsigned int dot5StatsSignalLoss;
unsigned int dot5StatsTransmitBeacons;
unsigned int dot5StatsRecoverys;
unsigned int dot5StatsLobeWires;
unsigned int dot5StatsRemoves;
unsigned int dot5StatsSingles;
unsigned int dot5StatsFreqErrors;
}
/* 100 BaseVG interface counters - see <a href="./rfc2020">RFC 2020</a> */
struct vg_counters {
if_counters generic;
unsigned int dot12InHighPriorityFrames;
unsigned hyper dot12InHighPriorityOctets;
unsigned int dot12InNormPriorityFrames;
unsigned hyper dot12InNormPriorityOctets;
unsigned int dot12InIPMErrors;
unsigned int dot12InOversizeFrameErrors;
unsigned int dot12InDataErrors;
unsigned int dot12InNullAddressedFrames;
unsigned int dot12OutHighPriorityFrames;
unsigned hyper dot12OutHighPriorityOctets;
unsigned int dot12TransitionIntoTrainings;
<span class="grey">Phaal, et al. Informational [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
unsigned hyper dot12HCInHighPriorityOctets;
unsigned hyper dot12HCInNormPriorityOctets;
unsigned hyper dot12HCOutHighPriorityOctets;
}
/* WAN counters */
struct wan_counters {
if_counters generic;
}
/* VLAN counters */
struct vlan_counters {
unsigned int vlan_id;
unsigned hyper octets;
unsigned int ucastPkts;
unsigned int multicastPkts;
unsigned int broadcastPkts;
unsigned int discards;
}
/* Counter data */
enum counters_version {
GENERIC = 1,
ETHERNET = 2,
TOKENRING = 3,
FDDI = 4,
VG = 5,
WAN = 6,
VLAN = 7
}
union counters_type (counters_version version) {
case GENERIC:
if_counters generic;
case ETHERNET:
ethernet_counters ethernet;
case TOKENRING:
tokenring_counters tokenring;
case FDDI:
fddi_counters fddi;
case VG:
vg_counters vg;
case WAN:
wan_counters wan;
case VLAN:
<span class="grey">Phaal, et al. Informational [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
vlan_counters vlan;
}
/* Format of a single counter sample */
struct counters_sample {
unsigned int sequence_number; /* Incremented with each counter
sample generated by this
source_id */
unsigned int source_id; /* sFlowDataSource encoded as
follows:
The most significant byte of the
source_id is used to indicate the
type of sFlowDataSource
(0 = ifIndex,
1 = smonVlanDataSource,
2 = entPhysicalEntry) and the
lower three
bytes contain the relevant
index value.*/
unsigned int sampling_interval; /* sFlowCounterSamplingInterval*/
counters_type counters;
}
/* Format of a sample datagram */
enum sample_types {
FLOWSAMPLE = 1,
COUNTERSSAMPLE = 2
}
union sample_type (sample_types sampletype) {
case FLOWSAMPLE:
flow_sample flowsample;
case COUNTERSSAMPLE:
counters_sample counterssample;
}
struct sample_datagram_v4 {
address agent_address /* IP address of sampling agent,
sFlowAgentAddress. */
unsigned int sequence_number; /* Incremented with each sample
datagram generated */
unsigned int uptime; /* Current time (in milliseconds since
device last booted). Should be set
as close to datagram transmission
time as possible.*/
<span class="grey">Phaal, et al. Informational [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
sample_type samples<>; /* An array of flow, counter and delay
samples */
}
enum datagram_version {
VERSION4 = 4
}
union sample_datagram_type (datagram_version version) {
case VERSION4:
sample_datagram_v4 datagram;
}
struct sample_datagram {
sample_datagram_type version;
}
The sFlow Datagram specification makes use of definitions from a
number of existing RFCs [<a href="#ref-22" title=""Definition of Managed Objects for IEEE 802.3 Medium Attachment Units (MAUs)"">22</a>], [<a href="#ref-23" title=""The Interfaces Group MIB using SMIv2"">23</a>], [<a href="#ref-24" title=""Definition of Managed Objects for the Ethernet-like Interface Types"">24</a>], [<a href="#ref-25" title=""FDDI Management Information Base"">25</a>], [<a href="#ref-26" title=""IEEE 802.5 MIB using SMIv2"">26</a>], [<a href="#ref-27" title=""Definitions of Managed Objects for IEEE 802.12 Interfaces"">27</a>] and [<a href="#ref-28" title=""Definitions of Managed Objects for the Fourth Version of the Border Gateway Protocol (BGP-4) using SMIv2"">28</a>].
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Security Considerations</span>
Deploying a traffic monitoring system raises a number of security
related issues. sFlow does not provide specific security mechanisms,
relying instead on proper deployment and configuration to maintain an
adequate level of security.
While the deployment of traffic monitoring systems does create some
risk, it also provides a powerful means of detecting and tracing
unauthorized network activity.
This section is intended to provide information that will help
understand potential risks and configuration options for mitigating
those risks.
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a> Control</span>
The sFlow MIB is used to configure the generation of sFlow samples.
The security of SNMP, with access control lists, is usually
considered adequate in an enterprise setting. However, there are
situations when these security measures are insufficient (for example
a WAN router) and SNMP configuration control will be disabled.
When SNMP is disabled, a command line interface is typically
provided. The following arguments are required to configure sFlow
sampling on an interface.
<span class="grey">Phaal, et al. Informational [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
-sFlowDataSource <source>
-sFlowPacketSamplingRate <rate>
-sFlowCounterSamplingInterval <interval>
-sFlowMaximumHeaderSize <header size>
-sFlowMaximumDatagramSize <datagram size>
-sFlowCollectorAddress <address>
-sFlowCollectorPort <port>
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a> Transport</span>
Traffic information is sent unencrypted across the network from the
sFlow Agent to the sFlow Analyzer and is thus vulnerable to
eavesdropping. This risk can be limited by creating a secure
measurement network and routing the sFlow Datagrams over this
network. The choice of technology for creating the secure
measurement network is deployment specific, but could include the use
of VLANs or VPN tunnels.
The sFlow Analyzer is vulnerable to attacks involving spoofed sFlow
Datagrams. To limit this vulnerability the sFlow Analyzer should
check sequence numbers and verify source addresses. If a secure
measurement network has been constructed then only sFlow Datagrams
received from that network should be processed.
<span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a> Confidentiality</span>
Traffic information can reveal confidential information about
individual network users. The degree of visibility of application
level data can be controlled by limiting the number of header bytes
captured by the sFlow agent. In addition, packet sampling makes it
virtually impossible to capture sequences of packets from an
individual transaction.
The traffic patterns discernible by decoding the sFlow Datagrams in
the sFlow Analyzer can reveal details of an individual's network
related activities and due care should be taken to secure access to
the sFlow Analyzer.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. References</span>
[<a id="ref-1">1</a>] Sun Microsystems, Inc., "XDR: External Data Representation
Standard", <a href="./rfc1014">RFC 1014</a>, June 1987.
[<a id="ref-2">2</a>] Harrington, D., Presuhn, R., and B. Wijnen, "An Architecture
for Describing SNMP Management Frameworks", <a href="./rfc2571">RFC 2571</a>, April
1999.
<span class="grey">Phaal, et al. Informational [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
[<a id="ref-3">3</a>] Rose, M. and K. McCloghrie, "Structure and Identification of
Management Information for TCP/IP-based Internets", STD 16, <a href="./rfc1155">RFC</a>
<a href="./rfc1155">1155</a>, May 1990.
[<a id="ref-4">4</a>] Rose, M. and K. McCloghrie, "Concise MIB Definitions", STD 16,
<a href="./rfc1212">RFC 1212</a>, March 1991.
[<a id="ref-5">5</a>] Rose, M., "A Convention for Defining Traps for use with the
SNMP", <a href="./rfc1215">RFC 1215</a>, March 1991.
[<a id="ref-6">6</a>] McCloghrie, K., Perkins, D., Schoenwaelder, J., Case, J., Rose,
M. and S. Waldbusser, "Structure of Management Information
Version 2 (SMIv2)", STD 58, <a href="./rfc2578">RFC 2578</a>, April 1999.
[<a id="ref-7">7</a>] McCloghrie, K., Perkins, D., Schoenwaelder, J., Case, J., Rose,
M. and S. Waldbusser, "Textual Conventions for SMIv2", STD 58,
<a href="./rfc2579">RFC 2579</a>, April 1999.
[<a id="ref-8">8</a>] McCloghrie, K., Perkins, D., Schoenwaelder, J., Case, J., Rose,
M. and S. Waldbusser, "Conformance Statements for SMIv2", STD
58, <a href="./rfc2580">RFC 2580</a>, April 1999.
[<a id="ref-9">9</a>] Case, J., Fedor, M., Schoffstall, M. and J. Davin, "Simple
Network Management Protocol", STD 15, <a href="./rfc1157">RFC 1157</a>, May 1990.
[<a id="ref-10">10</a>] Case, J., McCloghrie, K., Rose, M. and S. Waldbusser,
"Introduction to Community-based SNMPv2", <a href="./rfc1901">RFC 1901</a>, January
1996.
[<a id="ref-11">11</a>] Case, J., McCloghrie, K., Rose, M. and S. Waldbusser,
"Transport Mappings for Version 2 of the Simple Network
Management Protocol (SNMPv2)", <a href="./rfc1906">RFC 1906</a>, January 1996.
[<a id="ref-12">12</a>] Case, J., Harrington D., Presuhn R. and B. Wijnen, "Message
Processing and Dispatching for the Simple Network Management
Protocol (SNMP)", <a href="./rfc2572">RFC 2572</a>, April 1999.
[<a id="ref-13">13</a>] Blumenthal, U. and B. Wijnen, "User-based Security Model (USM)
for version 3 of the Simple Network Management Protocol
(SNMPv3)", <a href="./rfc2574">RFC 2574</a>, April 1999.
[<a id="ref-14">14</a>] Case, J., McCloghrie, K., Rose, M. and S. Waldbusser, "Protocol
Operations for Version 2 of the Simple Network Management
Protocol (SNMPv2)", <a href="./rfc1905">RFC 1905</a>, January 1996.
[<a id="ref-15">15</a>] Levi, D., Meyer, P. and B. Stewart, "SNMPv3 Applications", <a href="./rfc2573">RFC</a>
<a href="./rfc2573">2573</a>, April 1999.
<span class="grey">Phaal, et al. Informational [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
[<a id="ref-16">16</a>] Wijnen, B., Presuhn, R. and K. McCloghrie, "View-based Access
Control Model (VACM) for the Simple Network Management Protocol
(SNMP)", <a href="./rfc2575">RFC 2575</a>, April 1999.
[<a id="ref-17">17</a>] Case, J., Mundy, R., Partain, D. and B. Stewart, "Introduction
to Version 3 of the Internet-standard Network Management
Framework", <a href="./rfc2570">RFC 2570</a>, April 1999.
[<a id="ref-18">18</a>] Waldbusser, S., "Remote Network Monitoring Management
Information Base", <a href="./rfc2819">RFC 2819</a>, May 2000.
[<a id="ref-19">19</a>] Waterman, R., Lahaye, B., Romascanu, D. and S. Waldbusser,
"Remote Network Monitoring MIB Extensions for Switched Networks
Version 1.0", <a href="./rfc2613">RFC 2613</a>, June 1999.
[<a id="ref-20">20</a>] Daniele, M., Haberman, B., Routhier, S. and J. Schoenwaelder,
"Textual Conventions for Internet Network Addresses", <a href="./rfc2851">RFC 2851</a>,
June 2000.
[<a id="ref-21">21</a>] Brownlee, N., "Traffic Flow Measurement: Meter MIB", <a href="./rfc2720">RFC 2720</a>,
October 1999.
[<a id="ref-22">22</a>] Smith, A., Flick, J., de Graaf, K., Romanscanu, D., McMaster,
D., McCloghrie, K. and S. Roberts, "Definition of Managed
Objects for IEEE 802.3 Medium Attachment Units (MAUs)", <a href="./rfc2668">RFC</a>
<a href="./rfc2668">2668</a>, August 1999.
[<a id="ref-23">23</a>] McCloghrie, K. and F. Kastenholz, "The Interfaces Group MIB
using SMIv2", <a href="./rfc2233">RFC 2233</a>, November 1997.
[<a id="ref-24">24</a>] Flick, J. and J. Johnson, "Definition of Managed Objects for
the Ethernet-like Interface Types", <a href="./rfc2358">RFC 2358</a>, June 1998.
[<a id="ref-25">25</a>] Case, J., "FDDI Management Information Base", <a href="./rfc1512">RFC 1512</a>,
September 1993.
[<a id="ref-26">26</a>] McCloghrie, K. and E. Decker, "IEEE 802.5 MIB using SMIv2", <a href="./rfc1748">RFC</a>
<a href="./rfc1748">1748</a>, December 1994.
[<a id="ref-27">27</a>] Flick, J., "Definitions of Managed Objects for IEEE 802.12
Interfaces", <a href="./rfc2020">RFC 2020</a>, October 1996.
[<a id="ref-28">28</a>] Willis, S., Burruss, J. and J. Chu, "Definitions of Managed
Objects for the Fourth Version of the Border Gateway Protocol
(BGP-4) using SMIv2", <a href="./rfc1657">RFC 1657</a>, July 1994.
<span class="grey">Phaal, et al. Informational [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Authors' Addresses</span>
Peter Phaal
InMon Corporation
1404 Irving Street
San Francisco, CA 94122
Phone: (415) 661-6343
EMail: peter_phaal@INMON.COM
Sonia Panchen
InMon Corporation
1404 Irving Street
San Francisco, CA 94122
Phone: (415) 661-6343
EMail: sonia_panchen@INMON.COM
Neil McKee
InMon Corporation
1404 Irving Street
San Francisco, CA 94122
Phone: (415) 661-6343
EMail: neil_mckee@INMON.COM
<span class="grey">Phaal, et al. Informational [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Intellectual Property Statement</span>
The IETF takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; neither does it represent that it
has made any effort to identify any such rights. Information on the
IETF's procedures with respect to rights in standards-track and
standards-related documentation can be found in <a href="https://www.rfc-editor.org/bcp/bcp11">BCP-11</a>. Copies of
claims of rights made available for publication and any assurances of
licenses to be made available, or the result of an attempt made to
obtain a general license or permission for the use of such
proprietary rights by implementors or users of this specification can
be obtained from the IETF Secretariat.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to practice
this standard. Please address the information to the IETF Executive
Director.
<span class="grey">Phaal, et al. Informational [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc3176">RFC 3176</a> InMon Corporation's sFlow September 2001</span>
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. Full Copyright Statement</span>
Copyright (C) The Internet Society (2001). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Phaal, et al. Informational [Page 31]
</pre>
|