~ubuntu-branches/ubuntu/trusty/ntop/trusty

« back to all changes in this revision

Viewing changes to faq.html

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2008-06-15 14:38:28 UTC
  • mfrom: (2.1.11 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080615143828-oalh84nda2hje4do
Tags: 3:3.3-11
Correction of Polish translation encoding, closes: #479490. Thanks
to Christian Perrier <bubulle@debian.org> for the help.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
<meta http-equiv="Window-target" content="_top">
7
7
<meta name="description" content="ntop (http://www.ntop.org) FAQ file.">
8
8
<meta name="author" content="ntop">
9
 
<meta name="generator" content="ntop 3.0">
10
 
<link rel="stylesheet" type="text/css" href="style.css">
11
 
        <title>ntop FAQ</title>
 
9
<meta name="generator" content="ntop 3.3">
 
10
<title>ntop FAQ</title>
 
11
<script SRC="/functions.js" TYPE="text/javascript" LANGUAGE="javascript"></script>
 
12
<link rel="stylesheet" href="/style.css" TYPE="text/css">
 
13
<!--#include virtual="/menuHead.html" -->
12
14
</head>
13
 
<body background="white_bg.gif">
14
 
<h3>ntop FAQ...</h3>
 
15
<body link="blue" vlink="blue">
 
16
<!--#include virtual="/menuBody.html" -->
 
17
<h1>ntop FAQ...</h1>
15
18
<p>This is an unsophisticated, automated conversion of the source file, docs/FAQ into html.
16
19
Please report problems to the ntop-dev mailing list.
17
20
But remember, it's not about making it look good, it's about making the content available.</p>
18
21
<hr>
19
22
</p>
20
 
<br>
21
 
<p>
22
 
<b>Q.</b>&nbsp;
23
 
 Where can I find ntop?
24
 
</p>
25
 
<p>
26
 
<b>A.</b>&nbsp;
27
 
 The official website can be found at http://www.ntop.org/.
28
 
</p>
29
 
<br>
30
 
<p>
31
 
<b>Q.</b>&nbsp;
32
 
 Where do I get the source?
33
 
</p>
34
 
<p>
35
 
<b>A.</b>&nbsp;
36
 
 SourceForge -- http://sourceforge.net/projects/ntop/
37
 
</p>
38
 
<p>
39
 
   There is also a cvs (current development) maintained at cvs.ntop.org.
 
23
<h2>TOP 10 - the questions everyone asks...</h2>
 
24
<br>
 
25
<p><b>Q0.</b>&nbsp; I downloaded the source and ./configure doesn't work.</p>
 
26
<p><b>A.</b>&nbsp; Yup.</p>
 
27
<p>   There is a long history of warfare between the versions of the GNU
 
28
   autotools we use to build the distribution files and the ones installed
 
29
   on your host. So during the 3.3 development cycle, Luca finally gave in
 
30
   and stopped distributing a generated configure file.
 
31
</p>
 
32
<p>   Instead there is a script, autogen.sh, which uses the version(s) of the
 
33
   tools installed on your system to create configure and then run it.
 
34
</p>
 
35
<p>   Yes, this means you MUST have the following tools installed:
 
36
</p>
 
37
 
 
38
<pre>
 
39
      libtool
 
40
      automake
 
41
      m4
 
42
      autoconf
 
43
</pre>
 
44
<p>   We are talking only about people who are compiling from source.  Those 
 
45
   tools are pretty much required for ANY source.  Live with it.
 
46
</p>
 
47
<br>
 
48
<p><b>Q1(a).</b>&nbsp; Can I store data in a SQL database?</p>
 
49
<br>
 
50
<p><b>Q1(b).</b>&nbsp; When ntop stops I lose all my data. Why?</p>
 
51
<br>
 
52
<p><b>Q1(c).</b>&nbsp; Why doesn't the -S option work?</p>
 
53
<p><b>A.</b>&nbsp; ntop used to optionally store some data in a SQL database. The code was   broken, difficult to maintain, etc. and was removed.  A LONG TIME AGO.
 
54
   If you are reading about this in 'some' documentation - update.
 
55
</p>
 
56
<p>   Current ntop is 3.1, which is the only version we support.
 
57
</p>
 
58
<p>   There are scripts that various users have offered to take the data dump
 
59
   and insert it into a SQL database.  Search the back traffic on the mailing
 
60
   list for them.
 
61
</p>
 
62
<p>   Yes, ntop uses memory based structures to hold usage data and they are lost
 
63
   when you reset or restart ntop.
 
64
</p>
 
65
<p>   Persistent storage is in the RRD databases - there's a paper @ SourceForge
 
66
   that explains them.
 
67
</p>
 
68
<p>   There was another option for some persistence - it was -S - look in FAQarchive 
 
69
   for an article about it, "What was the -S option?".
 
70
</p>
 
71
<br>
 
72
<p><b>Q2.</b>&nbsp; The archive isn't indexed, so I can't search it.</p>
 
73
<p><b>A.</b>&nbsp; Yes, but it's easy to search using search engines or mail archives.</p>
 
74
<p>   Google: You need to restrict the search to the U of Pisa mail list
 
75
   gateway, i.e.:
 
76
</p>
 
77
 
 
78
<pre>
 
79
        site:listgateway.unipi.it ntop freebsd
 
80
</pre>
 
81
<p>   Two 'mail archive' sites that I know of (as of March 2005) are:
 
82
</p>
 
83
<p>   gmane: http://search.gmane.org (our lists are renamed as gmane.linux.ntop.general
 
84
   and gmane.linux.ntop.devel).
 
85
</p>
 
86
<p>   The Mail Archive:
 
87
</p>
 
88
 
 
89
<pre>
 
90
       http://www.mail-archive.com/ntop-dev@unipi.it/
 
91
       http://www.mail-archive.com/ntop@unipi.it/
 
92
</pre>
 
93
<br>
 
94
<p><b>Q3.</b>&nbsp; ntop crashed and the last log message is "xxxxx".</p>
 
95
<p><b>A.</b>&nbsp; Sorry, that's useless. ntop is multi-threaded and processes 100s or 1000s of   packets per second.  The last log message is probably from the wrong thread 
 
96
   and many seconds out of date.
 
97
</p>
 
98
<p>   To capture the true 'failure point information', you need to run under the 
 
99
   debugger (gdb) and send us the various outputs.  Instructions are at the bottom
 
100
   of this document.  Look for "GDB ultraMini-tutorial".
 
101
</p>
 
102
<p>   Yes, you will need the source and a compiler.
 
103
</p>
 
104
<br>
 
105
<p><b>Q3(a).</b>&nbsp; What about the backtrace?</p>
 
106
<p><b>A.</b>&nbsp; Again, probably useless. Use gdb and capture the full failure point info. If you   want to see more, look for "Q. What about the backtrace?" below.
 
107
</p>
 
108
<br>
 
109
<p><b>Q4.</b>&nbsp; I'm running out of memory.</p>
 
110
<p><b>A.</b>&nbsp; Basically ntop uses a lot of memory - it stores a chunk of information about each   and every host it's monitoring. See "Q. Why does ntop use so much memory ?" and
 
111
   the following articles below.
 
112
</p>
 
113
<br>
 
114
<p><b>Q5.</b>&nbsp; Dropped packets?</p>
 
115
<p><b>A.</b>&nbsp; There are lots of reasons - look for "Q. Why does ntop drop packets?" below.   Short version, is that as long as it's random, the information you glean from ntop
 
116
   (32% of our usage is P2P Music) is still valid.  But you are probably understating
 
117
   any problems.
 
118
</p>
 
119
<br>
 
120
<p><b>Q6.</b>&nbsp; The docs at ntop.org say ...</p>
 
121
<p><b>A.</b>&nbsp; Stop right there. They're out of date (notice, for example, the man page is   July 2002?).
 
122
</p>
 
123
<p>   The only current stuff is this FAQ (which gets out of date quickly) the other files
 
124
   in the distribution and the mailing lists.
 
125
</p>
 
126
<p>   You can access the updated FAQ from docs/FAQ in the cvs or from your ntop instance
 
127
   (click on the (?) icon in the "About" menu and read down 1/2 a page or so.
 
128
</p>
 
129
<br>
 
130
<p><b>Q7.</b>&nbsp; How do I report a problem?</p>
 
131
<p><b>A.</b>&nbsp; Best way is to use the PR (Problem Report) form - it automatically includes a lot of   the important information about your ntop instance.  In the "About" menu, click on the
 
132
   "Bug" icon.  This generates a text form you can copy into your email program, update
 
133
   and send.
 
134
</p>
 
135
<br>
 
136
<p><b>Q8.</b>&nbsp; HACK ALERT HACK ALERT - ntop is sending information to some machine called "jake".</p>
 
137
<p><b>A.</b>&nbsp; Chill. Take a deep breath.</p>
 
138
<p>   Jake is the cannonical name for version.ntop.org.  All you are seeing is the version
 
139
   check.  See "Q. What's with the version check?" below.
 
140
</p>
 
141
<br>
 
142
<p><b>Q9.</b>&nbsp; The program asks for password for "ntop HTTP server". When I started NTOP for the first   time, it asked me to set admin password, and i put "xxxxxxxx". The user is "xxxxxxxxxx"
 
143
   but I get "Unauthorized to access the document". Why?
 
144
</p>
 
145
<p><b>A.</b>&nbsp; The correct user to specify for the ntop web server is admin.   The -u value in the command line or parameter file is the account ntop runs under.
 
146
</p>
 
147
<br>
 
148
<p><b>Q10.</b>&nbsp; I'm not getting any rrd output.</p>
 
149
<p><b>A.</b>&nbsp; First, make sure that the plugin is installed (you should see it in the web interface   under plugins).  Make sure it is configured and active.
 
150
</p>
 
151
<p>   The default configuration does NOT include per-host .rrd files, because these can take
 
152
   up a lot of space.  But you probably want them and at the medium or high level of detail.
 
153
</p>
 
154
<br>
 
155
<p><b>Q11.</b>&nbsp; Single Threaded ntop?</p>
 
156
<p><b>A.</b>&nbsp; Gone. Poof. We're in a multi-threaded world, so live with it.</p>
 
157
<br>
 
158
<p><b>Q.</b>&nbsp; Where can I find ntop?</p>
 
159
<p><b>A.</b>&nbsp; The official website can be found at http://www.ntop.org/.</p>
 
160
<br>
 
161
<p><b>Q.</b>&nbsp; Where do I get the source?</p>
 
162
<p><b>A.</b>&nbsp; SourceForge -- http://sourceforge.net/projects/ntop/</p>
 
163
<p>   There is also a cvs (current development) maintained at cvs.ntop.org.
40
164
   (instructions are on the download page of www.ntop.org)
41
165
</p>
42
 
 
43
 
<pre>
44
 
     DO NOT (under ANY circumstances) USE THE SOURCE FILES FROM 
45
 
     http://snapshot.ntop.org!!!!! They are broken, incomplete and
46
 
     WILL NOT WORK. (See 'snapshot, cvs and the Wiki' below)
47
 
</pre>
48
 
<br>
49
 
<p>
50
 
<b>Q.</b>&nbsp;
51
 
 What is ntop?
52
 
</p>
53
 
<p>
54
 
<b>A.</b>&nbsp;
55
 
 ntop is an open source network top - it monitors a network and collects
56
 
   information about the protocols and hosts for display.
57
 
</p>
58
 
<br>
59
 
<p>
60
 
<b>Q.</b>&nbsp;
61
 
 Um, so it's like mrtg (http://people.ee.ethz.ch/~oetiker/webtools/mrtg/)?
62
 
</p>
63
 
<p>
64
 
<b>A.</b>&nbsp;
65
 
 Yes and no...
66
 
</p>
67
 
<p>
68
 
   Yes in that both are analyzers of network packets.
69
 
</p>
70
 
<p>
71
 
   Yes in that both display information about your network.
72
 
</p>
73
 
<p>
74
 
   No in that they take very different approaches to collecting information.
75
 
</p>
76
 
<p>
77
 
   No in that they display different types of information.
78
 
</p>
79
 
<br>
80
 
<p>
81
 
<b>Q.</b>&nbsp;
82
 
 So mrtg...
83
 
</p>
84
 
<p>
85
 
<b>A.</b>&nbsp;
86
 
 mrtg creates a picture of the network centered on the device on the link
87
 
   between devices (and aggregations of devices and links).
88
 
</p>
89
 
<p>
90
 
   Tobias (Tobi) Oetiker describe mrtg as:
 
166
<br>
 
167
<p><b>Q.</b>&nbsp; What is ntop?</p>
 
168
<p><b>A.</b>&nbsp; ntop is an open source network top - it monitors a network and collects   information about the protocols and hosts for display.
 
169
</p>
 
170
<br>
 
171
<p><b>Q.</b>&nbsp; Um, so it's like mrtg (http://people.ee.ethz.ch/~oetiker/webtools/mrtg/)?</p>
 
172
<p><b>A.</b>&nbsp; Yes and no...</p>
 
173
<p>   Yes in that both are analyzers of network packets.
 
174
</p>
 
175
<p>   Yes in that both display information about your network.
 
176
</p>
 
177
<p>   No in that they take very different approaches to collecting information.
 
178
</p>
 
179
<p>   No in that they display different types of information.
 
180
</p>
 
181
<br>
 
182
<p><b>Q.</b>&nbsp; So mrtg...</p>
 
183
<p><b>A.</b>&nbsp; mrtg creates a picture of the network centered on the device on the link   between devices (and aggregations of devices and links).
 
184
</p>
 
185
<p>   Tobias (Tobi) Oetiker describe mrtg as:
91
186
</p>
92
187
 
93
188
<pre>
97
192
        representation of this traffic."
98
193
</pre>
99
194
<br>
100
 
<p>
101
 
<b>Q.</b>&nbsp;
102
 
 And mrtg works how?
103
 
</p>
104
 
<p>
105
 
<b>A.</b>&nbsp;
106
 
 mrtg reads the counters maintained by various devices such as routers, using
107
 
   a protocol called 'snmp' (Simple Network Monitoring Protocol).  The
 
195
<p><b>Q.</b>&nbsp; And mrtg works how?</p>
 
196
<p><b>A.</b>&nbsp; mrtg reads the counters maintained by various devices such as routers, using   a protocol called 'snmp' (Simple Network Monitoring Protocol).  The
108
197
   management information bases (MIBs) read using snmp, contain incredibly
109
198
   detailed information about the packets the device has seen and what it has
110
199
   done with them.
111
200
</p>
112
 
<p>
113
 
   Again, quoting Tobi:
114
 
</p>
115
 
<p>
116
 
   "MRTG ... uses SNMP to read the traffic counters of your routers and
117
 
</p>
 
201
<p>   Again, quoting Tobi:
 
202
</p>
 
203
 
118
204
<pre>
119
 
    ... which logs the traffic data and creates beautiful graphs representing
120
 
    the traffic on the monitored network connection."
 
205
       "MRTG ... uses SNMP to read the traffic counters of your routers and
 
206
        ... which logs the traffic data and creates beautiful graphs representing
 
207
        the traffic on the monitored network connection."
121
208
</pre>
122
 
<p>
123
 
   mrtg is focused on 'layer 2' (the tcp/ip and other low level protocol).
124
 
</p>
125
 
<br>
126
 
<p>
127
 
<b>Q.</b>&nbsp;
128
 
 And ntop?
129
 
</p>
130
 
<p>
131
 
<b>A.</b>&nbsp;
132
 
 ntop doesn't use snmp - it's not a device centric view of the network.
133
 
   Instead ntop actually processes the network packets directly.
134
 
</p>
135
 
<br>
136
 
<p>
137
 
<b>Q.</b>&nbsp;
138
 
 What's wrong with snmp?
139
 
</p>
140
 
<p>
141
 
<b>A.</b>&nbsp;
142
 
 Nothing.
143
 
</p>
144
 
<p>
145
 
   snmp is a pull protocol, that is a monitoring tool has to pull the
 
209
<p>   mrtg is focused on 'layer 2' (the tcp/ip and other low level protocol).
 
210
</p>
 
211
<br>
 
212
<p><b>Q.</b>&nbsp; And ntop?</p>
 
213
<p><b>A.</b>&nbsp; ntop doesn't use snmp for it's main analysis - it's not a device centric   view of the network.  Instead ntop actually processes the network packets
 
214
   directly.
 
215
</p>
 
216
<br>
 
217
<p><b>Q.</b>&nbsp; What's wrong with snmp?</p>
 
218
<p><b>A.</b>&nbsp; Nothing. As of 3.1, ntop has some sort of snmp plugin.</p>
 
219
<p>   It's just different.
 
220
</p>
 
221
<p>   snmp is a pull protocol, that is a monitoring tool has to pull the
146
222
   information from the device.  snmp has 'traps' that is alert messages which
147
223
   can be sent out, but the MIB data has to be read by the monitoring tool from
148
224
   the device.
149
225
</p>
150
 
<p>
151
 
   snmp is an older protocol, from the dawn of the network era and it has some
 
226
<p>   snmp is an older protocol, from the dawn of the network era and it has some
152
227
   minor issues of security and complexity and verbosity.  But it's a critical
153
228
   network protocol, used successfully by 1000s of ISPs to monitor AND CONTROL
154
229
   vast networks.
155
230
</p>
156
 
<p>
157
 
   From our perspective, the problems with snmp are minor -
158
 
</p>
159
 
 
160
 
<pre>
161
 
       It can use a lot of bandwidth - especially if you're reading from devices
162
 
                                       on the far side of slow links.
163
 
</pre>
164
 
 
165
 
<pre>
166
 
       Pulling data out of MIBs is a complex process. MIBs can be specified in
167
 
       an RFC, or be unique to a vendor/device.
168
 
</pre>
169
 
 
170
 
<pre>
171
 
       An snmp-based tool either has to restrict itself to the common MIBs,
172
 
       or (most often for vendor tools) it be updated whenever a new device
173
 
       must be supported or a MIB changes.
174
 
</pre>
175
 
 
176
 
<pre>
177
 
       This makes snmp-based tools complex, because data may be unavailable
178
 
       in certain versions of seemingly similar devices, etc.  For example,
179
 
       http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml
180
 
       is a page which links to the specific MIBs supported by various
181
 
       Cisco devices.
182
 
</pre>
 
231
<p>   From our perspective, the problems with snmp are minor -
 
232
</p>
 
233
<p>   It can use a lot of bandwidth - especially if you're reading from devices
 
234
   on the far side of slow links.
 
235
</p>
 
236
<p>   Pulling data out of MIBs is a complex process. MIBs can be specified in
 
237
   an RFC, or be unique to a vendor/device.
 
238
</p>
 
239
<p>   An snmp-based tool either has to restrict itself to the common MIBs,
 
240
   or (most often for vendor tools) it be updated whenever a new device
 
241
   must be supported or a MIB changes.
 
242
</p>
 
243
<p>   This makes snmp-based tools complex, because data may be unavailable
 
244
   in certain versions of seemingly similar devices, etc.  For example,
 
245
   http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml
 
246
   is a page which links to the specific MIBs supported by various
 
247
   Cisco devices.
 
248
</p>
183
249
<br>
184
 
<p>
185
 
<b>Q.</b>&nbsp;
186
 
 So why hasn't ntop 'won'?
187
 
</p>
188
 
<p>
189
 
<b>A.</b>&nbsp;
190
 
 mrtg excels at monitoring 100s or 1000s of network devices (routers,
191
 
   switches, etc.) and presenting that information over long periods of time.
192
 
</p>
193
 
<p>
194
 
   ntop doesn't do a good job of showing multiple 'networks' - it's really
 
250
<p><b>Q.</b>&nbsp; So why hasn't ntop 'won'?</p>
 
251
<p><b>A.</b>&nbsp; mrtg excels at monitoring 100s or 1000s of network devices (routers,   switches, etc.) and presenting that information over long periods of time.
 
252
</p>
 
253
<p>   ntop doesn't do a good job of showing multiple 'networks' - it's really
195
254
   focused on aggregating a picture of a single network.  And for drilling down
196
255
   into that picture or presenting it over long periods of time.
197
256
</p>
198
 
<p>
199
 
   The processing of packets requires a lot more computer resources than just
 
257
<p>   The processing of packets requires a lot more computer resources than just
200
258
   reading counters from devices.  On the plus side, this gives much more
201
259
   detailed information - for example ntop sees the actual web server request
202
260
   instead of just that there was traffic on port 80.  On the minus side, it's
204
262
   available for ntop.  An ISP using ntop to monitor a couple of T3s needs a
205
263
   FAST computer and A LOT of memory.
206
264
</p>
207
 
<p>
208
 
   ntop also requires access to the physical network (either directly via a
 
265
<p>   ntop also requires access to the physical network (either directly via a
209
266
   network card or indirectly via a netFlow/sFlow probe).  This limits ntop's
210
267
   (usefullness|ability) to work across sites.
211
268
</p>
212
 
<p>
213
 
   Once you learn what they do (mrtg and ntop), you'll probably discover that
 
269
<p>   Once you learn what they do (mrtg and ntop), you'll probably discover that
214
270
   You need both.
215
271
</p>
216
272
<br>
217
 
<p>
218
 
<b>Q.</b>&nbsp;
219
 
 What's this 'layer' crud?
220
 
</p>
221
 
<p>
222
 
<b>A.</b>&nbsp;
223
 
 Network layers come from a widely cited but never implemented model, the OSI
224
 
   (Open System Interconnect ) networking model from the ISO (International
 
273
<p><b>Q.</b>&nbsp; What's this 'layer' crud?</p>
 
274
<p><b>A.</b>&nbsp; Network layers come from a widely cited but never implemented model, the OSI   (Open System Interconnect ) networking model from the ISO (International
225
275
   Standards Organization).
226
276
</p>
227
 
<p>
228
 
   Google for it - for example
 
277
<p>   Google for it - for example
229
278
</p>
230
279
<pre>
231
280
       http://www.ussg.iu.edu/usail/network/nfs/network_layers.html
232
281
</pre>
233
282
<br>
234
 
<p>
235
 
<b>Q.</b>&nbsp;
236
 
 So ntop is like netFlow (Cisco), sFlow (RFC 3176, http://www.sflow.org) or
237
 
   RMON (HP)?
238
 
</p>
239
 
<p>
240
 
<b>A.</b>&nbsp;
241
 
 Not really, actually those are all protocols for sending and receiving
242
 
   information about the network.
243
 
</p>
244
 
<p>
245
 
   ntop has lots in common with the tools that USE those protocols.
246
 
</p>
247
 
<p>
248
 
   And there are lots of tools - some proprietary, many open source.
249
 
</p>
250
 
<p>
251
 
   The devices/programs that collect the information and send it out in netFlow,
 
283
<p><b>Q.</b>&nbsp; So ntop is like netFlow (Cisco), sFlow (RFC 3176, http://www.sflow.org) or   RMON (HP)?
 
284
</p>
 
285
<p><b>A.</b>&nbsp; Not really, actually those are all protocols for sending and receiving   information about the network.
 
286
</p>
 
287
<p>   ntop has lots in common with the tools that USE those protocols.
 
288
</p>
 
289
<p>   And there are lots of tools - some proprietary, many open source.
 
290
</p>
 
291
<p>   The devices/programs that collect the information and send it out in netFlow,
252
292
   sFlow or RMON format are usually called (by me) 'probes'.  The devices and/or
253
293
   programs that receive the netFlow, sFlow or RMON formatted information and do
254
294
   things with it are called 'collectors' (if they process it and forward it on)
255
295
   or called 'displays'.
256
296
</p>
257
 
<p>
258
 
   In fact, ntop can receive netFlow packets and both send and receive sFlow 
 
297
<p>   In fact, ntop can receive netFlow packets and both send and receive sFlow 
259
298
   packets.  It can be a 'probe' or a 'display'. (ntop used to be able to send
260
299
   netFlow packets - that was removed 2004-03 by Luca).
261
300
</p>
262
301
<br>
263
 
<p>
264
 
<b>Q.</b>&nbsp;
265
 
 So ntop is like Nagios or Ipswitch's - WhatsUp Gold?.
266
 
</p>
267
 
<p>
268
 
<b>A.</b>&nbsp;
269
 
 Nope - those are layer 4 and higher (application) monitoring programs.
270
 
</p>
 
302
<p><b>Q.</b>&nbsp; So ntop is like Nagios or Ipswitch's - WhatsUp Gold?.</p>
 
303
<p><b>A.</b>&nbsp; Nope - those are layer 4 and higher (application) monitoring programs.</p>
271
304
<br>
272
 
<p>
273
 
<b>Q.</b>&nbsp;
274
 
 So it's like ...
275
 
</p>
276
 
<p>
277
 
<b>A.</b>&nbsp;
278
 
 Enough already - if you search Freshmeat.net,
279
 
   http://freshmeat.net/search/?q=network+monitor&section=projects
 
305
<p><b>Q.</b>&nbsp; So it's like ...</p>
 
306
<p><b>A.</b>&nbsp; Enough already - if you search Freshmeat.net,   http://freshmeat.net/search/?q=network+monitor&section=projects
280
307
   you will find (as of 18Aug2003):
281
308
</p>
282
309
 
283
310
<pre>
284
311
       Topic :: System :: Networking :: Monitoring (654 projects)
285
312
</pre>
286
 
<p>
287
 
   We'll be here all day.  ntop is ntop.
 
313
<p>   We'll be here all day.  ntop is ntop.
288
314
</p>
289
315
<br>
290
 
<p>
291
 
<b>Q.</b>&nbsp;
292
 
 Ok, so ntop is a unique TCP/IP analyzer.
293
 
</p>
294
 
<p>
295
 
<b>A.</b>&nbsp;
296
 
 Not exactly.
297
 
</p>
298
 
<p>
299
 
   First off, ntop pretty much doesn't care about the lowest (layer 1 or wire)
 
316
<p><b>Q.</b>&nbsp; Ok, so ntop is a unique TCP/IP analyzer.</p>
 
317
<p><b>A.</b>&nbsp; Not exactly.</p>
 
318
<p>   First off, ntop pretty much doesn't care about the lowest (layer 1 or wire)
300
319
   layer.  It leaves dealing with that to a library, libpcap, which hides most
301
320
   of that.
302
321
</p>
303
 
<p>
304
 
   ntop is designed as a hybrid packet analyzer, not a pure Ethernet analyzer
 
322
<p>   ntop is designed as a hybrid packet analyzer, not a pure Ethernet analyzer
305
323
   (layer 2) nor a pure TCP/IP analyzer (layer 3).
306
324
</p>
307
 
<p>
308
 
   ntop gets the data at the layer 2 (frame) level, which could be Ethernet
 
325
<p>   ntop gets the data at the layer 2 (frame) level, which could be Ethernet
309
326
   or another protocol.  Beyond Ethernet, ntop has minimal smarts about FDDI,
310
327
   PPP, RAW and TOKEN-RING frames.  That is, at least enough for some basic
311
328
   counts or to extract the (layer 3) TCP/IP data in side.
312
329
</p>
313
 
<p>
314
 
   ntop 3.0 adds TWO (three?) HUGE areas of new protocol support.
 
330
<p>   ntop 3.0 adds TWO (three?) HUGE areas of new protocol support.
315
331
</p>
316
 
<p>
317
 
   ntop 3.0 supports IPv6, thanks to code contributed by Olivier Festor
 
332
<p>   ntop 3.0 supports IPv6, thanks to code contributed by Olivier Festor
318
333
   <Olivier.Festor@loria.fr> and Abdelkader Lahmadi <Abdelkader.Lahmadi@loria.fr>
319
334
   of the MADYNES Research Time (Managing DYnamic NEtworks and Services), see
320
335
   http://madynes.loria.fr/.
321
336
</p>
322
 
<p>
323
 
   ntop 3.0 has more than a fair amount of smarts about FibreChannel and SCSI
 
337
<p>   ntop 3.0 has more than a fair amount of smarts about FibreChannel and SCSI
324
338
   thanks to code contributed by Dinesh G Dutt <ddutt@cisco.com> of Cisco. 
325
339
</p>
326
 
<p>
327
 
   However, since most of ntop's displayed counts are at the TCP/IP level, it
 
340
<p>   However, since most of ntop's displayed counts are at the TCP/IP level, it
328
341
   confuses people into thinking ntop is purely a TCP/IP analyzer.
329
342
</p>
330
 
<p>
331
 
   ntop is a traffic monitor with it's own network interfaces, which monitors
 
343
<p>   ntop is a traffic monitor with it's own network interfaces, which monitors
332
344
   what it sees (or is told about through netFlow or sFlow probes).
333
345
</p>
334
346
<br>
335
 
<p>
336
 
<b>Q.</b>&nbsp;
337
 
 ntop runs under?
338
 
</p>
339
 
<p>
340
 
<b>A.</b>&nbsp;
341
 
 ntop is known to work under Linux, Mac OS X, FreeBSD, OpenBSD (3.4, nothing
342
 
   earlier) NetBSD (with issues) and Win32.
343
 
</p>
344
 
<p>
345
 
   ntop development is done primarily on RedHat Linux and Mac OS.
346
 
</p>
347
 
<p>
348
 
   Luca also does a port to Win32 (MS Visual C++) and works in the Sun
349
 
   Solaris environment.
350
 
</p>
351
 
<p>
352
 
   I (Burton) usually work under RedHat Linux, but have a multi-boot system
353
 
   for testing that runs various Linux distros, FreeBSD (4.9 and 5.2),
354
 
   NetBSD, Solaris 8 i86 and OpenBSD.
355
 
</p>
356
 
<p>
357
 
   During the ntop 3.0 development cycle, we did some development and
358
 
   testing on various platforms.  Here's data from the version.xml log
359
 
   showing what people were running while testing 2.2.98 and 2.2.99:
360
 
</p>
361
 
 
362
 
<pre>
363
 
          count OS      Version        
364
 
        ------- ------- -------------- 
365
 
            492 Linux                  
366
 
             90 Windows WinNT/2K/XP    
367
 
             11 FreeBSD 4.9            
368
 
              9 Solaris 9              
369
 
              7 Darwin  7.2.0          
370
 
              6 FreeBSD 5.2            
371
 
              6 FreeBSD 5.1            
372
 
</pre>
373
 
 
374
 
<pre>
375
 
        and <5 records for FreeBSD 4.6.2, 4.8, 5.0, 5.2.1; OpenBSD 3.4; 
376
 
        and Solaris 8.
377
 
</pre>
378
 
<p>
379
 
   So:
380
 
</p>
381
 
 
382
 
<pre>
383
 
      Solaris 8 / 9 work, 2.6 and 7 probably would...
384
 
      FreeBSD 4.6.2/4.8/4.9 and 5.1/5.2
385
 
      OpenBSD 3.4
386
 
</pre>
387
 
<p>
388
 
   NetBSD doesn't seem to have been tested.
389
 
</p>
390
 
<p>
391
 
   Lots of Different Linuxes... of the ones we recognize:
392
 
</p>
393
 
 
394
 
<pre>
395
 
          count Distro    Release
396
 
        ------- --------- --------
397
 
            141 redhat    9
398
 
             42 fedora    1
399
 
             39 slackware 9.1.0
400
 
             38 redhat    7.3
401
 
             26 redhat    8.0
402
 
             15 debian          (probably 3.0)
403
 
             11 mandrake  9.2
404
 
             10 suse      9.0
405
 
             10 slackware 9.0.0
406
 
              9 redhat    7.2
407
 
              8 debian    3.0
408
 
              7 redhat    2.1AS
409
 
              6 mandrake  9.1
410
 
              5 suse      8.2
411
 
              5 redhat    3
412
 
</pre>
413
 
<p>
414
 
   and < 5 records for arch 0.6; aurora 1.0; aurox 9.2; fedora 0.95; 
415
 
   gentoo 1.4.2.9, 1.4.3.10 and 1.4.3.12; immunix 7.0; mandrake 8.1 and 8.2; 
416
 
   pld 1.1; redhat 1, 2.1, 6.2, 7.0, 7.1; slackware 7.1.0, 8.1 and 9.0-beta; 
417
 
   suse 6.3, 7.0, 8.0 and 8.1; and yellowdog 3.0.
418
 
</p>
419
 
 
420
 
<pre>
421
 
 Running under pretty much any *nix is at least theoretically possible.
422
 
 But it takes interested party/parties and access to resources - some of the
423
 
 things that ntop does such as libpcap and loading plugins are tied tighter
424
 
 to the OS than you might like.
425
 
</pre>
426
 
 
427
 
<pre>
428
 
 There are sections below about each specific OS.
 
347
<p><b>Q.</b>&nbsp; ntop runs under?</p>
 
348
<p><b>A.</b>&nbsp; ntop is known to work under Linux, Mac OS X, FreeBSD, Solaris and Win32.</p>
 
349
<p>   ntop development is done primarily on Fedora Linux.
 
350
</p>
 
351
<p>   Luca also does a port to Win32 (MS Visual C .Net) and used to work in the Sun
 
352
   Solaris environment.  He also seems to work with FreeBSD 5.4.
 
353
</p>
 
354
<p>   I (Burton) usually work under Fedora Linux, but use Microsoft's VPC 2004 and 
 
355
   VMware Workstation 5 to test under other Linux distros and OSes.
 
356
</p>
 
357
<p>   Our users run under many other platforms - Here's data from the version.xml log
 
358
   records showing what people were running while testing 3.2:
 
359
</p>
 
360
<p>   (This data covered approximately the first two weeks of July 2005)
 
361
</p>
 
362
 
 
363
<pre>
 
364
      count version
 
365
    ------- -------
 
366
      16684 3.1
 
367
      10960 3.0
 
368
        345 3.1rc1
 
369
        259 3.1.1
 
370
    etc.
 
371
</pre>
 
372
 
 
373
<pre>
 
374
     count OS Version
 
375
   ------- ------- --------------
 
376
     20509 Linux
 
377
      3566 Windows WinNT/2K/XP
 
378
      1752 Unknown Windowsv3.1
 
379
      1018 Unknown Windowsv3.0
 
380
       266 FreeBSD 5.3
 
381
       234 FreeBSD 5.4
 
382
       219 Darwin 7.7.0
 
383
</pre>
 
384
<p>   Of course, this is self-selected - people can turn off the logging.
 
385
</p>
 
386
<p>   Linux covers lots of Different Linuxes... of the ones we recognize:
 
387
</p>
 
388
 
 
389
<pre>
 
390
     count Distro    Release  
 
391
   ------- --------- -------- 
 
392
      3148 suse               
 
393
      2637 redhat    9        
 
394
      2625 fedora    3        
 
395
      2014 fedora    2        
 
396
      1541 debian    3.1      
 
397
      1373 gentoo    1.4.16   
 
398
       613 redhat    3        
 
399
       603 fedora    1        
 
400
       523 mandrakel 10.2     
 
401
       505 gentoo    1.6.12   
 
402
       473 redhat    7.3      
 
403
       448 mandrakel 10.1     
 
404
       428 debian             
 
405
       399 redhat    4        
 
406
       367 redhat    8.0      
 
407
       301 slackware 10.1.0   
 
408
       282 slackware 10.0.0 
 
409
</pre>
 
410
<p>   The jump in 'SuSE' may represent nothing more than improved detection
 
411
   in the 3.2/3.1 scripts vs. 3.0.  We used to have a huge 'unknown' count.
 
412
</p>
 
413
 
 
414
<pre>
 
415
Running under pretty much any *nix is at least theoretically possible.
 
416
But it takes interested party/parties and access to resources - some of the
 
417
things that ntop does such as libpcap and loading plugins are tied tighter
 
418
to the OS than you might like.
 
419
</pre>
 
420
 
 
421
<pre>
 
422
There are sections below about each specific OS.
429
423
</pre>
430
424
<h2>Features</h2>
431
425
<br>
432
 
<p>
433
 
<b>Q.</b>&nbsp;
434
 
 What determines the features of ntop?
435
 
</p>
436
 
<p>
437
 
<b>A.</b>&nbsp;
438
 
 <laugh>Whatever Luca wants</laugh>
439
 
</p>
 
426
<p><b>Q.</b>&nbsp; What determines the features of ntop?</p>
 
427
<p><b>A.</b>&nbsp; <laugh>Whatever Luca wants</laugh></p>
440
428
<br>
441
 
<p>
442
 
<b>Q.</b>&nbsp;
443
 
 Why did you do this "x" instead of feature "y"?
444
 
</p>
445
 
<p>
446
 
<b>A.</b>&nbsp;
447
 
 Don't know. I could guess...
448
 
</p>
449
 
<p>
450
 
   Imagine you are the network manager for a large University network and have
 
429
<p><b>Q.</b>&nbsp; Why did you do this "x" instead of feature "y"?</p>
 
430
<p><b>A.</b>&nbsp; Don't know. I could guess...</p>
 
431
<p>   Imagine you are the network manager for a large University network and have
451
432
   to crack down on users who are illegally exchanging copyrighted files or
452
433
   using University resources to run a business without paying for the resources
453
434
   being consumed.
454
435
</p>
455
 
<p>
456
 
   or
 
436
<p>   or
457
437
</p>
458
 
<p>
459
 
   You are a major vendor of infrastructure, whose customers are using networks
 
438
<p>   You are a major vendor of infrastructure, whose customers are using networks
460
439
   for new features such as storage area networks and you want to give them
461
440
   the ability to monitor these.
462
441
</p>
463
 
<p>
464
 
   or
 
442
<p>   or
465
443
</p>
466
 
<p>
467
 
   You have a really cool technology that you've just donated to the community
 
444
<p>   You have a really cool technology that you've just donated to the community
468
445
   via an RFC and wish to jump-start adoption of it.
469
446
</p>
470
 
<p>
471
 
   or
 
447
<p>   or
472
448
</p>
473
 
<p>
474
 
   You are moving heavily into IPv6 and need to be able to monitor your 'new'
 
449
<p>   You are moving heavily into IPv6 and need to be able to monitor your 'new'
475
450
   network just like you monitored the IPv4 one.
476
451
</p>
477
 
<p>
478
 
   or (my favorite)
 
452
<p>   or (my favorite)
479
453
</p>
480
 
<p>
481
 
   You really, really, really hate that ntop generates such lousy html code
 
454
<p>   You really, really, really hate that ntop generates such lousy html code
482
455
   and you decide to scratch that itch.
483
456
</p>
484
 
<p>
485
 
   or (what should happen)
 
457
<p>   or (what should happen)
486
458
</p>
487
 
<p>
488
 
   A major corporation, with out resources, time, skills and/or inclination
 
459
<p>   A major corporation, with out resources, time, skills and/or inclination
489
460
   to do it themselves sponsors the development of a feature that's critical
490
461
   to him/her.
491
462
</p>
492
 
<p>
493
 
   or
494
 
</p>
495
 
<p>
496
 
   Then again, it could just be because it's cool...
497
 
</p>
498
 
<br>
499
 
<p>
500
 
<b>Q.</b>&nbsp;
501
 
 Could ntop do "x"
502
 
</p>
503
 
<p>
504
 
<b>A.</b>&nbsp;
505
 
 Probably - as long as it doesn't move the tool away from it's purpose and
506
 
   it's strengths, almost anything is possible - especially as a plugin.
507
 
</p>
508
 
<br>
509
 
<p>
510
 
<b>Q.</b>&nbsp;
511
 
 Will you do "x"
512
 
</p>
513
 
<p>
514
 
<b>A.</b>&nbsp;
515
 
 Maybe - if it's of interest to a developer, or you provide the code such
516
 
   that it can be merged in, or if you're willing to sponsor the development
 
463
<p>   or
 
464
</p>
 
465
<p>   Then again, it could just be because it's cool...
 
466
</p>
 
467
<br>
 
468
<p><b>Q.</b>&nbsp; Could ntop do "x"</p>
 
469
<p><b>A.</b>&nbsp; Probably - as long as it doesn't move the tool away from it's purpose and   it's strengths, almost anything is possible - especially as a plugin.
 
470
</p>
 
471
<br>
 
472
<p><b>Q.</b>&nbsp; Will you do "x"</p>
 
473
<p><b>A.</b>&nbsp; Maybe - if it's of interest to a developer, or you provide the code such   that it can be merged in, or if you're willing to sponsor the development
517
474
   effort (contact us through http://www.ntop.org/consultancy.html).
518
475
</p>
519
476
<h2>Documentation</h2>
520
477
<br>
521
 
<p>
522
 
<b>Q.</b>&nbsp;
523
 
 Why isn't there (any)(more)(better) documentation.
524
 
</p>
525
 
<p>
526
 
<b>A.</b>&nbsp;
527
 
 (A personal peeve from Burton...)
528
 
</p>
529
 
<p>
530
 
   I get real tired of people complaining that there isn't any documentation
 
478
<p><b>Q.</b>&nbsp; Why isn't there (any)(more)(better) documentation.</p>
 
479
<p><b>A.</b>&nbsp; (A personal peeve from Burton...)</p>
 
480
<p>   I get real tired of people complaining that there isn't any documentation
531
481
   and then being unwilling to contribute even the simplest stuff.  I've said
532
482
   I'll edit and assemble whatever people send me... and since I started working
533
483
   with ntop in November 2001, I've received maybe six pages of stuff.
534
484
</p>
535
 
<p>
536
 
   I'm trying to get people - who aren't coders - to contribute to ntop the
 
485
<p>   I'm trying to get people - who aren't coders - to contribute to ntop the
537
486
   project.  The contribution that ANYONE can make is "documentation".  A task-
538
487
   specific HOWTO... some sample screen shots... An FAQ entry...
539
488
</p>
540
 
<p>
541
 
   I've tried being nice.
 
489
<p>   I've tried being nice.
542
490
   I've tried asking.
543
491
   I've tried shaming people into it.
544
492
</p>
545
 
<p>
546
 
   What have I gotten?    Zip.
 
493
<p>   What have I gotten?    Zip.
547
494
</p>
548
 
<p>
549
 
   Nasty is all that's left...  This is your fair warning.  If you show up on
 
495
<p>   Nasty is all that's left...  This is your fair warning.  If you show up on
550
496
   the ntop mailing lists and complain about documentation, you will get
551
497
   blasted.
552
498
</p>
553
 
<p>
554
 
   -----Burton
 
499
<p>   -----Burton
555
500
</p>
556
501
<br>
557
 
<p>
558
 
<b>Q.</b>&nbsp;
559
 
 Ok, where can I find what does exist.
560
 
</p>
561
 
<p>
562
 
<b>A.</b>&nbsp;
563
 
 http://www.ntop.org has pointers and some (dated) documents.
564
 
</p>
565
 
<p>
566
 
   The documentation in the docs/ directory, the Documentation files at SourceForge
 
502
<p><b>Q.</b>&nbsp; Ok, where can I find what does exist.</p>
 
503
<p><b>A.</b>&nbsp; http://www.ntop.org has pointers and some (very out-dated) documents.</p>
 
504
<p>   The documentation in the docs/ directory, the Documentation files at SourceForge
567
505
   and some at http://www.ntopsupport.com are basically all that there is.
568
506
</p>
569
 
<p>
570
 
   Search the ntop mailing lists at gmane, http://search.gmane.org. The lists
 
507
<p>   Search the ntop mailing lists at gmane, http://search.gmane.org. The lists
571
508
   are called gmane.linux.ntop.general and gmane.linux.ntop.devel.
572
509
</p>
573
 
<p>
574
 
   Please contribute to the ntop community by writing things up for inclusion
 
510
<p>   Please contribute to the ntop community by writing things up for inclusion
575
511
   in this FAQ or other documents!
576
512
</p>
577
 
<p>
578
 
   You can even do this all by yourself at the ntop Wiki, 
579
 
   http://www.burtonstrauss.com/pmwiki/pmwiki.php?pagename=Ntop.HomePage
580
 
   (But note that whether it remains available depends on whether people 
581
 
   contribute)
582
 
</p>
583
513
<br>
584
 
<p>
585
 
<b>Q.</b>&nbsp;
586
 
 I can't find a file at SourceForge!
587
 
</p>
588
 
<p>
589
 
<b>A.</b>&nbsp;
590
 
 You can reach the archives through any SourceForge mirror, e.g.
591
 
</p>
 
514
<p><b>Q.</b>&nbsp; I can't find a file at SourceForge!</p>
 
515
<p><b>A.</b>&nbsp; You can reach the archives through any SourceForge mirror, or the main site:</p>
592
516
 
593
517
<pre>
594
 
      http://telia.dl.sourceforge.net/sourceforge/ntop/
595
 
             ^^^^^  change that qualifier to one that's close to you.
 
518
      http://prdownloads.sourceforge.net/n/nt/ntop
596
519
</pre>
597
 
<p>
598
 
   It has ALL the files unless we explicitly delete them...
 
520
<p>   It has ALL the files unless we explicitly delete them...
599
521
</p>
600
522
<h2>Problems</h2>
601
523
<br>
602
 
<p>
603
 
<b>Q.</b>&nbsp;
604
 
 I have a problem...
605
 
</p>
606
 
<p>
607
 
<b>A.</b>&nbsp;
608
 
 Make sure it's a supported release!
609
 
</p>
610
 
<p>
611
 
   We support only the current versions of ntop.  This is either:
 
524
<p><b>Q.</b>&nbsp; I have a problem...</p>
 
525
<p><b>A.</b>&nbsp; Make sure it's a supported release!</p>
 
526
<p>   We support only the current versions of ntop.  This is either:
612
527
</p>
613
528
 
614
529
<pre>
615
 
       * the last release, e.g. v3.0.
 
530
       * the last release, e.g. v3.1.
616
531
       * the current cvs (cvs.ntop.org)
617
532
       * the latest development version posted at SourceForge (if one)
618
533
</pre>
619
 
<p>
620
 
   If you use a port/package and the latest version available for your
 
534
<p>   If you use a port/package and the latest version available for your
621
535
   OS is some release candidate from a year ago, sorry.  Contact the
622
536
   packager and ask them to get current.
623
537
</p>
624
 
<p>
625
 
   Luca usually asks people to try the latest cvs (development) version
 
538
<p>   Luca usually asks people to try the latest cvs (development) version
626
539
   because problems are frequently already fixed in there.
627
540
</p>
628
541
<br>
629
 
<p>
630
 
<b>Q.</b>&nbsp;
631
 
 I'm running something supported and I've tried the latest & greatest.
632
 
   Still, I have a problem.
633
 
</p>
634
 
<p>
635
 
<b>A.</b>&nbsp;
636
 
 Read the ntop mailing lists.
637
 
</p>
638
 
<p>
639
 
   The ntop mailing lists are at
 
542
<p><b>Q.</b>&nbsp; I'm running something supported and I've tried the latest & greatest.   Still, I have a problem.
 
543
</p>
 
544
<p><b>A.</b>&nbsp; Read the ntop mailing lists.</p>
 
545
<p>   The ntop mailing lists are at
640
546
</p>
641
547
<pre>
642
548
      http://listgateway.unipi.it/mailman/listinfo/ntop
643
 
   and
644
549
      http://listgateway.unipi.it/mailman/listinfo/ntop-dev
 
550
   and
 
551
      http://listgateway.unipi.it/mailman/listinfo/ntop-misc
645
552
</pre>
646
 
<p>
647
 
   If you're having non-user problems OR you are using the cvs, you should be
 
553
<p>   If you're having non-user problems OR you are using the cvs, you should be
648
554
   reading and posting ntop-dev (for example, the cvs commit messages are posted
649
 
   there).
 
555
   there).  Stuff unrelated to baseline ntop (PF_RING) belongs in ntop-misc.
650
556
</p>
651
 
<p>
652
 
   You can read the lists through gmane (or other gateways) if you don't
 
557
<p>   You can read the lists through gmane (or other gateways) if you don't
653
558
   want to subscribe, but only subscribers can post.
654
559
</p>
655
 
<p>
656
 
   You can download the older messages in large chunks from the mailing list
 
560
<p>   You can download the older messages in large chunks from the mailing list
657
561
   subscription pages.  Look for "To see the collection of prior postings to
658
562
   the list".
659
563
</p>
660
564
<br>
661
 
<p>
662
 
<b>Q.</b>&nbsp;
663
 
 I looked and I didn't find my problem.
664
 
</p>
665
 
<p>
666
 
<b>A.</b>&nbsp;
667
 
 Join the mailing list(s) and ask for help.
668
 
</p>
669
 
<p>
670
 
   Before you post, check the "HowTo Ask for Help" at the end of this FAQ.
671
 
</p>
672
 
<p>
673
 
   Please, if at all possible, use the built in PR_ form (the little 'bug' icon
 
565
<p><b>Q.</b>&nbsp; I looked and I didn't find my problem.</p>
 
566
<p><b>A.</b>&nbsp; Join the mailing list(s) and ask for help.</p>
 
567
<p>   Before you post, check the "HowTo Ask for Help" at the end of this FAQ.
 
568
</p>
 
569
<p>   Please, if at all possible, use the built in PR_ form (the little 'bug' icon
674
570
   on the 'About' tab).
675
571
</p>
676
 
<p>
677
 
   Guidelines for asking questions:
678
 
</p>
679
 
 
680
 
<pre>
681
 
      ONE and only ONE problem / issue / question per message.
682
 
</pre>
683
 
 
684
 
<pre>
685
 
      With a meaningful subject.
686
 
</pre>
 
572
<p>   Guidelines for asking questions:
 
573
</p>
 
574
<p>   ONE and only ONE problem / issue / question per message.
 
575
</p>
 
576
<p>   With a meaningful subject.
 
577
</p>
687
578
 
688
579
<pre>
689
580
         The goal is that if you're asking a common question, the
690
581
         subject would have allowed you to find it in the back
691
582
         traffic for the mailing list.
692
583
</pre>
693
 
 
694
 
<pre>
695
 
      Post the information about your environment we ask for.
696
 
</pre>
 
584
<p>   Post the information about your environment we ask for.
 
585
</p>
697
586
 
698
587
<pre>
699
588
         We STRONGLY suggest you use the automatically generated "Problem
700
589
         Report" form that since it contains much of the necessary information.
701
590
</pre>
702
 
 
703
 
<pre>
704
 
      Make sure you're in a supported environment (./configure --showoses).
705
 
</pre>
 
591
<p>   Make sure you're in a supported environment (./configure --showoses).
 
592
</p>
706
593
 
707
594
<pre>
708
595
         If it's an unsupported environment, we're interested in your efforts to
709
596
         make ntop work, but we don't have the time, resources, knowledge and/or
710
597
         interest to do it ourselves.
711
598
</pre>
712
 
 
713
 
<pre>
714
 
      For software 'crashes', please run ntop under the gdb debugger and capture
715
 
      the full failure information.
716
 
</pre>
 
599
<p>   For software 'crashes', please run ntop under the gdb debugger and capture
 
600
   the full failure information.
 
601
</p>
717
602
 
718
603
<pre>
719
604
         Brief instructions on using gdb are at the end of this file (docs/FAQ).
720
605
</pre>
721
606
<br>
722
 
<p>
723
 
<b>Q.</b>&nbsp;
724
 
 I posted to the list and nobody answered me.
725
 
</p>
726
 
<p>
727
 
<b>A.</b>&nbsp;
728
 
 ntop is open source, and the lists are a community resource. If nobody
729
 
   answered your question, then nobody knew the answers off-hand and nobody
 
607
<p><b>Q.</b>&nbsp; I posted to the list and nobody answered me.</p>
 
608
<p><b>A.</b>&nbsp; ntop is open source, and the lists are a community resource. If nobody   answered your question, then nobody knew the answers off-hand and nobody
730
609
   wanted to spend THEIR time solving YOUR problem.
731
610
</p>
732
611
<br>
733
 
<p>
734
 
<b>Q.</b>&nbsp;
735
 
 Do you offer paid support?
736
 
</p>
737
 
<p>
738
 
<b>A.</b>&nbsp;
739
 
 Yes - contact us through http://www.ntop.org/consultancy.html
740
 
</p>
 
612
<p><b>Q.</b>&nbsp; Do you offer paid support?</p>
 
613
<p><b>A.</b>&nbsp; Yes - contact us through http://www.ntop.org/consultancy.html</p>
741
614
<h2>Configuring ntop</h2>
742
615
<br>
743
 
<p>
744
 
<b>Q.</b>&nbsp;
745
 
 What does ./configure do?
746
 
</p>
747
 
<p>
748
 
<b>A.</b>&nbsp;
749
 
 ./configure checks for the tools installed on your system - configuring
750
 
   ntop to compile with the ones you have and skip the ones you don't (or
 
616
<p><b>Q.</b>&nbsp; What does ./configure do?</p>
 
617
<p><b>A.</b>&nbsp; ./configure checks for the tools installed on your system - configuring   ntop to compile with the ones you have and skip the ones you don't (or
751
618
   to tell you if you're missing something critical).
752
619
</p>
753
620
<br>
754
 
<p>
755
 
<b>Q.</b>&nbsp;
756
 
 Why bother - just compile the code.
757
 
</p>
758
 
<p>
759
 
<b>A.</b>&nbsp;
760
 
 Then you would have to have a machine configured EXACTLY like Luca's.
761
 
   Nothing else would work.  Various OSes and Linux distributions package
 
621
<p><b>Q.</b>&nbsp; Why bother - just compile the code.</p>
 
622
<p><b>A.</b>&nbsp; Then you would have to have a machine configured EXACTLY like Luca's.   Nothing else would work.  Various OSes and Linux distributions package
762
623
   the files in different ways and put them in different places.  Plus some
763
624
   packages put files into directories with release information in them, etc.
764
625
</p>
765
626
<br>
766
 
<p>
767
 
<b>Q.</b>&nbsp;
768
 
 OK, so ./configure
769
 
</p>
770
 
<p>
771
 
<b>A.</b>&nbsp;
772
 
 Is how you tell ntop where to find things. A lot of stuff it can figure
773
 
   out on it's own, but if things get put in 'strange' places, ntop's
 
627
<p><b>Q.</b>&nbsp; OK, so ./configure</p>
 
628
<p><b>A.</b>&nbsp; Is how you tell ntop where to find things. A lot of stuff it can figure   out on it's own, but if things get put in 'strange' places, ntop's
774
629
   ./configure has switches you use to tell where to find things.
775
630
</p>
776
631
<br>
777
 
<p>
778
 
<b>Q.</b>&nbsp;
779
 
 And the list is?
780
 
</p>
781
 
<p>
782
 
<b>A.</b>&nbsp;
783
 
 ./configure --help shows the whole list. It's a bit confusing because
784
 
   there are standard options and ntop options mixed in there.
785
 
</p>
786
 
<p>
787
 
<b>A.</b>&nbsp;
788
 
 So, first let's look at the 'where are things' options. There are two
789
 
   types of files ntop is looking for, '.h' files and libxxxx files.
790
 
</p>
791
 
<p>
792
 
   .h files are also called 'includes' and libxxxx files are called libraries
 
632
<p><b>Q.</b>&nbsp; And the list is?</p>
 
633
<p><b>A.</b>&nbsp; ./configure --help shows the whole list. It's a bit confusing because   there are standard options and ntop options mixed in there.
 
634
</p>
 
635
<p><b>A.</b>&nbsp; So, first let's look at the 'where are things' options. There are two   types of files ntop is looking for, '.h' files and libxxxx files.
 
636
</p>
 
637
<p>   .h files are also called 'includes' and libxxxx files are called libraries
793
638
   or lib files.
794
639
</p>
795
 
<p>
796
 
   .h files are the C source for functions provided by the OS or by libraries.
 
640
<p>   .h files are the C source for functions provided by the OS or by libraries.
797
641
   They are typically in a directory named /usr/include, but they can be
798
642
   placed ANYWHERE.
799
643
</p>
800
 
<p>
801
 
   lib files are compiled libraries of these functions (the .h tells ntop
 
644
<p>   lib files are compiled libraries of these functions (the .h tells ntop
802
645
   how to call something, the lib file is the actual code).  Their names
803
646
   usually begin libxxxx (so the library gd is named libgd).  
804
647
</p>
805
 
<p>
806
 
   By convention, libraries end in .so or .a.  A .so library is a shared
 
648
<p>   By convention, libraries end in .so or .a.  A .so library is a shared
807
649
   library (Windows DLL), where one copy of the library is used by all
808
650
   programs that want it's functions.  A .a library is a non-shared or
809
651
   static library, which must be merged (the technical term is linked)
810
652
   with the code.
811
653
</p>
812
 
<p>
813
 
   ntop uses both - the myrrd library is a static, .a library.  When it
 
654
<p>   ntop uses both - the myrrd library is a static, .a library.  When it
814
655
   comes to things like libpcap or libgd, we use shared (.so) libraries.
815
656
</p>
816
 
<p>
817
 
   Library files are typically placed in /usr/lib, where the gnu linker
 
657
<p>   Library files are typically placed in /usr/lib, where the gnu linker
818
658
   (ld), 'knows' automatically how to find them.  However, from OS to 
819
659
   OS and distribution to distribution, there are many other common places.
820
660
   Some OSes even have a file telling ld all the places to look.
821
661
</p>
822
662
<br>
823
 
<p>
824
 
<b>Q.</b>&nbsp;
825
 
 So ntop looks for these .h and library thingies in a couple of places.
826
 
   What if it doesn't find them?
827
 
</p>
828
 
<p>
829
 
<b>A.</b>&nbsp;
830
 
 If a basic ./configure can't find something, you'll have to tell ntop
831
 
   where to look.
832
 
</p>
833
 
<p>
834
 
   It's complex and OS/distro dependent. For example, if you install libgd
 
663
<p><b>Q.</b>&nbsp; So ntop looks for these .h and library thingies in a couple of places.   What if it doesn't find them?
 
664
</p>
 
665
<p><b>A.</b>&nbsp; If a basic ./configure can't find something, you'll have to tell ntop   where to look.
 
666
</p>
 
667
<p>   It's complex and OS/distro dependent. For example, if you install libgd
835
668
   from the Sun Freeware site on to a Solaris machine, the files get put
836
669
   into /usr/local/include and /usr/local/lib, which are not on the lists
837
670
   of 'standard' places for Solaris' versions of gcc (the Gnu c compiler)
838
671
   or ld.  So to compile ntop, you have to tell gcc to look in these
839
672
   additional locations.
840
673
</p>
841
 
<p>
842
 
   The things ntop might be looking for are in this part of the
 
674
<p>   The things ntop might be looking for are in this part of the
843
675
   ./configure --help output:
844
676
</p>
845
677
 
866
698
       --with-localedir=DIR        LOCALE files located in DIR (i18n)
867
699
       +-----------------------------------------------------------------------+
868
700
</pre>
869
 
<p>
870
 
   You can see that there is a pattern, pretty much every --with-xxxxx-root
 
701
<p>   You can see that there is a pattern, pretty much every --with-xxxxx-root
871
702
   has a --with-xxxxx-include and --with-xxxxx-lib option.
872
703
</p>
873
 
<p>
874
 
   So, if ntop tells you it can't find something, do this - first look for the
 
704
<p>   So, if ntop tells you it can't find something, do this - first look for the
875
705
   File on your system:
876
706
</p>
877
707
 
879
709
     $ locate pcap.h
880
710
     /usr/include/pcap/pcap.h
881
711
</pre>
882
 
<p>
883
 
   (If you don't have locate, this works too:
 
712
<p>   (If you don't have locate, this works too:
884
713
</p>
885
714
<pre>
886
715
     $ find / -type f -name "pcap.h"
887
716
   )
888
717
</pre>
889
 
<p>
890
 
   And then tell ./configure via --with-pcap-include=/usr/include/pcap
 
718
<p>   And then tell ./configure via --with-pcap-include=/usr/include/pcap
891
719
</p>
892
 
<p>
893
 
   (Some OSes are smart enough to look in a subdirectory of the standard
 
720
<p>   (Some OSes are smart enough to look in a subdirectory of the standard
894
721
   location, but others aren't).
895
722
</p>
896
723
<br>
897
 
<p>
898
 
<b>Q.</b>&nbsp;
899
 
 Ok, but why three options?
900
 
</p>
901
 
<p>
902
 
<b>A.</b>&nbsp;
903
 
 You use either the --with-xxxxx-root option OR either/both of the others
904
 
   at a time.  But ntop really only looks at the  --with-xxxxx-include and
 
724
<p><b>Q.</b>&nbsp; Ok, but why three options?</p>
 
725
<p><b>A.</b>&nbsp; You use either the --with-xxxxx-root option OR either/both of the others   at a time.  But ntop really only looks at the  --with-xxxxx-include and
905
726
   --with-xxxxx-lib options.
906
727
</p>
907
 
<p>
908
 
   Internally, --with-xxxxx-root=/a/b/c is translated into 
 
728
<p>   Internally, --with-xxxxx-root=/a/b/c is translated into 
909
729
   --with-xxxxx-lib=/a/b/c/lib and --with-xxxxx-include=/a/b/c/include
910
730
   (that's the usual pattern).
911
731
</p>
912
 
<p>
913
 
   Now sometimes libraries are installed logically - if the pcap.h file is in
 
732
<p>   Now sometimes libraries are installed logically - if the pcap.h file is in
914
733
   /usr/local/pcap/include, the library (libpcap.so) is probably in
915
734
   /usr/local/pcap/lib.  Sometimes they are not logical and you will have
916
735
   to use the split options.
917
736
</p>
918
 
<p>
919
 
   The --with-pcap-root=/usr/local/pcap is shorthand for the two options,
 
737
<p>   The --with-pcap-root=/usr/local/pcap is shorthand for the two options,
920
738
   --with-pcap-include=/usr/local/pcap/include and
921
739
   --with-pcap-lib=/usr/local/pcap/lib.
922
740
</p>
923
741
<br>
924
 
<p>
925
 
<b>Q.</b>&nbsp;
926
 
 Oh Ghu - aren't there any short cuts.
927
 
</p>
928
 
<p>
929
 
<b>A.</b>&nbsp;
930
 
 For the first time you try ./configure, there's a script on SourceForge in
931
 
   The user contributed area that will try to build the ./configure line for
 
742
<p><b>Q.</b>&nbsp; Oh Ghu - aren't there any short cuts.</p>
 
743
<p><b>A.</b>&nbsp; For the first time you try ./configure, there's a script on SourceForge in   The user contributed area that will try to build the ./configure line for
932
744
   you.
933
745
</p>
934
746
<br>
935
 
<p>
936
 
<b>Q.</b>&nbsp;
937
 
 And the OTHER options?
938
 
</p>
939
 
<p>
940
 
<b>A.</b>&nbsp;
941
 
 There is a set that tells ntop where to install stuff. For simplicity,
942
 
   the two you might want to change are:
 
747
<p><b>Q.</b>&nbsp; And the OTHER options</p>
 
748
<p><b>A.</b>&nbsp; There is a set that tells ntop where to install stuff. For simplicity,   the two you might want to change are:
943
749
</p>
944
750
 
945
751
<pre>
948
754
       --datadir=DIR           read-only architecture-independent data
949
755
                               [PREFIX/share]
950
756
</pre>
951
 
<p>
952
 
   --prefix tells ntop where to install the various files.  The default value
 
757
<p>   --prefix tells ntop where to install the various files.  The default value
953
758
   is /usr/local, which is where most non-OS software normal goes.
954
759
</p>
955
 
<p>
956
 
   A common choice for libraries (such as pcap) is --prefix=/usr, which puts
 
760
<p>   A common choice for libraries (such as pcap) is --prefix=/usr, which puts
957
761
   things like .h files in places easier to automatically find (/usr/include).
958
762
   --prefix=/usr certainly works for ntop.  --prefix=/opt is another choice.
959
763
</p>
960
 
<p>
961
 
   The 'proper' choice turns on which model of file organization the OS and
 
764
<p>   The 'proper' choice turns on which model of file organization the OS and
962
765
   sysadmin prefer.  That's a fight I'm staying out of.
963
766
</p>
964
 
<p>
965
 
   --datadir tells ntop where to put its databases and output files.  The
 
767
<p>   --datadir tells ntop where to put its databases and output files.  The
966
768
   default is /usr/share/ntop, but that will give some sysadmin's agita.
967
769
   Another popular choice is --datadir=/var, which puts all the files in
968
770
   /var/ntop.  That may be attractive especially if you make /var/ntop
969
771
   a separate partition, so the rrd files don't eat all your disk space.
970
772
</p>
971
773
<br>
972
 
<p>
973
 
<b>Q.</b>&nbsp;
974
 
 What's --enable-iknowbetter Override WILLFAIL
975
 
</p>
976
 
<p>
977
 
<b>A.</b>&nbsp;
978
 
 There are some error messages where it's possible that thing work (now)
979
 
   that didn't used to, or you're doing development and don't want ntop
 
774
<p><b>Q.</b>&nbsp; What's --enable-iknowbetter Override WILLFAIL</p>
 
775
<p><b>A.</b>&nbsp; There are some error messages where it's possible that thing work (now)   that didn't used to, or you're doing development and don't want ntop
980
776
   to stop you from doing something, or there's an error message that you
981
777
   have skipped before without getting bitten.
982
778
</p>
983
 
<p>
984
 
   --enable-iknowbetter will print the message but not stop ntop from
 
779
<p>   --enable-iknowbetter will print the message but not stop ntop from
985
780
   finishing ./configure.
986
781
</p>
987
 
<p>
988
 
   Use it at your own risk.
 
782
<p>   Use it at your own risk.
989
783
</p>
990
784
<br>
991
 
<p>
992
 
<b>Q.</b>&nbsp;
993
 
 What are the --enable and --disable options?
994
 
</p>
995
 
<p>
996
 
<b>A.</b>&nbsp;
997
 
 These (and the with/without options) pretty much do what you think - they
998
 
   enable or disable large chunks of ntop functionality:
 
785
<p><b>Q.</b>&nbsp; What are the --enable and --disable options?</p>
 
786
<p><b>A.</b>&nbsp; These (and the with/without options) pretty much do what you think - they   enable or disable large chunks of ntop functionality:
999
787
</p>
1000
788
 
1001
789
<pre>
1002
 
       +--ntop-specific:-------------------------------------------------------+
1003
 
       --disable-mt                disable multithread support [default=enabled]
 
790
       +--ntop-specific:------------------------------------------------------------+
1004
791
       --enable-sslv3              enable ssl v3 support [default=disabled]
1005
 
       --enable-sslwatchdog        enable Watchdog for ssl hang-ups
1006
 
                                   [default=disabled]
1007
 
       --disable-plugins           disable compilation of plugins
1008
 
                                   [default=enabled]
1009
 
       --enable-static-plugins     Enable static linked plugins sntop,
1010
 
                                   default=dynamic]
 
792
       --enable-sslwatchdog        enable Watchdog for ssl hangups [default=disabled]
 
793
       --disable-plugins           disable compilation of plugins [default=enabled]
 
794
       --enable-static-plugins     Enable static linked plugins sntop, default=dynamic]
1011
795
       --enable-ignoresigpipe      Ignore SIGPIPE errors [default=do not ignore]
1012
 
       --enable-i18n               Enable (limited) internationalization
1013
 
                                   [default=disabled]
1014
 
       --enable-showoses           display OS Support information.
 
796
       --disable-snmp              Disable SNMP support [default=disable]
 
797
       --enable-i18n               Enable (limited) internationalization [default=disabled]
 
798
       --enable-jumbo-frames       Enable Jumbo (9K) Ethernet frames [default=disabled]
1015
799
       --disable-ipv6              use IPv6 [default=enabled]
1016
800
       +-----------------------------------------------------------------------+
1017
801
</pre>
1021
805
       --without-ssl               disable HTPPS support [default=enabled]
1022
806
       --without-zlib              disable zlib [default=enabled]
1023
807
       --with-tcpwrap              enable use of TCP Wrapper [default=disabled]
 
808
       +-----------------------------------------------------------------------+
1024
809
</pre>
1025
810
<br>
1026
 
<p>
1027
 
<b>Q.</b>&nbsp;
1028
 
 What ELSE?
1029
 
</p>
1030
 
<p>
1031
 
<b>A.</b>&nbsp;
1032
 
 There are some so called 'environment variables' you can set that change
1033
 
   things too.  The common ones are:
 
811
<p><b>Q.</b>&nbsp; What ELSE?</p>
 
812
<p><b>A.</b>&nbsp; There are some so called 'environment variables' you can set that change   things too.  The common ones are:
1034
813
</p>
1035
814
<pre>
1036
815
        CC          C compiler command
1041
820
                    headers in a nonstandard directory <include dir>
1042
821
        CPP         C preprocessor
1043
822
</pre>
1044
 
<p>
1045
 
   You would use these variables to override the choices made by ./configure
 
823
<p>   You would use these variables to override the choices made by ./configure
1046
824
   or to help it to find libraries and programs with truly nonstandard
1047
825
   names/locations.
1048
826
</p>
1049
 
<p>
1050
 
   The best place to look for examples of these environment variables are in
 
827
<p>   The best place to look for examples of these environment variables are in
1051
828
   the OS/distribution files in the configureextra directory.  For example,
1052
829
   (again picking on Solaris), we use LDFLAGS to tell ld to look in some
1053
830
   common Solaris locations for libraries via this:
1056
833
<pre>
1057
834
     LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${LDFLAGS}"
1058
835
</pre>
1059
 
<p>
1060
 
   What that does is add /usr/local/lib to the locations that ld will check.
 
836
<p>   What that does is add /usr/local/lib to the locations that ld will check.
1061
837
</p>
1062
838
<br>
1063
 
<p>
1064
 
<b>Q.</b>&nbsp;
1065
 
 ./configure dies in some strange horrible way complaining about version
1066
 
   conflicts, lunar phase or whatever.
 
839
<p><b>Q.</b>&nbsp; ./configure dies in some strange horrible way complaining about version   conflicts, lunar phase or whatever.
1067
840
</p>
1068
 
<p>
1069
 
<b>A.</b>&nbsp;
1070
 
 The process of creating portable cross-platform scripts for building
1071
 
   software is ugly and hard and prone to failure.  There are tools
 
841
<p><b>A.</b>&nbsp; The process of creating portable cross-platform scripts for building   software is ugly and hard and prone to failure.  There are tools
1072
842
   (released by gnu) to help, named automake, autoconf and libtool.
1073
843
   (Collectively the auto* tools).
1074
844
</p>
1075
 
<p>
1076
 
   These tools take basic files and generate more complex files based
 
845
<p>   These tools take basic files and generate more complex files based
1077
846
   on a series of rules, conventions and macros (much of which is poorly
1078
847
   or undocumented).  Other processes (e.g. ./configure) take these files
1079
848
   and generate more complex files based on a different series of rules,
1082
851
   series of rules, conventions and macros - to actually compile the ntop
1083
852
   source.
1084
853
</p>
1085
 
<p>
1086
 
   There are interdependencies among the tools, partial support for older
 
854
<p>   There are interdependencies among the tools, partial support for older
1087
855
   versions in some releases, but not in other releases and many more
1088
856
   problems.
1089
857
</p>
1090
 
<p>
1091
 
   Different OSes and different Linux distros ship with wildly different
 
858
<p>   Different OSes and different Linux distros ship with wildly different
1092
859
   versions.  Some even have scripts that attempt to analyze the file and
1093
860
   pick the correct version (which just means that trying to code a file
1094
861
   with multiple version support confuses the tool).
1095
862
</p>
1096
 
<p>
1097
 
   So if you have a basic, total failure of ./configure, it's usually
 
863
<p>   So if you have a basic, total failure of ./configure, it's usually
1098
864
   the auto* tools.
1099
865
</p>
1100
 
<p>
1101
 
   ntop used to ship with a manual script that rebuilt the generated files
 
866
<p>   ntop used to ship with a manual script that rebuilt the generated files
1102
867
   according to the version(s) of the tools installed on the system you were
1103
868
   using to build ntop.  Thus the standard answer was 'run ./autogen.sh -1'.
1104
869
</p>
1105
 
<p>
1106
 
   But, this meant that you had to have these 'developer' tools installed
 
870
<p>   But, this meant that you had to have these 'developer' tools installed
1107
871
   and caused much problems and gnashing of teeth.
1108
872
</p>
1109
 
<p>
1110
 
   So we spent 100s of hours rebuilding the scripts to be totally independent
 
873
<p>   So we spent 100s of hours rebuilding the scripts to be totally independent
1111
874
   of having the tools installed on your system - only to run into problems
1112
875
   because the xyz 1.6.1 tool installed by default on OS A isn't quite
1113
876
   compatible with the 1.6.3 version on OS B.
1114
877
</p>
1115
 
<p>
1116
 
   So we put technology in place to automatically detect tool versions and
 
878
<p>   So we put technology in place to automatically detect tool versions and
1117
879
   rebuild the generated files if necessary.  That meant you had to have
1118
880
   these 'developer' tools installed and caused much problems.
1119
881
</p>
1120
 
<p>
1121
 
   So we rebuilt the scripts AGAIN and AGAIN, dropped support for old versions
 
882
<p>   So we rebuilt the scripts AGAIN and AGAIN, dropped support for old versions
1122
883
   of the tools and finally reached a point where it works for most reasonably
1123
884
   current platforms.  This is a compromise:
1124
885
</p>
1128
889
       Systems that have bleeding edge versions of these tools may break.
1129
890
       Systems with very old versions also may break.
1130
891
</pre>
1131
 
<p>
1132
 
   The technology to detect versions and rebuild the script files if
 
892
<p>   The technology to detect versions and rebuild the script files if
1133
893
   appropriate is still in there, but it's disabled from normal use.
1134
894
</p>
1135
 
<p>
1136
 
   If you have the auto* tools installed and have ./configure problems, you
 
895
<p>   If you have the auto* tools installed and have ./configure problems, you
1137
896
   can activate the automatic rebuild feature via:
1138
897
</p>
1139
898
 
1141
900
      $ export NTOPAUTOREBUILD=yes
1142
901
      $ ./configure ...
1143
902
</pre>
1144
 
<p>
1145
 
   If the rebuild fixes it, that's great.  Regardless, please report the
 
903
<p>   If the rebuild fixes it, that's great.  Regardless, please report the
1146
904
   problem to the ntop mailing list.  Please don't paraphrase the messages
1147
905
   cut & paste the ACTUAL MESSAGES into your report.  Also, please let us
1148
906
   know the version(s) of the tools installed on your system:
1156
914
      $ libtool --version
1157
915
</pre>
1158
916
<br>
1159
 
<p>
1160
 
<b>Q.</b>&nbsp;
1161
 
 But how does it all hang together?
1162
 
</p>
1163
 
<p>
1164
 
<b>A.</b>&nbsp;
1165
 
 There's a vsd (Visio)/pdf in the docs directory - ntop-autotools.pdf.
1166
 
</p>
 
917
<p><b>Q.</b>&nbsp; I can't build ntop... (auto* tools)</p>
 
918
<p><b>A.</b>&nbsp; ntop has been tested with and developed for various versions of   the "GNU auto* tools" (automake, autoconf and libtool).
 
919
</p>
 
920
<p>   The basic requirements are
 
921
</p>
 
922
<p>   automake 1.6.1 or higher  (automake 1.4 and 1.5 may or may not work)
 
923
   autoconf 2.51 or higher   (autoconf 2.13 will NOT work)
 
924
   libtool 1.4 or higher
 
925
</p>
 
926
<p>   But that simple statement hides a lot of complexity and many potential
 
927
   problems.  Surprisingly, this isn't solely ntop's fault, it's the 
 
928
   combination of GNU auto* tools version to version compatiblity and 
 
929
   because we're trying to distribute configure and make files that work
 
930
   on all versions.  If ntop were less complex or less clever about 
 
931
   trying to build a working program even with many components missing,
 
932
   things would work a lot better.
 
933
</p>
 
934
<p>   The big change between autoconf 2.13 and 2.5x generated scripts is that
 
935
   the ./configure and make steps are supposed to run the auto* commands
 
936
   automatically if they're required.  As we've seen, this doesn't always
 
937
   work!  
 
938
</p>
 
939
<p>   If you run into problems, you can ALWAYS recreate the generated files 
 
940
   via this procedure:
 
941
</p>
 
942
 
 
943
<pre>
 
944
      rm -f acinclude.m4 aclocal.m4 Makefile.in config.h.in configure Makefile
 
945
</pre>
 
946
 
 
947
<pre>
 
948
      find current versions of libtool, config.guess and config.sub and cp
 
949
      them into your working directory.
 
950
</pre>
 
951
 
 
952
<pre>
 
953
      cat acinclude.m4.ntop libtool.m4.in > acinclude.m4
 
954
      aclocal
 
955
      autoheader
 
956
      autoconf
 
957
      automake --gnu --copy --add-missing
 
958
</pre>
 
959
<p>   and then:
 
960
</p>
 
961
 
 
962
<pre>
 
963
      ./configure ...
 
964
      make
 
965
      make install
 
966
</pre>
 
967
<p>   as usual.
 
968
</p>
 
969
<br>
 
970
<p><b>Q.</b>&nbsp; But how does it all hang together?</p>
 
971
<p><b>A.</b>&nbsp; There's a vsd (Visio)/pdf in the docs directory - ntop-autotools.pdf.</p>
1167
972
<h2>Compiling ntop</h2>
1168
973
<br>
1169
 
<p>
1170
 
<b>Q.</b>&nbsp;
1171
 
 Which packages/libraries do I need to compile ntop:
1172
 
</p>
 
974
<p><b>Q.</b>&nbsp; Which packages/libraries do I need to compile ntop:</p>
1173
975
 
1174
976
<pre>
1175
977
    Note: In some cases the minimal header files for a tool will be in
1188
990
 
1189
991
<pre>
1190
992
       libpcap
1191
 
          We recommend 0.7.2, but ntop works with most 0.6.x versions. 
1192
 
          The newest version, 0.8.x works too - there are ntop fixes since 
1193
 
          late 2.2.9x releases for this.
 
993
          We recommend 0.8.3, but ntop works with most 0.7.2 and later versions. 
1194
994
</pre>
1195
995
 
1196
996
<pre>
1202
1002
</pre>
1203
1003
 
1204
1004
<pre>
1205
 
       gd (1.8.x - stay away from 2.x development versions)
1206
 
          http://www.boutell.com/gd/gd.html
 
1005
       gd 
 
1006
          http://www.boutell.com/gd/gd.html - note that many distros have both
 
1007
          the 1.8.x and 2.x series installed for differnt packages that require
 
1008
          them.  This occasionally causes problems.
1207
1009
</pre>
1208
1010
 
1209
1011
<pre>
1221
1023
</pre>
1222
1024
 
1223
1025
<pre>
1224
 
       gcc
1225
 
          Note: Both gcc 2.95/2.96 and 3.2/3.3 are reported to work.  Across a lot
1226
 
                of software, gcc 3.0 had problems - no clue re ntop.
1227
 
          For you folks still running 2.94, I think I fixed all the compile errors,
1228
 
          but upgrade for ghu's sake!
 
1026
       gcc most versions of gcc should work, but there are no promisses.
1229
1027
</pre>
1230
1028
 
1231
1029
<pre>
1232
 
       libtool  1.4+ (distribution with 1.4.2)
 
1030
       libtool  1.4+ (distribution is built with 1.4.2)
1233
1031
                     (there are successes reported with 1.3.4 or 1.3.5 -
1234
1032
                      use --enable-iknowbetter)
1235
1033
</pre>
1236
1034
 
1237
1035
<pre>
1238
1036
       gawk/mawk
1239
 
          Note: If all you have is nawk, then --enable-showoses will not work.
1240
 
                If all you have is original awk, then ./configure will not work.
 
1037
          Note: If all you have is original awk, then ./configure will not work.
1241
1038
</pre>
1242
1039
<br>
1243
 
<p>
1244
 
<b>Q.</b>&nbsp;
1245
 
 Will the "xyz" compiler work instead of gcc?
1246
 
</p>
1247
 
<p>
1248
 
<b>A.</b>&nbsp;
1249
 
 We explicitly REQUIRE gcc.
1250
 
</p>
1251
 
<p>
1252
 
   We know that under many systems, a compiler called cc is available. On some,
 
1040
<p><b>Q.</b>&nbsp; Will the "xyz" compiler work instead of gcc?</p>
 
1041
<p><b>A.</b>&nbsp; We explicitly REQUIRE gcc.</p>
 
1042
<p>   We know that under many systems, a compiler called cc is available. On some,
1253
1043
   it's a symbolic link to gcc, BUT, when invoked as cc, it often triggers 'old'
1254
1044
   behaviors for cc compatibility.  On others, cc is a retarded compiler just good
1255
1045
   enough for compiling the kernel.
1256
1046
</p>
1257
 
<p>
1258
 
   The one exception is Sun's cc, which - since Luca used to do a lot of development
 
1047
<p>   The one exception is Sun's cc, which - since Luca used to do a lot of development
1259
1048
   on Solaris - was pretty well supported.
1260
1049
</p>
1261
1050
<br>
1262
 
<p>
1263
 
<b>Q.</b>&nbsp;
1264
 
 The auto* tools?
1265
 
</p>
1266
 
<p>
1267
 
<b>A.</b>&nbsp;
1268
 
 Only if you are going to rebuild the distributed script files:
1269
 
</p>
 
1051
<p><b>Q.</b>&nbsp; The auto* tools?</p>
 
1052
<p><b>A.</b>&nbsp; Only if you are going to rebuild the distributed script files:</p>
1270
1053
 
1271
1054
<pre>
1272
1055
           autoconf 2.5+ (distribution with 2.57)
1273
 
           automake 1.6+ (distribution with 1.6.1)
 
1056
           automake 1.6+ (distribution with 1.8.3)
1274
1057
</pre>
1275
1058
<br>
1276
 
<p>
1277
 
<b>Q.</b>&nbsp;
1278
 
 Optional libraries?
1279
 
</p>
1280
 
<p>
1281
 
<b>A.</b>&nbsp;
1282
 
 Lots. The most common is:
1283
 
</p>
 
1059
<p><b>Q.</b>&nbsp; Optional libraries?</p>
 
1060
<p><b>A.</b>&nbsp; Lots. The most common is:</p>
1284
1061
 
1285
1062
<pre>
1286
1063
       openssl (for https:// support)
1288
1065
                Version of openssl installed.
1289
1066
</pre>
1290
1067
<br>
1291
 
<p>
1292
 
<b>Q.</b>&nbsp;
1293
 
 ntop doesn't compile.
1294
 
</p>
1295
 
<p>
1296
 
<b>A.</b>&nbsp;
1297
 
 Sure, it does - for me :-)
1298
 
</p>
 
1068
<p><b>Q.</b>&nbsp; ntop doesn't compile.</p>
 
1069
<p><b>A.</b>&nbsp; Sure, it does - for me :-)</p>
1299
1070
<br>
1300
 
<p>
1301
 
<b>Q.</b>&nbsp;
1302
 
 Right smarty-pants...
1303
 
</p>
1304
 
<p>
1305
 
<b>A.</b>&nbsp;
1306
 
 First, check if you're using a supported OS.
1307
 
</p>
1308
 
<p>
1309
 
   The long and short of it is that ntop works under Linux, Mac OS X and
 
1071
<p><b>Q.</b>&nbsp; Right smarty-pants...</p>
 
1072
<p><b>A.</b>&nbsp; First, check if you're using a supported OS.</p>
 
1073
<p>   The long and short of it is that ntop works under Linux, Mac OS X and
1310
1074
   FreeBSD.
1311
1075
</p>
1312
 
<p>
1313
 
   Luca distributes a Win32 version through http://shop.ntop.org but charges a
1314
 
   convenience fee.  Or you can fire up Microsoft's Visual C++ 6.0 and compile
1315
 
   the Win32 version that way.  We don't recommend Visual C++ .Net as the
1316
 
   internals of the memory management caused problems.
1317
 
</p>
1318
 
<p>
1319
 
   It works (albeit with severe limitations) on NetBSD.
1320
 
</p>
1321
 
<p>
1322
 
   It works on OpenBSD 3.4 (only).
1323
 
</p>
1324
 
<p>
1325
 
   It used to work under MinGW, but that broke after 2.1.3 and we need somebody
1326
 
   with some technical skills and an interest in MinGW to fix it.
1327
 
</p>
1328
 
<p>
1329
 
   Anything else, you are in untested waters.  Some cases we know there are
 
1076
<p>   Luca distributes a Win32 version through http://shop.ntop.org but charges a
 
1077
   convenience fee.  Or you can fire up Microsoft's Visual C++ or Visual C++ .Net
 
1078
   and compile the Win32 version that way.
 
1079
</p>
 
1080
<p>   It should work under MinGW - see the BUILD file in docs.
 
1081
</p>
 
1082
<p>   Anything else, you are in untested waters.  Some cases we know there are
1330
1083
   problems, others we just haven't tested.
1331
1084
</p>
1332
1085
<br>
1333
 
<p>
1334
 
<b>Q.</b>&nbsp;
1335
 
 But that was as of 18Aug2003?
1336
 
</p>
1337
 
<p>
1338
 
<b>A.</b>&nbsp;
1339
 
 Yes. For the latest scoop, run ./configure --enable-showoses
1340
 
</p>
1341
 
<p>
1342
 
   ntop will perform the basic ./configure tests (make sure you have a c
1343
 
   compiler that works, etc.) and then output a table.
1344
 
</p>
1345
 
<p>
1346
 
   This is from a pretty complete 3.0 release (at least as far as OS support
1347
 
   goes):
1348
 
</p>
1349
 
 
1350
 
<pre>
1351
 
     ntop OS Support status extract for version 2.2.91
1352
 
         Run Mon Aug 18 10:00:58 CDT 2003
1353
 
</pre>
1354
 
 
1355
 
<pre>
1356
 
     config.guess value     compiler OS name    Status
1357
 
     ------------------    --------- ---------  ---------------
1358
 
     mingw32*                    gcc MINGW             UNTESTED
1359
 
     cygwin*                       * CYGWIN            WILLFAIL
1360
 
     linux*                     *gcc LINUX      SUPPORTED
1361
 
     solaris2.9*                   * SOLARIS           UNTESTED
1362
 
     solaris2.8*                   * SOLARIS    SUPPORTED
1363
 
     solaris2.5*                   * SOLARIS           UNTESTED
1364
 
     solaris*                      * SOLARIS           UNTESTED
1365
 
     darwin*                       * DARWIN     SUPPORTED
1366
 
     freebsd[45]*               *gcc FREEBSD    SUPPORTED
1367
 
     freebsd*                      * FREEBSD           UNTESTED
1368
 
     openbsd*                      * OPENBSD           WILLFAIL
1369
 
     netbsd*1.5*                 gcc NETBSD
1370
 
     netbsd*                       * NETBSD            UNTESTED
1371
 
     hpux11*                     gcc HPUX              WILLFAIL
1372
 
     hpux10*                     gcc HPUX
1373
 
     aix*                          * AIX               UNTESTED
1374
 
</pre>
1375
 
<p>
1376
 
   Quoting from the ./configure --enable-showoses output:
1377
 
</p>
1378
 
 
1379
 
<pre>
1380
 
     Status of 'SUPPORTED' means you are:
1381
 
</pre>
1382
 
 
1383
 
<pre>
1384
 
          Building ntop for a supported platform
1385
 
          This means we expect ntop to work without major issues
1386
 
</pre>
1387
 
 
1388
 
<pre>
1389
 
     Status of 'UNTESTED' means you are:
1390
 
</pre>
1391
 
 
1392
 
<pre>
1393
 
          Building ntop for an untested platform
1394
 
</pre>
1395
 
 
1396
 
<pre>
1397
 
     Untested means that:
1398
 
</pre>
1399
 
 
1400
 
<pre>
1401
 
          1. A previous version of this OS is supported.
1402
 
          or 2. This version of this OS was supported by a
1403
 
          previous version of ntop.
1404
 
</pre>
1405
 
 
1406
 
<pre>
1407
 
          ./configure applies the same configuration options,
1408
 
          special parameters, etc. as for the prior release.
1409
 
</pre>
1410
 
 
1411
 
<pre>
1412
 
          For OS .0 releases that is probably a bad bet...
1413
 
</pre>
1414
 
 
1415
 
<pre>
1416
 
          It could just be that you are compiling an older version
1417
 
          of ntop on a new OS release - check the http://www.ntop.org
1418
 
          site for an update.
1419
 
</pre>
1420
 
 
1421
 
<pre>
1422
 
     Status of 'WILLFAIL' means you are:
1423
 
</pre>
1424
 
 
1425
 
<pre>
1426
 
          Attempting to build ntop for an unsupported platform
1427
 
</pre>
1428
 
 
1429
 
<pre>
1430
 
          >>> This is unsupported.
1431
 
          >>> It will almost certainly fail
1432
 
          (that is why it is listed as 'unsupported' - doh!)
1433
 
</pre>
1434
 
 
1435
 
<pre>
1436
 
     Status of blank means that the support level depends
1437
 
     upon ntop settings and/or other factors.
1438
 
</pre>
1439
 
<br>
1440
 
<p>
1441
 
<b>Q.</b>&nbsp;
1442
 
 Ok, it's a supported release and it still won't compile.
1443
 
</p>
1444
 
<p>
1445
 
<b>A.</b>&nbsp;
1446
 
 Did you run ./configure? And did it complete successfully?
1447
 
</p>
1448
 
<p>
1449
 
   Usually 'compile' problems for supported platforms are a missing
 
1086
<p><b>Q.</b>&nbsp; Ok, it's a supported environment and it still won't compile.</p>
 
1087
<p><b>A.</b>&nbsp; Did you run ./configure? And did it complete successfully?</p>
 
1088
<p>   Usually 'compile' problems for supported platforms are a missing
1450
1089
   (critical) library or header file, but the user ignored (didn't see)
1451
1090
   the error/warning message and tried running make anyway.
1452
1091
</p>
1453
 
<p>
1454
 
   ./configure checks a lot of things.  When it's looking for
 
1092
<p>   ./configure checks a lot of things.  When it's looking for
1455
1093
   headers and libraries, ntop will report KEY information and PROBLEMS
1456
1094
   in large, set-off, lines:
1457
1095
</p>
1474
1112
     *
1475
1113
     *******************************************************************
1476
1114
</pre>
1477
 
<p>
1478
 
   READ THESE BOXES.  Even if you don't read the rest of the output, read
 
1115
<p>   READ THESE BOXES.  Even if you don't read the rest of the output, read
1479
1116
   the boxes.  ntop can work around a lot of problems (missing libraries)
1480
1117
   by disabling features that need them.  If, for example, you don't have
1481
1118
   zlib, ntop will compile a version that doesn't output compressed html
1482
1119
   pages.  If you don't read the boxes, you will never know.
1483
1120
</p>
1484
 
<p>
1485
 
   READ THE MESSAGE BOXES!
 
1121
<p>   READ THE MESSAGE BOXES!
1486
1122
</p>
1487
1123
 
1488
1124
<pre>
1502
1138
     *                                                                 *
1503
1139
     *******************************************************************
1504
1140
</pre>
1505
 
<p>
1506
 
   The box will tell you what's wrong, what ntop did and often how to fix it
 
1141
<p>   The box will tell you what's wrong, what ntop did and often how to fix it
1507
1142
   if you don't like ntop's fix.
1508
1143
</p>
1509
 
<p>
1510
 
   READ THE MESSAGE BOXES!
 
1144
<p>   READ THE MESSAGE BOXES!
1511
1145
</p>
1512
 
<p>
1513
 
   Hint: It may sometimes be that you're missing the header files (often those
 
1146
<p>   Hint: It may sometimes be that you're missing the header files (often those
1514
1147
   are in a -devel rpm if you're running RedHat)
1515
1148
</p>
1516
 
<p>
1517
 
   If you see a message box and don't understand why ("I'm sure that
 
1149
<p>   If you see a message box and don't understand why ("I'm sure that
1518
1150
   header file is present"), then look at a file called config.log.  Search
1519
1151
   for the specific header or library reported in the message box and you will
1520
1152
   see the detailed compiler/linker error messages.
1521
1153
</p>
1522
 
<p>
1523
 
   For example, ./configure reports:
 
1154
<p>   For example, ./configure reports:
1524
1155
</p>
1525
1156
 
1526
1157
<pre>
1527
1158
        checking for linux/if_pppox.h... no
1528
1159
</pre>
1529
 
<p>
1530
 
   The first thing to so is check if it's on your system:
 
1160
<p>   The first thing to so is check if it's on your system:
1531
1161
</p>
1532
1162
 
1533
1163
<pre>
1534
1164
     $ locate linux/if_pppox.h
1535
1165
     /usr/include/linux/if_pppox.h
1536
1166
</pre>
1537
 
<p>
1538
 
   (If you don't have locate, this works too:
 
1167
<p>   (If you don't have locate, this works too:
1539
1168
</p>
1540
1169
<pre>
1541
1170
     $ find / -type f -name "ethertype.h"
1542
1171
   )
1543
1172
</pre>
1544
 
<p>
1545
 
   Open up config.log and look for if_pppox.h:
 
1173
<p>   Open up config.log and look for if_pppox.h:
1546
1174
</p>
1547
1175
 
1548
1176
<pre>
1578
1206
     | #include <linux/if_pppox.h>
1579
1207
     configure:13123: result: no
1580
1208
</pre>
1581
 
<p>
1582
 
   You see the actual test program, the actual compile line and the error
 
1209
<p>   You see the actual test program, the actual compile line and the error
1583
1210
   messages.
1584
1211
</p>
1585
 
<p>
1586
 
   Before reporting it to us, chase down where those missing items are declared:
 
1212
<p>   Before reporting it to us, chase down where those missing items are declared:
1587
1213
</p>
1588
1214
 
1589
1215
<pre>
1591
1217
     /usr/include/linux/if_ether.h:#define ETH_ALEN  6
1592
1218
     /usr/include/net/ethernet.h:#define     ETHER_ADDR_LEN  ETH_ALEN
1593
1219
</pre>
1594
 
<p>
1595
 
   And post that information with your error report.  The reason is that these
 
1220
<p>   And post that information with your error report.  The reason is that these
1596
1221
   field definitions are often placed in very different places in different
1597
1222
   OSes and even in different distributions.
1598
1223
</p>
1599
 
<p>
1600
 
   FWIW, if you look in the older configure.in:
 
1224
<p>   FWIW, if you look in the older configure.in:
1601
1225
</p>
1602
1226
 
1603
1227
<pre>
1604
1228
      AC_CHECK_HEADERS([linux/if_pppox.h], [], [], [net/if.h
1605
1229
         netinet/if_ether.h])
1606
1230
</pre>
1607
 
<p>
1608
 
   should have been
 
1231
<p>   should have been
1609
1232
</p>
1610
1233
 
1611
1234
<pre>
1612
1235
      AC_CHECK_HEADERS([linux/if_pppox.h], [], [], [#include <net/if.h>
1613
1236
      #include <netinet/if_ether.h>])
1614
1237
</pre>
1615
 
<p>
1616
 
   because the macro doesn't do the #include automatically.
 
1238
<p>   because the macro doesn't do the #include automatically.
1617
1239
</p>
1618
1240
<br>
1619
 
<p>
1620
 
<b>Q.</b>&nbsp;
1621
 
 Nope, it's not ./configure...
1622
 
</p>
1623
 
<p>
1624
 
<b>A.</b>&nbsp;
1625
 
 If it's not the configuration, then it's usually a problem with your specific
1626
 
   system, either:
 
1241
<p><b>Q.</b>&nbsp; Nope, it's not ./configure...</p>
 
1242
<p><b>A.</b>&nbsp; If it's not the configuration, then it's usually a problem with your specific   system, either:
1627
1243
</p>
1628
1244
 
1629
1245
<pre>
1630
1246
        - A new release of a supported OS.
1631
1247
        - An uncommon option/configuration of a supported OS.
1632
1248
</pre>
1633
 
<p>
1634
 
   In other words, something is different from what we've seen or expected.
 
1249
<p>   In other words, something is different from what we've seen or expected.
1635
1250
</p>
1636
 
<p>
1637
 
   Review the output from make.  The error message will usually give you a
 
1251
<p>   Review the output from make.  The error message will usually give you a
1638
1252
   Somewhat cryptic description of what's wrong and where.  Look for messages
1639
1253
   about missing files.  Post as much information as you can - do locates for
1640
1254
   the missing files, etc.  The more you give us the less we will have to ask
1641
1255
   you to provide.
1642
1256
</p>
1643
 
<p>
1644
 
   Remember, we can't see your box - all that the people on the list see is the
 
1257
<p>   Remember, we can't see your box - all that the people on the list see is the
1645
1258
   information you give in your message.
1646
1259
</p>
1647
1260
<br>
1648
 
<p>
1649
 
<b>Q.</b>&nbsp;
1650
 
 Compile dies because it's missing depcomp
1651
 
</p>
1652
 
<p>
1653
 
<b>A.</b>&nbsp;
1654
 
 automake/autoconf issue. The problem should have been fixed. If not, just
1655
 
   Copy the missing file (or make a symbolic link) into the ntop source
 
1261
<p><b>Q.</b>&nbsp; Compile dies because it's missing depcomp</p>
 
1262
<p><b>A.</b>&nbsp; automake/autoconf issue. The problem should have been fixed. If not, just   Copy the missing file (or make a symbolic link) into the ntop source
1656
1263
   directory.
1657
1264
</p>
1658
 
<p>
1659
 
   It's in /usr/share/automake on my Linux boxes.  Another user reports it is in
 
1265
<p>   It's in /usr/share/automake on my Linux boxes.  Another user reports it is in
1660
1266
   /usr/local/share/automake in sun8.
1661
1267
</p>
1662
 
<p>
1663
 
   If you have automake installed, this will do it automatically:
 
1268
<p>   If you have automake installed, this will do it automatically:
1664
1269
</p>
1665
1270
 
1666
1271
<pre>
1667
1272
       $ automake --add-missing --gnu -c
1668
1273
</pre>
1669
1274
<br>
1670
 
<p>
1671
 
<b>Q.</b>&nbsp;
1672
 
 Make fails with a message about being unable to create a .deps file.
1673
 
</p>
1674
 
<p>
1675
 
<b>A.</b>&nbsp;
1676
 
 Check the permissions on the (hidden) .deps (and .libs) directories - if root
1677
 
   owns them your non-root userid may not be able to create files in there.
1678
 
</p>
1679
 
<br>
1680
 
<p>
1681
 
<b>Q.</b>&nbsp;
1682
 
 Make fails with a message about a missing .deps file
1683
 
</p>
1684
 
<p>
1685
 
<b>A.</b>&nbsp;
1686
 
 Basically, it's a automake 1.5 bug, related to dependency tracking.
1687
 
</p>
1688
 
<p>
1689
 
   If you don't have automake installed, you shouldn't see this problem.
1690
 
</p>
1691
 
<p>
1692
 
   ntop requires automake 1.6+ - that dependency is EXPLICT in the Makefile.am!
1693
 
</p>
1694
 
<p>
1695
 
   If you do have automake installed, it's possible to hit this problem -
1696
 
   especially if it's one of those Linux distributions that have three versions
1697
 
   of automake installed and a (broken) script that's supposed to figure out
1698
 
   which version to actually run.
1699
 
</p>
1700
 
<p>
1701
 
   Since we distribute ntop with scripts generated from 1.6.3, you would *think*
1702
 
   they should work, regardless of what version of automake is installed.
1703
 
</p>
1704
 
<p>
1705
 
   That's not the case.  The problem occurs because automake gets invoked by
1706
 
   ./configure to copy the missing gnu files such as depcomp.  If you have 1.5
1707
 
   installed, it then remakes the plugins/Makefile as a 1.5 version, which
1708
 
   fails.
1709
 
</p>
1710
 
<p>
1711
 
   The problem should be trapped and worked around, however, so report the
1712
 
   problem to the list.
1713
 
</p>
1714
 
<br>
1715
 
<p>
1716
 
<b>Q.</b>&nbsp;
1717
 
 Why is the .deps problem mostly happening under FreeBSD?
1718
 
</p>
1719
 
<p>
1720
 
<b>A.</b>&nbsp;
1721
 
 Because the FreeBSD ports tree only has 1.5, but that's a FreeBSD ports
1722
 
   problem, not ntop's.  If you search the FreeBSD lists on Google, there's lots
1723
 
   of traffic about a 1.6 version for FreeBSD, but it doesn't seem to be in the
1724
 
   tree.  What's there is:
1725
 
</p>
1726
 
 
1727
 
<pre>
1728
 
     ./devel/automake
1729
 
        -- which is 1.5
1730
 
     ./devel/automake14
1731
 
     ./devel/automake17
1732
 
        -- which does NOT work
1733
 
</pre>
1734
 
<br>
1735
 
<p>
1736
 
<b>Q.</b>&nbsp;
1737
 
 So how do I work around the problem?
1738
 
</p>
1739
 
<p>
1740
 
<b>A.</b>&nbsp;
1741
 
 Install 1.6.3. It's quite easy, does NOT require root. The steps are listed
1742
 
   in the ./configure message, repeated below:
1743
 
</p>
1744
 
 
1745
 
<pre>
1746
 
      Download automake 1.6.3 from gnu
1747
 
          $ wget http://ftp.gnu.org/gnu/automake/automake-1.6.3.tar.gz
1748
 
</pre>
1749
 
 
1750
 
<pre>
1751
 
      Untar it
1752
 
          $ tar xfvz automake-1.6.3.tar.gz
1753
 
</pre>
1754
 
 
1755
 
<pre>
1756
 
      Make it
1757
 
          $ cd automake-1.6.3
1758
 
          $ ./configure --prefix=/home/<whatever>/automake163
1759
 
          $ make
1760
 
          $ make install
1761
 
</pre>
1762
 
 
1763
 
<pre>
1764
 
      Add it to your path (this is bash, but other shells, can do it too)
1765
 
</pre>
1766
 
 
1767
 
<pre>
1768
 
          $ PATH=/home/<whatever>automake163/bin:$PATH
1769
 
          $ export PATH
1770
 
</pre>
1771
 
 
1772
 
<pre>
1773
 
      And then untar, ./configure and make ntop.
1774
 
</pre>
1775
 
<br>
1776
 
<p>
1777
 
<b>Q.</b>&nbsp;
1778
 
 Make fails with a message like this:
1779
 
</p>
 
1275
<p><b>Q.</b>&nbsp; Make fails with a message about being unable to create a .deps file.</p>
 
1276
<p><b>A.</b>&nbsp; Check the permissions on the (hidden) .deps (and .libs) directories - if root   owns them your non-root userid may not be able to create files in there.
 
1277
</p>
 
1278
<br>
 
1279
<p><b>Q.</b>&nbsp; Make fails with a message like this:</p>
1780
1280
<pre>
1781
1281
     /bin/ld: Warning: size of symbol `pcap_open_dead' changed from 100 to 67
1782
1282
         in pcap.o
1787
1287
     make[1]: Leaving directory `/linuxadmin/ntop/ntop2.2.3/ntop-2.2.3'
1788
1288
     make: *** [all] Error 2
1789
1289
</pre>
1790
 
<p>
1791
 
<b>A.</b>&nbsp;
1792
 
 Ah yes, size of symbol...changed. It means you have a conflict between
1793
 
   the version of the shared library (be it libpcap, libgd, whatever) that
 
1290
<p><b>A.</b>&nbsp; Ah yes, size of symbol...changed. It means you have a conflict between   the version of the shared library (be it libpcap, libgd, whatever) that
1794
1291
   was used to compile ntop with the version that was used to link ntop.
1795
1292
</p>
1796
1293
<br>
1797
 
<p>
1798
 
<b>Q.</b>&nbsp;
1799
 
 'splain please...
1800
 
</p>
1801
 
<p>
1802
 
<b>A.</b>&nbsp;
1803
 
 If you break down a typical link line:
1804
 
</p>
 
1294
<p><b>Q.</b>&nbsp; 'splain please...</p>
 
1295
<p><b>A.</b>&nbsp; If you break down a typical link line:</p>
1805
1296
 
1806
1297
<pre>
1807
1298
      gcc -shared  address.lo ... ntop_darwin.lo
1814
1305
          -Wl,-soname -Wl,libntop-2.2.3.so
1815
1306
          -o .libs/libntop-2.2.3.so
1816
1307
</pre>
1817
 
<p>
1818
 
   You see the mix of -L and -l parameters.  The -L parameters ADD 
 
1308
<p>   You see the mix of -L and -l parameters.  The -L parameters ADD 
1819
1309
   additional places to look for the shared libraries, which are in 
1820
1310
   addition to the 'standard locations' for the system.  The -l
1821
1311
   parameters tell which libraries to include.
1822
1312
</p>
1823
 
<p>
1824
 
   Read the man pages (man ld, man ld.so, etc.)
 
1313
<p>   Read the man pages (man ld, man ld.so, etc.)
1825
1314
</p>
1826
 
<p>
1827
 
   The 'standard locations' are very system dependent, but usually
 
1315
<p>   The 'standard locations' are very system dependent, but usually
1828
1316
   include /usr/lib and /lib.  PLUS whatever is (under Linux) in the
1829
1317
   ld.so.conf file, for example
1830
1318
</p>
1836
1324
      /usr/lib/qt-3.0.5/lib
1837
1325
      /usr/local/lib
1838
1326
</pre>
1839
 
<p>
1840
 
   So, on this system, to resolve a library, ld looks in the -L values:
 
1327
<p>   So, on this system, to resolve a library, ld looks in the -L values:
1841
1328
</p>
1842
1329
 
1843
1330
<pre>
1858
1345
      8. /lib
1859
1346
      9. /usr/lib
1860
1347
</pre>
1861
 
<p>
1862
 
   Similarly, if you break apart the gcc COMPILE line and scrap the dups,
 
1348
<p>   Similarly, if you break apart the gcc COMPILE line and scrap the dups,
1863
1349
   you'll have a different set of places where gcc looks for the .h files.
1864
1350
   For those, it's the -I parameters plus whatever is 'standard' on your
1865
1351
   system, which is dependent on the specific gcc port:
1866
1352
</p>
1867
 
<p>
1868
 
   /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H  -DLINUX
 
1353
<p>   /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H  -DLINUX
1869
1354
</p>
1870
1355
<pre>
1871
1356
       -I. -I/linuxadmin/ntop/ntop2.2.3/ntop-2.2.3/myrrd 
1874
1359
      -Wshadow ... -Wnested-externs
1875
1360
       -o ntop_darwin.lo
1876
1361
</pre>
1877
 
<p>
1878
 
   Again, read the gcc man page.
 
1362
<p>   Again, read the gcc man page.
1879
1363
</p>
1880
 
<p>
1881
 
   A big problem is that - unlike .so files, it's not real clear what
 
1364
<p>   A big problem is that - unlike .so files, it's not real clear what
1882
1365
   directories ARE searched for .h files, only that there is a set.
1883
1366
</p>
1884
 
<p>
1885
 
   With me so far?  Go back to the message... what it means is that:
 
1367
<p>   With me so far?  Go back to the message... what it means is that:
1886
1368
</p>
1887
1369
 
1888
1370
<pre>
1891
1373
      * From the other set of locations, at link (ld) time, the
1892
1374
        library expects the parameter list to be of size 67.
1893
1375
</pre>
1894
 
<p>
1895
 
   Danger, Will Robinson...
 
1376
<p>   Danger, Will Robinson...
1896
1377
</p>
1897
 
<p>
1898
 
   The most likely cause of this problem is when you tell ntop to look at
 
1378
<p>   The most likely cause of this problem is when you tell ntop to look at
1899
1379
   one location to resolve either the .h or .so and it finds the other,
1900
1380
   'automatically' in a 'standard' location, but the two are actually from
1901
1381
   incompatible versions.
1902
1382
</p>
1903
 
<p>
1904
 
   Say you have libpcap 0.6.2 installed by the os in /usr/lib and 
 
1383
<p>   Say you have libpcap 0.6.2 installed by the os in /usr/lib and 
1905
1384
   /usr/include, but you also install libpcap 0.7.2 in /usr/local/lib and 
1906
1385
   /usr/local/include.
1907
1386
</p>
1911
1390
      /usr/include/pcap.h
1912
1391
      /usr/local/include/pcap.h
1913
1392
</pre>
1914
 
<p>
1915
 
   and
 
1393
<p>   and
1916
1394
</p>
1917
1395
 
1918
1396
<pre>
1926
1404
      /usr/local/lib/libpcap.so.0.7.2
1927
1405
      /usr/local/lib/libpcap.so.0.7
1928
1406
</pre>
1929
 
<p>
1930
 
   If all you give ./configure is --with-pcap-header=/usr/local/lib
 
1407
<p>   If all you give ./configure is --with-pcap-header=/usr/local/lib
1931
1408
</p>
1932
1409
 
1933
1410
<pre>
1935
1412
      * At link time, it finds the libpcap.so in the 'default', 
1936
1413
        /usr/lib/libpcap.so which is actually libpcap.so.0.6.2
1937
1414
</pre>
1938
 
<p>
1939
 
   ntop did EXACTLY what you told it to do.  The fact that it makes no
 
1415
<p>   ntop did EXACTLY what you told it to do.  The fact that it makes no
1940
1416
   sense is a problem, so you get the error message.
1941
1417
</p>
1942
1418
<br>
1943
 
<p>
1944
 
<b>Q.</b>&nbsp;
1945
 
 So the real solution is?
1946
 
</p>
1947
 
<p>
1948
 
<b>A.</b>&nbsp;
1949
 
 Give ntop pointers to consistent sets of header and library files, and maybe
1950
 
   don't have multiple versions of the same library installed at once.
1951
 
</p>
1952
 
<br>
1953
 
<p>
1954
 
<b>Q.</b>&nbsp;
1955
 
 I'm done compiling and it works/doesn't work, what do I do?
1956
 
</p>
1957
 
<p>
1958
 
<b>A.</b>&nbsp;
1959
 
 make install (You'll typically need to be root for this to work)
1960
 
</p>
1961
 
<br>
1962
 
<p>
1963
 
<b>Q.</b>&nbsp;
1964
 
 Anything else?
1965
 
</p>
1966
 
<p>
1967
 
<b>A.</b>&nbsp;
1968
 
 Yes. Run the "census" - this will send us an email telling us what's
1969
 
   working and what's not working.  The census sends me the basics - uname 
1970
 
   information, autotool versions, version.c.  The domain name is blinded, 
1971
 
   and the script will show you the file before it's sent (you'll have 10 
1972
 
   seconds to press control-c to abort).
1973
 
</p>
1974
 
<p>
1975
 
   If things work ok, then send the census information via
1976
 
</p>
1977
 
 
1978
 
<pre>
1979
 
    make census-ok
1980
 
</pre>
1981
 
<p>
1982
 
   If you have problems, the create the census information via
1983
 
</p>
1984
 
 
1985
 
<pre>
1986
 
    make census-fail
1987
 
</pre>
1988
 
<p>
1989
 
   Edit it to describe the problem and send it to census@ntopsupport.com
1990
 
</p>
1991
 
<br>
1992
 
<p>
1993
 
<b>Q.</b>&nbsp;
1994
 
 I'm seeing a lot of "changing search order for system directory" messages?
1995
 
</p>
1996
 
<p>
1997
 
<b>A.</b>&nbsp;
1998
 
 It's not a problem, just confusing. This warning, which appears if you
1999
 
   redefine the system include directory, causes lots of confusion.  Supposedly,
 
1419
<p><b>Q.</b>&nbsp; So the real solution is?</p>
 
1420
<p><b>A.</b>&nbsp; Give ntop pointers to consistent sets of header and library files, and maybe   don't have multiple versions of the same library installed at once.
 
1421
</p>
 
1422
<br>
 
1423
<p><b>Q.</b>&nbsp; I'm done compiling and it works/doesn't work, what do I do?</p>
 
1424
<p><b>A.</b>&nbsp; make install (You'll typically need to be root for this to work)</p>
 
1425
<br>
 
1426
<p><b>Q.</b>&nbsp; I'm seeing a lot of "changing search order for system directory" messages?</p>
 
1427
<p><b>A.</b>&nbsp; It's not a problem, just confusing. This warning, which appears if you   redefine the system include directory, causes lots of confusion.  Supposedly,
2000
1428
   according to this http://gcc.gnu.org/ml/gcc-bugs/2002-10/msg01080.html,
2001
1429
   it wasn't fixed in gcc 3.2.0, but should be fixed in gcc 3.2.1.
2002
1430
</p>
2003
 
<p>
2004
 
   According to this: http://gcc.gnu.org/onlinedocs/cpp/Invocation.html,
 
1431
<p>   According to this: http://gcc.gnu.org/onlinedocs/cpp/Invocation.html,
2005
1432
   it's truly harmless on systems which already have /usr/local/include as
2006
1433
   a standard system library:
2007
1434
</p>
2017
1444
</pre>
2018
1445
<h2>Other ./configure features</h2>
2019
1446
<br>
2020
 
<p>
2021
 
<b>Q.</b>&nbsp;
2022
 
 How do I update the Vendor Table (MAC address prefixes)?
2023
 
</p>
2024
 
<p>
2025
 
<b>A.</b>&nbsp;
2026
 
 ntop has (in Makefile), a rule to automatically download the latest vendor
2027
 
   information table from the IEEE, the oui.txt file ntop reads.
2028
 
</p>
2029
 
<p>
2030
 
   If you are seeing unknown MAC address prefixes (the 1st three units), try
 
1447
<p><b>Q.</b>&nbsp; How do I update the Vendor Table (MAC address prefixes)?</p>
 
1448
<p><b>A.</b>&nbsp; ntop has (in Makefile), a rule to automatically download the latest vendor   information table from the IEEE, the oui.txt file ntop reads.
 
1449
</p>
 
1450
<p>   If you are seeing unknown MAC address prefixes (the 1st three units), try
2031
1451
   the full IEEE table.  To rebuild it:
2032
1452
</p>
2033
1453
 
2034
1454
<pre>
2035
1455
     # make dnvt
2036
1456
</pre>
2037
 
<p>
2038
 
   and then copy the new oui.txt over the one installed by ntop originally.
 
1457
<p>   and then copy the new oui.txt over the one installed by ntop originally.
2039
1458
</p>
2040
 
<p>
2041
 
   Also note that the table changes over time - there are almost 600
 
1459
<p>   Also note that the table changes over time - there are almost 600
2042
1460
   Modifications and/or new assignments between the version shipped with
2043
1461
   ntop 2.0 and the version on the IEEE site in February 2002.
2044
1462
</p>
2045
1463
<br>
2046
 
<p>
2047
 
<b>Q.</b>&nbsp;
2048
 
 How do I update the passive ethernet fingerprint database?
2049
 
</p>
2050
 
<p>
2051
 
<b>A.</b>&nbsp;
2052
 
 ntop has (in Makefile), a rule to automatically download the latest
2053
 
   ettercap file from SourceForge:
 
1464
<p><b>Q.</b>&nbsp; How do I update the passive ethernet fingerprint database?</p>
 
1465
<p><b>A.</b>&nbsp; ntop has (in Makefile), a rule to automatically download the latest   ettercap file from SourceForge:
2054
1466
</p>
2055
1467
 
2056
1468
<pre>
2057
1469
     # make dnetter
2058
1470
</pre>
2059
 
<p>
2060
 
   It will also compress the file and tell you how big the old and new files
 
1471
<p>   It will also compress the file and tell you how big the old and new files
2061
1472
   were.
2062
1473
</p>
2063
1474
<br>
2064
 
<p>
2065
 
<b>Q.</b>&nbsp;
2066
 
 How do I update the IP to Country Code table?
2067
 
</p>
2068
 
<p>
2069
 
<b>A.</b>&nbsp;
2070
 
 Again, ntop has (in Makefile), a rule to automatically download the
2071
 
   latest data and build the file.
 
1475
<p><b>Q.</b>&nbsp; How do I update the IP to Country Code table?</p>
 
1476
<p><b>A.</b>&nbsp; Again, ntop has (in Makefile), a rule to automatically download the   latest data and build the file.
2072
1477
</p>
2073
1478
 
2074
1479
<pre>
2075
1480
     # make p2c
2076
1481
</pre>
2077
 
<p>
2078
 
   Note that this is actually a fairly complex script (utils/p2c) and is
 
1482
<p>   Note that this is actually a fairly complex script (utils/p2c) and is
2079
1483
   dependent upon data posted to supposedly well known locations by the various
2080
1484
   internet number authorities (APNIC, RIPE, etc.)
2081
1485
</p>
2082
 
<p>
2083
 
   It's a LOT of data to download so don't do this on a site with a slow
 
1486
<p>   It's a LOT of data to download so don't do this on a site with a slow
2084
1487
   link to the internet.  Also, read the output carefully and DO NOT apply a
2085
1488
   file if there are messages you don't understand.
2086
1489
</p>
2087
1490
<br>
2088
 
<p>
2089
 
<b>Q.</b>&nbsp;
2090
 
 But the IP -> CC data is wrong.
2091
 
</p>
2092
 
<p>
2093
 
<b>A.</b>&nbsp;
2094
 
 Yeah. Most people don't care :-(... it's enough to see various pretty
2095
 
   flags.
2096
 
</p>
2097
 
<p>
2098
 
   Sadly, the registries often post files with errors in them.  Some Tier
 
1491
<p><b>Q.</b>&nbsp; But the IP -> CC data is wrong.</p>
 
1492
<p><b>A.</b>&nbsp; Yeah. Most people don't care :-(... it's enough to see various pretty   flags.
 
1493
</p>
 
1494
<p>   Sadly, the registries often post files with errors in them.  Some Tier
2099
1495
   1 ISPs post their own data to elaborate on the registry data.  Most ISPs
2100
1496
   don't post data.  Some entries in the files make 'logical' sense, but not
2101
1497
   physical sense.
2102
1498
</p>
2103
 
<p>
2104
 
   If you find another set of data, let us know - the shell script is pretty
 
1499
<p>   If you find another set of data, let us know - the shell script is pretty
2105
1500
   easy to follow to add another data source.
2106
1501
</p>
2107
 
<p>
2108
 
   The user who used to care about this (Mr. Anon E. Mouse) used to send me
 
1502
<p>   The user who used to care about this (Mr. Anon E. Mouse) used to send me
2109
1503
   a file of corrections to apply to the file we posted with ntop.
2110
1504
</p>
2111
 
<p>
2112
 
   If such a file exists, it would be posted @ SourceForge in the user
 
1505
<p>   If such a file exists, it would be posted @ SourceForge in the user
2113
1506
   contributed area.
2114
1507
</p>
 
1508
<br>
 
1509
<p><b>Q.</b>&nbsp; I have installed ntop for OSX but I cannot start it as I have installed   some libraries using fink and ntop cannot find them.
 
1510
</p>
 
1511
<p><b>A.</b>&nbsp; The easiest thing to do is to do: ln -s /sw/lib/myfinklibrary /usr/local/lib   Courtesy of Matthew Scholz <matts@discovery.org>
 
1512
</p>
2115
1513
<h2>Running - Startup</h2>
2116
1514
<br>
2117
 
<p>
2118
 
<b>Q.</b>&nbsp;
2119
 
 ntop won't start - I get this message:
2120
 
</p>
 
1515
<p><b>Q.</b>&nbsp; ntop won't start - I get this message:</p>
2121
1516
<pre>
2122
1517
  ** FATAL ERROR** ... open of /var/ntop/addressQueue.db failed:
2123
1518
       File open error
2124
1519
</pre>
2125
 
<p>
2126
 
<b>A.</b>&nbsp;
2127
 
 It's either permissions (the ntop -u userid doesn't have read/write access
2128
 
   to that file - common if you're upgrading from 2.2 to 3.0).
 
1520
<p><b>A.</b>&nbsp; It's either permissions (the ntop -u userid doesn't have read/write access   to that file - common if you're upgrading from 2.2 to 3.0).
2129
1521
</p>
2130
 
<p>
2131
 
   The other cause is that there's still an instance of ntop running. Make
 
1522
<p>   The other cause is that there's still an instance of ntop running. Make
2132
1523
   sure you shutdown ntop before starting it.
2133
1524
</p>
2134
1525
<br>
2135
 
<p>
2136
 
<b>Q.</b>&nbsp;
2137
 
 What is the function of the 'ntop' script in the build directory - should I
2138
 
   call it or /usr/local/bin/ntop ?
2139
 
</p>
2140
 
<p>
2141
 
<b>A.</b>&nbsp;
2142
 
 (from the comments in the script):
2143
 
</p>
 
1526
<p><b>Q.</b>&nbsp; What is the function of the 'ntop' script in the build directory - should I   call it or /usr/local/bin/ntop ?
 
1527
</p>
 
1528
<p><b>A.</b>&nbsp; (from the comments in the script):</p>
2144
1529
 
2145
1530
<pre>
2146
1531
    # ntop - temporary wrapper script for .libs/ntop
2152
1537
    # This wrapper script should never be moved out of the build directory.
2153
1538
    # If it is, it will not operate correctly.
2154
1539
</pre>
2155
 
<p>
2156
 
   It allows you to run ntop out of the build directory before doing a "make
 
1540
<p>   It allows you to run ntop out of the build directory before doing a "make
2157
1541
   install" by doing all the necessary linkage magic - such as forcing a relink
2158
1542
   if it didn't succeed originally - to the files in .libs.
2159
1543
</p>
2160
 
<p>
2161
 
   Think of it as simulating make install, but not moving stuff to /usr/local
 
1544
<p>   Think of it as simulating make install, but not moving stuff to /usr/local
2162
1545
   or wherever.
2163
1546
</p>
2164
 
<p>
2165
 
   Don't use it - it just causes problems...
 
1547
<p>   Don't use it - it just causes problems...
2166
1548
</p>
2167
1549
<br>
2168
 
<p>
2169
 
<b>Q.</b>&nbsp;
2170
 
 Which libraries do I need?
2171
 
</p>
2172
 
<p>
2173
 
<b>A.</b>&nbsp;
2174
 
 To run ntop: glibc, gdbm, libpcap
2175
 
</p>
 
1550
<p><b>Q.</b>&nbsp; Which libraries do I need?</p>
 
1551
<p><b>A.</b>&nbsp; To run ntop: glibc, gdbm, libpcap</p>
2176
1552
<pre>
2177
1553
      For https://, add openssl.
2178
1554
      For other tools and compile options, add the appropriate libraries.
2179
1555
</pre>
2180
1556
<br>
2181
 
<p>
2182
 
<b>Q.</b>&nbsp;
2183
 
 ntop seems to run, but the web server isn't up.
2184
 
</p>
2185
 
<p>
2186
 
<b>A.</b>&nbsp;
2187
 
 Set the password - see docs/1STRUN.TXT
2188
 
</p>
2189
 
<br>
2190
 
<p>
2191
 
<b>Q.</b>&nbsp;
2192
 
 How do you reset Admin password if we lost it?
2193
 
</p>
2194
 
<p>
2195
 
<b>A.</b>&nbsp;
2196
 
 Delete ntop_pw.db and follow the procedure in docs/1STRUN.txt
2197
 
</p>
2198
 
<br>
2199
 
<p>
2200
 
<b>Q.</b>&nbsp;
2201
 
 I'm being prompted to set a password, what do I enter.
2202
 
</p>
2203
 
<p>
2204
 
<b>A.</b>&nbsp;
2205
 
 Anything you want, of 5 or more characters. If ntop can't find the value
2206
 
   in it's database, it will prompt you to set on.  If this happens every
 
1557
<p><b>Q.</b>&nbsp; ntop seems to run, but the web server isn't up.</p>
 
1558
<p><b>A.</b>&nbsp; Set the password - see docs/1STRUN.TXT</p>
 
1559
<br>
 
1560
<p><b>Q.</b>&nbsp; How do you reset Admin password if we lost it?</p>
 
1561
<p><b>A.</b>&nbsp; Delete ntop_pw.db and follow the procedure in docs/1STRUN.txt</p>
 
1562
<br>
 
1563
<p><b>Q.</b>&nbsp; I'm being prompted to set a password, what do I enter.</p>
 
1564
<p><b>A.</b>&nbsp; Anything you want, of 5 or more characters. If ntop can't find the value   in it's database, it will prompt you to set on.  If this happens every
2207
1565
   time you start ntop, check the permissions on the ntop_pw.db file.
2208
1566
</p>
2209
1567
<br>
2210
 
<p>
2211
 
<b>Q.</b>&nbsp;
2212
 
 How does the @filename option work e.g. /usr/bin/ntop ... @filename ...
2213
 
</p>
2214
 
<p>
2215
 
<b>A.</b>&nbsp;
2216
 
 The text of 'filename', is copied - ignoring line breaks and
2217
 
   comments (anything following a #) - into the command line.
2218
 
</p>
2219
 
<p>
2220
 
   ntop behaves as if all of the text had simply been typed directly 
 
1568
<p><b>Q.</b>&nbsp; Characters after the 8th are being ignored in my password.</p>
 
1569
<p><b>A.</b>&nbsp; Probably. ntop uses the standard crypt() function provided by the OS.</p>
 
1570
<p>   While crypt() is required part of the single unix specification, the 
 
1571
   details are implementation dependent.  Whatever the limitations of crypt() 
 
1572
   are, that what ntop's limits are.  
 
1573
</p>
 
1574
<p>   Unfortunately, there's no way to tell programatically what these limits are, 
 
1575
   you have to refer to the man page for crypt(3).
 
1576
</p>
 
1577
<p>   There is a "GNU EXTENSION" to crypt() which implies that changing the 'salt'
 
1578
   ntop uses would allow longer passwords.  That's set via CONST_CRYPT_SALT in 
 
1579
   globals-defines.h, but AFAIK this hasn't been tested.
 
1580
</p>
 
1581
<br>
 
1582
<p><b>Q.</b>&nbsp; How does the @filename option work e.g. /usr/bin/ntop ... @filename ...</p>
 
1583
<p><b>A.</b>&nbsp; The text of 'filename', is copied - ignoring line breaks and   comments (anything following a #) - into the command line.
 
1584
</p>
 
1585
<p>   ntop behaves as if all of the text had simply been typed directly 
2221
1586
   on the command line.  Multiple @s are permitted in the command
2222
1587
   line, nesting is not.  @s in the file will cause an error.
2223
1588
</p>
2224
 
<p>
2225
 
   Both are displayed on the info.html report, the "Started as"
 
1589
<p>   Both are displayed on the info.html report, the "Started as"
2226
1590
   shows the actual command line ntop was given and the 
2227
1591
   "Resolved to" shows what ntop processed.
2228
1592
</p>
2229
 
<p>
2230
 
   Started as /usr/bin/ntop -i eth0,eth1 @/root/ntop_parms -d -L
 
1593
<p>   Started as /usr/bin/ntop -i eth0,eth1 @/root/ntop_parms -d -L
2231
1594
</p>
2232
 
<p>
2233
 
   with /root/ntop_parms containing:
 
1595
<p>   with /root/ntop_parms containing:
2234
1596
</p>
2235
1597
 
2236
1598
<pre>
2244
1606
      -E
2245
1607
      -K
2246
1608
</pre>
2247
 
<p>
2248
 
   becomes:
 
1609
<p>   becomes:
2249
1610
</p>
2250
 
<p>
2251
 
   Resolved to /usr/bin/ntop -i eth0,eth1 -p /usr/share/ntop/protocol.list
 
1611
<p>   Resolved to /usr/bin/ntop -i eth0,eth1 -p /usr/share/ntop/protocol.list
2252
1612
</p>
2253
1613
<pre>
2254
1614
               -P /usr/share/ntop -w 192.168.42.38 -u ntop --trace-level 3
2255
1615
               -m 12.239.0.0/16,10.113.0.0/16 -E -K -d -L
2256
1616
</pre>
2257
 
<p>
2258
 
   Remember, most ntop options are "sticky", that is they just set an
 
1617
<p>   Remember, most ntop options are "sticky", that is they just set an
2259
1618
   internal flag. Invoking them multiple times doesn't change ntop's
2260
1619
   behavior. However, options that set a value, such as --trace-level,
2261
1620
   will use the LAST value given: --trace-level 2 --trace-level 3 will
2262
1621
   run as --trace-level 3.
2263
1622
</p>
2264
 
<p>
2265
 
   It is recommended that you use FULL pathnames for @filename, since
 
1623
<p>   It is recommended that you use FULL pathnames for @filename, since
2266
1624
   ntop may have different effective directories when run in different
2267
1625
   ways.  However, you may wish to use relative pathnames to take
2268
1626
   advantage of the different effective directories (say cron vs.
2269
1627
   command line).  Just know where you're starting.
2270
1628
</p>
2271
1629
<br>
2272
 
<p>
2273
 
<b>Q.</b>&nbsp;
2274
 
 ntop seems to run but I don't see any traffic.
2275
 
</p>
2276
 
<p>
2277
 
<b>A.</b>&nbsp;
2278
 
 Make sure you aren't running against the loopback (127.0.0.1) interface.
2279
 
   lo shouldn't see much traffic, only that originating on the host destined
 
1630
<p><b>Q.</b>&nbsp; ntop seems to run but I don't see any traffic.</p>
 
1631
<p><b>A.</b>&nbsp; Make sure you aren't running against the loopback (127.0.0.1) interface.   lo shouldn't see much traffic, only that originating on the host destined
2280
1632
   for it (e.g. ping 127.0.0.1).
2281
1633
</p>
2282
1634
<br>
2283
 
<p>
2284
 
<b>Q.</b>&nbsp;
2285
 
 ntop is unable to open its database file. Specifically:
2286
 
   I have following messages while running ntop
 
1635
<p><b>Q.</b>&nbsp; ntop is unable to open its database file. Specifically:   I have following messages while running ntop
2287
1636
</p>
2288
1637
 
2289
1638
<pre>
2291
1640
     24/Jul/2003 15:15:23 Initializing IP services...
2292
1641
     <snip />
2293
1642
     24/Jul/2003 15:15:23 Initializing GDBM...
2294
 
     24/Jul/2003 15:15:23 Database '/var/ntop/addressCache.db' open failed: File
2295
 
         open error
 
1643
     24/Jul/2003 15:15:23  ***FATAL_ERROR*** open of ...name... failed: can't be writer
2296
1644
     24/Jul/2003 15:15:23 Possible solution: please use '-P <directory>'
2297
1645
</pre>
2298
 
<p>
2299
 
<b>A.</b>&nbsp;
2300
 
 Multiple possible choices...
2301
 
</p>
2302
 
<pre>
2303
 
    1. The directory /var/ntop doesn't exist.  Create it or, as the message
2304
 
       says, use the -P parameter to point ntop at another directory.
2305
 
    2. You many not have read/write rights in /var/ntop - if you're running in
2306
 
       non-promiscuous mode from a user other than root.
2307
 
    3. Another instance of ntop may already be running, so it has the file open
2308
 
       and locked.
2309
 
</pre>
 
1646
<p><b>A.</b>&nbsp; Multiple possible choices...</p>
 
1647
<p>   * Another ntop already running
 
1648
</p>
 
1649
<p>   (Most common) You forgot the -P parameter, and ntop is using a default value that
 
1650
   doesn't exist.  Just as the message says, use the -P parameter to point ntop at 
 
1651
   the directory you want it to use.
 
1652
</p>
 
1653
<p>   * Some sort of file system problem (non-existent directory, permissions, etc.)
 
1654
</p>
 
1655
<p>   1. The directory shown doesn't exist.  Create it.
 
1656
</p>
 
1657
<p>   2. You many not have read/write rights in that directory.
 
1658
   This can occur if you run ntop both as root and (as recommended) as a non-root user.
 
1659
</p>
 
1660
<p>   3. Another instance of ntop may already be running, so it has the file open and locked.
 
1661
</p>
2310
1662
<br>
2311
 
<p>
2312
 
<b>Q.</b>&nbsp;
2313
 
 What's inside the .db files and what's their format?
2314
 
</p>
2315
 
<p>
2316
 
<b>A.</b>&nbsp;
2317
 
 The files are stored in GDBM format. You can dump their content using tools like
2318
 
   this: http://tboudet.free.fr/dumpgdbm/. In principle you should not be
 
1663
<p><b>Q.</b>&nbsp; What's inside the .db files and what's their format?</p>
 
1664
<p><b>A.</b>&nbsp; The files are stored in GDBM format. You can dump their content using tools like   this: http://tboudet.free.fr/dumpgdbm/. In principle you should not be
2319
1665
   interested in the file content as they are temporary caches and contain the
2320
1666
   configuration as well as the MD5 hash of the web passwords.
2321
1667
</p>
2322
 
<p>
2323
 
   I posted a trivial dumpgdbm.c to gmane - search for it.
 
1668
<p>   I posted a trivial dumpgdbm.c to gmane - search for it.
2324
1669
</p>
2325
1670
<br>
2326
 
<p>
2327
 
<b>Q.</b>&nbsp;
2328
 
 ntop starts up with this:
2329
 
   WARNING: Discarded network 172.20.0.0/16: this is the local network.
 
1671
<p><b>Q.</b>&nbsp; ntop starts up with this:   WARNING: Discarded network 172.20.0.0/16: this is the local network.
2330
1672
</p>
2331
 
<p>
2332
 
<b>A.</b>&nbsp;
2333
 
 No worries. The message means exactly what it says - it's a warning that
2334
 
   you gave the local network as one of the parameter(s) to -m.  Since the
 
1673
<p><b>A.</b>&nbsp; No worries. The message means exactly what it says - it's a warning that   you gave the local network as one of the parameter(s) to -m.  Since the
2335
1674
   local networks are always local, ntop doesn't need to make them pseudo-local.
2336
1675
</p>
2337
1676
<br>
2338
 
<p>
2339
 
<b>Q.</b>&nbsp;
2340
 
 What are ntop's options?
2341
 
</p>
2342
 
<p>
2343
 
<b>A.</b>&nbsp;
2344
 
 There are a couple of options that appear only if they're not compiled in,
2345
 
   and a few that depend on various external libraries, e.g. openSSL.
2346
 
</p>
2347
 
<p>
2348
 
   The best way to see what is actually available is to run ntop with the -h or
 
1677
<p><b>Q.</b>&nbsp; What are ntop's options?</p>
 
1678
<p><b>A.</b>&nbsp; There are a couple of options that appear only if they're not compiled in,   and a few that depend on various external libraries, e.g. openSSL.
 
1679
</p>
 
1680
<p>   The best way to see what is actually available is to run ntop with the -h or
2349
1681
   --help options and see.   Also read man ntop.
2350
1682
</p>
2351
 
<p>
2352
 
   Here is the FULL set of real, working options as of February 2004
2353
 
</p>
2354
 
 
2355
 
<pre>
2356
 
    -4             | --ipv4
2357
 
                             Use IPv4 connections (for the ntop web server)
2358
 
    -6             | --ipv6
2359
 
                             Use IPv6 connections (for the ntop web server)
2360
 
</pre>
2361
 
 
2362
 
<pre>
2363
 
    -a <file>      | --access-log-file <file>
2364
 
                             File for ntop web server access log
2365
 
</pre>
2366
 
 
2367
 
<pre>
2368
 
    -b             | --disable-decoders
2369
 
                             Disable protocol decoders
2370
 
</pre>
2371
 
 
2372
 
<pre>
2373
 
    -c             | --sticky-hosts
2374
 
                             Idle hosts are not purged from memory
2375
 
</pre>
2376
 
 
2377
 
<pre>
2378
 
    -d             | --daemon
2379
 
                             Run ntop in daemon mode
2380
 
</pre>
2381
 
 
2382
 
<pre>
2383
 
    -e <number>    | --max-table-rows <number>
2384
 
                             Maximum number of table rows to report
2385
 
</pre>
2386
 
 
2387
 
<pre>
2388
 
    -f <file>      | --traffic-dump-file <file>
2389
 
                             Traffic dump file (see tcpdump)
2390
 
</pre>
2391
 
 
2392
 
<pre>
2393
 
    -g             | --track-local-hosts
2394
 
                             Track only local hosts
2395
 
</pre>
2396
 
 
2397
 
<pre>
2398
 
    -h             | --help
2399
 
                             Display help and exit
2400
 
</pre>
2401
 
 
2402
 
<pre>
2403
 
    -i <name>      | --interface <name>
2404
 
                             Interface name or names to monitor
2405
 
</pre>
2406
 
 
2407
 
<pre>
2408
 
    -j             | --create-other-packets
2409
 
                             Create file ntop-other-pkts.XXX.pcap file
2410
 
</pre>
2411
 
 
2412
 
<pre>
2413
 
    -o             | --no-mac
2414
 
                             ntop will trust just IP addresses (no MACs)
2415
 
</pre>
2416
 
 
2417
 
<pre>
2418
 
    -k             | --filter-expression-in-extra-frame
2419
 
                             Show kernel filter expression in extra frame
2420
 
</pre>
2421
 
 
2422
 
<pre>
2423
 
    -l <path>      | --pcap-log <path>
2424
 
                             Dump packets captured to a file (debug only!)
2425
 
</pre>
2426
 
 
2427
 
<pre>
2428
 
    -m <addresses> | --local-subnets <addresses>
2429
 
                             Local subnetwork(s) (see man page)
2430
 
</pre>
2431
 
 
2432
 
<pre>
2433
 
    -n             | --numeric-ip-addresses
2434
 
                             Numeric IP addresses - no DNS resolution
2435
 
</pre>
2436
 
 
2437
 
<pre>
2438
 
    -p <list>      | --protocols <list>
2439
 
                             List of IP protocols to monitor (see man page)
2440
 
</pre>
2441
 
 
2442
 
<pre>
2443
 
    -q             | --create-suspicious-packets
2444
 
                             Create file ntop-suspicious-pkts.XXX.pcap file
2445
 
</pre>
2446
 
 
2447
 
<pre>
2448
 
    -r <number>    | --refresh-time <number>
2449
 
                             Refresh time in seconds, default is 120
2450
 
</pre>
2451
 
 
2452
 
<pre>
2453
 
    -s             | --no-promiscuous
2454
 
                             Disable promiscuous mode
2455
 
</pre>
2456
 
 
2457
 
<pre>
2458
 
    -t <number>    | --trace-level <number>
2459
 
                             Trace level 0-6
2460
 
</pre>
2461
 
 
2462
 
<pre>
2463
 
    -u <user>      | --user <user>
2464
 
                             Userid/name to run ntop under (see man page)
2465
 
</pre>
2466
 
 
2467
 
<pre>
2468
 
    -x <max num hash entries>
2469
 
                             Max num. hash entries ntop can handle (default 4294967295)
2470
 
</pre>
2471
 
 
2472
 
<pre>
2473
 
    -w <port>      | --http-server <port>
2474
 
                             Web server (http:) port (or address:port) to listen on
2475
 
</pre>
2476
 
 
2477
 
<pre>
2478
 
    -z             | --disable-sessions
2479
 
                             Disable TCP session tracking
2480
 
</pre>
2481
 
 
2482
 
<pre>
2483
 
    -A
2484
 
                             Ask admin user password and exit
2485
 
</pre>
2486
 
 
2487
 
<pre>
2488
 
    --set-admin-password=<pass>
2489
 
                             Set password for the admin user to <pass>
2490
 
</pre>
2491
 
 
2492
 
<pre>
2493
 
    --w3c
2494
 
                             Add extra headers to make better html
2495
 
</pre>
2496
 
 
2497
 
<pre>
2498
 
    -B <filter>    | --filter-expression
2499
 
                             Packet filter expression, like tcpdump
2500
 
</pre>
2501
 
 
2502
 
<pre>
2503
 
    -D <name>      | --domain <name>
2504
 
                             Internet domain name
2505
 
</pre>
2506
 
 
2507
 
<pre>
2508
 
    -F <spec>      | --flow-spec <specs>
2509
 
                             Flow specs (see man page)
2510
 
</pre>
2511
 
 
2512
 
<pre>
2513
 
    -K             | --enable-debug
2514
 
                             Enable debug mode
2515
 
</pre>
2516
 
 
2517
 
<pre>
2518
 
    -L
2519
 
                             Do logging via syslog
2520
 
</pre>
2521
 
 
2522
 
<pre>
2523
 
    --use-syslog=<facility>
2524
 
                             Do logging via syslog, facility ('=' is REQUIRED)
2525
 
</pre>
2526
 
 
2527
 
<pre>
2528
 
    -M             | --no-interface-merge
2529
 
                             Don't merge network interfaces (see man page)
2530
 
</pre>
2531
 
 
2532
 
<pre>
2533
 
    -N             | --wwn-map
2534
 
                             Map file providing map of WWN to FCID/VSAN
2535
 
</pre>
2536
 
 
2537
 
<pre>
2538
 
    -O <path>      | --pcap-file-path <path>
2539
 
                             Path for log files in pcap format
2540
 
</pre>
2541
 
 
2542
 
<pre>
2543
 
    -P <path>      | --db-file-path <path>
2544
 
                             Path for ntop internal database files
2545
 
</pre>
2546
 
 
2547
 
<pre>
2548
 
    -U <URL>       | --mapper <URL>
2549
 
                             URL (mapper.pl) for displaying host location
2550
 
</pre>
2551
 
 
2552
 
<pre>
2553
 
    -V             | --version
2554
 
                             Output version information and exit
2555
 
</pre>
2556
 
 
2557
 
<pre>
2558
 
    -X <max num TCP sessions>
2559
 
                             Max num. TCP sessions ntop can handle (default 4294967295)
2560
 
</pre>
2561
 
 
2562
 
<pre>
2563
 
    -W <port>      | --https-server <port>
2564
 
                             Web server (https:) port (or address:port) to listen on
2565
 
</pre>
2566
 
 
2567
 
<pre>
2568
 
    --disable-instantsessionpurge
2569
 
                             Disable instant FIN session purge
2570
 
</pre>
2571
 
 
2572
 
<pre>
2573
 
    --disable-mutexextrainfo
2574
 
                             Disable extra mutex info
2575
 
</pre>
2576
 
 
2577
 
<pre>
2578
 
    --disable-schedyield
2579
 
                             Turn off sched_yield() calls, if ntop is deadlocking on them
2580
 
</pre>
2581
 
 
2582
 
<pre>
2583
 
    --disable-stopcap
2584
 
                             Capture packets even if there's no memory left
2585
 
</pre>
2586
 
 
2587
 
<pre>
2588
 
    --fc-only
2589
 
                             Display only Fibre Channel statistics
2590
 
</pre>
2591
 
 
2592
 
<pre>
2593
 
    --no-fc
2594
 
                             Disable processing & Display of Fibre Channel
2595
 
</pre>
2596
 
 
2597
 
<pre>
2598
 
    --no-invalid-lun
2599
 
                             Don't display Invalid LUN information
2600
 
</pre>
2601
 
 
2602
 
<pre>
2603
 
    --p3p-cp
2604
 
                             Set return value for p3p compact policy, header
2605
 
</pre>
2606
 
 
2607
 
<pre>
2608
 
    --p3p-uri
2609
 
                             Set return value for p3p policyref header
2610
 
</pre>
2611
 
 
2612
 
<pre>
2613
 
    --set-pcap-nonblocking
2614
 
                             Call pcap_setnonblock
2615
 
</pre>
2616
 
 
2617
 
<pre>
2618
 
    --skip-version-check
2619
 
                             Skip ntop version check
2620
 
</pre>
2621
 
 
2622
 
<pre>
2623
 
    --ssl-watchdog
2624
 
                             Use ssl watchdog (NS6 problem)
2625
 
</pre>
2626
1683
<br>
2627
 
<p>
2628
 
<b>Q.</b>&nbsp;
2629
 
 -4 and -6?
2630
 
</p>
2631
 
<p>
2632
 
<b>A.</b>&nbsp;
2633
 
 The default for the ntop web server is to connect to any address and any family
2634
 
   of addresses, so if the NIC has both IPv4 and IPv6 addresses it should respond 
 
1684
<p><b>Q.</b>&nbsp; -4 and -6?</p>
 
1685
<p><b>A.</b>&nbsp; The default for the ntop web server is to connect to any address and any family   of addresses, so if the NIC has both IPv4 and IPv6 addresses it should respond 
2635
1686
   to both.  Use these to restrict the web server.
2636
1687
</p>
2637
1688
<br>
2638
 
<p>
2639
 
<b>Q.</b>&nbsp;
2640
 
 --trace-level?
2641
 
</p>
2642
 
<p>
2643
 
<b>A.</b>&nbsp;
2644
 
 The settings 0..4 control the amount of information logged or displayed.
2645
 
   5 adds a [MSGIDnnnn] field and 6 adds the file:line where the message originated.
2646
 
   -t 5 can be useful with a log watch type package, -t 6 is mostly for debugging.
2647
 
</p>
2648
 
<p>
2649
 
   -t 5:
 
1689
<p><b>Q.</b>&nbsp; --trace-level?</p>
 
1690
<p><b>A.</b>&nbsp; The settings 0..4 control the amount of information logged or displayed.   DETAIL (5) adds a [MSGIDnnnn] field and (VERYNOISY) 6 or greater adds the 
 
1691
   file:line where the message originated.
 
1692
</p>
 
1693
<p>   -t 5 can be useful with a log watch type package, -t 6 is mostly for debugging.
 
1694
</p>
 
1695
<p>   -t 5:
2650
1696
</p>
2651
1697
<pre>
2652
1698
      [MSGID8757584] OSFP: scanFingerprintLoop() checked 1, resolved 1
2653
1699
</pre>
2654
 
<p>
2655
 
   -t 6:
 
1700
<p>   -t 6:
2656
1701
</p>
2657
1702
<pre>
2658
1703
      [MSGID8757584] [ntop:698] OSFP: scanFingerprintLoop() checked 1, resolved 1
2659
1704
</pre>
 
1705
<p>   With 3.2 we've added VERYNOISY and (7) BEYONDNOISY ... they do pretty much what they
 
1706
   say.  Have LOTS of log space available.
 
1707
</p>
2660
1708
<br>
2661
 
<p>
2662
 
<b>Q.</b>&nbsp;
2663
 
 ntop starts up find and then seems to die.
2664
 
</p>
2665
 
<p>
2666
 
<b>A.</b>&nbsp;
2667
 
 Are the ntop threads still there? Use ps to check, for example:
2668
 
   # ps -C ntop -m -o "uid,pid,ppid,stat,time,command"
 
1709
<p><b>Q.</b>&nbsp; ntop starts up find and then seems to die.</p>
 
1710
<p><b>A.</b>&nbsp; Are the ntop threads still there? Use ps to check, for example:   # ps -C ntop -m -o "uid,pid,ppid,stat,time,command"
2669
1711
</p>
2670
1712
 
2671
1713
<pre>
2680
1722
     501 18336 18330 R    00:00:32 /usr/bin/ntop -i eth1,eth2 @/etc/ntop.conf...
2681
1723
     501 18337 18330 S    00:00:41 /usr/bin/ntop -i eth1,eth2 @/etc/ntop.conf...
2682
1724
</pre>
2683
 
<p>
2684
 
   The 'PID' numbers match the THREADMGMT: numbers in the log:
 
1725
<p>   The 'PID' numbers match the THREADMGMT: numbers in the log:
2685
1726
</p>
2686
1727
 
2687
1728
<pre>
2695
1736
</pre>
2696
1737
 
2697
1738
<pre>
2698
 
      ntop[18327]: THREADMGMT: Started thread (16386) for network packet analyser 
 
1739
      ntop[18327]:   THREADMGMT[t105061296]: SFP: Started thread for fingerprinting 
2699
1740
               A message is issued for each thread started.
2700
 
                                               ^^^^^ is the 'internal' thread #.
2701
 
                                                     Ignore it
2702
 
      ntop[18331]: THREADMGMT: Packet processor thread running... 
2703
 
           ^^^^^ is the child thread.  Each one issues a message as it starts up
2704
 
</pre>
2705
 
 
2706
 
<pre>
2707
 
      ntop[18327]: THREADMGMT: Started thread (32771) for idle hosts detection 
2708
 
      ntop[18332]: THREADMGMT: Idle host scan thread running... 
2709
 
      ntop[18327]: THREADMGMT: Started thread (49156) for DNS address resolution 
2710
 
      ntop[18333]: THREADMGMT: Address resolution thread running... 
2711
 
      ntop[18334]: THREADMGMT: rrd thread (65541) started 
2712
 
      ntop[18327]: THREADMGMT: Started thread (81926) for web server 
2713
 
      ntop[18335]: THREADMGMT: web connections thread (18335) started... 
2714
 
      ntop[18327]: THREADMGMT: Started thread (98311) for network packet sniffing on eth1 
2715
 
      ntop[18336]: THREADMGMT: pcap dispatch thread running... 
2716
 
      ntop[18327]: THREADMGMT: Started thread (114696) for network packet sniffing on eth2 
2717
 
      ntop[18337]: THREADMGMT: pcap dispatch thread running... 
2718
 
</pre>
2719
 
<p>
2720
 
   So:
 
1741
                                t^^^^^^^^^ is the 'internal' thread #. Ignore it
 
1742
      ntop[18331]: THREADMGMT[t105061296]: SFP: Fingerprint scan thread starting [18331]
 
1743
                                                                                  p^^^^^ 
 
1744
               is the child pid.  Each one issues a message as it starts up
 
1745
</pre>
 
1746
<p>   So:
2721
1747
</p>
2722
1748
 
2723
1749
<pre>
2731
1757
     501 18335 18330 S    00:00:00 Web Server
2732
1758
     501 18336 18330 R    00:00:32 eth1
2733
1759
     501 18337 18330 S    00:00:41 eth2
2734
 
i
2735
 
   If you connect to the running ntop via gdb, you can see this:
2736
1760
</pre>
2737
 
<p>
2738
 
   $ gdb /usr/bin/ntop 18327
 
1761
<p>   If you connect to the running ntop via gdb, you can see this:
 
1762
</p>
 
1763
<p>   $ gdb /usr/bin/ntop 18327
2739
1764
   (gdb) info threads
2740
1765
</p>
2741
1766
<pre>
2762
1787
     1 Thread 16384 (LWP 18327)  0x420b0226 in nanosleep () from
2763
1788
            /lib/i686/libc.so.6
2764
1789
</pre>
2765
 
<p>
2766
 
   (gdb) thread 2
 
1790
<p>   (gdb) thread 2
2767
1791
</p>
2768
1792
<pre>
2769
1793
         ^^^^^^^^ switch to thread 2 and see it's state
2770
1794
</pre>
2771
 
<p>
2772
 
   [Switching to thread 2 (Thread 32769 (LWP 18330))]#0  0x420db1a7 in
 
1795
<p>   [Switching to thread 2 (Thread 32769 (LWP 18330))]#0  0x420db1a7 in
2773
1796
</p>
2774
1797
<pre>
2775
1798
            poll () from /lib/i686/libc.so.6
2776
1799
</pre>
2777
 
<p>
2778
 
   (gdb) info stack
 
1800
<p>   (gdb) info stack
2779
1801
</p>
2780
1802
<pre>
2781
1803
         ^^^^^^^^^^ check the call stack
2782
1804
</pre>
2783
 
<p>
2784
 
   #0  0x420db1a7 in poll () from /lib/i686/libc.so.6
 
1805
<p>   #0  0x420db1a7 in poll () from /lib/i686/libc.so.6
2785
1806
   #1  0x4024f9de in __pthread_manager () from /lib/i686/libpthread.so.0
2786
1807
</p>
2787
1808
<pre>
2788
1809
                     ^^^^^^^^^^^^^^^^^ running __pthread_manager
2789
1810
</pre>
2790
1811
<br>
2791
 
<p>
2792
 
<b>Q.</b>&nbsp;
2793
 
 All the threads seem to be running ok.
2794
 
</p>
2795
 
<p>
2796
 
<b>A.</b>&nbsp;
2797
 
 Check if there's one that looks like this:
2798
 
</p>
 
1812
<p><b>Q.</b>&nbsp; All the threads seem to be running ok.</p>
 
1813
<p><b>A.</b>&nbsp; Check if there's one that looks like this:</p>
2799
1814
 
2800
1815
<pre>
2801
1816
     4 Thread 32771 (LWP 27295)  0x420cd207 in sched_yield () from
2802
1817
            /lib/i686/libc.so.6
2803
1818
</pre>
2804
 
<p>
2805
 
   Let ntop run a few more seconds (cont command), then check again.
 
1819
<p>   Let ntop run a few more seconds (cont command), then check again.
2806
1820
</p>
2807
 
<p>
2808
 
   If it's frozen in the sched_yield, you're probably tripping a deadlock 
 
1821
<p>   If it's frozen in the sched_yield, you're probably tripping a deadlock 
2809
1822
   situation that we've seen but don't understand - There's a lot of
2810
1823
   stuff on the 'net, including what seems to be the same problem with
2811
1824
   other resource intensive tools but no clear answers.  
2812
1825
</p>
2813
 
<p>
2814
 
   This happens most often on RedHat Linux 8.0 (9 uses a different
 
1826
<p>   This happens most often on RedHat Linux 8.0 (9 uses a different
2815
1827
   threading library and the issue hasn't been reported there).  
2816
1828
</p>
2817
 
<p>
2818
 
   Regardless, if you see the deadlock or just have a hung ntop, there is a
 
1829
<p>   Regardless, if you see the deadlock or just have a hung ntop, there is a
2819
1830
   run time option to try: --disable-schedyield.  This option disables the
2820
1831
   calls at a slight penalty to ntop's interactivness.  If you're experiencing
2821
1832
   the deadlocks, try it.
2822
1833
</p>
2823
 
<p>
2824
 
   And, especially if you're running something other than RedHat 8, please
 
1834
<p>   And, especially if you're running something other than RedHat 8, please
2825
1835
   let the ntop-dev list know about it.
2826
1836
</p>
2827
1837
<br>
2828
 
<p>
2829
 
<b>Q.</b>&nbsp;
2830
 
 But what about SQL and mySQL
2831
 
</p>
2832
 
<p>
2833
 
<b>A.</b>&nbsp;
2834
 
 Removed in 2.1.50+ versions - use rrd
2835
 
</p>
2836
 
<br>
2837
 
<p>
2838
 
<b>Q.</b>&nbsp;
2839
 
 But I really, really, need the data in an sql database.
2840
 
</p>
2841
 
<p>
2842
 
<b>A.</b>&nbsp;
2843
 
 If you are only interested in saving your netflow data in MySQL, use the
2844
 
   script ntop/NetFlow/netFlowClient.pl (netflow v5).  With few additional lines
2845
 
   you could save your data in flat files, forward the netflow data or whatever.
2846
 
</p>
2847
 
<p>
2848
 
   What this script does it set itself up as a netflow collector and sql
2849
 
   inserter. The main loop just accepts a netflow packet and inserts the flow(s)
2850
 
   into sql.
2851
 
</p>
2852
 
<p>
2853
 
   To use this with a single instance of ntop, just set ntop up as a netflow
2854
 
   sender, directed at the script (e.g. 127.0.0.1 on any port you like).
2855
 
   Configure the script with the port # and run it.
2856
 
</p>
2857
 
<p>
2858
 
   The same idea would work with sFlow, you would just have to change the packet
2859
 
   decoding part of the script.
2860
 
</p>
2861
 
 
2862
 
<pre>
2863
 
Q: How does ntop use lsof? nmap?
2864
 
</pre>
2865
 
<p>
2866
 
<b>A.</b>&nbsp;
2867
 
 ntop no longer uses these external tools.
2868
 
</p>
2869
 
<p>
2870
 
   OS fingerprinting was replaced by ettercap.
2871
 
</p>
2872
 
<p>
2873
 
   If you need lsof data, you should ssh to the host and run it locally (this
2874
 
   allows the sysadmin to put appropriate security on lsof).
2875
 
</p>
2876
 
<br>
2877
 
<p>
2878
 
<b>Q.</b>&nbsp;
2879
 
 Can I set the admin password from a script?
2880
 
</p>
2881
 
<p>
2882
 
<b>A.</b>&nbsp;
2883
 
 Yes, you can call ntop with the option:
2884
 
</p>
2885
 
<pre>
2886
 
      ntop --set-admin-password=password        
2887
 
</pre>
2888
 
<br>
2889
 
<p>
2890
 
<b>Q.</b>&nbsp;
2891
 
 What's this warning about ownership?
2892
 
</p>
2893
 
<p>
2894
 
<b>A.</b>&nbsp;
2895
 
 The first time you run make install and ntop creates a new
2896
 
   directory for ntop's files, there's a problem.  So you'll
 
1838
<p><b>Q.</b>&nbsp; Can I set the admin password from a script?</p>
 
1839
<p><b>A.</b>&nbsp; Yes, you can call ntop with the option:</p>
 
1840
<pre>
 
1841
      ntop --set-admin-password=password        
 
1842
</pre>
 
1843
<br>
 
1844
<p><b>Q.</b>&nbsp; What's this warning about ownership?</p>
 
1845
<p><b>A.</b>&nbsp; The first time you run make install and ntop creates a new   directory for ntop's files, there's a problem.  So you'll
2897
1846
   see this warning box:
2898
1847
</p>
2899
1848
 
2933
1882
      ************************************************************
2934
1883
      ************************************************************
2935
1884
</pre>
2936
 
<p>
2937
 
   Since root created the directory, root is the owner.  And since we don't
 
1885
<p>   Since root created the directory, root is the owner.  And since we don't
2938
1886
   know - yet - what user ntop is going to be run as, we can't issue the
2939
1887
   chown (CHange OWNership) command for you.
2940
1888
</p>
2941
1889
<br>
2942
 
<p>
2943
 
<b>Q.</b>&nbsp;
2944
 
 And if I don't do this?
2945
 
</p>
2946
 
<p>
2947
 
<b>A.</b>&nbsp;
2948
 
 ntop won't run. Typically you get a message about a bad -P file or
2949
 
   endless prompts for the admin password.
 
1890
<p><b>Q.</b>&nbsp; And if I don't do this?</p>
 
1891
<p><b>A.</b>&nbsp; ntop won't run. Typically you get a message about a bad -P file or   endless prompts for the admin password.
2950
1892
</p>
2951
1893
<br>
2952
 
<p>
2953
 
<b>Q.</b>&nbsp;
2954
 
 I can't merge interfaces (-M option)?
2955
 
</p>
2956
 
<p>
2957
 
<b>A.</b>&nbsp;
2958
 
 Check your plugins and see if either netFlow or sFlow is active.
2959
 
   Regardless of whether you're using them, if they're active, they
 
1894
<p><b>Q.</b>&nbsp; I can't merge interfaces (-M option)?</p>
 
1895
<p><b>A.</b>&nbsp; Check your plugins and see if either netFlow or sFlow is active.   Regardless of whether you're using them, if they're active, they
2960
1896
   (silently) force the -M switch on.
2961
1897
</p>
 
1898
<p>   If you have used the web configuration to set this, you may be
 
1899
   unintentionally overriding your command line.
 
1900
</p>
 
1901
<p>   With v3.2 there are log messages telling you what sets interface
 
1902
   merge.
 
1903
</p>
 
1904
 
 
1905
<pre>
 
1906
        NOTE: Interface merge disabled by default
 
1907
        NOTE: Interface merge enabled by default
 
1908
        NOTE: Interface merge disabled from prefs file
 
1909
        NOTE: Interface merge enabled from prefs file
 
1910
        NOTE: Interface merge disabled due to command line switch
 
1911
</pre>
2962
1912
<br>
2963
 
<p>
2964
 
<b>Q.</b>&nbsp;
2965
 
 Explain -u.
2966
 
</p>
2967
 
<p>
2968
 
<b>A.</b>&nbsp;
2969
 
 -u root means that you are running ntop as root. It means you don't drop
2970
 
   root's superuser privledges, so pretty much you can read/write any file.
 
1913
<p><b>Q.</b>&nbsp; Explain -u.</p>
 
1914
<p><b>A.</b>&nbsp; -u root means that you are running ntop as root. It means you don't drop   root's superuser privledges, so pretty much you can read/write any file.
2971
1915
   It's not a good idea.  While we're not aware of any security problems with
2972
1916
   ntop, programs that run as root are targets.
2973
1917
</p>
2974
 
<p>
2975
 
   -u ntop (or -u whatever) means you run as a normal user and can be assigned
 
1918
<p>   -u ntop (or -u whatever) means you run as a normal user and can be assigned
2976
1919
   only the privledges necessary to run ntop.  It also means you can only read/
2977
1920
   write files as ntop.  So less is exposed.
2978
1921
</p>
2979
 
<p>
2980
 
   For even better security, the -u userid should not have a valid shell, so
 
1922
<p>   For even better security, the -u userid should not have a valid shell, so
2981
1923
   people can't use it to login.
2982
1924
</p>
2983
1925
<br>
2984
 
<p>
2985
 
<b>Q.</b>&nbsp;
2986
 
 What are the options that reduce ntop's workload?
2987
 
</p>
2988
 
<p>
2989
 
<b>A.</b>&nbsp;
2990
 
 These options turn off certain processing (and thus limit ntop's
2991
 
   functionality), and may be appropriate for high volume installations.
2992
 
</p>
2993
 
<p>
2994
 
   -b | --disable-decoders
 
1926
<p><b>Q.</b>&nbsp; What are the options that reduce ntop's workload?</p>
 
1927
<p><b>A.</b>&nbsp; These options turn off certain processing (and thus limit ntop's   functionality), and may be appropriate for high volume installations.
 
1928
</p>
 
1929
<p>   -b | --disable-decoders
2995
1930
</p>
2996
1931
 
2997
1932
<pre>
3045
1980
              21 or smtp's 25) (or there is a non-ftp or smtp request on the
3046
1981
              standard ports), the packet is logged.
3047
1982
</pre>
3048
 
<p>
3049
 
   -g | --track-local-hosts
 
1983
<p>   -g | --track-local-hosts
3050
1984
</p>
3051
1985
 
3052
1986
<pre>
3073
2007
     This switch could be used to run ntop on low-end CPUs or where ntop is
3074
2008
     acting as a collector (netFlow or sFlow) and the GUI is not required.
3075
2009
</pre>
3076
 
<p>
3077
 
   -o | --no-mac
 
2010
<p>   -o | --no-mac
3078
2011
</p>
3079
2012
 
3080
2013
<pre>
3114
2047
<pre>
3115
2048
     See also -z | --disable-sessions
3116
2049
</pre>
3117
 
<p>
3118
 
   -z | --disable-sessions
 
2050
<p>   -z | --disable-sessions
3119
2051
</p>
3120
2052
 
3121
2053
<pre>
3143
2075
     then you will also need to disable session tracking with this switch.
3144
2076
</pre>
3145
2077
<br>
3146
 
<p>
3147
 
<b>Q.</b>&nbsp;
3148
 
 -s | --no-promiscuous doesn't work
3149
 
</p>
3150
 
<p>
3151
 
<b>A.</b>&nbsp;
3152
 
 It should work - it's passed to pcap_open_live. Understand that it does mean
3153
 
   ntop sees a lot less comprehensive view of the traffic.  You won't see
3154
 
   anything different unless you do an ifconfig on the interface.  Note that
3155
 
   while the parameter specifies if the interface is to be put into promiscuous
3156
 
   mode, even if this parameter is false, the interface could well be in
3157
 
   promiscuous mode for some other reason.
3158
 
</p>
3159
 
<p>
3160
 
   If it fails, you'll see a message and ntop will refuse to startup
 
2078
<p><b>Q.</b>&nbsp; -s | --no-promiscuous doesn't work</p>
 
2079
<p><b>A.</b>&nbsp; It should work - it's passed to pcap_open_live.</p>
 
2080
<p>   But, whether the flag is supported by the OS and whether it is actually 
 
2081
   respected by the interface depends on libpcap.  If it fails, you'll see 
 
2082
   a message and ntop will refuse to startup.
 
2083
</p>
 
2084
<p>   Understand that if it actually does work, it means that ntop sees a lot 
 
2085
   less comprehensive view of the traffic.
 
2086
</p>
 
2087
<p>   But from the ntop web server, you won't see anything different.
 
2088
</p>
 
2089
<p>   You can check (*nix) by executing ifconfig on the interface.
 
2090
</p>
 
2091
<p>   Note that the parameter specifies if the interface is to be put into 
 
2092
   promiscuous mode because of ntop.
 
2093
</p>
 
2094
<p>   Even if this parameter is false, the interface could well be in promiscuous
 
2095
   mode for some other reason.  And in some situations, the interface may be 
 
2096
   forced by the low level driver into promiscuous mode, without reporting
 
2097
   this to the kernel!
3161
2098
</p>
3162
2099
<br>
3163
 
<p>
3164
 
<b>Q.</b>&nbsp;
3165
 
 How does -m | --local-subnets work?
3166
 
</p>
3167
 
<p>
3168
 
<b>A.</b>&nbsp;
3169
 
 This flag allows users to specify the subnets whose traffic is considered
3170
 
   local (called "pseudoLocal" internally).  
3171
 
</p>
3172
 
<p>
3173
 
   The format is
 
2100
<p><b>Q.</b>&nbsp; How does -m | --local-subnets work?</p>
 
2101
<p><b>A.</b>&nbsp; This flag allows users to specify the subnets whose traffic is considered   local (called "pseudoLocal" internally).  
 
2102
</p>
 
2103
<p>   The format is
3174
2104
</p>
3175
2105
<pre>
3176
2106
        <network address>/<# subnet mask bits>[,<network address>/<#  subnet 
3177
2107
         mask bits>
3178
2108
</pre>
3179
 
<p>
3180
 
   For instance "131.114.21.0/24,10.0.0.0/255.0.0.0".
 
2109
<p>   For instance "131.114.21.0/24,10.0.0.0/255.0.0.0".
3181
2110
</p>
3182
2111
<br>
3183
 
<p>
3184
 
<b>Q.</b>&nbsp;
3185
 
 (followup) but what does it MEAN?
3186
 
</p>
3187
 
<p>
3188
 
<b>A.</b>&nbsp;
3189
 
 Surprisingly, it means EXACTLY what it says. Treat traffic on the listed
3190
 
   subnet(s) as local.
3191
 
</p>
3192
 
<p>
3193
 
   -m relates to the traffic you see on the wire at the TCP/IP level.
 
2112
<p><b>Q.</b>&nbsp; (followup) but what does it MEAN?</p>
 
2113
<p><b>A.</b>&nbsp; Surprisingly, it means EXACTLY what it says. Treat traffic on the listed   subnet(s) as local.
 
2114
</p>
 
2115
<p>   -m relates to the traffic you see on the wire at the TCP/IP level.
3194
2116
   -m tells ntop something it can't determine by itself.  And that is to 
3195
2117
   treat a range of addresses EXACTLY like it was local.
3196
2118
</p>
3197
 
<p>
3198
 
   For example, on my Cable Modem, I see broadcasts for a number of subnets
 
2119
<p>   For example, on my Cable Modem, I see broadcasts for a number of subnets
3199
2120
   that AT&T (now Comcast) has assigned to this area (I don't see the 
3200
2121
   traffic just the broadcasts).
3201
2122
</p>
3202
 
<p>
3203
 
   If you have VLANs or simply network overlays (two or more networks on the
 
2123
<p>   If you have VLANs or simply network overlays (two or more networks on the
3204
2124
   same wire, but with separate address spaces).  etc.
3205
2125
</p>
3206
 
<p>
3207
 
   Those are the cases where you use -m.  To tell ntop to treat that traffic
 
2126
<p>   Those are the cases where you use -m.  To tell ntop to treat that traffic
3208
2127
   as local.
3209
2128
</p>
3210
2129
<br>
3211
 
<p>
3212
 
<b>Q.</b>&nbsp;
3213
 
 Why
3214
 
</p>
 
2130
<p><b>Q.</b>&nbsp; Why</p>
3215
2131
<pre>
3216
2132
A  ntop differentiates between local traffic and remote traffic.  There are
3217
2133
   actually four classes (although only three are routinely reported) L->L L->R
3219
2135
   reporting is available for L traffic.
3220
2136
</pre>
3221
2137
<br>
3222
 
<p>
3223
 
<b>Q.</b>&nbsp;
3224
 
 I'm confused. Explain, please!
3225
 
</p>
3226
 
<p>
3227
 
<b>A.</b>&nbsp;
3228
 
 Suppose your IP is 1.2.3.4 with a 255.255.255.0 netmask (a/k/a 1.2.3.4/24)
3229
 
</p>
3230
 
<p>
3231
 
   Under the TCP/IP protocol, traffic with any address 1.2.3.1 -> 1.2.3.254 does
 
2138
<p><b>Q.</b>&nbsp; I'm confused. Explain, please!</p>
 
2139
<p><b>A.</b>&nbsp; Suppose your IP is 1.2.3.4 with a 255.255.255.0 netmask (a/k/a 1.2.3.4/24)</p>
 
2140
<p>   Under the TCP/IP protocol, traffic with any address 1.2.3.1 -> 1.2.3.254 does
3232
2141
   not get routed.  It's "local".
3233
2142
</p>
3234
 
<p>
3235
 
   Your buddy is at 1.2.3.9 and the router is 1.2.3.1, so your network looks
 
2143
<p>   Your buddy is at 1.2.3.9 and the router is 1.2.3.1, so your network looks
3236
2144
   like this:
3237
2145
</p>
3238
 
<p>
3239
 
   the       +--------+
 
2146
<p>   the       +--------+
3240
2147
   world-----+ Router +--1.2.3.1--------------------------------------
3241
2148
   +dog      +--------+                | 1.2.3.4             | 1.2.3.9
3242
2149
</p>
3245
2152
                                  |  You   |            |  Buddy |
3246
2153
                                  +--------+            +--------+
3247
2154
</pre>
3248
 
<p>
3249
 
   Say you send a packet to your buddy at 1.2.3.9. You build a packet with
 
2155
<p>   Say you send a packet to your buddy at 1.2.3.9. You build a packet with
3250
2156
   SRC=1.2.3.4 DST=1.2.3.9 and your data and cast it out the wire.   (For
3251
2157
   purposes of this illustration, ignore the fact the your TCP stack would
3252
2158
   recognize the "local" nature of the packet and actually use another, lower
3253
2159
   level protocol, called Ethernet to deliver it.)
3254
2160
</p>
3255
 
<p>
3256
 
   The router (1.2.3.1) looks at it, does the math and ignores it - it's local
 
2161
<p>   The router (1.2.3.1) looks at it, does the math and ignores it - it's local
3257
2162
   Your buddy (1.2.3.9) looks at it, says - gee, that's me and reads it
3258
2163
</p>
3259
 
<p>
3260
 
   This is L->L traffic.
 
2164
<p>   This is L->L traffic.
3261
2165
</p>
3262
 
<p>
3263
 
   Now you send a packet to ntop.org at 131.114.21.9.  Again, SRC=1.2.3.4 and
 
2166
<p>   Now you send a packet to ntop.org at 131.114.21.9.  Again, SRC=1.2.3.4 and
3264
2167
   Now DST=131.114.21.9.
3265
2168
</p>
3266
 
<p>
3267
 
   The router (1.2.3.1) looks at it, does the math and says - oops, I have to
 
2169
<p>   The router (1.2.3.1) looks at it, does the math and says - oops, I have to
3268
2170
   send it out to the world. Your buddy (1.2.3.9) looks at it, says - gee that's
3269
2171
   NOT me and ignores it
3270
2172
</p>
3271
 
<p>
3272
 
   This is L->R traffic.
 
2173
<p>   This is L->R traffic.
3273
2174
</p>
3274
 
<p>
3275
 
   Now it's perfectly possible to have multiple (physical) networks on the same
 
2175
<p>   Now it's perfectly possible to have multiple (physical) networks on the same
3276
2176
   physical wire.  Say that your ISP chooses to put 1.2.4.1-1.2.4.254
3277
2177
   (1.2.4.0/24) on the same wire. (Why would they do this? - maybe it's a big
3278
2178
   pipe and only a few users or whatever).
3279
2179
</p>
3280
 
<p>
3281
 
   A packet from 1.2.4.4 -> 1.2.4.9 is seen by
 
2180
<p>   A packet from 1.2.4.4 -> 1.2.4.9 is seen by
3282
2181
</p>
3283
 
<p>
3284
 
   The router - no, that too is local, ignore it
 
2182
<p>   The router - no, that too is local, ignore it
3285
2183
   You (1.2.3.4): (1.2.4.9) - not me - ignore it
3286
2184
   Buddy (1.2.3.9) - um... 1.2.4.9 - not me - ignore it
3287
2185
</p>
3288
 
<p>
3289
 
   And that's perfectly legal.
 
2186
<p>   And that's perfectly legal.
3290
2187
</p>
3291
 
<p>
3292
 
   But what if you are the ISP and you want ntop to see ALL the traffic on that
 
2188
<p>   But what if you are the ISP and you want ntop to see ALL the traffic on that
3293
2189
   wire? ntop will figure out from it's own IP address that the 1.2.3.0/24
3294
2190
   traffic is local, but it will classify the 1.2.4.0/24 as REMOTE.
3295
2191
</p>
3296
 
<p>
3297
 
   And that is what the --local-subnets switch does.  It tells ntop to treat
 
2192
<p>   And that is what the --local-subnets switch does.  It tells ntop to treat
3298
2193
   that 1.2.4.0/24 traffic as local.
3299
2194
</p>
3300
 
<p>
3301
 
   If there isn't any other traffic on the wire, then telling ntop to treat it
 
2195
<p>   If there isn't any other traffic on the wire, then telling ntop to treat it
3302
2196
   as local won't change a thing.
3303
2197
</p>
3304
 
<p>
3305
 
   You can always use a packet sniffer, such as tcpdump to scan the traffic on
 
2198
<p>   You can always use a packet sniffer, such as tcpdump to scan the traffic on
3306
2199
   the wire and see what's really there...
3307
2200
</p>
3308
2201
<br>
3309
 
<p>
3310
 
<b>Q.</b>&nbsp;
3311
 
 And internally?
3312
 
</p>
3313
 
<p>
3314
 
<b>A.</b>&nbsp;
3315
 
 ntop is designed as a hybrid packet analyzer, not a pure Ethernet analyzer
3316
 
   (layer 2) nor a pure TCP/IP analyzer (layer 3).  Most of ntop's displayed
 
2202
<p><b>Q.</b>&nbsp; And internally?</p>
 
2203
<p><b>A.</b>&nbsp; ntop is designed as a hybrid packet analyzer, not a pure Ethernet analyzer   (layer 2) nor a pure TCP/IP analyzer (layer 3).  Most of ntop's displayed
3317
2204
   counts are at the TCP/IP level, and that's what confuses people.  Internally,
3318
2205
   ntop works both at the level of the Ethernet frame and the TCP/IP packet.
3319
2206
</p>
3320
 
<p>
3321
 
   A single MAC address can be associated with multiple TCP/IP addresses.  The
 
2207
<p>   A single MAC address can be associated with multiple TCP/IP addresses.  The
3322
2208
   MAC address -- unless something is horribly wrong on the network or with the
3323
2209
   hardware or somebody is deliberately spoofing it -- is guaranteed to be
3324
2210
   unique and refers to a physical host or network interface.  For many reports,
3326
2212
   devices.  Other data is accumulated and displayed at the TCP/IP (level 3)
3327
2213
   layer.
3328
2214
</p>
3329
 
<p>
3330
 
   -m relates to the traffic you see on the wire at the TCP/IP level.
 
2215
<p>   -m relates to the traffic you see on the wire at the TCP/IP level.
3331
2216
   -m tells ntop something it can't determine by itself.  And that is to treat
3332
2217
   that range of addresses EXACTLY like it was local.
3333
2218
</p>
3334
 
<p>
3335
 
   For example, on my Cable Modem, I see broadcasts for a number of subnets
 
2219
<p>   For example, on my Cable Modem, I see broadcasts for a number of subnets
3336
2220
   that AT&T has assigned to this area (I don't see the traffic, but you get
3337
2221
   the picture) in an overlay structure (two or more networks on the
3338
2222
   same wire, but with separate address spaces).
3339
2223
</p>
3340
2224
<br>
3341
 
<p>
3342
 
<b>Q.</b>&nbsp;
3343
 
 What about multicast traffic?
3344
 
</p>
3345
 
<p>
3346
 
<b>A.</b>&nbsp;
3347
 
 Multicast traffic uses the 224.0.0.0/4 address range (that is all addresses
3348
 
   between 224.0.0.0 and 239.255.255.255 - see RFC 1112).  By default then,
 
2225
<p><b>Q.</b>&nbsp; What about multicast traffic?</p>
 
2226
<p><b>A.</b>&nbsp; Multicast traffic uses the 224.0.0.0/4 address range (that is all addresses   between 224.0.0.0 and 239.255.255.255 - see RFC 1112).  By default then,
3349
2227
   all multicast traffic is treated as 'Remote' by ntop.  
3350
2228
</p>
3351
 
<p>
3352
 
   Your actual network topology may be such that multicast traffic could
 
2229
<p>   Your actual network topology may be such that multicast traffic could
3353
2230
   all be local, all be remote or a mixture.  You can use the -m | 
3354
2231
   --local-subnets parameter to force some (or all) multicast groups
3355
2232
   to be counted as 'Local' traffic.
3356
2233
</p>
3357
2234
<br>
3358
 
<p>
3359
 
<b>Q.</b>&nbsp;
3360
 
 What about VLANs?
3361
 
</p>
3362
 
<p>
3363
 
<b>A.</b>&nbsp;
3364
 
 VLAN traffic is also a special case. ntop treats all traffic within your
3365
 
   machine's netmask definition as 'Local'.  For instance, you may have a /16
 
2235
<p><b>Q.</b>&nbsp; What about VLANs?</p>
 
2236
<p><b>A.</b>&nbsp; VLAN traffic is also a special case. ntop treats all traffic within your   machine's netmask definition as 'Local'.  For instance, you may have a /16
3366
2237
   network (netmask of 255.255.0.0), and you are using VLANs to distribute
3367
2238
   the traffic.  In this case ntop will see the a.b.c.d/16 address and classify
3368
2239
   all traffic within this /16 network as 'Local'.
3369
2240
</p>
3370
 
<p>
3371
 
   Don't design your network that way.
 
2241
<p>   Don't design your network that way.
3372
2242
</p>
3373
2243
<br>
3374
 
<p>
3375
 
<b>Q.</b>&nbsp;
3376
 
 But they did!
3377
 
</p>
3378
 
<p>
3379
 
<b>A.</b>&nbsp;
3380
 
 This MIGHT work:
3381
 
</p>
3382
 
<p>
3383
 
   Use an un-numbered interface, so that ntop doesn't assign any implicit
 
2244
<p><b>Q.</b>&nbsp; But they did!</p>
 
2245
<p><b>A.</b>&nbsp; This MIGHT work:</p>
 
2246
<p>   Use an un-numbered interface, so that ntop doesn't assign any implicit
3384
2247
   'Local' addresses.  Then use the -m | --local-subnets parameter to 
3385
2248
   define what is truly 'Local'.  As long as there aren't too many
3386
2249
   'Local' networks, this should work.  I run something sort of like this
3387
2250
   (but using /24s not subdividing a /16) for my development network.
3388
2251
</p>
3389
2252
<br>
3390
 
<p>
3391
 
<b>Q.</b>&nbsp;
3392
 
 What are the default protocols ntop monitors?
3393
 
</p>
3394
 
<p>
3395
 
<b>A.</b>&nbsp;
3396
 
 (These are the ones ntop monitors if the user does not supply a -p parameter)
3397
 
   Check addDefaultProtocols() in ntop.c around line 520.
3398
 
   The current list (August 2003) is
 
2253
<p><b>Q.</b>&nbsp; What are the default protocols ntop monitors?</p>
 
2254
<p><b>A.</b>&nbsp; (These are the ones ntop monitors if the user does not supply a -p parameter)   Check addDefaultProtocols() in ntop.c around line 525.
 
2255
   The current list (December 2004) is
3399
2256
</p>
3400
2257
 
3401
2258
<pre>
3413
2270
     DHCP/BOOTP 67-68
3414
2271
     SNMP       snmp snmp-trap
3415
2272
     NNTP       nntp
3416
 
     NFS        mount pcnfs bwnfs nfsd nfsd-status
 
2273
     NFS/AFS    mount pcnfs bwnfs nfsd nfsd-status 7000-7009
3417
2274
     X11        6000-6010
3418
2275
     SSH        22
3419
2276
     Gnutella   6346 6347 6348
3420
2277
     Morpheus   1214
3421
2278
     WinMX      6699 7730
 
2279
     DirectConnect 
3422
2280
     eDonkey    4661-4665
 
2281
     BitTorrent 6881-6999 6969
3423
2282
     Messenger  1863 5000 5001 5190-5193
3424
2283
</pre>
3425
 
<p>
3426
 
   Note that the names come from /etc/services (or your system's equivalent).
 
2284
<p>   Note that the names come from /etc/services (or your system's equivalent).
3427
2285
   If you add protocols to /etc/services, you can refer to them by name on the
3428
2286
   -p parameter.
3429
2287
</p>
3430
 
<p>
3431
 
   The list changes over time as P2P protocols appear and disappear.  Check the
 
2288
<p>   REMEMBER: You must define the list using the format illustrated in the ntop
 
2289
   man page.  Don't try to read /etc/services.  It will fail.
 
2290
</p>
 
2291
<p>   The list changes over time as P2P protocols appear and disappear.  Check the
3432
2292
   cvs and diff ntop.c (around line 550 in void addDefaultProtocols() if you
3433
2293
   want the history.
3434
2294
</p>
3435
2295
<br>
3436
 
<p>
3437
 
<b>Q.</b>&nbsp;
3438
 
 What about protocol XYZZY?
3439
 
</p>
3440
 
<p>
3441
 
<b>A.</b>&nbsp;
3442
 
 The analysis of protocols is very limited and unsophisticated. But,
3443
 
   theoretically, if it's there in plain text, we could report on it.
 
2296
<p><b>Q.</b>&nbsp; What about protocol XYZZY?</p>
 
2297
<p><b>A.</b>&nbsp; The analysis of protocols is very limited and unsophisticated. But,   theoretically, if it's there in plain text, we could report on it.
3444
2298
   The more work you can do up front in identifying the protocol (e.g. port #s,
3445
2299
   header structure, etc.), the easier it would be to add.
3446
2300
</p>
3447
2301
<br>
3448
 
<p>
3449
 
<b>Q.</b>&nbsp;
3450
 
 How can I run ntop without being root?
3451
 
</p>
3452
 
<p>
3453
 
<b>A.</b>&nbsp;
3454
 
 A very simple way of doing this is:
3455
 
   > su
3456
 
   > chown root ntop
3457
 
   > chgrp root ntop
3458
 
   > chmod 6111 ntop
3459
 
   > exit
3460
 
</p>
3461
 
<p>
3462
 
   This makes ntop read-only for everyone and sets the setuid and setguid bits.
3463
 
</p>
3464
 
<p>
3465
 
   Do not forget to use the -u flag so that ntop changes user as soon as it
3466
 
   is started.
3467
 
</p>
3468
 
<p>
3469
 
   Understand that setting the Setuid and Setguid bits allows ANY user to run
3470
 
   ntop and it will run with ROOT privileges.  This is very powerful, and often
3471
 
   a source of security exposure - many system hardening scripts and
3472
 
   recommendations tell you to look for and remove the setuid and setguid bits.
3473
 
</p>
3474
 
<p>
3475
 
   DO NOT suid UNLESS YOU UNDERSTAND THE RISKS!
3476
 
</p>
3477
 
<p>
3478
 
   REPEAT: DO NOT DO THIS, IT IS A BAD IDEA!
3479
 
</p>
3480
 
<p>
3481
 
   Also, there are unconfirmed reports of this method problems, causing a
3482
 
</p>
3483
 
<pre>
3484
 
      "socket: operation not permitted"
3485
 
   message.  Probably related to something in the OS checking for real root
3486
 
   not suid to open the interface in promiscuous mode.
3487
 
</pre>
3488
 
<br>
3489
 
<p>
3490
 
<b>Q.</b>&nbsp;
3491
 
 I am using a /16 (/25 or whatever) mask and I get this message:
3492
 
</p>
 
2302
<p><b>Q.</b>&nbsp; I am using a /16 (/25 or whatever) mask and I get this message:</p>
3493
2303
<pre>
3494
2304
      Truncated network size to 1024 hosts (real netmask 255.255.255.0)
3495
2305
</pre>
3496
 
<p>
3497
 
<b>A.</b>&nbsp;
3498
 
 Yes. ntop limits each network to 1024 hosts (a /24). If you need more, alter
3499
 
   the #define for MAX_SUBNET_HOSTS in globals-defines.h and recompile.  Space
 
2306
<p><b>A.</b>&nbsp; Yes. ntop limits each network to 1024 hosts (a /24). If you need more, alter   the #define for MAX_SUBNET_HOSTS in globals-defines.h and recompile.  Space
3500
2307
   has to be reserved for this many hosts for each network, so the limit exists
3501
2308
   to keep memory usage from growing to absurd levels on people with "class A"
3502
2309
   (/8) interfaces (e.g. 10. or Cable Modems, etc.).
3503
2310
</p>
 
2311
<br>
 
2312
<p><b>Q.</b>&nbsp; What's with the version check?</p>
 
2313
<br>
 
2314
<p><b>Q.</b>&nbsp; Why is ntop connecting to jake.ntop.org?</p>
 
2315
<p><b>A.</b>&nbsp; jake.ntop.org is the cannonical name for version.ntop.org, which hosts the xml   file used for the version check.
 
2316
</p>
 
2317
<p>   See the man page, 1st run log messages and/or privacyNotice.html page (Click on the
 
2318
   "this" in this line: "For information on ntop and information privacy, see this page."
 
2319
   on the 1st page ntop presents).
 
2320
</p>
3504
2321
<h2>Running - On-going</h2>
3505
2322
<br>
3506
 
<p>
3507
 
<b>Q.</b>&nbsp;
3508
 
 Explain L and R - why doesn't ntop double count?
3509
 
</p>
3510
 
<p>
3511
 
<b>A.</b>&nbsp;
3512
 
 Classification is all based on what ntop SEES in the packets. ntop sees
3513
 
   packets and ONLY packets.  Packets have a FROM and a TO address.  Which 
 
2323
<p><b>Q.</b>&nbsp; Explain L and R - why doesn't ntop double count?</p>
 
2324
<p><b>A.</b>&nbsp; Classification is all based on what ntop SEES in the packets. ntop sees   packets and ONLY packets.  Packets have a FROM and a TO address.  Which 
3514
2325
   packets ntop sees is determined by the interfaces it is monitoring.
3515
2326
</p>
3516
 
<p>
3517
 
   Traffic (packets) is classified based on the joint classification of the
 
2327
<p>   Traffic (packets) is classified based on the joint classification of the
3518
2328
   FROM address (L or R) and the TO address (L or R).
3519
2329
</p>
3520
 
<p>
3521
 
   Only in L->L traffic will ntop see sent=rcvd and 'double count'.
 
2330
<p>   Only in L->L traffic will ntop see sent=rcvd and 'double count'.
3522
2331
</p>
3523
2332
 
3524
2333
<pre>
3543
2352
      etc.
3544
2353
</pre>
3545
2354
<br>
3546
 
<p>
3547
 
<b>Q.</b>&nbsp;
3548
 
 Why does ntop use so much memory ?
3549
 
</p>
3550
 
<p>
3551
 
<b>A.</b>&nbsp;
3552
 
 ntop holds a lot of information about each host it has seen in an in-memory
3553
 
   table. Periodically, it looks at all the entries in the table and flushes any
 
2355
<p><b>Q.</b>&nbsp; Why does ntop use so much memory ?</p>
 
2356
<p><b>A.</b>&nbsp; ntop holds a lot of information about each host it has seen in an in-memory   table. Periodically, it looks at all the entries in the table and flushes any
3554
2357
   which have been idle for a period of time.
3555
2358
</p>
3556
 
<p>
3557
 
   You can change the sizing of the table and the flushing interval via #define
 
2359
<p>   You can change the sizing of the table and the flushing interval via #define
3558
2360
   statements in globals-defines.h.
3559
2361
</p>
3560
 
<p>
3561
 
   But realistically, ntop needs enough memory to hold information about what's
 
2362
<p>   But realistically, ntop needs enough memory to hold information about what's
3562
2363
   active on YOUR network.
3563
2364
</p>
3564
 
<p>
3565
 
   To reduce memory, monitor fewer protocols or use the filter (-B "bpf filter")
 
2365
<p>   To reduce memory, monitor fewer protocols or use the filter (-B "bpf filter")
3566
2366
   option to monitor only parts of the network.
3567
2367
</p>
3568
 
<p>
3569
 
   There have been a couple of discussions on the ntop mailing list about ntop's
 
2368
<p>   There have been a couple of discussions on the ntop mailing list about ntop's
3570
2369
   memory usage - you might read them (search on gmane).
3571
2370
</p>
3572
2371
<br>
3573
 
<p>
3574
 
<b>Q.</b>&nbsp;
3575
 
 So ntop's memory usage is dependent upon?
 
2372
<p><b>Q.</b>&nbsp; Database.</p>
 
2373
<p><b>A.</b>&nbsp; No way. This data just can't be stored in a database - while each record (row)   is small, we're talking 1000s of updates/second.  As in Enterprise Oracle class
 
2374
   speeds...  
3576
2375
</p>
3577
 
<p>
3578
 
<b>A.</b>&nbsp;
3579
 
 ntop's memory usage for host tables depends on the # of hosts it sees in
3580
 
   packet traffic.  This is NOT, repeat NOT controllable by ntop in ANY way.
 
2376
<p><b>A.</b>&nbsp; ntop's memory usage for host tables depends on the # of hosts it sees in   packet traffic.  This is NOT, repeat NOT controllable by ntop in ANY way.
3581
2377
   If a user kicks off a port scan, 100s of hosts appear.  If somebody does a
3582
2378
   DOS attack against you, 1000s of hosts 'appear'.  If a user searches Kazza
3583
2379
   for an obscure song, it can probe 4K hosts. etc.
3584
2380
</p>
3585
 
<p>
3586
 
   Lots of those hosts appear, have a few bytes of traffic and then disappear.
 
2381
<p>   Lots of those hosts appear, have a few bytes of traffic and then disappear.
3587
2382
   Each host has a variable amount of memory - there's a base structure, some
3588
2383
   optional counter structures and a large # of pointer fields, which may or
3589
2384
   may not be valued for any given host.  It depends on the # of active
3592
2387
   disappear (http: opens a lot, does a small retrieval and closes them), ssh
3593
2388
   may last for days.  etc.   Memory is consumed tracking them too.
3594
2389
</p>
3595
 
<br>
3596
 
<p>
3597
 
<b>Q.</b>&nbsp;
3598
 
 So what does the purge do?
3599
 
</p>
3600
 
<p>
3601
 
<b>A.</b>&nbsp;
3602
 
 ntop purges idle hosts. Period.
3603
 
</p>
3604
 
<p>
3605
 
   Idle being defined as having not had packet traffic for a #define able
 
2390
<p>   It's not just one table entry per host - there are a lot of ancillary tables 
 
2391
   which only get allocated if you have data for them.
 
2392
</p>
 
2393
<br>
 
2394
<p><b>Q.</b>&nbsp; Got a guess?</p>
 
2395
<p><b>A.</b>&nbsp; Sure. Look in textinfo.html and you will see the line:</p>
 
2396
 
 
2397
<pre>
 
2398
     (very) Approximate memory per host.....4.4KB
 
2399
</pre>
 
2400
<p>   I'm not sure how much I trust this and I wrote it.  This calculation just
 
2401
   computes the (current usage - baseline) / # of hosts.
 
2402
</p>
 
2403
<br>
 
2404
<p><b>Q.</b>&nbsp; So ntop's memory usage is dependent upon?</p>
 
2405
<br>
 
2406
<p><b>Q.</b>&nbsp; So what does the purge do?</p>
 
2407
<p><b>A.</b>&nbsp; ntop purges idle hosts. Period.</p>
 
2408
<p>   Idle being defined as having not had packet traffic for a #define able
3606
2409
   period, 5 minutes by default.
3607
2410
</p>
3608
 
<p>
3609
 
   Because of the amount of linked data, these purges take time (lots of 
 
2411
<p>   Because of the amount of linked data, these purges take time (lots of 
3610
2412
   free() calls on all those char* values), so we don't purge in 'real time'.
3611
2413
   First we build a list of idle hosts, then we purge from that list.
3612
2414
   Any idle host is eligible for purge (unless you tell ntop not to purge idle
3613
2415
   hosts, which is usable only on small networks).
3614
2416
</p>
3615
 
<p>
3616
 
   Over time, all idle hosts are purged.  Only to be perturbed by the 
 
2417
<p>   Over time, all idle hosts are purged.  Only to be perturbed by the 
3617
2418
   next burst of activity - say a port scan or everybody logging in back
3618
2419
   in after lunch.  Eventually, there's some form of steady state, but it's
3619
2420
   HIGHLY dependent upon network activity.  Which, remember, is external to 
3620
2421
   ntop and can't be predicted.
3621
2422
</p>
3622
2423
<br>
3623
 
<p>
3624
 
<b>Q.</b>&nbsp;
3625
 
 Why?
3626
 
</p>
3627
 
<p>
3628
 
<b>A.</b>&nbsp;
3629
 
 Think about the overhead of sorting this huge structure by 'last packet
3630
 
   seen time'.  1GB of ram is something like 80K+ hosts and takes a long
 
2424
<p><b>Q.</b>&nbsp; Why?</p>
 
2425
<p><b>A.</b>&nbsp; Think about the overhead of sorting this huge structure by 'last packet   seen time'.  1GB of ram is something like 80K+ hosts and takes a long
3631
2426
   time to sort (let alone free).   During which time, on that busy network,
3632
2427
   a couple of dozen packets are processed...  Meaning maybe your list of idle
3633
2428
   hosts is wrong.
3634
2429
</p>
3635
2430
<br>
3636
 
<p>
3637
 
<b>Q.</b>&nbsp;
3638
 
 So how about a hard memory limit?
3639
 
</p>
3640
 
<p>
3641
 
<b>A.</b>&nbsp;
3642
 
 There's no way to make a hard limit without purging ACTIVE hosts (or
3643
 
   non-IDLE given ntop's definition of idle).
3644
 
</p>
3645
 
<p>
3646
 
   Think about it ... you're at that 1GB limit and you find a new host.
 
2431
<p><b>Q.</b>&nbsp; So how about a hard memory limit?</p>
 
2432
<p><b>A.</b>&nbsp; There's no way to make a hard limit without purging ACTIVE hosts (or   non-IDLE given ntop's definition of idle).
 
2433
</p>
 
2434
<p>   Think about it ... you're at that 1GB limit and you find a new host.
3647
2435
   Do you kick off an interim purge (with it's huge overhead?)  And wait
3648
2436
   2 or 3 s for an available slot??  While 1000s of other packets appear??
3649
2437
</p>
3650
2438
<br>
3651
 
<p>
3652
 
<b>Q.</b>&nbsp;
3653
 
 Soft limit?
3654
 
</p>
3655
 
<p>
3656
 
<b>A.</b>&nbsp;
3657
 
 It might, might, be possible as a soft limit - but it's got a lot of
3658
 
   issues.
3659
 
</p>
3660
 
<p>
3661
 
   First off, tracking memory usage of the hosts tables is itself a huge
 
2439
<p><b>Q.</b>&nbsp; Soft limit?</p>
 
2440
<p><b>A.</b>&nbsp; It might, might, be possible as a soft limit - but it's got a lot of   issues.
 
2441
</p>
 
2442
<p>   First off, tracking memory usage of the hosts tables is itself a huge
3662
2443
   job. There are multiple places were stuff is purged, added to the 
3663
2444
   structures as pointers, etc. and there's a queue of purged entries 
3664
2445
   for reuse to cut down on the malloc() calls.
3665
2446
</p>
3666
 
<p>
3667
 
   Secondly, the purge is resource intensive, and has been the cause of
 
2447
<p>   Secondly, the purge is resource intensive, and has been the cause of
3668
2448
   deadlocks before - you don't dare lock the structures for too long - 
3669
2449
   packets keep arriving, and FAST on the busy network that has the memory
3670
2450
   issues in the first place.  Since you can't lock for long, you can only
3671
2451
   purge a small # of entries.
3672
2452
</p>
3673
2453
<br>
3674
 
<p>
3675
 
<b>Q.</b>&nbsp;
3676
 
 Why does ntop drop packets?
3677
 
</p>
3678
 
<p>
3679
 
<b>A.</b>&nbsp;
3680
 
 Short Answer: You need a faster processor. Maybe.
3681
 
</p>
3682
 
<p>
3683
 
<b>A.</b>&nbsp;
3684
 
 Long Answer: There are four places packets drop "in" ntop. One in
3685
 
   the NIC, one in the OS kernel, one in the libpcap library and one 
3686
 
   actually in ntop.
3687
 
</p>
3688
 
<p>
3689
 
   First off, this is largely NOT controlled by ntop.  It's inside the network
3690
 
   card, the network card driver and libpcap.  All ntop does is use the stats
3691
 
   provided by libpcap, pcap_stats:
3692
 
</p>
3693
 
 
3694
 
<pre>
3695
 
      "int pcap_stats() returns 0 and fills in a pcap_stat struct. The 
3696
 
       values represent packet statistics from the start of the run to
3697
 
       the time of the call. If there is an error or the under lying 
3698
 
       packet capture doesn't support packet statistics, -1 is returned
3699
 
       and the error text can be obtained with pcap_perror() or 
3700
 
       pcap_geterr()."
3701
 
</pre>
3702
 
<p>
3703
 
   to get the value and reports it in report.con the Stats | Traffic
3704
 
   page, some in the configuration report (info.html) and also on
3705
 
   the problem report skeleton.
3706
 
</p>
3707
 
<p>
3708
 
   The information on the Stats | Traffic page is simply the best available.
3709
 
   However, this data is not always easy to obtain nor interpret.
3710
 
</p>
3711
 
<p>
3712
 
   It looks great, but the reality is that the stats provided by libpcap
3713
 
   aren't very good!
3714
 
</p>
3715
 
<br>
3716
 
<p>
3717
 
<b>Q.</b>&nbsp;
3718
 
 Not good? Why...
3719
 
</p>
3720
 
<p>
3721
 
<b>A.</b>&nbsp;
3722
 
 The network card (NIC) reads packets from the wire into a small buffer.
3723
 
   That buffer is emptied by the OS into it's own buffers which are then 
3724
 
   passed to libpcap.  libpcap filters the packets (if requested) and 
3725
 
   passes the packets to ntop.
3726
 
</p>
3727
 
<p>
3728
 
   Packets may be dropped at any or all of these stages, even on a system 
3729
 
   that does not appear to be exceptionally busy.
3730
 
</p>
3731
 
<br>
3732
 
<p>
3733
 
<b>Q.</b>&nbsp;
3734
 
 How can packets be lost in the NIC?
3735
 
</p>
3736
 
<p>
3737
 
<b>A.</b>&nbsp;
3738
 
 A NIC has a small buffer - modern cards have 8K, 12K, even more buffer
3739
 
   space.  But if traffic comes in off the wire faster than the processes
3740
 
   are pulling it out of the NIC, well that buffer gets over-written and
3741
 
   packets get dropped.
3742
 
</p>
3743
 
<p>
3744
 
   Every time a packet comes in (or on some newer cards after a few packets
3745
 
   are recevied), the NIC interrupts the processor (CPU) to tell it to do
3746
 
   something.  This isn't a problem - some NICs with larger buffers
3747
 
   internally queuing a number of packets before interrupting the OS to
3748
 
   boost performance.
3749
 
</p>
3750
 
<p>
3751
 
   Check ifconfig for this:
3752
 
</p>
3753
 
 
3754
 
<pre>
3755
 
      eth0      Link encap:Ethernet  HWaddr 00:D0:09:77:85:B9
3756
 
                inet addr:192.168.42.6  Bcast:192.168.42.255  Mask:255.255.255.0
3757
 
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
3758
 
                RX packets:3892397 errors:30 dropped:0 overruns:0 frame:33
3759
 
                                             ^^^^^^^^^
3760
 
                TX packets:473009 errors:0 dropped:0 overruns:0 carrier:0
3761
 
                                           ^^^^^^^^^
3762
 
                collisions:1073 txqueuelen:100
3763
 
                RX bytes:2606704447 (2485.9 Mb)  TX bytes:70474880 (67.2 Mb)
3764
 
                Interrupt:11 Base address:0xc000
3765
 
</pre>
3766
 
<p>
3767
 
   Now, if it's an occasional burst, losing 1 or 2 packets won't kill 
3768
 
   you.  TCP/IP recovers.  And ntop's statistics aren't life-critical.  
3769
 
   If, however, it's continuous, on-going and the count is growing - i.e.
3770
 
   the NIC/CPU combo can't keep up with the AVERAGE network flow?  
3771
 
</p>
3772
 
 
3773
 
<pre>
3774
 
       You're toast...
3775
 
</pre>
3776
 
<p>
3777
 
   Upgrade the Processor or NIC. Maybe.
3778
 
</p>
3779
 
<br>
3780
 
<p>
3781
 
<b>Q.</b>&nbsp;
3782
 
 Can you tell if the NIC is the bottleneck?
3783
 
</p>
3784
 
<p>
3785
 
<b>A.</b>&nbsp;
3786
 
 Probably not. Different NIC cards (and NIC card drivers) record different
3787
 
   information.  Different tools present pieces and parts of it differently.
3788
 
</p>
3789
 
<p>
3790
 
   For example, a runt packet - one that is too short to really be a packet
3791
 
   is supposed to be discarded according to the tcp/ip standard.  But do you
3792
 
   count it as a packet received??
3793
 
</p>
3794
 
<p>
3795
 
   On many systems, interface level (NIC) statistics are available through 
3796
 
   the ifconfig (or similar) command.  But what is available and what they
3797
 
   mean can be different - even though they're presented in the same format.
3798
 
   Different programs can read the 'same' data and show different things.
3799
 
</p>
3800
 
<p>
3801
 
   For example - eth1 is an Intel Ethernet Pro/100, eth2 a 3c905...
3802
 
</p>
3803
 
<p>
3804
 
   # netstat -i --all
3805
 
   Kernel Interface table
3806
 
   Iface       MTU Met     RX-OK RX-ERR RX-DRP RX-OVR   TX-OK TX-ERR TX-DRP TX-OVR Flg
3807
 
   eth1       1500   0  50752227      0      0      0       0      0      0      0 BMPRU
3808
 
   eth2       1500   0 145053154      0      0      0       0      0      0      0 BMPRU
3809
 
</p>
3810
 
<p>
3811
 
   No errors - great, right?  But look at ifconfig, a few seconds earlier:
3812
 
</p>
3813
 
<p>
3814
 
   # ifconfig
3815
 
   eth1      Link encap:Ethernet  HWaddr 00:03:47:B1:62:27  
3816
 
</p>
3817
 
<pre>
3818
 
             UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
3819
 
             RX packets:50754251 errors:0 dropped:0 overruns:0 frame:3454146
3820
 
             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
3821
 
             collisions:0 txqueuelen:100 
3822
 
             RX bytes:667103055 (636.1 Mb)  TX bytes:0 (0.0 b)
3823
 
             Interrupt:9 Base address:0x1000 
3824
 
</pre>
3825
 
<p>
3826
 
   eth2      Link encap:Ethernet  HWaddr 00:60:97:04:30:33  
3827
 
</p>
3828
 
<pre>
3829
 
             UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
3830
 
             RX packets:145056087 errors:0 dropped:0 overruns:0 frame:0
3831
 
             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
3832
 
             collisions:0 txqueuelen:100 
3833
 
             RX bytes:1784472399 (1701.8 Mb)  TX bytes:0 (0.0 b)
3834
 
             Interrupt:9 Base address:0xb800 
3835
 
</pre>
3836
 
<p>
3837
 
   If I'm reading the code right, then the frame:nnnn count is set here:
3838
 
</p>
3839
 
 
3840
 
<pre>
3841
 
     sp->stats.rx_frame_errors += le32_to_cpu(sp->lstats->rx_align_errs);
3842
 
</pre>
3843
 
<p>
3844
 
   Meaning? No clue - the writer of the driver had to sign an NDA and so
3845
 
   couldn't explain a lot of what the driver does.  Besides, that data
3846
 
   isn't available to ntop anyway.
3847
 
</p>
3848
 
<br>
3849
 
<p>
3850
 
<b>Q.</b>&nbsp;
3851
 
 How can packets can be lost in the kernel?
3852
 
</p>
3853
 
<p>
3854
 
<b>A.</b>&nbsp;
3855
 
 Each time that interrupt occurs, the kernel processes it by moving
3856
 
   the data from the NIC to a kernel buffer, then re-enable interrupts.
3857
 
</p>
3858
 
<p>
3859
 
   Not really.
3860
 
</p>
3861
 
<p>
3862
 
   Actually, in Linux (and other OSes), the Kernel interrupt handler is
3863
 
   broken in half - called in Linux the top and bottom.  The bottom 
3864
 
   interrupt works with processor interrupts off to grab the data and 
3865
 
   buffer it and does only minimal processing as fast as possible so 
3866
 
   interrupts can be turned back on.  Then the top half is scheduled 
3867
 
   and processes as a Kernel process (high priority), but it is less 
3868
 
   time critical.
3869
 
</p>
3870
 
<p>
3871
 
   However, if the kernel can't process the bottom half in time - because
3872
 
   there isn't enough memory and/or the processor isn't fast enough to
3873
 
   respond to the interrupt, you do have a problem.   The small buffer
3874
 
   in the NIC will overflow and packets are dropped (this is the ONE place
3875
 
   where a better NIC, with a larger buffer, MIGHT help).
3876
 
</p>
3877
 
<p>
3878
 
   While there are LOTS of possible causes, if the kernel is *routinely*
3879
 
   dropping packets, it's almost certainly an interrupt/processor
3880
 
   speed/buffering issue.
3881
 
</p>
3882
 
<p>
3883
 
   So, I guess what I'm saying is that the dropped: count from ifconfig
3884
 
   might not be the NIC's fault - and that's why a faster processor is a
3885
 
   better choice than an expensive server class NIC.
3886
 
</p>
3887
 
<br>
3888
 
<p>
3889
 
<b>Q.</b>&nbsp;
3890
 
 But at least I can trust the libpcap reported counts, right?
3891
 
</p>
3892
 
<p>
3893
 
<b>A.</b>&nbsp;
3894
 
 Nope. You need to treat the pcap reported drops with more than a few
3895
 
   grains of salt.  See this thread, for example:
3896
 
</p>
3897
 
<pre>
3898
 
      http://www.tcpdump.org/lists/workers/2001/07/msg00018.html
3899
 
   and this msg:
3900
 
      http://www.mcabee.org/lists/snort-users/Jan-02/msg00771.html
3901
 
</pre>
3902
 
<p>
3903
 
   There's a lot of other stuff about pcap problems, especially from
3904
 
   snort (another package that stresses libpcap) - 
3905
 
   STFW for "libpcap ps_drop".
3906
 
</p>
3907
 
<p>
3908
 
   See, the call to pcap_stats reads internal counters - maybe they come
3909
 
   from the NIC and maybe they're just maintained by the kernel.  That's a
3910
 
   function of how the low level NIC driver is written to handle certain 
3911
 
   calls from higher level drivers.  So it's a function of the specific
3912
 
   NIC card, something we try to hide from everyone, ntop included.
3913
 
</p>
3914
 
<p>
3915
 
   Ultimately, some piece of hardware or software SHOULD be counting packets
3916
 
   and dropped packets.
3917
 
</p>
3918
 
<p>
3919
 
   But, remember also, that - AT THE INSTANT OF THE pcap_stats call -
3920
 
   there can be packets queued in any of these buffers (NIC, kernel, libpcap).
3921
 
</p>
3922
 
<p>
3923
 
   Put the two together and I wouldn't trust 'em.
3924
 
</p>
3925
 
<p>
3926
 
   Want more fear?  Read the comments through out the libpcap code.  Like 
3927
 
   this gem from pcap-linux.c:
3928
 
</p>
3929
 
 
3930
 
<pre>
3931
 
    *  Get the statistics for the given packet capture handle.
3932
 
    *  Reports the number of dropped packets iff the kernel supports
3933
 
    *  the PACKET_STATISTICS "getsockopt()" argument (2.4 and later
3934
 
    *  kernels, and 2.2[.x] kernels with Alexey Kuznetzov's turbopacket
3935
 
    *  patches); otherwise, that information isn't available, and we lie
3936
 
    *  and report 0 as the count of dropped packets.
3937
 
</pre>
3938
 
<p>
3939
 
   And this from pcap-bpf.c:
3940
 
</p>
3941
 
 
3942
 
<pre>
3943
 
    /*
3944
 
     * "ps_recv" counts packets handed to the filter, not packets
3945
 
     * that passed the filter.  This includes packets later dropped
3946
 
     * because we ran out of buffer space.
3947
 
     *
3948
 
     * "ps_drop" counts packets dropped inside the BPF device
3949
 
     * because we ran out of buffer space.  It doesn't count
3950
 
     * packets dropped by the interface driver.  It counts
3951
 
     * only packets that passed the filter.
3952
 
     *
3953
 
     * Both statistics include packets not yet read from the kernel
3954
 
     * by libpcap, and thus not yet seen by the application.
3955
 
     */
3956
 
</pre>
3957
 
<p>
3958
 
   As you see from the comments in the code, the interpretation of even
3959
 
   those counts differs between operating systems and even between minor versions
3960
 
   of the same OS (e.g. Linux 2.4.8 vs. 2.4.9).  For example, some systems 
3961
 
   do not maintain a dropped count and will always report zero.  Differences
3962
 
   may also occur on the same system for different NIC drivers.  
3963
 
</p>
3964
 
<p>
3965
 
   If a BPF filter (-B option) is in place, the differences between OSes are
3966
 
   more significant.
3967
 
</p>
3968
 
<p>
3969
 
   etc.
3970
 
</p>
3971
 
<p>
3972
 
   Trust nobody...
3973
 
</p>
3974
 
<br>
3975
 
<p>
3976
 
<b>Q.</b>&nbsp;
3977
 
 ntop drops packets?
3978
 
</p>
3979
 
<p>
3980
 
<b>A.</b>&nbsp;
3981
 
 Sure. ntop runs multiple threads (we call them "NPS - Network Packet Sniffer"
3982
 
   or something similar), one to handle each incomming device.  These operate
3983
 
   much like the bottom-half interrupt - they accept the packet and queue it
3984
 
   to another thread ("NPA - Network Packet Analyzer") for the analysis.
3985
 
</p>
3986
 
<p>
3987
 
   Ultimately, we're interested in the counter droppedPkts, which is
3988
 
   incremented in only one place, pbuf.c around 1398, which this is where 
3989
 
   NPS is trying to queue a packet for NPA.
3990
 
</p>
3991
 
<p>
3992
 
   Now, you can increase PACKET_QUEUE_LENGTH
3993
 
</p>
3994
 
 
3995
 
<pre>
3996
 
      ntop.h:   693   #define PACKET_QUEUE_LENGTH     2048
3997
 
</pre>
3998
 
<p>
3999
 
   but if you're routinely dropping packets here it's because ntop can't 
4000
 
   keep up with the flow.  Increasing the queue length will ONLY help if
4001
 
   it's an occasional huge peak with times where the network is quiet 
4002
 
   enough to allow you to work off the queue.  And each packet buffer 
4003
 
   in use takes up memory - (about 1.5MB for a queue of size 2048).
4004
 
</p>
4005
 
<p>
4006
 
   The instantaneous and maximum value for the queue are reported in
4007
 
   the configuration report:
4008
 
</p>
4009
 
 
4010
 
<pre>
4011
 
      # Queued Pkts to Process 0
4012
 
      # Max Queued Pkts 0
4013
 
</pre>
4014
 
<p>
4015
 
   But, again, the best answer for dropped packets is probably a 
4016
 
   faster processor... (Upgrading to an expensive faster NIC with a 
4017
 
   larger internal buffer is rarely the best "bang for the buck" - if 
4018
 
   you were running a server, then a server class NIC is a good idea,
4019
 
   but for workstations or network monitors, etc. you just need something 
4020
 
   that can keep up with the network flow.)
4021
 
</p>
4022
 
<br>
4023
 
<p>
4024
 
<b>Q.</b>&nbsp;
4025
 
 So what do you show?
4026
 
</p>
4027
 
<p>
4028
 
<b>A.</b>&nbsp;
4029
 
 The kicker is that accurate counts of raw and dropped packets do not exist
4030
 
   or are not available without using low-level, system specific logic.
4031
 
</p>
4032
 
<p>
4033
 
   The counts that ARE available in a system-independent way are what is 
4034
 
   reported in the statistics on the Stats | Traffic page.
4035
 
</p>
4036
 
<br>
4037
 
<p>
4038
 
<b>Q.</b>&nbsp;
4039
 
 So what is reported?
4040
 
</p>
4041
 
<p>
4042
 
<b>A.</b>&nbsp;
4043
 
 ntop reports the packet and dropped counts as reported by libpcap and the
4044
 
   received, dropped and processed counts it maintains internally.
4045
 
</p>
4046
 
<br>
4047
 
<p>
4048
 
<b>Q.</b>&nbsp;
4049
 
 So what does ntop do with what it does receive?
4050
 
</p>
4051
 
<p>
4052
 
<b>A.</b>&nbsp;
4053
 
 ntop processes or queues all packets received from libpcap but may drop
4054
 
   packets if the processing queue fills up.  Losing a few packets inside 
4055
 
   ntop due to a rare burst of traffic is just that - rare, and is not a 
4056
 
   'bug'.
4057
 
</p>
4058
 
<p>
4059
 
   If you consistently see packets dropped by ntop then you probably need
4060
 
   to use a faster processor (increasing the buffer size beyond the default
4061
 
   of 2K packets will usually not help).  
4062
 
</p>
4063
 
<br>
4064
 
<p>
4065
 
<b>Q.</b>&nbsp;
4066
 
 How do I tell?
4067
 
</p>
4068
 
<p>
4069
 
<b>A.</b>&nbsp;
4070
 
 You can monitor the queue size on the 'Configuration' (info.html) page.
4071
 
</p>
4072
 
<br>
4073
 
<p>
4074
 
<b>Q.</b>&nbsp;
4075
 
 What about the other dropped items?
4076
 
</p>
4077
 
<p>
4078
 
<b>A.</b>&nbsp;
4079
 
 If you consistently see packets dropped at either the interface or
4080
 
   libpcap level, there is not much we can offer in the way of help for you.
4081
 
</p>
4082
 
<p>
4083
 
   The best suggestion is to try another NIC or a faster machine.  
4084
 
</p>
4085
 
<br>
4086
 
<p>
4087
 
<b>Q.</b>&nbsp;
4088
 
 Why?
4089
 
</p>
4090
 
<p>
4091
 
<b>A.</b>&nbsp;
4092
 
 Some NICs - especially ISA ones - are just too slow at moving packets
4093
 
   off of the card. Measurements I did on an old SMC 10BaseT card in 1993
4094
 
   showed that the best it could do - ISA bus, windows overhead, etc. all
4095
 
   rolled together was about 1.7Mbps.
4096
 
</p>
4097
 
<p>
4098
 
   Memory bus speeds (e.g. PC100 vs PC133, DDR333 vs DDR400, etc.) can also
4099
 
   affect moving packets from the NIC to main memory.
4100
 
</p>
4101
 
<br>
4102
 
<p>
4103
 
<b>Q.</b>&nbsp;
4104
 
 Won't a faster CPU help?
4105
 
</p>
4106
 
<p>
4107
 
<b>A.</b>&nbsp;
4108
 
 Maybe. Some network card drivers are processor intensive - and would
4109
 
   benefit - but others offload most of the processing to the NIC, and so a
4110
 
   faster CPU wouldn't matter.
4111
 
</p>
4112
 
<p>
4113
 
   Even a fancy (read as expensive) NIC may not work well - the drivers
4114
 
   for the NIC on one OS may take advantage of features the card provides 
4115
 
   and be 'faster', while the driver for the same NIC on another OS may 
4116
 
   not take advantage of these features and be 'slower'.
4117
 
</p>
4118
 
<p>
4119
 
   As we say, YMMV...
4120
 
</p>
4121
 
<br>
4122
 
<p>
4123
 
<b>Q.</b>&nbsp;
4124
 
 So?
4125
 
</p>
4126
 
<p>
4127
 
<b>A.</b>&nbsp;
4128
 
 So, remember - ntop drops packets, the kernel drops packets, libpcap drops
4129
 
   packets and none of 'em do it the same way.  Don't bet the farm on counting
4130
 
   every packet with absolute accuracy and use ntop the way it was meant to
4131
 
   be used - showing the overall usage and flows on the network.
4132
 
</p>
4133
 
<p>
4134
 
   Still it's not all gloom and doom!
4135
 
</p>
4136
 
<p>
4137
 
   Even if you're only processing 90% of the traffic, since the drops are
4138
 
   pretty random, it's a decent bet that if 90% of what you DO see is MP3s,
4139
 
   then 90% of the whole traffic flow is probably MP3s.
4140
 
</p>
4141
 
<br>
4142
 
<p>
4143
 
<b>Q.</b>&nbsp;
4144
 
 ntop stops capturing packets, except ARP and other broadcasts. Why?
4145
 
</p>
4146
 
<p>
4147
 
<b>A.</b>&nbsp;
4148
 
 Check if you have a daemon running that periodically checks for and
4149
 
   resets interfaces in promiscuous mode?  If that happens, all you
 
2454
<p><b>Q.</b>&nbsp; But what about -x and -X.</p>
 
2455
<p><b>A.</b>&nbsp; Ah, yes, grasshopper - you have been reading the man page. Good user.   The -x and -X options are pretty crude.  They say "if you have allocated
 
2456
   n (hosts|sessions), fail the allocation of (host|session) n+1".
 
2457
</p>
 
2458
<p>   It works in the context of preventing memory exhaustion - if you can calculate
 
2459
   the right values based on your available memory (and remember that 4K or 12K or
 
2460
   whatever per host value is an AVERAGE).
 
2461
</p>
 
2462
<p>   And, no, you can't make them memory dependent - it's all ultimately virtual and
 
2463
   ntop doesn't get indication of whether a malloc() call causes swapping.  It either
 
2464
   works because the allocation (total) is under your limit (or the hard limit of real
 
2465
   memory + swap space - OS usage), or it fails.
 
2466
</p>
 
2467
<p>   This type of limit can't make sure you save only the RIGHT hosts.
 
2468
</p>
 
2469
<br>
 
2470
<p><b>Q.</b>&nbsp; These options aren't very smart, are they?</p>
 
2471
<p><b>A.</b>&nbsp; No. They don't know anything about the hosts. Just the # of them. So failing   an allocation might hurt in that the n+1th host might be an important one and yet 
 
2472
   host #2 is basically trivial junk (the printer that sends and "I'm here" message
 
2473
   every three minutes).
 
2474
</p>
 
2475
<p>   It also causes overhead, because the next packet for host n+1 will attempt to
 
2476
   allocate a record and fail.  Again and again.
 
2477
</p>
 
2478
<p>   But these options may keep ntop from crashing and that's a good thing.
 
2479
</p>
 
2480
<p>   If you use them, I would recommend setting them very high - just at the limit 
 
2481
   of what your memory permits.  Use this as a last resort - say you get hit by
 
2482
   a worm or virus.
 
2483
</p>
 
2484
<p>   I recommend that you use other options such as filter and track-local-hosts for 
 
2485
   the day-to-day controls on what ntop tracks.
 
2486
</p>
 
2487
<br>
 
2488
<p><b>Q.</b>&nbsp; Why does ntop drop packets?</p>
 
2489
<p><b>A.</b>&nbsp; We used to have an extensive discussion here. But with Luca's merge of ntop-ht   into baseline, we shouldn't be dropping packets beyond whatever the OS is dropping.
 
2490
</p>
 
2491
<p>   Until we've learned enought about ntop 3.2 and following, the whole discussion
 
2492
   has been moved to FAQarchive.
 
2493
</p>
 
2494
<br>
 
2495
<p><b>Q.</b>&nbsp; ntop stops capturing packets, except ARP and other broadcasts. Why?</p>
 
2496
<p><b>A.</b>&nbsp; Check if you have a daemon running that periodically checks for and   resets interfaces in promiscuous mode?  If that happens, all you
4150
2497
   would see were broadcast packets like ARPs...
4151
2498
</p>
4152
 
<p>
4153
 
   Check back in the log and see if there is a message about the interface
 
2499
<p>   Check back in the log and see if there is a message about the interface
4154
2500
   changing status.  Determine why.
4155
2501
</p>
4156
2502
<br>
4157
 
<p>
4158
 
<b>Q.</b>&nbsp;
4159
 
 How much horsepower do I need to run ntop on a network of size x?
4160
 
</p>
4161
 
<p>
4162
 
<b>A.</b>&nbsp;
4163
 
 Nobody really knows. ntop needs enough memory to store the active
4164
 
   hosts and enough cpu to keep up with the average packet flow.  The
 
2503
<p><b>Q.</b>&nbsp; How much horsepower do I need to run ntop on a network of size x?</p>
 
2504
<p><b>A.</b>&nbsp; Nobody really knows. ntop needs enough memory to store the active   hosts and enough cpu to keep up with the average packet flow.  The
4165
2505
   buffer will handle the occasional peak, but if you see frequent
4166
2506
   lost packets, you're in trouble.
4167
2507
</p>
4168
 
<p>
4169
 
   Note that a few packets occasionally lost isn't a big deal for most
 
2508
<p>   Note that a few packets occasionally lost isn't a big deal for most
4170
2509
   users.  After all, the network itself has losses - I've seen my AT&T
4171
2510
   Broadband connection have spurts of 30% packet loss.  Ideally in a
4172
2511
   LAN environment, the packet loss should be down in the small #s...
4173
2512
   the Ethernet standard allows 1  error in 100,000,000(10^8), but most
4174
2513
   vendors beat that by a long margin (even as high as 1 in 10^12).
4175
2514
</p>
4176
 
<p>
4177
 
   Of course, those are lab measurements.  In the real world?  Not that good.
 
2515
<p>   Of course, those are lab measurements.  In the real world?  Not that good.
4178
2516
   Electrical noise can be a real bugaboo. Remember, at a certain point, if
4179
2517
   the NIC doesn't understand what it's seeing, it throws it away and
4180
2518
   declares an error.  The key is to keep up with the traffic.
4181
2519
</p>
4182
 
<p>
4183
 
   Similarly, the OS kernel does the same thing in it's interrupt handling
 
2520
<p>   Similarly, the OS kernel does the same thing in it's interrupt handling
4184
2521
   (throw away packets).  Last resort, but better than hanging up the whole
4185
2522
   machine.
4186
2523
</p>
4187
 
<p>
4188
 
   ntop drops packets when the queue gets longer than the permitted length.
 
2524
<p>   ntop drops packets when the queue gets longer than the permitted length.
4189
2525
   You can see this in the configuration page as # Queued Pkts to Process
4190
2526
   and # Max Queued Pkts.
4191
2527
</p>
4192
 
<p>
4193
 
   One or two or a small number (you pick your tolerance) is ok, but constant
 
2528
<p>   One or two or a small number (you pick your tolerance) is ok, but constant
4194
2529
   losses isn't.  What I'm saying is that as long as ntop can keep up with the
4195
2530
   NIC, then the data is as good as it gets...  if ntop can't keep up, then the
4196
2531
   data isn't very good.
4197
2532
</p>
4198
 
<p>
4199
 
   If you have measurements - network size, traffic flow and %CPU used (with
 
2533
<p>   If you have measurements - network size, traffic flow and %CPU used (with
4200
2534
   the hardware info, of course), shoot them over to us on ntop and someday
4201
2535
   maybe we'll be able to give better #s.
4202
2536
</p>
4203
2537
<br>
4204
 
<p>
4205
 
<b>Q.</b>&nbsp;
4206
 
 What about my Frobozz Model xx Magic Network card? Is it good enough?
4207
 
</p>
4208
 
<p>
4209
 
<b>A.</b>&nbsp;
4210
 
 Probably. Well, a lot of the cheapos just don't have the buffering
4211
 
   and cpu offload of a 3c905c or such.  If the network isn't that busy,
 
2538
<p><b>Q.</b>&nbsp; What about my Frobozz Model xx Magic Network card? Is it good enough?</p>
 
2539
<p><b>A.</b>&nbsp; Probably. Well, a lot of the cheapos just don't have the buffering   and cpu offload of a 3c905c or such.  If the network isn't that busy,
4212
2540
   anything will do.  For a busy network, buy a decent PCI NIC.
4213
2541
</p>
4214
2542
<br>
4215
 
<p>
4216
 
<b>Q.</b>&nbsp;
4217
 
 Gigabit Ethernet?
4218
 
</p>
4219
 
<p>
4220
 
<b>A.</b>&nbsp;
4221
 
 No clue. Remember that you can suck a lot more traffic over that
4222
 
   network than an old PC can handle (i.e. the bandwidth limitations
 
2543
<p><b>Q.</b>&nbsp; Gigabit Ethernet?</p>
 
2544
<p><b>A.</b>&nbsp; No clue. Remember that you can suck a lot more traffic over that   network than an old PC can handle (i.e. the bandwidth limitations
4223
2545
   of 32bit PCI and PC100/133 RAM, heck even PC2700 DDR).  
4224
2546
</p>
4225
2547
<br>
4226
 
<p>
4227
 
<b>Q.</b>&nbsp;
4228
 
 Do "zero copy" drivers help?
4229
 
</p>
4230
 
<p>
4231
 
<b>A.</b>&nbsp;
4232
 
 Yeah. Maybe. Once upon a time, I read about "zero copy" - look here
4233
 
   http://people.freebsd.org/~ken/zero_copy/ for the FreeBSD stuff. Quoting:
 
2548
<p><b>Q.</b>&nbsp; Do "zero copy" drivers help?</p>
 
2549
<p><b>A.</b>&nbsp; Yeah. Maybe. Once upon a time, I read about "zero copy" - look here   http://people.freebsd.org/~ken/zero_copy/ for the FreeBSD stuff. Quoting:
4234
2550
</p>
4235
2551
 
4236
2552
<pre>
4264
2580
      decrease system load when CPU or memory bandwidth isn't the 
4265
2581
      limiting factor."
4266
2582
</pre>
4267
 
<p>
4268
 
   What's that mean?  It means that BEST CASE, you have to copy the data 
 
2583
<p>   What's that mean?  It means that BEST CASE, you have to copy the data 
4269
2584
   NIC->Kernel and without zero copy, it happens TWICE.  Then, once you're
4270
2585
   in the kernel, it has to hand the data off to libpcap (another copy) 
4271
2586
   and from libpcap to ntop.  So we're moving the data 3 or 4 times... 
4272
2587
   best case!
4273
2588
</p>
4274
 
<p>
4275
 
   Let's do some off the cuff math.  Looking here
 
2589
<p>   Let's do some off the cuff math.  Looking here
4276
2590
</p>
4277
2591
<pre>
4278
2592
      http://www6.tomshardware.com/mainboard/20020501/ddr400vsrambus-05.html
4285
2599
      PC133  SDRAM       133 MHz     64 Bit  1,06 GBb/s
4286
2600
      PC2700 DDR333      166 MHz     64 Bit  2,7 GB/s
4287
2601
</pre>
4288
 
<p>
4289
 
   See the problem?  A fully loaded GigE link is 1 Gb/s.  4x that is 0.5 
 
2602
<p>   See the problem?  A fully loaded GigE link is 1 Gb/s.  4x that is 0.5 
4290
2603
   GB/s - so if ALL that's going on is the capture of packets from the network,
4291
2604
   the CPU can keep up.  Maybe.  Those bandwidth numbers are theoretical, best
4292
2605
   case (nice sequential access).  Throw in some other system activity, cache 
4293
2606
   misses and CAS/RAS issues... and um...
4294
2607
</p>
4295
 
<p>
4296
 
   The moral is that if you're going to use ntop to monitor big fat links,
 
2608
<p>   The moral is that if you're going to use ntop to monitor big fat links,
4297
2609
   you need screaming fast iron.
4298
2610
</p>
4299
2611
<br>
4300
 
<p>
4301
 
<b>Q.</b>&nbsp;
4302
 
 Can I disable logging? Totally?
4303
 
</p>
4304
 
<p>
4305
 
<b>A.</b>&nbsp;
4306
 
 Sort of - if you run single threaded, without the -d or -L options.
4307
 
   Multithreaded?  No.  If ntop creates child threads, they don't have
4308
 
   terminal access and have to have some way of reporting things.
4309
 
</p>
 
2612
<p><b>Q.</b>&nbsp; Can I disable logging? Totally?</p>
 
2613
<p><b>A.</b>&nbsp; No.</p>
4310
2614
<br>
4311
 
<p>
4312
 
<b>Q.</b>&nbsp;
4313
 
 I'm seeing weird "hosts" on my network with names like
4314
 
   "Bridge Sp. Tree/OSI Route".
 
2615
<p><b>Q.</b>&nbsp; I'm seeing weird "hosts" on my network with names like   "Bridge Sp. Tree/OSI Route".
4315
2616
   What are they?
4316
2617
</p>
4317
 
<p>
4318
 
<b>A.</b>&nbsp;
4319
 
 There is a list of "special" MAC address prefixes in vendor.c,
4320
 
   specialMacInfo[].  There are blocks of MAC addresses reserved (sometimes not
 
2618
<p><b>A.</b>&nbsp; There is a list of "special" MAC address prefixes in vendor.c,   specialMacInfo[].  There are blocks of MAC addresses reserved (sometimes not
4321
2619
   formally) for special uses, such as sharing information about Spanning Tree
4322
2620
   for bridges.  These do not have an IP address - they operate at a lower
4323
2621
   level - so nothing gets displayed in some of ntop's fields.
4324
2622
</p>
4325
 
<p>
4326
 
   A reference about protocols at the wire level is here:
 
2623
<p>   A reference about protocols at the wire level is here:
4327
2624
</p>
4328
2625
<pre>
4329
2626
      http://www.oreillynet.com/pub/a/network/2001/03/02/net_2nd_lang.html
4330
2627
</pre>
4331
 
<p>
4332
 
   If you only want to see TCP/IP, then I suggest you use -B "ip" to filter
 
2628
<p>   If you only want to see TCP/IP, then I suggest you use -B "ip" to filter
4333
2629
   only TCP/IP protocol on your ntop line...
4334
2630
</p>
4335
2631
<br>
4336
 
<p>
4337
 
<b>Q.</b>&nbsp;
4338
 
 How do I see fully qualified names for all my hosts? Some are netbios
4339
 
   names!
4340
 
</p>
4341
 
<p>
4342
 
<b>A.</b>&nbsp;
4343
 
 ntop doesn't SEND NetBIOS queries, it sniffs them off the traffic already on
4344
 
   the network.
4345
 
</p>
4346
 
<p>
4347
 
   There is only ONE case where ntop uses the NetBIOS names, which is if
 
2632
<p><b>Q.</b>&nbsp; How do I see fully qualified names for all my hosts? Some are netbios   names!
 
2633
</p>
 
2634
<p><b>A.</b>&nbsp; ntop doesn't SEND NetBIOS queries, it sniffs them off the traffic already on   the network.
 
2635
</p>
 
2636
<p>   There is only ONE case where ntop uses the NetBIOS names, which is if
4348
2637
   it can't resolve them via DNS (both it's own queries and from sniffing
4349
2638
   responses to other's queries off the network).
4350
2639
</p>
4351
 
<p>
4352
 
   So, if you have a properly functioning DNS, you'll see DNS names.  If
 
2640
<p>   So, if you have a properly functioning DNS, you'll see DNS names.  If
4353
2641
   these are (for example) internal names, unknown to the DNS server, you'll
4354
2642
   see NetBIOS names if they are available.  Lastly, you'll get IP addresses...
4355
2643
</p>
4356
 
<p>
4357
 
   If you do have a DNS, and the name is resolved as part of the default
 
2644
<p>   If you do have a DNS, and the name is resolved as part of the default
4358
2645
   domain, you won't see a fully qualified name back from the DNS, so ntop
4359
2646
   won't have that information.
4360
2647
</p>
4361
 
<p>
4362
 
   So, on a real network you'll often get a mix of name resolution types:
 
2648
<p>   So, on a real network you'll often get a mix of name resolution types:
4363
2649
</p>
4364
2650
 
4365
2651
<pre>
4373
2659
    12-xxx-xxx-yyy.client.attbi.com 12.xxx.xxx.yyy
4374
2660
</pre>
4375
2661
<br>
4376
 
<p>
4377
 
<b>Q.</b>&nbsp;
4378
 
 What does this log message (and others like it) mean?
4379
 
   **WARNING** releaseMutex() call with an UN-LOCKED mutex [hash.c:559] last
 
2662
<p><b>Q.</b>&nbsp; What does this log message (and others like it) mean?   **WARNING** releaseMutex() call with an UN-LOCKED mutex [hash.c:559] last
4380
2663
</p>
4381
2664
<pre>
4382
2665
               unlock [pid 22176, pbuf.c:2598]
4383
2666
</pre>
4384
 
<p>
4385
 
<b>A.</b>&nbsp;
4386
 
 Those messages are part of an error check in our mutex handling routines.
4387
 
</p>
4388
 
<p>
4389
 
   Actually they pretty much mean what they say.
4390
 
</p>
4391
 
<p>
4392
 
   releaseMutex() call with an UN-LOCKED mutex means that the corresponding
 
2667
<p><b>A.</b>&nbsp; Those messages are part of an error check in our mutex handling routines.</p>
 
2668
<p>   If things are working properly, then these messages tell us things are 
 
2669
   really, really, really wrong.
 
2670
</p>
 
2671
<p>   releaseMutex() call with an UN-LOCKED mutex means that the corresponding
4393
2672
   accessMutex() call never occured.
4394
2673
</p>
4395
 
<p>
4396
 
   releaseMutex() call with an UN-INITIALIZED mutex means that the 
 
2674
<p>   releaseMutex() call with an UN-INITIALIZED mutex means that the 
4397
2675
   access/release occured before the createMutex().
4398
2676
</p>
4399
 
<p>
4400
 
   The file/line comments, [hash.c:559] last unlock [pid 22176, pbuf.c:2598],
4401
 
   tell you where the access/release was called from (e.g. hash.c @ 559) and
4402
 
   where the last recorded release was.
4403
 
</p>
4404
 
<p>
4405
 
   There are others, look in leaks.c for the entire set.
4406
 
</p>
4407
 
<br>
4408
 
<p>
4409
 
<b>Q.</b>&nbsp;
4410
 
 How serious are they?
4411
 
</p>
4412
 
<p>
4413
 
<b>A.</b>&nbsp;
4414
 
 None of these stop ntop from processing, but they're indications of
4415
 
   unprotected accesses to shared data areas, which could lead to lost counts.
4416
 
</p>
4417
 
<p>
4418
 
   Now understand that there's one set of conditions where I believe it doesn't
4419
 
   matter, and that's when there are multiple NICs and multiple processors.  
4420
 
   Under some circumstances - not well understood - gcc with the -O2 option 
4421
 
   reorders the executable code in such a way as to cause these messages.  
4422
 
   Those are spurious.
4423
 
</p>
4424
 
<p>
4425
 
   But for most users, these warning messages shouldn't be ignored if they occur
4426
 
   often.
4427
 
</p>
4428
 
<p>
4429
 
   The problem is that a POSIX mutex doesn't allow for additional data, 
4430
 
   such as we're using to track the access / release information.  So that 
4431
 
   data is, itself protected by a single global mutex.  You can't hold that
4432
 
   global mutex across an access call, or you'll deadlock ntop (either through
4433
 
   normal mutex processing or something called 'priority inversion').
4434
 
</p>
4435
 
<p>
4436
 
   So we use this pattern instead:
4437
 
</p>
4438
 
 
4439
 
<pre>
4440
 
      access(stateChangeMutex)
4441
 
        set state data
4442
 
      release(stateChangeMutex)
4443
 
</pre>
4444
 
 
4445
 
<pre>
4446
 
      access(mutex) or release(mutex)
4447
 
</pre>
4448
 
 
4449
 
<pre>
4450
 
      access(stateChangeMutex)
4451
 
        set state data
4452
 
      release(stateChangeMutex)
4453
 
</pre>
4454
 
<p>
4455
 
   The problem is that these updates aren't atomic, so it's possible to have
4456
 
   the state data updated by another thread:
4457
 
</p>
4458
 
 
4459
 
<pre>
4460
 
      ---------thread A---------         ---------thread B---------
4461
 
      access(stateChangeMutex)
4462
 
        set state data
4463
 
                                         access(stateChangeMutex)
4464
 
                                         *****blocked****
4465
 
      release(stateChangeMutex)
4466
 
                                         (resumes)
4467
 
                                           set state data
4468
 
                                         release(stateChangeMutex)
4469
 
      access(mutex)
4470
 
      ****blocked****
4471
 
                                         release(mutex)
4472
 
      (resumes)
4473
 
                                         access(stateChangeMutex)
4474
 
                                           set state data
4475
 
                                         release(stateChangeMutex)
4476
 
</pre>
4477
 
 
4478
 
<pre>
4479
 
      access(stateChangeMutex)
4480
 
        set state data
4481
 
      release(stateChangeMutex)
4482
 
</pre>
4483
 
 
4484
 
<pre>
4485
 
      Unfortunately, this is equally likely:
4486
 
</pre>
4487
 
 
4488
 
<pre>
4489
 
      ---------thread A---------         ---------thread B---------
4490
 
      access(stateChangeMutex)
4491
 
        set state data
4492
 
                                         access(stateChangeMutex)
4493
 
                                         *****blocked****
4494
 
      release(stateChangeMutex)
4495
 
                                         (resumes)
4496
 
                                           set state data
4497
 
                                         release(stateChangeMutex)
4498
 
      access(mutex)
4499
 
      ****blocked****
4500
 
                                         release(mutex)
4501
 
      (resumes)
4502
 
      access(stateChangeMutex)
4503
 
        set state data
4504
 
      release(stateChangeMutex)
4505
 
                                         access(stateChangeMutex)
4506
 
                                           set state data
4507
 
                                         release(stateChangeMutex)
4508
 
</pre>
4509
 
<p>
4510
 
   So at the end, you have an inaccurate picture in the state table.
4511
 
</p>
4512
 
<br>
4513
 
<p>
4514
 
<b>Q.</b>&nbsp;
4515
 
 Threads. ugh...
4516
 
</p>
4517
 
<p>
4518
 
<b>A.</b>&nbsp;
4519
 
 There's a good set of articles on POSIX threads at
4520
 
</p>
 
2677
<p>   The file/line comments, e.g. [hash:559], tell you where the access/release 
 
2678
   was called from (e.g. hash.c @ 559) and where the last recorded release was.
 
2679
</p>
 
2680
<p>   There are others, look in leaks.c for the entire set.
 
2681
</p>
 
2682
<br>
 
2683
<p><b>Q.</b>&nbsp; How serious are they?</p>
 
2684
<p><b>A.</b>&nbsp; None of these stop ntop from processing, but they're indications of   unprotected accesses to shared data areas, which could lead to lost counts.
 
2685
</p>
 
2686
<p>   In the development cycle after 3.1 was released, I was able to track down
 
2687
   and fix the remaining cause of spurious messages (but I've thought this was
 
2688
   fixed before).
 
2689
</p>
 
2690
<p>   For most users, these warning messages shouldn't be ignored.
 
2691
</p>
 
2692
<p>   The root of the problem is that POSIX mutexes are stupid and don't record
 
2693
   a lot of state information.  To debug things like deadlock, it's really,
 
2694
   really, nice to know where the mutex was locked from.
 
2695
</p>
 
2696
<p>   So ntop has added 'extra' information to the mutex data for recording this.
 
2697
   This added data is not protected by the mutex and could get out of sync.
 
2698
   So we lock a state change mutex whenever we are changing the state data.
 
2699
</p>
 
2700
<p>   BUT: You can't hold the state change mutex while waiting for the main mutex
 
2701
   or you deadlock.
 
2702
</p>
 
2703
<p>   So the 'access' call becomes this pattern (see utils.c):
 
2704
</p>
 
2705
<p>   lock(statechangemutex)
 
2706
</p>
 
2707
<pre>
 
2708
     set state data
 
2709
</pre>
 
2710
 
 
2711
<pre>
 
2712
     tryLock(mutex)
 
2713
     if(fails) {
 
2714
       unlock(statechangemutex)
 
2715
       lock(mutex)  <-- which may block, but does not hold the statechangemutex!
 
2716
       lock(statechangemutex)
 
2717
     }
 
2718
     set state data
 
2719
     unlock(statechangemutex)
 
2720
</pre>
 
2721
<br>
 
2722
<p><b>Q.</b>&nbsp; Threads. ugh...</p>
 
2723
<p><b>A.</b>&nbsp; There's a good set of articles on POSIX threads at</p>
4521
2724
<pre>
4522
2725
      http://www-106.ibm.com/developerworks/library/l-posix1/,
4523
2726
      http://www-106.ibm.com/developerworks/library/l-posix2/ and
4524
2727
      http://www-106.ibm.com/developerworks/library/l-posix3/.
4525
2728
</pre>
4526
2729
<br>
4527
 
<p>
4528
 
<b>Q.</b>&nbsp;
4529
 
 What does the message "URL security(1): ERROR: Found percent in
4530
 
   URL...DANGER... rejecting request" mean?
 
2730
<p><b>Q.</b>&nbsp; What does the message "URL security(1): ERROR: Found percent in   URL...DANGER... rejecting request" mean?
4531
2731
</p>
4532
 
<p>
4533
 
<b>A.</b>&nbsp;
4534
 
 It means that ntop received a request with a percent sign (%) in it, often
4535
 
   used as part of Unicode exploits against various web servers.  Since there is
 
2732
<p><b>A.</b>&nbsp; It means that ntop received a request with a percent sign (%) in it, often   used as part of Unicode exploits against various web servers.  Since there is
4536
2733
   no situation where ntop should process this, we reject it.
4537
2734
   URLsecurity in http.c is the place where these tests occur.
4538
2735
</p>
4539
2736
<br>
4540
 
<p>
4541
 
<b>Q.</b>&nbsp;
4542
 
 What does the message "Rejected request from address x.y.z.t (it previously
4543
 
   sent ntop a bad request)" mean?
 
2737
<p><b>Q.</b>&nbsp; What does the message "Rejected request from address x.y.z.t (it previously   sent ntop a bad request)" mean?
4544
2738
</p>
4545
 
<p>
4546
 
<b>A.</b>&nbsp;
4547
 
 Once you send ntop a request that URLsecurity rejects, the sending address
4548
 
   goes into a ring buffer on a 5 minute timeout where we simply drop subsequent
 
2739
<p><b>A.</b>&nbsp; Once you send ntop a request that URLsecurity rejects, the sending address   goes into a ring buffer on a 5 minute timeout where we simply drop subsequent
4549
2740
   requests...  rather than waste cycles ignoring an attack...
4550
2741
</p>
4551
2742
<br>
4552
 
<p>
4553
 
<b>Q.</b>&nbsp;
4554
 
 What are the other URL security(#) codes?
4555
 
</p>
4556
 
<p>
4557
 
<b>A.</b>&nbsp;
4558
 
 1. Found a % in the request (Unicode problems)
4559
 
   2.  Found a parameter type code (//, &&, ??)
 
2743
<p><b>Q.</b>&nbsp; What are the other URL security(#) codes?</p>
 
2744
<p><b>A.</b>&nbsp; 1. Found a % in the request (Unicode problems)   2.  Found a parameter type code (//, &&, ??)
4560
2745
   3.  Found a directory transversal code (..)
4561
2746
   4.  Found a prohibited (RFC1945) character
4562
2747
   5.  Found a bad extension
4563
2748
</p>
4564
2749
<br>
4565
 
<p>
4566
 
<b>Q.</b>&nbsp;
4567
 
 ntop doesn't report any traffic at all.
4568
 
</p>
4569
 
<p>
4570
 
<b>A.</b>&nbsp;
4571
 
 Understand how ntop works: It simply listens on the interface(s) for
4572
 
   packets, then counts and interprets them.  If there aren't any packets, ntop
 
2750
<p><b>Q.</b>&nbsp; ntop doesn't report any traffic at all.</p>
 
2751
<p><b>A.</b>&nbsp; Understand how ntop works: It simply listens on the interface(s) for   packets, then counts and interprets them.  If there aren't any packets, ntop
4573
2752
   doesn't count things.
4574
2753
</p>
4575
 
<p>
4576
 
   ntop does not sample.  It processes every packet it sees and counts them.
 
2754
<p>   ntop does not sample.  It processes every packet it sees and counts them.
4577
2755
   Only if there is more traffic than ntop can handle for a long period of time
4578
2756
   will the packet queue hit it's limit and packets be lost.  But this is still
4579
2757
   not sampling.
4580
2758
</p>
4581
 
<p>
4582
 
   Make sure that there's traffic on the interface(s) you are using. You can
 
2759
<p>   Make sure that there's traffic on the interface(s) you are using. You can
4583
2760
   use tcpdump or a similar network sniffer tool to check.
4584
2761
</p>
4585
 
<p>
4586
 
   If you are on a segmented network (i.e. switched), you may not see traffic
 
2762
<p>   If you are on a segmented network (i.e. switched), you may not see traffic
4587
2763
   that isn't destined for the ntop machine unless you configure the switch to
4588
2764
   set the port for the ntop host into "mirror" or "management" mode (different
4589
2765
   vendors call it different things, but it's a mode where ALL traffic is copied
4590
2766
   to a specific port, regardless of which port the destination host is on).
4591
2767
</p>
4592
 
<p>
4593
 
   If there is more than one interface in the ntop host, perhaps you aren't
 
2768
<p>   If there is more than one interface in the ntop host, perhaps you aren't
4594
2769
   listening on the one that has traffic?  Check using ifconfig:
4595
2770
</p>
4596
 
<p>
4597
 
   eth0      Link encap:Ethernet  HWaddr 00:D0:09:77:85:B9
 
2771
<p>   eth0      Link encap:Ethernet  HWaddr 00:D0:09:77:85:B9
4598
2772
</p>
4599
2773
<pre>
4600
2774
             inet addr:192.168.0.34  Bcast:192.168.0.255  Mask:255.255.255.0
4605
2779
             RX bytes:119869887 (114.3 Mb)  TX bytes:112203781 (107.0 Mb)
4606
2780
             Interrupt:11 Base address:0xc000
4607
2781
</pre>
4608
 
<p>
4609
 
   If the RX and TX numbers are increasing, this shows that traffic IS
 
2782
<p>   If the RX and TX numbers are increasing, this shows that traffic IS
4610
2783
   flowing...
4611
2784
</p>
4612
 
<p>
4613
 
   If you have an unnumbered interface (listening only), remember you need to
 
2785
<p>   If you have an unnumbered interface (listening only), remember you need to
4614
2786
   use -m to tell ntop what is local and what isn't:
4615
2787
</p>
4616
 
<p>
4617
 
   eth1      Link encap:Ethernet  HWaddr 00:30:F1:54:55:00
 
2788
<p>   eth1      Link encap:Ethernet  HWaddr 00:30:F1:54:55:00
4618
2789
</p>
4619
2790
<pre>
4620
2791
             UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
4623
2794
             collisions:0 txqueuelen:100
4624
2795
             RX bytes:566953031 (540.6 Mb)  TX bytes:0 (0.0 b)
4625
2796
</pre>
4626
 
<p>
4627
 
   You can select an interface using the '-i' flag, e.g. -i eth1 or
 
2797
<p>   You can select an interface using the '-i' flag, e.g. -i eth1 or
4628
2798
   -i eth0,eth1.
4629
2799
</p>
4630
2800
<br>
4631
 
<p>
4632
 
<b>Q.</b>&nbsp;
4633
 
 ntop doesn't understand xxxxx?
4634
 
</p>
4635
 
<p>
4636
 
<b>A.</b>&nbsp;
4637
 
 True. IP Packets have a source address & port and a destination address &
4638
 
   port... you MUST get your head out of the application layers and revert to
 
2801
<p><b>Q.</b>&nbsp; ntop doesn't understand xxxxx?</p>
 
2802
<p><b>A.</b>&nbsp; True. IP Packets have a source address & port and a destination address &   port... you MUST get your head out of the application layers and revert to
4639
2803
   that simple concept.
4640
2804
</p>
4641
 
<p>
4642
 
   How does Apache handle virtual hosts? It analyzes the flow at the
 
2805
<p>   How does Apache handle virtual hosts? It analyzes the flow at the
4643
2806
   application level (layer 4) not the wire/packet/protocol (layers 1, 2 and
4644
2807
   3).  It does this by re-assembling packets into a layer 4 message (e.g. GET
4645
2808
   http://virtual.host.name.com/page.html)...
4646
2809
</p>
4647
 
<p>
4648
 
   Now there are some layer 4 analysis routines - virtual hosts was added in
 
2810
<p>   Now there are some layer 4 analysis routines - virtual hosts was added in
4649
2811
   2.2 (and the folks who have virtual hosts have been pretty pleased), ftp, 
4650
2812
   http, and some others - mostly looking for traffic on non-standard
4651
2813
   ports, etc.
4652
2814
</p>
4653
 
<p>
4654
 
   So, since ntop works at the packet level, it doesn't understand virtual
 
2815
<p>   So, since ntop works at the packet level, it doesn't understand virtual
4655
2816
   hosts. Unless it's SPECIFICALLY coded for.  ntop is a NETWORK analyzer, not 
4656
2817
   an application level one.
4657
2818
</p>
4658
2819
<br>
4659
 
<p>
4660
 
<b>Q.</b>&nbsp;
4661
 
 tcpwrappers doesn't work
4662
 
</p>
4663
 
<p>
4664
 
<b>A.</b>&nbsp;
4665
 
 Oh yes it does... for http: connections
4666
 
</p>
4667
 
<p>
4668
 
   1) You have to configure it this way before compiling ntop:
 
2820
<p><b>Q.</b>&nbsp; tcpwrappers doesn't work</p>
 
2821
<p><b>A.</b>&nbsp; Oh yes it does... for http: connections</p>
 
2822
<p>   1) You have to configure it this way before compiling ntop:
4669
2823
</p>
4670
2824
<pre>
4671
2825
        ./configure --enable-tcpwrap
4672
2826
</pre>
4673
 
<p>
4674
 
   2) You must have the headers and libraries installed on the build machine
 
2827
<p>   2) You must have the headers and libraries installed on the build machine
4675
2828
</p>
4676
2829
<pre>
4677
2830
      (and on the execution machine if they aren't the same).
4678
2831
</pre>
4679
 
<p>
4680
 
   Remember to make the appropriate entries in hosts.allow (e.g. 
 
2832
<p>   Remember to make the appropriate entries in hosts.allow (e.g. 
4681
2833
   ntop:192.168.0.) and hosts.deny (e.g. ntop:ALL)
4682
2834
</p>
4683
 
<p>
4684
 
   However, tcpwrappers and https:// is known not to work - see docs/KNOWN_BUGS
 
2835
<p>   However, tcpwrappers and https:// is known not to work - see docs/KNOWN_BUGS
4685
2836
</p>
4686
2837
<br>
4687
 
<p>
4688
 
<b>Q.</b>&nbsp;
4689
 
 My filter doesn't work! I'm running ntop like this:
4690
 
</p>
 
2838
<p><b>Q.</b>&nbsp; My filter doesn't work! I'm running ntop like this:</p>
4691
2839
<pre>
4692
 
      /usr/local/bin/ntop -u nobody -L -d -E -w 3000 -S 2 \
 
2840
      /usr/local/bin/ntop -u nobody -L -d -E -w 3000 \
4693
2841
                      -m 192.168.10.0/24,xxx.xxx.xxx.xxx/32 \
4694
2842
                      -M -i eth0,eth1 \
4695
2843
                      (src net 192.168.10.0/24 or src host xxx.xxx.xxx.xxx ) \
4696
2844
                       and not dst net 192.168.10.0/24
4697
2845
</pre>
4698
 
<p>
4699
 
<b>A.</b>&nbsp;
4700
 
 Yup, it doesn't work. Use the -B option and put the filter in quotes:
4701
 
</p>
 
2846
<p><b>A.</b>&nbsp; Yup, it doesn't work. Use the -B option and put the filter in quotes:</p>
4702
2847
<pre>
4703
2848
      -B "(src net 192.168.10.0/24 or src host xxx.xxx.xxx.xxx ) and 
4704
2849
           not dst net 192.168.10.0/24"
4705
2850
</pre>
4706
 
<p>
4707
 
   ntop used to assume anything it didn't recognize was a filter.  But not since 
 
2851
<p>   ntop used to assume anything it didn't recognize was a filter.  But not since 
4708
2852
   2.1.3.  If you try this now, you should see a log warning that says maybe you
4709
2853
   forgot the quotes
4710
2854
</p>
4711
2855
<br>
4712
 
<p>
4713
 
<b>Q.</b>&nbsp;
4714
 
 I have experienced problems defining multiple filters: ntop reports 'syntax
4715
 
   error'
 
2856
<p><b>Q.</b>&nbsp; I have experienced problems defining multiple filters: ntop reports 'syntax   error'
4716
2857
</p>
4717
 
<p>
4718
 
<b>A.</b>&nbsp;
4719
 
 If you believe the filter is syntactically correct then it's likely that the
4720
 
   Libpcap you have used has been compiled using an old non-reentrant version of
 
2858
<p><b>A.</b>&nbsp; If you believe the filter is syntactically correct then it's likely that the   Libpcap you have used has been compiled using an old non-reentrant version of
4721
2859
   flex.  Please make sure you're using version 2.5.4 or above.
4722
2860
</p>
4723
2861
<br>
4724
 
<p>
4725
 
<b>Q.</b>&nbsp;
4726
 
 Can you give some additional examples of filters?
4727
 
</p>
4728
 
<p>
4729
 
<b>A.</b>&nbsp;
4730
 
 man tcpdump -- see "expression"
4731
 
</p>
4732
 
<p>
4733
 
   A couple of simple examples, courtesy of B. Loic:
 
2862
<p><b>Q.</b>&nbsp; Can you give some additional examples of filters?</p>
 
2863
<p><b>A.</b>&nbsp; man tcpdump -- see "expression"</p>
 
2864
<p>   A couple of simple examples, courtesy of B. Loic:
4734
2865
</p>
4735
2866
 
4736
2867
<pre>
4737
2868
       -B "host not 192.168.1.100 and not 192.168.1.101"
4738
2869
</pre>
4739
 
<p>
4740
 
   to exclude hosts 192.168.1.100 and 192.168.1.101 from tracking (FQDN 
 
2870
<p>   to exclude hosts 192.168.1.100 and 192.168.1.101 from tracking (FQDN 
4741
2871
   such as www.yahoo.com will work too). 
4742
2872
</p>
4743
 
<p>
4744
 
   If you need to exclude a full IP range, you will want to use something like
 
2873
<p>   If you need to exclude a full IP range, you will want to use something like
4745
2874
</p>
4746
2875
 
4747
2876
<pre>
4748
2877
        -B "net not 192.168.1.0/24" 
4749
2878
</pre>
 
2879
<br>
 
2880
<p><b>Q.</b>&nbsp; What about the backtrace?</p>
 
2881
<p><b>A.</b>&nbsp; Sadly, probably useless. Why? Too much information isn't available:</p>
 
2882
 
 
2883
<pre>
 
2884
  Here's one (and a pretty good, obvious one at that):
 
2885
</pre>
 
2886
 
 
2887
<pre>
 
2888
      ntop[23720]:   **FATAL_ERROR** RRD: caught signal 11 SIGSEGV
 
2889
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE: backtrace is:
 
2890
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE:  1. /usr/bin/ntop [0x42028c48]
 
2891
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE:  2. /usr/bin/ntop(getopt_long+0x43) [0x420c4e83]
 
2892
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE:  3. /usr/lib/ntop/plugins/rrdPlugin.so(rrd_update+0x61) [0x44157f7d]
 
2893
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE:  4. /usr/lib/ntop/plugins/rrdPlugin.so [0x441481a2]
 
2894
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE:  5. /usr/lib/ntop/plugins/rrdPlugin.so(updateCounter+0x19) [0x44148a15]
 
2895
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE:  6. /usr/lib/ntop/plugins/rrdPlugin.so [0x4414ba49]
 
2896
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE:  7. /lib/i686/libpthread.so.0 [0x41138941]
 
2897
      ntop[23720]:   **FATAL_ERROR** RRD: BACKTRACE:  8. /usr/bin/ntop(__clone+0x3a) [0x420da1ca]
 
2898
</pre>
 
2899
 
 
2900
<pre>
 
2901
    See: It doesn't give the routines, just the hex offsets from some points in the executable.
 
2902
    It seems to say that rrdPlugin's updateCounter called rrd_update which called getopt_long. But
 
2903
    then getopt_long called something else and that's what died...  plus we don't see the parameters.
 
2904
</pre>
 
2905
 
 
2906
<pre>
 
2907
    Sometimes it works great for me on my box, because I can use the tools to figure out precisely
 
2908
    where it means.  But often I use gdb too.  Move off my box and the odds of your compile and my 
 
2909
    compile (and our ./configure and all the tool versions) matching so that the offsets mean something
 
2910
    are pretty small.
 
2911
</pre>
 
2912
<br>
 
2913
<p><b>Q.</b>&nbsp; What do these log messages mean?</p>
 
2914
 
 
2915
<pre>
 
2916
     **ERROR** mVLAN: Host (identical IP/MAC) found on multiple VLANs
 
2917
     mVLAN: ntop continues but will consolidate and thus probably overcount this traffic
 
2918
     mVLAN: Up to 10 examples will be printed
 
2919
     mVLAN: Host 192.168.aaa.bbb (00:12:17:xx:yy:zz) VLANs 3 and 4
 
2920
</pre>
 
2921
<p><b>A.</b>&nbsp; Once again, they mean what they say. ntop found something pretty weird. It found packets   for the same 'host' (that is the same IP and MAC address) on two different VLANs.  In this
 
2922
   case, IP 192.168.aaa.bbb, MAC 00:12:17:xx:yy:zz on VLAN 3 and VLAN 4.
 
2923
</p>
 
2924
<p>   It's not WRONG, but it's definitely odd.  If we see a packet twice, we count it twice, so -
 
2925
   via this message - we're warning you that we might be double counting some traffic.  We warn
 
2926
   you ONCE per host (per ntop run) and for only up to 10 hosts, so as not to innundate you with
 
2927
   meaningless warnings.
 
2928
</p>
 
2929
<p>   On the about page is a count (if you've even seen this junk), in the "Host/Session counts - global"
 
2930
   section.  If it's just a couple, ignore it.
 
2931
</p>
 
2932
<p>   If you see a lot of this stuff, you may want to rethink your ntop sensor placement or at least
 
2933
   understand what you are doing.  On my home LAN, I use a 802.1q VLAN trunk to move traffic between
 
2934
   two switches and have a passive tap on the trunk. Traffic to/from the firewall moves over this trunk,
 
2935
   so I see the same packet on the YELLOW(DMZ) VLAN and the GREEN(TRUSTED) VLAN all the time.
 
2936
</p>
 
2937
<p>   Why even bother trapping and warning?  Well, there is one bad thing from ntop's perspective with 
 
2938
   duplicated hosts, which would occur if we didn't trap this, and that is that you would also
 
2939
   see a lot of RRD errors when ntop tries to update the same host twice:
 
2940
</p>
 
2941
<p>   **WARNING** RRD: rrd_update(/usr/.../ipBytesSent.rrd) error: illegal attempt to update using time 
 
2942
</p>
 
2943
<pre>
 
2944
                    1109523297 when last update time is 1109523297 (minimum one second step)
 
2945
</pre>
4750
2946
<h2>Running - Web Server</h2>
4751
2947
<br>
4752
 
<p>
4753
 
<b>Q.</b>&nbsp;
4754
 
 ntop shows an older, single menu interface
4755
 
</p>
4756
 
<p>
4757
 
<b>A.</b>&nbsp;
4758
 
 If ntop is unable to find the file index.html it generates the page
4759
 
   internally. That page refers to 'leftindex.html' which is the all-in-one menu
4760
 
   you see, similar to the v1.3 menu.
4761
 
</p>
4762
 
<p>
4763
 
   To find the html files, ntop looks in the html subdirectory in two places:
4764
 
</p>
4765
 
 
4766
 
<pre>
4767
 
      1. In the current directory (i.e. ./html),
4768
 
   and
4769
 
      2. In '[prefix]/share/ntop/html'
4770
 
         (where [prefix] is set by the --prefix option of your ./configure
4771
 
          step).
4772
 
</pre>
4773
 
<p>
4774
 
   Common causes:
4775
 
</p>
4776
 
 
4777
 
<pre>
4778
 
      1. Is manually installing ntop in an unusual place, having forgotten to
4779
 
         update DATAFILE_DIR in config.h. Or forgetting to copy the html
4780
 
         subdirectories, etc.
4781
 
</pre>
4782
 
 
4783
 
<pre>
4784
 
      2. Forgetting to run './autogen.sh -1' first and 'make install' last when
4785
 
         first building ntop from source.
4786
 
</pre>
4787
 
 
4788
 
<pre>
4789
 
      3. Running ntop with an explicit path from somewhere other that the
4790
 
         directory it's installed into. For example, if you install ntop 
4791
 
         into /root/ntop, but run it like this:
4792
 
</pre>
4793
 
 
4794
 
<pre>
4795
 
            cd /usr/bin
4796
 
            /root/ntop/ntop
4797
 
</pre>
4798
 
 
4799
 
<pre>
4800
 
         It will look 1st in /usr/bin/html and then in [prefix]/share/ntop 
4801
 
         and not find the html files in /root/ntop/html!
4802
 
</pre>
4803
 
<p>
4804
 
   This often occurs when running ntop as a daemon, because the current
4805
 
   working directory of the script is not what you expect it to be!
4806
 
</p>
4807
 
<br>
4808
 
<p>
4809
 
<b>Q.</b>&nbsp;
4810
 
 Why does ntop display bits of my web site, instead of its own pages?
4811
 
</p>
4812
 
<p>
4813
 
<b>A.</b>&nbsp;
4814
 
 ntop is designed to search the current working directory for data files,
4815
 
   such as the html subdirectory, before it searches the default directories.
4816
 
</p>
4817
 
<p>
4818
 
   This is a feature.
4819
 
</p>
4820
 
<p>
4821
 
   You are one of those rare souls who happen to have had an unrelated
 
2948
<p><b>Q.</b>&nbsp; Why does ntop display bits of my web site, instead of its own pages?</p>
 
2949
<p><b>A.</b>&nbsp; ntop is designed to search the current working directory for data files,   such as the html subdirectory, before it searches the default directories.
 
2950
</p>
 
2951
<p>   This is a feature.
 
2952
</p>
 
2953
<p>   You are one of those rare souls who happen to have had an unrelated
4822
2954
   subdirectory 'html' with a file named 'index.html' as a subdirectory 
4823
2955
   of the current working directory at the time that you launched ntop. 
4824
2956
   cd to an acceptable directory, such as /usr/share/ntop, before 
4825
2957
   launching ntop.  
4826
2958
</p>
4827
2959
<br>
4828
 
<p>
4829
 
<b>Q.</b>&nbsp;
4830
 
 What are High/Medium/Low risk flags
4831
 
</p>
4832
 
<p>
4833
 
<b>A.</b>&nbsp;
4834
 
 They are set in reportUtils.c based on fairly self-obvious functions
4835
 
   Well documented in the help.html page, reachable by clicking on
 
2960
<p><b>Q.</b>&nbsp; What are High/Medium/Low risk flags</p>
 
2961
<p><b>A.</b>&nbsp; They are set in reportUtils.c based on fairly self-obvious functions   Well documented in the help.html page, reachable by clicking on
4836
2962
   the problem descriptions or via http://127.0.0.1:3000/help.html
4837
2963
</p>
4838
 
<p>
4839
 
   Often seen if you are monitoring a backbone or common network (high)
 
2964
<p>   Often seen if you are monitoring a backbone or common network (high)
4840
2965
   or if you have cloned MAC addresses for, say, a home Firewall box.
4841
2966
</p>
4842
2967
<br>
4843
 
<p>
4844
 
<b>Q.</b>&nbsp;
4845
 
 What does the "Users" flag mean on a host?
4846
 
</p>
4847
 
<p>
4848
 
<b>A.</b>&nbsp;
4849
 
 If you go to the "Info about host xxxx" page, there will be data
4850
 
   in the "Known Users" section, if it's acting as a server for certain
 
2968
<p><b>Q.</b>&nbsp; What does the "Users" flag mean on a host?</p>
 
2969
<p><b>A.</b>&nbsp; If you go to the "Info about host xxxx" page, there will be data   in the "Known Users" section, if it's acting as a server for certain
4851
2970
   protocols.
4852
2971
</p>
4853
 
<p>
4854
 
   In sessions.c, the function updateHostUsers() is used to maintain the list
 
2972
<p>   In sessions.c, the function updateHostUsers() is used to maintain the list
4855
2973
   of "users" of a host.  In handleSession(), as part of the protocol level
4856
2974
   analysis, the "user" information for various protocols is pulled out of the
4857
2975
   packets.  Stuff like the "X-Kazaa-Username" header, the "MAIL FROM:" header,
4858
2976
   etc.
4859
2977
</p>
4860
 
<p>
4861
 
   We tag users as one or more of the following types:
 
2978
<p>   We tag users as one or more of the following types:
4862
2979
</p>
4863
2980
<pre>
4864
2981
        P2P_USER, SMTP_USER, FTP_USER, POP_USER, IMAP_USER
4865
2982
</pre>
4866
 
<p>
4867
 
   Note that for P2P, we also record - where possible - whether this user is
 
2983
<p>   Note that for P2P, we also record - where possible - whether this user is
4868
2984
   in P2P_UPLOAD_MODE and/or P2P_DOWNLOAD_MODE.
4869
2985
</p>
4870
2986
<br>
4871
 
<p>
4872
 
<b>Q.</b>&nbsp;
4873
 
 Why are some of the host names in different colors?
4874
 
</p>
4875
 
<p>
4876
 
<b>A.</b>&nbsp;
4877
 
 Colors are used on several of the ntop pages to convey extra
4878
 
   information to the user.  (in particular the ACTIVE TCP SESSIONS
 
2987
<p><b>Q.</b>&nbsp; Why are some of the host names in different colors?</p>
 
2988
<p><b>A.</b>&nbsp; Colors are used on several of the ntop pages to convey extra   information to the user.  (in particular the ACTIVE TCP SESSIONS
4879
2989
   and the LOCAL HOST STATS pages). There are five colors used to
4880
2990
   depict how long ago the host was first seen by ntop.
4881
2991
</p>
4882
 
<p>
4883
 
   The pages which display these colors use a html style sheet called
 
2992
<p>   The pages which display these colors use a html style sheet called
4884
2993
   style.css located in the normal html subdirectory (where ntop is
4885
2994
   installed). This happens by setting the 'class=' parameter of
4886
2995
   the html 'A' (Anchor or hyper-link) tag.  The style sheet defines
4897
3006
      30-60        A.age30min   { color:#007FFF }   Slate blue
4898
3007
      60+          A.age60min   { color:#0000FF }   Blue
4899
3008
</pre>
4900
 
<p>
4901
 
   The color legend is displayed on the About | Configuration page
 
3009
<p>   The color legend is displayed on the About | Configuration page
4902
3010
   (info.html).
4903
3011
</p>
4904
3012
<br>
4905
 
<p>
4906
 
<b>Q.</b>&nbsp;
4907
 
 What does the P2P flag mean on a host?
4908
 
</p>
4909
 
<p>
4910
 
<b>A.</b>&nbsp;
4911
 
 If ntop knows enough to tag you as a P2P user, it's also looking at the
4912
 
   other headers to see if it can track what files you're exchanging.  If a host
 
3013
<p><b>Q.</b>&nbsp; What does the P2P flag mean on a host?</p>
 
3014
<p><b>A.</b>&nbsp; If ntop knows enough to tag you as a P2P user, it's also looking at the   other headers to see if it can track what files you're exchanging.  If a host
4913
3015
   (i.e. a workstation) downloads a file from another host ("server"), the file
4914
3016
   name is recorded in the list ntop maintains for both of them.
4915
3017
</p>
4916
 
<p>
4917
 
   If a host has at least one file name recorded, it's tagged with the "P2P"
 
3018
<p>   If a host has at least one file name recorded, it's tagged with the "P2P"
4918
3019
   flag.
4919
3020
</p>
4920
3021
<br>
4921
 
<p>
4922
 
<b>Q.</b>&nbsp;
4923
 
 What does a "Virtual Host" mean.
4924
 
</p>
4925
 
<p>
4926
 
<b>A.</b>&nbsp;
4927
 
 If a single instance of a web server handles many web sites, all of the
4928
 
   references resolve to the same name.  The web server uses the "Host:"
 
3022
<p><b>Q.</b>&nbsp; What does a "Virtual Host" mean.</p>
 
3023
<p><b>A.</b>&nbsp; If a single instance of a web server handles many web sites, all of the   references resolve to the same name.  The web server uses the "Host:"
4929
3024
   header to determine which "index.html" page to serve up.
4930
3025
</p>
4931
 
<p>
4932
 
   ntop monitors port 80 (http:) exchanges and looks for the Host: which allows
 
3026
<p>   ntop monitors port 80 (http:) exchanges and looks for the Host: which allows
4933
3027
   it to build a list of virtual hosts being handled by the web server.
4934
3028
</p>
4935
3029
<h2>Running - Web Server (https:)</h2>
4936
3030
<br>
4937
 
<p>
4938
 
<b>Q.</b>&nbsp;
4939
 
 SSL is not working! I have the following error in the log/terminal:
4940
 
</p>
 
3031
<p><b>Q.</b>&nbsp; SSL is not working! I have the following error in the log/terminal:</p>
4941
3032
<pre>
4942
3033
     10/Jun/2002 22:58:17 Started thread (6151) for network packet sniffing on
4943
3034
          eth0.1700:error:140EC0AF:SSL routines:SSL2_READ_INTERNAL:non sslv2
4944
3035
          initial packet:s2_pkt.c:187:
4945
3036
</pre>
4946
 
<p>
4947
 
<b>A.</b>&nbsp;
4948
 
 You forgot to put https:// instead of http:// in the URL you put in your
4949
 
   browser!
 
3037
<p><b>A.</b>&nbsp; You forgot to put https:// instead of http:// in the URL you put in your   browser!
4950
3038
</p>
4951
3039
<br>
4952
 
<p>
4953
 
<b>Q.</b>&nbsp;
4954
 
 Unable to find SSL certificate 'ntop-cert.pem'
4955
 
</p>
4956
 
<p>
4957
 
<b>A.</b>&nbsp;
4958
 
 ntop looks such file under the current working directory, then /etc or in
4959
 
   Whatever directory you configured with ./configure.
4960
 
</p>
4961
 
<p>
4962
 
   If you want a personal certificate, you need to create it by:
 
3040
<p><b>Q.</b>&nbsp; Unable to find SSL certificate 'ntop-cert.pem'</p>
 
3041
<p><b>A.</b>&nbsp; ntop looks such file under the current working directory, then /etc or in   Whatever directory you configured with ./configure.
 
3042
</p>
 
3043
<p>   If you want a personal certificate, you need to create it by:
4963
3044
</p>
4964
3045
 
4965
3046
<pre>
4966
3047
      >make ntop-cert.pem
4967
3048
</pre>
4968
 
<p>
4969
 
   It should be installed as part of "make install".  If you have a special
 
3049
<p>   It should be installed as part of "make install".  If you have a special
4970
3050
   Certificate or it's not present, do it (one-time) manually:
4971
3051
</p>
4972
 
<p>
4973
 
   For example to install it under /usr/local/etc, do:
 
3052
<p>   For example to install it under /usr/local/etc, do:
4974
3053
</p>
4975
 
<p>
4976
 
   mkdir /usr/local/etc
 
3054
<p>   mkdir /usr/local/etc
4977
3055
   cp /usr/local/bin/ntop-cert.pem /usr/local/etc/ntop
4978
3056
</p>
4979
 
<p>
4980
 
   See docs/README.SSL
 
3057
<p>   See docs/README.SSL
4981
3058
</p>
4982
3059
 
4983
3060
<pre>
5000
3077
                 that's hung.  So, it looks - to the user - like a failed 
5001
3078
                 connection.  S'be'it...
5002
3079
</pre>
5003
 
<p>
5004
 
   If you are using https:// and seem to have the problem, run ntop with the 
 
3080
<p>   If you are using https:// and seem to have the problem, run ntop with the 
5005
3081
   --ssl-watchdog command line parameter... The item to look for on the
5006
3082
   configuration page (info.html) is:
5007
3083
</p>
5009
3085
<pre>
5010
3086
       # HTTPS Request Timeouts
5011
3087
</pre>
5012
 
<p>
5013
 
   Or messages in the log:
 
3088
<p>   Or messages in the log:
5014
3089
</p>
5015
 
<p>
5016
 
   ...: SSLWDERROR: Watchdog timer has expired. Aborting request, but ntop
 
3090
<p>   ...: SSLWDERROR: Watchdog timer has expired. Aborting request, but ntop
5017
3091
</p>
5018
3092
<pre>
5019
3093
        processing continues!
5020
3094
</pre>
5021
 
<p>
5022
 
   You can also enable it via a ./configure parameter (./configure --help |
 
3095
<p>   You can also enable it via a ./configure parameter (./configure --help |
5023
3096
   less) if it's something you're going to always require.
5024
3097
</p>
5025
3098
<br>
5026
 
<p>
5027
 
<b>Q.</b>&nbsp;
5028
 
 Tell me more
5029
 
</p>
5030
 
<p>
5031
 
<b>A.</b>&nbsp;
5032
 
 The problem is that ntop's web server is single threaded until we determine
5033
 
   that the request is simply one that will be reading data.  At that point we
 
3099
<p><b>Q.</b>&nbsp; Tell me more</p>
 
3100
<p><b>A.</b>&nbsp; The problem is that ntop's web server is single threaded until we determine   that the request is simply one that will be reading data.  At that point we
5034
3101
   fork to generate the page.  But the basic "accept a request" code is single
5035
3102
   threaded.  This happens all but instantaneously and hasn't been a problem
5036
3103
   previously.
5037
3104
</p>
5038
 
<p>
5039
 
   The code is pretty basic and pretty common:
 
3105
<p>   The code is pretty basic and pretty common:
5040
3106
</p>
5041
3107
 
5042
3108
<pre>
5047
3113
<pre>
5048
3114
       Then process the http request (i.e. the GET and associated headers).
5049
3115
</pre>
5050
 
<p>
5051
 
   With Netscape 6.2.2 (and others), there seems to be a bug in the Netscape
 
3116
<p>   With Netscape 6.2.2 (and others), there seems to be a bug in the Netscape
5052
3117
   code (ntop's is identical to other projects like sshd).
5053
3118
</p>
5054
 
<p>
5055
 
   According to something I read - but now can't find again - Netscape doesn't
 
3119
<p>   According to something I read - but now can't find again - Netscape doesn't
5056
3120
   accept a legal combination of options on the handshake back from openSSL and
5057
3121
   hangs in a deadly embrace.  Supposedly openSSL 0.9.6c (or was it d - it's not
5058
3122
   in the changelog) built in a patch.  However, I didn't find the new version
5059
3123
   changed the behavior.
5060
3124
</p>
5061
 
<p>
5062
 
   There is stuff about a bug w/ Netscape 4.x on the openSSL website, but I'm
 
3125
<p>   There is stuff about a bug w/ Netscape 4.x on the openSSL website, but I'm
5063
3126
   not having trouble with Netscape 4.x.
5064
3127
</p>
5065
 
<p>
5066
 
   I don't understand the details and really don't care to find out.  It boils
 
3128
<p>   I don't understand the details and really don't care to find out.  It boils
5067
3129
   down to a hang in a call, SSL_accept() that doesn't have a timeout parameter.
5068
3130
   Argh
5069
3131
</p>
5070
 
<p>
5071
 
   Because the code is invasive, I built it (like the SIGPIPE stuff) so you can
 
3132
<p>   Because the code is invasive, I built it (like the SIGPIPE stuff) so you can
5072
3133
   turn it on at ./configure time:
5073
3134
</p>
5074
3135
 
5076
3137
      --enable-sslwatchdog    Watchdog for ssl hangups (Netscape 6.2.2)
5077
3138
                              [default=disabled]
5078
3139
</pre>
5079
 
<p>
5080
 
   or via a command line option:
 
3140
<p>   or via a command line option:
5081
3141
</p>
5082
3142
 
5083
3143
<pre>
5084
3144
      --ssl-watchdog          Use ssl watchdog (NS6 problem)
5085
3145
</pre>
5086
 
<p>
5087
 
   With the "fix", ntop's web server hangs for at most 3 seconds, then continues
 
3146
<p>   With the "fix", ntop's web server hangs for at most 3 seconds, then continues
5088
3147
   on.  The user gets nada - and I don't know a way to send them anything,
5089
3148
   because we haven't retrieved the request yet nor done the handshake (so there
5090
3149
   isn't a TCP connection!)
5091
3150
</p>
5092
 
<p>
5093
 
   It only affects https:// requests and I've coded the watchdog so it doesn't
 
3151
<p>   It only affects https:// requests and I've coded the watchdog so it doesn't
5094
3152
   activate unless we have openSSL and either the compile or runtime parameter
5095
3153
   set.  If you don't get https:// requests, it's just another idle thread.
5096
3154
</p>
5097
 
<p>
5098
 
   The fix is working for me... What I've tested (and the results with and
 
3155
<p>   The fix is working for me... What I've tested (and the results with and
5099
3156
   without the watchdog):
5100
3157
</p>
5101
3158
 
5127
3184
</pre>
5128
3185
<h2>Running - Web Server - Security</h2>
5129
3186
<br>
5130
 
<p>
5131
 
<b>Q.</b>&nbsp;
5132
 
 I'm being prompted for a userid/password, what do I enter.
5133
 
</p>
5134
 
<p>
5135
 
<b>A.</b>&nbsp;
5136
 
 The default admin userid is 'Admin' (without the quotes) and the password
5137
 
   is whatever you set on the 1st run of ntop (look in this FAQ for
 
3187
<p><b>Q.</b>&nbsp; I'm being prompted for a userid/password, what do I enter.</p>
 
3188
<p><b>A.</b>&nbsp; The default admin userid is 'Admin' (without the quotes) and the password   is whatever you set on the 1st run of ntop (look in this FAQ for
5138
3189
   --set-admin-password).
5139
3190
</p>
5140
3191
<br>
5141
 
<p>
5142
 
<b>Q.</b>&nbsp;
5143
 
 Why create Userids (beyond the Admin id created by --set-admin-password)
5144
 
</p>
5145
 
<p>
5146
 
<b>A.</b>&nbsp;
5147
 
 Multiple users allow you to control who can alter ntop's performance and/or
5148
 
   view specific information. If you look on the "Admin" tab, you will see that
 
3192
<p><b>Q.</b>&nbsp; Why create Userids (beyond the Admin id created by --set-admin-password)</p>
 
3193
<p><b>A.</b>&nbsp; Multiple users allow you to control who can alter ntop's performance and/or   view specific information. If you look on the "Admin" tab, you will see that
5149
3194
   you can create additional users and also control which URLs can be executed
5150
3195
   by whom.
5151
3196
</p>
5152
 
<p>
5153
 
   Userids could allow, for example, an ISP to allow users to access SOME
 
3197
<p>   Userids could allow, for example, an ISP to allow users to access SOME
5154
3198
   network performance statistics, but not the proprietary stuff...
5155
3199
</p>
5156
 
<p>
5157
 
   Suppose you want to restrict who accesses the Multicast statistics page,
 
3200
<p>   Suppose you want to restrict who accesses the Multicast statistics page,
5158
3201
   multicastStats.html.
5159
3202
</p>
5160
 
<p>
5161
 
   ntop uses terminal wildcards matching the names, so multicast is treated as
 
3203
<p>   ntop uses terminal wildcards matching the names, so multicast is treated as
5162
3204
   multicast* and matches multicastStats.html plus any other name beginning
5163
3205
   multicast...
5164
3206
</p>
5165
 
<p>
5166
 
   howto:
 
3207
<p>   howto:
5167
3208
</p>
5168
 
<p>
5169
 
   1st add a new user
 
3209
<p>   1st add a new user
5170
3210
   2nd add "multicast" to the list of controlled screens and allow admin
5171
3211
</p>
5172
3212
<pre>
5173
3213
       and the new user to access it (note the * wildcard is automatically
5174
3214
       added)
5175
3215
</pre>
5176
 
<p>
5177
 
   Try and access the screen and you are prompted for a userid/password...
 
3216
<p>   Try and access the screen and you are prompted for a userid/password...
5178
3217
</p>
5179
 
<p>
5180
 
   Look in http.c for all the names and #defines used...
 
3218
<p>   Look in http.c for all the names and #defines used...
5181
3219
</p>
5182
3220
<br>
5183
 
<p>
5184
 
<b>Q.</b>&nbsp;
5185
 
 So, How do I restrict access to the main http or https ntop web page?
5186
 
</p>
5187
 
<p>
5188
 
<b>A.</b>&nbsp;
5189
 
 To stop everyone from logging into ntop, do the following:
5190
 
   Select ADMIN tab
 
3221
<p><b>Q.</b>&nbsp; So, How do I restrict access to the main http or https ntop web page?</p>
 
3222
<p><b>A.</b>&nbsp; To stop everyone from logging into ntop, do the following:   Select ADMIN tab
5191
3223
   Select URL's then "Add Url"
5192
3224
   Don't fill in anything (the wildcard * is implied)
5193
3225
   Select only the users who you want to authorize (hold control key and
5194
3226
   click on user to add more users if you added users)
5195
3227
</p>
5196
 
<p>
5197
 
   and click on "Add Url"
 
3228
<p>   and click on "Add Url"
5198
3229
</p>
5199
 
<p>
5200
 
   You will see URL '*' is added, e.g.
 
3230
<p>   You will see URL '*' is added, e.g.
5201
3231
</p>
5202
3232
 
5203
3233
<pre>
5207
3237
     'deleteU*'
5208
3238
     'modifyU*'
5209
3239
</pre>
5210
 
<p>
5211
 
   Then only users who know the user id and password (remember to keep the .db
 
3240
<p>   Then only users who know the user id and password (remember to keep the .db
5212
3241
   file secure!) will have access.
5213
3242
</p>
5214
3243
<br>
5215
 
<p>
5216
 
<b>Q.</b>&nbsp;
5217
 
 How good is the default security ntop provides through the web server.
5218
 
</p>
5219
 
<p>
5220
 
<b>A.</b>&nbsp;
5221
 
 Good question...
5222
 
</p>
5223
 
<p>
5224
 
   The default ntop configuration is not appropriate if you put ntop in a
 
3244
<p><b>Q.</b>&nbsp; How good is the default security ntop provides through the web server.</p>
 
3245
<p><b>A.</b>&nbsp; Good question...</p>
 
3246
<p>   The default ntop configuration is not appropriate if you put ntop in a
5225
3247
   publicly reachable location.  We assume that ntop is either running in a
5226
3248
   small, trusted, LAN or that you've used other tools such as firewalls to
5227
3249
   protect the ntop web server.
5228
3250
</p>
5229
 
<p>
5230
 
   The userid/password scheme is good enough to prevent you from accidentally
 
3251
<p>   The userid/password scheme is good enough to prevent you from accidentally
5231
3252
   shutting down ntop or getting into 'dangerous' places.  But that's really
5232
3253
   all it does.
5233
3254
</p>
5234
 
<p>
5235
 
   Also, the security of the ntop web server is only as good as the security of
 
3255
<p>   Also, the security of the ntop web server is only as good as the security of
5236
3256
   the passwords file, ntop_pw.db - only the ntop -u userid should be able to
5237
3257
   read from or write to it.
5238
3258
</p>
5239
 
<p>
5240
 
   Read man crypt for information on the security of the encrypted password.
5241
 
</p>
5242
 
<br>
5243
 
<p>
5244
 
<b>Q.</b>&nbsp;
5245
 
 The plugins aren't very secure.
5246
 
</p>
5247
 
<p>
5248
 
<b>A.</b>&nbsp;
5249
 
 True.
5250
 
</p>
5251
 
<br>
5252
 
<p>
5253
 
<b>Q.</b>&nbsp;
5254
 
 How do I prevent users from turning plugins on/off?
5255
 
</p>
5256
 
<p>
5257
 
<b>A.</b>&nbsp;
5258
 
 The default configuration of ntop does not protect the plugin pages - no
5259
 
   password is required to access showPlugins.html.
5260
 
</p>
5261
 
<p>
5262
 
   This allows any user who can connect to the ntop web server to view reports
 
3259
<p>   Read man crypt for information on the security of the encrypted password.
 
3260
</p>
 
3261
<br>
 
3262
<p><b>Q.</b>&nbsp; The plugins aren't very secure.</p>
 
3263
<p><b>A.</b>&nbsp; True.</p>
 
3264
<br>
 
3265
<p><b>Q.</b>&nbsp; How do I prevent users from turning plugins on/off?</p>
 
3266
<p><b>A.</b>&nbsp; The default configuration of ntop does not protect the plugin pages - no   password is required to access showPlugins.html.
 
3267
</p>
 
3268
<p>   This allows any user who can connect to the ntop web server to view reports
5263
3269
   FROM the plugins, but also allows them to make plugin configuration changes.
5264
3270
</p>
5265
 
<p>
5266
 
   This may not be desirable.  You may wish to add additional URLs to the
 
3271
<p>   This may not be desirable.  You may wish to add additional URLs to the
5267
3272
   Default list of those which require entry of a userid/password.
5268
3273
</p>
5269
 
<p>
5270
 
   You can prevent unauthorized individuals from turning plugins on/off by
 
3274
<p>   You can prevent unauthorized individuals from turning plugins on/off by
5271
3275
   adding this URL: "showPlugins.html?" to the list via Add URL.
5272
3276
</p>
5273
3277
<br>
5274
 
<p>
5275
 
<b>Q.</b>&nbsp;
5276
 
 Ok, but they can still get into the configuration pages and change things.
5277
 
</p>
5278
 
<p>
5279
 
<b>A.</b>&nbsp;
5280
 
 Yes. Add the following URLs to the controlled list:
5281
 
</p>
 
3278
<p><b>Q.</b>&nbsp; Ok, but they can still get into the configuration pages and change things.</p>
 
3279
<p><b>A.</b>&nbsp; Yes. Add the following URLs to the controlled list:</p>
5282
3280
 
5283
3281
<pre>
5284
3282
        plugins/sFlow*
5291
3289
    configurable plugins.  Unfortunately, it will also prevent them from seeing
5292
3290
    the rrd graphs, because those are created out of the rrd plugin.
5293
3291
</pre>
5294
 
<p>
5295
 
<b>A.</b>&nbsp;
5296
 
 Instead of plugins/rrdPlugin*, create these:
5297
 
</p>
 
3292
<p><b>A.</b>&nbsp; Instead of plugins/rrdPlugin*, create these:</p>
5298
3293
 
5299
3294
<pre>
5300
3295
        plugins/rrdPlugin?d*
5302
3297
        plugins/rrdPlugin?i*
5303
3298
        plugins/rrdPlugin?r*
5304
3299
</pre>
5305
 
<p>
5306
 
   It's still not perfect, the reasons why are left as an exercise for the
 
3300
<p>   It's still not perfect, the reasons why are left as an exercise for the
5307
3301
   user.
5308
3302
</p>
5309
3303
<br>
5310
 
<p>
5311
 
<b>Q.</b>&nbsp;
5312
 
 I created a new user, adminp for administering the plugins and ntop is
5313
 
   also accepting the admin userid/password.
 
3304
<p><b>Q.</b>&nbsp; I created a new user, adminp for administering the plugins and ntop is   also accepting the admin userid/password.
5314
3305
</p>
5315
 
<p>
5316
 
<b>A.</b>&nbsp;
5317
 
 Yes, the matching of userid's isn't too swift. It's better to make sure
5318
 
   that there are NO common initial substrings among ANY of the userids.
 
3306
<p><b>A.</b>&nbsp; Yes, the matching of userid's isn't too swift. It's better to make sure   that there are NO common initial substrings among ANY of the userids.
5319
3307
</p>
5320
3308
 
5321
3309
<pre>
5322
3310
Q: How can I use Apache (with it's security, etc.) to serve up ntop pages?
5323
3311
A: (Toby Johnson [public@tobiasly.com], Sun 10Nov2002)
5324
3312
</pre>
5325
 
<p>
5326
 
   A while back, I had written about the possibility of configuring ntop to use
 
3313
<p>   A while back, I had written about the possibility of configuring ntop to use
5327
3314
   only relative URL's, in order to facilitate proxying ntop's web interface
5328
3315
   through Apache. I have decided it's easier to simply use Apache's ability to
5329
3316
   rewrite ntop's URL's when necessary. So, based on my experience, here is a
5330
3317
   mini-HOWTO on how to proxy ntop through Apache.
5331
3318
</p>
5332
 
<p>
5333
 
   ------
 
3319
<p>   ------
5334
3320
</p>
5335
 
<p>
5336
 
   Proxying ntop's web interface through a secure Apache virtual host is a
 
3321
<p>   Proxying ntop's web interface through a secure Apache virtual host is a
5337
3322
   convenient way to make use of any existing security measures you may already
5338
3323
   have. In my case, I wanted to be able to access ntop from anywhere outside
5339
3324
   my LAN, but opening another port on my server for ntop's dedicated web
5340
3325
   server wasn't an option.
5341
3326
</p>
5342
 
<p>
5343
 
   I already had a password-protected, secure web server that I use for admin
 
3327
<p>   I already had a password-protected, secure web server that I use for admin
5344
3328
   purposes -- I'll call it https://admin.tobiasly.com. I wanted ntop's web
5345
3329
   interface to appear as a subdirectory under this host:
5346
3330
   https://admin.tobiasly.com/ntop/ .
5347
3331
</p>
5348
 
<p>
5349
 
   Here's how to configure such a setup. Change the server names and ports to
 
3332
<p>   Here's how to configure such a setup. Change the server names and ports to
5350
3333
   match your own. I'm assuming that you already have a working, secure Apache
5351
3334
   virtual host (using HTTPS).
5352
3335
</p>
5353
 
<p>
5354
 
   First, pick a port for ntop's HTTP server. I'll use 15123. You won't need
 
3336
<p>   First, pick a port for ntop's HTTP server. I'll use 15123. You won't need
5355
3337
   ntop's built-in HTTPS server, since you're proxying its content through a
5356
3338
   pre-existing Apache HTTPS server. Configure ntop to start with the correct
5357
3339
   HTTP port, and with HTTPS disabled. Something like "ntop -d -w 15123 -W 0".
5358
3340
   (See the ntop man page for more startup options.)
5359
3341
</p>
5360
 
<p>
5361
 
   Now, you need to tell Apache that anything under the /ntop/ URL should be
 
3342
<p>   Now, you need to tell Apache that anything under the /ntop/ URL should be
5362
3343
   proxied to the ntop web server. In my case, the Apache server is running on
5363
3344
   the same machine as ntop, so it's just a proxy to a different port on
5364
3345
   localhost. In your Apache secure host configuration, add a line like this:
5367
3348
<pre>
5368
3349
      ProxyPass /ntop/ http://localhost:15123/
5369
3350
</pre>
5370
 
<p>
5371
 
   Now, whenever Apache receives a request for something like
 
3351
<p>   Now, whenever Apache receives a request for something like
5372
3352
   "https://secure.tobiasly.com/ntop/home.html", it will proxy this request to
5373
3353
   the location "http://localhost:15123/home.html". Ntop will take it from
5374
3354
   there, generate the web content, and pass the result back to Apache. Then
5375
3355
   Apache passes that result back to the original client.
5376
3356
</p>
5377
 
<p>
5378
 
   It's important to note that you don't need to open port 15123 to the
 
3357
<p>   It's important to note that you don't need to open port 15123 to the
5379
3358
   outside, since the connection actually goes through your existing Apache
5380
3359
   port, and then is transparently proxied by Apache on the server itself. Of
5381
3360
   course, you don't even have to run ntop on the same machine; as long as the
5382
3361
   Apache server can connect to ntop's port, it'll work.
5383
3362
</p>
5384
 
<p>
5385
 
   This is not the same as URL redirection. As far as your web browser knows,
 
3363
<p>   This is not the same as URL redirection. As far as your web browser knows,
5386
3364
   everything is going through https://secure.tobiasly.com/ntop/. The Apache
5387
3365
   server does all the proxy work behind the scenes, and simply serves up the
5388
3366
   results to the requesting client. And since the "outward-facing" server is
5389
3367
   Apache instead of ntop, you'll be using your existing Apache secure server
5390
3368
   certificate, instead of ntop's ntop-cert.pem.
5391
3369
</p>
5392
 
<p>
5393
 
   Everything appears to work OK at first, but we quickly run into a problem:
 
3370
<p>   Everything appears to work OK at first, but we quickly run into a problem:
5394
3371
   some of the URL's that ntop generates are absolute. For example, to draw bar
5395
3372
   graphs, ntop's web pages will request the image "/gauge.jpg". This would
5396
3373
   translate into "https://secure.tobiasly.com/gauge.jpg". Also, host info
5397
3374
   pages are absolute. If I click on the host "10.1.2.3", it tries to take me
5398
3375
   to the page "https://secure.tobiasly.com/10.1.2.3.html".
5399
3376
</p>
5400
 
<p>
5401
 
   This is a big problem, because unless the URL is underneath the /ntop/
 
3377
<p>   This is a big problem, because unless the URL is underneath the /ntop/
5402
3378
   directory, Apache doesn't know that it needs to proxy the request to ntop,
5403
3379
   and you get broken links. Luckily, Apache has the Rewrite module that lets
5404
3380
   us fool with requested URL's. In order to get the required URL's rewritten,
5409
3385
      RewriteEngine On
5410
3386
      RewriteCond %{HTTP_REFERER} tobiasly.com/ntop
5411
3387
      RewriteCond %{REQUEST_URI} !^/ntop
 
3388
      RewriteCond %{REQUEST_URI} !^/error
5412
3389
      RewriteRule ^/(.*)$ http://secure.tobiasly.com/ntop/$1 [L,P]
5413
3390
</pre>
5414
 
<p>
5415
 
   In English, this basically says "If I get a URL request that comes from a
 
3391
<p>   In English, this basically says "If I get a URL request that comes from a
5416
3392
   page that has tobiasly.com/ntop in it, and that request doesn't begin with
5417
3393
   /ntop, rewrute the URL to begin with http://secure.tobiasly.com/ntop/, and
5418
3394
   pass this rewritten URL to the Proxy engine." At this point, the Proxy
5422
3398
   handed directly to the Proxy engine, it can't be HTTPS or ntop's web server
5423
3399
   will not recognize it.
5424
3400
</p>
5425
 
<p>
5426
 
   Now, you should be able to simply connect to
 
3401
<p>   Now, you should be able to simply connect to
5427
3402
   https://secure.tobiasly.com/ntop/ , and you're ready to go!
5428
3403
</p>
 
3404
<p>   NOTE courtesy of Bruno Lebayle <lebayle@esrf.fr>
 
3405
</p>
 
3406
<p>   I had many problems with the "Rewrite" stuff described in the FAQ. After
 
3407
   some Google search, it appears that HTTP_REFERER is sometimes not
 
3408
   reliable, and the browser I am using (Firefox/Solaris) does not seem to
 
3409
   present this header properly.
 
3410
   So I've found an other way to do it, and this proves to work with many
 
3411
   different browsers:
 
3412
</p>
 
3413
<p>   within mod_proxy.c:
 
3414
</p>
 
3415
<pre>
 
3416
    ProxyPass /ntop/ http://localhost:3000/
 
3417
    ProxyPassReverse /ntop/ http://localhost:3000/
 
3418
</pre>
 
3419
<p>   <IfModule mod_rewrite.c>
 
3420
</p>
 
3421
<pre>
 
3422
    RewriteEngine On
 
3423
    RewriteLogLevel 0
 
3424
    RewriteLog logs/rewrite_log
 
3425
    RewriteCond %{REQUEST_URI} !^/$
 
3426
    RewriteCond %{REQUEST_URI} !^/home.html$
 
3427
    RewriteCond %{REQUEST_URI} !^/ntop/
 
3428
    RewriteRule ^/([^/]+\.[a-z]+)$ http://nms.my.domain:my_port/ntop/$1[L,P]
 
3429
   </IfModule>
 
3430
</pre>
 
3431
<p>   Where http://nms.my.domain:my_port is:
 
3432
   - the host where the network management tools are located with the
 
3433
   proper authentication
 
3434
   - the host where the above Apache config has to be set
 
3435
   - the host where ntop is installed on port 3000 in this example
 
3436
   Where the Web site on this host has no URL in the form of /xxx.xxx aprt
 
3437
   from / and /home.html (additions can be made in the RewriteCond)
 
3438
</p>
 
3439
<p>   Especially, the trailing "/" after /ntop in the RewriteCond is
 
3440
   mandatory, since e.g. the Ntop logo is /ntop_logo.gif and would match
 
3441
   /ntop
 
3442
</p>
 
3443
<p>   # Rewrite help summary:
 
3444
   # HTTP_REFERER = pattern in the name of the page from which the request comes
 
3445
   #    THIS IS NOT RELIABLE AND DIFFERS AMONG BROWSERS !!!
 
3446
   # REQUEST_URI = contents of the request (^ = start of line, $ = end of line,
 
3447
   #    ! = not the text which follows
 
3448
   # All conditions preceding a rule are evaluated
 
3449
   # All rules are processed in sequence
 
3450
   # Rewrite: () = group of text used for the substitution,
 
3451
   #    . = any char, * = repeated 0-N times,
 
3452
   #    + = repeated 1-N times, ^ = not this char, [chars] = one of chars
 
3453
   #    special characters escaped by \ e.g. the dot as \.
 
3454
   #    $1 means the 1st group of text between ()
 
3455
   #    Flags L = last (i.e. exit from the rewriting process)
 
3456
   #          P = proxy (i.e. use the proxy module for this URL)
 
3457
   #
 
3458
   # Full doc in http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
 
3459
   # Useful help in http://rewrite.drbacchus.com/rewritewiki/
 
3460
</p>
5429
3461
<h2>Running - Web Server - i18n</h2>
5430
3462
<br>
5431
 
<p>
5432
 
<b>Q.</b>&nbsp;
5433
 
 Is ntop localized for language x? (i18n)
5434
 
</p>
5435
 
<p>
5436
 
<b>A.</b>&nbsp;
5437
 
 No. ntop wasn't really written with i18n in mind.
5438
 
</p>
5439
 
<p>
5440
 
   Most of the text is generated in-line, on the fly.  Plus ntop must
 
3463
<p><b>Q.</b>&nbsp; Is ntop localized for language x? (i18n)</p>
 
3464
<p><b>A.</b>&nbsp; No. ntop wasn't really written with i18n in mind.</p>
 
3465
<p>   Most of the text is generated in-line, on the fly.  Plus ntop must
5441
3466
   dynamically support multiple locales simultaneously.
5442
3467
</p>
5443
 
<p>
5444
 
   However, beginning with v2.1.56 (2.2 development release), there is limited,
 
3468
<p>   However, beginning with v2.1.56 (2.2 development release), there is limited,
5445
3469
   optional, i18n support in ntop.
5446
3470
</p>
5447
3471
<br>
5448
 
<p>
5449
 
<b>Q.</b>&nbsp;
5450
 
 So, what internationalization (i18n) support does ntop provide.
5451
 
</p>
5452
 
<p>
5453
 
<b>A.</b>&nbsp;
5454
 
 The key word is LIMITED
5455
 
</p>
5456
 
<p>
5457
 
   This only applies to the pages that are pulled from .html files, NOT those
 
3472
<p><b>Q.</b>&nbsp; So, what internationalization (i18n) support does ntop provide.</p>
 
3473
<p><b>A.</b>&nbsp; The key word is LIMITED</p>
 
3474
<p>   This only applies to the pages that are pulled from .html files, NOT those
5458
3475
   created internally.  This includes the menus and the few static text pages,
5459
3476
   but none of the pages with interesting data on them.
5460
3477
</p>
5461
 
<p>
5462
 
   The localized pages must be placed in parallel directories to the existing
 
3478
<p>   The localized pages must be placed in parallel directories to the existing
5463
3479
   html ones.
5464
3480
</p>
5465
 
<p>
5466
 
   For example, if ntop is installed in /usr/share/ntop, the html files are in
 
3481
<p>   For example, if ntop is installed in /usr/share/ntop, the html files are in
5467
3482
   /usr/share/ntop/html.
5468
3483
</p>
5469
 
<p>
5470
 
   To support them Canadians, then, you would need to create a
 
3484
<p>   To support them Canadians, then, you would need to create a
5471
3485
   /usr/share/ntop/html_en_CA AND that locale would need to be installed on the
5472
3486
   ntop host system.
5473
3487
</p>
5474
 
<p>
5475
 
   Note that there are NO i18n files distributed with ntop (yet!)
 
3488
<p>   Note that there are NO i18n files distributed with ntop (yet!)
5476
3489
</p>
5477
 
<p>
5478
 
   At ./configure time, you enable support via --enable-i18n.  ntop MUST be told
 
3490
<p>   At ./configure time, you enable support via --enable-i18n.  ntop MUST be told
5479
3491
   how to find the locale files.  In ./configure, a "standard" location is
5480
3492
   defined per OS.
5481
3493
</p>
5482
 
<p>
5483
 
   (Initially only the value for FreeBSD is populated).  All others assume the
 
3494
<p>   (Initially only the value for FreeBSD is populated).  All others assume the
5484
3495
   "default", /usr/lib/locale.  If that isn't right for your OS, then you MUST
5485
3496
   use the optional parameter --with-localedir= to tell ntop where to find the
5486
3497
   files.
5487
3498
</p>
5488
 
<p>
5489
 
   At run time, ntop scans the host for the installed locales (locale -a should
 
3499
<p>   At run time, ntop scans the host for the installed locales (locale -a should
5490
3500
   - on most systems give you a list) and checks if a comparable html_cc_XX
5491
3501
   directory exists.
5492
3502
</p>
5493
 
<p>
5494
 
   This builds a list of supported languages, which (along with i18n status) is
 
3503
<p>   This builds a list of supported languages, which (along with i18n status) is
5495
3504
   shown on the configuration pages, info.html and textinfo.html.
5496
3505
</p>
5497
 
<p>
5498
 
   When an http request is made, your browser sends a list of languages it is
 
3506
<p>   When an http request is made, your browser sends a list of languages it is
5499
3507
   willing to accept in the http Accept-Language: header.
5500
3508
</p>
5501
 
<p>
5502
 
   (check View | Internet Options | Languages in IE to see what you're sending)
 
3509
<p>   (check View | Internet Options | Languages in IE to see what you're sending)
5503
3510
</p>
5504
 
<p>
5505
 
   For example,
 
3511
<p>   For example,
5506
3512
</p>
5507
3513
 
5508
3514
<pre>
5509
3515
       Accept-Languages: en_US, en
5510
3516
</pre>
5511
 
<p>
5512
 
   Means that you prefer US English, but will accept any English dialect if US
 
3517
<p>   Means that you prefer US English, but will accept any English dialect if US
5513
3518
   English isn't available.
5514
3519
</p>
5515
 
<p>
5516
 
   Be aware that the locale settings and Accept-Language settings are not well
 
3520
<p>   Be aware that the locale settings and Accept-Language settings are not well
5517
3521
   standardized, nor common and may not necessarily map very cleanly.  You
5518
3522
   should see what's defined (perhaps it's locale 'german' instead of 'gr') and
5519
3523
   make or link directories as necessary.  You can always create the directory
5520
3524
   you tell ntop to use via --with-localedir= in the /usr/share/ntop structure
5521
3525
   and create links from there to the real locale directories!
5522
3526
</p>
5523
 
<p>
5524
 
   Limits in the per-request and total # of languages to support are in
 
3527
<p>   Limits in the per-request and total # of languages to support are in
5525
3528
   globals-defines.h
5526
3529
</p>
5527
 
<p>
5528
 
   Because of directory structure limits, a lack of interest in multiple
 
3530
<p>   Because of directory structure limits, a lack of interest in multiple
5529
3531
   character sets, etc. the locale and accept-language headers are coerced into
5530
3532
   a common format:
5531
3533
</p>
5532
 
<p>
5533
 
   locales are                  ll[_XX][.char][@modifier]
 
3534
<p>   locales are                  ll[_XX][.char][@modifier]
5534
3535
</p>
5535
3536
 
5536
3537
<pre>
5539
3540
       char - character set (we sort of assume UTF-8)
5540
3541
       modifier - euro
5541
3542
</pre>
5542
 
<p>
5543
 
   Accept-Language: values are  ll-XX or ll or ll-*
 
3543
<p>   Accept-Language: values are  ll-XX or ll or ll-*
5544
3544
</p>
5545
 
<p>
5546
 
   Once the user makes a request, each page pulled is checked:
 
3545
<p>   Once the user makes a request, each page pulled is checked:
5547
3546
</p>
5548
3547
 
5549
3548
<pre>
5551
3550
       2. For the ntop host locale value.
5552
3551
       3. In the ntop default (English) set.
5553
3552
</pre>
5554
 
<p>
5555
 
   These checks are performed for each of the libraries specified in the config
 
3553
<p>   These checks are performed for each of the libraries specified in the config
5556
3554
   value (CFG_DATAFILE_DIR).
5557
3555
</p>
5558
3556
<br>
5559
 
<p>
5560
 
<b>Q.</b>&nbsp;
5561
 
 What about the country flags.
5562
 
</p>
5563
 
<p>
5564
 
<b>A.</b>&nbsp;
5565
 
 There are other sets available on the web, of different quality and size.
5566
 
   Rather than chase down permissions and rights, we'll stick with what we have
 
3557
<p><b>Q.</b>&nbsp; What about the country flags.</p>
 
3558
<p><b>A.</b>&nbsp; There are other sets available on the web, of different quality and size.   Rather than chase down permissions and rights, we'll stick with what we have
5567
3559
   but let you know here of other options.
5568
3560
</p>
5569
 
<p>
5570
 
   If you find a set you like, just download them and replace the xx.gif files 
 
3561
<p>   If you find a set you like, just download them and replace the xx.gif files 
5571
3562
   in .../html/statsicons/flags
5572
3563
</p>
5573
 
<p>
5574
 
   Much better, but about 4x larger:
 
3564
<p>   Much better, but about 4x larger:
5575
3565
</p>
5576
3566
<pre>
5577
3567
      http://users.skynet.be/hermandw/fl/smalgifs.html
5578
3568
</pre>
5579
 
<p>
5580
 
   Same height, but wider (so they look better):
 
3569
<p>   Same height, but wider (so they look better):
5581
3570
</p>
5582
3571
<pre>
5583
3572
      http://www.kidlink.org/www/miniflags.html
5584
3573
</pre>
5585
3574
<br>
5586
 
<p>
5587
 
<b>Q.</b>&nbsp;
5588
 
 What pages can be customized?
5589
 
</p>
5590
 
<p>
5591
 
<b>A.</b>&nbsp;
5592
 
 ls /usr/share/ntop/html/*.html (or wherever the ntop pages are installed):
5593
 
</p>
5594
 
<p>
5595
 
   frameset
5596
 
   --------
5597
 
</p>
5598
 
 
5599
 
<pre>
5600
 
       Note: There is no real benefit, except maybe the title in index.html so
5601
 
             you can see that it really does work!
5602
 
</pre>
5603
 
<p>
5604
 
   index.html
5605
 
   index_inner.html
5606
 
   index_left.html
5607
 
   index_top.html
5608
 
   top.html
5609
 
</p>
5610
 
<p>
5611
 
   Navigation
5612
 
   ----------
5613
 
   About.html
5614
 
   Admin.html
5615
 
   All.html
5616
 
   FibreChannel.html
5617
 
   IP.html
5618
 
   Local.html
5619
 
   SCSI.html
5620
 
   Summary.html
5621
 
</p>
5622
 
<p>
5623
 
   Misc data
5624
 
   ---------
5625
 
   Copyright.html
5626
 
   dump.html
5627
 
   faq.html - lots of work
5628
 
   help.html - good candidate
5629
 
   ntop.html - splash page
5630
 
   ntophelp.html
5631
 
   privacyNotice.html
5632
 
</p>
5633
 
<p>
5634
 
   Also, remember that a file overrides ntop's internal page generation, so you
 
3575
<p><b>Q.</b>&nbsp; What pages can be customized?</p>
 
3576
<p><b>A.</b>&nbsp; ls /usr/share/ntop/html/*.html (or wherever the ntop pages are installed):</p>
 
3577
<p>   Also, remember that a file overrides ntop's internal page generation, so you
5635
3578
   can also use this facility to override ANY of ntop's pages and return a
5636
3579
   customized page (perhaps you don't want users seeing them?).
5637
3580
</p>
5638
3581
<h2>Running - Web Server - p3p</h2>
5639
3582
<br>
5640
 
<p>
5641
 
<b>Q.</b>&nbsp;
5642
 
 What's up with P3P?
5643
 
</p>
5644
 
<p>
5645
 
<b>A.</b>&nbsp;
5646
 
 P3P is a W3C recommendation - http://www.w3.org/TR/P3P/ - for specifying how
5647
 
   an application(typically a web site) handles personally identifiably
 
3583
<p><b>Q.</b>&nbsp; What's up with P3P?</p>
 
3584
<p><b>A.</b>&nbsp; P3P is a W3C recommendation - http://www.w3.org/TR/P3P/ - for specifying how   an application(typically a web site) handles personally identifiably
5648
3585
   information.  What information the site collects and what it does with the
5649
3586
   information.
5650
3587
</p>
5651
 
<p>
5652
 
   p3p is pretty complex!  There are basically two ways to enable an application
 
3588
<p>   p3p is pretty complex!  There are basically two ways to enable an application
5653
3589
   for p3p. One is to add another HTTP header, P3P:.  The second is to support a
5654
3590
   well-known file location, /w3c/p3p.xml (like robots.txt).
5655
3591
</p>
5656
 
<p>
5657
 
   Browser support is pretty spotty, as is web site adoption.
 
3592
<p>   Browser support is pretty spotty, as is web site adoption.
5658
3593
</p>
5659
 
<p>
5660
 
   Some 3rd party browsers have some support...  up to CrazyBrowser which claims
 
3594
<p>   Some 3rd party browsers have some support...  up to CrazyBrowser which claims
5661
3595
   "full support", whatever that means...
5662
3596
</p>
5663
3597
<br>
5664
 
<p>
5665
 
<b>Q.</b>&nbsp;
5666
 
 So why put P3P into ntop?
5667
 
</p>
5668
 
<p>
5669
 
<b>A.</b>&nbsp;
5670
 
 It's coming. P3P is gradually making it's way into the top web sites -
5671
 
   right now (Dec2002), for example dell.com supports it and yahoo.com doesn't.
 
3598
<p><b>Q.</b>&nbsp; So why put P3P into ntop?</p>
 
3599
<p><b>A.</b>&nbsp; It's coming. P3P is gradually making it's way into the top web sites -   right now (Dec2002), for example dell.com supports it and yahoo.com doesn't.
5672
3600
</p>
5673
3601
<br>
5674
 
<p>
5675
 
<b>Q.</b>&nbsp;
5676
 
 Ok, but what's that got to do with ntop?
5677
 
</p>
5678
 
<p>
5679
 
<b>A.</b>&nbsp;
5680
 
 Since ntop collects personally identifiable data in it's access log (-a
5681
 
   option) and it's various reports and makes those available to pretty much
 
3602
<p><b>Q.</b>&nbsp; Ok, but what's that got to do with ntop?</p>
 
3603
<p><b>A.</b>&nbsp; Since ntop collects personally identifiable data in it's access log (-a   option) and it's various reports and makes those available to pretty much
5682
3604
   anyone in the default configuration, it's probably not a bad idea to OFFER
5683
3605
   some support.  Especially if you're running ntop at a site that has started
5684
3606
   to support P3P, if you don't have a mechanism for your own policies
5686
3608
   changes to ntop.
5687
3609
</p>
5688
3610
<br>
5689
 
<p>
5690
 
<b>Q.</b>&nbsp;
5691
 
 IE6?
5692
 
</p>
5693
 
<p>
5694
 
<b>A.</b>&nbsp;
5695
 
 Since ntop doesn't send the P3P: header, IE6 ignores ntop wrt p3p. Besides,
5696
 
   IE6 uses p3p to block 3rd party cookies.  If you want to see the p3p stuff,
 
3611
<p><b>Q.</b>&nbsp; IE6?</p>
 
3612
<p><b>A.</b>&nbsp; Since ntop doesn't send the P3P: header, IE6 ignores ntop wrt p3p. Besides,   IE6 uses p3p to block 3rd party cookies.  If you want to see the p3p stuff,
5697
3613
   it's view | privacy report in the menus.  If the site's policies don't match
5698
3614
   your settings, there will be a red "do not enter" icon in the third box on
5699
3615
   the bottom right of the IE6 window - double click on it to see the report.
5700
3616
   See http://support.microsoft.com/default.aspx?scid=KB;en-us;q293513
5701
3617
</p>
5702
3618
<br>
5703
 
<p>
5704
 
<b>Q.</b>&nbsp;
5705
 
 Mozilla
5706
 
</p>
5707
 
<p>
5708
 
<b>A.</b>&nbsp;
5709
 
 Unknown if it's enabled by default. Mozilla had support, ripped it out in
5710
 
   Feb 2002 and put a new version back in.
5711
 
</p>
5712
 
<br>
5713
 
<p>
5714
 
<b>Q.</b>&nbsp;
5715
 
 Other browsers
5716
 
</p>
5717
 
<p>
5718
 
<b>A.</b>&nbsp;
5719
 
 See their home pages or search the web. One that I know that claims "full
5720
 
   support" (whatever that means) is at http://www.crazybrowser.com/
5721
 
</p>
5722
 
<br>
5723
 
<p>
5724
 
<b>Q.</b>&nbsp;
5725
 
 Privacy Bird?
5726
 
</p>
5727
 
<p>
5728
 
<b>A.</b>&nbsp;
5729
 
 A browser-add-on, AT&T's privacy bird (http://www.privacybird.com/), that I'm
5730
 
   playing with is a lot more aggressive in supporting p3p.  If Privacy bird
 
3619
<p><b>Q.</b>&nbsp; Mozilla</p>
 
3620
<p><b>A.</b>&nbsp; Unknown if it's enabled by default. Mozilla had support, ripped it out in   Feb 2002 and put a new version back in.
 
3621
</p>
 
3622
<br>
 
3623
<p><b>Q.</b>&nbsp; Other browsers</p>
 
3624
<p><b>A.</b>&nbsp; See their home pages or search the web. One that I know that claims "full   support" (whatever that means) is at http://www.crazybrowser.com/
 
3625
</p>
 
3626
<br>
 
3627
<p><b>Q.</b>&nbsp; Privacy Bird?</p>
 
3628
<p><b>A.</b>&nbsp; A browser-add-on, AT&T's privacy bird (http://www.privacybird.com/), that I'm   playing with is a lot more aggressive in supporting p3p.  If Privacy bird
5731
3629
   doesn't see the P3P: header, it then requests the "well known" file,
5732
3630
   /w3c/p3p.xml file and gets nailed by ntop as a hostile application, since we
5733
3631
   don't have support for returning .xml files (yet).
5734
3632
</p>
5735
3633
<br>
5736
 
<p>
5737
 
<b>Q.</b>&nbsp;
5738
 
 So when & how does ntop support p3p?
5739
 
</p>
5740
 
<p>
5741
 
<b>A.</b>&nbsp;
5742
 
 A patch in the cvs on 4Dec2002 adds minimal support for p3p -- specifically:
5743
 
</p>
 
3634
<p><b>Q.</b>&nbsp; So when & how does ntop support p3p?</p>
 
3635
<p><b>A.</b>&nbsp; A patch in the cvs on 4Dec2002 adds minimal support for p3p -- specifically:</p>
5744
3636
 
5745
3637
<pre>
5746
3638
      1) ntop will respond to queries for /w3c/p3p.xml and ntop.p3p -- returning
5763
3655
         ntop doesn't validate the text in any way other than the usual
5764
3656
         stringSanityCheck().
5765
3657
</pre>
5766
 
<p>
5767
 
   This allows me to run the Privacy Bird and still talk to ntop.  I'll admit
 
3658
<p>   This allows me to run the Privacy Bird and still talk to ntop.  I'll admit
5768
3659
   that option #2 is speculative, since I really don't have much of a way to
5769
3660
   test it.
5770
3661
</p>
5771
3662
<br>
5772
 
<p>
5773
 
<b>Q.</b>&nbsp;
5774
 
 But there isn't a sample .p3p file provided.
5775
 
</p>
5776
 
<p>
5777
 
<b>A.</b>&nbsp;
5778
 
 Right.
5779
 
</p>
5780
 
<p>
5781
 
   Please note that there is no sample file provided.  This is not an oversight.
5782
 
</p>
5783
 
<p>
5784
 
   After careful consideration, I am not providing one.  The reason is that a
 
3663
<p><b>Q.</b>&nbsp; But there isn't a sample .p3p file provided.</p>
 
3664
<p><b>A.</b>&nbsp; Right.</p>
 
3665
<p>   Please note that there is no sample file provided.  This is not an oversight.
 
3666
</p>
 
3667
<p>   After careful consideration, I am not providing one.  The reason is that a
5785
3668
   .p3p file is intended to be a legal contract between your site and your users.
5786
3669
   While I could provide a default file that has the right tags - as I
5787
3670
   understand p3p - for the data ntop collects and stores, I don't want the
5788
3671
   responsibility and/or liability.
5789
3672
</p>
5790
 
<p>
5791
 
   If anyone wants this "sample p3p file", I will make it available for a fee,
 
3673
<p>   If anyone wants this "sample p3p file", I will make it available for a fee,
5792
3674
   Provided your organization - through an appropriate officer, in writing:
5793
3675
</p>
5794
3676
 
5809
3691
         lawsuit, arbitration proceeding, etc. in conjunction with your use of
5810
3692
         the sample p3p file.
5811
3693
</pre>
5812
 
<p>
5813
 
   Since your legal department would be nuts to agree to that I doubt it will
 
3694
<p>   Since your legal department would be nuts to agree to that I doubt it will
5814
3695
   come up.
5815
3696
</p>
5816
3697
<br>
5817
 
<p>
5818
 
<b>Q.</b>&nbsp;
5819
 
 So How do I create a .p3p file?
5820
 
</p>
5821
 
<p>
5822
 
<b>A.</b>&nbsp;
5823
 
 There are tools available to create p3p policy files - search the web for
5824
 
   'p3p editor'. One that I've used is a zero cost albeit beta tool, p3peditor
 
3698
<p><b>Q.</b>&nbsp; So How do I create a .p3p file?</p>
 
3699
<p><b>A.</b>&nbsp; There are tools available to create p3p policy files - search the web for   'p3p editor'. One that I've used is a zero cost albeit beta tool, p3peditor
5825
3700
   from IBM (http://www.alphaworks.ibm.com/tech/p3peditor).
5826
3701
</p>
5827
3702
<h2>Networks, Network cards and Networking</h2>
5828
3703
<br>
5829
 
<p>
5830
 
<b>Q.</b>&nbsp;
5831
 
 My security people won't let me run in promiscuous mode.
5832
 
</p>
5833
 
<p>
5834
 
<b>A.</b>&nbsp;
5835
 
 Tough...
5836
 
</p>
5837
 
<p>
5838
 
   Or, use the -s option and accept the limitations...
5839
 
</p>
5840
 
<p>
5841
 
   Ask them "honestly, what is the problem" - other than having an interface
 
3704
<p><b>Q.</b>&nbsp; My security people won't let me run in promiscuous mode.</p>
 
3705
<p><b>A.</b>&nbsp; Tough...</p>
 
3706
<p>   Or, use the -s option and accept the limitations...
 
3707
</p>
 
3708
<p>   Ask them "honestly, what is the problem" - other than having an interface
5842
3709
   in promiscuous mode is a signature of a sniffer and security folks look for
5843
3710
   unauthorized sniffers?
5844
3711
</p>
5845
 
<p>
5846
 
   ntop needs promiscuous mode so that it sees the full range of traffic.  Any
 
3712
<p>   ntop needs promiscuous mode so that it sees the full range of traffic.  Any
5847
3713
   similar product will do the same thing.
5848
3714
</p>
5849
 
<p>
5850
 
   If the security people think traffic on the wire is secure, they're wrong!
 
3715
<p>   If the security people think traffic on the wire is secure, they're wrong!
5851
3716
   Face facts - just about every Windows user, except for 2K/XP Pro (and then
5852
3717
   only if TBTP have especially locked them down) can install the windows
5853
3718
   version of tcpdump...
5854
3719
</p>
5855
 
<p>
5856
 
   If it's a checklist item, just gen up a form to "authorize" it, have the
 
3720
<p>   If it's a checklist item, just gen up a form to "authorize" it, have the
5857
3721
   boss and VP/CIO sign it and give it to them.
5858
3722
</p>
5859
3723
<br>
5860
 
<p>
5861
 
<b>Q.</b>&nbsp;
5862
 
 What is Ethernet and TCP/IP and how do they differ?
5863
 
</p>
5864
 
<p>
5865
 
<b>A.</b>&nbsp;
5866
 
 Both are protocols - that is the definition of how
5867
 
   to interpret bits on wires (or in packets) into
 
3724
<p><b>Q.</b>&nbsp; What is Ethernet and TCP/IP and how do they differ?</p>
 
3725
<p><b>A.</b>&nbsp; Both are protocols - that is the definition of how   to interpret bits on wires (or in packets) into
5868
3726
   meaningful conversations.
5869
3727
</p>
5870
 
<p>
5871
 
   Ethernet is the lower level, wire (or wireless) protocol,
 
3728
<p>   Ethernet is the lower level, wire (or wireless) protocol,
5872
3729
   concerned with moving the physical bits of data.
5873
3730
</p>
5874
 
<p>
5875
 
   TCP/IP is the higher-level protocol, which explains
 
3731
<p>   TCP/IP is the higher-level protocol, which explains
5876
3732
   how to interpret the block of bits (frame).
5877
3733
</p>
5878
 
<p>
5879
 
   TCP/IP uses a familiar 32-bit "IP" address, e.g.
 
3734
<p>   TCP/IP uses a familiar 32-bit "IP" address, e.g.
5880
3735
   192.168.0.1.
5881
3736
</p>
5882
 
<p>
5883
 
   Ethernet uses a less familiar, 48 bit unique to the NIC
 
3737
<p>   Ethernet uses a less familiar, 48 bit unique to the NIC
5884
3738
   (some times called "burned in") address, e.g.
5885
3739
   00:40:05:DE:AD:00.  This is called the MAC (Media
5886
3740
   Access Control) address.
5887
3741
</p>
5888
 
<p>
5889
 
   FYI: The official IEEE MAC address lookup is at
 
3742
<p>   FYI: The official IEEE MAC address lookup is at
5890
3743
</p>
5891
3744
<pre>
5892
3745
       http://standards.ieee.org/regauth/oui/index.shtml
5893
3746
   (Look up the first six digits, separated by -s, e.g. 00-40-05)
5894
3747
</pre>
5895
3748
<br>
5896
 
<p>
5897
 
<b>Q.</b>&nbsp;
5898
 
 OK, but how is stuff sent from my computer to, say, Yahoo!?
5899
 
</p>
5900
 
<p>
5901
 
<b>A.</b>&nbsp;
5902
 
 First off, your computer does a lookup - using a service
5903
 
   called DNS (Domain Name Service) to convert www.yahoo.com
 
3749
<p><b>Q.</b>&nbsp; OK, but how is stuff sent from my computer to, say, Yahoo!?</p>
 
3750
<p><b>A.</b>&nbsp; First off, your computer does a lookup - using a service   called DNS (Domain Name Service) to convert www.yahoo.com
5904
3751
   to a numeric value, such as 66.218.71.80.
5905
3752
</p>
5906
 
<p>
5907
 
   Then it builds a collection of characters that says send
 
3753
<p>   Then it builds a collection of characters that says send
5908
3754
   this data from me, 192.168.0.1 to Yahoo at 66.218.71.80.
5909
3755
   This is called a packet.  That gets wrapped in an Ethernet
5910
3756
   frame (addressed from 00:40:05:DE:AD:00 to the MAC address
5911
3757
   of the local gateway router, 0:d0:9e:6:38:00 and squirts it
5912
3758
   out the router.
5913
3759
</p>
5914
 
<p>
5915
 
   Packets are forwarded step by step along a path from you
 
3760
<p>   Packets are forwarded step by step along a path from you
5916
3761
   to Yahoo by computers called routers.  This is done based
5917
3762
   on the 32 bit IP address and the router's knowledge of the
5918
3763
   network.
5919
3764
</p>
5920
 
<p>
5921
 
   Each router sees a Ethernet frame addressed to it (by
 
3765
<p>   Each router sees a Ethernet frame addressed to it (by
5922
3766
   MAC address), checks the TCP/IP address to figure out
5923
3767
   where to send it next, re-wraps the TCP/IP packet in a new
5924
3768
   Ethernet frame (with the from MAC as it's own and the to
5925
3769
   MAC as the next hop).
5926
3770
</p>
5927
 
<p>
5928
 
   This happens until the TCP/IP packet reaches the final
 
3771
<p>   This happens until the TCP/IP packet reaches the final
5929
3772
   segment (the last router).  Once it reaches a router that
5930
3773
   knows it has addresses 66.218.71.0-66.218.71.255 on one
5931
3774
   of it's interface, the routing stops using the TCP/IP
5932
3775
   address.
5933
3776
</p>
5934
 
<p>
5935
 
   The last hop is done (like each intermediate hop - at the
 
3777
<p>   The last hop is done (like each intermediate hop - at the
5936
3778
   lowest level) based on the MAC address!  Specifically, the
5937
3779
   last router does an "ARP" (Address Resolution Protocol") query,
5938
3780
   to find out "Who Has" address 66.218.71.80.  The NIC responds
5943
3785
      arp who-has www.yahoo.com tell router
5944
3786
      arp reply www.yahoo.com is-at 0:d0:9e:6:38:00
5945
3787
</pre>
5946
 
<p>
5947
 
   And the packet is routed to that address.
 
3788
<p>   And the packet is routed to that address.
5948
3789
</p>
5949
 
<p>
5950
 
   Alright, that's a bit simplified, but see Douglas Comer,
 
3790
<p>   Alright, that's a bit simplified, but see Douglas Comer,
5951
3791
   "Internetworking with TCP/IP, volume I", page 25 and 73ff.
5952
3792
</p>
5953
3793
<br>
5954
 
<p>
5955
 
<b>Q.</b>&nbsp;
5956
 
 Tell me more.
5957
 
</p>
5958
 
<p>
5959
 
<b>A.</b>&nbsp;
5960
 
 OK, gang time to teach Ethernet & TCP/IP basics one more time.
5961
 
   With pictures...
5962
 
</p>
5963
 
<p>
5964
 
   Suppose you have a network that looks like this (we'll use 
 
3794
<p><b>Q.</b>&nbsp; Tell me more.</p>
 
3795
<p><b>A.</b>&nbsp; OK, gang time to teach Ethernet & TCP/IP basics one more time.   With pictures...
 
3796
</p>
 
3797
<p>   Suppose you have a network that looks like this (we'll use 
5965
3798
   impossible addresses 288 - just pretend it's ok):
5966
3799
</p>
5967
3800
 
5974
3807
        me 299.0.0.1           \----------- DMZ ----- MAIL 277.1.1.2
5975
3808
                                                  \-- WEB  277.1.1.3
5976
3809
</pre>
5977
 
<p>
5978
 
   ISA can be acting solely as a router or it can be acting as a NAT device.
 
3810
<p>   ISA can be acting solely as a router or it can be acting as a NAT device.
5979
3811
   That's irrelevant, so we assume it's not.
5980
3812
</p>
5981
 
<p>
5982
 
   I send you a packet.  It travels the Internet and arrives at your 288.1.1.1
 
3813
<p>   I send you a packet.  It travels the Internet and arrives at your 288.1.1.1
5983
3814
   the ISA(router) with src=299.0.0.1, dst=288.2.2.2.
5984
3815
</p>
5985
 
<p>
5986
 
   Like every router along the way, ISA(router) looks at the destination
 
3816
<p>   Like every router along the way, ISA(router) looks at the destination
5987
3817
   address and realizes it has to route the packet on to 288.2.2.2.  So the
5988
3818
   ISA(router) sends the packet on, out the best interface to reach 288.2.2.2.
5989
3819
</p>
5990
 
<p>
5991
 
   Remember, however, the TCP/IP packet is wrapped in a lower level (Ethernet)
 
3820
<p>   Remember, however, the TCP/IP packet is wrapped in a lower level (Ethernet)
5992
3821
   packet at the wire level.  Read your TCP/IP and Ethernet standards - the
5993
3822
   actual delivery of packets over links is this Ethernet level and it uses the
5994
3823
   48 bit MAC address.
5995
3824
</p>
5996
 
<p>
5997
 
   This "Ethernet" packet is actually what travels hop to hop to hop (you can
 
3825
<p>   This "Ethernet" packet is actually what travels hop to hop to hop (you can
5998
3826
   even see these headers if you have visibility to the traffic - it's called
5999
3827
   the link level header by tcpdump and you'll see the 48 bit MAC addresses if
6000
3828
   you use the -e parameter).
6001
3829
</p>
6002
 
<p>
6003
 
   In order to be able to handle the Ethernet level signaling, each router
 
3830
<p>   In order to be able to handle the Ethernet level signaling, each router
6004
3831
   rewrites the packet so that the 48 bit source MAC address it it's own
6005
3832
   (from-router that is) and the destination MAC address is the one that
6006
3833
   from-router has in it's tables for to-router (the next hop).
6007
3834
</p>
6008
 
<p>
6009
 
   So the packet looks like this, where the srcMAC and dstMAC get rewritten
 
3835
<p>   So the packet looks like this, where the srcMAC and dstMAC get rewritten
6010
3836
   each hop, so that the routers on both ends of the link know whom it's
6011
3837
   addressed to:
6012
3838
</p>
6013
 
<p>
6014
 
   Hop1 (srcMAC=00:00:00:aa:aa:aa dstMAC=00:00:00:bbbbb:bb frame=IP
 
3839
<p>   Hop1 (srcMAC=00:00:00:aa:aa:aa dstMAC=00:00:00:bbbbb:bb frame=IP
6015
3840
   data=(src=299.1.1.1 dst=288.2.2.2 data="Hi!")
6016
3841
   Hop2 (srcMAC=00:00:00:bb:bb:bb dstMAC=00:00:00:cc:cc:cc frame=IP
6017
3842
   data=(src=299.1.1.1 dst=288.2.2.2 data="Hi!")
6018
3843
   Hop3 (srcMAC=00:00:00:cc:cc:cc dstMAC=00:00:00:dd:dd:dd frame=IP
6019
3844
   data=(src=299.1.1.1 dst=288.2.2.2 data="Hi!")
6020
3845
</p>
6021
 
<p>
6022
 
   Notice how the TCP/IP stuff isn't changed.  But the MAC address is.
 
3846
<p>   Notice how the TCP/IP stuff isn't changed.  But the MAC address is.
6023
3847
</p>
6024
 
<p>
6025
 
   At each hop, the NIC card, operating at the Ethernet level, sees its own MAC
 
3848
<p>   At each hop, the NIC card, operating at the Ethernet level, sees its own MAC
6026
3849
   address and knows to accept the packet. It passes it up the protocol stack,
6027
3850
   where the next layer (TCP/IP) realizes it needs to be routed further on...
6028
3851
</p>
6029
 
<p>
6030
 
   Ultimately, the packet gets delivered to some service listening on your WS.
6031
 
</p>
6032
 
<p>
6033
 
   Here's a packet capture to show you:
6034
 
</p>
6035
 
<p>
6036
 
   # tcpdump -Xx -c1 -i eth0 -e
 
3852
<p>   Ultimately, the packet gets delivered to some service listening on your WS.
 
3853
</p>
 
3854
<p>   Here's a packet capture to show you:
 
3855
</p>
 
3856
<p>   # tcpdump -Xx -c1 -i eth0 -e
6037
3857
   tcpdump: listening on eth0
6038
3858
   11:49:10.809890 0:3:47:b1:xx:xx 0:e0:18:b4:yy:yy ip 118:
6039
3859
   tigger.ssh > zebra.2714:
6045
3865
   0x0040   7db8 9954 dae1 55b6 54f9 cdfd ac07 a2b5        }..T..U.T.......
6046
3866
   0x0050   ce4f
6047
3867
</p>
6048
 
<p>
6049
 
   So this says, the packet came from tigger (MAC address 0:3:47:b1:xx:xx) ->
 
3868
<p>   So this says, the packet came from tigger (MAC address 0:3:47:b1:xx:xx) ->
6050
3869
   zebra (MAC address 0:e0:18:b4:yy:yy)
6051
3870
</p>
6052
3871
<pre>
6053
3872
     Within that is the tcp/ip packet, from c0a82a24 -> c0ae2a21
6054
3873
   (192.168.42.36 -> 192.168.42.33)
6055
3874
</pre>
6056
 
<p>
6057
 
   Here's another one, from tigger -> router.
 
3875
<p>   Here's another one, from tigger -> router.
6058
3876
</p>
6059
 
<p>
6060
 
   # tcpdump -Xx -c1 -i eth0 -e host 192.168.42.1
 
3877
<p>   # tcpdump -Xx -c1 -i eth0 -e host 192.168.42.1
6061
3878
   tcpdump: listening on eth0
6062
3879
   11:52:48.712750 0:3:47:b1:aa:aa 0:d0:9e:6:bb:bb ip 72:
6063
3880
   tigger.32782 > homeportal.gateway.2wire.net.domain:
6067
3884
   0x0020   0001 0000 0000 0000 0363 7673 046e 746f        .........cvs.nto
6068
3885
   0x0030   7003 6f72 6700 0001 0001                       p.org.....
6069
3886
</p>
6070
 
<p>
6071
 
   (0035 = port 53, so it's a dns query)
 
3887
<p>   (0035 = port 53, so it's a dns query)
6072
3888
</p>
6073
 
<p>
6074
 
   And one more, from cvs.ntop.org -> tigger (which has to have passed through
 
3889
<p>   And one more, from cvs.ntop.org -> tigger (which has to have passed through
6075
3890
   the router)
6076
3891
</p>
6077
 
<p>
6078
 
   # tcpdump -Xx -c1 -i eth0 -e "not src net 192.168.42.0/24"
 
3892
<p>   # tcpdump -Xx -c1 -i eth0 -e "not src net 192.168.42.0/24"
6079
3893
   tcpdump: listening on eth0
6080
3894
   11:53:39.688806 0:d0:9e:6:bb:bb 0:3:47:b1:aa:aa ip 69:
6081
3895
   195.31.151.66.cvspserver > tigger.42964:
6086
3900
   0x0020   8018 6028 279a 0000 0101 080a 173c 72b5        ..`('........<r.
6087
3901
   0x0030   0519 24a3 6f6b 0a                              ..$.ok.
6088
3902
</p>
6089
 
<p>
6090
 
   See the MAC address?  It's the routers, not cvs.ntop.org's
 
3903
<p>   See the MAC address?  It's the routers, not cvs.ntop.org's
6091
3904
</p>
6092
3905
<br>
6093
 
<p>
6094
 
<b>Q.</b>&nbsp;
6095
 
 Why do I care?
6096
 
</p>
6097
 
<p>
6098
 
<b>A.</b>&nbsp;
6099
 
 Because that's sometimes a problem you'll have with ntop. See ntop is
6100
 
   nosy, so it puts the interface into promiscuous mode, where every 
 
3906
<p><b>Q.</b>&nbsp; Why do I care?</p>
 
3907
<p><b>A.</b>&nbsp; Because that's sometimes a problem you'll have with ntop. See ntop is   nosy, so it puts the interface into promiscuous mode, where every 
6101
3908
   packet - addressed to the ntop host or not - is processed.  Now the 
6102
3909
   next layer up, the tcp/ip layer will throw away any 'junk' (You can 
6103
3910
   just hear it going tisk, tisk, tisk).  But libpcap can intercept them 
6104
3911
   at the Ethernet level and feed them to ntop...
6105
3912
</p>
6106
 
<p>
6107
 
   For REMOTE hosts, ntop uses the IP address as it's the only valid data.
 
3913
<p>   For REMOTE hosts, ntop uses the IP address as it's the only valid data.
6108
3914
   But for LOCAL hosts, ntop prefers to use the MAC address as a way of
6109
3915
   resolving multi-homed or multiply addressed hosts.
6110
3916
</p>
6111
 
<p>
6112
 
   See if you have two IP addresses assigned to the same host on your local
 
3917
<p>   See if you have two IP addresses assigned to the same host on your local
6113
3918
   network, say 192.168.42.42 and 192.168.42.43, how is ntop to tell they're
6114
3919
   the same host?  Well, the MAC addresses are the same...  (for some
6115
3920
   manufacturers, e.g. Sun, ALL of the interfaces on a host use the same MAC
6116
3921
   address).
6117
3922
</p>
6118
 
<p>
6119
 
   read getHostInfo() in hash.c.
 
3923
<p>   read getHostInfo() in hash.c.
6120
3924
</p>
6121
3925
 
6122
3926
<pre>
6131
3935
         FD_SET(FLAG_HOST_TYPE_MULTIHOMED, &el->flags);
6132
3936
      }
6133
3937
</pre>
6134
 
<p>
6135
 
   i.e. if the address we've stored for this host doesn't match this one, 
 
3938
<p>   i.e. if the address we've stored for this host doesn't match this one, 
6136
3939
   it's multihomed.
6137
3940
</p>
6138
3941
 
6158
3961
         break;
6159
3962
      }
6160
3963
</pre>
6161
 
<p>
6162
 
   If the addresses DO match, we've had two MAC addresses, so this is being
 
3964
<p>   If the addresses DO match, we've had two MAC addresses, so this is being
6163
3965
   spoofed.
6164
3966
</p>
6165
 
<p>
6166
 
   etc.
 
3967
<p>   etc.
6167
3968
</p>
6168
3969
<br>
6169
 
<p>
6170
 
<b>Q.</b>&nbsp;
6171
 
 So why do I get bad output?
6172
 
</p>
6173
 
<p>
6174
 
<b>A.</b>&nbsp;
6175
 
 If, somehow, you've confused ntop - for example telling it that
6176
 
   277.1.1.0/24 in the ascii art example (above) is local, then ntop 
 
3970
<p><b>Q.</b>&nbsp; So why do I get bad output?</p>
 
3971
<p><b>A.</b>&nbsp; If, somehow, you've confused ntop - for example telling it that   277.1.1.0/24 in the ascii art example (above) is local, then ntop 
6177
3972
   is going to believe you.  And it will see a packet with the 
6178
3973
   277.1.1.1 IP and a MAC address. And use that.  Only it's not the MAC 
6179
3974
   address of the MAIL host, it's really the MAC address of ISA.
6180
3975
</p>
6181
 
<p>
6182
 
   No matter, ntop doesn't know this -- all it sees is the packets and 
 
3976
<p>   No matter, ntop doesn't know this -- all it sees is the packets and 
6183
3977
   the data you gave it.  So later on, when it sees a packet with the 
6184
3978
   same MAC address, but a different IP, well, it will assume that it's 
6185
3979
   the same host... and the data will all be lumped together.
6186
3980
</p>
6187
3981
<br>
6188
 
<p>
6189
 
<b>Q.</b>&nbsp;
6190
 
 Does that explain why I'm seeing xxxx as multihomed?
6191
 
</p>
6192
 
<p>
6193
 
<b>A.</b>&nbsp;
6194
 
 Maybe. Remember - it only takes one packet, not even an ack, for
6195
 
   ntop to create a host record.  If that's wrong, it will carry 
 
3982
<p><b>Q.</b>&nbsp; Does that explain why I'm seeing xxxx as multihomed?</p>
 
3983
<p><b>A.</b>&nbsp; Maybe. Remember - it only takes one packet, not even an ack, for   ntop to create a host record.  If that's wrong, it will carry 
6196
3984
   forward - and you'll probably see the host tagged as 'Multihomed'
6197
3985
   when correct packets show up.  Say:
6198
3986
</p>
6201
3989
      Host 1: IP 192.168.1.1 MAC 00:00:00:aa:aa:aa
6202
3990
      Host 3: IP 192.168.1.3 MAC 00:00:00:cc:cc:cc
6203
3991
</pre>
6204
 
<p>
6205
 
   If somebody has the incorrect hosts table, dns, cached, whatever 
 
3992
<p>   If somebody has the incorrect hosts table, dns, cached, whatever 
6206
3993
   but has the info that Host 1 is 192.168.1.3 and is on the same 
6207
3994
   subnet, then it will send a packet where the Ethernet layer and
6208
3995
   the ip are nonsense.  But because it's on the same wire, the ip 
6209
3996
   is ignored:
6210
3997
</p>
6211
 
<p>
6212
 
   (Ethernet from:00:00:00:dd:dd:dd to:00:00:00:aa:aa:aa)
 
3998
<p>   (Ethernet from:00:00:00:dd:dd:dd to:00:00:00:aa:aa:aa)
6213
3999
</p>
6214
4000
<pre>
6215
4001
       (tcp s=192.168.1.4 d=192.168.1.3)
6216
4002
</pre>
6217
 
<p>
6218
 
   ntop will read both out of the packet and create the association
 
4003
<p>   ntop will read both out of the packet and create the association
6219
4004
</p>
6220
4005
 
6221
4006
<pre>
6222
4007
      192.168.1.3=00:00:00:aa:aa:aa
6223
4008
</pre>
6224
 
<p>
6225
 
   Since it doesn't know better.
6226
 
</p>
6227
 
<p>
6228
 
   Then when it sees
6229
 
</p>
6230
 
<p>
6231
 
   (Ethernet from:00:00:00:ee:ee:ee to:00:00:00:cc:cc:cc)
 
4009
<p>   Since it doesn't know better.
 
4010
</p>
 
4011
<p>   Then when it sees
 
4012
</p>
 
4013
<p>   (Ethernet from:00:00:00:ee:ee:ee to:00:00:00:cc:cc:cc)
6232
4014
</p>
6233
4015
<pre>
6234
4016
      (tcp s=192.168.1.5 d=192.168.1.3)
6235
4017
</pre>
6236
 
<p>
6237
 
   It will create the multihomed association...
 
4018
<p>   It will create the multihomed association...
6238
4019
</p>
6239
4020
<br>
6240
 
<p>
6241
 
<b>Q.</b>&nbsp;
6242
 
 So what's a hub vs. a Switch
6243
 
</p>
6244
 
<p>
6245
 
<b>A.</b>&nbsp;
6246
 
 A hub is a device that links a bunch of computers together
6247
 
   at the wire (Ethernet) level.  Logically, Ethernet is a bus,
 
4021
<p><b>Q.</b>&nbsp; So what's a hub vs. a Switch</p>
 
4022
<p><b>A.</b>&nbsp; A hub is a device that links a bunch of computers together   at the wire (Ethernet) level.  Logically, Ethernet is a bus,
6248
4023
   that is everybody sees all the traffic, just like cars crossing
6249
4024
   under a highway bridge.   Physically, Ethernet is wired like
6250
4025
   a star - with all the wires coming back to a central "hub".
6251
4026
   The hub is just the device that makes the electric star look
6252
4027
   like a shared bus.
6253
4028
</p>
6254
 
<p>
6255
 
   Switches and Hubs operate at the Ethernet level, not TCP/IP.
 
4029
<p>   Switches and Hubs operate at the Ethernet level, not TCP/IP.
6256
4030
</p>
6257
 
<p>
6258
 
<b>A.</b>&nbsp;
6259
 
 Watch out for 'Switched hubs', which are hubs that include an
6260
 
   internal switch between 2 or more segments (for example, BUT
 
4031
<p><b>A.</b>&nbsp; Watch out for 'Switched hubs', which are hubs that include an   internal switch between 2 or more segments (for example, BUT
6261
4032
   NOT LIMITED TO a 10BaseT and 100BaseT) segment.  These are hubs
6262
4033
   within a segment, but switches across segments.  ntop may not
6263
4034
   see the traffic you expect if you have a 'switched hubs' and
6264
4035
   manufacturers are pretty bad about marking them. See
6265
4036
   http://article.gmane.org/gmane.linux.ntop.general/5081
6266
4037
</p>
6267
 
<p>
6268
 
<b>A.</b>&nbsp;
6269
 
 A switch is a smart hub.
6270
 
</p>
6271
 
<p>
6272
 
   Switches improve performance by creating a virtual Ethernet
 
4038
<p><b>A.</b>&nbsp; A switch is a smart hub.</p>
 
4039
<p>   Switches improve performance by creating a virtual Ethernet
6273
4040
   bus for the duration of the packet that joins JUST the source
6274
4041
   and destination ports.
6275
4042
</p>
6276
 
<p>
6277
 
   A switch operates via an internal table of MAC addresses.
 
4043
<p>   A switch operates via an internal table of MAC addresses.
6278
4044
   It learns (or is programmed) that 0:d0:9e:6:38:00 is on
6279
4045
   port 1, while 00:40:05:DE:AD:00 is on port 3.
6280
4046
</p>
6281
 
<p>
6282
 
   A packet coming in port 1, destined for 00:40:05:DE:AD:00
 
4047
<p>   A packet coming in port 1, destined for 00:40:05:DE:AD:00
6283
4048
   is sent out ONLY port 3.
6284
4049
</p>
6285
 
<p>
6286
 
   If the switch doesn't know (or the packet is a broadcast),
 
4050
<p>   If the switch doesn't know (or the packet is a broadcast),
6287
4051
   it gets sent out all ports.
6288
4052
</p>
6289
 
<p>
6290
 
   This doesn't make for MORE bandwidth, but it does use it
 
4053
<p>   This doesn't make for MORE bandwidth, but it does use it
6291
4054
   more efficiently.  That is in addition to the session between
6292
4055
   ports 1 and 3 at 100Mbps, a second, simultaneous 100Mbps
6293
4056
   session can occur between ports 2 and 4.
6294
4057
</p>
6295
4058
<br>
6296
 
<p>
6297
 
<b>Q.</b>&nbsp;
6298
 
 How do I use ntop in a switched network?
6299
 
</p>
6300
 
<p>
6301
 
<b>A.</b>&nbsp;
6302
 
 First off, you need to be or have the support of
6303
 
   your network administrator.  (Yes, you can do something
 
4059
<p><b>Q.</b>&nbsp; How do I use ntop in a switched network?</p>
 
4060
<p><b>A.</b>&nbsp; First off, you need to be or have the support of   your network administrator.  (Yes, you can do something
6304
4061
   called "ARP poisoning" to - maybe - get the switch to send
6305
4062
   you all the traffic, but that's beyond this FAQ... STFW)
6306
4063
</p>
6307
 
<p>
6308
 
   Many switches (although not the USD$50 cheap "workgroup" units)
 
4064
<p>   Many switches (although not the USD$50 cheap "workgroup" units)
6309
4065
   have a special port or mode, where by all the traffic for the
6310
4066
   entire network gets copied out that port, in addition to the
6311
4067
   normal switch action.
6312
4068
</p>
6313
 
<p>
6314
 
   When you invoke the monitoring mode (called span, mirror, monitor,
 
4069
<p>   When you invoke the monitoring mode (called span, mirror, monitor,
6315
4070
   analysis, etc.), you are forcing the entire switch bandwidth out one
6316
4071
   port.  This may exceed the bandwidth of the port.  100Mbps+100Mbps
6317
4072
   >> 100Mbps!
6318
4073
</p>
6319
 
<p>
6320
 
   Traffic that is being sent to the monitoring port in excess of the
 
4074
<p>   Traffic that is being sent to the monitoring port in excess of the
6321
4075
   capacity of that port is usually dropped.  It should NOT slow down
6322
4076
   the switch on other ports.
6323
4077
</p>
6324
 
<p>
6325
 
   Some switches have some buffering capability and it *may* be able to
 
4078
<p>   Some switches have some buffering capability and it *may* be able to
6326
4079
   keep up with an occasional burst of traffic, as long as the average
6327
4080
   is below the port capacity and the buffer isn't exceeded.
6328
4081
</p>
6329
 
<p>
6330
 
   See, for example, http://www.cisco.com/warp/public/473/41.html#archXL.
 
4082
<p>   See, for example, http://www.cisco.com/warp/public/473/41.html#archXL.
6331
4083
</p>
6332
 
<p>
6333
 
   One list of switch manufacturers is the document is titled "REFERENCE:
 
4084
<p>   One list of switch manufacturers is the document is titled "REFERENCE:
6334
4085
   Configuring a Switch to Monitor All Traffic" from Elron Software. (The
6335
4086
   URL is long, do a Google search for "site:elronsoftware.com wi6038").
6336
4087
</p>
6337
4088
<h2>Dumping data</h2>
6338
4089
<br>
6339
 
<p>
6340
 
<b>Q.</b>&nbsp;
6341
 
 Can I use ntop from php/perl?
6342
 
</p>
6343
 
<p>
6344
 
<b>A.</b>&nbsp;
6345
 
 Yes you can. Please see the www directory under the ntop source tree.
6346
 
</p>
6347
 
<p>
6348
 
<b>A.</b>&nbsp;
6349
 
 Look at the Admin | Dump Data page.
6350
 
</p>
 
4090
<p><b>Q.</b>&nbsp; Can I use ntop from php/perl?</p>
 
4091
<p><b>A.</b>&nbsp; Yes you can. Please see the www directory under the ntop source tree.</p>
 
4092
<p><b>A.</b>&nbsp; Look at the Admin | Dump Data page.</p>
6351
4093
<h2>rrd (myrrd)</h2>
6352
4094
<br>
6353
 
<p>
6354
 
<b>Q.</b>&nbsp;
6355
 
 How do I save data between runs?
6356
 
</p>
6357
 
<p>
6358
 
<b>A.</b>&nbsp;
6359
 
 Use rrd.
6360
 
</p>
 
4095
<p><b>Q.</b>&nbsp; How do I save data between runs?</p>
 
4096
<p><b>A.</b>&nbsp; Use rrd.</p>
6361
4097
<br>
6362
 
<p>
6363
 
<b>Q.</b>&nbsp;
6364
 
 What's rrd?
6365
 
</p>
6366
 
<p>
6367
 
<b>A.</b>&nbsp;
6368
 
 There's a 12 page writeup on what rrd is and what ntop does with it.
6369
 
   A pdf version is posted at SourceForge in the "Documentation" release.
 
4098
<p><b>Q.</b>&nbsp; What's rrd?</p>
 
4099
<p><b>A.</b>&nbsp; There's a 12 page writeup on what rrd is and what ntop does with it.   A pdf version is posted at SourceForge in the "Documentation" release.
6370
4100
   Download it and read it.
6371
4101
</p>
6372
4102
<br>
6373
 
<p>
6374
 
<b>Q.</b>&nbsp;
6375
 
 Do I gotta?
6376
 
</p>
6377
 
<p>
6378
 
<b>A.</b>&nbsp;
6379
 
 Yup - the pretty pictures won't work in this FAQ.
6380
 
</p>
6381
 
<br>
6382
 
<p>
6383
 
<b>Q.</b>&nbsp;
6384
 
 What's myrrd?
6385
 
</p>
6386
 
<p>
6387
 
<b>A.</b>&nbsp;
6388
 
 ntop includes a frozen and slightly patched version of rrd 1.0.42 in the
6389
 
   ntop source tree.  This is called myrrd.
6390
 
</p>
6391
 
<p>
6392
 
   As of rrdtool 1.0.46 was released 04-Jan-2004.
6393
 
</p>
6394
 
<br>
6395
 
<p>
6396
 
<b>Q.</b>&nbsp;
6397
 
 Where do I get rrd?
6398
 
</p>
6399
 
<p>
6400
 
<b>A.</b>&nbsp;
6401
 
 You should not need to do anything to get rrd (see myrrd, above).
6402
 
</p>
6403
 
<p>
6404
 
   The home page for rrd is
 
4103
<p><b>Q.</b>&nbsp; Do I gotta?</p>
 
4104
<p><b>A.</b>&nbsp; Yup - the pretty pictures won't work in this FAQ.</p>
 
4105
<br>
 
4106
<p><b>Q.</b>&nbsp; I'm lazy - What is rrd?</p>
 
4107
<p><b>A.</b>&nbsp; RRD stands for "round-robin database". It is a special type of database designed for   holding sequences of information over periods of time, without growing in size. 
 
4108
</p>
 
4109
<p>   Rrdtool is a tool for manipulating RRDs. The home page for rrdtool is at 
 
4110
   http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ 
 
4111
</p>
 
4112
<p>   What do they do? Well, suppose you want to compute the average of the traffic to your
 
4113
   web site for the last fifteen minutes. If you record the data each minute and save it
 
4114
   in a traditional database it looks like this: 
 
4115
</p>
 
4116
 
 
4117
<pre>
 
4118
                10:45   1.00 MB
 
4119
                10:46   1.02 MB
 
4120
                10:47   0.27 MB
 
4121
                ...
 
4122
                11:00   0.54 MB
 
4123
                ...
 
4124
</pre>
 
4125
<p>   While you have the data to compute the total, the database grows in size forever. And
 
4126
   all you really need are the last 15 values. Certainly you can create a purge routine
 
4127
   and periodically remove the old data. But this type of constantly growing SQL database
 
4128
   - even with a prune process - will require reorganization and rebuilds over time. 
 
4129
</p>
 
4130
<p>   Suppose you had some kind of data structure where the last value was thrown away each
 
4131
   time you added a new one. When it comes time to store the 11:01 value, you overlay the
 
4132
   10:46 value. At any time, you still have the last 15 values. That - slightly simplified - 
 
4133
   is an RRD. The benefit is that your database never grows in size. The down side is that 
 
4134
   everything else in your history is gone - if your needs ever change, tough. 
 
4135
</p>
 
4136
<p>   The ring buffers are called round-robin archives or RRAs. The RRA actually stores the 
 
4137
   RATE (bits per second), so the 10:47 value of 0.27 Megabytes is 0.27 * 1024*1024 * 8 / 60
 
4138
   or 37748.736 (bits per second). But it functions just like the rings described above. 
 
4139
</p>
 
4140
<p>   ntop uses RRDs to store data over long periods of time. Separate files are created for 
 
4141
   each counter, in a structure that reflects the interfaces and hosts ntop sees. The specifics 
 
4142
   of what's recorded - interfaces or not, hosts or not, etc. is controlled by switches on the
 
4143
   ntop rrd plugin. 
 
4144
</p>
 
4145
<p>   (Read the paper - it goes on from here, with specific details on how ntop uses RRDs). 
 
4146
</p>
 
4147
<br>
 
4148
<p><b>Q.</b>&nbsp; What's myrrd?</p>
 
4149
<p><b>A.</b>&nbsp; ntop includes a frozen and slightly patched version of rrd 1.0.49 in the   ntop source tree.  This is called myrrd.
 
4150
</p>
 
4151
<p>   rrdtool 1.0.49 was released 08-Aug-2004.
 
4152
</p>
 
4153
<pre>
 
4154
           1.0.50 was released 25-Apr-2005.
 
4155
</pre>
 
4156
<p>   rrdtool 1.2.x began to be released in Apr 2005.
 
4157
</p>
 
4158
<br>
 
4159
<p><b>Q.</b>&nbsp; What's rrdtool?</p>
 
4160
<p><b>A.</b>&nbsp; rrdtool is the packaged program to access the various rrd routines (export, dump, graph)   from the command line.
 
4161
</p>
 
4162
<br>
 
4163
<p><b>Q.</b>&nbsp; How do I get it?</p>
 
4164
<p><b>A.</b>&nbsp; The myrrd version included with ntop doesn't have rrdtool. Assuming you haven't installed   an rrdtools package (which ntop ignores), here is how to get rrdtool: 
 
4165
</p>
 
4166
<p>   The myrrd version is a frozen copy of rrdtool 1.0.49, so your best bet is to go to the 
 
4167
   rrdtool home page, http://www.rrdtool.com/ or the download page, 
 
4168
   http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/ and download rrdtool-1.0.49.tar.gz. 
 
4169
</p>
 
4170
<p>   Once you have it, it's pretty standard. 
 
4171
</p>
 
4172
<p>   $ tar xfvz rrdtool-1.0.49.tar.gz $ cd rrdtool-1.0.49 $ ./configure 
 
4173
</p>
 
4174
<p>   (You can add --prefix=/usr if you want) 
 
4175
</p>
 
4176
<p>   $ make 
 
4177
</p>
 
4178
<p>   This runs a few minutes. 
 
4179
</p>
 
4180
<p>   Now you can do 
 
4181
</p>
 
4182
<p>   $ make install 
 
4183
</p>
 
4184
<p>   but remember, ntop just ignores this, so why bother? All you really need are the rrdtool
 
4185
   executable program (src/rrdtool) and maybe a few of the files in the doc/ directory. Just
 
4186
   copy them where you want them and then delete the whold build directory. 
 
4187
</p>
 
4188
<br>
 
4189
<p><b>Q.</b>&nbsp; Where do I get rrd?</p>
 
4190
<p><b>A.</b>&nbsp; Unless you need rrdtool, you should not need to do anything to get rrd (see myrrd, above).</p>
 
4191
<p>   The home page for rrd is
6405
4192
   http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
6406
4193
</p>
6407
 
<p>
6408
 
   rpm's are available at
 
4194
<p>   rpm's are available at
6409
4195
   http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub
6410
4196
</p>
6411
4197
<br>
6412
 
<p>
6413
 
<b>Q.</b>&nbsp;
6414
 
 What about the multi-threaded development version?
6415
 
</p>
6416
 
<p>
6417
 
<b>A.</b>&nbsp;
6418
 
 Stay away. I only experimented with it a little bit, but it was not
6419
 
   stable.  Use 1.0.42.
 
4198
<p><b>Q.</b>&nbsp; What about the multi-threaded development version?</p>
 
4199
<p><b>A.</b>&nbsp; Stay away.</p>
 
4200
<p>   (UPDATED) I was able to patch ntop to work with 1.2.7+ and experimented with it a little bit.
 
4201
</p>
 
4202
<p>   The binary .rrd file formats are different, so if you try 1.2.x, any new .rrd files which are 
 
4203
   created are incompatible.
 
4204
</p>
 
4205
<p>   The new version doesn't use freetype, it uses libart, which introduces a different (not better,
 
4206
   nor worse) chain of dependencies.
6420
4207
</p>
6421
4208
 
6422
4209
<pre>
6436
4223
A: Create the rrd directory and make sure that the -u userid has read/write
6437
4224
   access to it (typically /usr/share/ntop/rrd).
6438
4225
</pre>
6439
 
<br>
6440
 
<p>
6441
 
<b>Q.</b>&nbsp;
6442
 
 rrdPlugin - problem with rrd/myrrd?
6443
 
</p>
6444
 
<p>
6445
 
<b>A.</b>&nbsp;
6446
 
 By default, ntop's Makefile binds the static libmyrrd library to create ntop's
6447
 
   rrdPlugin shared library.  THIS IS DELIBERATE so that you use the myrrd library
 
4226
 
 
4227
<pre>
 
4228
Q: Still nothing...
 
4229
A: Remember to activate the plugin.  You will need to configure it, and remember that
 
4230
   the default configuration does not include per-host data.
 
4231
</pre>
 
4232
<br>
 
4233
<p><b>Q.</b>&nbsp; What's the difference in the Host Detail Level for RRDs?</p>
 
4234
<p><b>A.</b>&nbsp; Low is just the bare counts, pktSent/pktRcvd and bytesSent/bytesRcvd.</p>
 
4235
<p>   Medium adds:
 
4236
</p>
 
4237
 
 
4238
<pre>
 
4239
     pktDuplicatedAckSent/pktDuplicatedAckRcvd,
 
4240
     pktBroadcastSent, bytesBroadcastSent,
 
4241
     pktMulticastSent, bytesMulticastSent,
 
4242
     pktMulticastRcvd, bytesMulticastRcvd, 
 
4243
     bytesSentLoc, bytesSentRem, bytesRcvdLoc, bytesRcvdFromRem, 
 
4244
     ipBytesSent, ipBytesRcvd, 
 
4245
     tcpSentLoc, tcpSentRem, tcpRcvdLoc, tcpRcvdFromRem, tcpFragmentsSent, tcpFragmentsRcvd, 
 
4246
     udpSentLoc, udpSentRem, udpRcvdLoc, udpRcvdFromRem, udpFragmentsSent, udpFragmentsRcvd, 
 
4247
     icmpSent, icmpRcvd, icmpFragmentsSent, icmpFragmentsRcvd, 
 
4248
     ipv6Sent, ipv6Rcvd
 
4249
</pre>
 
4250
 
 
4251
<pre>
 
4252
    NonIP:
 
4253
</pre>
 
4254
 
 
4255
<pre>
 
4256
     stpSent, stpRcvd,
 
4257
     ipxSent, ipxRcvd,
 
4258
     osiSent, osiRcvd,
 
4259
     dlcSent, dlcRcvd,
 
4260
     arp_rarpSent, arp_rarpRcvd, arpReqPktsSent, arpReplyPktsSent, arpReplyPktsRcvd,
 
4261
     decnetSent, decnetRcvd,
 
4262
     appletalkSent, appletalkRcvd,
 
4263
     netbiosSent, netbiosRcvd,
 
4264
     otherSent, otherRcvd
 
4265
</pre>
 
4266
 
 
4267
<pre>
 
4268
    And the per-protocol Sent/Rcvd
 
4269
</pre>
 
4270
<p>   High adds:
 
4271
</p>
 
4272
 
 
4273
<pre>
 
4274
     totContactedSentPeers, totContactedRcvdPeers
 
4275
</pre>
 
4276
 
 
4277
<pre>
 
4278
    And the per-IP-protocol Sent/Rcvd, e.g. IP_HTTP...
 
4279
</pre>
 
4280
<br>
 
4281
<p><b>Q.</b>&nbsp; rrdPlugin - problem with rrd/myrrd?</p>
 
4282
<p><b>A.</b>&nbsp; By default, ntop's Makefile binds the static libmyrrd library to create ntop's   rrdPlugin shared library.  THIS IS DELIBERATE so that you use the myrrd library
6448
4283
   and not some other version of rrd that's installed somewhere else on your system.
6449
4284
</p>
6450
 
<p>
6451
 
   Sometimes this causes problems, where there are special tricks required to tell
 
4285
<p>   Sometimes this causes problems, where there are special tricks required to tell
6452
4286
   (a non gnu ld) loader about static (.a) libraries, which ntop doesn't have in
6453
4287
   the Makefile nor the configureextra files.
6454
4288
</p>
6455
 
<p>
6456
 
   As a SHORT TERM WORK-AROUND, you can TRY this:
 
4289
<p>   As a SHORT TERM WORK-AROUND, you can TRY this:
6457
4290
</p>
6458
4291
 
6459
4292
<pre>
6460
4293
      $ cd myrrd
6461
4294
</pre>
6462
 
<p>
6463
 
   Edit Makefile --
 
4295
<p>   Edit Makefile --
6464
4296
</p>
6465
4297
 
6466
4298
<pre>
6467
4299
       all: $(LIBRRD) libmyrrd.so
6468
4300
                      ^^^^^^^^^^^ add this 
6469
4301
</pre>
6470
 
<p>
6471
 
   Add these lines:
 
4302
<p>   Add these lines:
6472
4303
</p>
6473
4304
 
6474
4305
<pre>
6475
4306
       libmyrrd.so: $(OBJECTS)
6476
4307
       <tab>ld -shared -o libmyrrd.so $(OBJECTS)
6477
4308
</pre>
6478
 
<p>
6479
 
   Now do make.  You should see a libmyrrd.so file.
 
4309
<p>   Now do make.  You should see a libmyrrd.so file.
6480
4310
</p>
6481
 
<p>
6482
 
   The main 'make' should now complete.  Copy that libmyrrd.so file where the other
 
4311
<p>   The main 'make' should now complete.  Copy that libmyrrd.so file where the other
6483
4312
   ntop library files are, and it MIGHT work.
6484
4313
</p>
6485
 
<p>
6486
 
   However, the whole idea behind having a static libmyrrd.a is to prevent version
 
4314
<p>   However, the whole idea behind having a static libmyrrd.a is to prevent version
6487
4315
   conflicts and use a stable version of rrd.
6488
4316
</p>
6489
 
<p>
6490
 
   The right fix is to get the configureextra/<whatever> file changed.
 
4317
<p>   The right fix is to get the configureextra/<whatever> file changed.
6491
4318
</p>
6492
4319
<h2>netFlow and sFlow</h2>
6493
4320
<br>
6494
 
<p>
6495
 
<b>Q.</b>&nbsp;
6496
 
 How do I access netFlow or sFlow data from ntop?
6497
 
</p>
6498
 
<p>
6499
 
<b>A.</b>&nbsp;
6500
 
 You need to configure ntop as a listener (it can also be a collector, but
6501
 
   that data shows up in the receiving interface, not under netFlow/sFlow).
6502
 
</p>
6503
 
<p>
6504
 
   First, use the appropriate plugin to set the parameters - basically the port
 
4321
<p><b>Q.</b>&nbsp; How do I access netFlow or sFlow data from ntop?</p>
 
4322
<p><b>A.</b>&nbsp; You need to configure ntop as a listener.</p>
 
4323
<p>   First, use the appropriate plugin to set the parameters - basically the port
6505
4324
   you want ntop to listen on.  Then, using the Admin | Set Interface menu item,
6506
4325
   switch ntop to report on the sFlow/netFlow pseudo-device (NetFlow-device or
6507
4326
   sFlow-device).
6508
4327
</p>
6509
4328
<br>
6510
 
<p>
6511
 
<b>Q.</b>&nbsp;
6512
 
 Is there any parameter to set to tell sFlow which interface/ip address
6513
 
   to use when exporting the flows?
6514
 
</p>
6515
 
<p>
6516
 
<b>A.</b>&nbsp;
6517
 
 No. All ntop does is send a packet to the network addressed to the
6518
 
   destination you request.
6519
 
</p>
6520
 
<p>
6521
 
   Typically if the ntop host is multihomed, the routing service will pick the
6522
 
   the MOST SPECIFIC route with the lowest metric # that is selected.  E.g., if
6523
 
   this is the routing table:
6524
 
</p>
6525
 
<p>
6526
 
   Kernel IP routing table
6527
 
   Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
6528
 
   192.168.2.0    0.0.0.0          255.255.255.0   U     0      0        0 eth0
6529
 
   192.168.2.129  0.0.0.0          255.255.255.128 U     0      0        0 eth2
6530
 
   192.168.2.146  0.0.0.0          255.255.255.255 U     0      0        0 eth1
6531
 
   192.168.2.146  0.0.0.0          255.255.255.255 U     1      0        0 eth2
6532
 
   127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
6533
 
   0.0.0.0         192.168.2.1     0.0.0.0         UG    0      0        0 eth0
6534
 
</p>
6535
 
<p>
6536
 
   A packet to 192.168.2.146 goes via eth1 (equally specific routes, so it
6537
 
   chooses based on the metric 0 vs. 1)
6538
 
</p>
6539
 
<p>
6540
 
   A packet to 192.168.2.145 goes via eth2  (192.168.2.129/25 is more specific
6541
 
   than 192.168.2.0/24)
6542
 
</p>
6543
 
<p>
6544
 
   A packet to 192.168.2.46 goes via eth0
6545
 
</p>
6546
 
<p>
6547
 
   A packet to 10.1.1.1 goes via eth0 (the gateway is the least specific route,
6548
 
   but it is the best match)
6549
 
</p>
6550
 
<p>
6551
 
   But how it goes out (and thus the source IP address) is totally up to the OS.
6552
 
   Just be aware when it gets to the sflow collector, it might have an
6553
 
   unexpected ip address as the source.
6554
 
</p>
 
4329
<p><b>Q.</b>&nbsp; Can I use ntop as a netflow collector.</p>
 
4330
<p><b>A.</b>&nbsp; Not in the current versions - you used to be able, but that code was removed.</p>
6555
4331
<h2>netFlow</h2>
6556
4332
<br>
6557
 
<p>
6558
 
<b>Q.</b>&nbsp;
6559
 
 Which versions of netFlow.
6560
 
</p>
6561
 
<p>
6562
 
<b>A.</b>&nbsp;
6563
 
 v5
6564
 
   And v1/v7/v9 - in that internally a v1/v7/v9 flow is copied to a v5 buffer and then
 
4333
<p><b>Q.</b>&nbsp; Which versions of netFlow.</p>
 
4334
<p><b>A.</b>&nbsp; v5   And v1/v7/v9 - in that internally a v1/v7/v9 flow is copied to a v5 buffer and then
6565
4335
   processed.  We default/ignore fields that are different.
6566
4336
   And nFlow - similar conversion.
6567
4337
</p>
6568
4338
<br>
6569
 
<p>
6570
 
<b>Q.</b>&nbsp;
6571
 
 netFlow doesn't work.
6572
 
</p>
6573
 
<p>
6574
 
<b>A.</b>&nbsp;
6575
 
 You MUST make sure the ntop plugin is ACTIVE. With the change to allow
6576
 
   setting parameters while inactive, it's easy to miss that last step.  
 
4339
<p><b>Q.</b>&nbsp; netFlow doesn't work.</p>
 
4340
<p><b>A.</b>&nbsp; You MUST make sure the ntop plugin is ACTIVE. With the change to allow   setting parameters while inactive, it's easy to miss that last step.  
6577
4341
   If you don't activate the plugin, you'll still have the netflow-device, but
6578
4342
   no data on it...
6579
4343
</p>
6580
4344
<br>
6581
 
<p>
6582
 
<b>Q.</b>&nbsp;
6583
 
 What's Virtual NetFlow Interface?
6584
 
</p>
6585
 
<p>
6586
 
<b>A.</b>&nbsp;
6587
 
 Be sure and set it. It's important for pseudo-local classification, which
6588
 
   affects L R reporting.  You need to set it to the (network) and mask for 
 
4345
<p><b>Q.</b>&nbsp; What's Virtual NetFlow Interface?</p>
 
4346
<p><b>A.</b>&nbsp; Be sure and set it. It's important for pseudo-local classification, which   affects L R reporting.  You need to set it to the (network) and mask for 
6589
4347
   the netFlow collector.  So ntop knows 'where' the data is coming from.
6590
4348
</p>
6591
4349
<br>
6592
 
<p>
6593
 
<b>Q.</b>&nbsp;
6594
 
 'splain some more, Lucy...
6595
 
</p>
6596
 
<p>
6597
 
<b>A.</b>&nbsp;
6598
 
 OK.
6599
 
</p>
6600
 
<p>
6601
 
   It's best to think of netFlow like this:
6602
 
</p>
6603
 
<p>
6604
 
   The physical interface which is monitoring the packets is like a
 
4350
<p><b>Q.</b>&nbsp; 'splain some more, Lucy...</p>
 
4351
<p><b>A.</b>&nbsp; OK.</p>
 
4352
<p>   It's best to think of netFlow like this:
 
4353
</p>
 
4354
<p>   The physical interface which is monitoring the packets is like a
6605
4355
   temperature probe you stick into a roast.
6606
4356
</p>
6607
 
<p>
6608
 
   Even though the display of the data can be right there at the probe, or
 
4357
<p>   Even though the display of the data can be right there at the probe, or
6609
4358
   the other end of a (long) wire, or somewhere entirely elsewhere via a 
6610
4359
   wireless connection, the probe is monitoring at the tip.  If it says 145F,
6611
4360
   that's the temperature of the meat - not the oven and not the kitchen.
6612
4361
</p>
6613
 
<p>
6614
 
   Similarly, the netFlow data ntop is receiving is based on the probe
 
4362
<p>   Similarly, the netFlow data ntop is receiving is based on the probe
6615
4363
   location.
6616
4364
</p>
6617
 
<p>
6618
 
   So, if you have a router and are monitoring a single interface to collect
 
4365
<p>   So, if you have a router and are monitoring a single interface to collect
6619
4366
   netFlow data, then the ip address you want to give to ntop is that of
6620
4367
   the router interface.
6621
4368
</p>
6622
 
<p>
6623
 
   If you are monitoring a router with more than one interface, you will 
 
4369
<p>   If you are monitoring a router with more than one interface, you will 
6624
4370
   need to give ntop ONE of those addresses and use the -m | --local-subnets
6625
4371
   option to tell it that the other addresses are also local.
6626
4372
</p>
6627
4373
<br>
6628
 
<p>
6629
 
<b>Q.</b>&nbsp;
6630
 
 Where is info about netflow?
6631
 
</p>
6632
 
<p>
6633
 
<b>A.</b>&nbsp;
6634
 
 Dale Reed pointed out a good tech doc (no flak, just the formats) for netflow
6635
 
</p>
 
4374
<p><b>Q.</b>&nbsp; Where is info about netflow?</p>
 
4375
<p><b>A.</b>&nbsp; Dale Reed pointed out a good tech doc (no flak, just the formats) for netflow</p>
6636
4376
<pre>
6637
4377
    V1/5/7:
6638
4378
</pre>
6640
4380
<pre>
6641
4381
http://www.cisco.com/univercd/cc/td/doc/product/rtrmgmt/nfc/nfc_2_0/nfc_ug/nfcform.htm
6642
4382
</pre>
6643
 
<p>
6644
 
   (As of Oct2003, it includes v8 and is here:)
 
4383
<p>   (As of Oct2003, it includes v8 and is here:)
6645
4384
</p>
6646
4385
<pre>
6647
4386
http://www.cisco.com/univercd/cc/td/doc/product/rtrmgmt/nfc/nfc_3_0/nfc_ug/nfcform.htm
6648
4387
</pre>
6649
4388
<br>
6650
 
<p>
6651
 
<b>Q.</b>&nbsp;
6652
 
 How Do I Enable NetFlow Data Export on a Cisco Device?
6653
 
</p>
6654
 
<p>
6655
 
<b>A.</b>&nbsp;
6656
 
 To enable netFlow Data Export (NDE) from a Cisco device to an ntop netFlow
6657
 
   receiver on port 2055 (default) at address 10.1.1.1:
 
4389
<p><b>Q.</b>&nbsp; How Do I Enable NetFlow Data Export on a Cisco Device?</p>
 
4390
<p><b>A.</b>&nbsp; To enable netFlow Data Export (NDE) from a Cisco device to an ntop netFlow   receiver on port 2055 (default) at address 10.1.1.1:
6658
4391
</p>
6659
4392
 
6660
4393
<pre>
6661
4394
     ip flow-export destination 10.1.1.1 2055
6662
4395
     ip flow-export version 5
6663
4396
</pre>
6664
 
<p>
6665
 
   You may want to designate the source interface, e.g.:
 
4397
<p>   You may want to designate the source interface, e.g.:
6666
4398
</p>
6667
4399
 
6668
4400
<pre>
6669
4401
     ip flow-export source Ethernet0
6670
4402
</pre>
6671
 
<p>
6672
 
   Enable netFlow on each interface to be monitored. netFlow normally only
 
4403
<p>   Enable netFlow on each interface to be monitored. netFlow normally only
6673
4404
   captures data from each incoming packet, so to see traffic in both directions
6674
4405
   netFlow must be enabled on both the incoming and outgoing interfaces. As an
6675
4406
   example, for an Internet access router this would mean enabling netFlow on
6686
4417
     interface Dialer1
6687
4418
     ip route-cache flow
6688
4419
</pre>
6689
 
<p>
6690
 
   By default netFlow will only export flow statistics shortly after the flow
 
4420
<p>   By default netFlow will only export flow statistics shortly after the flow
6691
4421
   Terminates or when 30 minutes have elapsed. In many environments, you want
6692
4422
   ntop to be a bit more up to date. To change the timeout to five minutes:
6693
4423
</p>
6695
4425
<pre>
6696
4426
     ip flow-cache timeout active 5
6697
4427
</pre>
6698
 
<p>
6699
 
   The following 'show' commands are useful for examining netFlow statistics
 
4428
<p>   The following 'show' commands are useful for examining netFlow statistics
6700
4429
   directly on the Cisco box and may assist when setting up ntop:
6701
4430
</p>
6702
4431
 
6705
4434
     show ip cache flow
6706
4435
     show ip cache verbose flow
6707
4436
</pre>
6708
 
<p>
6709
 
   Obviously, there is a lot more to it than this, for more information, see the
 
4437
<p>   Obviously, there is a lot more to it than this, for more information, see the
6710
4438
   Cisco web site: http://www.cisco.com/go/netflow
6711
4439
</p>
6712
4440
<pre>
6713
4441
                                     (Created by sholmes at snapshot, 02Feb2003)
6714
4442
</pre>
 
4443
<br>
 
4444
<p><b>Q.</b>&nbsp; Can I run ONLY w/ netFlow (Running ntop as a Collector for Net Flow only)</p>
 
4445
<p><b>A.</b>&nbsp; Sure.</p>
 
4446
<p>   ntop is usually configured to capture all traffic from local interfaces. If no 
 
4447
   interface is given (e.g. option -i|--interface is missing), the "first" interface 
 
4448
   is taken. This value, typically eth0 on linux boxes, may not be what you wanted. 
 
4449
</p>
 
4450
<p>   If you want to use ntop as a collector for Net Flow traffic only, you may want to
 
4451
   supress all local traffic. 
 
4452
</p>
 
4453
<p>   In this case use -i none or --interface none. 
 
4454
</p>
 
4455
<p>   Remember to activate Net Flow plugin from Menu Admin->Plugin and to configure the
 
4456
   plugin by setting "Local Collector UDP Port". 
 
4457
</p>
6715
4458
<h2>sFlow</h2>
6716
4459
<br>
6717
 
<p>
6718
 
<b>Q.</b>&nbsp;
6719
 
 What is sFlow
6720
 
</p>
6721
 
<p>
6722
 
<b>A.</b>&nbsp;
6723
 
 The core component of the sFlow toolkit is the sflowtool command line
6724
 
   utility. sflowtool interfaces to utilities such as tcpdump, ntop and Snort
 
4460
<p><b>Q.</b>&nbsp; What is sFlow</p>
 
4461
<p><b>A.</b>&nbsp; The core component of the sFlow toolkit is the sflowtool command line   utility. sflowtool interfaces to utilities such as tcpdump, ntop and Snort
6725
4462
   for detailed packet tracing and analysis, NetFlow compatible collectors for
6726
4463
   IP flow accounting, and provides text based output that can be used in
6727
4464
   scripts to provide customized analysis and reporting and for integrating with
6728
4465
   other tools such as MRTG or rrdtool.
6729
4466
</p>
6730
 
<p>
6731
 
   Some info:
 
4467
<p>   Some info:
6732
4468
</p>
6733
 
<p>
6734
 
   http://www.inmon.com/sflowTools.htm
 
4469
<p>   http://www.inmon.com/sflowTools.htm
6735
4470
   http://www.faqs.org/rfcs/rfc3176.html
6736
4471
</p>
6737
4472
<br>
6738
 
<p>
6739
 
<b>Q.</b>&nbsp;
6740
 
 I have activated the sFlow plugin in ntop. But it doesn't seem to
6741
 
   generate any output based on the collected sflow datagrams.
6742
 
</p>
6743
 
<p>
6744
 
<b>A.</b>&nbsp;
6745
 
 sFlow can be a collector or a receiver or both, depending on the
6746
 
   settings configured via the plugin.
6747
 
</p>
6748
 
<p>
6749
 
   If you configure ntop as an sFlow collector, it will use sFlow data
 
4473
<p><b>Q.</b>&nbsp; I have activated the sFlow plugin in ntop. But it doesn't seem to   generate any output based on the collected sflow datagrams.
 
4474
</p>
 
4475
<p><b>A.</b>&nbsp; sFlow can be a collector or a receiver or both, depending on the   settings configured via the plugin.
 
4476
</p>
 
4477
<p>   If you configure ntop as an sFlow collector, it will use sFlow data
6750
4478
   for generating reports, treating the remote collector(s) as another
6751
4479
   network interface - see Admin | Switch NIC.
6752
4480
</p>
6753
 
<h2>snapshot, cvs and the Wiki</h2>
6754
 
<br>
6755
 
<p>
6756
 
<b>Q.</b>&nbsp;
6757
 
 What was "snapshot"?
6758
 
</p>
6759
 
<p>
6760
 
<b>A.</b>&nbsp;
6761
 
 Snapshot was a community FAQ and documentation resource at
6762
 
   http://snapshot.ntop.org. It's was also the site of "the snapshots".
6763
 
</p>
6764
 
<p>
6765
 
   Unfortunately, snapshot seems to have 'Gone to Atlanta' (404), with
6766
 
   the web server no longer responding in February 2004.
6767
 
</p>
6768
 
<p>
6769
 
   Nicolai Petri's efforts were appreciated.  But snapshot was an effort
6770
 
   of love by a gentleman who hasn't had time for the effort in quite 
6771
 
   some time.
6772
 
</p>
6773
 
<br>
6774
 
<p>
6775
 
<b>Q.</b>&nbsp;
6776
 
 Is there a community resource that replaces (enhances) snapshot.
6777
 
</p>
6778
 
<p>
6779
 
<b>A.</b>&nbsp;
6780
 
 Yes. There is now an ntop Wiki at
6781
 
</p>
6782
 
<pre>
6783
 
     http://www.burtonstrauss.com/pmwiki/pmwiki.php?pagename=Ntop.HomePage
6784
 
   Whether it remains available depends on whether people contribute.
6785
 
</pre>
6786
 
<br>
6787
 
<p>
6788
 
<b>Q.</b>&nbsp;
6789
 
 What was "a snapshot" or "the snapshots"?
6790
 
</p>
6791
 
<p>
6792
 
<b>A.</b>&nbsp;
6793
 
 A snapshot was a dump of the ntop cvs structure, automatically generated
6794
 
   every day at 5 minutes after midnight (Pisa time).
6795
 
</p>
6796
 
<p>
6797
 
   Snapshots were named with their creation date, in the form of
6798
 
   ntop-yy-mm-dd.tgz.
6799
 
</p>
6800
 
<p>
6801
 
   Snapshots were neither polished nor even "releases". They contained any
6802
 
   update(s) checked into the cvs during the prior day.  No more, no less.
6803
 
</p>
6804
 
<p>
6805
 
   cvs checkins (commits) are usually tested by the developer, but perhaps only
6806
 
   in one (limited) environment.  Occasionally a file is missed or a typo occurs
6807
 
   and a snapshot wouldn't compile. Snapshots frequently introduced bugs that aren't
6808
 
   apparent on a quick review.  Snapshots were basically a point-in-time capture
6809
 
   of the moving development environment.  No more and no less.
6810
 
</p>
6811
 
<p>
6812
 
   With release 2.2, rapid development occurred after general release and using
6813
 
   the latest snapshot was your best bet. With 3.0, after a short period of stability
6814
 
   (releases 2.2b and 2.2c), the development again outpaced the stable version and
6815
 
   using the cvs again was almost manditory. 
6816
 
</p>
6817
 
<p>
6818
 
   If the 3.0 release doesn't work, drop by the mailing lists and check the back
6819
 
   traffic to see if this is a common problem.  If it's not, try the latest
6820
 
   snapshot or ask for a recommendation of which version is the best to use.
6821
 
</p>
6822
 
<p>
6823
 
   As with 2.2, we plan to have a cvs branch to allow for 3.0a/b/c
6824
 
   releases while 3.1 is being developed (3.1.1, 3.1.2, etc.).
6825
 
</p>
6826
 
<p>
6827
 
   Note that the ntop_2_2_patches branch broke the snapshot extract script, so
6828
 
   snapshots ARE NO LONGER RECOMENDED OR SUPPORTED.
6829
 
</p>
6830
 
<h2>Old answers, but goodies</h2>
6831
 
<br>
6832
 
<p>
6833
 
<b>Q.</b>&nbsp;
6834
 
 What is "obsolete/"
6835
 
</p>
6836
 
<p>
6837
 
<b>A.</b>&nbsp;
6838
 
 Obsolete code is code that is no longer being maintained nor part of ntop,
6839
 
   but it's stuck off in that directory because 1) storage is cheap and 2) it
6840
 
   might have usage someday and 3) somebody might be interested in resurrecting
6841
 
   it...
6842
 
</p>
6843
 
<p>
6844
 
   Code in obsolete/ IS NOT MAINTAINED, even minimally.
6845
 
</p>
6846
 
<p>
6847
 
   Specifics?  (As of June 2002)
6848
 
</p>
6849
 
 
6850
 
<pre>
6851
 
       Various programs and functions which supported "rules" were determined to
6852
 
       be obsolete were removed from ntop in late March 2002. This included a
6853
 
       substantial number of lines of code, which was simply removed. Entire
6854
 
       modules were placed into the obsolete/ directory.
6855
 
               ntop-rules.8
6856
 
               event.c
6857
 
               rules.c
6858
 
               rules.h
6859
 
               rules.sample
6860
 
</pre>
6861
 
 
6862
 
<pre>
6863
 
       Various plugin programs, which were no longer being supported, were
6864
 
       removed from ntop in late March 2002. These entire modules were placed
6865
 
       into the obsolete/ directory.
6866
 
               wapPlugin.c
6867
 
               rmon.h
6868
 
               rmonPlugin.c
6869
 
</pre>
6870
 
 
6871
 
<pre>
6872
 
       Various lines of code (totaling a substantial number, widely scattered
6873
 
       Throughout ntop), which had provided compile-time selectable support
6874
 
       (#define ENABLE_NAPSTER) for analysis of the (late) Napster protocol were
6875
 
       removed on 4Apr2002.  
6876
 
</pre>
6877
 
<br>
6878
 
<p>
6879
 
<b>Q.</b>&nbsp;
6880
 
 I get an error, libtool: link: CURRENT `-release' is not a nonnegative
6881
 
   integer
6882
 
</p>
6883
 
<p>
6884
 
<b>A.</b>&nbsp;
6885
 
 This is an autoconf problem. It should be fixed.
6886
 
   The whole set of messages is typically:
6887
 
</p>
6888
 
<p>
6889
 
   [...]
6890
 
   > libtool: link: CURRENT `-release' is not a nonnegative integer
6891
 
   > libtool: link: `-release' is not valid version information
6892
 
   > make[2]: *** [libntop.la] Error 1
6893
 
   > make[2]: Leaving directory `/usr/local/src/ntop'
6894
 
   > make[1]: *** [all-recursive] Error 1
6895
 
   > make[1]: Leaving directory `/usr/local/src/ntop'
6896
 
   > make: *** [all-recursive-am] Error 2
6897
 
</p>
6898
 
<p>
6899
 
   From Luca:
6900
 
</p>
6901
 
 
6902
 
<pre>
6903
 
       "AFAIK this is a bug of autoconf that's not able to expand some macros,
6904
 
        namely those that contain the version number. The workaround is to
6905
 
        downgrade to the previous autoconf version."
6906
 
</pre>
6907
 
 
6908
 
<pre>
6909
 
       Workarounds:
6910
 
       - downgrade to a stable autoconf version
6911
 
       - edit all the ntop Makefile(s), add "0:0:0" behind any
6912
 
         occurrence of "version-info" and "2.0" behind
6913
 
         "-release".
6914
 
</pre>
6915
 
<p>
6916
 
   Other Solutions:
6917
 
</p>
6918
 
<p>
6919
 
   1) Burton posted a personal patch to do the above for Makefile.am on
6920
 
</p>
6921
 
<pre>
6922
 
      Thu Dec 20 2001 - "Compile problems with -release". Check the ntop-dev
6923
 
      archive.
6924
 
</pre>
6925
 
<p>
6926
 
   2) Older versions (e.g. Slackware 7.xx) of Linux installations have older
6927
 
</p>
6928
 
<pre>
6929
 
      versions of automake, which don't exhibit the bug.
6930
 
</pre>
6931
 
<p>
6932
 
   3) (Sean O'Neill) "I cheated a bit and hacked libtool by changing the
6933
 
</p>
6934
 
<pre>
6935
 
      following"
6936
 
</pre>
6937
 
 
6938
 
<pre>
6939
 
        current="$2"
6940
 
          to
6941
 
        current=0
6942
 
</pre>
6943
 
 
6944
 
<pre>
6945
 
    4) The new ./configure scripts - call it versions after Nov2002 - fix this.
6946
 
</pre>
6947
 
 
6948
 
<pre>
6949
 
Q, How to Build the (obsolete) RMON plugin
6950
 
</pre>
6951
 
<p>
6952
 
<b>A.</b>&nbsp;
6953
 
 Without any guarantees...
6954
 
</p>
6955
 
 
6956
 
<pre>
6957
 
    0) Please do NOT use a precompiled UCD package unless you know what you're
6958
 
       doing.
6959
 
</pre>
6960
 
 
6961
 
<pre>
6962
 
    1) Fetch UCD-SNMP [See http://net-snmp.sourceforge.net/developer.html]
6963
 
</pre>
6964
 
 
6965
 
<pre>
6966
 
    2) Compile the stuff as specified as follows :
6967
 
        [see also http://net-snmp.sourceforge.net/tutorial/toolkit/demon/]
6968
 
    > ./configure --with-mib-modules="agentx"
6969
 
    > make
6970
 
    > make install
6971
 
</pre>
6972
 
 
6973
 
<pre>
6974
 
    3) Once you this stuff ready you can build the ntop/RMON plugins.
6975
 
</pre>
6976
 
 
6977
 
<pre>
6978
 
    4) Now start ntop.
6979
 
</pre>
6980
 
 
6981
 
<pre>
6982
 
    5) The ntop/RMON plugin listens on port 161 (the default SNMP port).
6983
 
        If you want to test the agent you can use the 'tkMib' tool that comes
6984
 
        with UCD-SNMP [see http://net-snmp.sourceforge.net/tkmib.jpg].
6985
 
</pre>
6986
 
<p>
6987
 
   NOTE: If you use tkMib do not forget to do "setenv MIBS ALL" (csh shells),
6988
 
</p>
6989
 
<pre>
6990
 
         otherwise you won't see the RMON MIB.
6991
 
</pre>
6992
 
<p>
6993
 
   How to Build the RMON plugin (bis) created 04/03 2002 by pierlo
6994
 
</p>
6995
 
<p>
6996
 
   The following works with :
6997
 
</p>
6998
 
<pre>
6999
 
     - ntop v.2.0.1
7000
 
     - UCD-SNMP v.4.2.3
7001
 
     - openSSL v.0.9.6c
7002
 
</pre>
7003
 
 
7004
 
<pre>
7005
 
     0. Requirements
7006
 
     * Make sure that ntop works properly
7007
 
</pre>
7008
 
 
7009
 
<pre>
7010
 
     * Make sure that openSSL & openSSL libraries are correctly installed
7011
 
       (no WARNING when ntop is started !). If not, download and install
7012
 
       the latest versions)
7013
 
</pre>
7014
 
 
7015
 
<pre>
7016
 
     * fetch & install UCD-SNMP :
7017
 
     tar -xvzf XXXXX.tar.gz
7018
 
     ./configure --enable-shared
7019
 
     make
7020
 
     umask 022
7021
 
     make install
7022
 
</pre>
7023
 
 
7024
 
<pre>
7025
 
     1. uncomment lines around 474 and 1035 in configure.in file :
7026
 
</pre>
7027
 
 
7028
 
<pre>
7029
 
     dnl>OPTIONAL UCD-SNMP
7030
 
     dnl>AC_HAVE_HEADERS(ucd-snmp/ucd-snmp-agent-includes.h)
7031
 
     (...)
7032
 
     dnl> check for `UCD-SNMP' library by University of California
7033
 
         [http://ucd-snmp.ucdavis.edu]
7034
 
     dnl>AC_CHECK_LIB(ucdagent, register_mib, [AC_DEFINE(HAVE_SNMP) 
7035
 
           SNMPLIBS="-L/usr/local/lib -lsnmp -lucdagent -lucdmibs"],
7036
 
           , -lsnmp -lucdagent -lucdmibs $LIBS $MORELIBS)
7037
 
</pre>
7038
 
 
7039
 
<pre>
7040
 
     (remove the dnl> from the AC_ lines)
7041
 
</pre>
7042
 
 
7043
 
<pre>
7044
 
     * in /ntop/plugins/rmonPlugin.c file, replace :
7045
 
</pre>
7046
 
 
7047
 
<pre>
7048
 
     line 702 approx. : droppedPackets with droppedPkts
7049
 
     (there is only one occurence, so it may not be difficult to find)
7050
 
</pre>
7051
 
 
7052
 
<pre>
7053
 
     line 676 approx. :
7054
 
     if (header_simple_table (vp,name,length,exact,var_len,
7055
 
          write_method,numDevices)
7056
 
</pre>
7057
 
 
7058
 
<pre>
7059
 
     with :
7060
 
</pre>
7061
 
 
7062
 
<pre>
7063
 
     if (header_simple_table(vp,name,length,exact,var_len,
7064
 
          write_method,myGlobals.numDevices)
7065
 
</pre>
7066
 
 
7067
 
<pre>
7068
 
     and :
7069
 
</pre>
7070
 
 
7071
 
<pre>
7072
 
     long_ret = (long)(device[ifNum]
7073
 
</pre>
7074
 
 
7075
 
<pre>
7076
 
     with
7077
 
</pre>
7078
 
 
7079
 
<pre>
7080
 
     long_ret = (long)(myGlobals.device[ifNum]
7081
 
</pre>
7082
 
 
7083
 
<pre>
7084
 
     (lines 690 to 782 approx., about 13 occurences to change)
7085
 
</pre>
7086
 
 
7087
 
<pre>
7088
 
     2. launch /ntop/autogen.sh -1
7089
 
</pre>
7090
 
 
7091
 
<pre>
7092
 
     3. launch /ntop/configure
7093
 
</pre>
7094
 
 
7095
 
<pre>
7096
 
     Be sure that :
7097
 
</pre>
7098
 
 
7099
 
<pre>
7100
 
     * there is no warning about openSSL libraries !
7101
 
</pre>
7102
 
 
7103
 
<pre>
7104
 
     * the following checks are successful :
7105
 
     " Step 4. Looking for both required and optional system headers....
7106
 
     (...)
7107
 
     checking for ucd-snmp/ucd-snmp-agent-includes.h... yes"
7108
 
     (...)
7109
 
</pre>
7110
 
 
7111
 
<pre>
7112
 
     "Step 7. Looking for optional GPLed libraries....
7113
 
     (...)
7114
 
     checking for register_mib in -lucdagent... yes"
7115
 
</pre>
7116
 
 
7117
 
<pre>
7118
 
     -> NO warning about openSSL libraries here ! If any trouble,
7119
 
     check config.log file, which may help to get round the problem...
7120
 
     Looking at ls.so.conf file and checking libraries pathes may also be
7121
 
     helpful.
7122
 
</pre>
7123
 
 
7124
 
<pre>
7125
 
     3. edit /ntop/plugins/Makefile : replace every ocurence of "icmpPlugin"
7126
 
        with "rmonPlugin".
7127
 
</pre>
7128
 
 
7129
 
<pre>
7130
 
     4. Launch /ntop/plugins/make
7131
 
</pre>
7132
 
 
7133
 
<pre>
7134
 
     5. Theoretically, RMON plugin is built and is ready to work ! If you have
7135
 
        a error message like "undefined symbol..." when ntop started...
7136
 
        I don't know how to fix it.
7137
 
</pre>
7138
 
 
7139
 
<pre>
7140
 
     Hope I didn't forget anything... Have fun !
7141
 
</pre>
7142
 
 
7143
 
<pre>
7144
 
     P-L.
7145
 
</pre>
7146
 
<br>
7147
 
<p>
7148
 
<b>Q.</b>&nbsp;
7149
 
 I don't understand -j | --border-sniffer-mode
7150
 
</p>
7151
 
<p>
7152
 
<b>A.</b>&nbsp;
7153
 
 Welcome to the club <grin />
7154
 
</p>
7155
 
<p>
7156
 
   Quoting from Luca's comment:
7157
 
</p>
7158
 
<p>
7159
 
   "-j is used when you are starting ntop on a mirrored interface where you
7160
 
   cannot trust MAC addresses."
7161
 
</p>
7162
 
<p>
7163
 
   ntop uses MAC addresses for many things to differentiate among machines.
7164
 
   IP addresses and names can mean many things, but hardware addresses are
7165
 
   supposed to be unique.  This is usually true, but gets hairy when you
7166
 
   introduce a switch into the network which is also copying all of the
7167
 
   packets it sees to a monitoring port.
7168
 
</p>
7169
 
<p>
7170
 
   Understand how a switch works: In short, a switch monitors the network it
7171
 
   sees and knows which mac address(es) are on which ports.  When it received a
7172
 
   packet, it forwards it to only that port. Broadcasts are forwarded to all
7173
 
   ports.
7174
 
</p>
7175
 
<p>
7176
 
   So an ntop instance, sniffer, whatever only sees a fraction of the traffic.
7177
 
</p>
7178
 
<p>
7179
 
   In many managed switches, there is an option for a "repeater" or "monitoring"
7180
 
   or "spanned" port, which receives all traffic, so that network monitoring can
7181
 
   be performed there.
7182
 
</p>
7183
 
<p>
7184
 
   However, When the switch sends out packets on the monitoring port, it must
7185
 
   rewrite them to be valid Ethernet packets with a valid (i.e. the switch's)
7186
 
   MAC address and ntop gets confused.
7187
 
</p>
7188
 
<p>
7189
 
   Note that:
7190
 
</p>
7191
 
<p>
7192
 
   1. -j usually requires you to specify the local network (-m) as a mirrored
7193
 
</p>
7194
 
<pre>
7195
 
      interface might have a wrong/ip-less/privare IP address.
7196
 
</pre>
7197
 
<p>
7198
 
   2. -j disables some features as TCP session tracking etc.
7199
 
</p>
7200
 
<p>
7201
 
   In future versions -j will disappear and it will be replaced with more flags
7202
 
   for better controlling all these options.
7203
 
</p>
7204
 
<p>
7205
 
   With multiple switches in a hierarchy, you have to place the ntop instance
7206
 
   or instances carefully, depending upon what you want to monitor.
7207
 
</p>
7208
 
<p>
7209
 
   For example, most lans have a switch in each area with its uplink connected
7210
 
   to a backbone switch.  Servers and gateways are then placed off one or more
7211
 
   backbone ports.  This keeps departmental traffic isolated from each other,
7212
 
   while making enterprise wide and inter-department traffic feasible.  ntop
7213
 
   would have to be monitoring the backbone switch, but you would need to be
7214
 
   aware of what ntop is NOT seeing and place additional monitors.
7215
 
</p>
7216
 
<p>
7217
 
   For example, you could place additional ntop instances in the departments,
7218
 
   using the netflow or sFlow plugins to receive flow information from them
7219
 
   which wouldn't be visible to the backbone instance. (I'll note that I haven't
7220
 
   actually tried this, myself. -----Burton)
7221
 
</p>
7222
 
<br>
7223
 
<p>
7224
 
<b>Q.</b>&nbsp;
7225
 
 When I run with -j | --border-sniffer-mode, there are different menus.
7226
 
</p>
7227
 
<p>
7228
 
<b>A.</b>&nbsp;
7229
 
 Yes.
7230
 
</p>
7231
 
<p>
7232
 
   The menus are just html files.  There is a set for regular mode and a
7233
 
   j_xxx.html set for border sniffer mode.  Why?  Because there are things
7234
 
   that simply don't work in border-sniffer-mode, so why let the user
7235
 
   request those pages.
7236
 
</p>
7237
 
<br>
7238
 
<p>
7239
 
<b>Q.</b>&nbsp;
7240
 
 OK, but it changed after 2.1.2 (i.e. in 2.1.50) what are the NEW parameters?
7241
 
</p>
7242
 
<p>
7243
 
<b>A.</b>&nbsp;
7244
 
 There were four new parameters introduced when -j | --border-sniffer-mode
7245
 
   was removed.  Whether the old parameter really did all the same things as
7246
 
   the new ones is irrelevant and left to code-archeologists.  What matters
7247
 
   is what the new ones are and what they do!
7248
 
</p>
7249
 
<br>
7250
 
<p>
7251
 
<b>Q.</b>&nbsp;
7252
 
 What was the -S option?
7253
 
</p>
7254
 
<p>
7255
 
<b>A.</b>&nbsp;
7256
 
 The -S option was the --store-mode option, or the "Persistent storage mode"
7257
 
   Ntop's internal structures are basically an array of devices (network
7258
 
   interfaces), which contains an array of hosts (specific machines seen on the
7259
 
   device.
7260
 
</p>
7261
 
<p>
7262
 
   So device[0] is the 1st network interface, and device[2] the third.
7263
 
   device[0].host[0] would be, say, the local file server and device[0].host[1]
7264
 
   would be a simple host. device[1].host[1] is a completely different set of
7265
 
   counts from device[0].host[1].
7266
 
</p>
7267
 
<p>
7268
 
   The -S options tells ntop to store information about a specific host in a
7269
 
   database from run to run (-S 0 none, -S 1 all and -S 2 only local hosts).
7270
 
</p>
7271
 
<p>
7272
 
   This is only the count information about the host and does not store the
7273
 
   information about a device (a network interface). Further, items of
7274
 
   dynamically allocated storage (the devices name) are not stored.
7275
 
</p>
7276
 
<p>
7277
 
   Data is retrieved on a subsequent run ONLY when traffic is seen from that
7278
 
   host after the restart.  (I suppose you could script a ping to each host you
7279
 
   care about and force the reload that way, but it hasn't been tested...)
7280
 
</p>
7281
 
<p>
7282
 
   So if you go into the host details (e.g. the 192.168.1.1.html page) you
7283
 
   should see prior-run information.
7284
 
</p>
7285
 
<p>
7286
 
   But if you're looking for device throughput to be preserved... nope...
7287
 
</p>
7288
 
<p>
7289
 
   Also, ntop stores the information during 1) reset and 2) shutdown. So if ntop
7290
 
   crashes, the persistent data will be lost.
7291
 
</p>
7292
 
<p>
7293
 
   This option was removed from ntop in the 2.1.52 development version.
7294
 
</p>
7295
 
<br>
7296
 
<p>
7297
 
<b>Q.</b>&nbsp;
7298
 
 What was the -A option, a/k/a --accuracy-level?
7299
 
</p>
7300
 
<p>
7301
 
<b>A.</b>&nbsp;
7302
 
 This option was used to set ntop into various modes which performed less
7303
 
   processing, in order to handle higher traffic volumes.
7304
 
</p>
7305
 
<p>
7306
 
   It was added on 14Dec2001 (just before v2.0) and was removed on 11Mar2002,
7307
 
   although traces survived in usage() until April 2002.
7308
 
</p>
7309
 
<p>
7310
 
   Note that the CODE remains in initialize.c for use by EXPERTS if necessary.
7311
 
</p>
7312
 
<br>
7313
 
<p>
7314
 
<b>Q.</b>&nbsp;
7315
 
 What was the --no-admin-password-hint option?
7316
 
</p>
7317
 
<p>
7318
 
<b>A.</b>&nbsp;
7319
 
 This option was used to remove the hint text from the administrative password
7320
 
   entry message box.
7321
 
</p>
7322
 
<p>
7323
 
   It was added 4Feb2002 and removed 8Mar2002 (the last traces, in usage(), were
7324
 
   removed on 4Apr2002).
7325
 
</p>
 
4481
<br>
 
4482
<p><b>Q.</b>&nbsp; sFlow doesn't work.</p>
 
4483
<p><b>A.</b>&nbsp; Check this out:</p>
 
4484
 
 
4485
<pre>
 
4486
     This talks about a bad experience I had setting up sFlow reception. For the longest
 
4487
     time, I could see that ntop was getting sflow packets, but no data would show up. 
 
4488
     It turns out the switch I was exporting from didn't see any real traffic, and it was 
 
4489
     just sending COUNTERSAMPLE packets..... 
 
4490
</pre>
 
4491
 
 
4492
<pre>
 
4493
     - - - - - - - - I figured out that it was indeed "invalid" sflow packets. 
 
4494
</pre>
 
4495
 
 
4496
<pre>
 
4497
     Apparently, sflow sends COUNTERSAMPLE and FLOWSAMPLE packets. COUNTERSAMPLE packets 
 
4498
     give a quick look at interface counters on the machine, whereas FLOWSAMPLE packets 
 
4499
     are actual packet fragments from IP connections. Ntop seems to simply parse, 
 
4500
     debug_print, and discard COUNTERSAMPLE packets...which made it confusing to look at 
 
4501
     the debug output and say "wow, lots of sflow coming in!" when in fact it was just for
 
4502
     show, as Burton suggested. I added more switches (with active connections) to the
 
4503
     switches sending sflow packets and I now have hosts with pretty graphs. 
 
4504
</pre>
7326
4505
<h2>Solaris</h2>
7327
 
 
7328
 
<pre>
7329
 
                                        During the ntop 2.2 development cycle,
7330
 
                                        we did development/testing under:
7331
 
                                           Solaris 2.5, 7 and 8 (i86)
7332
 
</pre>
7333
 
 
7334
 
<pre>
7335
 
                                        During the ntop 3.0 development cycle,
7336
 
                                        we did development/testing under:
7337
 
                                           Solaris 8 (i86) and 9
7338
 
</pre>
7339
 
<br>
7340
 
<p>
7341
 
<b>Q.</b>&nbsp;
7342
 
 How do I install the ntop package on Solaris?
7343
 
</p>
7344
 
<p>
7345
 
<b>A.</b>&nbsp;
7346
 
 For instance do 'pkgadd -d ntop-2.2-solaris.i386'
7347
 
</p>
7348
 
<br>
7349
 
<p>
7350
 
<b>Q.</b>&nbsp;
7351
 
 What c compiler do I need?
7352
 
</p>
7353
 
<p>
7354
 
<b>A.</b>&nbsp;
7355
 
 Sun's cc or gnu's gcc.
7356
 
</p>
7357
 
<br>
7358
 
<p>
7359
 
<b>Q.</b>&nbsp;
7360
 
 What about /usr/ucb/cc is that the one?
7361
 
</p>
7362
 
<p>
7363
 
<b>A.</b>&nbsp;
7364
 
 No. cc is software you pay for. /usr/ucb/cc is a stub compiler and good for,
7365
 
   recompiling the kernel and absolutely nothing else.
7366
 
</p>
7367
 
<p>
7368
 
   The cc I mean is Sun's Commercial Compiler.
7369
 
</p>
7370
 
<h2>xxxxBSD</h2>
7371
 
<br>
7372
 
<p>
7373
 
<b>Q.</b>&nbsp;
7374
 
 When I type 'make' it complains about a makefile error.
7375
 
</p>
7376
 
<p>
7377
 
<b>A.</b>&nbsp;
7378
 
 Always remember to use gnu make.
7379
 
</p>
7380
 
<p>
7381
 
   On many *BSD systems which have other 'make's, gnu make is called gmake.
 
4506
<br>
 
4507
<p><b>Q.</b>&nbsp; How do I install the ntop package on Solaris?</p>
 
4508
<p><b>A.</b>&nbsp; For instance do 'pkgadd -d ntop-2.2-solaris.i386'</p>
 
4509
<br>
 
4510
<p><b>Q.</b>&nbsp; What c compiler do I need?</p>
 
4511
<p><b>A.</b>&nbsp; Sun's cc or gnu's gcc.</p>
 
4512
<br>
 
4513
<p><b>Q.</b>&nbsp; What about /usr/ucb/cc is that the one?</p>
 
4514
<p><b>A.</b>&nbsp; No. cc is software you pay for. /usr/ucb/cc is a stub compiler and good for,   recompiling the kernel and absolutely nothing else.
 
4515
</p>
 
4516
<p>   The cc I mean is Sun's Commercial Compiler.
 
4517
</p>
 
4518
<h2>BSD - FreeBSD</h2>
 
4519
 
 
4520
<pre>
 
4521
                                        During the ntop 3.2 development cycle,
 
4522
                                        we did development/testing under:
 
4523
                                           4.10 and 4.11
 
4524
                                           5.3 and 5.4
 
4525
</pre>
 
4526
<br>
 
4527
<p><b>Q.</b>&nbsp; When I type 'make' it complains about a makefile error.</p>
 
4528
<p><b>A.</b>&nbsp; Always remember to use gnu make.</p>
 
4529
<p>   On many *BSD systems which have other 'make's, gnu make is called gmake.
7382
4530
   Try make --version -- if it shows a Gnu version stamp you're ok, otherwise
7383
4531
   try gmake.
7384
4532
</p>
7385
 
<h2>BSD - FreeBSD</h2>
7386
 
 
7387
 
<pre>
7388
 
                                        During the ntop 2.2 development cycle,
7389
 
                                        we did development/testing under:
7390
 
                                           4.6.3
7391
 
                                           5.0
7392
 
</pre>
7393
 
 
7394
 
<pre>
7395
 
                                        Users reported success with:
7396
 
                                           4.7
7397
 
                                           4.8
7398
 
</pre>
7399
 
 
7400
 
<pre>
7401
 
                                        During the ntop 3.0 development cycle,
7402
 
                                        we did development/testing under:
7403
 
                                           4.8 and 4.9
7404
 
                                           5.1 and 5.2
7405
 
</pre>
7406
 
 
7407
 
<pre>
7408
 
                                        Users reported success with:
7409
 
                                           4.6.2
7410
 
                                           4.5.1
7411
 
</pre>
7412
 
<br>
7413
 
<p>
7414
 
<b>Q.</b>&nbsp;
7415
 
 I can't compile ntop under FreeBSD 5.0 or 5.1.
7416
 
</p>
7417
 
<p>
7418
 
<b>A.</b>&nbsp;
7419
 
 In some situations, we produce gcc link lines which expose a conflict 'tween
7420
 
   FreeBSD 5.x and libtool.
7421
 
</p>
7422
 
<p>
7423
 
   You will see the following error messages:
7424
 
</p>
7425
 
 
7426
 
<pre>
7427
 
       expr: illegal option -- l
7428
 
       usage: expr [-e] expression
7429
 
       etc.
7430
 
</pre>
7431
 
<p>
7432
 
   See the release notes for FreeBSD 5.0 and the expr(1) man page:
7433
 
</p>
7434
 
 
7435
 
<pre>
7436
 
       http://www.freebsd.org/releases/5.0R/DP2/relnotes-i386.html
7437
 
       http://www.freebsd.org/cgi/man.cgi?query=expr&sektion=1&manpath=FreeBSD+5.0-current
7438
 
</pre>
7439
 
<p>
7440
 
   Solve this by setting the compatibility flag before running make.
7441
 
</p>
7442
 
 
7443
 
<pre>
7444
 
       $ export EXPR_COMPAT=Y
7445
 
</pre>
7446
 
<p>
7447
 
   configure.in and configure have been updated to do warn you to do this.
7448
 
</p>
7449
 
<br>
7450
 
<p>
7451
 
<b>Q.</b>&nbsp;
7452
 
 I get "ntop: /dev/bpf0: Device not configured", what's wrong?
7453
 
</p>
7454
 
<p>
7455
 
<b>A.</b>&nbsp;
7456
 
 This is because bfpX has not been configured inside the generic bsd-kernel
7457
 
   config file.
7458
 
</p>
7459
 
<p>
7460
 
   If you use generic kernel config file put "pseudo-device bpfilter 16" in
 
4533
<br>
 
4534
<p><b>Q.</b>&nbsp; I get "ntop: /dev/bpf0: Device not configured", what's wrong?</p>
 
4535
<p><b>A.</b>&nbsp; This is because bfpX has not been configured inside the generic bsd-kernel   config file.
 
4536
</p>
 
4537
<p>   If you use generic kernel config file put "pseudo-device bpfilter 16" in
7461
4538
   kernel config file and rebuild the kernel.
7462
4539
</p>
7463
4540
<br>
7464
 
<p>
7465
 
<b>Q.</b>&nbsp;
7466
 
 I remember rumors about something not being right under FreeBSD with
7467
 
   threads?
7468
 
</p>
7469
 
<p>
7470
 
<b>A.</b>&nbsp;
7471
 
 Yes. See FreeBSD bug bin/17437 at
7472
 
   http://www.FreeBSD.org/cgi/query-pr.cgi?pr=17437
7473
 
</p>
7474
 
<p>
7475
 
   Basically, due to limits in FreeBSD, there is no pthread_atfork() function.
 
4541
<p><b>Q.</b>&nbsp; I remember rumors about something not being right under FreeBSD with   threads?
 
4542
</p>
 
4543
<p><b>A.</b>&nbsp; Yes. See FreeBSD bug bin/17437 at   http://www.FreeBSD.org/cgi/query-pr.cgi?pr=17437
 
4544
</p>
 
4545
<p>   Basically, due to limits in FreeBSD, there is no pthread_atfork() function.
7476
4546
   So, when ntop does it's fork() call to create http pages, it can't fixup
7477
4547
   the Mutexes.  It wrong and could conceivably cause problems.
7478
4548
</p>
7479
 
<p>
7480
 
   However - ntop ran for years without the pthread_atfork() code, so we're
 
4549
<p>   However - ntop ran for years without the pthread_atfork() code, so we're
7481
4550
   no worse off in 3.0 under FreeBSD than in 2.2 or 2.1...
7482
4551
</p>
7483
 
<p>
7484
 
   There was a flurry of problems late in the 3.0 development cycle having to
7485
 
   do with a seeming deadlock of the ntop web server (it's actually not dead,
 
4552
<br>
 
4553
<p><b>Q.</b>&nbsp; The web server problem?</p>
 
4554
<p><b>A.</b>&nbsp; There was a flurry of problems late in the 3.0 development cycle having to   do with a seeming deadlock of the ntop web server (it's actually not dead,
7486
4555
   just walking at about 0.001KPH).
7487
4556
</p>
7488
 
<p>
7489
 
   Thanks to Yeoman efforts by Stanley Hopcroft, Michal Meloun and, well, me,
 
4557
<p>   Thanks to Yeoman efforts by Stanley Hopcroft, Michal Meloun and, well, me,
7490
4558
   we have a work-around.  
7491
4559
</p>
7492
 
<p>
7493
 
   If you're running under FreeBSD, use the flag, --set-pcap-nonblocking.
7494
 
</p>
7495
 
<p>
7496
 
   For more on this, read the threads at gmane - look for "FreeBSD and pthreads" - 
 
4560
<p>   With 3.1 we tried to automate this workaround, but fell a foul of FreeBSD's
 
4561
   fixes.  So in 3.2 we've reverted to requiring the command line flag.
 
4562
</p>
 
4563
<p>   If you're running under FreeBSD and have problems, use the flag, --set-pcap-nonblocking.
 
4564
</p>
 
4565
<p>   For more on this, read the threads at gmane - look for "FreeBSD and pthreads" - 
7497
4566
   that's probably the best summary.  But there's stuff on this back at least to 
7498
4567
   October 2003 - look for Stanley's problems with CPU usage.
7499
4568
</p>
7500
 
<br>
7501
 
<p>
7502
 
<b>Q.</b>&nbsp;
7503
 
 Um... something about bad fds?
7504
 
</p>
7505
 
<p>
7506
 
<b>A.</b>&nbsp;
7507
 
 Oh yes, see bug bin/51535: uthreads bug: new opened files may get stale fcntl flags
7508
 
</p>
7509
 
<p>
7510
 
   They fixed the code, sort of:
7511
 
</p>
7512
 
 
7513
 
<pre>
7514
 
         OS      Version
7515
 
         ------- --------------
7516
 
         FreeBSD 4.9    FIXED
7517
 
         FreeBSD 5.1    BUGGY
7518
 
         FreeBSD 5.2    FIXED
7519
 
         FreeBSD 4.8    BUGGY
7520
 
         FreeBSD 4.6.2  BUGGY
7521
 
</pre>
7522
 
<p>
7523
 
   There's a work-around in ntop, called the HAVE_FILEDESCRIPTORBUG fix.
7524
 
   If you even might possibly need it, it should be set in configureextra/ but 
7525
 
   go ahead and set it anyway, it can't hurt.
7526
 
</p>
7527
 
<h2>BSD - OpenBSD</h2>
7528
 
 
7529
 
<pre>
7530
 
                                        During the ntop 3.0 development cycle,
7531
 
                                        we tried development/testing under:
7532
 
                                           3.1 and 3.4
7533
 
</pre>
7534
 
<br>
7535
 
<p>
7536
 
<b>Q.</b>&nbsp;
7537
 
 So?
7538
 
</p>
7539
 
<p>
7540
 
<b>A.</b>&nbsp;
7541
 
 3.1 - I could never make it work. Problem seems to be that the gnu tools such
7542
 
   as ld don't support a.out systems very well.
7543
 
</p>
7544
 
<p>
7545
 
<b>A.</b>&nbsp;
7546
 
 3.4 - Should work. Julien Touche <julien.touche@lycos.com> sweated buckets
7547
 
   to make this work and reported that it did in January 2004.
7548
 
</p>
7549
 
<h2>BSD - NetBSD</h2>
7550
 
 
7551
 
<pre>
7552
 
                                        During the ntop 2.3 development cycle,
7553
 
                                        we tried development/testing under:
7554
 
                                           1.5.3
7555
 
                                           1.6
7556
 
                                           1.6.1
7557
 
</pre>
7558
 
<br>
7559
 
<p>
7560
 
<b>Q.</b>&nbsp;
7561
 
 So?
7562
 
</p>
7563
 
<p>
7564
 
<b>A.</b>&nbsp;
7565
 
 Some testing was done using - ntop works only in SINGLE THREADED mode and so
7566
 
   is fragile.
7567
 
</p>
7568
 
<br>
7569
 
<p>
7570
 
<b>Q.</b>&nbsp;
7571
 
 And Multithreaded?
7572
 
</p>
7573
 
<p>
7574
 
<b>A.</b>&nbsp;
7575
 
 There isn't (yet) a standard POSIX thread package for NetBSD. Both "proven"
7576
 
   and "unproven" threads have issues.  One user was bound and determined to
7577
 
   make GNU Pth work, but pth isn't quite POSIX threads and he's didn't get
7578
 
   far...
7579
 
</p>
7580
 
<br>
7581
 
<p>
7582
 
<b>Q.</b>&nbsp;
7583
 
 But there IS a POSIX threads...
7584
 
</p>
7585
 
<p>
7586
 
<b>A.</b>&nbsp;
7587
 
 Yes. And when NetBSD -current finally incorporates the POSIX threads (its
7588
 
   been committed but not yet part of a release) this should be revisited.
 
4569
<p><b>A.</b>&nbsp; Also, understand that --set-pcap-nonblocking is going to increase ntop's   cpu usage.  It will probably come close to pegging the CPU at 100%.  Yet
 
4570
   strangely other processes won't seem to be impacted. (Of course, you really
 
4571
   should be running ntop on it's own host, anyway, right?).
 
4572
</p>
 
4573
<p>   This is because of how the work-around is coded. ntop should step aside
 
4574
   briefly and let them run.
 
4575
</p>
 
4576
<p>   Just be aware of it and don't ask on the mailing lists.
 
4577
</p>
 
4578
<p>   It's not giant lock vs. fine grained, etc., it's really the handling of 
 
4579
   signals (user interrupts) that is different. 
 
4580
</p>
 
4581
<p>   Say you have a process, A running.
 
4582
</p>
 
4583
<p>   In linux, POSIX thread x is kernel process x' and POSIX thread y is kernel 
 
4584
   process y'.  Now the POSIX standard doesn't prevent thread y from receiving 
 
4585
   a signal 'intended' for x, so you have to code for that.  But when a thread 
 
4586
   'sleeps', the process sleeps, which is something the kernel understands and 
 
4587
   so the kernel can do other work.
 
4588
</p>
 
4589
<p>   In a userland threads model (i.e. xBSD), POSIX thread x and POSIX thread y 
 
4590
   are both parts of kernel process A.  To implement the POSIX threading, the
 
4591
   thread library code creates a thread manager, thread z'. That thread receives
 
4592
   all signals, interupts etc. and parcels the work back out.  
 
4593
</p>
 
4594
<p>   This too is perfectly within the POSIX model.
 
4595
</p>
 
4596
<p>   BUT: To implement the thread manager implies that the user task (A+x+y+z) is 
 
4597
   active whenever it's waiting for ANYTHING.  How well this works depends upon 
 
4598
   the sophistication of kernel processes that recognize when the user task is 
 
4599
   'idle', meaning it is spinning waiting for somethings, vs. doing useful work.
 
4600
</p>
 
4601
<p>   In FreeBSD 4.x, we see that this recognition is not very sophisticated when 
 
4602
   it comes to the bpf pseudo driver and so ntop will use 100% of the available CPU.
 
4603
   Even so, the scheduler bounces between tasks of equal priority, so productive
 
4604
   work does get done, but you see the high CPU usage charged to your task.
7589
4605
</p>
7590
4606
<h2>Linux - all</h2>
7591
4607
 
7592
4608
<pre>
7593
 
                                        During the ntop 2.2 development cycle,
7594
 
                                        we did development and/or testing under:
7595
 
                                           Debian
7596
 
                                           LinuxFromScratch 3.0pre3
7597
 
                                           RedHat AS2.1, 7.2, 7.3, 8.0
7598
 
</pre>
7599
 
 
7600
 
<pre>
7601
 
                                        During the ntop 3.0 development cycle,
7602
 
                                        we did development and/or testing under:
7603
 
                                           Debian 3.0 (Woody)
7604
 
                                           Gentoo 1.4 (rc5 and released)
7605
 
                                           LinuxFromScratch 3.0pre3
7606
 
                                           Mandrake 9.1
7607
 
                                           RedHat AS2.1, 7.3, 8.0 and 9
7608
 
                                           Slackware 9.0
7609
 
                                           SuSE 8.2
7610
 
</pre>
7611
 
 
7612
 
<pre>
7613
 
                                        And loads more - see the list above.
 
4609
                                        During the ntop 3.2 development cycle,
 
4610
                                        we did development and/or testing under:
 
4611
                                           Gentoo 2005.0
 
4612
                                           Fedora Core 2 and 3
 
4613
</pre>
 
4614
 
 
4615
<pre>
 
4616
                                        The cvs version was run by users on many
 
4617
                                        other versions.
7614
4618
</pre>
7615
4619
 
7616
4620
<pre>
7619
4623
</pre>
7620
4624
<h2>Linux - RedHat</h2>
7621
4625
<br>
7622
 
<p>
7623
 
<b>Q.</b>&nbsp;
7624
 
 NPTL?
7625
 
</p>
7626
 
<p>
7627
 
<b>A.</b>&nbsp;
7628
 
 When RH9 came out with NPTL, we had lots of problems. NPTL is much closer
7629
 
   to POSIX threads, but very different from the old linuxthreads.  At the same
7630
 
   time, we had problems with the glibc 2.3.x (vs. 2.2.x) update.
7631
 
</p>
7632
 
<p>
7633
 
   By the end of the development cycle, a couple of memory management fixes
7634
 
   seem to have made the NPTL/glibc problems go away.  But if they're still out
7635
 
   there, they are quite nasty.  Random unexplained BOMBs and such.
7636
 
</p>
7637
 
<p>
7638
 
   If you hit these problems, you can try disabling NPTL via this flag.
7639
 
   Before both ./configure AND make, set the following:
7640
 
</p>
7641
 
 
7642
 
<pre>
7643
 
        export LD_ASSUME_KERNEL=2.4.1"
7644
 
</pre>
7645
 
<p>
7646
 
   This forces the use of the old linuxthreads library.
7647
 
</p>
7648
 
<p>
7649
 
   This flag may also do something to glibc, but it's undocumented and we
7650
 
   never could really figure it out.  For that run time behavior change
7651
 
   to happen, you would also have to have the LD_ASSUME_KERNAL flag set
7652
 
   at run time too.
7653
 
</p>
7654
 
<br>
7655
 
<p>
7656
 
<b>Q.</b>&nbsp;
7657
 
 The cause?
7658
 
</p>
7659
 
<p>
7660
 
<b>A.</b>&nbsp;
7661
 
 Unknown.
7662
 
</p>
7663
 
<p>
7664
 
   A lot of them seemed to go away when we fixed a free() that occurs in
7665
 
   a fork()ed child of memory malloc()ed in the parent.  Under Linux, the
7666
 
   fork() gets a copy of memory, but a technique called copy-on-write is used
7667
 
   to reduce the time the fork() takes.
7668
 
</p>
7669
 
<p>
7670
 
   We suspected that the free() was corrupting the parent's memory structures,
7671
 
   but this isn't supposed to be possible and we couldn't nail it down enough
7672
 
   to report it to the glibc people.
7673
 
</p>
7674
 
<br>
7675
 
<p>
7676
 
<b>Q.</b>&nbsp;
7677
 
 What can I do to help?
7678
 
</p>
7679
 
<p>
7680
 
<b>A.</b>&nbsp;
7681
 
 There is code in leaks.c tagged "DIAGNOSTIC". Turn it on, collect a set of
7682
 
   potential problems and report them.  However, this code isn't that bright.
7683
 
   It will report all the free() calls in fork()ed children, even those that
7684
 
   are legit (i.e. the malloc() was also in for fork()ed child).
7685
 
</p>
7686
 
<br>
7687
 
<p>
7688
 
<b>Q.</b>&nbsp;
7689
 
 "application bug: ntop(...) has SIGCHLD set to SIG_IGN but calls wait().
7690
 
   (See the NOTES section of 'man 2 wait'). Workaround activated."
7691
 
</p>
7692
 
<p>
7693
 
   This message and the NOTES section of the man page lead me to believe
 
4626
<p><b>Q.</b>&nbsp; "application bug: ntop(...) has SIGCHLD set to SIG_IGN but calls wait().   (See the NOTES section of 'man 2 wait'). Workaround activated."
 
4627
</p>
 
4628
<p>   This message and the NOTES section of the man page lead me to believe
7694
4629
   that the problem is handled but the kernel feels the need to report it
7695
4630
   from time to time.
7696
4631
</p>
7697
 
<p>
7698
 
<b>A.</b>&nbsp;
7699
 
 Read the NOTES section. The problem has been handled, but the kernel
7700
 
   feels the need to report it from time to time.  See the article at
 
4632
<p><b>A.</b>&nbsp; Read the NOTES section. The problem has been handled, but the kernel   feels the need to report it from time to time.  See the article at
7701
4633
   http://article.gmane.org/gmane.linux.ntop.general/5304
7702
4634
</p>
7703
4635
<br>
7704
 
<p>
7705
 
<b>Q.</b>&nbsp;
7706
 
 libpng version conflicts?
7707
 
</p>
7708
 
<p>
7709
 
<b>A.</b>&nbsp;
7710
 
 See libpng, below.
7711
 
</p>
 
4636
<p><b>Q.</b>&nbsp; libpng version conflicts?</p>
 
4637
<p><b>A.</b>&nbsp; See libpng, below.</p>
7712
4638
<h2>Win32 - Common</h2>
7713
4639
<br>
7714
 
<p>
7715
 
<b>Q.</b>&nbsp;
7716
 
 Where can I find GDBM for Windows?
7717
 
</p>
7718
 
<p>
7719
 
<b>A.</b>&nbsp;
7720
 
 GDBM for windows can be found at http://www.roth.net/libs/gdbm/
7721
 
</p>
 
4640
<p><b>Q.</b>&nbsp; Where can I find GDBM for Windows?</p>
 
4641
<p><b>A.</b>&nbsp; GDBM for windows can be found at http://www.roth.net/libs/gdbm/</p>
7722
4642
<br>
7723
 
<p>
7724
 
<b>Q.</b>&nbsp;
7725
 
 ntop -i1 ... doesn't work
7726
 
</p>
7727
 
<p>
7728
 
<b>A.</b>&nbsp;
7729
 
 ntop has special parameters under Win32
7730
 
</p>
 
4643
<p><b>Q.</b>&nbsp; ntop -i1 ... doesn't work</p>
 
4644
<p><b>A.</b>&nbsp; ntop has special parameters under Win32</p>
7731
4645
 
7732
4646
<pre>
7733
4647
         Under win32 there are TWO COMPLETELY SEPARATE TYPES OF PARAMETERS.
7753
4667
</pre>
7754
4668
 
7755
4669
<pre>
7756
 
         ntop /d deletes the ntop service
 
4670
         ntop /r removes the ntop service
7757
4671
</pre>
7758
 
<p>
7759
 
   Remember, ntop /i and ntop /d don't actually run the service - you need to
 
4672
<p>   Remember, ntop /i and ntop /d don't actually run the service - you need to
7760
4673
   start it.
7761
4674
</p>
 
4675
<p>   REMEMBER: there are TWO ways to run ntop, one as a service, one 'interactively' (/c).
 
4676
</p>
 
4677
<p>   They are totally separate.  Just because you ran ntop w/ interactively with some parameter 
 
4678
   set, does not affect the stored parameter set for the service.
 
4679
</p>
 
4680
<p>   To change the stored parameters, reinstall the service vi /i.
 
4681
</p>
7762
4682
<br>
7763
 
<p>
7764
 
<b>Q.</b>&nbsp;
7765
 
 How do I figure out what my network interface numbers are for the -I
7766
 
   parameter?
7767
 
</p>
7768
 
<p>
7769
 
<b>A.</b>&nbsp;
7770
 
 (Thanks to jac engel [jacengel@home.nl] for the example)
7771
 
</p>
7772
 
<p>
7773
 
   If you only have ONE network interface, it doesn't matter as the default is
 
4683
<p><b>Q.</b>&nbsp; How do I figure out what my network interface numbers are for the -I   parameter?
 
4684
</p>
 
4685
<p><b>A.</b>&nbsp; (Thanks to jac engel [jacengel@home.nl] for the example)</p>
 
4686
<p>   If you only have ONE network interface, it doesn't matter as the default is
7774
4687
   fine.  However, that's the RARE case.  Most people have multiple network
7775
4688
   interfaces (NICs), with virtual ones for VPNs, Dialup Networking, etc.
7776
4689
</p>
7777
 
<p>
7778
 
   The Windows tools ipconfig, winipcfg and the Device Manager (depending on
 
4690
<p>   The Windows tools ipconfig, winipcfg and the Device Manager (depending on
7779
4691
   which version of Windows you have) will probably show you them.  However,
7780
4692
   it's easier and better to use ntop to show you how ntop sees the network
7781
4693
   interfaces.
7782
4694
</p>
7783
 
<p>
7784
 
   If you start  ntop /c (interactive mode, with only the default parameters) it
 
4695
<p>   If you start  ntop /c (interactive mode, with only the default parameters) it
7785
4696
   Will display all your network interfaces (NICs), like this:
7786
4697
</p>
7787
4698
 
7809
4720
  whatever...
7810
4721
</pre>
7811
4722
<br>
7812
 
<p>
7813
 
<b>Q.</b>&nbsp;
7814
 
 OK, but how to I translate \Device\Packet_xxxxx to my Froboz ModelT network
7815
 
   card and not the Fubar27 that's on the motherboard.
7816
 
</p>
7817
 
<p>
7818
 
<b>A.</b>&nbsp;
7819
 
 ntop should report both the index and the human readable information.
7820
 
</p>
7821
 
<p>
7822
 
<b>A.</b>&nbsp;
7823
 
 A Google search on script "CurrentVersion\NetworkCards" finds a couple of
7824
 
   scripts/utilities that might work in various environments.
7825
 
</p>
7826
 
<p>
7827
 
<b>A.</b>&nbsp;
7828
 
 Otherwise...
7829
 
</p>
7830
 
<p>
7831
 
   You're going to need to view the registry.  All the usual warnings - back up
 
4723
<p><b>Q.</b>&nbsp; OK, but how to I translate \Device\Packet_xxxxx to my Froboz ModelT network   card and not the Fubar27 that's on the motherboard.
 
4724
</p>
 
4725
<p><b>A.</b>&nbsp; ntop should report both the index and the human readable information.</p>
 
4726
<p><b>A.</b>&nbsp; A Google search on script "CurrentVersion\NetworkCards" finds a couple of   scripts/utilities that might work in various environments.
 
4727
</p>
 
4728
<p><b>A.</b>&nbsp; Otherwise...</p>
 
4729
<p>   You're going to need to view the registry.  All the usual warnings - back up
7832
4730
   your pc, etc.
7833
4731
</p>
7834
 
<p>
7835
 
   If you damage the registry, you may not be able to reboot the computer.
 
4732
<p>   If you damage the registry, you may not be able to reboot the computer.
7836
4733
</p>
7837
 
<p>
7838
 
   You're not going to CHANGE anything, but an inadvertent keystroke could be
 
4734
<p>   You're not going to CHANGE anything, but an inadvertent keystroke could be
7839
4735
   disaster ... BE CAREFUL!
7840
4736
</p>
7841
 
<p>
7842
 
   Under WinNT/2K, to find the interface name of your NIC look in the registry
 
4737
<p>   Under WinNT/2K, to find the interface name of your NIC look in the registry
7843
4738
   at the keys in 
7844
4739
</p>
7845
4740
<pre>
7848
4743
   which NIC.
7849
4744
</pre>
7850
4745
<br>
7851
 
<p>
7852
 
<b>Q.</b>&nbsp;
7853
 
 Where does ntop look for html (and gif) files under Win32?
7854
 
</p>
7855
 
<p>
7856
 
<b>A.</b>&nbsp;
7857
 
 ntop looks in two places. The first is the current directory and the second
7858
 
   is configurable through a constant in ntop_win32.h, #define DATAFILE_DIR "."
7859
 
</p>
7860
 
<p>
7861
 
   Note that the current directory, or ".", may not be what you expect.
7862
 
</p>
7863
 
<p>
7864
 
   When running ntop as a Win32 service, "." is %SystemRoot%\system32, meaning
 
4746
<p><b>Q.</b>&nbsp; Where does ntop look for html (and gif) files under Win32?</p>
 
4747
<p><b>A.</b>&nbsp; ntop looks in two places. The first is the current directory and the second   is configurable through a constant in ntop_win32.h, #define DATAFILE_DIR "."
 
4748
</p>
 
4749
<p>   Note that the current directory, or ".", may not be what you expect.
 
4750
</p>
 
4751
<p>   When running ntop as a Win32 service, "." is %SystemRoot%\system32, meaning
7865
4752
   that ntop looks in %SystemRoot%\system32\html for the .html and .gif files.
7866
4753
</p>
7867
 
<p>
7868
 
   When running ntop from the command line,
 
4754
<p>   When running ntop from the command line,
7869
4755
</p>
7870
4756
 
7871
4757
<pre>
7872
4758
       ntop /c parameters...
7873
4759
</pre>
7874
 
<p>
7875
 
   "." is whatever directory is current.  This means that if you run ntop with a
 
4760
<p>   "." is whatever directory is current.  This means that if you run ntop with a
7876
4761
   full, explicit path (c:\ntopnew\ntop /c ...) there may be an unexpected
7877
4762
   difference between what ntop finds for "." and what you THINK "." is!  This
7878
4763
   will lead to missing .html and .gif files.
7879
4764
</p>
7880
 
<p>
7881
 
   If you wish to have ntop look in a specific place for the files, the best
 
4765
<p>   If you wish to have ntop look in a specific place for the files, the best
7882
4766
   choices are:
7883
4767
</p>
7884
4768
 
7887
4771
        first.
7888
4772
     2) Edit ntop_win32.c and then recompile.
7889
4773
</pre>
7890
 
<p>
7891
 
   Note that the settings for DATAFILE_DIR (and other constants) are reported on
 
4774
<p>   Note that the settings for DATAFILE_DIR (and other constants) are reported on
7892
4775
   the text version of the configuration page, textinfo.html.
7893
4776
</p>
7894
4777
<h2>Win32 (MinGW) (Windows)</h2>
7895
4778
<br>
7896
 
<p>
7897
 
<b>Q.</b>&nbsp;
7898
 
 What's the scoop with ntop on Windows?
7899
 
</p>
7900
 
<p>
7901
 
<b>A.</b>&nbsp;
7902
 
 Semi-officially,
7903
 
</p>
7904
 
<p>
7905
 
   ntop for Windows 95/98/ME/NT/2K is also provided as a binary application with
 
4779
<p><b>Q.</b>&nbsp; What's the scoop with ntop on Windows?</p>
 
4780
<p><b>A.</b>&nbsp; Semi-officially,</p>
 
4781
<p>   ntop for Windows 95/98/ME/NT/2K is also provided as a binary application with
7906
4782
   limited capture capability (1000 packets). This is intended to allow 
7907
4783
   demonstration of ntop for people without access to a Unix system.
7908
4784
</p>
7909
 
<p>
7910
 
   We call this version Win32 after the old official name of the Windows library.
 
4785
<p>   We call this version Win32 after the old official name of the Windows library.
7911
4786
</p>
7912
 
<p>
7913
 
   If you want to use the full version with unlimited packet capture you can
 
4787
<p>   If you want to use the full version with unlimited packet capture you can
7914
4788
   either:
7915
4789
</p>
7916
4790
 
7920
4794
       * Register your ntop for Windows 95/98/NT/2K copy by paying a 
7921
4795
         convenience fee to receive the prebuilt executable.
7922
4796
</pre>
7923
 
<p>
7924
 
   If you decide to register your copy, Luca will send you an URL from which
 
4797
<p>   If you decide to register your copy, Luca will send you an URL from which
7925
4798
   you  can download the full version periodically.
7926
4799
</p>
7927
4800
<br>
7928
 
<p>
7929
 
<b>Q.</b>&nbsp;
7930
 
 So where did MinGW come in?
7931
 
</p>
7932
 
<p>
7933
 
<b>A.</b>&nbsp;
7934
 
 All of the necessary open software tools have been ported to run under
7935
 
   windows (sort of), so it is theoretically possible to build and run ntop
 
4801
<p><b>Q.</b>&nbsp; So where did MinGW come in?</p>
 
4802
<p><b>A.</b>&nbsp; All of the necessary open software tools have been ported to run under   windows (sort of), so it is theoretically possible to build and run ntop
7936
4803
   under Windows.  
7937
4804
</p>
7938
 
<p>
7939
 
   However, Windows and *nix are very, very different internally.  So we have
 
4805
<p>   However, Windows and *nix are very, very different internally.  So we have
7940
4806
   to use special versions of the packet capture library (winpcap instead of
7941
4807
   libpcap).  And we needed our standard tools (gcc et al), plus some 'glue'
7942
4808
   so we could make *nix calls and have Windows things happen.
7943
4809
</p>
7944
 
<p>
7945
 
   For the tools and glue, there are three choices: native, Cygwin and MinGW.
 
4810
<p>   For the tools and glue, there are three choices: native, Cygwin and MinGW.
7946
4811
</p>
7947
 
<p>
7948
 
   Native means you put lots of #ifdefs in to make Windows calls where you
 
4812
<p>   Native means you put lots of #ifdefs in to make Windows calls where you
7949
4813
   had *nix calls.
7950
4814
</p>
7951
 
<p>
7952
 
   Cygwin is a shim - it's a Windows dll (Dynamic Link Library) that pretends
 
4815
<p>   Cygwin is a shim - it's a Windows dll (Dynamic Link Library) that pretends
7953
4816
   to support the *nix calls and then does the right Windows things for you.
7954
4817
</p>
7955
 
<p>
7956
 
   MinGW is a project to create native Windows tools and executables from
 
4818
<p>   MinGW is a project to create native Windows tools and executables from
7957
4819
   *nix code.
7958
4820
</p>
7959
 
<p>
7960
 
   Each of these have limits, pluses and minuses.  For example, Cygwin's dll
 
4821
<p>   Each of these have limits, pluses and minuses.  For example, Cygwin's dll
7961
4822
   has caused all sorts of problems (dlls and their *nix equivalent, shared
7962
4823
   libraries, usually do).  MinGW has some limits.  As MinGW grew, ntop for
7963
4824
   Win32(MinGW) got closer to ntop under *nix.  Native means supporting two
7964
4825
   'separate' code bases.
7965
4826
</p>
7966
 
<p>
7967
 
   Luca actually picked a hybrid - he uses Microsoft Visual C++ 6.0 - which
 
4827
<p>   Luca actually picked a hybrid - he uses Microsoft Visual C++ 6.0 - which
7968
4828
   has it's own (albeit incomplete) shim layer.  As long as you stay within
7969
4829
   the limits of the shim, the same code works across platforms.  In other
7970
4830
   places you have to make thinks like Windows wants them.  How close are
7971
4831
   we?  grep for WIN32.
7972
4832
</p>
7973
 
<p>
7974
 
   The advantage of the hybrid was that is was also pretty close to working
 
4833
<p>   The advantage of the hybrid was that is was also pretty close to working
7975
4834
   under MinGW - creating native executables from the base code using free
7976
4835
   tools.  So people sent in patches and it pretty much worked.  Up until
7977
4836
   2.1.3, that is.  But it was never officially more than an 'it also runs'.
7978
4837
</p>
7979
 
<p>
7980
 
   After 2.1.3, Luca embarked on a process of bringing the WIN32 and *nix
 
4838
<p>   After 2.1.3, Luca embarked on a process of bringing the WIN32 and *nix
7981
4839
   code closer together.  Surprisingly, this actually broke MinGW!
7982
4840
</p>
7983
4841
<br>
7984
 
<p>
7985
 
<b>Q.</b>&nbsp;
7986
 
 Where do I get MinGW?
7987
 
</p>
7988
 
<p>
7989
 
<b>A.</b>&nbsp;
7990
 
 The MinGW home page is http://www.mingw.org. Quoting:
7991
 
</p>
 
4842
<p><b>Q.</b>&nbsp; Where do I get MinGW?</p>
 
4843
<p><b>A.</b>&nbsp; The MinGW home page is http://www.mingw.org. Quoting:</p>
7992
4844
 
7993
4845
<pre>
7994
4846
      "MinGW is a collection of header files and import libraries that 
8000
4852
      GNU toolchain, and looking for volunteers."
8001
4853
</pre>
8002
4854
<br>
8003
 
<p>
8004
 
<b>Q.</b>&nbsp;
8005
 
 Does ntop work under Cygwin?
8006
 
</p>
8007
 
<p>
8008
 
<b>A.</b>&nbsp;
8009
 
 The .exe distributed through ntop.org is built with Visual C++ 6.0.
8010
 
   It proved just barely possible to use the same code under MinGW.
 
4855
<p><b>Q.</b>&nbsp; Does ntop work under Cygwin?</p>
 
4856
<p><b>A.</b>&nbsp; The .exe distributed through ntop.org is built with Visual C++ 6.0.   It proved just barely possible to use the same code under MinGW.
8011
4857
   Forget about cygwin.
8012
4858
</p>
8013
4859
<br>
8014
 
<p>
8015
 
<b>Q.</b>&nbsp;
8016
 
 Does ntop (v3.0) work under MinGW?
8017
 
</p>
8018
 
<p>
8019
 
<b>A.</b>&nbsp;
8020
 
 No - There are problems with versions of ntop after 2.1.3 under MinGW -
8021
 
   it won't build.
8022
 
</p>
8023
 
<br>
8024
 
<p>
8025
 
<b>Q.</b>&nbsp;
8026
 
 When I type 'make' it complains about a makefile error.
8027
 
</p>
8028
 
<pre>
8029
 
A: Remember to use -f Makefile.MinGW or whatever is appropriate - see
8030
 
   BUILD-MinGW.txt.
8031
 
</pre>
8032
 
<br>
8033
 
<p>
8034
 
<b>Q.</b>&nbsp;
8035
 
 Mingw make of Ntop fails when using the single-file distribution
8036
 
   MinGW-1.1.tar.gz with make errors about version.c like :
8037
 
</p>
8038
 
<pre>
8039
 
    zsh: no matches found: *version
8040
 
    make: *** [version.c] Error 1
8041
 
</pre>
8042
 
<p>
8043
 
<b>A.</b>&nbsp;
8044
 
 Be sure that your PATH setting in the DOS command box of the Mingw bin
8045
 
   directory ends with a backslash.
8046
 
</p>
8047
 
<pre>
8048
 
    This is OK:
8049
 
        set path=C:\Mingw\bin\;%path%
8050
 
    This is wrong:
8051
 
        set path=C:\Mingw\bin;%path%
8052
 
                             ^
8053
 
</pre>
 
4860
<p><b>Q.</b>&nbsp; Does ntop (v3.2) work under MinGW?</p>
 
4861
<p><b>A.</b>&nbsp; Maybe (I think) - During the 3.1 development cycle changes were made to   support MinGW and it should again work - see docs/BUILD-MinGW.txt
 
4862
</p>
8054
4863
<h2>Win32 (MS Visual C++)</h2>
8055
 
<h2>Other platforms</h2>
8056
 
 
8057
 
<pre>
8058
 
-UX
8059
 
=-=-=
8060
 
During the 2.2 development cycle, some work was done to make ntop work under
8061
 
-UX 11 without breaking the HP-UX 10.20 support (limited as it was). During
8062
 
the 3.0 development cycle, HP-UX was not considered.
8063
 
</pre>
8064
 
 
8065
 
<pre>
8066
 
It will almost certainly fail.
8067
 
</pre>
8068
 
 
8069
 
<pre>
8070
 
IRIX (v1.3 information)
8071
 
=-=-=-=-=-=-=-=-=-=-=-=-
8072
 
During the ntop 2.2 and 3.0 development cycles, IRIX was not considered.
8073
 
</pre>
8074
 
 
8075
 
<pre>
8076
 
It will almost certainly fail.
8077
 
</pre>
8078
 
 
8079
 
<pre>
8080
 
Digital UNIX (v1.3)
8081
 
During the ntop 2.2 and 3.0 development cycles, Digital UNIX was not considered.
8082
 
</pre>
8083
 
 
8084
 
<pre>
8085
 
It will almost certainly fail.
8086
 
</pre>
8087
 
 
8088
 
<pre>
8089
 
AIX (v1.3)
8090
 
During the ntop 2.2 and 3.0 development cycles, AIX was not considered.
8091
 
</pre>
8092
 
 
8093
 
<pre>
8094
 
It will almost certainly fail.
8095
 
</pre>
8096
4864
<h2>Libpng</h2>
8097
4865
<br>
8098
 
<p>
8099
 
<b>Q.</b>&nbsp;
8100
 
 Bad things - I see the following messages:
8101
 
</p>
 
4866
<p><b>Q.</b>&nbsp; Bad things - I see the following messages:</p>
8102
4867
<pre>
8103
4868
        libpng warning: Application was compiled with png.h from libpng-1.0.x
8104
4869
        libpng warning: Application is running with png.c from libpng-1.2.x 
8105
4870
        gd-png: fatal libpng error: Incompatible libpng version in application
8106
4871
              and library
8107
4872
</pre>
8108
 
<p>
8109
 
<b>A.</b>&nbsp;
8110
 
 You have a version problem with libpng.
8111
 
</p>
8112
 
<p>
8113
 
   First off, following the instructions in BUILD-NTOP.txt should work just
 
4873
<p><b>A.</b>&nbsp; You have a version problem with libpng.</p>
 
4874
<p>   First off, following the instructions in BUILD-NTOP.txt should work just
8114
4875
   fine. These problems come about when you have libpng installed (i.e. using
8115
4876
   shared libraries).
8116
4877
</p>
8117
 
<p>
8118
 
   1. If you are compiling from source, you may have png.h left over from the
 
4878
<p>   1. If you are compiling from source, you may have png.h left over from the
8119
4879
</p>
8120
4880
<pre>
8121
4881
      earlier version of libpng. Remove it.
8122
4882
</pre>
8123
 
<p>
8124
 
   2. (Most common under RedHat). RedHat 7.2 installs a libgd.so.1.8.4 library,
 
4883
<p>   2. (Most common under RedHat). RedHat 7.2 installs a libgd.so.1.8.4 library,
8125
4884
</p>
8126
4885
<pre>
8127
4886
       which was compiled against 1.0.x series of libpng (which is fine, because
8128
4887
       RedHat 7.2 includes libpng-1.0.12).
8129
4888
</pre>
8130
 
<p>
8131
 
   Updating RedHat to newer (RawHide) packages for libpng,
 
4889
<p>   Updating RedHat to newer (RawHide) packages for libpng,
8132
4890
   http://www.rpmfind.net//linux/RPM/rawhide/1.0/i386/RedHat/RPMS/libpng-1.2.2-5.i386.html,
8133
4891
   should work. However, there are reports of version conflicts and required
8134
4892
   updates to multiple packages. Proceed with caution (especially if you decide
8136
4894
   Also, do not use --nodeps or --force, as this can leave you with two
8137
4895
   partially installed versions (see item #1, above).
8138
4896
</p>
8139
 
<p>
8140
 
   3. (Slackware) Users have reported this error from an older header file in
 
4897
<p>   3. (Slackware) Users have reported this error from an older header file in
8141
4898
</p>
8142
4899
<pre>
8143
4900
      /usr/include.
8145
4902
   files are in the common library locations. You can do this with buildAll.sh,
8146
4903
   just navigate back down to the libpng-1.2.x directory first.
8147
4904
</pre>
8148
 
<p>
8149
 
   4. If you are building ntop on one machine and running on another, they may
 
4905
<p>   4. If you are building ntop on one machine and running on another, they may
8150
4906
</p>
8151
4907
<pre>
8152
4908
      have different libpng.so versions.  Even if you think you are using the
8154
4910
      "make install" for libpng.
8155
4911
</pre>
8156
4912
<br>
8157
 
<p>
8158
 
<b>Q.</b>&nbsp;
8159
 
 When I run ./configure, it finds png.h but not libpng:
8160
 
</p>
 
4913
<p><b>Q.</b>&nbsp; When I run ./configure, it finds png.h but not libpng:</p>
8161
4914
<pre>
8162
4915
      *******************************************************************
8163
4916
      *
8174
4927
      *
8175
4928
      *******************************************************************
8176
4929
</pre>
8177
 
<p>
8178
 
<b>A.</b>&nbsp;
8179
 
 You're missing libpng.so. Look for it (locate libpng) and tell ntop
8180
 
   where it is via the --with-png-lib= parameter.
 
4930
<p><b>A.</b>&nbsp; You're missing libpng.so. Look for it (locate libpng) and tell ntop   where it is via the --with-png-lib= parameter.
8181
4931
</p>
8182
4932
<br>
8183
 
<p>
8184
 
<b>Q.</b>&nbsp;
8185
 
 I seem to be missing libpng.so - when I do locate libpng, it finds:
8186
 
</p>
 
4933
<p><b>Q.</b>&nbsp; I seem to be missing libpng.so - when I do locate libpng, it finds:</p>
8187
4934
<pre>
8188
4935
      /usr/lib/libpng.so.3
8189
4936
      /usr/lib/libpng.so.3.1.2.2
8192
4939
      /usr/lib/libpng.so.2.1.0.13
8193
4940
   but no libpng.so...
8194
4941
</pre>
8195
 
<p>
8196
 
<b>A.</b>&nbsp;
8197
 
 Yeah. Send RedHat a nasty gram.
8198
 
</p>
 
4942
<p><b>A.</b>&nbsp; Yeah. Send RedHat a nasty gram.</p>
8199
4943
<br>
8200
 
<p>
8201
 
<b>Q.</b>&nbsp;
8202
 
 I don't understand...
8203
 
</p>
8204
 
<p>
8205
 
<b>A.</b>&nbsp;
8206
 
 In a normal libpng install, say from the source, you would have - in
8207
 
   addition to the .so.n.n.n.n files - a symlink named libpng.so, like this:
 
4944
<p><b>Q.</b>&nbsp; I don't understand...</p>
 
4945
<p><b>A.</b>&nbsp; In a normal libpng install, say from the source, you would have - in   addition to the .so.n.n.n.n files - a symlink named libpng.so, like this:
8208
4946
</p>
8209
4947
 
8210
4948
<pre>
8211
4949
      lrwxrwxrwx 1 root  root   19 Apr 23 15:46 libpng.so -> libpng12.so.0.1.2.2
8212
4950
</pre>
8213
 
<p>
8214
 
   But, that link seems to be missing.  Without it, -lpng doesn't properly
 
4951
<p>   But, that link seems to be missing.  Without it, -lpng doesn't properly
8215
4952
   resolve and you get the ./configure error.
8216
4953
</p>
8217
4954
<br>
8218
 
<p>
8219
 
<b>Q.</b>&nbsp;
8220
 
 Why?
8221
 
</p>
8222
 
<p>
8223
 
<b>A.</b>&nbsp;
8224
 
 RedHat ships Linux with both versions of libpng, a 1.0.x and a 1.2.x version.
8225
 
</p>
8226
 
<p>
8227
 
   Do this:
 
4955
<p><b>Q.</b>&nbsp; Why?</p>
 
4956
<p><b>A.</b>&nbsp; RedHat ships Linux with both versions of libpng, a 1.0.x and a 1.2.x version.</p>
 
4957
<p>   Do this:
8228
4958
</p>
8229
4959
 
8230
4960
<pre>
8231
4961
      $ rpm -qa | grep libpng
8232
4962
</pre>
8233
 
<p>
8234
 
   And you'll see the libpng 1.0.x run time:
 
4963
<p>   And you'll see the libpng 1.0.x run time:
8235
4964
</p>
8236
4965
 
8237
4966
<pre>
8239
4968
      libpng-devel-1.2.2-8
8240
4969
      libpng10-1.0.13-6
8241
4970
</pre>
8242
 
<p>
8243
 
   Dig into the files installed by them and you'll not find libpng.so.
 
4971
<p>   Dig into the files installed by them and you'll not find libpng.so.
8244
4972
</p>
8245
 
<p>
8246
 
   Since they're incompatible RedHat doesn't create the libpng.so link.
 
4973
<p>   Since they're incompatible RedHat doesn't create the libpng.so link.
8247
4974
   Instead they patch the makefiles to point the various packages at one or the
8248
4975
   other .so file they install.  This allows them to ship packages that require
8249
4976
   one or the other.
8250
4977
</p>
8251
 
<p>
8252
 
   It works fine unless you try and install something other than via an rpm.
 
4978
<p>   It works fine unless you try and install something other than via an rpm.
8253
4979
   Then you're missing the libpng.so file that normal packages look for...
8254
4980
</p>
8255
 
<p>
8256
 
   Best bet is to create a symbolic link from the libpng.so.xxxx installed 
 
4981
<p>   Best bet is to create a symbolic link from the libpng.so.xxxx installed 
8257
4982
   by the package which matches the -devel (because that's where png.h is 
8258
4983
   found), e.g.:
8259
4984
</p>
8260
 
<p>
8261
 
   ln -s /usr/lib/libpng.so.3.1.2.2 /usr/lib/libpng.so
 
4985
<p>   ln -s /usr/lib/libpng.so.3.1.2.2 /usr/lib/libpng.so
8262
4986
</p>
8263
 
<p>
8264
 
   And remember this in case you update the libpng rpm's in the future.
 
4987
<p>   And remember this in case you update the libpng rpm's in the future.
8265
4988
</p>
8266
4989
<h2>Silly Season</h2>
8267
4990
<br>
8268
 
<p>
8269
 
<b>Q.</b>&nbsp;
8270
 
 Who is Pixel
8271
 
</p>
8272
 
<p>
8273
 
<b>A.</b>&nbsp;
8274
 
 My cat.
8275
 
</p>
 
4991
<p><b>Q.</b>&nbsp; Who is Pixel</p>
 
4992
<p><b>A.</b>&nbsp; My cat.</p>
8276
4993
<h2>HowTo Ask For Help (ntop mailing lists)</h2>
8277
4994
 
8278
4995
<pre>
8295
5012
</pre>
8296
5013
 
8297
5014
<pre>
 
5015
ntop-misc is for other products - nProbe, nBox, PF_RING, etc.
 
5016
</pre>
 
5017
 
 
5018
<pre>
8298
5019
Discussions about the current cvs version belong in ntop-dev.
8299
5020
</pre>
8300
5021
 
8373
5094
 
8374
5095
<pre>
8375
5096
Despite any individual's frequent postings, nobody is "responsible" for
8376
 
answering your question. It's all on a "best efforts" basis. This is equally
8377
 
true of the entries in ntop's Wiki. Our responses may be incomplete, inaccurate,
8378
 
even dead wrong. Caveat Emptor! The only "guarantee" is that free support will 
8379
 
be worth what you've paid for it.  It may be worth MORE, it won't be worth
8380
 
LESS.
 
5097
answering your question. It's all on a "best efforts" basis. Our responses may 
 
5098
be incomplete, inaccurate, even dead wrong. Caveat Emptor! The only "guarantee" 
 
5099
is that free support will be worth what you've paid for it.  It may be worth MORE, 
 
5100
it won't be worth LESS.
8381
5101
</pre>
8382
5102
 
8383
5103
<pre>
8387
5107
<pre>
8388
5108
If nobody answers, then maybe it's because:
8389
5109
</pre>
8390
 
<p>
8391
 
   * Nobody knows.
 
5110
<p>   * Nobody knows.
8392
5111
   * People are busy.
8393
5112
   * You've asked the same question multiple times and it's already been
8394
5113
</p>
8498
5217
</pre>
8499
5218
 
8500
5219
<pre>
8501
 
2.1.3
8502
 
</pre>
8503
 
 
8504
 
<pre>
8505
 
The actual flow of ntop development was 
8506
 
    2.1 -> 2.1.1 -> 2.1.2 -> 2.1.50 -> 2.1.51...
8507
 
</pre>
8508
 
 
8509
 
<pre>
8510
 
Version 2.1.3 was provided by Dennis Schoen [ds@teuto.net] as part of the Debian
8511
 
project.  Dennis (manually) maintains a bitkeeper tree, based on 2.1.2 with
8512
 
various patches which - in HIS opinion - were important enough to be back
8513
 
ported.  Releases in this tree are identified as 2.1.2-n.  Dennis reports you
8514
 
can obtain his current version via:
8515
 
</pre>
8516
 
 
8517
 
<pre>
8518
 
bk clone bk://ntop.teuto.net:ntop-debian ntop-stable
8519
 
</pre>
8520
 
 
8521
 
<pre>
8522
 
Version 2.1.3 is an export from Dennis' tree with the version number changed and
8523
 
is equivalent to 2.1.2-1.  Dennis' graciously provided the extract and we
8524
 
accepted with thanks!
8525
 
</pre>
8526
 
 
8527
 
<pre>
8528
 
2.2
8529
 
</pre>
8530
 
 
8531
 
<pre>
8532
 
The actual flow of ntop development was 2.1 -> 2.1.1 -> 2.1.2 -> 2.1.50
8533
 
                                     -> 2.1.51..59 -> 2.1.90..92 -> 2.2
8534
 
</pre>
8535
 
<p>
8536
 
   after 2.2, came 2.2a/2.2b (Win32 only), then 2.2c.  These were branches,
8537
 
   containing unique 2.2 fixes and back-ports of some critical items.
8538
 
</p>
8539
 
 
8540
 
<pre>
8541
 
3.0
8542
 
</pre>
8543
 
 
8544
 
<pre>
8545
 
The actual flow of ntop development was 2.2.1..4 ->
8546
 
                                    -> 2.2.90..99 -> 3.0pre1 -> 3.0
 
5220
3.1
 
5221
</pre>
 
5222
 
 
5223
<pre>
 
5224
The actual flow of ntop development was 3.0.50.. ->
 
5225
                                    -> 3.0.50.. -> 3.1rc1 -> 3.1
 
5226
</pre>
 
5227
 
 
5228
<pre>
 
5229
3.2
 
5230
</pre>
 
5231
 
 
5232
<pre>
 
5233
The actual flow of ntop development was 3.1.1.. -> etc (I think .4 was the last Win32 version),
 
5234
                                    -> 3.1.50.. -> 3.1.51 -> 3.2rc1 -> 3.2rc2 -> 3.2
8547
5235
</pre>
8548
5236
 
8549
5237
<pre>
8744
5432
(Originally posted on 07Jan2002 to ntop and ntop-dev, updated.  This is version 12April2003)
8745
5433
</pre>
8746
5434
<h2>GDB ultraMini-tutorial - Running ntop under gdb (debugger)</h2>
 
5435
<h2>or, 'capturing the failure point'</h2>
8747
5436
 
8748
5437
<pre>
8749
5438
The very best way to debug a segmentation fault in ntop is to use gdb. The
8772
5461
</pre>
8773
5462
 
8774
5463
<pre>
8775
 
(gdb) list [this shows where in the code it died]
8776
 
</pre>
8777
 
 
8778
 
<pre>
8779
 
(gdb) info stack [this shows the call stack]
8780
 
</pre>
8781
 
 
8782
 
<pre>
8783
 
if there are any variables involved, you can print them:
8784
 
</pre>
8785
 
 
8786
 
<pre>
8787
 
(gdb) print deviceId
8788
 
</pre>
8789
 
 
8790
 
<pre>
8791
 
[gdb can handle pretty complex arguments in the print command, so you can say
8792
 
"print myGlobals.device[0].hash_hostTraffic[myGlobals.broadcastEntryIdx]"
8793
 
if that's what it bombed on.]
8794
 
</pre>
8795
 
 
8796
 
<pre>
8797
5464
"bt full" does a decent job of printing the stack and the back trace and the
8798
 
local variables at each level. Just make sure you are in the thread you are
8799
 
interested in:
 
5465
local variables at each level. 
 
5466
</pre>
 
5467
 
 
5468
<pre>
 
5469
Just make sure you are in the thread you are interested in (i.e. DO THIS FIRST)
8800
5470
</pre>
8801
5471
 
8802
5472
<pre>
8824
5494
</pre>
8825
5495
 
8826
5496
<pre>
 
5497
Now, continue:
 
5498
</pre>
 
5499
 
 
5500
<pre>
 
5501
if there are any seemingly interesting variables involved, you can print them:
 
5502
</pre>
 
5503
 
 
5504
<pre>
 
5505
(gdb) print deviceId
 
5506
</pre>
 
5507
 
 
5508
<pre>
 
5509
[gdb can handle pretty complex arguments in the print command, so you can say
 
5510
"print myGlobals.device[0].hash_hostTraffic[myGlobals.broadcastEntryIdx]"
 
5511
if that's what it bombed on.]
 
5512
</pre>
 
5513
 
 
5514
<pre>
 
5515
Sometimes gdb won't find a variable, that's because C used a register. S'be'it.
 
5516
</pre>
 
5517
 
 
5518
<pre>
 
5519
Other interesting things:
 
5520
</pre>
 
5521
 
 
5522
<pre>
 
5523
(gdb) list [this shows where in the code it died]
 
5524
</pre>
 
5525
 
 
5526
<pre>
 
5527
(gdb) info threads [this shows the status of the multiple threads]
 
5528
</pre>
 
5529
 
 
5530
<pre>
 
5531
(gdb) info stack [this shows the call stack]
 
5532
</pre>
 
5533
 
 
5534
<pre>
 
5535
If you want, you can check each of the threads and THEIR status via:
 
5536
</pre>
 
5537
 
 
5538
<pre>
 
5539
(gdb) thread 1 [or any valid number]
 
5540
(gdb) info stack
 
5541
</pre>
 
5542
 
 
5543
<pre>
8827
5544
gdb has all kinds of included help, and frankly that's all I know...
8828
5545
Here are some extracts and examples:
8829
5546
</pre>
8995
5712
 
8996
5713
<pre>
8997
5714
Original version Luca Deri, 1999-2001
8998
 
Updated Burton M. Strauss III 2002, 2003, 2004
 
5715
Updated Burton M. Strauss III 2002, 2003, 2004, 2005
8999
5716
</pre>
9000
 
<!-- Total Lines........  6121 -->
 
5717
<!-- Total Lines........  5297 -->
9001
5718
 
9002
 
<!-- (skipped) --s......    75 -->
9003
 
<!-- (skipped) ==s......    16 -->
9004
 
<!-- (skipped) header...    50 -->
9005
 
<!-- empty ("").........  1697 -->
9006
 
<!-- empty (//).........     6 -->
9007
 
<!-- Sections...........     0 -->
9008
 
<!-- Q:.................   248 -->
9009
 
<!-- A:.................   256 -->
9010
 
<!-- Normal text........  2044 -->
9011
 
<!-- Preformatted text..  1693 -->
 
5719
<!-- (skipped) --s......    66 -->
 
5720
<!-- (skipped) ==s......    13 -->
 
5721
<!-- (skipped) header...    44 -->
 
5722
<!-- empty ("").........  1481 -->
 
5723
<!-- empty (//).........    11 -->
 
5724
<!-- Sections...........     1 -->
 
5725
<!-- Q:.................   236 -->
 
5726
<!-- A:.................   239 -->
 
5727
<!-- Normal text........  1897 -->
 
5728
<!-- Preformatted text..  1278 -->
9012
5729
<!-- Updated.xxmmmyyyy..     0 -->
9013
5730
<!-- Added.xxmmmyyyy....     0 -->
9014
 
<!-- ...........TOTAL...  6085 -->
 
5731
<!-- ...........TOTAL...  5266 -->
9015
5732
</body>
9016
5733
</html>