You are on page 1of 68

PERFORMANCE EVALUATION OF RMI

Submitted in partial fulfillment of the requirements


for the award of

BACHELOR OF TECHNOLOGY IN INFORMATION


TECHNOLOGY

by

sivakumar.s
24sit180

DEPARTMENT OF
INFORMATION TECHNOLOGY
SATHYABAMA UNIVERSITY
(Established under Section 3 of UGC Act 1956)
JEPPIAAR NAGAR, OLD MAMALLAPURAM ROAD
CHENNAI - 600119

APRIL 2007

1
SATHYABAMA UNIVERISTY
(Established under section 3 of UGC Act, 1956)
Accredited with B++ Grade by NAAC
JEPPIAAR NAGAR, CHENNAI - 119

DEPARTMENT OF INFORMATION TECHNOLOGY

BONAFIDE CERTIFICATE

This is the certify that this Project Report is the bonafide work of
Mr. SIVAKUMAR.S Reg. No.2412203 who carried out the project
entitled
“ACTIVE NETWORK SYSTEM” under our supervision from
December 2006 to March, 2007.

Internal Guide Head of the Department

Mis VIMALI J.S(M.TECH)

Submitted for Viva voce Examination held on


____________________________

Internal Examiner External Examiner

DECLARATION FORMAT

2
I Mr. SIVAKUMAR.S Reg. No.2412203 hereby declare that the Project

Report entitled “PERFORMANCE EVALUATION OF RMI done by me under

the guidance of Dr./ Prof.Mrs VIMALI J.S is submitted in partial fulfillment of

the requirements for the award of degree in INFORMATION TECHNOLOGY.

DATE :

PLACE :

SIGNATURE OF THE CANDIDATE

ACKNOWLEDGEMENT

3
The satisfaction and elation that accompany the successful completion
of any task would be incomplete without the mention of the people who have
made it a possibility. It is my great privilege to express my gratitude and
respect to all those who have guided me and inspired me during the course of
the project work.

First and foremost, I express my sincere gratitude to our beloved


Chancellor Thiru. Jeppiaar, M.A., B.L., and also my heartfelt thanks to our
Directors Thiru. Marie Johnson, B.E., M.B.A and Mrs. Mariazeena
Johnson, B.E., M.B.A for providing me the necessary facilities for the
completion of my project. I also acknowledge our Vice-Chancellor Dr.
V.S.R.K. Mouli, B.E., M.Sc. (Engg.) Ph.D., for his constant support and
endorsement.

I am indebted to the Head of the Department Mrs.T.Sasiprabha ME


Ph.D, for having been a constant source of support and encouragement for
the completion of the project. I also express my sincere thanks to my internal
guide Mrsvimali j.s for his constant guidance and supervision during the
period of my project work.

CONTENTS

4
CHAPTER NO TITLES PAGE NO
ABSTRACT ii
LIST OF TABLES vi
LIST OF FIGURES

1. INTRODUCTION 10
1.1 problems
1.2 software tools
1.2.1 FEATUREA OF JAVA
1.2.2 FEATURES OF JSP
PROBLEM ENHANCEMENT 12
2.1 lan monitoring
2.2 applicatoin monitoring
METHODOLOGY 13
3.1 class
3.2 java.net PACKAGES
3.3 java.i/o packages
3.4 javax.swing PACKAGES
3.4.1 swingclass
PROBLEMS DISCRIPTIONS 22
4.1 networking
4.1.1 local area network
4.2 host and networks
4.2.1 ip addressing and classes
4.2.2 protocols
4.2.3 client and server
4.3 tcp(transmission control protocol)
4.3.1 tcp packet structure
4.4 internet protocol
4.4.1 ip packet structure
7. 2. SOFTWARE DEVELOPMENT AND
REQUREMENTS 27

5
5.1 hardware requirements
5.2 software requirements

3. SYSTEM ANALYSIS & DESIGN 28


6.1 system flow diagram
6.1.1 lan monitoring
6.1.2 application monitoring
6.2 feasibility study
6.3 data collection
6.4 database design
6.5 source code
6.5.1 sample code in lan monitoring
6.5.2 sample code in application monitoring
4. IMPLEMENTATION
7.1 module description
7.1.1 lan monitoring
7.1.2 application monitoring

5 TESTING
8.1 types of boxes
8.2 screen shots
6 SUMMARY & CONCLUSION 67
9.1 conclusion
9.2 future enhancement
9.3 bibliography
9.2.1 books
9.2.2 web sites

6
ACTIVE NETWORK SYSTEM

ABSTRACT

Active Network system is a system for the day-to-day monitoring of clients


and server in the network. Active Network system allows Systems
Administrators to gather information from all the clients in the network without
installing server-side applications on these computers. Active Network system
provides the powerful technology of storing and comparing received data.
Administrators can make "snapshots" of the systems for future comparison
and notation of changes.

Active Network System (ANS) has flexible module based architecture. Two
main modules are LAN monitoring and Application monitoring. Each module
(plug-in) performs a task and displays retrieved information in its own window.
Active Network System ships with predefined monitoring server information.
LAN Monitoring determines host name, host address of systems, routing
table, protocol statistics etc. Application Monitoring show the total number of
mail sent for a
Particular day are a particular session, the clients login time & logout time.
Active Network System is an Online Control System by using this we can
identify the domain of the client system.

LIST OF TABLES

7
S.NO TABLE NAME PAGE NO.
1 Server details 21
2 Number of Users 21
3 New user 21
4 Messaging Details 22
5 Login 22
6 Session Details 22
7 Login time
8 Logout Time

LIST OF FIGURES

8
FIGURE NO FIGURE NAME PAGE
NO.

1. LAN Monitoring Workflow 17


2. Application Module Workflow 18
3. Home Page 39
4. File Menu 39
5. Search thru host 40
6. Obtaining IP address 40
7. Searching several host 41
8. Range of IP Address 41
9. Result seen in View Menu 42
10. View Menu 42
11. Consolidated Output 43
12. Net shower menu 43
13. Mac table doc 44
14. Net shower 44
15. Protocol statistics 45
16. Name table 46
17. Viewer 46
18. Messenger 47
19. Utility-Calculator 47
20. Application Module-Home page 48
21. Admin details 48
22. User details 49
23. User details for any particular date 50
24. Server configuration details 51
25. Mailing Details 52

1. INTRODUCTION

9
monitoring is the main aspect of Network with out monitoring, Network
never succeeds. Active Network system is a system for monitoring the clients
and server in the network. It should allow System Administrators to gather
information from all the clients in the network without installing server-side
applications on the computers.

1.1 Problem
This project ANS is a administrator assistant. Network monitoring is
handled in two modules namely LAN Monitoring and Application Monitoring.
LAN monitoring determines the host name, host address and type of address
assigned in LAN, the routing table, protocol statistics and h/w addresses in
LAN .In application monitoring it monitors application’s usage, session
maintenance and broadcasting.
6t7t7868dfhgfhgjhgjj
1.2 Software Tools
Operating System : Windows XP
Language : Java1.5, JSP2.0
Database : MS- Access

1.2.1 FEATURES OF JAVA


The Software tool used to implement this project is an outstanding
Language “JAVA”
Java is familiar and simple
Java programs simply import the s/w packages they need. These
packages may be in another directory or another drive. The java compiler and
interpreter figure out what objects are referenced and supply the necessary
linkage.

Java is object oriented


Java deals with classes and objects, pure and simple.

10
Java is safer and more reliable
Java won’t automatically convert data types. You have to explicitly
convert from one class to another. Complex printer arithmetic is avoided.
Java is secure
The java runtime system is designed to enforce a security policy that
prevents execution of malicious code. It does this by remembering how
objects are secure access to those objects according to its security rules. It
performs byte code. Verification by passing compiled classes through a
simple theorem proves that either proves that the code is secure or prevents
the code from being loaded and executed. The class is java’s basic execution
unit and security is implemented at the class level.
Java is interpreted and portable

FEATURES OF JSP

Java Server Pages (JSP) is a technology that lets you mix regular,
static HTML with dynamically generated HTML
JSP technology has facilitated the segregation of work profile of a Web
designer and a Web developer
A JSP page after compilation generates a servlet and incorporates all
servlet functionalities
Servlet and JSP thus share common features such as platform
independence, creation of database driven web Application and server side
programming capabilities.

2. PROBLEM STATEMENT

The main modules of this project Active Network System (ANS) are
• LAN monitoring

11
• Application Monitoring
2.1 LAN Monitoring
This module is designed as GUI Mode Application. So that it is very
easy to handle by end users.
This main objective of the project is used to avoid Data Collision / IP
Confliction between a System and another system of same or different block
when each blocks interconnected.
It is used to determine Host Names, Host Addresses of systems of in
this LAN and systems of different block when each block is interconnected. It
determines routing table of the server host, network protocol statistics in the
LAN and H/W address of each host in the LAN.
Also determines which type of IP Address assigned to a system or
group of systems of this LAN or different LAN when each block is
interconnected after the connection was established.
It involves establishing connection to the remote Host(s) given by the
user. It is possible to send messages between systems in LAN.
Additional features like Calculator and browser is included in this
project to improve the user interface.

2.2 Application Monitoring


In this module an application like Website is going to monitor.
The Application module helps the administrator to measure how many users
is using the application for the specified day or specified period of time. This
information will not be made visible to the end users of the application. This
project assists the administrator for the future enhancement of the application.

3. METHODOLOGY

In this project the important concepts in JAVA are described below

12
3.1 Class
Classes encapsulate the objects. A single class can be used instantiate
multiple objects. This means that you can have many active objects or
instance of a class.
Class<classname>
{
Variable declarations;
}
<classname> <object name>;

Action Listener
The action Listener is a key word for the concept of Event handling.
The event class is central to the JAVA window event generation and handling
mechanism. Event objects are generated by the user who interacts with a
JAVA window program or applet and by the JAVA runtime system. User
generated events occur when user make selection on a menu or press a key
Events generated by the runtime system include errors and Exceptions. They
are handled by the set of predefined event-handling methods that are defined
by the component class and its subclass.
Class<class name> implements Action Listener
{
St1;
St2;
}
Public void action performed (Action Event ae)
{
-----
-----
-----
}

Exceptions
JAVA handles potentially recoverable errors through exceptions a
special object class that handles virtually all errors in JAVA. Exception

13
handling code resides in the java. Lang package and is automatically included
in all compiled code. JAVA uses the try catch and throws keywords to do
actual exception handling. They are conceptually similar to switch statement.
Throw
The first concept in exception handling is throwing an exception. If the
error during reading the file ie says a method could not read the file because
the file did not exit, this would generate an IOException in JAVA terminology. It
is said that the method threw an IOException.
Catch
An exception catch is code that realizes the exception has occurred
and deals with it

3.2 Java.net PACKAGES


GetName
Set the name of this network interface

Syntax
Public string getName( )
String S = Ia.getName( )
System.out.println(S);
getInetAddresses
Convenience method to return an enumeration will all or a sub set of
the InetAddresses bound to the network interface.

Syntax
InetAddress<array obj> = InetAddress.getInetAddress( )

getDisplayName
Get the display name of this network interface. A display name is a
human readable string describing the network device.

14
Syntax
Ia.getDisplayName( );
Where, Ia is object of the InetAddres class.

getByName
Searches for the network interface with the specified name.
syntax
Ia.getByName(<IPAddress>) / < Host Name> )
Where, ia is an object of the class InetAddress.

getByInetAddress
Convenience method to search for a network interface that has the
specified internet protocol (IP) address bound to it. If the specified (IP address
is bound to multiple network interfaces it is not defined which network
interface is returned.

Syntax
NetworkInterface getByInetAddress(Inet Address ia)

getNetworkInterfaces
Returns all the interfaces on this machine. Returns null if no network
interfaces could be found on this machine. If returns an enumeration of
network interfaces found on this machine.

getAllByName
This method returns all IP address of this machine or remote machine
it associates with InetAddress object.

Syntax
InetAddress ia.getAll By Name(charles);
getHostName
Returns a HostName of the given IP address is associates with
InetAddress object.
Ia.getHostName( )

15
getHostAddress
It returns IP address of the given HostName. It gets with the object of
InetAddress class
3.3 JAVA I/O PACKAGE
The java .io. Package contains various types of classes and its
respective packages. These packages used to read data from memory
devices such as floppy disk, Hard disk, CD Rom, Flash memory and also from
primary memory. Also write Data to memory devices such as FDD, HDD,
CDROM, etc.
Type of I/O streams:
There are various types of streams found in java.io.* package. They
are

1. ByteArrayInputStream:
Allows a buffer in memory to be used as an input stream
Methods:
available ( ), mark ( ), mark supported ( ), read ( ), insert ( ) & skip( )
2. FileInputStream:
For reading information from a file
Methods:
available ( ), close( ), finalize( ), read( ), skip( ).
3. FilterInputStream:
Abstract class providing an interface for useful functionality to the other
input stream classes.
Methods:
available ( ), close( ), mark( ), mark supported( ), skip( ), read( ),
reset( ).
4. ByteArrayOutputStream:
Creates a buffer in memory. All the data we send to stream is placed in
this buffer.
Methods:
reset(), size( ), toBytearray( ), tostring( ), write( ), writeto( ).
5. FileOutputStream:
For sending information to a file

16
Methods:
Close( ), finalize( ), write( ).
6. FilterOutputStream:
Abstract class providing an interface for useful functionality to the other
o/p stream classes.
Method:
Close( ), finalize( ), write( ).
7. FileReader:
The file reader class enables reading character files. It uses default
character encoding.
Constructor:
Public file reader (File f)
8. CharArrayReader:
The char array reader allows the usage of a character array as an input
stream. This class is similar to Byte Array Input stream.
Constructor:
Public char Array Reader (char ch []);
9. StringReader:
The string Reader class reads characters from a string.
Constructor:
Public string Reader (String s);
10. FileWriter:
The file writer allows writing character files. It uses the default encoding
character and buffer size. This class is similar to that of file output stream
class.
Constructor:
Public file writer (File f)
11. CharArrayWriter:
This class allows to use a character buffer as an o/p stream.
Constructor:
Public char Array writer( ).
12. BufferedWriter:
The buffered writer class buffers data to the character output stream.
Constructor:

17
Public buffered writer (writer w)
3.4 javax.swing PACKAGES
Swing Classes
Swing classes can be used to produce pure 100% java windowing
toolkit. Some swing classes and its descriptions are as follows.
1. JFrame
This class represents the swing frame that is more sophisticated than
the AWT frame. You can add components in layers, add a Manu bar, or paint
over the component.
Constructor
JFrame <object> = new J frame (<title>);
Ex.
JFrame Jfm = new J frame (“Remote Host Monitory System”);
2. Container
The container class have few layout managers by using any one of
these layout managers, a program can control the arrangement and sizes of
components to preserve the appearance of a user interface.
They are as follows:
 Flow layout
 Grid layout
 Border layout
 Grid Bag layout
 Box layout
 Overlay layout
 Scroll pane layout
 View port layout

Constructor
Container <obj> = <frame object> . get content pane ();
Ex
JFrame jfm = JFrame(“monitoring”);
Container cnr = jfm.getContentPane ();
Cnr.setlayout(null);

18
3. JMenuBar
A menu bar is a narrow rectangular component that is positioned at the
top edge of an applet or a frame. The menu bar contains the labels of drop
down menus that will be attached to if.

Constructor
JMenuBar <obj> = new JMenuBar();
Ex
JMenuBar jmb = new JMenuBar();
4. JMenu
Once a menu bar has been created you can add menus to it by using
the following constructors
Public JMenu ()
Public JMenu(String title)
Public JMenu(String label, Boolean turn_ off)

The Boolean parameter is meant to declare whether the menu is turn _


off or not. The turn _ off menus are menus with there own look and feel.
Ex JMenu jm = new JMenu(“file”);
JMenu jm = new JMenu(“file”, true);
5. JMenuItem
The swing menu item can be a created with simple text, an icon, or
both you can also specify the mnemonic key, Typically you create a menu
item and then add if to a menu.
The following is the list of constructors supported to create menu item
objects.
Public JMenuItem()
Public JMenuItem(Icon icn)
Public JMenuItem(String text)
Public JMenuItem(String text, Icon icn)
Public JMenuItem(String text, int mnemonic);
Ex
JMenuBar jmb = new JMenuBar()
JMenu JM = new JMenu(“File”)

19
JMenuItem jmi = new JMenuItem(“search”);
Cnr.add(jmb)
Jmb.add(jm)

6.JButton
The class represents swing buttons. These buttons can poses an icon
as well as text with suitable (absolute as well as relative) positioning.

Constructor
JButton <obj> = new JButton(<caption>)
Ex
JButton jbn = new JButton(“Ok”)

7. JLabel
This class represents swing labels that can display a place of text as
well as icons with suitable positioning. A label object can be created by using
the following statement:

Constructor
JLabel<obj> = new JLabel(text)
Ex. JLabel Jlb = new JLabel(“Enter your name”);
8. JComboBox
A swing combo box is an enhancement over the AWT component
called choice. The combo box is a pull down list with a capability to display the
selected item in a display area. You can also enter an item in the display area
to edit it info the list.

Constructor
JComboBox <obj> = new JComboBox( )
Ex. JComboBox jcb = new JComboBox( )

9. JTextField
The swing text field can be used to display or edit a single line of plain
text. The swing text field is a light weight component. A text field object is

20
created by using the class JText field, which is a direct subclass of JText
component.

Constructors
public JTextField( )
public JTextField(String text)
public JTextField(String text, int width)
public JTextField(Document model, string text, int width);
Ex.
JText Field JTF = new JText Field(“Welcomes you”);

4. PROBLEM DESCRIPTION

21
4.1 NETWORKING
Networking is the means by which computers share and exchange
information and resources across either short distances Local Area Network
(LAN) or globally wide Area Networks (WAN). Making the best use of
networking technology is about making better use of business resources,
enhancing productivity and efficiency, reducing costs and gaining competitive
advantage.
Networking enables everyone in an organization to communicate with
and share resources with everyone else-giving them access to data held in
individual PCs by remote office sites or external suppliers and giving users the
ability to share printers, fax, CD-ROM and Modem Technology, etc. networks
can be designed for organizations of all sizes from the small office with
between two and ten workstations to the largest international corporations
linking thousands of workstations.
4.1.1 Local Area Network (LAN)
A LAN is a group of desktop computers located relatively close to one
another and connected through cabling system to enable them to share
access to computing resources. LAN satisfies two fundamental requirements
(a) sharing information, and (b) sharing computer resources.
A LAN typically consists of PCs on the same floor in the same
buildings. It may even consist of computers which are with in the factory area,
but spread across various buildings like administrative block or production
block or warehouse, etc.
LANs consist of workstations which are connected to a central
computer called file server (special purpose computers). [Workstations are the
nodal computers on which users do their work-like executing their own
applications programs locally and sending request to the file server for any of
the network function and receiving the response from the file server. All
workstations on LAN would have a Network interface.
LAN’s topology is of 3 types (a) star, (b) Ring, and (c) Bus. LAN can be
connected to larger networks including mainframe computers. This gives the
user of LAN access to enormous computing power and excellent
communication facilities. The distinctive feature of LAN is its inherent
capability for distributed processing.

22
LANs use File servers to control and manage the network resources
which are shared by the Network users. These file servers are used to
perform (a) control of the traffic of requests and messages on the network, (b)
security requirements, (c) centralized Hard disk storage, and (d) control of
peripherals like printers, etc.
4.2 HOST AND NETWORKS
IP addressing is based on the concept of Host and networks. A host is
essentially anything on the network that is capable of receiving and
transmitting IP packets on the network servers and client workstations are IP
hosts.
The hosts are connected together by one or more networks the IP
address of any host consists of its network address plus its own host address
on the networks.
4.2.1 IP addressing and classes

An IP address is 32 bits wide, and as discussed, it is composed of two


parts the network number, and the host number. By convention, it is
expressed as four decimal numbers separated by periods. Such as
“172.100.101.134” representing the decimal value of each of the four bytes.
Valid addresses thus range from 0.0.0.0 to 255.255.255. a total of
about 4.3 billion addresses.
Any address starting with 127 is a loop back address and should never
be used for addressing outside the host. A host number of all binary is
indicates a directed broadcast over the specific network.
A network is a set of computers and peripherals which are physically
connected together. Networking enables sharing of resources and
communication. Networking in Java is possible through the use of java.net
package. The classes within the package encapsulate the socket model
developed by Bex Koley software division.
4.2.2 Protocols

Communication between computers in a network or a different network


requires certain set of rules which is called protocols java networking is done

23
using TCP/IP protocol. Some of the different kinds of protocols available are
HTTP, FTP, SMTP, SNMP, NNTP, etc.
4.2.3 Client and Server

A computer, which requests for some service from another computer, is


called a client. The one that processes the request is called as server. A
server waits till one of its clients makes a request. It can accept multiple
connections at a time to the same port number.
4.3 TCP (Transmission Control Protocol)

The most common higher level protocol in the suite is TCP. It provides
a reliable, connection-oriented packet delivery service on top of IP.
TCP guarantees the delivery of packet, ensure proper sequences of
the data, and provide a check sum secure that validates both the packet
heads and its data for accuracy.
This reliable makes TCP protocol of choice for session based data
transmission, client-server application and critical services, such as electronic
mail. Because TCP headers required additional bits to provide proper
sequencing of information, as well as a check sum to ensure reliability of both
the TCP packet header & the packet, TCP is slower than UDP

To guarantee successful data delivery, the protocol also required that


the recipient acknowledge successful receipt of data.

4.3.1 TCP PACKET STRUCTURE:

24
S.No Field Explanation
01. Source port TCP port of sending host
02. Destination port TCP port of destination host
03. Sequence number Ensures all bytes have been received
04. Ack number The sequence number of the next byte
05. Data length Length of the TCP segment
06. Reserved Reserved
07. Flags What content is in the segment
08. Windows How much space is in the TCP windows
09. Check sum Ensures validity of the header
10. Urgent pointer If urgent data is being sent, this specifies
the end of that data in the segment.

4.4 IP (Internet Protocol)

IP provides packet delivery for all higher level protocol within the suite.
It provides best efforts delivery of as unreliable and connection less nature.
Delivery is not guaranteed and a packet might be last, delivery out of
sequence duplicated or delayed.

25
4.4.1 IP PACKET STRUCTURE

1. Source IP address - Identifies the sender of the datagram


by IP address
2. Destination IP address - Identifies the destination of the
datagram by IP address.
3. Protocol - Indicates whether the data should
be passed to UDP or TCP at
the destination host.
4. Checksum - A field used to verify the packets
integrity upon arrived at the
destination.
5. Time to Live - The number of seconds a datagram is
allowed to stay on the network before
being discarded, otherwise packets could
endlessly loop around an internet.
A router will decrease the TTL by at
Least 1 second when if handles the
Packet, and is required to decrement the
TTL by at least the time spent in the router.

5. SOFTWARE AND HARDWARE REQUIREMENTS

5.1 Hardware requirements

• Pentium II 266 Mhz

• 64 MB RAM

26
• Hard Disk Drive 6GB

5.2 Software requirements

• Microsoft Windows XP

• Winsock 2.0

• SMTP

• Apache Tomcat Server 5.0

6. SYSTEM ANALYSIS &DESIGN

27
6.1 SYSTEM FLOW DIAGRAM

6.1.1 LAN MONITORING


This module is used to determine Host Names,
Host Addresses of systems of in this LAN and systems of different block when
each block is interconnected. It determines routing table of the server host,
network protocol statistics in the LAN and H/W address of each host in the
LAN.

28
Fig6.1.LAN Monitoring work flow

6.1.2 APPLICATION MONITORING

29
in this module an application
like Website is going to monitor.
The Application module helps
the administrator to measure how
many users is using the application
for the specified day or specified period
of time.

30
LOGIN NEW USER

USER VALIDITY EXISTING USER

ADMIN USER

ADMIN USER SERVER MAIL


DETAIL DETAILS DETAILS DETAILS

TOTAL CLIENT NO OF
USERS AND MAILS
SERVER SEND
DETAILS

MAILING COMPOSE AND SESSION


PAGE SEND MAIL MAINTANANCE

LOGOUT

APPLICATION MONITORING MODULE.

31

If ctr > 15 min


6.2FEASIBILITY STUDTY
The feasibility study is examining all issues related to this proposal,
including privacy, reporting burden, technical capabilities, and the coordination
of reporting for public institutions, timing/census dates, and implementation
The three primary areas of feasibility study are:
• Economic feasibility
• Technical feasibility
• Legal feasibility

The Economic study is based on the cost-benefit analysis, potential


market growth, cost of resources needed for development etc., as this project
is dealt with cost benefit analysis, so that the cost does not overweigh the
benefits
The Technical study is of product engineering process, where
functions, performance and constraints are the major heads.
All the legal formalities such as contracts, which include liability,
infringement, legal approval and justifications, are been made for the
proposed system.
• This project is feasible with current technology since all the software
used are available in our environment
• This project is economically feasible since software can de
downloaded from internet at free of cost
• This project is technically feasible since it continuously monitors the no.
of clients we can increase the instance number whenever needed

32
6.3 DATA COLLECTION
Data was collected only for application module. MS Access was used
as the back end.

The essential data can be classified into three categories.

• Server details
• User details
• Messaging details

In server details static information like server version number and compatible
versions are stored. This information is essential for any new administrator for
accompanying the applications.

In User Details information like number of clients visited the application for
any particular date from the date of installing the application is maintained.
For any particular session login and logout time is maintained. This
information is utilized in instance control.
Details regarding existing users their authorized status and their password are
maintained. This criteria is for abstraction.
Facility for new user registration is also provided, so information regarding
new user is also maintained.

In Messaging Details, Details include the client who have messaged to the
admin, their message, message size, date of messaging are stored.

33
6.4 DATABASE DESIGN
• Table Name : Server Details
Table Description : This stores static server details

FIELDS DATATYPE
Servlet/JSP specification Text(15)
Version Text(15)
• Table Name : Number of users
Table Description : This is to find the number of users visited
the Application in a particular date.

FIELDS DATATYPE
S.No Auto Number
Date Text(15)
No.of .User Number
• Table Name : New user
Table Description : This stores registration information

FIELDS DATATYPE
Row id Auto Number
FName Text(20)
LName Text(20)
Pwd Text(6)
Age Number
Gender Text(6)
Address Text(50)
Phone Number
Mail-id Text(20)
• Table Name : Messaging Details
Table Description : This table contains data about the clients
Who messaged for the application admin
FIELDS DATATYPE
Row-id Number
To addr Text(15)
From Text(15)
addr
Subject Text(10)
Msg Text(100)

34
Msg Size Number
Date Text(10)

• Table Name : Login


Table Description : This table is for Login validation
FIELDS DATATYPE
Uname Text(30)
Pword Text(6)
Status Text(2)

• Table Name : Session Details


Table Description : This table is for session maintenance
FIELDS DATATYPE
Uname Text(30)
Host Text(10)
Login Text(10)
Logout Text(10)
Date Text(10)

6.5 Source Code


6.5.1 Sample code for LAN Monitoring

import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.net.*;
import java.io.*;
import java.net.InetAddress.*;
public class NetView extends JFrame
{
JButton jbn;
Icon icn;
NetView()

35
{
JMenuBar jmb=new JMenuBar();
Container cnr=this.getContentPane();
cnr.setLayout(null);

JMenu file=new JMenu("File");


JMenu view=new JMenu("View");
JMenu mesg=new JMenu("Net Shower");
JMenu appl=new JMenu("Utility");
JMenu help=new JMenu("Help");
JMenu ByIp=new JMenu("IP Local LAN");
JMenu Ipot1=new JMenu("IP Selective");
JMenu find=new JMenu("Search");
JMenuItem Ipot2=new JMenuItem("IP of All");
JMenuItem eXit=new JMenuItem("Exit");
JMenuItem ByHo=new JMenuItem("By Host Name");
JMenuItem Repo1=new JMenuItem("Consolidate");
JMenuItem Repo2=new JMenuItem("Passed");
JMenuItem Repo3=new JMenuItem("Failed");
JMenuItem Calc=new JMenuItem("Calculator");
JMenuItem noTe=new JMenuItem("Browser");
JMenuItem mesg1=new JMenuItem("Sessioner");
JMenuItem mesg2=new JMenuItem("Viewer");
JMenuItem mesg3=new JMenuItem("Message");
JMenuItem mesg4=new JMenuItem("MAC_Addr");
JMenuItem mesg5=new JMenuItem("Proto_Statis");
JMenuItem mesg6=new JMenuItem("Name_Tbl");
JMenuItem Read=new JMenuItem("Read Me");
JMenuItem Myho=new JMenuItem("My Host");
JMenuItem Sthi=new JMenuItem("Single Host");
JMenuItem Soth=new JMenuItem("A Host");
JMenuItem Mthi=new JMenuItem("Several Host");
JMenuItem Moth=new JMenuItem("All Hosts");
file.setMnemonic('F');

36
find.setMnemonic('S');
view.setMnemonic('V');
appl.setMnemonic('U');
help.setMnemonic('H');
mesg.setMnemonic('M');
eXit.setMnemonic('X');
Repo1.setMnemonic('C');
Repo2.setMnemonic('P');
Repo3.setMnemonic('F');
Calc.setMnemonic('C');
noTe.setMnemonic('B');
Read.setMnemonic('R');
mesg1.setMnemonic('S');
mesg2.setMnemonic('V');
mesg3.setMnemonic('M');

find.add(Myho);
find.add(ByHo);
find.add(ByIp);
find.add(Ipot1);
find.add(Ipot2);
file.add(find);
file.add(eXit);

view.add(Repo1);
view.add(Repo2);
view.add(Repo3);
mesg.add(mesg4);
mesg.add(mesg5);
mesg.add(mesg6);
mesg.add(mesg1);
mesg.add(mesg2);
mesg.add(mesg3);
appl.add(Calc);

37
appl.add(noTe);
help.add(Read);
ByIp.add(Sthi);
ByIp.add(Mthi);
Ipot1.add(Soth);
Ipot1.add(Moth);

icn=new ImageIcon("d:/lanmonitor/natpark.jpg");
jbn=new JButton("",icn);
jbn.setLocation(300,150);
jbn.setSize(240,240);

jmb.add(file);
jmb.add(view);
jmb.add(appl);
jmb.add(mesg);
jmb.add(help);
cnr.add(jbn);
Ipot2.addActionListener(new Action());
eXit.addActionListener(new Action());
ByHo.addActionListener(new Action());
Sthi.addActionListener(new Action());
Soth.addActionListener(new Action());
Mthi.addActionListener(new Action());
Moth.addActionListener(new Action());
Myho.addActionListener(new Action());
Repo1.addActionListener(new Action());
Repo2.addActionListener(new Action());
Repo3.addActionListener(new Action());
mesg1.addActionListener(new Action());
mesg2.addActionListener(new Action());
mesg3.addActionListener(new Action());
mesg4.addActionListener(new Action());
mesg5.addActionListener(new Action());

38
mesg6.addActionListener(new Action());

Calc.addActionListener(new Action());
noTe.addActionListener(new Action());
Read.addActionListener(new Action());

setTitle(" Active Network System - Network Monitoring :


Done by : J.Geetha,S.Indhumathi,M.Lakshmibala");
setSize(800,600);
setJMenuBar(jmb);
show();
}
public static void main(String arg[]) throws Exception
{
NetView n=new NetView();
}
}

class Action implements ActionListener


{
String s,s1;
public void actionPerformed(ActionEvent e)
{
s=e.getActionCommand();
if(s=="Exit")
{
System.exit(0);
}
if(s=="Browser")
{
Runtime rt=Runtime.getRuntime();
try
{
rt.exec("c:/Program files/Internet Explorer/iexplore");

39
}
catch(Exception e1)
{
String act="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(act);
}
}
if(s=="Calculator")
{ Runtime rt=Runtime.getRuntime();
try
{
rt.exec("u:/Calf.class");
}
catch(Exception e1)
{
String act="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(act);
}
}
if(s=="Consolidate")
{
Runtime rt=Runtime.getRuntime();
Process p=null;
try
{
p=rt.exec("Wordpad d:\\ Consol.class");
p.waitFor();
}
catch(Exception e1)
{
String s1="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();

40
msg.ErrorMesgWin(s1);
}
p.exitValue();
}

if(s=="Passed")
{
Runtime rt=Runtime.getRuntime();
Process p=null;
try
{
p=rt.exec("wordpad d:\\ Passed.class");
p.waitFor();
}
catch(Exception e1)
{
String s1="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(s1);
}
p.exitValue();
}

if(s=="Failed")
{ Runtime rt=Runtime.getRuntime();
Process p=null;
try
{
p=rt.exec("wordpad.exe d:\\ Failed.class");
p.waitFor();
}
catch(Exception e1)
{
String s1="Invalid Path/File Name";

41
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(s1);
}
p.exitValue();
}
if(s=="Sessioner")
{
Runtime rt;
Process p;
try
{
rt=Runtime.getRuntime();
p=rt.exec("d:/lanmonitor/session.bat");
p.waitFor();
p.exitValue();
rt.exec("notepad d\\Session.class");
}
catch(Exception e1)
{
String s1="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(s1);
}
}
if(s=="Viewer")
{
Runtime rt;
Process p;
try
{
rt=Runtime.getRuntime();
p=rt.exec("d:/viewer.bat");
p.waitFor();
p.exitValue();

42
rt.exec("notepad d: \\SViewer.class");
}
catch(Exception e2)
{
String s1="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(s1);
}
}
if(s=="Message")
{
MessageSender ms=new MessageSender();
ms.MsgSender();
}
if(s=="Read Me")
{
Runtime rt;
Process p;
try
{
rt=Runtime.getRuntime();
p=rt.exec("WordPad d:/lanmonitor/mainfiles/Readme.txt");
p.waitFor();
p.exitValue();
}
catch(Exception e1)
{
String s1="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(s1);
}
}
if(s=="My Host")
{

43
MyHost mY=new MyHost();
mY.IamUrHost();
}
if(s=="By Host Name")
{
HostWise Hw=new HostWise();
Hw.HWisesrc();
}
if(s=="Single Host") //IP Local LAN <Single Host>
{
SglinLAN sgli=new SglinLAN();
sgli.SglInLAN();
}
if(s=="A Host") //IP Selective <Remote Host>
{
SgloutLAN sglo=new SgloutLAN();
sglo.SglOutLAN();
}
if(s=="Several Host") //IP Local LAN <Several Host>
{
LANin mni=new LANin();
mni.ManyInLAN();
}
if(s=="Hosts")
//IP Selective <Remote Hosts>
{
LANout mnyo=new LANout();
mnyo.ManyOutLAN();
}

if(s=="All Hosts") //IP of All <Single Host>


{
LANout mnyo=new LANout();
mnyo.ManyOutLAN();

44
}
if(s=="MAC_Addr")
{ Runtime rt=Runtime.getRuntime();
MACAddr mac=new MACAddr();
mac.MAC_tbl();
try
{
rt.exec("wordpad d:\\MACtbl.class");
}
catch(Exception e1)
{
String act="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(act);
}
}
if(s=="Name_Tbl")
{
Runtime rt;
NameTable nt=new NameTable();
nt.Name_tbl();
try
{
rt=Runtime.getRuntime();
rt.exec("notepad d:\\Nametbl.class");
}
catch(Exception e1)
{
String act="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(act);
}
}

45
if(s=="Proto_Statis")
{
Runtime rt=Runtime.getRuntime();
ProtocolViewer rout=new ProtocolViewer();
rout.ProtocolView();
try
{
rt.exec("notepad d:\\Status.class");
}
catch(Exception e1)
{
String act="Invalid Path/File Name";
ErrMsgWindow msg=new ErrMsgWindow();
msg.ErrorMesgWin(act);
}
}
}
}
class SgloutLAN implements ActionListener
{
JFrame jfm;
JTextField jtf;
JButton jbn1,jbn2,jbn3;
int count=0;
Counter cnt=new Counter();
public void SglOutLAN()
{
jfm=new JFrame("IP Selective <Remote Host>");
Container cnr=jfm.getContentPane();
cnr.setLayout(null);

JLabel jlb1=new JLabel("Enter an IP Address");


jlb1.setLocation(40,50);
jlb1.setSize(300,25);

46
jbn1=new JButton("Ok");
jbn1.setMnemonic('O');
jbn1.setLocation(200,130);
jbn1.setSize(100,25);
jbn1.addActionListener(this);

jtf=new JTextField();
jtf.setLocation(200,50);
jtf.setSize(250,25);

jbn2=new JButton("Cancel");
jbn2.setMnemonic('C');
jbn2.addActionListener(this);
jbn2.setLocation(350,130);
jbn2.setSize(100,25);

jbn3=new JButton("Continue");
jbn3.setMnemonic('n');
jbn3.setLocation(50,130);
jbn3.setSize(100,25);
jbn3.addActionListener(this);

cnr.add(jbn1);
cnr.add(jbn2);
cnr.add(jbn3);
cnr.add(jlb1);
cnr.add(jtf);

jfm.setLocation(150,200);
jfm.setSize(500,200);
jfm.setVisible(true);
}
public void actionPerformed(ActionEvent e1)

47
{
String s=e1.getActionCommand();
if(s=="Ok")
{
String s1=jtf.getText();
RemoteHost Rh=new RemoteHost();
Rh.RemoteID(s1);
}
if(s=="Continue")
{
count=cnt.Counting(count);
System.out.println("count "+count);
}
if(s=="Cancel");
{
jfm.setVisible(false);

}
}
}

class Counter
{
public int Counting(int i)
{
i+=1;
return i;
}
}
6.5.2 Sample Code in Application Module

Code for checking validity


<%@ page import="java.sql.*" errorPage="errpage.jsp" %>
<%

48
String u=request.getParameter("uname");
String p =request.getParameter("pword");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:eg");
Statement s=con.createStatement();
ResultSet r=s.executeQuery("select * from login where uname='"+u+"'
and pword='"+p+"'");
out.println("Hello");
if(!r.next())
{
out.println(" Invalid UserName ");
out.println(" Check Your UserName and PassWord !");
out.println("<a href=login.html> Login Again </a>");
}
else
session.putValue("uname",u);
%>
<jsp:forward page="ehome.jsp" />

Code for registering New User

<%@ page import="java.sql.*" errorPage="errpage.jsp" %>


<%! int n=0; %>
<%

String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String pword=request.getParameter("pword");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String addr=request.getParameter("addr");
long zipcode=Long.parseLong(request.getParameter("zipcode"));

49
long phone=Long.parseLong(request.getParameter("phone"));
String mailid=request.getParameter("mailid");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Jdbc:Odbc:eg");

String str="insert into


newuser(fname,lname,pword,age,gender,addr,zipcode,phone,mailid)
values('"+fname+"','"+lname+"','"+pword+"',"+age+",'"+gender+"','"+addr+"',"+z
ipcode+","+phone+",'"+mailid+ "')";
PreparedStatement s=con.prepareStatement(str);
n=s.executeUpdate();
if(n==0)
out.println("Error in insertion : 1");

str="insert into login(uname,pword) values('"+fname+"','"+pword+"')";


s=con.prepareStatement(str);
n=s.executeUpdate();
if(n==0)
out.println("Error in insertion : 2");
%>
<jsp:forward page="ehome.jsp" />

Code for admin details

<%@ page import="java.sql.*" errorPage="errpage.jsp" %>


<%! int n=0; %>
<%

String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String pword=request.getParameter("pword");
int age=Integer.parseInt(request.getParameter("age"));

50
String gender=request.getParameter("gender");
String addr=request.getParameter("addr");
long zipcode=Long.parseLong(request.getParameter("zipcode"));
long phone=Long.parseLong(request.getParameter("phone"));
String mailid=request.getParameter("mailid");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Jdbc:Odbc:eg");
String str="insert into
newuser(fname,lname,pword,age,gender,addr,zipcode,phone,mailid)
values('"+fname+"','"+lname+"','"+pword+"',"+age+",'"+gender+"','"+addr+"',"+z
ipcode+","+phone+",'"+mailid+ "')";
PreparedStatement s=con.prepareStatement(str);
n=s.executeUpdate();
if(n==0)
out.println("Error in insertion : 1");

str="insert into login(uname,pword) values('"+fname+"','"+pword+"')";


s=con.prepareStatement(str);

n=s.executeUpdate();
if(n==0)

out.println("Error in insertion : 2");


%>
<jsp:forward page="ehome.jsp" />

Code for calculating tot User

<%@ page import="java.sql.*" errorPage="errpage.jsp" %>


<%! int n=0; %>
<%

51
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String pword=request.getParameter("pword");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String addr=request.getParameter("addr");
long zipcode=Long.parseLong(request.getParameter("zipcode"));
long phone=Long.parseLong(request.getParameter("phone"));
String mailid=request.getParameter("mailid");

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Jdbc:Odbc:eg");
String str="insert into
newuser(fname,lname,pword,age,gender,addr,zipcode,phone,mailid)
values('"+fname+"','"+lname+"','"+pword+"',"+age+",'"+gender+"','"+add
r+"',"+zipcode+","+phone+",'"+mailid+ "')";

PreparedStatement s=con.prepareStatement(str);
n=s.executeUpdate();

if(n==0)
out.println("Error in insertion : 1");
str="insert into login(uname,pword)
values('"+fname+"','"+pword+"')";
s=con.prepareStatement(str);
n=s.executeUpdate();
if(n==0)
out.println("Error in insertion : 2");
%>
<jsp:forward page="ehome.jsp" />

52
7. SCREEN SHOT

53
Fig7.1 Home Page

Fig 7.2 File Menu

Fig7.3 Search thru Host Name

54
Fig 7.4 IP address is obtained

Fig7.5 Searching several host

55
Fig 7.6 Range of IP addresses

Fig 7.7 After Processing Result should be seen in View menu

56
Fig7.8 View Menu

Fig 7.9 Consolidated output

57
Fig 7.10 Net Shower menu

Fig 7.11 Mac table doc

58
Fig 7.12 Net Shower

Fig 7.13 Protocol statistics

59
Fig7.14 Name table

Fig 7.15 Viewer

60
Fig 7.16 Messenger

Fig 7.17 Utility -Calculator

61
Fig7.18 Application module –Home page

62
Fig 7.19 Admin Details

63
Fig 7.20 User Details

64
Fig 7.21 for any Particular date –User details

Fig 7.22 – Server configuration details

65
Fig 7.23 Mailing details

66
8. CONCLUSION & FUTURE ENHANCEMENT

8.1 CONCLUSION
The Active Network System is developed to successfully incorporate
the essential requirements. In this project monitoring is handled in two ways.
LAN Monitoring is highly administrator friendly. It is designed with java
swing, an efficient GUI environment is provided. It assists the administrator to
know about the active and inactive clients in the LAN network along with their
status.
Application Monitoring is highly beneficial for any application
administrator. In this project website is taken as the specific application. It is
efficient in Instance control and session maintenance.

8.2 FUTURE ENHANCEMENT

Success of any project lies in its flexibility to inculcate any future


modifications. This project can easily accommodate changes. It is planned to
enhance application monitoring in Internet. In LAN monitoring module in
addition to simple monitoring function administrator should be given some
controlling power which is also the future enhancement of this project.

67
9. BIBLIOGRAPHY
9.1 Books

1. Patrick Naughter, Heerbert schildt, “The Complete Reference –


JAVA”,Tata Mc graw Hill,New Delhi,2001
2. Hans Bergsten, “Java Server Pages” ,Shroff
publishers,Calcutta,2003
3. Doglas E.Comer, “Internetworking with TCP/IP, LPE, New
Delhi,2002

9.2 web sites


1. JSP http://the Jsptags.com
2. Jakrtha tag http://jakartha apache.org
3. Networking http://aboutlan.com

68

You might also like