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
|
<HTML>
<HEAD>
<TITLE>FlowScan - a system to analyze and report on cflowd flow files
</TITLE>
</HEAD>
<BODY>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#NAME">NAME</A>
<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
<LI><A HREF="#Use_the_Mailing_List">Use the Mailing List</A>
<LI><A HREF="#Upgrading">Upgrading</A>
<UL>
<LI><A HREF="#Software_Upgrade_Requirements">Software Upgrade Requirements</A>
<LI><A HREF="#Configuring_FlowScan_when_Upgrad">Configuring FlowScan when Upgrading</A>
<LI><A HREF="#Generating_Graphs_after_Upgradin">Generating Graphs after Upgrading</A>
<LI><A HREF="#Done_Upgrading">Done Upgrading </A>
</UL>
<LI><A HREF="#Initial_Install_Requirements">Initial Install Requirements</A>
<UL>
<LI><A HREF="#Hardware_Requirements">Hardware Requirements</A>
<LI><A HREF="#Software_Requirements">Software Requirements</A>
</UL>
<LI><A HREF="#Configuring_FlowScan_Prerequisit">Configuring FlowScan Prerequisites</A>
<UL>
<LI><A HREF="#Choose_a_User_to_Run_cflowd_and_">Choose a User to Run cflowd and FlowScan</A>
<LI><A HREF="#Configuring_Your_Host">Configuring Your Host</A>
<LI><A HREF="#Configuring_Your_Ciscos">Configuring Your Ciscos</A>
<LI><A HREF="#Configuring_cflowd">Configuring cflowd</A>
</UL>
<LI><A HREF="#Configuring_FlowScan">Configuring FlowScan</A>
<UL>
<LI><A HREF="#Configure_and_Install">Configure and Install</A>
<LI><A HREF="#Create_the_Output_Directory">Create the Output Directory</A>
<LI><A HREF="#FlowScan_Configuration_Files">FlowScan Configuration Files</A>
<LI><A HREF="#Preserving_Old_Flow_Files">Preserving "Old" Flow Files</A>
</UL>
<LI><A HREF="#Testing_FlowScan">Testing FlowScan</A>
<LI><A HREF="#Performance_Problems_">Performance Problems?</A>
<LI><A HREF="#Final_Setup">Final Setup</A>
<LI><A HREF="#Generating_Graphs">Generating Graphs</A>
<UL>
<LI><A HREF="#Supplied_Graphs">Supplied Graphs</A>
<LI><A HREF="#Adding_Events_to_Graphs">Adding Events to Graphs</A>
<LI><A HREF="#Custom_Graphs">Custom Graphs</A>
<LI><A HREF="#Future_Directions_for_Graphs">Future Directions for Graphs</A>
</UL>
<LI><A HREF="#Copyright_and_Disclaimer">Copyright and Disclaimer</A>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="NAME">NAME
</A></H1>
FlowScan - a system to analyze and report on cflowd flow files
<P>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION
</A></H1>
This document is the FlowScan User Manual $Revision: 1.23 $, $Date:
2001/02/28 21:48:08 $. It describes the installation and setup of <CODE>FlowScan-1.006</CODE>.
<P>
FlowScan is a system which scans cflowd-format raw flow files and reports
on what it finds. There are two report modules that are included. The <CODE>CampusIO</CODE> report module produced the graphs at:
<P>
<PRE> <A HREF="http://wwwstats.net.wisc.edu">http://wwwstats.net.wisc.edu</A>
</PRE>
<P>
which show traffic in and out through a peering point or network border.
The <CODE>SubNetIO</CODE> report updates RRD files for each of the subnets that you specify (so that
you can produce graphs of <CODE>CampusIO</CODE>
by subnet).
<P>
The idea behind the distinct report modules is that users will be able to
write new reports that are either derived-classes from <CODE>CampusIO</CODE>
or altogether new ones. For instance, one may wish to write a report module
called <CODE>Abuse</CODE> which would send email when it detected potentially abusive things going
on, like Denial-of-Service attacks and various scans.
<P>
FlowScan is freely-available under the GPL, the GNU General Public License.
<P>
<P>
<HR>
<H1><A NAME="Use_the_Mailing_List">Use the Mailing List
</A></H1>
Please help me to help you. It is, unfortunately, not uncommon for one to
have questions or problems while installing FlowScan. Please do not send
email about such things to my personal email address, but instead check the
FlowScan mailing list archive, and join the FlowScan mailing list.
Information about the FlowScan mailing lists can be found at:
<P>
<PRE> <A HREF="http://net.doit.wisc.edu/~plonka/FlowScan/#Mailing_Lists">http://net.doit.wisc.edu/~plonka/FlowScan/#Mailing_Lists</A>
</PRE>
<P>
By reading and participating in the list, you will be helping me to use my
time effectively so that others will benefit from questions answered and
issues raised.
<P>
The mailing lists' archives are available at:
<P>
<PRE> <A HREF="http://net.doit.wisc.edu/~plonka/list/flowscan">http://net.doit.wisc.edu/~plonka/list/flowscan</A>
</PRE>
<P>
and:
<P>
<PRE> <A HREF="http://net.doit.wisc.edu/~plonka/list/flowscan-announce">http://net.doit.wisc.edu/~plonka/list/flowscan-announce</A>
</PRE>
<P>
<P>
<HR>
<H1><A NAME="Upgrading">Upgrading
</A></H1>
<STRONG>First-time</STRONG> FlowScan users should skip to <A HREF="#Initial_Install_Requirements">Initial Install Requirements</A>, below.
<P>
If you have previously installed and properly configured
<CODE>FlowScan-1.005</CODE>, you need only perform a subset of the steps that one would normally have
to perform for an initial installation.
<P>
This release of FlowScan uses more memory than previous releases. That is,
the <CODE>flowscan</CODE> process will grow to a larger size than that in
<CODE>FlowScan-1.005</CODE>. In my recent experience while testing this release, the <CODE>flowscan</CODE> process size to approximately 128MB when I use the new experimental <CODE>BGPDumpFile</CODE> option to produce ``Top'' reports by ASN. This is hopefully understandable
since <CODE>flowscan</CODE> is carrying a full internet routing table when configured in this way. The
memory requirements are significantly lessened if you do not use the
<CODE>BGPDumpFile</CODE> option. The <CODE>flowscan</CODE> process' size is also a function of the number of active hosts in your
network.
<P>
<P>
<HR>
<H2><A NAME="Software_Upgrade_Requirements">Software Upgrade Requirements
</A></H2>
<UL>
<LI><STRONG><A NAME="item_Upgrading">Upgrading perl Modules
</A></STRONG>
Upgrade the <CODE>Cflow</CODE> perl module to <CODE>Cflow-1.030</CODE> or later for improved performance. Install <CODE>HTML::Table</CODE> in case you want to produce the new ``Top Talkers'' reports. Details on how
to obtain and install these modules can be found in <A HREF="#Software_Requirements">Software Requirements</A>, below.
<P>
<LI><STRONG><A NAME="item_Upgrading">Upgrading FlowScan
</A></STRONG>
Of course, when upgrading you will need to obtain the current FlowScan.
When you run <EM>configure</EM>, you should specify the same value with <CODE>--prefix</CODE> that you did when installing your existing FlowScan, e.g. <EM>/var/local/flows</EM>, or wherever your time-stamped raw flow files are currently being written
by <CODE>cflowd</CODE>.
<P>
</UL>
<P>
<HR>
<H2><A NAME="Configuring_FlowScan_when_Upgrad">Configuring FlowScan when Upgrading
</A></H2>
There is now POD documentation provided with the CampusIO and SubNetIO
reports. Please use that as the definitive reference on configuration
options for those reports, e.g.:
<P>
<PRE> $ cd bin
$ perldoc CampusIO
</PRE>
<P>
Here are a few things that changed regarding the FlowScan configuration:
<P>
<DL>
<DT><STRONG><A NAME="item_Upgrading">Upgrading CampusIO and/or SubNetIO Configuration Files
</A></STRONG><DD>
There are new <CODE>TopN</CODE> and <CODE>ReportPrefixFormat</CODE> directives for
<CODE>CampusIO</CODE> and <CODE>SubNetIO</CODE>. These directives enable the production of ``Top Talker'' reports.
Furthermore there are new <STRONG>experimental</STRONG>
<CODE>BGPDumpFile</CODE> and <CODE>ASNFile</CODE> options <CODE>CampusIO</CODE> which are used to produce ``Top'' reports by Autonomous System. You will
need access a Cisco carrying a full BGP routing table to produce such
reports. See the CampusIO configuration documentation for more info about
configuring this feature. If you have trouble with it, remember that it is
experimental, so please join the discussion in the mailing list.
<P>
Secondly, the <EM>Napster_subnets.boulder</EM> has changed significantly since that provided with FlowScan-1.005. If you
have FlowScan configured to measure Napster traffic, replace your old
<EM>Napster_subnets.boulder</EM> with the one from the newer distribution:
<P>
<PRE> $ cp cf/Napster_subnets.boulder $PREFIX/bin/Napster_subnets.boulder
</PRE>
<P>
<DT><STRONG>Upgrading your RRD Files
</A></STRONG><DD>
If you are upgrading, it is necessary to add two new Data Sources to the
some of your existing RRD files. Before running flowscan, backup your RRD
files, e.g.:
<P>
<PRE> $ cd $prefix/graphs
$ tar cf saved_rrd_files.tar *.rrd
</PRE>
<P>
then do this:
<P>
<PRE> $ cd $prefix/graphs
$ ../bin/add_txrx total.rrd [1-9]*.*.*.*_*.rrd
</PRE>
<P>
</DL>
<P>
<HR>
<H2><A NAME="Generating_Graphs_after_Upgradin">Generating Graphs after Upgrading
</A></H2>
A number of new features have been added to the <EM>graphs.mf</EM> template Makefile. Some of these are described below in <A HREF="#Supplied_Graphs">Supplied Graphs</A>. You may wish to copy <EM>graphs.mf</EM> to your <EM>graphs</EM>
sub-directory.
<P>
While it is not required, I highly recommend installing <CODE>RRGrapher</CODE> if you want to produce other graphs. It is referenced below in <A HREF="#Custom_Graphs">Custom Graphs</A>.
<P>
<P>
<HR>
<H2><A NAME="Done_Upgrading">Done Upgrading
</A></H2>
That should be it for upgrading!
<P>
<P>
<HR>
<H1><A NAME="Initial_Install_Requirements">Initial Install Requirements
</A></H1>
<P>
<HR>
<H2><A NAME="Hardware_Requirements">Hardware Requirements
</A></H2>
<UL>
<LI><STRONG><A NAME="item_Cisco">Cisco routers
</A></STRONG>
If you don't have Cisco at your border, you're probably barking up the
wrong tree with this package. Also, FlowScan currently requires that your
IOS version supports NetFlow version 5. Try this command on your router if
you are unsure:
<P>
<PRE> ip flow-export version ?
</PRE>
<P>
<LI><STRONG><A NAME="item_a">a GNU/Linux or Unix machine
</A></STRONG>
If you have a trivial amount of traffic being exported to cflowd, such as a
T1's worth, perhaps any old machine will do.
<P>
However, if you want to process a fair amount of traffic (e.g. at ~OC-3
rates) you'll want a <EM>fast</EM> machine.
<P>
I've run FlowScan on a SPARC Ultra-30 w/256MB running Solaris 2.6, a Dell
Precision 610 (dual Pentium III, 2x450Mhz) w/128MB running Debian Linux
2.1, and most recenlty a dual PIII Dell server, 2x600Mhz, w/256MB running
Debian Linux 2.2r2. The Intel machines are definitely preferably in the
sense that <CODE>flowscan</CODE> processes flows in about 40% of the time that it took the SPARC. (The main <CODE>flowscan</CODE> script itself is currently single-threaded.)
<P>
In an early performance test of mine, using 24 hours of flows from our
peering router here at UW-Madison, here's the comparison of their ave. time
to process 5 minutes of flows:
<P>
<PRE> SPARC - 284 sec
Intel - 111 sec
</PRE>
<P>
Note that it is important that flowscan doesn't take longer to process the
flows than it does for your network's activity and exporting Cisco routers
to produce the flows. So, you want to keep the time to process 5 minutes of
flows under 300 seconds on average.
<P>
My recent testing has indicated that 600-850MHz PIII machines can usually
process 3000-4000 flows per second, if <CODE>flowscan</CODE> doesn't have to compete with too many other processes.
<P>
<LI><STRONG><A NAME="item_Disk">Disk Space
</A></STRONG>
I recommend devoting a file-system to cflowd and FlowScan. Both require
disk space and the amount depends upon a number of things:
<P>
<UL>
<LI><STRONG><A NAME="item_The">The rate of flows being exported and collected
</A></STRONG>
<LI><STRONG><A NAME="item_The">The rate at which FlowScan is able to process (and remove) those files
</A></STRONG>
<LI><STRONG><A NAME="item_Whether">Whether or not you have configured FlowScan to "save" flow files
</A></STRONG>
<LI><STRONG><A NAME="item_The">The number of hours after which you remove gzip(1)ped flow files
</A></STRONG>
</UL>
To find the characteristics of your environment, you'll just have to run
the patched cflowd for a little while to see what you get.
<P>
Early in this project (c. 1999), we were usually collecting about
150-300,000 flows from our peering router every 5 minutes. Recently, our
5-minute flow files average ~15 to 20 MB in size.
<P>
During a recent inbound Denial-of-Service attack consisting of 40-byte TCP
SYN packets with random source addresses and port numbers, I've seen a
single ``5-minute'' flow file greater than 500MB! Even on our fast machine,
that single file took hours to process.
<P>
Surely YMMV, currently a 35GB file-system allows us to preserve
<CODE>gzip(1)</CODE>ped flow files for about 2 weeks.
<P>
<LI><STRONG><A NAME="item_Network">Network Interface Card
</A></STRONG>
Regarding the host machine configuration, consider the amount of traffic
that may be exported from your <CODE>Cisco(s)</CODE> to your collector
machine if you have enabled <CODE>ip route-cache flow</CODE> on very many fast interfaces. With lots of exported flow data (e.g. 15-20
MB of raw flow file data every 5 minutes) and only a 10 Mb/s ethernet NIC,
I found that the host was dropping some of the incoming UDP packets, even
though the rate of incoming flows was less than 2 Mb/s. This was evidenced
by a constantly-increasing number of <CODE>udpInOverflows</CODE> in the
<CODE>netstat -s</CODE> output under Solaris. I addressed this by reconfiguring my hosts with a 100
Mb/s fast ethernet NIC or 155 Mb/s OC-3 ATM LANE interface and have not
seen that problem since. Of course, one should assure that the requisite
bandwidth is available along the full path between the exporting
<CODE>Cisco(s)</CODE> and the collecting host.
<P>
</UL>
<P>
<HR>
<H2><A NAME="Software_Requirements">Software Requirements
</A></H2>
The packages and perl modules required by FlowScan are numerous. Their
presence or absence will be detected by FlowScan's <EM>configure</EM> script but you'll save yourself some frustration by getting ahead of the
game by collecting and installing them first. Below, I've attempted to
present them in a reasonable order in which to obtain, build, and install
them.
<P>
<UL>
<LI><STRONG><A NAME="item_arts">arts++
</A></STRONG>
arts++ is required by cflowd and is available at:
<P>
<PRE> <A HREF="ftp://ftp.caida.org/pub/arts++/">ftp://ftp.caida.org/pub/arts++/</A>
</PRE>
<P>
As of arts++-1-1-a5, the arts++ build appears to require GNU make 3.79
because its Makefiles use glob for header dependencies, e.g. ``*.hh''. From
my cursory look at the GNU make ChangeLog, perhaps any version >=
3.78.90 will suffice. Also there may be trouble if you don't have flex
headers installed in your ``system'' include directory, such as
``/usr/include'', even though ``configure.in'' appears to be trying to
handle this situation. Since mine were in the ``local'' include directory,
I hand-tweaked the classes/src/Makefile's ``.cc.o'' default rule to include
that directory as well.
<P>
<LI><STRONG><A NAME="item_cflowd">cflowd patch
</A></STRONG>
My patches are available at:
<P>
<PRE> <A HREF="http://net.doit.wisc.edu/~plonka/cflowd/?M=D">http://net.doit.wisc.edu/~plonka/cflowd/?M=D</A>
</PRE>
<P>
Obtain the patch or patches which apply to the version of cflowd that you
intend to run and apply it to cflowd before building cflowd below.
<P>
<LI><STRONG><A NAME="item_cflowd">cflowd
</A></STRONG>
cflowd itself is available at:
<P>
<PRE> <A HREF="http://www.caida.org/tools/measurement/cflowd/">http://www.caida.org/tools/measurement/cflowd/</A>
<A HREF="ftp://ftp.caida.org/pub/cflowd/">ftp://ftp.caida.org/pub/cflowd/</A>
</PRE>
<P>
In my experience with building cflowd, you're the most likely to have
success in a GNU development environment such as that provided with
GNU/Linux or FreeBSD.
<P>
I have not had problems building the patched <CODE>cflowd-2-1-a9</CODE> or
<CODE>cflowd-2-1-a6</CODE> under Debian Linux 2.2.
<P>
I've also managed to build the patched cflowd-2-1-a6 with gcc-2.95.2 and
binutils-2.9.1 on a sparc-sun-solaris2.6 machine with GNU make 3.79 and
flex-2.5.4.
<P>
As of cflowd-2-1-a6, beware that during the build may pause for minutes
while <CODE>as(1)</CODE> uses lots of CPU and memory to building
``CflowdCisco.o''. This is apparenly `normal'. Also, the build appears to
be subtley reliant on GNU <CODE>ld(1),</CODE> which is available in the GNU
``binutils'' package. (I was unable to build cflowd-2-1-a6 with the
sparc-sun-solaris2.6 ``/usr/ccs/bin/ld'' although earlier cflowd releases
built fine with it.)
<P>
<LI><STRONG><A NAME="item_perl">perl 5
</A></STRONG>
If you don't have this already, you're probably way over your head, but
anyway, check out the Comprehensive Perl Archive Network (CPAN):
<P>
<PRE> <A HREF="http://www.cpan.org/">http://www.cpan.org/</A>
</PRE>
<P>
and:
<P>
<PRE> <A HREF="http://www.perl.com/">http://www.perl.com/</A>
</PRE>
<P>
I've tested with perl 5.004, 5.005, and 5.6.0. If you'd like to upgrade to
perl 5.6.0 you can install it thusly:
<P>
<PRE> # perl -MCPAN -e shell
cpan> install G/GS/GSAR/perl-5.6.0.tar.gz
</PRE>
<P>
However, I suggest you don't install it in the same place as your existing <CODE>perl</CODE>.
<P>
<LI><STRONG><A NAME="item_Korn">Korn shell
</A></STRONG>
<CODE>ksh</CODE> is used as the <CODE>SHELL</CODE> in the <EM>Makefile</EM> for the graphs.
<CODE>pdksh</CODE> works fine too. If for some reason you don't already have
<CODE>ksh</CODE>, check out:
<P>
<PRE> <A HREF="http://www.kornshell.com/">http://www.kornshell.com/</A>
</PRE>
<P>
or:
<P>
<PRE> <A HREF="http://www.math.mun.ca/~michael/pdksh/">http://www.math.mun.ca/~michael/pdksh/</A>
</PRE>
<P>
If you're using GNU/Linux, <CODE>pdksh</CODE> is available as an optional binary package for various distributions.
<P>
<LI><STRONG><A NAME="item_RRDTOOL">RRDTOOL
</A></STRONG>
This package is available at:
<P>
<PRE> <A HREF="http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/">http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/</A>
</PRE>
<P>
I recommend that you install <CODE>rrdtool</CODE> from source, even if it is available as an optional binary package for
operating system distribution. This is because FlowScan expects that you've
built and installed RRDTOOL something like this:
<P>
<PRE> $ ./configure --enable-shared
$ make install site-perl-install
</PRE>
<P>
That last bit is important, since it makes the <CODE>rrdtool</CODE> perl modules available to all perl scripts.
<P>
<LI><STRONG><A NAME="item_Perl">Perl Modules
</A></STRONG>
<UL>
<LI><STRONG><A NAME="item_RRDs">RRDs
</A></STRONG>
This is the shared-library perl module supplied with <CODE>rrdtool</CODE>. (See above.)
<P>
<LI><STRONG><A NAME="item_Boulder">Boulder
</A></STRONG>
The Boulder distribution includes the Boulder::Stream module and its
prerequisites. They are available on CPAN in the ``Boulder'' distribution.
<P>
You can install them using the CPAN shell like this:
<P>
<PRE> # perl -MCPAN -e shell
cpan> install Boulder::Stream
</PRE>
<P>
If you want to fetch it manually you can probably find it at:
<P>
<PRE> <A HREF="http://search.cpan.org/search?dist=Boulder">http://search.cpan.org/search?dist=Boulder</A>
</PRE>
<P>
I've tested with the modules supplied in the Boulder-1.18 distribution and
also those in the old ``boulder.tar.gz'' distribution.
<P>
<LI><STRONG><A NAME="item_ConfigReader">ConfigReader::DirectiveStyle
</A></STRONG>
The ConfigReader package is available on CPAN. You can install it using the
CPAN shell like this:
<P>
<PRE> # perl -MCPAN -e shell
cpan> install ConfigReader::DirectiveStyle
</PRE>
<P>
If you want to fetch it manually you can probably find it at:
<P>
<PRE> <A HREF="http://search.cpan.org/search?dist=ConfigReader">http://search.cpan.org/search?dist=ConfigReader</A>
</PRE>
<P>
I'm using ConfigReader-0.5.
<P>
<LI><STRONG><A NAME="item_HTML">HTML::Table
</A></STRONG>
The HTML::Table package is available on CPAN. You can install it using the
CPAN shell like this:
<P>
<PRE> # perl -MCPAN -e shell
cpan> install HTML::Table
</PRE>
<P>
If you want to fetch it manually you can probably find it at:
<P>
<PRE> <A HREF="http://search.cpan.org/search?dist=HTML-Table">http://search.cpan.org/search?dist=HTML-Table</A>
</PRE>
<P>
<LI><STRONG><A NAME="item_Net">Net::Patricia
</A></STRONG>
This is a new module which I have uploaded to PAUSE, but it not have
entered CPAN yet.
<P>
You can try to install it using the CPAN shell like this:
<P>
<PRE> # perl -MCPAN -e shell
cpan> install Net::Patricia
</PRE>
<P>
If <CODE>Net::Patricia</CODE> is not found on CPAN, you can obtain it here:
<P>
<PRE> <A HREF="http://net.doit.wisc.edu/~plonka/Net-Patricia/">http://net.doit.wisc.edu/~plonka/Net-Patricia/</A>
</PRE>
<P>
<LI><STRONG><A NAME="item_Cflow">Cflow
</A></STRONG>
This perl module is used by FlowScan to read the raw flow files written by
cflowd. It is available at:
<P>
<PRE> <A HREF="http://net.doit.wisc.edu/~plonka/Cflow/">http://net.doit.wisc.edu/~plonka/Cflow/</A>
</PRE>
<P>
You'll need Cflow-1.024 or greater.
<P>
<LI><STRONG><A NAME="item_FlowScan">FlowScan
</A></STRONG>
This package is available at:
<P>
<PRE> <A HREF="http://net.doit.wisc.edu/~plonka/FlowScan/">http://net.doit.wisc.edu/~plonka/FlowScan/</A>
</PRE>
<P>
</UL>
</UL>
<P>
<HR>
<H1><A NAME="Configuring_FlowScan_Prerequisit">Configuring FlowScan Prerequisites
</A></H1>
<P>
<HR>
<H2><A NAME="Choose_a_User_to_Run_cflowd_and_">Choose a User to Run cflowd and FlowScan
</A></H2>
I recommend that you create a user just for the purpose of running these
utilities so that all directory permissions and created file permissions
are consistent. You may find this useful especially if you have multiple
network engineers accessing the flows.
<P>
I suggest that the FlowScan <CODE>--prefix</CODE> directory be owned by an appropriate user and group, and that the
permissions allow write by other members of the group. Also, turn on the
set-group-id bit on the directory so that newly created files (such as the
flow files and log file) will be owned by that group as well, e.g.:
<P>
<PRE> user$ chmod g+ws $PREFIX
</PRE>
<P>
<P>
<HR>
<H2><A NAME="Configuring_Your_Host">Configuring Your Host
</A></H2>
The current FlowScan graphing stuff likes your machine to have the
<CODE>80/tcp</CODE> service to be called <CODE>http</CODE>. Try running this command:
<P>
<PRE> $ perl -le "print scalar(getservbyport(80, 'tcp'))"
</PRE>
<P>
You can continue with the next step if this command prints <CODE>http</CODE>. However, if it prints some other value, such as <CODE>www</CODE>, then I suggest you modify your <EM>/etc/services</EM> file so that the line containing
<CODE>80/tcp</CODE> looks something like this:
<P>
<PRE> http 80/tcp www www-http #World Wide Web HTTP
</PRE>
<P>
Be sure to leave the old name such as <CODE>www</CODE> as an ``alias'', like I've shown here. This will reduce the risk of
breaking existing applications which may refer to the service by that name.
If you decide not to modify the service name in this way, FlowScan should
still work, but you'll be on your own when it comes to producing graphs.
<P>
<P>
<HR>
<H2><A NAME="Configuring_Your_Ciscos">Configuring Your Ciscos
</A></H2>
First and foremost, to get useful flow information from your Cisco, you'll
need to enable flow-switching on the appropriate ingress interfaces using
this interface-level configuration statement:
<P>
<PRE> ip route-cache flow
</PRE>
<P>
Also, I suggest that you export from your Cisco like this:
<P>
<PRE> ip flow-export version 5 peer-as
ip flow-export destination 10.0.0.1 2055
</PRE>
<P>
Of course the IP address and port are determined by your
<EM>cflowd.conf</EM>. To help ensure that flows are exported in a timely fashion, I suggest you
also do this if your IOS version supports it:
<P>
<PRE> ip flow-cache timeout active 1
</PRE>
<P>
Some IOS versions, e.g. 12.0(9), use this syntax instead:
<P>
<PRE> ip flow-cache active-timeout 1
</PRE>
<P>
unless you've specified something such as <CODE>downward-compatible-config 11.2</CODE>.
<P>
Lastly, in complicated environments, choosing which particular interfaces
should have <CODE>ip route-cache flow</CODE> enabled is somewhat difficult. For FlowScan, one usually wants it enabled
for any interface that is an ingress point for traffic that is from inside
to outside or vice-versa. You probably don't want flow-switching enabled
for interfaces that carry policy-routed traffic, such as that being
redirected transparently to a web cache. Otherwise, FlowScan could count
the same traffic twice because of multiple flows being reported for what
was essentially the same traffic making multiple passes through a border
router. E.g. user-to-webcache, webcache-to-outside world (on behalf of that
user).
<P>
<P>
<HR>
<H2><A NAME="Configuring_cflowd">Configuring cflowd
</A></H2>
This document does not attempt to explain cflowd. There is good
documentation provided with that package.
<P>
As for the tweaks necessary to get cflowd to play well with FlowScan,
hopefully, an example is worth a thousand words.
<P>
My <EM>cflowd.conf</EM> file looks like this:
<P>
<PRE> OPTIONS {
LOGFACILITY: local6
TCPCOLLECTPORT: 2056
TABLESOCKFILE: /home/whomever/cflowd/etc/cflowdtable.socket
FLOWDIR: /var/local/flows
FLOWFILELEN: 1000000
NUMFLOWFILES: 10
MINLOGMISSED: 300
}
CISCOEXPORTER {
HOST: 10.0.0.10
ADDRESSES: { 10.42.42.10,
}
CFDATAPORT: 2055
# COLLECT: { flows }
}
COLLECTOR {
HOST: 127.0.0.1
AUTH: none
}
</PRE>
<P>
And I invoke the <EM>patched</EM> cflowd like this:
<P>
<PRE> user$ cflowd -s 300 -O 0 -m /path/to/cflowd.conf
</PRE>
<P>
Those options cause a flow file to be ``dropped'' every 5 minutes, skipping
flows with an output interface of zero unless they are multicast flows.
Once you have this working, your ready to continue.
<P>
<P>
<HR>
<H1><A NAME="Configuring_FlowScan">Configuring FlowScan
</A></H1>
<P>
<HR>
<H2><A NAME="Configure_and_Install">Configure and Install
</A></H2>
<STRONG>Do not</STRONG> use the same <CODE>--prefix</CODE> value as might for other packages!
<P>
I.e. don't use <EM>/usr/local</EM> or a similar directory in which other things are installed. This prefix
should be the directory where the patched cflowd has been configured to
write flow files.
<P>
A good way to avoid doing something dumb here is to not run FlowScan's
<CODE>configure</CODE> nor <CODE>make</CODE> as root.
<P>
<PRE> user$ ./configure --help # note --with-... options
</PRE>
<P>
e.g.:
<P>
<PRE> user$ ./configure --prefix=/var/local/flows
user$ make
user$ make -n install
user$ make install
</PRE>
<P>
By the way, in the above commands, all is OK if make says ``<CODE>Nothing to
be done for `target'</CODE>''. As long as <CODE>make</CODE> completes without an error, all is OK.
<P>
Subsequently in this document the ``prefix'' directory will be referred to
as the ``<CODE>--prefix</CODE> diretory'' or using the environment variable
<CODE>$PREFIX</CODE>. FlowScan does not require or use this environment variable, it's just a
documentation convention so you know to use the directory which you passed
as with <CODE>--prefix</CODE>.
<P>
<P>
<HR>
<H2><A NAME="Create_the_Output_Directory">Create the Output Directory
</A></H2>
The <CODE>OutputDir</CODE> is where the <CODE>.rrd</CODE> files and graphs will reside. As the chosen FlowScan user do:
<P>
<PRE> $ PREFIX=/var/local/flows
$ mkdir -p $PREFIX/graphs
</PRE>
<P>
Then, when you edit the <CODE>.cf</CODE> files below, be sure to specify this using the <CODE>OutputDir</CODE> directive.
<P>
<P>
<HR>
<H2><A NAME="FlowScan_Configuration_Files">FlowScan Configuration Files
</A></H2>
The FlowScan Package ships with sample configuration files in the <CODE>cf</CODE>
sub-directory of the distribution. During initial configuration you will
copy and sometimes modify these sample files to match your network
environent and your purposes.
<P>
FlowScan looks for its configuration files in its <CODE>bin</CODE> directory - i.e. the directory in which the <CODE>flowscan</CODE> perl script <EM>and</EM> FlowScan report modules are installed. I don't really like this, but that's
the way it is for now. Forgive me.
<P>
FlowScan currently uses two kinds of cofiguration files:
<P>
<OL>
<LI><STRONG><A NAME="item_Directive_style_configuration_fi"> Directive-style configuration files, with the .cf extension
</A></STRONG>
This format should be relatively self-explanatory based on the sample files
referenced below. The directives are documented in comments within those
sample configuration files.
<P>
A number of the directorives have paths to directory entries as their
values. One has a choice of configuring these as either relative or
absolute paths. The samples configuration files ship with relative path
specifications to minimize the changes a new user must make. However, in
this configuration, it is imperitive that <CODE>flowscan</CODE> be run in the <CODE>--prefix</CODE> directory if these relative paths are used.
<P>
<LI><STRONG><A NAME="item__Boulder_IO_format_files_with_"> "Boulder IO" format files, with the .boulder extension
</A></STRONG>
I've chosen Boulder IO's ``semantic free data interchange format'' to use
for related projects, and since this is the format in which our subnet
definitions were available, I continued to use it.
<P>
If you're new to ``Boulder IO'', the examples referenced below should be
sufficient. Remember that lines containing just <CODE>=</CODE> are record seperators.
<P>
For complete information on this format, do:
<P>
<PRE> $ perldoc Boulder # or "perldoc bolder" if that fails
</PRE>
<P>
</OL>
Here's a step-by-step guide to installing, reviewing, and editing the
FlowScan configuration files:
<P>
<UL>
<LI><STRONG><A NAME="item_Copy">Copy and Edit flowscan.cf
</A></STRONG>
<PRE> $ cp cf/flowscan.cf $PREFIX/bin
$ chmod u+w $PREFIX/bin/flowscan.cf
$ # edit $PREFIX/bin/flowscan.cf
</PRE>
<P>
<LI><STRONG><A NAME="item_Decide">Decide which FlowScan Reports to Run
</A></STRONG>
The FlowScan package contains the <CODE>CampusIO</CODE> and <CODE>SubNetIO</CODE> reports. These two reports are mutually exclusive - <CODE>SubNetIO</CODE> does everything that <CODE>CampusIO</CODE> does, and more.
<P>
Initially, in <EM>flowscan.cf</EM> I strongly suggest you configure:
<P>
<PRE> ReportClasses CampusIO
</PRE>
<P>
rather than:
<P>
<PRE> ReportClasses SubNetIO
</PRE>
<P>
The <CODE>CampusIO</CODE> report class is simpler than <CODE>SubNetIO</CODE>, requires less configuration, and is less CPU/processing intensive. Once
you have the
<CODE>CampusIO</CODE> stuff working, you can always go back and configure
<CODE>flowscan</CODE> to use <CODE>SubNetIO</CODE> instead.
<P>
There is POD documentation provided with the <CODE>CampusIO</CODE> and
<CODE>SubNetIO</CODE> reports. Please use that as the definitive reference on configuration
options for those reports, e.g.:
<P>
<PRE> $ cd bin
$ perldoc CampusIO
</PRE>
<P>
<LI><STRONG><A NAME="item_Copy">Copy and Edit CampusIO.cf
</A></STRONG>
Copy the template to the <EM>bin</EM> directory. Adjust the values using the required and optional configuration
directives documented there-in.
<P>
The most important thing to consider configuring in <EM>CampusIO.cf</EM> is the method by which <CODE>CampusIO</CODE> should identify outbound flows. In order of preference, you should define <CODE>NextHops</CODE>, or
<CODE>OutputIfIndexes</CODE>, or neither. Beware that if you define neither, CampusIO will resort to
using the flow destination address to determine whether or not the flow is
outbound. This can be troublesome if you do not accurately define your
local networks (below), since flows forwarded to any non-local addresses
will be considered outbound. If possible, it's best to define the list of <CODE>NextHops</CODE> to which you know your outbound traffic is forwarded.
<P>
For most purposes, the default values for the rest of the <CODE>CampusIO</CODE>
directives should suffice. For advanced users that export from multiple
Ciscos to the same cflowd/FlowScan machine, it is also very important to
configure <CODE>LocalNextHops</CODE>.
<P>
<LI><STRONG><A NAME="item_Copy">Copy and Edit local_nets.boulder
</A></STRONG>
Copy the template to the <EM>bin</EM> directory. This file should be referenced in <EM>CampusIO.cf</EM> by the <CODE>LocalSubnetFiles</CODE> directive.
<P>
The <EM>local_nets.boulder</EM> file must contain a list of the networks or subnets within your
organization. It is imperative that this file is maintained accurately
since flowscan will use this to determine whether a given flow represents
inbound traffic.
<P>
You should probably specify the networks/subnets in as terse a way as
possible. That is, if you have two adjacent subnets that can be coallesced
into one specification, do so. (This is differnet than the similarly
formatted <EM>our_subnets.boulder</EM> file mentioned below.)
<P>
The format of an entry is:
<P>
<PRE> SUBNET=10.0.0.0/8
[TAG=value]
[...]
</PRE>
<P>
Technically, <CODE>SUBNET</CODE> is the only tag required in each record. You may find it useful to add
other tags such as <CODE>DESCRIPTION</CODE> for documentation purposes. Entries are seperated by a line containing a
single <CODE>=</CODE>.
<P>
FlowScan identifies outbound flows based on the list of nexthop addresses
that you'll set up below.
<P>
<LI><STRONG><A NAME="item_Copy">Copy and Edit Napster_subnets.boulder (if referenced in CampusIO.cf)
</A></STRONG>
Note: if you do not wish to have <CODE>CampusIO</CODE> attempt to identify Napster traffic, be sure to comment out all Napster
related option in
<EM>CampusIO.cf</EM>.
<P>
Copy the template to the <EM>bin</EM> directory from which you will be running <CODE>flowscan</CODE>. The supplied content seems to work well as of this writing (Mar 10,
2000). No warranties. Please let me know if you have updates regarding
Napster IP address usage, protocol, and/or port usage.
<P>
The file <EM>Napster_subnets.boulder</EM> should contain a list of the networks/subnets in use by Napster, i.e. <CODE>napster.com</CODE>.
<P>
As of this writing, more info on Napster can be found at:
<P>
<PRE> <A HREF="http://napster.cjb.net/">http://napster.cjb.net/</A>
<A HREF="http://opennap.sourceforge.net/napster.txt">http://opennap.sourceforge.net/napster.txt</A>
<A HREF="http://david.weekly.org/code/napster-proxy.php3">http://david.weekly.org/code/napster-proxy.php3</A>
</PRE>
<P>
<LI><STRONG><A NAME="item_Copy">Copy and Edit SubNetIO.cf (if you have selected it in your ReportClasses)
</A></STRONG>
Copy the template to the <EM>bin</EM> directory from which you will be running flowscan. Adjust the values using
the required and optional configuration directives documented there-in. For
most purposes, the default values should suffice.
<P>
<LI><STRONG><A NAME="item_Copy">Copy and Edit our_subnets.boulder (if you use ReportClasses SubNetIO)
</A></STRONG>
Copy the template to the <EM>bin</EM> directory.
<P>
This file is used by the <CODE>SubNetIO</CODE> report class, and therefore is only necessary if you have defined <CODE>ReportClasses SubNetIO</CODE> rather than <CODE>ReportClasses CampusIO</CODE>.
<P>
The file <EM>our_subnets.boulder</EM> should contain a list of the subnets on which you'd like to gather I/O
statistics.
<P>
You should format this file like the aforementioned
<EM>local_nets.boulder</EM> file. However, the <CODE>SUBNET</CODE> tags and values in this file should be listed exactly as you use them in
your network: one record for each subnet. So, if you have two subnets, with
different purposes, they should have seperate entries even if they are
numerically adjacent. This will enable you to report on each of those user
populations independently. For instance:
<P>
<PRE> SUBNET=10.0.1.0/24
DESCRIPTION=power user subnet
=
SUBNET=10.0.2.0/24
DESCRIPTION=luser subnet
</PRE>
<P>
</UL>
<P>
<HR>
<H2><A NAME="Preserving_Old_Flow_Files">Preserving "Old" Flow Files
</A></H2>
If you'd like to have FlowScan save your flow files, make a sub-directory
named <EM>saved</EM> in the directory where flowscan has been configured to look for flow files.
This has been specified with the
<CODE>FlowFileGlob</CODE> directive in <EM>flowscan.cf</EM> and is usually the same directory that is specified using the <CODE>FLOWDIR</CODE> directive in your
<EM>cflowd.conf</EM>.
<P>
If you do this, flowscan will move each flow file to that <EM>saved</EM>
sub-directory after processing it. (Otherwise it would simply remove them.)
e.g.:
<P>
<PRE> $ mkdir $PREFIX/saved
$ touch $PREFIX/saved/.gzip_lock
</PRE>
<P>
The <EM>.gzip_lock</EM> file created by this command is used as a lock file to ensure that only one
cron job at a time.
<P>
Be sure to set up a crontab entry as is mentioned below in <A HREF="#Final_Setup">Final Setup</A>. I.e. don't complain to the author if you're saving flows and your
file-system fills up ;^).
<P>
<P>
<HR>
<H1><A NAME="Testing_FlowScan">Testing FlowScan
</A></H1>
Once you have the patched cflowd running with the <CODE>-s 300</CODE> option, and it has written at least one time-stamped flow file (i.e. other
than
<EM>flows.current</EM>), try this:
<P>
<PRE> $ cd /dir/containing/your/time-stamped/raw/flow/files
$ flowscan
</PRE>
<P>
The output should appear as something like this:
<P>
<PRE> Loading "bin/Napster_subnets.boulder" ...
Loading "bin/local_nets.boulder" ...
2000/03/20 17:01:04 working on file flows.20000320_16:57:22...
2000/03/20 17:07:38 flowscan-1.013 CampusIO: Cflow::find took 394 wallclock secs (350.03 usr + 0.52 sys = 350.55 CPU) for 23610455 flow file bytes, flow hit ratio: 254413/429281
2000/03/20 17:07:41 flowscan-1.013 CampusIO: report took 3 wallclock secs ( 0.44 usr + 0.04 sys = 0.48 CPU)
sleep 300...
</PRE>
<P>
At this point, the RRD files have been created and updated as the flow
files are processed. If not, you should use the diagnostic warning and
error messages or the perl debugger (<CODE>perl -d flowscan</CODE>) to determine what is wrong.
<P>
Look at the above output carefully. It is imperative that the number of
seconds that <CODE>Cflow::find took</CODE> not usually approach nor exceed 300. If, as in the example above, your log
messages indicate that it took more than 300 seconds, FlowScan will not be
able to keep up with the flows being collected on this machine (if the
given flow file is representative). If the total of usr + sys CPU seconds
totals more than 300 seconds, than this machine is not even capable of
running FlowScan fast enough, and you'll need to run it on a faster machine
(or tweak the code, rewrite in C, or mess with process priorities using
<CODE>nice(1),</CODE> etc.)
<P>
<P>
<HR>
<H1><A NAME="Performance_Problems_">Performance Problems?
</A></H1>
Here are some hints on getting the most out of your hardware if you find
that FlowScan is processing 300 seconds of flows in less an averave of 300
CPU seconds or less, but not 300 seconds of real time; i.e. the <CODE>flowscan</CODE> process is not being scheduled to run often enough because of context
switching or because of its competing for CPU with too many other
processes.
<P>
On a 2 processor Intell PIII, to keep <CODE>flowscan</CODE> from having to compete with other processes for CPU, I have recently had
good luck with setting the <CODE>flowscan</CODE> process' <CODE>nice(1)</CODE> value to -20.
<P>
Furthermore, I applied this experimental patch to the Linux 2.2.18pre21
kernel:
<P>
<PRE> <A HREF="http://isunix.it.ilstu.edu/~thockin/pset/">http://isunix.it.ilstu.edu/~thockin/pset/</A>
</PRE>
<P>
This patch enables users to determine which processor or set of processors
a process may run on. Once applied, you can reserve the 2nd processor
solely for use by <CODE>flowscan</CODE>:
<P>
<PRE> root# mpadmin -r 1
</PRE>
<P>
Then launch <CODE>flowscan</CODE> on processor number 1:
<P>
<PRE> root# /usr/bin/nice --20 /usr/bin/runon 1 /usr/bin/su - username -c '/usr/bin/nohup /var/local/flows/bin/flowscan -v' >> /var/local/flows/flowscan.log 2>&1 </dev/null &'
</PRE>
<P>
This configuration has yielded the best ratio of CPU to real seconds that I
have seen - nearly 1 to 1.
<P>
<P>
<HR>
<H1><A NAME="Final_Setup">Final Setup
</A></H1>
Once you feel that <CODE>flowscan</CODE> is working correctly, you can set it (and <CODE>cflowd</CODE>) to start up at system boot time. Sample <CODE>rc</CODE> scripts for Solaris and Linux are supplied in the <EM>rc</EM> sub-directory of this distribution. You may have to edit these scripts
depending on your <CODE>ps(1)</CODE> flavor and where various commands have
been installed on your system.
<P>
Also, if you're saving your flow files, you should set up crontab entries
to handle the ``old'' flows. I use one crontab entry to
<CODE>gzip(1)</CODE> recently processed files, and another to delete the files older than a
given number of hours. The ``right'' number of hours is a function of your
file-system size and the rate of flows being exported/collected. See the <EM>example/crontab</EM> file.
<P>
<P>
<HR>
<H1><A NAME="Generating_Graphs">Generating Graphs
</A></H1>
<P>
<HR>
<H2><A NAME="Supplied_Graphs">Supplied Graphs
</A></H2>
To generate graphs, try the <EM>graphs.mf</EM> Makefile:
<P>
<PRE> $ cp graphs.mf $PREFIX/graphs/Makefile
$ cd $PREFIX/graphs
$ make
</PRE>
<P>
This should produce the ``Campus I/O by IP Protocol'' and ``Well Known
Services'' graphs in PNG files. GIF files may be produced using the
<CODE>filetype</CODE> option mentioned below.
<P>
If this command fails to produce those graphs, it is likely that some of
the requisite <CODE>.rrd</CODE> files are missing, i.e. they have not yet been created by FlowScan, such as <EM>http_dst.rrd</EM>. If this is the case, it is probably because you skipped the configuration
of <EM>/etc/services</EM>
in <A HREF="#Configuring_Your_Host">Configuring Your Host</A>. Stop <CODE>flowscan</CODE>, rename your
<EM>www_*.rrd</EM> files to <EM>http_*.rrd</EM>, modify <EM>/etc/services</EM>, and restart <CODE>flowscan</CODE>.
<P>
Alternatively, you may copy and customize the <EM>graphs.mf</EM> Makefile to remove references to the missing or misnamed <CODE>.rrd</CODE> files for those targets. Also, you could produce your graphs using a
graphing tool such as RRGrapher mentioned below in <A HREF="#Custom_Graphs">Custom Graphs</A>.
<P>
Note that the <EM>graphs.mf</EM> template Makefile has options to specify such things as the range of time,
graph height and width, and output file type. Usage:
<P>
<PRE> make -f graphs.mf [filetype=<png|gif>] [width=x] [height=y] [ioheight=y+n] [hours=h] [tag=_tagval] [events=public_events.txt] [organization='Foobar U - Springfield Campus']
</PRE>
<P>
as in:
<P>
<PRE> $ make -f graphs.mf filetype=gif height=400 hours=24 io_services_bits.gif
</PRE>
<P>
<P>
<HR>
<H2><A NAME="Adding_Events_to_Graphs">Adding Events to Graphs
</A></H2>
There is a new graphing feature which allows you to specify events that
should be displayed in your graphs. These events are simply a list of
points in time at which something of interest occurred.
<P>
For instance, one could create a plain text file in the <EM>graphs</EM>
directory called <EM>events.txt</EM> containing these lines:
<P>
<PRE> 2001/02/10 1538 added support for events to FlowScan graphs
2001/02/12 1601 allowed the events file to be named on make command line
</PRE>
<P>
Then to generate the graphs with those events included one might run:
<P>
<PRE> $ make -f graphs.mf events=events.txt
</PRE>
<P>
This feature was implemented using a new script called <EM>event2vrule</EM>
that is supplied with FlowScan. This script is meant to be used as a
``wrapper'' for running <CODE>rrdtool(1),</CODE> similarly to how one might
run <CODE>nohup(1).</CODE> E.g.:
<P>
<PRE> $ event2vrule -h 48 events.txt rrdtool graph -s -48h ...
</PRE>
<P>
That command will cause these <CODE>VRULE</CODE> arguments to be passed to rrdtool, at the end of the argument list:
<P>
<PRE> COMMENT:\n
VRULE:981841080#ff0000:2001/02/10 1538 added support for events to FlowScan graphs
COMMENT:\n
VRULE:982015260#ff0000:2001/02/12 1601 allowed the events file to be named on make command line
COMMENT:\n
</PRE>
<P>
<P>
<HR>
<H2><A NAME="Custom_Graphs">Custom Graphs
</A></H2>
Creation of other graphs will require the use of a tool such as RRGrapher
or knowledge of RRDTOOL. RRGrapher, my Graph Construction Set for RRDTOOL
is available at:
<P>
<PRE> <A HREF="http://net.doit.wisc.edu/~plonka/RRGrapher/">http://net.doit.wisc.edu/~plonka/RRGrapher/</A>
</PRE>
<P>
For other custom graphs, if you use the supplied <EM>graphs.mf</EM> Makefile, you can use the examples there in to see how to build ``Campus
I/O by Network'' and ``AS to AS'' graphs. The examples use UW-Madison
network numbers, names of with which we peer and such, so it will be
non-trivial for you to customize them, but at least there's an example.
<P>
Currently, RRD files for the configured <CODE>ASPairs</CODE> contain a <CODE>:</CODE> in the file name. This is apparently a no-no with RRDTOOL since, although
it allows you create files with these names, it doesn't let you graphs
using them because of how the API uses <CODE>:</CODE> to seperate arguments.
<P>
For the time being, if you want to graph AS information, you must manually
create symbolic links in your graphs sub-dir. i.e.
<P>
<PRE> $ cd graphs
$ ln -s 0:42.rrd Us2Them.rrd
$ ln -s 42:0.rrd Them2Us.rrd
</PRE>
<P>
A reminder for me to fix this is in the <EM>TODO</EM> list.
<P>
<P>
<HR>
<H2><A NAME="Future_Directions_for_Graphs">Future Directions for Graphs
</A></H2>
The current Makefile-based graphing, while coherent, is cumbersome at best.
I find that the verbosity and complexity of adding new graph targets to the
Makefile makes my brain hurt.
<P>
Other RRDTOOL front-ends that produce graphs should be able to work with
FlowScan-generated <CODE>.rrd</CODE> files, so there's hope.
<P>
<P>
<HR>
<H1><A NAME="Copyright_and_Disclaimer">Copyright and Disclaimer
</A></H1>
Note that this document is provided `as is'. The information in it is not
warranted to be correct. Use it at your own risk.
<P>
<PRE> Copyright (c) 2000-2001 Dave Plonka <plonka@doit.wisc.edu>.
All rights reserved.
</PRE>
<P>
This document may be reproduced and distributed in its entirety (including
this authorship, copyright, and permission notice), provided that no charge
is made for the document itself.
<P>
</DL>
</BODY>
</HTML>
|