home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
tvis1219.zip
/
TVisor-read.txt
< prev
next >
Wrap
Text File
|
2002-12-10
|
8KB
|
216 lines
TVisor (TrafficVisor)
---------------------
1. Introduction
2. Requiriments
3. Installation
4. Setting up
4.1 Config file
4.2 Statistic rules defining file
4.3 Using comment key to stat.php script and TVisorClient
5. Starting
6. Contacts
7. Appreciations
1. Introduction
This program is to trace and count IP-traffic in a LAN and on gateways.
Results are stored in the text-files or can be obtained via TCP/IP connection.
2. Requirements
Program was tested on these OS/2 versions: Merlin, Aurora, and Aurora CP2 with
IBM TCP/IP 4.3. Program requires IPSpy package that can be found at Hobbes
archive (http://hobbes.nmsu.edu). Program is small enough and requires only
50Kb of HDD space, but output files can require much more space.
3. Installation
Installation process includes two phases - IPSpy installation, and unpacking
tvisor-??????.zip file to the desired directory.
1. Create directory to install TVisor (for example, C:\TVisor).
2. Install IPSpy: copy ipspy.dll to the just created directory or to the any
directory listed in the LIBPATH= statement of your CONFIG.SYS file. If you need
promiscuous mode (listening for all packets in the LAN), install ipspy.os2
driver according to the IPSpy instructions.
3. Unpack tvisor-??????.zip archive to the created directory.
4. Setting up
4.1 Config file
By default, all configuration stored in the tvisor.cfg file located in the
tvisor.exe directory.
Any empty lines, or lines begins with "#" characters are ignored.
Keywords and their values are described below:
interface - defines interface on which IP-packets have to be analyzed.
Values: lanN (or pppN) [LMode], where N - interface number, and LMode is the
desired listening mode. LMode is counted as sum of the following standard
modes:
DIRECTED_MODE - 1
BROADCAST_MODE - 2
PROMISCUOUS_MODE - 4
SOURCE_ROUTING_MODE - 8
By default LMode is equal 3 (DIRECTED_MODE + BROADCAST_MODE).
There can be several "interface" keywords.
Sample:
interface lan0 1
interface lan1 3
interface ppp0
rules - defines external file where rules of packets counting are stored
(more details in 4.2).
Default value - rules.lst
Sample: rules TRules.lst
StatFile - defines filename where all analyze output will be stored (in the
other words - statistic's file).
Default value - tvision.stat
Sample: StatFile statistics.out
SaveStatFreq - frequency (in seconds) of saving output to the statistic's file
(see StatFile).
Default value - 86400
Sample: SaveStatFreq 3600
Reset - defines when all obtained statistics have to be cleaned. Format:
YYMMDDHHMM. For example, if you need to clear statistic every 1st day of each
month at midnight, the desired value will be: 010000; to every day at
afternoon - 1200; every year at 21st of April at afternon - 04211200; clear
only once at 2005, 21st of April at afternoon - 0504211200. After clearing
event, when next data portion is arrived, the current stat-file will be renamed
to X.X.0 (X.X - value of StatFile parameter), old X.X.0 will be renamed to
X.X.1, and so on, and will be created new file X.X the arrived data will be
stored into until next clear event.
By default obtained data is never cleared.
Sample: Reset 010000
StatHistoryCount - number of stored stat-files.
Port - TCP-port on which program listens for an user's requests to show up
requested information.
By default this mode is disabled.
Sample: Port 5460
4.2 File of rules to count
When next IP packet is arrived, the rules are looked over in their order in
file they stored. If suitable rule is found the whole stats for this rule is
increased for an packet's size. Next, if that rule has "calc" type, the next
suitable rule will be looked over; or, if that rule has "deny" type, look
process is stopped.
Alls empty lines, and lines beginning from "#" symbol (comments) are ignored.
Each rule begins from string "rule deny" or "rule calc", and ends by string
"end rule". Between these lines the condituions and comments can be placed:
comment - optional but very useful key just for comment the rule.
interface - interface for this rule; if this keyword is omited the rule will
be applyed for packets from all interfaces. There can be several "interface"
keywords in the rule's file. You can point out only those interfaces that are
defined in the config file.
Sample: interface lan2
srcaddr - IP-address of sender
srcmask - mask of sender
dstaddr - IP-address of receiver
dstmask - mask of receiver
Address combened with netmask defines the address or group of addresses, for
instance:
192.168.123.3 mask 255.255.255.255 - points to the address 192.168.123.3;
192.168.123.0 mask 255.255.255.0 - points to the addresses 192.168.123.0-192.168.123.255;
0.0.0.0 mask 0.0.0.0 - points to the any address;
ICMP - list ICMP-services of sender/receiver
UDP - list of UDP-ports of sender/receiver
TCP - list of TCP-ports of sender/receiver
Ports are defined in a form of "Source List:Target List". Lists can contain
one or more value or range, delimited by comma, or "*" meaning range 0-65535.
Examples:
TCP 0-8079,8081-65535:* - source - all ports excluding 8080,
target - any port
UDP *:* - packets from any port to any port
TCP *:80 - from any port to port 80.
To simplify defining of close rules you can use directive "include" in a form of:
include "file name" v0 v1 ... v9
This directive performs including the file "file name" into main file with
substituting of all %0 ... %9 to the values of v0 .. v9.
If failname of value vN contains spaces it has to be bordered by double
quotation marks ". Included file "file name" can also contain another "include"
directives.
4.3 Using "comment" directive for a stat.php script and TVisorClient
There is a script stat.php in an archive tvisor-??????.zip. This script allows
creating of readable HTML-page from statistics files. There is also a GUI
application TVisorClient to display statistics obtained via TCPIP connection
from server. The stat.php as well as TVisorClient displays information using
"comment" directives from rule's file. This value has a form of:
comment group:send/receive:user
where,
group - logical group of rules, for example local_users or dialup_users;
send/receive - direction (send or receive);
user - end name, for example, username or computer name.
While parsing these comments the rules are seen by pair. For example, if there
is a rule with comment "Our users:send:John Black" and a rule with comment
"Our users:receive:John Black" there will be only one line while output for
the user "John Black" from group "Our users" with data of sent and recieved
packets.
5. Starting
Executable tvisor.exe can be started with the following optional command line
parameters:
-C - before starting the current stat file is read up and used to "resume"
after program restarting.
-D - debug mode. Info of all packets is displayed on screen: addresses and ports
of sender and receiver, packet size, action:
calc - rule is found for this packet
not calc - rule is not found for this packet
skip - packet is already counted and going through another interface
Don't use this mode on a gateway with huge traffic.
-S - send a signal to the running tvisor:
stop - stop the program
getstat - obtain statistics and put it in file immediately
reset - reset all values
-? - help of command line parameters
6. Contacts
My e-mail: vav@sahen.elektra.ru
Also, I can be found in eCSNet IRC-network (irc.ecomstation.ru) on #common and
#ecs channels (nick - Digi)
Latest versions: ftp://vdn.sahen.elektra.ru/pub/dev/
7. Appreciations:
Edgar Buerkle - for his IPSpy package
Timur Kazimirov - for the help.
Andrey Vasilkin aka Digi