FLENT(1)

NAME
flent - Flent: The FLExible Network Tester

INTRODUCTION

Flent is a wrapper around netperf and similar tools to run predefined tests and aggregate and plot the results. It defines several tests that can be run against one or more hosts, primarily targeted at testing for the presence of bufferbloat under various conditions.

The aggregated data is saved in (gzipped) JSON format for later processing and/or import into other tools. The JSON format is documented below.

Apart from the JSON format, the data can be output as csv values, emacs org mode tables or plots. Each test can specify several different plots, including time-series plots of the values against each other, as well as CDF plots of (e.g.) ping times.

Plots can be output to the formats supported by matplotlib by specifying the output filename with -o output.{png,ps,pdf,svg}. If no output file is specified, the plot is displayed using matplotlib’s interactive plot browser, which also allows saving of the output (in .png format).

  Requirements

Flent runs on Python, versions 2.7+ and 3.3+. Plotting requires a functional matplotlib installation (but everything else can run without matplotlib). For the interactive plot viewer, a graphical display (and suitably configured matplotlib) is required.

Most tests employ the netperf benchmarking tool to run the tests. Version 2.6 or higher is required, and netperf must be compiled with the --enable-demo option passed to ./configure. Some tests use iperf in addition to, or instead of netperf. Both tools must be available in the PATH.

For ICMP ping measurements, the version of ping employed must support output timestamping (the -D parameter to GNU ping). This is not supported by the BSD and OSX versions of ping. As an alternative to the regular ping command, the fping utility (see <http://fping.org>) can be employed. In that case fping must be version 3.5 or greater. Flent will attempt to detect the presence of fping in the PATH and check for support for the -D parameter. If this check is successful, fping will be employed for ping data, otherwise the system ping will be used.

The irtt tool is highly recommended for UDP measurements. See <https://github.com/peteheist/irtt>. Flent will automatically detect if irtt is available in the PATH and use it if it is detected. Note that the server component of irtt needs to be running on the target host(s) as well.

RUNNING FLENT

When run, flent must be supplied either (a) a test name and one or more host names to connect to, or (b) one or more input files containing data from previous runs to post-process.

Test names, hostnames and input file names can all be specified as unqualified arguments, and flent will do its best to guess which is which. For each argument, if it is an existing file, it is assumed to be an input file, if it is the name of an existing test configuration it’s assumed to be a test name, and if neither of those are true, it is assumed to be a host name. The -i and -H switches can be used to explicitly specify the interpretation of an argument.

  Invocation

flent [options] <host|test|input file ...>

  General options

    -o OUTPUT, --output=OUTPUT
        File to write processed output to (default standard out).

    -D DATA_DIR, --data-dir=DATA_DIR
        Directory to store data files in. Defaults to the current directory.

    -i INPUT, --input=INPUT
        File to read input from (instead of running tests). Input files can also be specified as unqualified arguments without using the -i switch.

    -f FORMAT, --format=FORMAT
        Select output format (plot, csv, org_table, stats). Default is no processed output (just writes the JSON data file).

    -p PLOT, --plot=PLOT
        Select which plot to output for the given test (implies -f plot). Use the --list-plots option to see available plots.

    -t TITLE, --title-extra=TITLE
        Text to add to plot title and data file name.

    -n NOTE, --note=NOTE
        Add arbitrary text as a note to be stored in the JSON data file (under the NOTE key in the metadata object).

    -r RCFILE, --rcfile=RCFILE
        Load configuration data from RCFILE (default ~/.flentrc). See section below for information on the rc file format.

    -x, --extended-metadata
        Collect extended metadata and store it with the data file. May include details of your machine you don’t want to distribute; see the section on the data format below.

    --remote-metadata=HOSTNAME
        Collect extended metadata from a remote host. HOSTNAME is passed verbatim to ssh, so can include hosts specified in ~/.ssh/config. Note that gathering the data can take some time, since it involves executing several remote commands. This option can be specified multiple times and implies --extended-metadata.

    --gui
        Run the flent GUI. All other options are used as defaults in the GUI, but can be changed once it is running. The GUI can also be started by running the flent-gui binary. For more information on the GUI, see the The Flent GUI section.

    --new-gui-instance
        Start a new GUI instance. Otherwise, flent will try to connect to an already running GUI instance and have that load any new data files specified as arguments. Implies --gui when passed on the command line, but not when set in the rc file. Note that when multiple GUI instances are running, there is no guarantee as to which instance will get a subsequent open request (if run again without --new-gui-instance).

    --gui-no-defer
        Normally, the GUI defers redrawing plots until they are needed to avoid redrawing all open plots every time an option changes. This switch turns off that optimisation in favour of always redrawing everything straight away. This is useful when loading a bunch of plots from the command line and then wanting to flip through them without drawing delay.

    -b BATCH_NAME, --batch-name=BATCH_NAME
        Run test batch BATCH_NAME (must be specified in a batch file loaded by the --batch-file option). Can be supplied multiple times.

    -B BATCH_FILE, --batch-file=BATCH_FILE
        Load batch file BATCH_FILE. Can be specified multiple times, in which case the files will be combined (with identically-named sections being overridden by later files). See appropriate section below for an explanation of the batch file format.

    --batch-override=key=value
        Override parameter ’key’ in the batch config and set it to ’value’. The key name will be case folded to lower case. Can be specified multiple times.

    --batch-dry-run
        Dry batch run. Prints what would be done, but doesn’t actually run any tests.

    --batch-verbose
        Be verbose during batch run: Print all commands executed.

    --batch-no-shuffle
        Do not randomise the order of test runs within each batch.

    --batch-repetitions=REPETITIONS
        Shorthand for --batch-override 'repetitions=REPETITIONS’.

    --batch-title=TITLE
        Shorthand for --batch-override 'batch_title=TITLE’.

    --batch-resume=DIR
        Try to resume a previously interrupted batch run. The argument is the top-level output directory from the previous run.

        This will attempt to find a data file in the resume directory and load the BATCH_TIME from the previous run from that and continue. The assumption is that the output directory and filenames are generated from the batch time, so that they will match with the previous run when the same time is used. Then, tests for which data files already exist will be skipped on this run. If the rest of the batch invocation is different from the one being resumed, results may not be what you want.

        There's a check to ensure that the generated output path is a subdirectory of the resume directory, and the whole run will be aborted if it isn't.

  Test configuration options

These options affect the behaviour of the test being run and have no effect when parsing input files.

    -H HOST, --host=HOST
        Host to connect to for tests. For tests that support it, multiple hosts can be specified by supplying this option multiple times. Hosts can also be specified as unqualified arguments; this parameter guarantees that the argument be interpreted as a host name (rather than being subject to auto-detection between input files, hostnames and test names).

    --local-bind=IP
        Local hostname or IP address to bind to (for test tools that support this). Can be specified multiple times for tests that connect to more than one host; if it is, it must be specified as many times as there are hosts.

    --remote-host=idx=HOSTNAME
        A remote hostname to connect to when starting a test. The idx is the runner index, which is assigned sequentially to each runner (and so it is not the same as the sequence of hostnames). Look for the 'IDX' key in SERIES_META for a test get the idx used here, but note that the idx assignment depends on the exact arguments to the test.

        This works by simply prepending 'ssh HOSTNAME' to the runner command, so it relies on the same binaries being in the same places on both machines, and won't work for all runners.

        This option can be specified multiple times to have multiple runners run on remote hosts.

    -l LENGTH, --length=LENGTH
        Base test length (some tests may add some time to this).

    -s STEP_SIZE, --step-size=STEP_SIZE
        Measurement data point step size.

    -d DELAY, --delay=DELAY
        Number of seconds to delay parts of test (such as bandwidth loaders).

    -4, --ipv4
        Use IPv4 for tests (some tests may ignore this).

    -6, --ipv6
        Use IPv6 for tests (some tests may ignore this).

    --socket-timeout=SOCKET_TIMEOUT
        Socket timeout (in seconds) used for UDP delay measurement, to prevent stalls on packet loss. Only enabled if the installed netperf version is detected to support this (requires SVN version of netperf).

        For the default value, see the output of flent -h. The value of this parameter is an implicit upper bound on how long a round-trip time that can be measured. As such you may need to adjust it if you are experiencing latency above the default value. Set to 0 to disable.

    --send-size=SEND_SIZE
        Send size (in bytes) used for TCP tests. Netperf uses the socket buffer size by default, which if too large can cause spikes in the throughput results. Lowering this value will increase CPU usage but also improves the fidelity of the throughput results without having to decrease the socket buffer size.

        Can be specified multiple times, with each value corresponding to a stream of a test. If only specified once, the same value will be applied to all flows.

    --test-parameter=key=value
        Arbitrary test parameter in key=value format. Key will be case folded to lower case. The values are stored with the results metadata, and so can be used for storing arbitrary information relevant for a particular test run.

        In addition to serving as simple metadata, the test parameters can also affect the behaviour of some test configurations. See the Supplied Tests section for information on these.

        This option can be specified multiple times to set multiple test parameters.

    --swap-up-down
        Switch upstream and downstream directions for data transfer. This means that ’upload’ will become ’download’ and vice versa. Works by exchanging netperf TCP_MAERTS and TCP_STREAM parameters, so only works for tests that employ these as their data transfer, and only for the TCP streams.

    --socket-stats
        Parse socket stats during test. This will capture and parse socket statistics for all TCP upload flows during a test, adding TCP cwnd and RTT values to the test data. Requires the 'ss' utility to be present on the system, and can fail if there are too many simultaneous upload flows; which is why this option is not enabled by default.

    --marking-name
        Define a new symbolic name that can be used when specifying flow markings using the 'markings' test parameter. This can be used to make it easier to specify custom diffserv markings on flows by using symbolic names for each marking value instead of the hex codes. Values specified here will be used in addition to the common values (listed below), and cannot override the built-in names. Names will be case-folded when matching.

        The list of symbolic markings natively supported, along with their hex expansions, are:

                AF11: 0x28    CS0: 0x00
                AF12: 0x30    CS1: 0x20
                AF13: 0x38    CS2: 0x40
                AF21: 0x48    CS3: 0x60
                AF22: 0x50    CS4: 0x80
                AF23: 0x58    CS5: 0xa0
                AF31: 0x68    CS6: 0xc0
                AF32: 0x70    CS7: 0xe0
                AF33: 0x78    EF:  0xb8
                AF41: 0x88
                AF42: 0x90
                AF43: 0x98

    Note that the hexadecimal values denote the value of the full ToS byte (including the two ECN bits), so they need to be right-shifted by two bits to get the corresponding diffserv code points.

  Plot configuration options

These options are used to configure the appearance of plot output and only make sense combined with -f plot.

    --label-x=LABEL

    --label-y=LABEL
        Override the figure axis labels. Can be specified twice, corresponding to figures with multiple axes.

    -I, --invert-latency-y
        Invert latency data series axis (typically the Y-axis), making plots show ’better' values upwards.

    -z, --zero-y
        Always start Y axis of plot at zero, instead of autoscaling the axis. Autoscaling is still enabled for the upper bound. This also disables log scale if enabled.

    --log-scale={log2,log10}
        Use the specified logarithmic scale on plots.

    --norm-factor=FACTOR
        Data normalisation factor. Divide all data points by this value. Can be specified multiple times, in which case each value corresponds to a data series.

    --bounds-x=BOUNDS

    --bounds-y=BOUNDS
        Specify bounds of the plot axes. If specifying one number, that will become the upper bound. Specify two numbers separated by a comma to specify both upper and lower bounds. To specify just the lower bound, add a comma afterwards. Can be specified twice, corresponding to figures with multiple axes.

    -S, --scale-mode
        Treat file names (except for the first one) passed as unqualified arguments as if passed as --scale-data (default as if passed as --input).

    --concatenate
        Concatenate multiple result sets into one data series. This means that each data file will have its time axis shifted by the preceding series duration and appended to the first data set specified. Only works for data sets from the same test, obviously.

    --absolute-time
        Plot data points with absolute UNIX time on the x-axis. This requires the absolute starting time for the test run to be stored in the data file, and so it won’t work with data files that predates this feature.

    --subplot-combine
        When plotting multiple data series, plot each one on a separate subplot instead of combining them into one plot. This mode is not supported for all plot types, and only works when --scale-mode is disabled.

    --skip-missing-series
        Skip missing series entirely from bar plots, instead of leaving an empty space for it.

    --no-print-n
        Do not print the number of data points on combined plots. When using plot types that combines results from several test runs, the number of data series in each combined data point is normally added after the series name, (n=X) for X data series. This option turns that off.

    --no-annotation
        Exclude annotation with hostnames, time and test length from plots.

    --figure-note=NOTE, --fig-note=NOTE
        Add a note (arbitrary text) to the bottom-left of the figure.

    --no-title
        Exclude title from plots.

    --override-title=TITLE
        Override plot title with this string. Completely discards the configured title (from the test configuration), as well as the title stored in the data set, and replaces it with the value supplied here. This is useful to override the plot title at the time of plotting, for instance to add a title to an aggregate plot from several data series. When this parameter is specified, --no-title has no effect.

    --no-labels
        Hides tick labels from box and bar plots.

    --no-markers
        Don’t use line markers to differentiate data series on plots.

    --no-legend
        Exclude legend from plots.

    --horizontal-legend
        Place a horizontal legend below the plot instead of a vertical one next to it. Doesn't always work well if there are too many items in the legend.

    --legend-title=LEGEND_TITLE
        Override legend title on plot.

    --legend-placement=LEGEND_PLACEMENT
        Control legend placement. Enabling this option will place the legend inside the plot at the specified location. Can be one of 'best', 'upper right', 'upper left', 'lower left', 'lower right', 'right', 'center left', 'center right', 'lower center', 'upper center' or 'center'.

    --legend-columns=LEGEND_COLUMNS

    Set the number of columns in the legend.

    --reverse-legend
        Reverse the order of items in the legend. This can be useful to make the legend order match the data series in some cases.

    --filter-legend
        Filter legend labels by removing the longest common substring from all entries. This is not particularly smart, so use with care.

    --replace-legend=src=dest
        Replace 'src' with 'dst' in legends. Can be specified multiple times.

    --filter-regexp=REGEXP
        Filter the plot legend by the supplied regular expression (removing any text from the legend that matches the expression). Can be specified multiple times, in which case the filters will be applied in the order specified. Note that for combining several plot results, the regular expression is also applied before the grouping logic, meaning that a too wide filter can mess up the grouping.

    --override-label=LABEL
        Override dataset label. Can be specified multiple times when multiple datasets are being plotted, in which case the order of labels corresponds to the order of datasets.

        Like --override-title, this is applied at the time of plotting.

    --filter-series=SERIES
        Filter out specified series from plot. Can be specified multiple times.

    --split-group=LABEL
        Split data sets into groups when creating box plots. Specify this option multiple times to define the new groups; the value of each option is the group name.

        Say you're plotting nine datasets which are really testing two variables with three values each. In this case, it can be useful to have the box plot of the results be split into three parts (corresponding to the values of one variable) with each three boxes in each of them (corresponding to the values of the second variable). This option makes this possible; simply specify it three times with the labels to be used for the three groups.

        A constraint on this option is that the number of datasets being plotted must be divisible by the number of groups.

    --colours=COLOURS
        Comma-separated list of colours to be used for the plot colour cycle. Can be specified in any format understood by matplotlib (including HTML hex values prefixed with a #).

        Yes, this option uses British spelling. No, American spelling is not supported.

    --override-colour-mode=MODE
        Override colour_mode attribute. This changes the way colours are assigned to bar plots. The default is 'groups' which assigns a separate colour to each group of data series. The alternative is 'series' which assigns a separate colour to each series, repeating them for each data group.

    --override-group-by=GROUP
        Override the group_by setting for combination plots. This is useful to, for instance, switch to splitting up combined data sets by batch run instead of by file name.

    --combine-save-dir=DIRNAME
        When doing a combination plot save the intermediate data to DIRNAME. This can then be used for subsequent plotting to avoid having to load all the source data files again on each plot.

    --figure-width=FIG_WIDTH
        Figure width in inches. Used when saving plots to file and for default size of the interactive plot window.

    --figure-height=FIG_HEIGHT
        Figure height in inches. Used when saving plots to file and for default size of the interactive plot window.

    --figure-dpi=FIG_DPI
        Figure DPI. Used when saving plots to raster format files.

    --fallback-layout
        Use the fallback layout engine (tight_layout built in to matplotlib). Use this if text is cut off on saved figures. The downside to the fallback engine is that the size of the figure (as specified by --figure-width and --figure-height) is no longer kept constant.)

    --no-matplotlibrc
        Don’t load included matplotlibrc values. Use this if autodetection of custom matplotlibrc fails and flent is inadvertently overriding rc values.

    --no-hover-highlight
        Don't highlight data series on hover in interactive plot views. Use this if redrawing is too slow, or the highlighting is undesired for other reasons.

    --scale-data=SCALE_DATA
        Additional data files to consider when scaling the plot axes (for plotting several plots with identical axes). Note, this displays only the first data set, but with axis scaling taking into account the additional data sets. Can be supplied multiple times; see also --scale-mode.

  Test tool-related options

    --control-host=HOST
        Hostname for the test control connection (for test tools that support this). Default: First hostname of test target.

        When running tests that uses D-ITG as a test tool (such as the voip-* tests), this switch controls where flent will look for the D-ITG control server (see section below on running tests with D-ITG). For Netperf-based tests, this option is passed to Netperf to control where to point the control connection. This is useful to, for instance, to run the control server communication over a separate control network so as to not interfere with test traffic.

        There is also a per-flow setting for this for tests that connect to multiple hosts; see the control_hosts test parameter in Supplied Tests. If both are set, the per-flow setting takes precedence for those tests that use it.

    --control-local-bind=IP
        Local hostname or IP to bind control connection to (for test tools that support it; currently netperf). If not supplied, the value for --local-bind will be used. Note that if this value is passed but --local-bind is not, netperf will use the value specified here to bind the data connections to as well.

    --netperf-control-port=PORT
        Port for Netperf control server. Default: 12865.

    --ditg-control-port=PORT
        Port for D-ITG control server. Default: 8000.

    --ditg-control-secret=SECRET
        Secret for D-ITG control server authentication. Default: ’’.

    --http-getter-urllist=FILENAME
        When running HTTP tests, the http-getter tool is used to fetch URLs (see <https://github.com/tohojo/http-getter>). This option specifies the filename containing the list of HTTP URLs to get. Can also be a URL, which will then be downloaded as part of each test iteration. If not specified, this is set to <http:/>/<hostname>/filelist.txt where <hostname> is the first test hostname.

    --http-getter-dns-servers=DNS_SERVERS
        DNS servers to use for http-getter lookups. Format is host[:port][,host[:port]]... This option will only work if libcurl supports it (needs to be built with the ares resolver). Default is none (use the system resolver).

    --http-getter-timeout=MILLISECONDS
        Timeout for HTTP connections. Default is to use the test length.

    --http-getter-workers=NUMBER
        Number of workers to use for getting HTTP urls. Default is 4.

    --irtt-sampling-interval=MILLISECONDS
        Override the sampling interval passed to irtt, in milliseconds. Can be used to run irtt with a higher sampling frequency than the rest of the test. If set, this will override the sampling interval for all instances of irtt used in the test.

  Misc and debugging options:

    -L LOG_FILE, --log-file=LOG_FILE
        Write debug log (test program output) to log file.

    --list-tests
        List available tests and exit.

    --list-plots
        List available plots for selected test and exit.

    -V, --version
        Show Flent version information and exit.

    -v, --verbose
        Enable verbose logging to console.

    -q, --quiet
        Disable normal logging to console (and only log warnings and errors).

    --debug-error
        Print full exception backtraces to console.

    -h, --help
        Show usage help message and exit.

  Signals

Flent will abort what it is currently doing on receiving a SIGINT -- this includes killing all runners, cleaning up temporary files and shutting down as gracefully as possible. Runners are killed with SIGTERM in this mode, and their output is discarded. If a batch run is in progress, the current test will be interrupted in this way, and the rest of the batch run is aborted. Previously completed tests and their results are not aborted. Post-commands marked as ’essential’ will be run after the test is interrupted. Additionally, flent converts SIGTERM into SIGINT internally and reacts accordingly.

Upon receiving a SIGUSR1, flent will try to gracefully abort the test it is currently running, and parse the output of the runners to the extent that any such output exists. That is, each runner will be killed by a SIGINT, which will cause a graceful shutdown for at least ping and netperf (although netperf running in TCP_MAERTS mode will bug out when interrupted like this, so end-of-tests statistics will be missing). Flent will only react once to a SIGUSR1, sending exactly one SIGINT to the active runners, then wait for them to exit. This may take several seconds in the case of netperf. If the runners for some reason fail to exit, flent will be stuck and will need to be killed with SIGINT. If running in batch mode, SIGUSR1 will only affect the currently running test; subsequent tests will still be run.

SUPPLIED TESTS

Test are supplied as Python files and can specify commands to run etc. For a full list of the tests supported by flent, see the --list-tests option.

  The Realtime Response Under Load (RRUL) test

This test exists in a couple of variants and is a partial implementation of the RRUL specification as written by Dave Taht (see <https://www.bufferbloat.net/projects/bloat/wiki/RRUL_Spec/>). It works by running RTT measurement using ICMP ping and UDP roundtrip time measurement, while loading up the link with eight TCP streams (four downloads, four uploads). This quite reliably saturates the measured link (wherever the bottleneck might be), and thus exposes bufferbloat when it is present.

  Simple TCP flow tests

These tests combine a TCP flow (either in one direction, or both) with an ICMP ping measurement. It’s a simpler test than RRUL, but in some cases the single TCP flow can be sufficient to saturate the link.

  UDP flood test

This test runs iperf configured to emit 100Mbps of UDP packets targeted at the test host, while measuring RTT using ICMP ping. It is useful for observing latency in the face of a completely unresponsive packet stream.

  Test parameters

Some test parameters (set with --test-parameter ) affect the way tests behave. These are:

    upload_streams

    download_streams

    bidir_streams
        These set the number of streams for the tests that are configurable. The tcp_nup, tcp_ndown and rrul_be_nflows tests understand upload_streams and download_streams, while the rrul_var test understands bidir_streams. If any of these parameter is set to the special value num_cpus the number of streams will be set to the number of CPUs on the system (if this information is available).

    tcp_cong_control
        Set the congestion control used for TCP flows, for platforms that supports setting it. This can be specified as a simple string to set the same value for upstream and downstream, or two comma-separated values to set it separately for the upstream and downstream directions. On Linux, any value in the sysctl net.ipv4.tcp_allowed_congestion_control can be used.

        If a congestion control is specified that is not available on the system running the test, setting it will simply fail. In addition, some tests override the congestion control for one or more flows. The actual congestion control used is stored in the CONG_CONTROL per-test metadata field.

    udp_bandwidth

    udp_bandwidths

    udp_pktsize

    udp_pktsizes
        This sets the bandwidth and packet size of each UDP stream in the udp_* tests. The option is passed to iperf so can be in any syntax the iperf understands (e.g. 20M for 20 Mbps).

        When running multiple UDP streams use the plural versions of the options (udp_bandwidths and udp_pktsizes) to specify individual per-stream values (comma-separated per stream), or the singular versions to specify the same value for all streams.

    burst_length

    burst_ports

    burst_psize

    burst_tos
        These set the length, number of ports to use, packet size and TOS value for the packet bursts generated in the burst* tests.

    cpu_stats_hosts

    netstat_hosts

    qdisc_stats_hosts

    wifi_stats_hosts
        These set hostnames to gather statistics from from during the test. The hostnames are passed to SSH, so can be anything understood by SSH (including using username@host syntax, or using hosts defined in ~/.ssh/config). This will attempt to run remote commands on these hosts to gather the required statistics, so passwordless login has to be enabled for. Multiple hostnames can be specified, separated by commas.

        CPU stats and netstat output is global to the machine being connected to. The qdisc and WiFi stats need extra parameters to work. These are qdisc_stats_interfaces, wifi_stats_interfaces and wifi_stats_stations. The two former specify which interfaces to gather statistics from. These are paired with the hostnames, and so must contain the same number of elements (also comma-separated) as the _hosts variables. To specify multiple interfaces on the same host, duplicate the hostname. The wifi_stats_stations parameter specifies MAC addresses of stations to gather statistics for. This list is the same for all hosts, but only stations present in debugfs on each host are actually captured.

        The qdisc stats gather statistics output from tc -s, while the WiFi stats gather statistics from debugfs. These are gathered by looping in a shell script; however, for better performance, the tc_iterate and wifistats_iterate programmes available in the misc/ directory of the source code tarball can be installed. On low-powered systems this can be critical to get correct statistics. The helper programmes are packaged for LEDE/OpenWrt in the flent-tools package.

    ping_hosts

    ping_local_binds

    ping_labels
        These are used to define one or more extra host names that will receive a ping flow while a test is run. The ping_hosts variable simply specifies hostnames to ping (several can be specified by separating them with commas). The ping_local_binds variable sets local IP address(es) to bind to for the extra ping flows. If specified, it must contain the same number of local addresses as the number of ping hosts. The same local address can be specified multiple times, however. The ping_labels variable is used to label each of the ping flows; if not specified, Flent will create a default label based on the target hostname for each flow.

    voip_host

    voip_local_bind

    voip_control_host

    voip_marking
        Similar to the ping variants above, these parameters specify a hostname that will receive a VoIP test. However, unlike the ping parameters, only one hostname can be specified for VoIP tests, and that end-host needs to have either D-ITG (and the control server) or the IRTT server running. The marking setting controls which DiffServ marking is applied to the VoIP flow and defaults to no marking being set.

    control_hosts
        Hostnames to use for the control connections for the rtt_fair* tests. Comma-separated. If specified, it must contain as many hostnames as the number of target hostnames specified for the test.

    markings

    labels
        Flow markings to use for each of the flows in the rtt_fair* tests. Comma-separated values of markings understood by Netperf (such as "CS0"). Only supports setting the same marking on both the upstream and downstream packets of each flow (so no "CS0,CS0" setting as can be used for Netperf). If not set, defaults to CS0 (best effort). If set, each value corresponds to a flow, and any extra flows will be set to CS0. By default each flow will be labelled according to its marking; to override these labels, use the labels parameter.

    stream_delays
        Specify a per-stream delay (in seconds) for the different streams started up by a test. Use commas to separate values for the different streams. This can be used to create tests with staggered start times, for example to test TCP flow startup convergence times. What exactly constitutes a stream depends on the test. For example, the rtt_fair* tests considers each hostname a stream, whether or not there is one or two flows going to that host.

THE FLENT GUI

Flent comes equipped with a GUI to browse and plot previously captured datasets. The GUI requires PyQt4; if this is installed, it can be launched with the --gui parameter, or by launching the flent-gui binary. Additionally, if Flent is launched without parameters and without a controlling terminal, the GUI will be launched automatically.

The GUI can be used for interactively plotting previously captured datasets, and makes it easy to compare results from several test runs. It presents a tabbed interface to graphs of data files, allows dynamic configuration of plots, and includes a metadata browser. For each loaded data file, additional data files can be loaded and added to the plot, similar to what happens when specifying multiple input files for plotting on the command line. A checkbox controls whether the added data files are added as separate entries to the plot, or whether they are used for scaling the output (mirroring the --scale-mode ) command line switch.

The GUI also incorporates matplotlib’s interactive browsing toolbar, enabling panning and zooming of the plot area, dynamic configuration of plot and axis parameters and labels and saving the plots to file. The exact dynamic features supported depends on the installed version of matplotlib.

CONFIGURATION FILES

  The RC file

Some of the command line options can be specified in an rc file. By default, flent looks for this in ~/.flentrc, but an alternative location can be specified with the --rcfile command line option.

The rc file allows options to be specified globally, an optionally overridden for specific tests. For an explanation of the options, refer to the annotated example rc file, by default installed to /usr/share/doc/flent/flentrc.example.

  Batch Files

Flent supports reading batch files to automate running several tests and do setup/teardown of test environment etc. This greatly aids reproducibility of tests.

The batch file is parsed as an ini file, and can have three types of sections: batches, commands and args. Each section also has a name; type and name are separated with two colons. 'Batches' are named tests that can be selected from the command line, 'commands' are system commands to be run before or after each test run, and 'args' are used in the looping mechanism (which allows repeating tests multiple times with different parameters).

Variables in sections control the operation of Flent and can be modified in several ways: Sections of the same type can inherit from each other and the variables in an 'arg' section will be interpolated into the batch definition on each iteration of a loop. In addition, variable contents can be substituted into other variables by using the ${varname} syntax. These three operations are resolved in this order (inheritance, arg interpolation and variable substitution).

An annotated example batchfile is distributed with the source code, and is by default installed to /usr/share/doc/flent/batchfile.example.

THE DATA FILE FORMAT

The aggregated test data is saved in a file called <test_name>-<date>.<title>.flent.gz (the title part is omitted if no title is specified by the -t parameter). This file contains the data points generated during the test, as well as some metadata.

  The top-level object keys

    version
        The file format version as an integer.

    x_values
        An array of the x values for the test data (typically the time values for timeseries data).

    results
        A JSON object containing the result data series. The keys are the data series names; the value for each key is an array of y values for that data series. The data array has the same length as the x_values array, but there may be missing data points (signified by null values).

    metadata
        An object containing various data points about the test run. The metadata values are read in as configuration parameters when the data set is loaded in for further processing. Not all tests use all the parameters, but they are saved anyway.

    raw_values
        An array of objects for each data series. Each element of the array contains the raw values as parsed from the test tool corresponding to that data series.

  Metadata keys

    NAME
        The test name.

    TITLE
        Any extra title specified by the --title-extra parameter when the test was run.

    HOSTS
        List of the server hostnames connected to during the test.

    LOCAL_HOST
        The hostname of the machine that ran the test.

    LENGTH
        Test length in seconds, as specified by the --length parameter.

    TOTAL_LENGTH
        Actual data series length, after the test has added time to the LENGTH.

    STEP_SIZE
        Time step size granularity.

    TIME
        ISO timestamp of the time the test was initiated.

    NOTE
        Arbitrary text as entered with the --note switch when the test was run.

    FLENT_VERSION
        Version of Flent that generated the data file.

    IP_VERSION
        IP version used to run test (as specified by command line parameters, or auto-detected from getaddrinfo() if unspecified).

    KERNEL_NAME
        The kernel name as reported by uname -s.

    KERNEL_RELEASE
        The kernel release as reported by uname -r.

    MODULE_VERSIONS
        The sha1sum of certain interesting Linux kernel modules, if available. Can be used to match test data to specific code versions, if the kernel build is instrumented to, e.g., set the build ID to a git revision.

    SYSCTLS
        The values of several networking-related sysctls on the host (if available; Linux only).

    EGRESS_INFO
        Interface name, qdisc, offload, driver and BQL configuration of the interface used to reach the test target. This requires that the ip binary is present on Linux, but can be extracted from route on BSD. Qdisc information requires the tc binary to be present, and offload information requires ethtool.

        If the --remote-metadata is used, the extended metadata info is gathered for each of the hostnames specified. This is gathered under the REMOTE_METADATA key in the metadata object, keyed by the hostname values passed to --remote-metadata . Additionally, the REMOTE_METADATA object will contain an object called INGRESS_INFO which is a duplicate of EGRESS_INFO, but with the destination IP exchanged for the source address of the host running flent. The assumption here is that --remote-metadata is used to capture metadata of a router known to be in the test path, in which case INGRESS_INFO will contain information about the reverse path from the router (which is ingress from the point of view of the host running flent). If the host being queried for remote metadata is off the path, the contents of INGRESS_INFO will probably be the same as that of EGRESS_INFO .

  Extended metadata

If the --extended-metadata switch is turned on, the following additional values are collected and stored (to the extent they are available from the platform):

    IP_ADDRS
        IP addresses assigned to the machine running flent.

    GATEWAYS
        IP addresses of all detected default gateways on the system, and the interfaces they are reachable through. Only available if the netstat binary is present on the system.

    EGRESS_INFO
        In the EGRESS_INFO key, the IP address of the next-hop router and the interface MAC address are added if extended metadata is enabled.

OUTPUT FORMATS

The following output formats are currently supported by Flent:

  Plot output (-f plot )

Output test data as one of a series of graphical plots of timeseries data or summarised as a CDF plot. Each test supplies a number of different plots; the list of plots for a given test is output by the --list-plots switch (which must be supplied along with a test name).

The plots are drawn by matplotlib, and can be displayed on the screen interactively (requires a graphical display), or output to a file in svg, pdf, ps and png formats. Using the -o switch turns out file output (the file format is inferred from the file name), while not supplying the switch turns on the interactive plot viewer.

  Tabulated output (-f csv and -f org_table )

These formats output the numeric data in a tabulated format to be consumed by other applications. The csv output format is a comma-separated output that can be imported into e.g. spreadsheets, while org_table outputs a tabulated output in the table format supported by Emacs org mode. The data is output in text format to standard output, or written to a file if invoked with the -o parameter.

  Statistics output (-f stats )

This output format outputs various statistics about the test data, such as total bandwidth consumed, and various statistical measures (min/max/mean/median/std dev/variance) for each data source specified in the relevant test (this can include some data sources not includes on plots). The data is output in text format to standard output, or written to a file if invoked with the -o parameter.

  Metadata output (-f metadata )

This output format outputs the test metadata as pretty-printed JSON (also suitable for human consumption). It is output as a list of objects, where each object corresponds to the metadata of one test. Mostly useful for inspecting metadata of stored data files.

MISC INFO

  Running tests with the D-ITG tool

This version of flent has experimental support for running and parsing the output of the D-ITG test tool (see <http://traffic.comics.unina.it/software/ITG/>). Flent supports parsing the one-way delay as measured by D-ITG. However, in order to do so, the data needs to be collected at the receiver end, statistics extracted, and the result passed back to flent on the sending side.

To perform this function, flent supports a control server which will listen to XML-RPC requests, spawn an appropriate ITGRecv instance and, after the test is done, parse its output and make it available for flent to retrieve. This control server is available as a Python file that by default is installed in /usr/share/doc/flent/misc. It currently requires a patched version of D-ITG v2.8.1. The patch is also included in the same directory.

Note that the D-ITG server is finicky and not designed with security in mind. For this reason, the control server includes HMAC authentication to only allow authenticated clients to run a test against the server; however there is currently no support for enforcement of this in e.g. firewall rules. Please bear this in mind when running a publicly reachable ITGRecv instance (with or without the control server). Another security issue with the control server is that the Python XML-RPC library by default is vulnerable to XML entity expansion attacks. For this reason, it is highly recommended to install the defusedxml library (available at <https://pypi.python.org/pypi/defusedxml/>) on the host running the control server. The server will try to find the library on startup and refuse to run if it is not available, unless explicitly told otherwise.

Due to the hassle of using D-ITG, it is recommended to install irtt instead and use that for VoIP tests.

  Bugs

Under some conditions (such as severe bufferbloat), the UDP RTT measurements done by netperf can experience packet loss to the extent that the test aborts completely, which can cause missing data points for some measurement series. The --socket-timeout feature can alleviate this, but requires a recent SVN version of netperf to work. Flent tries to detect if netperf supports this option and enables it for the UDP measurements if it does. Using irtt for UDP measurements is a way to alleviate this; Flent will automatically detect the availability of irtt and use it if available.

Probably many other bugs. Please report any found to <https://github.com/tohojo/flent/issues> and include the output of flent --version in the report. A debug log (as obtained with flent --log-file ) is also often useful.

Author
Toke Høiland-Jørgensen

Copyright
2012-2024, Toke Høiland-Jørgensen and contributors. Source code is GPLv3. Documentation is CC-BY-SA. Neither license affects any output produced by Flent