Manpage of stak
Section: User Commands (1)
Return to Main Contents
stak - Statistical Traffic Analysis Kit
stakrate [generic options] [rate-estimator-specific options]
stakhosts [generic options] [host-statistics-specific options]
stakasta [generic options] [as-traffic-analyzer-specific options]
stakextract [generic options] [regex-extractor-specific options]
stakstreams [generic options] [stream-analyzer-specific options]
helps an administrator to figure out what is happening in his network at the moment.
uses statistical and stream-oriented traffic analysing methods, and it
will never produce an output stream at a speed beyond human perception. The
output is less accurate, however.
consists of five different utilities, designed to perform the following tasks:
estimating overall traffic rates
determining nodes generating the highest traffic
determining connections and flows generating the highest traffic
extracting strings from packets
estimating traffic exchange with particular autonomous systems
All the utilities share a generic sniffer framework, based on the
Each of the utilities accepts parameters in a standard, short
syntax. There are several options concerning the sniffer framework,
common for the all stak utilities - these options are described below in this manual.
After a successful startup, each of the utilities installs a packet
capturing handler and starts to process data and generate reports. The
default report generating policy is to dump a report to stdout every
100 milliseconds - you can adjust this time using the
option, or choose a different report generation policy (on key stroke,
or upon receiving a signal) by using the
Each utility processes the captured data and presents the results in its very own
way and thus has its very own set of specific options. You can find these on
separate manual pages.
Always make sure
has enough information on datalink layer protocol present on the
interface it was ordered to bind to. Consult the
option description for details.
- -0 c
Replace every NUL character (ASCII 0) with c before doing regular expression
based matching. Ignored if the
option was not specified. The default is '@'.
Color (ANSI-compatible) output in modes that support it (currently: stream
analyzer and "abusers detection" mode).
- -f f
BPF filter expression to use. Using this option causes
to ignore any packets not matching the specified BPF filter expression. For
a detailed description of BPF filter expressions syntax, consult the
Signal-based report generation policy. The reports are dumped
whenever stak receives a SIGUSR1 signal.
- -h -?
dumps a short help on available command-line options and quits, regardless
of other options.
- -i I
Bind to interface I. The default is 'eth0', which of course will cause a failure on
systems other than Linux. Make sure you specify the datalink prefix (see -p)
when you order stak to bind to an interface of an uncommon type.
Interactive report generation. The reports are dumped whenever
data is available on the standard input, which usually means you'll have
to press RETURN in order to generate a report.
Make stdout line-buffered. This option is useful when reports are redirected
(eg. using shell redirection) to a file.
Turns off asynchronous reverse DNS lookups.
will print numeric IPs rather than fully qualified domain names.
- -p N
Datalink layer header prefix length. Every (or at least almost every) known datalink
layer protocol prefixes a packet with its own header - which has to be stripped
before the actual data essential for stak (the IP protocol header) can be read.
is able to determine automatically how many bytes to skip only for the most common
datalink layer protocols (Ethernet, FDDI, TokenRing, loopback, PPP) - in other cases
the prefix length
must be specified using this option. It is EXTREMELY IMPORTANT to set the right value
might print completely irrevelant reports and output invalid IP addresses. The default
is autosense, or if that fails - 14 bytes, which is the length of an
- -q N
to quit after outputting N reports.
- -r N
Time-based report generation policy. The reports will be dumped on
stdout every N seconds. This is the default (with N = 0.1).
- -s N
Capture at least N bytes. For performance reasons,
does not acquire the whole packet from network, it just reads and processes first N
bytes. The default is 64 bytes, which might be not enough if you are using complicated BPF
expressions or filtering the packets using a regular expression. In such cases, it is
good to set the capture length to MTU on the interface. The value is automatically increased
to at least 1500 (which is the default MTU for an Ethernet interface) if one of -x, -E or -T
options is used. This option does NOT affect statistical data (amount of bytes, per-second byte rate)
collected by stak - the accounted packet size is always the 'real' one.
Print exact values. Normally,
uses SI prefixes (like k - kilo, M - mega, G - giga, T - tera) to make
the printed numeric values more attractive for a human being. The -v option
disables this feature, causing
to print exact values.
Clear the screen before printing each report. This assumes your terminal
is capable of understanding certain control sequences.
- -X r
Regular expression-based filtering. This option will cause
to ignore packets that DO NOT match specified regular expression. Before
any tests, NUL characters occuring in a packet are replaced with
an other character, as specified in the -0 option (the default is '@').
manual for a detailed description of POSIX regular expressions.
In addition to standard regex syntax, you may use the
\r (CR), \n (LF), \t (TAB), \\ (\)
and \xNN (hex NN) special sequences.
BUGS AND LIMITATIONS
(-T) operation mode is experimental. It consumes large amounts of system resources. Memory
leaks in code that provides this feature are possible.
Mateusz Golicz <email@example.com>
Feel free to send comments, suggestions, bug reports, etc. The
author is not a native english speaker, and is aware of the fact that his english is far from
perfect. Because of that, reports on grammar or vocabulary mistakes in this manual are also welcome.
The asynchronous DNS resolver part was taken from
- a very handy traceroute replacement by Matt Kimball.
Copyright 2003 - 2004 Mateusz Golicz. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, Version 2,
as published by the Free Software Foundation. A copy of this license is
distributed with this software in the file "COPYING".
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Read the
file "COPYING" for more details.
- GENERIC OPTIONS
- BUGS AND LIMITATIONS
- SEE ALSO
This document was created by
using the manual pages.
Time: 14:58:33 GMT, March 21, 2004