trafgen: proto: Fix bad field masking
[netsniff-ng.git] / flowtop.8
blob1367e6e5ebd1a3c75a23e3a1e06fb74ff6c1af28
1 .\" netsniff-ng - the packet sniffing beast
2 .\" Copyright 2013 Daniel Borkmann.
3 .\" Subject to the GPL, version 2.
4 .TH FLOWTOP 8 "03 March 2013" "Linux" "netsniff-ng toolkit"
5 .SH NAME
6 flowtop \- top-like netfilter TCP/UDP/SCTP/DCCP/ICMP(v6) flow tracking
7 .PP
8 .SH SYNOPSIS
9 .PP
10 \fBflowtop\fR { [\fIoptions\fR] }
11 .PP
12 .SH DESCRIPTION
13 .PP
14 flowtop is a top-like connection tracking tool that can run on an end host or
15 small home router. It is able to present TCP, UDP/UDP-lite, SCTP, DCCP, and
16 ICMP(v6) flows that have been collected by the kernel's netfilter connection
17 tracking framework, thus no packet capturing in user space needs to be done.
18 .PP
19 flowtop is able to give you a quick overview of current connections on your
20 local system, e.g. for debugging purposes or to answer questions like:
21 .PP
22     * If you access website X, what other connections are being opened in
23       the background that I'm not aware of?
24     * What connections are active that pass one's router?
25     * I have this proprietary binary Y, to where does it connect?
26     * To which countries am I sending data?
27     * Are there any suspicious background connections on my machine?
28     * How many active connections does binary Y have?
29     * How long are connections active already?
30     * At which rate am I sending/receiving data?
31 .PP
32 The following information will be presented in flowtop's output:
33 .PP
34     * Application name and PID when run on local machine
35     * Reverse DNS for source and destination
36     * Geo-location information (country, city)
37     * Used protocols (IPv4, IPv6, TCP, UDP, SCTP, ICMP, ...)
38     * Flow port's service name heuristic
39     * Transport protocol state machine information
40     * Byte/packet counters (if they are enabled)
41     * Connection duration (if timestamping is enabled)
42     * Flow send/receive rate (if byte/packet counters are enabled)
43 .PP
44 In order for flowtop to work, netfilter must be active and running
45 on your machine, thus kernel-side connection tracking is active. If netfilter
46 is not running, you can activate it with iptables(8):
47 .in +4
48 .sp
49 iptables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
50 .sp
51 iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
52 .in -4
53 .PP
54 To dump byte/packet counters flowtop enables the sysctl(8) parameter
55 \[lq]net.netfilter.nf_conntrack_acct\[rq] via:
56 .in +4
57 .sp
58 echo 1 > /proc/sys/net/netfilter/nf_conntrack_acct
59 .sp
60 .in -4
61 and resets it to the previously set value on exit. These counters will only be
62 active on connections which were created after accounting was enabled. Thus, to
63 have these counters be active all the time the parameter should be enabled after
64 the system is up. To automatically enable it, sysctl.conf(8) or sysctl.d(8)
65 might be used.
66 .PP
67 To calculate the connection duration flowtop enables the sysctl(8) parameter
68 \[lq]net.netfilter.nf_conntrack_timestamp\[rq] via:
69 .in +4
70 .sp
71 echo 1 > /proc/sys/net/netfilter/nf_conntrack_timestamp
72 .sp
73 .in -4
74 and resets it to the previously set value on exit.
75 .PP
76 flowtop's intention is just to get a quick look over your active connections.
77 If you want logging support, have a look at netfilter's conntrack(8) tools
78 instead.
79 .PP
80 .SH OPTIONS
81 .PP
82 .SS -4, --ipv4
83 Display IPv4 flows. That is the default when flowtop is started without
84 any arguments.
85 .PP
86 .SS -6, --ipv6
87 Display IPv6 flows. That is the default when flowtop is started without
88 any arguments.
89 .PP
90 .SS -T, --tcp
91 Display TCP flows. That is the default when flowtop is started without
92 any arguments.
93 .PP
94 .SS -U, --udp
95 Display UDP and UDP-lite flows.
96 .PP
97 .SS -D, --dccp
98 Display DCCP flows.
99 .PP
100 .SS -I, --icmp
101 Display ICMP version 4 and version 6 flows.
103 .SS -S, --sctp
104 Display SCTP flows.
106 .SS -n, --no-dns
107 Don't perform hostname lookup. Only numeric addresses will be shown for flow
108 endpoints.
110 .SS -G, --no-geoip
111 Don't perform GeoIP lookup. No geographical information will be shown for flow
112 endpoints.
114 .SS -s, --show-src
115 Also show source information of the flow, not only destination information.
117 .SS -b, --bits
118 Show flow rates in bits per second instead of bytes per second.
120 .SS -u, --update
121 The built-in database update mechanism will be invoked to get Maxmind's
122 latest database. To configure search locations for databases, the file
123 /etc/netsniff-ng/geoip.conf contains possible addresses. Thus, to save
124 bandwidth or for mirroring Maxmind's databases (to bypass their traffic
125 limit policy), different hosts or IP addresses can be placed into geoip.conf,
126 separated by a newline.
128 .SS -t <time>, --interval <time>
129 Flow info refresh interval in seconds, default is 1s.
131 .SS -v, --version
132 Show version information and exit.
134 .SS -h, --help
135 Show user help and exit.
137 .SH USAGE EXAMPLE
139 .SS flowtop
140 Default ncurses output for flowtop that tracks IPv4, IPv6 flows for TCP.
142 .SS flowtop -46UTDISs
143 This example enables the maximum display options for flowtop.
145 .SH CONFIG FILES
147 Files under /etc/netsniff-ng/ can be modified to extend flowtop's
148 service resolution and lookup information.
150     * tcp.conf - TCP port/services map
151     * udp.conf - UDP port/services map
152     * geoip.conf - GeoIP database mirrors
154 .SH BUGS
155 With a fairly high rate of connection tracking updates, flowtop can become
156 unresponsive for short periods of time while scrolling. The right fix would
157 be to replace flowtop's connection management backend with a better design
158 with respect to the locking approach. This is still on the "todo" list.
160 .SH LEGAL
161 flowtop is licensed under the GNU GPL version 2.0.
163 .SH HISTORY
164 .B flowtop
165 was originally written for the netsniff-ng toolkit by Daniel Borkmann. It
166 is currently maintained by Tobias Klauser <tklauser@distanz.ch> and Daniel
167 Borkmann <dborkma@tik.ee.ethz.ch>.
169 .SH SEE ALSO
170 .BR netsniff-ng (8),
171 .BR trafgen (8),
172 .BR mausezahn (8),
173 .BR ifpps (8),
174 .BR bpfc (8),
175 .BR astraceroute (8),
176 .BR curvetun (8),
177 .BR iptables (8),
178 .BR sysctl (8),
179 .BR sysctl.conf (8),
180 .BR sysctl.d (8)
182 .SH AUTHOR
183 Manpage was written by Daniel Borkmann.
185 .SH COLOPHON
186 This page is part of the Linux netsniff-ng toolkit project. A description of the project,
187 and information about reporting bugs, can be found at http://netsniff-ng.org/.