| 1 |
This is jnettop 0.13.0. |
| 2 |
It's a package, which should do simmilar job for network as top does for |
| 3 |
processes. |
| 4 |
|
| 5 |
-- Introduction -- |
| 6 |
|
| 7 |
After administering various networks I decided to write this piece of code, |
| 8 |
becouse I didn't find anything that was simmilar or suitable for my purpose. |
| 9 |
I often needed to watch traffic on the outbound router by the times our line |
| 10 |
was getting red and see, what's going on there and whether is it right. |
| 11 |
I hope, somebody out there will find this tool usefull too. |
| 12 |
Just in case you wanted to write me any comments, hints, postcards, herritage |
| 13 |
announcements, love, wish, abuse etc., feel free to use my email, [email protected], |
| 14 |
please include "jnettop" in the subject of your mail(!!). |
| 15 |
|
| 16 |
-- Installation -- |
| 17 |
|
| 18 |
Download the sources (http://jnettop.kubs.info), unpack and decide, whether |
| 19 |
you want: |
| 20 |
|
| 21 |
support for NCURSES display (default is yes) |
| 22 |
support for logging into SYSLOG (default is yes) |
| 23 |
support for UIA protocol (default is no) (see README.UIA for more info) |
| 24 |
|
| 25 |
if you don't want the default behaviour for any of the above options, specify |
| 26 |
|
| 27 |
--without-ncurses, --without-syslog, --enable-uia |
| 28 |
|
| 29 |
respectivelly to configure script. Make as usual. |
| 30 |
|
| 31 |
-- FreeBSD Notes -- |
| 32 |
|
| 33 |
Is jnettop crashing under your FreeBSD? Try passing |
| 34 |
--disable-multithreaded-resolver to configure script and recompile. |
| 35 |
|
| 36 |
-- Aggregation -- |
| 37 |
|
| 38 |
(What is it?) |
| 39 |
|
| 40 |
Aggregation is a way, how to modify packet classicication rules. There are |
| •41 |
two types of aggregation in jnettop: host, port, and host+port. If there |
| 42 |
is port aggregation enabled, it means, that all packets seem to come(go |
| 43 |
to) same port numbers. If there is host aggregation enabled, it means, |
| 44 |
that all packets seem to come(go to) same host. If host+port |
| 45 |
aggregation is enabled, it aggregates both. Let's have an example: |
| 46 |
Suppose we have following configuration: |
| 47 |
|
| 48 |
+--- host0 |
| 49 |
internet ----- addr1 (eth0) --- router --- addr2 (eth1) ---+--- host1 |
| 50 |
+--- host2 |
| 51 |
|
| 52 |
i.e. typical border router with eth0 interface looking into internet and |
| 53 |
eth1 interface looking to intranet. Suppose we're running jnettop on router |
| 54 |
sniffing on interface eth0. To see how many bytes every host consumes out |
| •55 |
of the internet connection, we enable remote host+port aggregation and |
| 56 |
local port aggregation. i.e. All internet will behave as one endpoint |
| 57 |
and all programs on one host will, too, behave as one endpoint. This |
| 58 |
way, every stream we see in jnettop will be from one of the hosts in |
| 59 |
intranet to a public internet. Aggregation is very powerfull laser-knife |
| 60 |
in network traffic analysis. I understand, that it is not very user |
| 61 |
friendly implementation in jnettop and I will gratefully welcome every |
| 62 |
suggestion on how to make this topic clear and more clear-to-use. |
| 63 |
|
| 64 |
-- .jnettop configuration file -- |
| 65 |
|
| 66 |
(How can I configure packet filters that apply prior to processing |
| 67 |
packets) |
| 68 |
|
| 69 |
Since version 0.6, jnettop package scans your home directory for a file named |
| 70 |
".jnettop" and reads possible packet filters. Syntax of the configuration |
| 71 |
file is (at least I hope) obvious out of the example provided in .jnettop file |
| 72 |
included in distribution. The file consists of lines beginning with keywords. |
| 73 |
Each keyword can have various parameters. Following keywords were implemented |
| 74 |
so far: |
| 75 |
|
| 76 |
variable "<name>" "<value>" |
| 77 |
|
| 78 |
this keyword introduces new string variable of name <name>. This variable |
| 79 |
is assigned value of <value>. Variables can be used in rule specifications |
| 80 |
to shorten them and make them more readable. |
| 81 |
ex. |
| 82 |
|
| 83 |
variable "intranet" "net 192.168.0.0/16" |
| 84 |
|
| 85 |
rule "<name>" "<packet filter specification>" |
| 86 |
|
| 87 |
this keyword defines new packet filter rule of name <name>. Packet filter |
| 88 |
syntax conforms to that of libpcap library or tcpdump program. Explanation |
| 89 |
of the syntax can be found in manual page of tcpdump package. Specification |
| 90 |
undergoes variable substitution. Each string of the form "${identifier}" is |
| 91 |
expanded to the value of the variable named "identifier". The variable |
| 92 |
must be defined PRIOR to the definition of the rule in the configuration |
| 93 |
file. Given the previous example of variable keyword, you can use: |
| 94 |
|
| 95 |
rule "source is intranet" "src ${intranet}" |
| 96 |
|
| 97 |
After you start jnettop, you can use the "f" key to select active filter used |
| 98 |
PRIOR to any packet processing. This filter is applied BEFORE any statistics |
| 99 |
are computed, so even the total BPS is computed only out of the packets, that |
| 100 |
pass the filter(!!). |
| 101 |
|
| 102 |
Since version 0.8, jnettop supports "interface" keyword, which specifies |
| 103 |
which interface to listen after you start it up. Example: |
| 104 |
|
| 105 |
interface "eth0" |
| 106 |
|
| 107 |
Since version 0.9, jnettop supports following new keywors: |
| 108 |
|
| •109 |
local_aggregation [none|host|port|host+port] |
| 110 |
|
| 111 |
this keyword sets startup local aggregation value |
| 112 |
ex. |
| 113 |
|
| 114 |
local_aggregation port |
| 115 |
|
| •116 |
remote_aggregation [none|host|port|host+port] |
| 117 |
|
| 118 |
this keyword sets startup remote aggregation value |
| 119 |
ex. |
| 120 |
|
| 121 |
remote_aggregation host |
| 122 |
|
| 123 |
select_rule "<name>" |
| 124 |
|
| 125 |
this keywors sets rule, that is enabled on startup |
| 126 |
name is the name of previously(!) defined rule (by "rule" keyword) |
| 127 |
ex. |
| 128 |
|
| 129 |
select_rule "source is intranet" |
| 130 |
|
| 131 |
Since version 0.11, jnettop supports multiple resolvers. This can be configured |
| 132 |
thru "resolve" keyword in configuration file: |
| 133 |
|
| 134 |
resolve_rule "<network ip>" "<network mask>" [normal|external] ("<extscript>") |
| 135 |
|
| 136 |
this keyword configures resolver, so that it uses the appropriate method |
| 137 |
of resolving for specified network. If this method fails, next one matching |
| 138 |
is used. |
| 139 |
ex. |
| 140 |
|
| 141 |
resolve_rule "192.168.1.0" "255.255.255.0" normal |
| 142 |
resolve_rule "192.168.1.0" "255.255.255.0" external "jnettop-lookup-nmb" |
| 143 |
|
| 144 |
this will cause jnettop to use normal DNS lookup for all 192.168.1.0/24 address- |
| 145 |
es first. If nothing is found, than external program "jnettop-lookup-smb" |
| 146 |
is used. |
| 147 |
if end of all rules is reached, normal DNS lookup is used. |
| 148 |
|
| 149 |
resolve [on|off] |
| 150 |
|
| 151 |
enables/disables resolving completelly |
| 152 |
|
| 153 |
Since version 0.12, jnettop supports explicit list of local networks. Local |
| 154 |
networks then appear on the left side of display: |
| 155 |
|
| 156 |
local_network "<network ip>" "<network mask>" |
| 157 |
|
| 158 |
this keyword configures packet classifier, so that hosts matching this |
| 159 |
classification will be considered local. |
| 160 |
|
| 161 |
The pathname of configuraton file can be overrided by specifying -f command |
| 162 |
line parameter. |
| 163 |
|
| 164 |
-- libpcap dependency explanation -- |
| 165 |
|
| 166 |
(Why cannot I switch interfaces while running jnettop. I've seen this |
| 167 |
feature on a screenshot) |
| 168 |
|
| 169 |
There are various libpcap versions out there with different capabilities. |
| 170 |
Notably there are 0.6.2 and older, which don't support interface discovery. |
| 171 |
With these versions of libpcap, you won't be able to switch between interfaces |
| 172 |
while running jnettop. Anyway, you can use "-i" parameter to specify which |
| 173 |
interface to listen on (since jnettop 0.2). |
| 174 |
With libpcap version 0.7 and younger, you will be able to switch between |
| 175 |
various interfaces while running jnettop. |
| 176 |
|
| 177 |
If you want to get newer version of libpcap, go to http://www.tcpdump.org to |
| 178 |
get sources or you can find newer versions in RPMs on http://rpmfind.net |
| 179 |
|
| 180 |
-- glib2 dependency -- |
| 181 |
|
| 182 |
(Won't there be port for glib < 2 versions?) |
| 183 |
|
| 184 |
No. This package is heavily dependant on thread functions contained in glib2. |
| 185 |
I believe, that there are (will be) various platforms for which glib2 is ported |
| 186 |
and thus prefer to depend on generic threading capabilities of glib2 to meet |
| 187 |
less portability problems later. |
| 188 |
Glib2 is now available in RPMs for RedHat (and simmilar), DEBs for Debian and |
| 189 |
.tar.gz for the others. |
| 190 |
|
| 191 |
-- UNKNOWN traffic -- |
| 192 |
|
| 193 |
(Jnettop displays a lot of UNKNOWN traffic and UNK. protocol) |
| 194 |
|
| 195 |
Jnettop was done as basic analysis tool and does not interpret most of the |
| 196 |
protocols on Internet. Namely it can only interpret TCP/UDP/IP (v4 as well as |
| 197 |
v6 since 0.10) on EtherNet or Linux "any" device. This is sufficient for vast |
| 198 |
majority of linux users (=me .-)). In case you want me to add support for |
| 199 |
another encapsulation (802.11, etc...), please send me output of jnettop -d |
| 200 |
and a piece of tcpdump dumpfile with examples of packets. I'll do my best :) |
| 201 |
In case you want me to add support for another higher-level protocol |
| 202 |
(IPX, AppleTalk,...), please, send me a vote for that protocol. |
| 203 |
|
| 204 |
-- PORTABILITY -- |
| 205 |
|
| 206 |
(Does Jnettop work under system X on computer Y) |
| 207 |
|
| 208 |
For portability description, please, see PORTING file. There is an up-to-date |
| 209 |
status of portability issues. Generally, I'd like jnettop to be working on |
| 210 |
any system, which has glib2, pcap and ncurses ports. |
| 211 |
|
| 212 |
-- content filtering -- |
| 213 |
|
| 214 |
(What the hell is that?) |
| 215 |
|
| 216 |
Jnettop attempts to "understand" what communication is in the TCP/UDP data and |
| 217 |
displays this information along the stream. For example it can recover URL from |
| 218 |
a HTTP request or addresses of ongoing SMTP session. Content filtering is |
| 219 |
enabled by default and can be disabled while running. There can be performance |
| 220 |
problems on a very busy server which would cause various packets to be dropped. |
| 221 |
|
| 222 |
-- 100% CPU usage -- |
| 223 |
|
| 224 |
(Why does jnettop consume all CPU time?) |
| 225 |
|
| 226 |
Libpcap's features don't include reading a packet with timeout. On some systems |
| 227 |
this can be overcomed by using select() call. On others, we loop between non- |
| 228 |
blocking read and thread_yeald() function (notably BSD). On these systems (BSD) |
| 229 |
jnettop consumes all available CPU time, but should behave nicely, so that |
| 230 |
it consumes all time up to 100%. Other processes should have theire appropriate |
| 231 |
time. This behaviour does not include Linux |
| 232 |
|
| 233 |
Copyright (C) 2002, 2003, 2004, 2005, 2006 Jakub Skopal |
| 234 |
Portions of the package are taken from the tcpdump project and their rights are |
| 235 |
held by their respective owners stated in the beginning of the files. |
| 236 |
|
| 237 |
$Header: /cvsroot/jnettop/jnettop/README,v 1.20 2006/04/11 15:21:05 merunka Exp $ |
| 238 |
|