Covid-19 Update: We've taken precautionary measures to enable all staff to work away from the office. These changes have already rolled out with no interruptions, and will allow us to continue offering the same great service at your busiest time in the year.

Network Management System: Light Weight SNMP Implementation

3073 words (12 pages) Essay in Computer Science

03/04/18 Computer Science Reference this

Disclaimer: This work has been submitted by a student. This is not an example of the work produced by our Essay Writing Service. You can view samples of our professional work here.

Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of UK Essays.

Chapter 6

  1. Implementation

Initially the Java (JDK 1.6) and Netbeans IDE 5.4 should be installed in a system. Then the SNMP4J API should be added to the Netbeans library. The Mysql-JDBC sever should be added to the library for using the database purpose. Then the SNMP is tested in the same system for working condition, afterwards the destination devices are enabled with SNMP agent and are tested. The system should have the requirements as follows.

6.1 About NetBeans:

NetBeans IDE is a developer tool for application development technologies. The IDE includes a multi-language editor, Profiler, Debugger and also tools for developer requirement. The IDE provides templates to create Java EE, Java SE, and Java ME applications. A variety of technologies and frameworks are supported. The language-aware editor detects errors while you type and suggest user with documentation popups and smart code completion with the speed and simplicity. To identify and solve problems in your applications, such as deadlocks and memory leaks, the IDE provides a feature rich debugger and profiler.When user is testing applications, it provides tools for Testing, as well as code analyzers and, in particular, integration with the popular open source Error detecting tool.

NetBeans is an integrated development environment (IDE) for developing primarily with Java, but also with other languages, in particular PHP,C/C++, and HTML5. It is also an application platform framework for Java desktop applications and others. The NetBeans IDE is written in Java and can run on Windows, OS X, Linux, Solaris and other platforms supporting a compatible JVM. The NetBeans Platform allows applications to be developed from a set of modular software components called modules NetBeans began in 1996 as Xelfi (word play on Delphi), a Java IDE student project under the guidance of the Faculty of Mathematics and Physics at Charles University in Prague. In 1997 Roman Staněk formed a company around the project and produced commercial versions of the NetBeans IDE until it was bought by Sun Microsystems in 1999. Sun opensourced the NetBeans IDE in June of the following year. Since then, the NetBeans community has continued to grow. In 2010, Sun (and thus NetBeans) was acquired by Oracle.

6.1.1 NetBeans Platform:

The NetBeans Platform is a reusable framework for simplifying the development of Java Swing desktop applications. The NetBeans IDE bundle for Java SE contains what is needed to start developing NetBeans plugins and NetBeans Platform based applications; no additional SDK is required. Applications can install modules dynamically.

Any application can include the Update Center module to allow users of the application to download signed upgrades and new features directly into the running application. Reinstalling an upgrade or a new release does not force users to download the entire application again. The platform offers reusable services common to desktop applications, allowing developers to focus on the logic specific to their application. Among the features of the platform are:

  • User interface management (e.g. menus and toolbars).
  • User settings management.
  • Storage management (saving and loading any kind of data).
  • Window management.
  • Wizard framework (supports step-by-step dialogs).
  • NetBeans Visual Library.
  • Integrated development tools.

NetBeans IDE is a free, open-source, cross-platform IDE with built-in-support for Java Programming Language.

6.1.2 NetBeans IDE:

NetBeans IDE is an open-source integrated development environment. NetBeans IDE supports development of all Java application types (Java SE(including JavaFX), Java ME, web, EJB and mobile applications) out of the box.

Modularity:

All the functions of the IDE are provided by modules. Each module provides a well defined function, such as support for the Java language, editing, or support for the CVS versioning system, and SVN. NetBeans contains all the modules needed for Java development in a single download, allowing the user to start working immediately. Modules also allow NetBeans to be extended. New features, such as support for other programming languages, can be added by installing additional modules. For instance, Sun Studio, Sun Java Studio Enterprise, and Sun Java Studio Creator from Sun Microsystems are all based on the NetBeans IDE.

6.2 Platform selection:

Java is an object oriented application programming language developed by Sun Microsystems in the early 1990s.Java application is typically compiled to byte code, although compilation to native machine code is also possible. At runtime, byte code is usually either interpreted or compiled to native code for execution, although direct hardware execution of byte code by a java processor is also possible. The version of java used to run the application is JDK1.6.This is because the APIs used in this application specifies this requirement.

6.2.1 Reasons for Using Java

Java was chosen as the programming language because of its versatility. It is an object oriented programming language with the following important features.

a) Platform Independent-The concept of Write-once-run-anywhere (known as the platform independent) is one of the important key feature of java language that makes java as the most powerful language. The programs written on one platform can run on any platform provided the platform must have the JVM.

b) Simple – There are various features that make the java as a simple language. Programs are easy to write and debug because java does not use the pointers explicitly. Java provides the bug free system due to the strong memory management. It also has the automatic memory allocation and de-allocation system.

c) Robust – Java has the strong memory allocation and automatic garbage collection mechanism. It provides the powerful exception handling and type checking mechanism as compare to other programming languages. Compiler checks the program whether there are any errors and interpreter checks any run time error and makes the system secure from crash. All of the above features make the java language robust.

d) Distributed – The widely used protocols like HTTP and FTP are developed in java. Internet programmers can call functions on these protocols and can get access the files from any remote machine on the internet rather than writing codes on their local system.

e) Portable – The feature Write-once-run-anywhere makes the java language portable provided that the system must have interpreter for the JVM. Java also has the standard data size irrespective of operating system or the processor. These features make the java as a portable language.

f) Dynamic – While executing the java program the user can get the required files dynamically from a local drive or from a computer thousands of miles away from the user just by connecting with the Internet.

g) Secure – Java does not use memory pointers explicitly. All the programs in java are run under an area known as the sand box. Security manager determines the accessibility options of a class like reading and writing a file to the local disk. Java uses the public key encryption system to allow the java applications to transmit over the internet in the secure encrypted form. The byte code verifier checks the classes after loading.

h) Performance – Java uses native code usage, and lightweight process called threads. In the beginning interpretation of byte code resulted in the slow performance but the advance version of JVM uses the adaptive and just in time compilation technique that improves the performance.

i) Multithreaded – Java is also a multithreaded programming language. Multithreading means a single program having different threads executing independently at the same time. Multithreading programming is a very interesting concept in Java. In multithreaded programs not even a single thread disturbs the execution of other thread.

j) Architecture Neutral – The Java compiler generates byte code instructions, to be easily interpreted on any machine and to be easily translated into native machine code on the fly. The compiler generates an architecture-neutral object file format to enable a Java application to execute anywhere on the network and then the compiled code is executed on many processors, given the presence of the Java runtime system.

6.3 About SNMP:

Simple Network Management Protocol (SNMP) is an application–layer protocolusedfor exchanging management information between network devices.SNMP is one of the widely accepted protocols to manage and monitor network elements. Most of the professional–grade network elements come with bundled SNMP agent.

In the following figure the SNMP manager, SNMP agents and MIBs (Management information base) are the major parts of architecture. Here the manager will send the get-next request for particular OID (object identifier) to the agent. The SNMP agent will retrieve the information from the MIB for a particular OID and will send the response to the manager. If any warning message occurs in the agent side, agent will send the trap notifications to manager.

6.4 Use of API:

The SNMP4J API should be added correctly to the tool which the user is using in the project. It may be eclipse or Netbeans. Basically the APIs which needed in our project are JFreechart, Mysql and the SNMP4J.

JFreechart APIs are added into the tool by their jar files, it should contain the JCommon and JFreechart JAR files and the documentation. These should be added into the library here. Mysql JDBC Connector JAR files should be added into the library for using the database.

6.5 Modules of project:

A) The following code snippet explains how the set of all the IP address and MAC address are retrieved for the given input switch. That is the all the devices connected to the particular switch is retrieved and stored.

for (i = 0; i < nodesSwi.getLength(); i++) {

Node nodSwi = nodesSwi.item(i);

if (nodSwi.getNodeType() == Node.ELEMENT_NODE) {

Element element = (Element) nodSwi;

String MacAddress = xjava.getValue(“MacAddr”, element);

String MacAddressEnd = xjava.getValue(“MacAddrEnd”, element);

out.println(“

“);

out.println(“

“);

out.println(“

“);

out.println(“

“);

stroid_result = MacAddress;

do {

stroid_result = ip.CreateOID(ipAddress, stroid_result, port);

temp = stroid_result.substring(stroid_result.indexOf(“.”) + 20, stroid_result.length());

ipA = temp.substring(temp.indexOf(“.”) + 1, temp.indexOf(“=”));

MacAddr = temp.substring(temp.indexOf(“=”) + 2, temp.length());

stroid_result = stroid_result.substring(0, stroid_result.indexOf(“=”) – 1);

if (!stroid_result.contains(MacAddressEnd)) {

out.println(“

“);

out.println(“

“);

out.println(“

“);

}

} while (!stroid_result.contains(MacAddressEnd));

out.println(“

SL no IP Address MAC Binding
” + ++i + “
” + ipA + ”
” + MacAddr + ”

“);

out.println(“

“);

}

}

B) The following code is typed and tested in the JSP file. Here the connectivity discovery module is explained and the connection between the ports and the devices are identified.

stroid_result = MacAddress;

do {

stroid_result = ip.CreateOID(ipAddress, stroid_result, port);

temp = stroid_result.substring(stroid_result.indexOf(“.”) + 20, stroid_result.length());

ipA = temp.substring(temp.indexOf(“.”) + 1, temp.indexOf(“=”));

MacAddr = temp.substring(temp.indexOf(“=”) + 2, temp.length());

stroid_result = stroid_result.substring(0, stroid_result.indexOf(“=”) – 1);

if (stroid_result.contains(MacAddress))

{//Port Index

objip_MacResult[index] = new ClsOid_Input_Rslt();

objip_MacResult[index].Str_Macaddress = MacAddr;

objip_MacResult[index].Str_Ip = ipA;

m++;

index++;

}

} while (!stroid_result.contains(MacAddrEnd));

/*TO GET MAC ADDRESS AND PORT COUNT*/

do {

stroid_result = ip.CreateOID(ipAddress, stroid_result, port);

temp = stroid_result.substring(stroid_result.indexOf(“=”) + 2, stroid_result.length());

stroid_result = stroid_result.substring(0, stroid_result.indexOf(“=”) – 1);

if (stroid_result.contains(Mac))

{//Port Index

count++;

}

} while (!stroid_result.contains(MacEnd));

ClsOid_Input_Rslt[] objMac_PortResult;

objMac_PortResult = new ClsOid_Input_Rslt[count];

/*TO GET MAC ADDRESS AND PORT */

do {

stroid_result = ip.CreateOID(ipAddress, stroid_result, port);

temp = stroid_result.substring(stroid_result.indexOf(“=”) + 2, stroid_result.length());

stroid_result = stroid_result.substring(0, stroid_result.indexOf(“=”) – 1);

if (stroid_result.contains(Mac))

{

objMac_PortResult[index] = new ClsOid_Input_Rslt();

objMac_PortResult[index].Str_Mac = temp;

m++;

index++;

}

if (stroid_result.contains(PortNum))

{

if (index > n)

{

index = (n – 1);

}

objMac_PortResult[index].Str_PortNum = temp;

n++;

index++;

}

} while (!stroid_result.contains(MacEnd));

HashMap map = new HashMap();

/* TO GET IPADDRESS, MACADDRESS AND PORTS */

out.println(“

“);

out.println(“

“);

for (int Macportcount = 0; Macportcount < objMac_PortResult.length; Macportcount++)

{

String Macaddress = new String();

String MacPort = new String();

MacPort = objMac_PortResult[Macportcount].Str_Mac;

for (int IpMaccount = 0; IpMaccount < objip_MacResult.length; IpMaccount++) {

Macaddress = objip_MacResult[IpMaccount].Str_Macaddress;

if (MacPort.equals(Macaddress))

{

if (!map.containsKey(objMac_PortResult[Macportcount].Str_PortNum)) {

map.put(objMac_PortResult[Macportcount].Str_PortNum, objip_MacResult[IpMaccount].Str_Ip);

} else {

map.remove(objMac_PortResult[Macportcount].Str_PortNum);

map.put(objMac_PortResult[Macportcount].Str_PortNum, “uplink”);

}

}

}

}

Set> set = map.entrySet();

for (Map.Entry me : set)

{

out.println(“

“);

out.println(“

“);

}

out.println(“

IP ADDRESS PORT NUMBER
” + me.getValue() + “ ” + me.getKey() + “

“);

out.println(“

“);

}

C) The following code is to explain about the device type discovery of the network. The device type and the switch type are identified using this code.

stroid_result = Service;

stroid_result = ip.CreateOID(ipAdd[ipCount], stroid_result, port);

temp = stroid_result.substring(stroid_result.indexOf(“=”) + 2, stroid_result.length());

stroid_result = stroid_result.substring(0, stroid_result.indexOf(“=”) – 1);

if (temp.contains(“7”) || temp.contains(“6”))

{

out.println(“Switch Type :L3 “);

} else {

out.println(“Switch Type :L2 “);

}

/*code for Type of Switch ENDS*/

/* the device type discovery code starts from here*/

stroid_result = name;

stroid_result = ip.CreateOID(ipAddress, stroid_result, port);

if (stroid_result.indexOf(“=”) > 0) {

out.println(“

“);

stroid_result = print;

stroid_result = ip.CreateOID(ipAddress, stroid_result, port);

stroid_result = stroid_result.substring(0, stroid_result.indexOf(“=”) – 1);

if (stroid_result.contains(print)) {

out.println(“

“);

out.println(“image 1“);

} else {

stroid_result = Numberofuser;

stroid_result = ip.CreateOID(ipAddress, stroid_result, port);

stroid_result = stroid_result.substring(0, stroid_result.indexOf(“=”) – 1);

if (stroid_result.contains(Numberofuser)) {

out.println(“

“);

out.println(“image 1“);

} else {

out.println(“

“);

out.println(“image 1“);

stroid_result = name;

stroid_result = ip.CreateOID(ipAddress, stroid_result, port);

temp = stroid_result.substring(stroid_result.indexOf(“=”) + 2, stroid_result.length());

out.println(“

” + temp + “

“);

out.println(“

“);

out.println(“

“);

}

}

6.6 Execution part:

Here JDK 1.6 with Netbeans 6.9.1 tool is used, SNMP API(SNMP4J) [11], and Jfreechart for graphical representation. The system is developed and tested on Red Hat Linux 5.4 operating system with 2.80-GHz, Intel Pentium 4 CPU with 512 MB RAM.

The approach is tested in the subnet of a network or can say that department of an organisation. In this subnet found number of devices connected to the switches, their details and also the connection between them. These are tested multiple times and physically verified. The problem we faced is that some devices are having multiple Mac Addresses so it is difficult for the system to find the connectivity of the device to port. Except this everything is working well enough. The major thing done is when the device is not supporting for SNMP then tried to get the details of that system by ICMP echo requests.

The time taken to discover the devices connected to switch are compared with the previous research. And it is very less compared to other research. In very short time nearly 8-9 seconds we can discover all the devices connected to the switch in the network.

Get Help With Your Essay

If you need assistance with writing your essay, our professional essay writing service is here to help!

Find out more

Cite This Work

To export a reference to this article please select a referencing style below:

Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.

Related Services

View all

DMCA / Removal Request

If you are the original writer of this essay and no longer wish to have the essay published on the UK Essays website then please:

Related Lectures

Study for free with our range of university lectures!