Version 1.4.0, revision 1.11, 10 Mar 2008
Copyright © 2006, 2007, 2008 CESNET, z.s.p.o.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. The license can be found at GNU web page.
Table of Contents
List of Figures
List of Tables
List of Examples
Table of Contents
This handbook describes FlowMon Probe itself, its installation, configuration and different ways how to use it.
You can check latest news about FlowMon Probe at our web sites: http://www.liberouter.org/ and http://www.flowmon.org/.
The FlowMon Probe is a passive network monitoring device based on the COMBO6(X) technology. It is able to collect dynamic data about IP flows and export them to external collectors in the NetFlow (version 5 and 9) and IPFIX (IP Flow Information eXport) format. The probe has great contribution to the safety and reliability of your network. You can obtain information about attacks and data transfers going in and out of your network. The probe is remotely configurable using web or terminal interface.
So far, NetFlow data are mostly generated by IP routers. In contrast, our NetFlow probe is designed as an autonomous device working essentially as a T-splitter: when inserted into a network link, the incoming traffic is passed directly to the original destination and a separate copy of the link data is processed by the probe in parallel. From the network perspective, the probe can be classified as a repeater that is invisible at both the network and link layer.
Using a specialized probe for gathering data about IP flows has several advantages over the traditional routerbased setup:
The probe does not appear as a hop in traceroute and thus remote attacks are virtually impossible.
Routers must concentrate on their main task - routing and forwarding. Consequently, the CPU cycles available for processing flow records are usually rather limited. The probe is much more flexible in this respect.
As a special case of the previous item, routers often enforce traffic sampling, especially on high-speed links. For some applications such as security analysis this is highly undesirable.
In contrast, standalone monitoring probe is essentially a stealth device - invisible at both Layer 3 and 2 - dedicating all its resources to the tasks of flow record acquisition and processing.
monitoring of two 1 Gbps ports at full speed (actually we support 1Gbps and 10Gbps speeds, lower speeds can be set via phyterctl tool)
precise timestamps, active and inactive timeouts
input sampling (Each packet is sampled with a probability on selected input interface.), sample and hold sampling (Each packet is sampled with a probability, if a packet is chosen and the flow it belongs to is not in the flow memory, a new item is created. However, after an item is created for a flow, unlike in sampled NetFlow, every subsequent packet belonging to the flow updates the item.)
repeater and splitter ports
export in NetFlow version 5, NetFlow version 9 and IPFIX format
exporting to more collectors at the same time
anonymization and per collector filtering
IPFIX format is not standardized yet - we have tested IPFIX export functionality against libipfix collector.
FlowMon package is available via WWW download page: http://www.liberouter.org/clients
To verify that the downloaded files are genuine and complete SHA1 digests are available. Download both the CHECKSUM.SHA1 file and the package file to the same directory. Run the sha1sum(1) command to verify the package file e.g. flowmon-1.4.0.tgz:
$ cat CHECKSUM.SHA1 | grep flowmon-1.4.0.tgz | sha1sum -c
If there are any errors, they will be reported.
/firmware - COMBO6(X) card firmware (*.mcs files)
/base - source code for software tools and drivers
/mk - build system (makefiles)
/sys_sw/drivers - kernel drivers
/sys_sw/hwtools - necessary hardware tools for COMBO6(X) card
/sys_sw/lib* - libraries necessary for other tools
/sys_sw/projects/flowmon - exporters, testing programs, configuration
and documentation for using FlowMon
/sys_sw/projects/netconf - NETCONF protocol programs
/sys_sw/swtools/csxtool - tool for handle COMBO6(X) XML files
/doc - FlowMon project documentation - FlowMon Handbook
ERRATA - list of known bugs and their solutions
README - short manual how to build, install and use FlowMon Probe
RELNOTES - differences against previous release
There are two possibilities how to use FlowMon probe - either locally by flowmonlkm(1) and flowmon(1) programs (described in Chapter FlowMon Probe - local using) or remotely via remote command line interface or Web frontend (described in Chapter Using FlowMon Probe - remote configuration).
Table of Contents
Compilation and installation process is covered by the build system
located in the base/mk directory.
To build package you will need following tools (programs, libraries):
gmake 3.80 or later
autoconf 2.59 or later
automake 1.4 or later
gcc 3.0 or later
libxml2 2.6.16 or later (including devel sources)
libxslt 1.1.11 or later (including devel sources)
pciutils (lspci) 2.2.2 or later
lsof 4.72 or later
To run web configuration frontend you will need:
apache2 with
mod_ssl (to run over HTTPS)
php5 configured with
-with-xml
netconf (included in the package)
All scripts are running in /bin/sh shell interpreter so all scripts were created with aim to portability. But on all testing machine the /bin/sh program was actually Bash (/bin/bash). Therefore we recommend using Bash as a default shell.
To build kernel drivers needed by FlowMon package you will need
fully configured Linux 2.4 or 2.6 kernel source tree. More installation
and compilation details about kernel drivers are available in the README
file inside base/sys_sw/drivers/linux
directory.
The FlowMon hardware has been designed to work on any PC-AT compatible computer running GNU/Linux or other "Unix-like" operating system. It has been tested only on computers that use the x86 family of processors. The hardware requirements necessary to run FlowMon are:
Intel Pentium or equivalent x86 based PC
COMBO6 - 32-bit/33 MHz PCI bus
COMBO6X - 64-bit/66 MHz PCI-X bus
The "sandwich" consisting of COMBO6(X) and an interface card (COMBO-4MTX, COMBO-4SFP, COMBO-4SFPRO or COMBO-2XFP2) fits into one PCI slot.
Following table express our experience with COMBO6(X) card compatibility to some motherboards.
Table 2.1. COMBO6X Motherboard Compatibility
| MB type | COMBO6 | COMBO6X |
|---|---|---|
| Intel SE7501CW2 | compatible | compatible |
| Intel SE7520BD2D | compatible | compatible |
| Intel S5000VSA | compatible | compatible |
| Intel S5000PAL0 | compatible | compatible |
| Intel SE7525GP2 | compatible | incompatible |
| Intel SE7221BK1-E | compatible | incompatible |
Following table displays list of compatible GBICs, which we have tested. We haven't found any non-compatible GBIC yet, all GBIC satisfying SFP/XFP MSA specification should work.
Table 2.2. Tested GBICs
| Metallic 1Gbps (1000base-T) for COMBO-4SFPRO cards | Optical 1Gbps (1000BASE-LX and 1000BASE-SX) for COMBO-4SFPRO | Optical 10Gbps (10GBASE-SR and 10GBASE-LR) for COMBO-2XFP and COMBO-2XFP2 cards |
|---|---|---|
| Finisar FCLF-8521-3 | Agilent HFBR 57M5AP (850nm) | JDSU JXP-01SWAA1 (850nm) |
| Linksys MGBT1 | Dell FTRJ-8519-7D (850nm) | JDSU JXP-01LWAA1 (1310nm) |
| Methode Electronics SP7041 | MSFP-FO-0850-M8511-111 (850nm) | Finisar FTRX-1411D3 (1310nm) |
| Finisar FTRJ1321P1BTL (1310nm) | Agilent (Avago) HFCT-721XPD (1310nm) |
This package can be used with the COMBO6(X) cards described in the following table. COMBO6(X) cards have to have installed PCI bridge version c610.04.07 or higher (you can find details about PCI bridge and its version at http://www.liberouter.org/documents/pci_bridge_upgrade.php).
Table 2.3. Supported Hardware
| COMBO6 | a PCI (32/33) card with XILINX FPGA | |
| COMBO-4MTX | add-on card with four copper GE interfaces | |
| COMBO-4SFP | add-on card with four SFP cages for GE interfaces | |
| COMBO6X | a PCI-X (64/66) card with XILINX FPGAs | |
| COMBO-4SFPRO | add-on card with four SFP cages for GE interfaces | |
| COMBO-2XFP2 | add-on card with two XFP cages for 10GE interfaces and one SFP cage for 1GE interface |
You can find more information about COMBO6(X) cards at http://www.liberouter.org/hardware.php.
Supported firmware depends on the type of card you use.
Table 2.4. Supported Firmware
| Mother Card | Add-on Card | Firmware | Features |
|---|---|---|---|
| COMBO6 | COMBO-4MTX/COMBO-4SFP | 01_07 | Monitoring of one gigabit interface |
| Expiration of flowrecord can be controlled by TCP flags | |||
| Active timeout | |||
| Inactive timeout | |||
| Input sampling | |||
| Sample and Hold | |||
| Throughput 230Kpackets/s (shortest packets) or 750Mbit/s (longest packets) | |||
| 64 K flowrecords | |||
| Repeater between port 0 and 1 | |||
| No setup for GBIC - phyterctl and ibufctl not working | |||
| COMBO6X | COMBO-4SFPRO | 02_07 | Extension of COMBO-4MTX/4SFP + COMBO6 firmware |
| Monitoring of two one-gigabit interfaces | |||
| Network interface is identified in the flowrecord | |||
| Network interface for 1000/100/10Mbps with MTU control (=1526 Bytes) | |||
| Inactive timeout adapts according to flow-cache occupancy | |||
| Adaptive input sampling | |||
| 120 K flowrecords | |||
| Full throughput (no matter of packet size) | |||
| LM83 temperature sensor controller connected via I2C | |||
| Mirror to port 2 and 3 | |||
| 03_03 | Same as 02_07 firmware, 490 K flowrecords with DRAM | ||
| COMBO-2XFP2 | 02_07 | Same features as COMBO-4SFPRO + COMBO6X firmware | |
| Network interface only for 10Gbps | |||
| Limited throughput (up to 5Gbps) | |||
| 03_03 | Same as 02_07 firmware on COMBO2-XFP2, 490 K flowrecords with DRAM |
Firmware supports processing of Ethernet and all basic IPv4 and IPv6 headers:
ethernet L2 layer processing
MAC
802.1Q - Ethernet VLANs (cannot be recursive)
MPLS - MPLS packets (MPLS tags are removed only), EoMPLS
IPv4 and IPv6 protocols are recognized, other protocols are unknown.
TCP, UDP, ICMP and ICMPv6 processing supported.
FlowMon software works on GNU/Linux OS with 2.4 and 2.6 kernels. The NetFlow v5, v9 and IPFIX protocols are supported. The software has been tested on computers running Red Hat Enterprise Linux, CentOs, Ubuntu and Debian.
After plugging COMBO6(X) card into your PCI slot, you should test connection between the card and your PC. We use lspci(8) utility for this purpose. lspci(8) is a utility for displaying information about all PCI buses in the system and all devices connected to them. For correct recognition of the COMBO6(X) card you need update PCI ID Database used by lspci(8) or download pciutils-2.2.2 (program collection containing lspci(8) or later. If the lspci(8) output contains the following line your COMBO6(X) card is connected properly.
$lspci-d18ec:03:01.0 Ethernet controller: Cesnet, z.s.p.o. COMBO6X (rev 01) 04:02.0 Ethernet controller: Cesnet, z.s.p.o. COMBO6 (rev 01)
Numbers at the beginning of the line can be different.
There are three possibilities, how to insert FlowMon probe to the network - you can connect FlowMon probe at a mirror port of some network device, utilize network tap or insert into a line as a repeater.
If you want to check FlowMon features you can simply mirror traffic from your router to the FlowMon probe.
Another way of how to connect FlowMon probe in your network is to utilize network tap, e.g. optical splitter (see figure below).
In this case the FlowMon probe works as a T-splitter: when inserted into a network link, the traffic is passed directly to the original destination and a separate copy of link data is processed by the probe in parallel. From the network perspective, the probe can be classified as a repeater that is invisible at both the network and link layer. Description of this repeater mode is in the chapter Repeater.
The general rule for numbering card ports is that the ports closer to the motherboard (PCI slot) have lower numbers, e.g. the closest port has number 0, the next one number 1 etc. See figures bellow for examples:
pkgtool(1) helps to build, install and uninstall the FlowMon distribution package.
$tar-xzvfflowmon-XX.YY.ZZ.tgz$cdflowmon-XX.YY.ZZ/base$./pkgtool--build
Replace XX.YY.ZZ with the chosen package version number such as 1.3.0.
If this is the first Liberouter package you have ever installed, you can
define installation directory with the --prefix=path
option. But remember that this installation path MUST not exists (e.g.
/usr/local is invalid
installation path on most systems because this directory exists). This
restriction is due to new installation framework which enables easy package
uninstall or package switching. More information about these features can be
found in the liberouterpkg
section.
The --prefix option takes effect only during building
package. If no prefix is set then
/usr/local/liberouter path is used.
$./pkgtool--build--prefix=/usr/local/flowmon
If you have previously installed some Liberouter package (nific, nic, ids, flowmon with liberouterpkg mechanism), the installation path is detected automatically as path used for the first installed package.
Remember that installation path given as --prefix parameter
will contain next subdirectories for binaries, libraries, man pages, etc.
These directories can be affected by future uninstalling or package
switching so it could be used as installation directory only for
Liberouter packages.
Installed tools are divided to three parts.
This is a default type of the installation that includes all
necessary tools to control COMBO card, kernel drivers and NETCONF tools
(server side as well as client side tools). All these tools will be
installed to the installation directory (by default
/usr/local/liberouter). To use this
type of installation use --install option with
server parameter
#./pkgtool--install=server
or simply use --install option without any parameter:
#./pkgtool--install
If you are going to use udev mechanism
to creating device files, you can use pkgtool with --udev
option. This option cause copying file with COMBO6(X) card rules
(combo6.udev.rules) to
the /etc/udev/rules.d directory.
#./pkgtool--install --udev
--udev option takes effect only with
--install option.
Only NETCONF-client side tools are installed in this case. These
tools are included in the server and
web installation too. To install only these
tools, use --install option with
client parameter
#./pkgtool--install=client
Last installation type enables to install FlowMon web configuration frontend into your Apache web server including NETCONF-client side tools needed by web configuration frontend.
#./pkgtool--install=web
You can use more than one type of installation (typically server
and web) by specifying keywords separated
by comma(s)
#./pkgtool--install=server,web
All FlowMon Probe tools come with its manual pages so for information about any tool (included configuration files) you can see these man pages by man(1) program, e.g.
$ man flowmon_nf5
$ man flowmon.conf
There are necessary following post-install steps:
Export Liberouter environment variables generated by pkgtool. These variables were printed as last output of pkgtool --install command and they are in the following form
VARIABLE=value
Please, use these lines as a parameter for export command like in following example:
# ./pkgtool --install
...
[pkgtool output]
...
### Liberouter environment variables:
CS_XML_INDEX_PATH=/usr/local/liberouter/mcs/index
$ export CS_XML_INDEX_PATH=/usr/local/liberouter/mcs/index
For permanent export of this variable add same line
(export command) into the
/etc/profile configuration file.
export CS_XML_INDEX_PATH=/usr/local/liberouter/mcs/index
Liberouter environment variables are prepared only if they are needed. So if pkgtool doesn't print any "Liberouter environment variables:" you doesn't need export any variable.
Set PATH variable to point to installed FlowMon
tools directory (${PREFIX}/bin)
$ export PATH=/usr/local/liberouter/bin:$PATH
For permanent PATH change add following line into the
/etc/profile configuration file
export PATH=/usr/local/liberouter/bin:$PATH
Configure dynamic linker run time bindings by setting
/etc/ld.so.conf to point to the FlowMon
library directory (${PREFIX}/lib).
Add /usr/local/liberouter/lib
(by default) entry to the /etc/ld.so.conf file.
# echo "/usr/local/liberouter/lib" >> /etc/ld.so.conf
# ldconfig
Set /etc/man.config file to point to the
FlowMon man pages (${PREFIX}/man).
Add line
MANPATH /usr/local/liberouter/man
entry to the /etc/man.config file (name of this
file can little differ on different Linux distribution).
If you want to load FlowMon kernel modules when the PC starts up,
add following lines to the /etc/modules
file.
For COMBO6 card:
libermemalloc
combo6core
combo6
szedata
netflow-ph1
For COMBO6X card:
libermemalloc
combo6core
combo6x
szedata
szedatax-c6pcr
After this, you don't need to run flowmonlkm script any more.
In some distribution (e.g. Red Hat Enterprise Linux 4) you
have to use file /etc/rc.modules in place of
/etc/modules file. This file contains commands
to load kernel modules at boot time - it is actually script so it
must be an executable file:
# chmod +x /etc/rc.modules
so such file will look like this:
#!/bin/sh
/sbin/modprobe libermemalloc
/sbin/modprobe combo6core
/sbin/modprobe combo6x
/sbin/modprobe szedata
/sbin/modprobe szedatax-c6pcr
The FlowMon probe driver needs device files in the
/dev/combosix/ and
/dev/szedata/ directory. To
create them, run the flowdevices script in the
packages directory base/sys_sw/drivers/linux.
These devices are removed after reboot, so you need to run this script after each reboot.
# ./flowdevices
To run FlowMon as a non-privileged user set r/w permissions on
/dev/combosix/0 and
/dev/szedata/0 devices.
You have to change the permissions of the device files so that the non-privileged user that will execute the FlowMon tools has read-write access. For example, you can create a new group, say combo-rw, add that user to this group and change the file group ownership and permissions as follows:
# chgrp combo-rw /dev/combosix/0 /dev/szedata/0
# chmod 664 /dev/combosix/0 /dev/szedata/0
Using recent 2.6 kernels it might be wanted to use the sysfs/udev mechanisms to create device files. For more details about udev see http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
Example udev rules are placed in the package in
sys_sw/drivers/linux/combo6.udev.rules file. If
you didn't use option --udev during package
installation, copy this file (located in the package directory
sys_sw/drivers/linux/) to
/etc/udev/rules.d directory
and modify it (change group or permissions). Following line will
create COMBO6(X) device files required by the FlowMon probe with access
rights to combo-rw group:
KERNEL=="combosix[0-9]*", NAME="combosix/%n", GROUP="combo-rw", MODE="0664"
KERNEL=="szedata[0-9]*", NAME="szedata/%n", GROUP="combo-rw", MODE="0664"
Depending on your version of udevd you must adjust syntax of your udev rule file. Older versions of udevd require '=' character to match KERNEL key e.g. KERNEL="combosix[0-9]*". The newer one require '==' characters to match KERNEL key e.g. KERNEL=="combosix[0-9]*".
Please copy (and rewrite any previous version)
liberouterpkg script, located in the package base
directory into your standard binary directory (e.g.
/usr/local/bin/). This enables
using liberouterpkg script as standard system tool
# liberouterpkg
Path where the liberouterpkg script is placed must be different from used package installation path. More information about liberouterpkg can be found in the liberouterpkg section.
The flowmon-1.3.0 is the first Liberouter package using liberouterpkg tool enabling package switching and fully package uninstalling. If you have installed any previous Liberouter package without liberouterpkg, please remove it completely (including all libraries and drivers) to ensure proper behavior of the installed package.
More information about these features can be found in the liberouterpkg section.
If you are installing new version of previously installed package (e.g. you have installed flowmon-1.3.0 and now you are installing flowmon-1.3.1 package) you will be asked by pkgtool(1) to decide if you wish to keep your own (but may be obsolete) configuration files or to overwrite them with our default (but up-to-date) configuration files.
liberouterpkg script is new tool covering new
Liberouter package installation framework which enables safe and easy
package uninstalling or simple package switching (and using different
project packages on the same PC). To display all available functions of
the liberouterpkg script use --help
option
$ liberouterpkg --help
liberouterpkg uses
/etc/liberouter/packages.list configuration file that
stores information about installed packages.
liberouterpkg can be used to display list of all installed Liberouter packages
# liberouterpkg --list
# Installed packages:
flowmon-1.3.0
or to display currently active package (only one package can be active at the same time)
# liberouterpkg
flowmon-1.3.0
liberouterpkg tool is able to safely uninstall any
previously installed Liberouter package (covered by new Liberouter
package installation framework with liberouterpkg) by
--uninstall=<PKG_ID> option where
<PKG_ID> is a package identification string
(that can be displayed by --list option)
# liberouterpkg --uninstall=flowmon-1.3.0
If you are using a flowmon package (flowmon-x.y.z package is active)
you are unable to use tools from e.g. ids package. Using
liberouterpkg script you can switch to any installed
package and change this way currently active package. For switching
packages use --switch=<PKG_ID> option where
<PKG_ID> is a package identification string
of a package that will be activated. List of available packages can be
displayed by --list option)
# liberouterpkg --switch=ids-1.0.0
Table of Contents
This chapter describes key configuration files for the FlowMon Probe. The first section explains purpose of the flowmon.conf(5) configuration file used by FlowMon programs and describes its content. The second section describes FlowMon Probe XML configuration scheme used for describing FlowMon Probe parameters used during remote configuration.
This section describes
flowmon.conf(5) configuration file placed in the
/etc/liberouter/ directory.
This configuration file is read by FlowMon Probe starting (
flowmonlkm(1),
flowmon(1)) and controlling (
flowmond(1)) programs.
flowmon.conf(5) is actually a list of definition of environment variables.
VARNAME=VALUE
The file can contain blank lines or lines starting with '#' which are ignored by programs and can be used for comments.
You can freely modify this file and redefine default values of the
probe settings. During installation of the next flowmon package version
you will be inquired by pkgtool if you prefer to keep
your own configuration file or to rewrite it with our up-to-date version.
So you don't have to be worry to lose your changes. Up-to-date file is
during installation process always copied to the
(by default $PREFIX/etc/liberouter/usr/local/etc/liberouter)
directory. So you can use this file as a backup copy.
Variable definitions are divided into several parts.
The first part contains variables specifying FlowMon Probe parameters. Please remember that these variables are used only by programs described in the Setting up FlowMon Probe section. Remote configuration uses more advanced, XML based configuration datastores, described in the XML configuration scheme section.
INACTIVE_TIMEOUTValue of the inactive timeout in seconds.
This element specifies the inactive timeout in seconds, i.e., the amount of time after which a flow is classified as terminated and exported if no traffic has been seen for that interval. The value is an integer between 0 and 60.
ACTIVE_TIMEOUTValue of the active timeout in seconds.
This element specifies the active timeout, i.e., the time period after which any flow that is still classified as active must be exported in order to keep the collectors informed about the flow. Active timeout is given in seconds and can be between zero and 1200 (20 min).
SAMPLING0_RATESampling rate on IBUF0. Set value
means rate 1:value and in this rate are packets
sampled on input of interface 0.
SAMPLING1_RATE is used to set sampling rate on IBUF1,
but it is available only for COMBO6X card.
Sampling of incoming packets is the easiest way how to guarantee the measured bandwidth. It helps also to decrease number of new flows during attacks when every incoming packets belongs to new flow.
SAMPLING0_TYPEType of the sampling on IBUF0. Variable
SAMPLING1_TYPE is used to set sampling type on IBUF1,
but it is available only for COMBO6X card. Value 0 means constant
sampling and value 1 means random sampling.
SAMPLE_HOLD_RATESampling rate for the Sample and hold function. Set value
means rate 1:value and in this rate are packets
sampled.
Sample and hold method is quite similar to input sampling but with following twist. As with ordinary sampling, each packet is sampled with a probability. If a packet is chosen and the flow it belongs to is not in the flow memory, a new item is created. However, after an item is created for a flow, unlike in sampled NetFlow, every subsequent packet belonging to the flow updates the item.
SAMPLE_HOLD_TYPEType of the sampling for the Sample and hold function. Value 0 means constant sampling and value 1 means random sampling.
SAMPLE_HOLD_THRESHOLDValue of the sample and hold threshold. It means the rate of flowrecord memory occupation from which start this method with sampling.
The second part contains variables specifying FlowMon exporter(s)
settings. Please remember that these variables are used only
by programs described in the
Setting up FlowMon Probe section,
last variable FLOWMON_EXPN is only by
startup scripts running at boot
time. Remote configuration uses more
advanced, XML based configuration datastores, described in the
XML configuration scheme section.
COLLECTORNetwork address to the flow collector in the form host:port.
EXPORT_PROTOCOLSpecifies protocol for flow sending to the collector. Available values are 'NF5' for NetFlow v5 protocol, 'NF9' for NetFlow v9 protocol and 'IPFIX' for IPFIX protocol.
FLOWMON_EXPNContains command to run exporter at the boot time. Last character of the variable name is number of running exporter. Maximal number of exporter is 4 (numbered from 0 to 3) and it must be a gradual sequence (i.e. if you specify exporter 0 and 2, only number 0 will be started). More information about exporters can be found in the flowmon_nf5(1), flowmon_nf9 or flowmon_ipfix(1) man pages.
The third part contains variables specifying Hardware parameters used for firmware design booting. These variables are used by all FlowMon starting and controlling programs.
COMBO6_DEVICEThis variable contains path to the combo6 device file.
FIRMWARE_PATHPath to the storage of the firmware files. Value of this variable is automatically generated during building and installation process of the package.
FIRMWARE_IDNHardware identification string for the COMBO6 card
(FIRMWARE_ID0), for COMBO6X card (
FIRMWARE_ID1) and for COMBO6X card with SDRAM
(FIRMWARE_ID1_DDR).
Next part contains only one variable storing path to the installed FlowMon programs.
The last part contains variables used only by flowmond(1) configuration daemon.
FLOWMOND_FIRMWARE_DESIGNXMLPath to the design.xml file which will be
used for selecting and booting firmware by
flowmond(1) program. Value of this
variable is automatically generated during building and
installation process of the package but can be changed by user.
FLOWMOND_HFE_PROGPath to the HFE program which will be used for loading to the HFE processor by flowmod program. Value of this variable is automatically generated during building and installation process of the package but can be changed by user.
Remote configuration programs use as source of the configuration data
set of configuration files in XML format (configuration datastores).
These files are located in the
/etc/liberouter/netconf/
directory by default. This location can be changed in the
netconf.conf(5) configuration file.
FlowMon Probe remote configuration uses three configuration datastores
called running, startup and
candidate (concrete filenames representing these
datastores are defined in the
netconf.conf(5) configuration file).
This configuration datastore stores configuration data used at the device startup. Configuration daemon (flowmond(1)) reads this data at its startup and set the FlowMon Probe according to startup configuration data.
After initial setting up according to startup configuration
data, configuration daemon creates running
configuration datastore and copy there a content of the
startup configuration datastore.
The FlowMon Probe is always set up according to configuration data
stored in the running configuration
datastore. If running configuration data is changed, configuration
daemon changes FlowMon Probe parameters immediately.
When the configuration daemon is stopped, it removes
running configuration datastore as well.
The candidate configuration
datastore can be used only by
NETCONF manager user interface.
Web configuration interface is
not able to use this repository.
The candidate configuration datastore
is used to hold configuration data that can be manipulated without
impacting the device's current parameters. This datastore serves as
a work place for creating and manipulating configuration data.
Additions, deletions, and changes may be made to this data to
construct the desired configuration data. A NETCONF commit
operation may be performed at any time that causes the device's
running configuration to be set to the value of the candidate
configuration.
The user can discard any uncommitted changes to the candidate configuration by executing the NETCONF discard-changes operation reverting the content of the candidate configuration to the content of the running configuration.
candidate datastore is as well as other
datastores shared among all NETCONF sessions connected to the FlowMon Probe.
Therefore locking (by NETCONF
lock
operation)of the all datastore is highly recommended.
In addition when the lock of the candidate
datastore is released (by NETCONF
unlock
operation) the content of the datastore is reverted to the content
of the running configuration.
Before starting to manipulate with this datastore, it is
necessary to lock it by NETCONF
lock
operation. If target repository of any operation is not locked,
every operation locks its target repository themselves before
performing any change. Finally the target repository is again
unlocked and therefore the content of the
candidate datastore is reverted to the
content of the running data.
Definition of the FlowMon Probe XML configuration scheme can be found at http://www.flowmon.org/flowmon-probe/devel/config/flowmon-rng/.
Table of Contents
This chapter describes starting FlowMon Probe locally by flowmonlkm(1) and flowmon(1) programs. These programs serves to unrepeated start of the FlowMon Probe. If you wish to start the FlowMon Probe anytime you will reboot the PC, please see section FlowMon init.d script.
After building and installing package including post-install steps, all FlowMon tools (included man pages) are available as any other system tools. There are two main scripts to start the probe - flowmonlkm(1) and flowmon(1). Both scripts use flowmon.conf(5) configuration file.
flowmonlkm(1) script is used for
loading/removing FlowMon kernel modules. There are two main options
for this script. Option -l is used for loading
FlowMon kernel modules and option -r is used for
removing these modules. Script uses
lspci(8) utility to detect COMBO6(X) card.
When all kernel modules are loaded, csid(1) is able to detect type of plugged cards and provide more detailed information.
You should get following output on PC with installed
COMBO6 mother card and COMBO-4MTX add-on card:
$ csid
combo6 mtx2 xcv2000
COMBO6X mother card and COMBO-4SFPRO add-on card:
$ csid
combo6x sfpro xc2vp20
COMBO6X mother card and COMBO-4XFP2.0 add-on card:
$ csid
combo6x xfp2.0 xc2vp30
COMBO6X mother card and COMBO-4XFP2.1 add-on card:
$ csid
combo6x xfp2 xc2vp30
Chips can be different on some cards, so don't worry about differing last part of the csid output
flowmon(1) is main start up script for the
FlowMon probe. Script boots firmware files (according to
FIRMWARE_PATH variable from the
flowmon.conf(5)),
setting up probe behavior and is able to start NetFlow protocol exporter.
By default, the probe settings are set according to variables from
flowmon.conf(5)
configuration file. Optionally you can define your own settings by options
given to the script. More detailed information you can get by
-h option or from man page:
$ flowmon -h
$ man flowmon
You should get following output in the control buffer via dmesg(8) command after starting up FlowMon Probe:
$ dmesg
combo6#0: device 0xf1010100 (NETFLOW_1Gbps_Probe) successfully attached
Both scripts (flowmon(1) as well as flowmonlkm(1)) using lsof(8) tool to detect any process using COMBO6(X) device(s). To run scripts properly you have to install lsof(8) tool. lsof(8) is utility to get information about files opened by processes.
The FlowMon Probe logs important events to syslog using the user facility.
To have these log messages saved to a file, you must configure the syslog
daemon appropriately. In the case of the classical Unix syslogd daemon,
add the following line to /etc/syslog.conf:
user.* /var/log/user.log
Regarding to your Linux distribution see syslogd(8) and logrotate(8) documentation how to adjust log file rotation.
# flowmonlkm -l
Loading FlowMon kernel modules for COMBO6X card.
szedatax_c6pcr 13504 3
szedata 31596 5 szedatax_c6pcr
libermemalloc 4164 2 szedatax_c6pcr,szedata
combo6x 13028 1 szedatax_c6pcr
combo6 20072 1 szedatax_c6pcr
combo6core 24052 7 szedatax_c6pcr,combo6x,combo6
$ flowmon -ec collector.liberouter.org:60000
Server collector.liberouter.org
is only example name of the collector host which doesn't exist. Use,
please, your own (existing) collectors.
To make sure that the firmware was loaded correctly you can run csid(1):
$ csid -s
Board : combo6
Addon : mtx2
Chip : xcv2000
LAN ports: 4
Firmware : ok
SW : 0xf1010002
HW : 0x00000006
Text : NETFLOW_1Gbps_Probe
HW number detected by csid -s
reflects firmware version, e.g. HW : 0x00000006 reflects version
NETFLOW_01_06.
To stop running exporter(s) and detach drivers, use
flowmon(1) script with the
-s option:
$ flowmon -s
Then you can remove Flowmon loaded kernel modules by the flowmonlkm(1) script:
# flowmonlkm -r
You can list all running exporters by system command ps(1) or use startup script:
$ ps aux | grep flowmon
flowmon 3023 12:19 0:11 flowmon_nf9 collector.liberouter.org 60000 -I 65535
flowmon 3105 12:26 0:04 flowmon_nf5 -d localhost 3003
Startup scripts are used to start some service (or some script) at the
machine boot time. Our sample startup script is used to automatically
start up the FlowMon Probe (loads kernel modules if necessary, boots
firmware and set up the probe behavior) anytime your PC is starting up.
Sample script is stored in the package directory structure in the
base/sys_sw/projects/flowmon/doc
directory as a flowmon.rc file. It is prepared for use
in the SysV init system (and tested on the Red Hat Linux distribution).
Script is commented so you can get a lot of information directly from the
script.
Startup script uses flowmon.conf(5) to start flow exporter(s).
copy flowmon.rc file to the
/etc/rc.d/init.d/ directory
and rename it to the flowmon
run chkconfig(8) and add flowmon as new service
# chkconfig --add flowmon
To verify, everything is right, you can try to find flowmon in the list of services
# chkconfig --list | grep flowmon
reboot your system
To stop FlowMon (kill running exporters) go to the
/etc/rc.d/init.d/ directory and
use following command:
# ./flowmon stop
This command causes stopping FlowMon but the service will be started
again during next reboot. To switch off the FlowMon service, in the
current runlevel, use chkconfig(8) with off
option after service name (flowmon in our case):
# chkconfig flowmon off
Last possibility is to remove FlowMon service from chkconfig(8) management:
# chkconfig --del flowmon
More detailed information you can find in the chkconfig(8) man page.
To show current status of the FlowMon Probe use option
status. It displays all running FlowMon
exporter(s).
# ./flowmon status
Loaded kernel modules for the FlowMon probe:
netflow_ph1 7684 2
szedata 21452 3 netflow_ph1
libermemalloc 2948 2 netflow_ph1,szedata
combo6 13928 1 netflow_ph1
combo6core 15956 4 netflow_ph1,combo6
Running FlowMon exporter(s):
flowmon_nf9 collector.liberouter.org 3002 -I 6553
To read data from HW and send them to collector you can run several instances of FlowMon exporters. Before running exporter you must start FlowMon probe (load kernel modules and run flowmon script).
FlowMon exporter has possibility to anonymize exported data, perform filtering, exporter sampling, use IPv4 or IPv6 transport etc. There are three versions of FlowMon exporter, flowmon_nf5(1) for exporting in NetFlow version 5 export format, flowmon_nf9(1) for exporting in NetFlow version 9 export format and flowmon_ipfix(1) for exporting in IPFIX export format.
Example 4.1. Basic Exporting of NetFlow Records to the Collector
Following example shows running three exporters, first one exporting in NetFlow version 5 to a port 60000 of a collector collector.liberouter.org, second one in NetFlow version 9 to a port 60001 of the same collector and third one in IPFIX export format to a port 60002 of the same collector. Parameter -d runs exporter as a daemon.
$flowmon_nf5 -d collector.liberouter.org:60000$flowmon_nf9 -d collector.liberouter.org:60001$flowmon_ipfix -d collector.liberouter.org:60002
Example 4.2. Exporting Anonymized NetFlow Records
Exporting NetFlow records from card 0 and interface 0 with anonymized source and destination IP address by applying block cipher.
$ flowmon_nf9 -c 0:0 -a aes:fields=src,dst -d collector.liberouter.org:60000
The exporter program will start sending flow records to the configured collector. To test that it is really the case, you can run a packet sniffer such as tcpdump(1) or ethereal(1), for example
#tcpdump -i interface 'udp dst port collector_port'#tcpdump -i eth0 'udp dst port 60000' tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 12:23:41.656669 IP exporter.flowmon.org.32768 > collector.liberouter.org.60000: UDP, length 1424 12:23:41.667760 IP exporter.flowmon.org.32768 > collector.liberouter.org.60000: UDP, length 1424 12:23:41.667798 IP exporter.flowmon.org.32768 > collector.liberouter.org.60000: UDP, length 1420 ...
You should see the NetFlow traffic sent by the flow exporter to the collector. To test basic collector functionality you can use flowmoncol(1) tool.
Example 4.3. Testing Collector - Exporter Functionality by flowmoncol(1) Tool
You can test basic FlowMon Probe functionality by running one instance of FlowMon exporter exporting flows to the localhost and collecting these flows by simple flowmoncol(1) collector.
$flowmon_nf5 -d localhost:60000$flowmoncol -l 60000 -m 4 seq 871320, dur 106 ms, in 0, proto 6, 195.113.123.86:36174 -> 82.208.7.33:80, packets 17, octets 912, aps 53, bps 68830, pps 160 seq 871320, dur 82 ms, in 0, proto 6, 147.231.249.66:3902 -> 77.75.72.72:80, packets 4, octets 1689, aps 422, bps 164780, pps 48 seq 871320, dur 40207 ms, in 0, proto 6, 195.113.168.70:49307 -> 80.239.235.195:443, packets 11, octets 586, aps 53, bps 116, pps 0 ...
For further information please see exporters man pages:
$man flowmon_nf5$man flowmon_nf9$man flowmon_ipfix
Repeater duplicates data from PORT0 to PORT1 and vice versa. PORT2 and PORT3 are not utilized on COMBO-4SFP or COMBO-4MTX. COMBO-4SFPRO card is able to mirror traffic from PORT0 to PORT2 and from PORT1 to PORT3. Input streams from PORT0 and PORT1 are processed by IBUFs. In each IBUF Input Sampling rate can be set. Also, repeater is not present on COMBO2-XFP2 card.
It is necessary to state that the repeater is independent on the state of the rest of firmware and software as well. It is only dependent on state of the FPGA chip and thus on the state of the host computer (power supply, firmware booting). So if you have connected the FlowMon probe directly in the link as repeater (see section FlowMon Probe Inserted in a Line), the built-in repeater starts to transfer packets in both directions between interfaces 0 and 1, and at the same time mirror packets to interfaces 2 and 3. If you choose this option it is recommended to use UPS (uninterruptable power supply) so the repeater is available during power failures.
During reloading or resetting card, it takes about 4 seconds to start repeating again. Also monitoring starts 4 seconds later after reset or reload.
phyterctl(1) is tool used to display and change configuration of 4 interfaces available on COMBO-4SFPRO cards. The tool displays information about link status, resolved speed or duplex mode on link. phyterctl(1) is also able to change the advertised speed and duplex mode and provides r/w access to internal registers of the physical layer IC.
ibufctl(1) is used to display and change configuration of IBUF components in FlowMon COMBO6X designs.
$phyterctl -s100 -i0 ... advertise 100Mbps on interface 0$ibufctl -s100 -i0 ... set 100Mbps input on interface 0
Example of phyterctl(1) listing with GBIC EEPROM information:
$ phyterctl -c gbic
Settings for card 0 (device /dev/combosix/0):
------------------------------ Interface 0 ---
Transceiver FINISAR CORP.
Model FCMJ-8521-3
Phyter vendor MARVELL
Phyter model 88E1111 Gigabit PHY
Speed 1000 Mb/s
Mode Full-duplex
Link status Up
------------------------------ Interface 1 ---
Transceiver FINISAR CORP.
Model FCMJ-8521-3
Phyter vendor MARVELL
Phyter model 88E1111 Gigabit PHY
Speed 1000 Mb/s
Mode Full-duplex
Link status Up
------------------------------ Interface 2 ---
Transceiver FINISAR CORP.
Model FCMJ-8521-3
Phyter vendor MARVELL
Phyter model 88E1111 Gigabit PHY
Link status Down
------------------------------ Interface 3 ---
Transceiver FINISAR CORP.
Model FCMJ-8521-3
Phyter vendor MARVELL
Phyter model 88E1111 Gigabit PHY
Speed 1000 Mb/s
Mode Full-duplex
Link status Up
More information can be found in the phyterctl(1) and ibufctl(1) man pages or in the README files placed in the base/sys_sw/hwtools/phyter/ and base/sys_sw/hwtools/ibufctl/ directories.
COMBO card doesn't support autonegotiation and autoswitching between 10Mbps/100Mbps/1000Mbps. You need to use phyterctl(1) and ibufctl(1) tools.
Table of Contents
Remote configuration of the FlowMon Probe is based on the NETCONF protocol. As you can see on the remote configuration system scheme the core of the system is made up of pair of the NETCONF protocol programs. On the server side system uses flowmond(1) configuration daemon program to change current settings of the FlowMon Probe. Client side of the NETCONF protocol implementation (netconf(1) program) has built-in command line interface (similar to e.g. sftp(1) program). netconf(1) can be also used as a backend for other user interfaces, as used for the Web frontend.
This section describes step-by-step process to prepare server (PC with installed COMBO6(X) card) and manager PC (any PC with Linux OS connected to the Internet).
Server is a PC machine with installed COMBO6(X) card. To install
all necessary tools, please follow steps described in the
Building package and
Installing package section.
For installing you have to select server
installation type:
# ./pkgtool --install=server
flowmond(1) is one of the most important
server program. It provides firmware booting, setting up all parameters
and starting and controlling exporter programs.
flowmond(1) must be always running on the
server machine. For starting
flowmond(1) the flowmond.rc
script is used. This script is prepared for use in the SysV init system
(and tested on the Red Hat Linux distribution).
copy flowmond.rc file (from
sys_sw/projects/flowmon/doc
package directory) to the
/etc/rc.d/init.d/ directory
and rename it to the flowmond
run chkconfig(8) and add flowmond as new service
# chkconfig --add flowmond
To verify, everything is right, you can try to find flowmond in the list of services
# chkconfig --list | grep flowmond
reboot your system or run flowmond script manually
# /etc/init.d/flowmond start
If the flowmond(1) doesn't start automatically,
one of possible problems can be the wrong BINDIR
variable set in the
flowmon.conf(5) configuration file. So please
check, that directory represented by this variable contains the
FlowMon programs (csxtool(1),
flowmond(1), etc.).
Configuration file netconf.conf(5) is stored in the
/etc/liberouter/ directory. This
file contains paths to various files used during remote configuration.
You should make sure that these paths exist and the access rights
enables r/w rights for all users you want to use the FlowMon remote
configuration system.
netconf.conf(5) is actually a list of definition of environment variables.
VARNAME=VALUE
The file can contain blank lines or lines starting with '#' are ignored by programs and can be used for comments. The meanings of the variables are as follows.
runningThe filename (including absolute path) of the file storing running configuration datastore. Running configuration datastore is created by flowmond(1) program when it starts so you never should create this file manually.
The file is created with r/w access right for user and group as the flowmond(1) is running. By default, the flowmond(1) started at a boot time is running as root (user as well as group). To change this behavior and run flowmond(1) as e.g. flowmon user (and e.g. liberouter group), you have to edit flowmond startup script and change following lines:
# start flowmond configuration daemon
# change parameter -u to run flowmond with specific user's rights
$BINDIR/flowmond -u root -g root
to
# start flowmond configuration daemon
# change parameter -u to run flowmond with specific user's rights
$BINDIR/flowmond -u flowmon -g liberouter
But then, please check out that user flowmon (or liberouter group) is able to create a file in the directory where the running datastore should be stored. To better protection of the configuration data, ONLY user flowmon (or liberouter group) should be able to write to this directory. Remember, that in this case, only user flowmon (or members of liberouter group) will be able to successfully configure the FlowMon Probe remotely.
startupThe filename (including absolute path) of the file storing startup configuration datastore. This file must be created manually. Please, make sure, that user (or group) of user (or group) running flowmond(1) is able to write and read this file. By default this file is writable only by root.
candidateThe filename (including absolute path) of the file storing candidate configuration datastore. This file is dynamically created and changed by netconf-agent(1) program. Please make sure, that all users you want to use the FlowMon remote configuration system are able to create a file in the directory where the candidate configuration datastore should be stored. This can be done by creating a group of users that will configure the FlowMon Probe remotely. Directory containing configuration datastores then will be writable only by this group.
comm_keySpecifies the filename (including absolute path) of the file representing the key (token) for the communication between flowmond(1) and netconf-agent(1)(s) programs. This file should be placed in the directory where only users, you want to use the FlowMon remote configuration system, are able to write.
daemon_inSpecifies the filename (including absolute path) of the file representing communication pipe from netconf-agent(1) program to the flowmond(1). This file should be placed in the directory where only users, you want to use the FlowMon remote configuration system, are able to write.
daemon_outSpecifies the filename (including absolute path) of the file representing communication pipe from flowmond(1) program to the netconf-agent(1). This file should be placed in the directory where only users, you want to use the FlowMon remote configuration system, are able to write.
xsl_keysSpecifies the filename (including absolute path) of the file with XSL stylesheet to add key-nodes to the XML configuration datastore. These key-nodes are then used by the netconf-agent(1) program during subtree filtering.
Proper XSL stylesheets are part of the installation package.
xsl_statsSpecifies the filename (including absolute path) of the file with XSL stylesheet to add nodes containing the FlowMon Probe state information to the XML configuration datastore. This stylesheet is used in the implementation of NETCONF get command.
Proper XSL stylesheets are part of the installation package.
The FlowMon remote configuration system uses the SSH to built-up secured NETCONF connection between server and manager PC. To enable the NETCONF connection over SSH, you have to edit sshd(8) configuration file sshd_config(5).
In the sshd_config(5) configuration file you have to enable SSH connection on the port 830 (this port was assigned to the NETCONF over SSH connection by IANA. This can be done by adding following line to the configuration file.
Port 830
If you are using default SSH port 22, make sure that you have uncommented this line in the configuration file.
Port 22
You can also use (on your own risk) any other port to establish NETCONF connection. NETCONF manager program netconf(1) as well as Web frontend enable to specify the port number used for the NETCONF connection.
The FlowMon remote configuration system uses SSH subsystem mechanism. To enable netconf-agent(1) as SSH subsystem, you have to add following line to the sshd_config(5) configuration file.
Subsystem netconf /usr/local/liberouter/bin/netconf-agent
Notice that the /usr/local/liberouter/bin/netconf-agent
is only example (and default) path to the
netconf-agent(1) program. You have to use
your own path to this program.
Manager PC is a computer with the Linux OS used to remote FlowMon Probes
managing. You can choose the type of remote configuration between
CLI and
Web configuration interface.
To install all necessary tools, please follow steps described in the
Building package and
Installing package section.
For installing you have to select client<