Toaz - Info Network Management System 40nms41 PR
Toaz - Info Network Management System 40nms41 PR
1st semester
2006-12-21
Contents:
SNMP overview.
The project implementation.
Project's user manual.
Instructor:
Dr.: Laui Malhees.
Prepared by:
Fuad Nassar
Ali Hussien.
Overview:
What is SNMP:
The Simple Network Management Protocol (SNMP) is an application layer protocol
that facilitates the exchange of management information between network devices. It is
part of the Transmission Control Protocol/Internet Protocol (TCP/IP) protocol suite.
SNMP enables network administrators to manage network performance, find and solve
network problems, and plan for network growth.
Two versions of SNMP exist: SNMP version 1 (SNMPv1) and SNMP version2
(SNMPv2). Both versions have a number of features in common, but SNMPv2 offers
enhancements, such as additional protocol operations.
Basic Components:
An SNMP-managed network consists of three key components: managed devices,
agents, and network-management systems (NMSs).
A managed device is a network node that contains an SNMP agent and that resides
on a managed network. Managed devices collect and store management information and
make this information available to NMSs using SNMP. Managed devices, sometimes
called network elements, can be routers
and access servers, switches and bridges, hubs, computer hosts, or printers.
An agent is a network-management software module that resides in a managed device.
An agent has local knowledge of management information and translates that information
into a form compatible with SNMP.
An NMS executes applications that monitor and control managed devices. NMSs
provide the bulk of the processing and memory resources required for network
management. One or more NMSs must exist on any managed network.
The following figure will make the image clear about the network management job ,
and how the administrator can managed and monitoring the network devices , and show
the place of the databases and agents.
FIG 1: Network Management System.
Basic Commands:
Managed devices are monitored and controlled using four basic SNMP commands:
read, write, trap , and traversal operations.
The read command is used by an NMS to monitor managed devices. The NMS
examines different variables that are maintained by managed devices.
The write command is used by an NMS to control managed devices. The NMS
changes the values of variables stored within managed devices.
The trap command is used by managed devices to asynchronously report events to
the NMS. When certain types of events occur, a managed device sends a trap to the NMS.
Traversal operations are used by the NMS to determine which variables a managed
device supports and to sequentially gather information in variable tables, such as a
routing table.
Two types of managed objects exist: scalar and tabular. Scalar objects define a
single object instance.
Tabular objects define multiple related object instances that are grouped in MIB
tables.
An object identifier (or object ID) uniquely identifies a managed object in the MIB
hierarchy. The MIB hierarchy can be depicted as a tree with a nameless root, the levels of
which are assigned by different organizations.
The top-level MIB object IDs belong to different standards organizations, while lower-
level object IDs are allocated by associated organizations.
Vendors can define private branches that include managed objects for their own products.
MIBs that have not been standardized typically are positioned in the experimental branch.
The managed object at input can be uniquely identified either by the object
name—iso.identified organization.dod.internet.private.enterprise.cisco.temporary
variables.AppleTalk.at input—or by the equivalent object descriptor, 1.3.6.1.4.1.9.3.3.1.
MIBs’ groups:
MIB-II system group (1.3.6.1.2.1.1)
Interfaces group (1.3.6.1.2.1.2)
Address Translation group (1.3.6.1.2.1.3)
Internet Protocol group (1.3.6.1.2.1.4)
Internet Control Message Protocol group (1.3.6.1.2.1.5)
Transmission Control Protocol group (1.3.6.1.2.1.6)
User Datagram Protocol group (1.3.6.1.2.1.7)
Exterior Gateway Protocol group (1.3.6.1.2.1.8)
SNMP group (1.3.6.1.2.1.11)
Transmission group (1.3.6.1.2.1.10)
SNMP Version 1:
SNMP version 1 (SNMPv1) is the initial implementation of the SNMP protocol. It
is described in Request For Comments (RFC) 1157 and functions within the
specifications of the Structure of Management Information (SMI). SNMPv1 operates
over protocols such as User Datagram Protocol (UDP), Internet Protocol (IP), OSI
Connectionless Network Service (CLNS), AppleTalk Datagram-Delivery Protocol
(DDP), and Novell Internet Packet Exchange (IPX). SNMPv1 is widely used and is the
de facto network-management protocol in the Internet community.
Three simple data types are defined in the SNMPv1 SMI, all of which are unique
values: integers, octet strings, and object IDs. The integer data type is a signed integer in
the range of –2,147,483,648 to 2,147,483,647. Octet strings are ordered sequences of 0 to
65,535 octets. Object IDs come from the set
of all object identifiers allocated according to the rules specified in ASN.1.
Seven application-wide data types exist in the SNMPv1 SMI: network addresses,
counters, gauges, time ticks, opaque, integers, and unsigned integers. Network addresses
represent an address from a particular
protocol family. SNMPv1 supports only 32-bit IP addresses. Counters are non-negative
integers that increase until they reach a maximum value and then return to zero. In
SNMPv1, a 32-bit counter size is specified. Gauges are non-negative integers that can
increase or decrease but that retain the maximum
value reached. A time tick represents a hundredth of a second since some event. An
opaque represents an arbitrary encoding that is used to pass arbitrary information strings
that do not conform to the strict
data typing used by the SMI. An integer represents signed integer-valued information.
This data type redefines the integer data type, which has arbitrary precision in ASN.1 but
bounded precision in the SMI.
An unsigned integer represents unsigned integer-valued information and is useful when
values are always non-negative. This data type redefines the integer data type, which has
arbitrary precision in ASN.1 but bounded precision in the SMI.
SNMP Version 2:
SNMP Management:
SNMP is a distributed-management protocol. A system can operate exclusively as
either an NMS or an agent, or it can perform the functions of both. When a system
operates as both an NMS and an agent, another NMS might require that the system query
manage devices and provide a summary of the information learned, or that it report
locally stored management information.
This is a fast overview about SNMP and the related topics that may help the reader
to know the main feature of the SNMP, what we do in our project is an interface that take
benefit of these SNMP feature and make it more user friendly to link the network's
administrator with the NMS that use SNMP, and enable him to easily apply the SNMP
commands on any network component.
Implementation:
As I said this project is just an interface help the administrator to apply the SNMP
command using graphical user interface components to make this operations easy and
fast.
We implement this interface using visual .NET 2005 framework environment using
C# language as a simple strong and comprehensive object oriented language , in visual
.NET 2005 all graphical user interface components that the software developer may need
such as buttons , textboxes , popup menu , drag and drop controls , list view , tree
view , picture boxes , and all well known components.
The fact that the C# is object orient language make it easy to benefit from the
different classes that it contain , also this simplify the process of define objects and use
the methods of that object in a simple way.
The most part in this language help us is the ability to define property especial in
this kind of project that deal with GET and SET operations and the property definition
must use those methods on C# make it easier and flexible to access (read or write) the
property.
Ex:
In this project we use a very useful and easy and comprehensive package that been
built for .NET environment , the implementation of this project classes and objects is
depend on this package and also on the visual .NET C# basics parts such that Property
and interfaces that C# included, as we said this project is just an interface between the
user and the NMS so the use for a ready interface package will make the developing of
the project easy and fast and more reliable and easy to repair, this part of the document
will include this package main features that been used in this project this package named
as:
Advent Net SNMP API .NET:
A comprehensive toolkit for rapid development of SNMP-based management
applications that are reliable and scalable. With well-proven APIs enriched with customer
experience and an integrated set of easy-to-use tools and features, AdventNet SNMP API
caters to the complete development life cycle of network element management.
The core of AdventNet SNMP API .NET Edition is a set of APIs that can be
integrated in any application. Built using the best software design patterns and optimized
performance, it is a powerful suite to secure APIs to build cross-platform, real-time
application for monitoring and tracking the performance of network elements.
Deployment Instructions.
The following piece of code illustrates how applications use MibOperations to load MIB
files.
try {
mibops.loadMibModule("RFC1213-MIB");
If the imported module is in a different directory, we can set the search path before
loading the MIB. The search path can be set by using the method setMibPath(String) .
The API searches for the module in the path specified. Multiple paths can be given
separated by a pipe(|) symbol.
The following code snippet shows how to load a MIB file which has its dependency file
in another directory. For example, if the IF-MIB is in mibs directory and if SNMPv2-
MIB (dependency file for IF-MIB) is in the patchmibs directory, the following code
shows how to load IF-MIB.
try {
mibops.loadMibModule("IF-MIB");
}
The API can load MIB files with the extensions mib, txt, and my. The method
setMibFileExtension(String) can be used to set the MIB file extension for the file to be
loaded.
The getNearestNode() method of MibModule class gets the nearest MIB node
corresponding to the int array of the OID. The getNearestNode(SnmpOID) method of
MibOperations class searches all MIB modules loaded in this MibOperations instance
and returns the OID if found.
The getSubID() of the MibNode class gives the sub identifier of this node's object-
identifier. The ObjectIdentifier have the 128 sub-identifiers, each sub-identifier can have
the value ranges from 0 to 4294967295. The getNumberedOIDString() method of the
MibNode class gives the numbered OID string of the node. The getOID() method of the
MibNode class gives the numbered OID of the node as an int array. The getOIDString()
method of the MibNode class gives the named OID of the node. The getOIDVector()
method of the MibNode class gets the named OID of the node as a vector.
The method decodeDefval() of the MibNode class decodes the DEFVAL value that is
defined for this node and returns the corresponding SnmpVar object.
Agent Class/Component
Description API Methods
Parameter Name
SnmpSession
SNMP Refers to the SNMP version Version = int value
Version of the agent. If the SNMP SnmpPDU
version is not explicitly set,
the default version is taken
as SNMPv1. To set the
specific SNMP version, we
need to use the following
methods. The value 1 is for
SNMPv2c.
The management
applications communicate
with the SNMP agents in the
managed node in a
particular port number. This
remote port number is the
UDP port 161. By default,
all the SNMP request
messages are received in
RemotePort = int
Port Number this port. Sometimes, the UDPProtocolOptions
value
agent may also be
configured to receive
messages in ports other than
161. The management
applications normally have
the provision to send request
to the default port and also
the option to set different
port numbers.
SnmpSession Community = String
Community Community strings are used value
Name to authenticate SNMP SnmpPDU
PDUs. Since SNMP packets WriteCommunity =
are usually sent using UDP String value
packets, there is no
connection established as in
the case of TCP/IP packets.
Therefore, when a UDP
packet arrives at the agent,
the agent validates the
packet. It accepts and sends
a response if the community
string of the PDU is equal to
that set on the agent, else
drops the packet. The agent
does not change the
community name after
communicating.
Applications typically
communicate with the
SNMP agents by specifying
the community name of the
agent.
session.Open();
Set the SNMP version using the Version() method and use the Command() method to
send an SNMP request. The command constants are defined in the SnmpAPI class. The
following command sets the constant to GET_REQ_MSG to perform an SNMP GET
operation.
pdu.ProtocolOptions=option;
pdu.Command=SnmpAPI.GET_REQ_MSG;
The OID can be given in the form x.x.x... or .x.x.x.... The OID given in the form
.x.x.x.x is assumed to be fully qualified, and the OID in the form x.x.x is not fully
qualified in which case the value of the SnmpAPI.getOIDPrefix() method is added to the
OID as a prefix.
This prefix can be changed by the user but it should be to applied across the entire
application. The AddNull method in the SnmpPDU class adds a variable binding with the
OID specified and a null variable value. Multiple OIDs can also be given as input.
pdu.AddNull(oid);
5. After the SnmpPDU and the OID is setup using the above methods, it
should be sent over a session to the peer SNMP entity. The method SyncSend(pdu)
is used to send synchronous requests. The PrintVarBinds() methods is used to print
the descriptive value of the OID and the variables. An error message is displayed if
the request fails.
System.Console.Out.WriteLine(result.PrintVarBinds());
session.Close();
api.Close();
SNMP GETNEXT:
The SNMP GETNEXT operation is similar to the SNMP GET operation. The
GETNEXT operation retrieves the value of the next OID in the tree. The GETNEXT
operation is particularly useful for retrieving the table data and also for variables that
cannot be specifically named. It is used for traversing the MIB tree.
Unlike SNMP GET, providing the instance value as part of the OID is not
mandatory. The SNMP GETNEXT operation always returns the next OID in the MIB tree
regardless of whether we specify the particular instance of OID.
pdu.ProtocolOptions=option;
pdu.Command=SnmpAPI.GETNEXT_REQ_MSG;
SNMP GETBULK:
The GETBULK operation is normally used for retrieving large amount of data,
particularly from large tables. A GETBULK request is made by giving an OID list along
with a Max-Repetitions value and a Nonrepeaters value.
N is the minimum of
R is the maximum of
MaxRepetitions()
NonRepeaters()
pdu.ProtocolOptions=option;
pdu.Command=SnmpAPI.GETBULK_REQ_MSG;
pdu.MaxRepetitions=10;
pdu.NonRepeaters=0;
The rest of the steps will remain the same as the SNMP GET operation.
Data Altering Operations:
SNMP SET:
The SNMP SET operation is used by the management applications to modify the
value of the managed object. Most of the managed objects have a default value
maintained by the agent. Sometimes the applications might want to modify one or more
MIB variables by using the SNMP SET operation.
The applications typically perform an SNMP SET operation by providing the host
name of the agent, one or more OIDs along with its instance, and the new value. The
agent processes the request and assigns the new value to the MIB variable. If an error
occurs, the new value is not assigned.
The SnmpAPI, SnmpSession, and SnmpPDU classes are used for most of the
management operations.
To use the communication services available with the API, we must instantiate
SnmpAPI. The SnmpAPI class is a thread which monitors SNMP sessions and it contains
various SNMP parameters.
Following are the steps involved in performing a simple SNMP SET operation using
the API.
session.Open();
pdu.Command=SnmpAPI.SET_REQ_MSG;
To perform SET operations we need to know the OID, its type, and its value. These
values are needed to build the varbind and can be received as user input. The variable
binding or the varbind is the pairing of the OID and its corresponding value. This varbind
should be added to the PDU for performing SET operations.
The type of the variable can be INTEGER, STRING, COUNTER, etc. The
SnmpAPI class provides constants for all the SNMP data types. Using this type, the value
an instance of SnmpVar is created.
//create varbind
pdu.AddVariableBinding(varbind);
Now the request should be sent over a session to the peer SNMP entity. The method
SyncSend(pdu) is used to send synchronous requests. The PrintVarBinds() methods is
used to print the descriptive value of the OID and the variables. An error message is
displayed if the request fails.
result = session.SyncSend(pdu);
System.Console.Out.WriteLine("Response PDU received from " + result.Address+ ",
community: " + result.Community);
System.Console.Out.WriteLine(result.PrintVarBinds());
session.Close();
api.Close();
Management applications can receive trap messages sent by the agent. Following are
the trap parameters that are to be set while developing applications
Enterprise OID:
This is the OID of the management enterprise that defines the trap message.
The value is represented as an OBJECT IDENTIFIER and has a variable length. The
following table displays the method that can be used for setting the enterprise OID.
Agent Address
This specifies the source IP address from which the trap was sent. The following
table displays the method that can be used for setting the agent address.
linkDown trap(2)
linkUp trap(3)
authenticationFailure trap(4)
egpNeighborLoss trap(5)
The generic traps are fixed and cannot be defined. On the other hand, it is possible to
define multiple enterprise-specific traps.
The trap message identity is determined based on the values contained in the
Enterprises, Standard Trap Type, and Specific Trap Type fields of the Trap PDU. If the
Trap Type value is zero through five, the trap is one of the generic traps and the value of
the Specific Trap Type field will be zero. If the Trap type value is six, the trap is
enterprise specific and is defined in a private MIB. It can take any integer value between
0 and 2147483647.
The following table lists the methods that can be used for setting the trap type. The
following table lists the methods that can be used for setting the generic and specific
traps.
Time Stamp
This is the value stored in the MIB-II sysUpTime variable converted into hours,
minutes, and seconds. It is a 32-bit unsigned value indicating the number of centiseconds
that have elapsed since the start of the SNMP agent and the sending of the trap. The
following table displays the method that can be used for setting the time stamp.
Trap Port
The traps are normally received in the UDP port no 162. However, this port number
can be different and the applications should be able to handle this.
The following table lists the methods that can be used for setting the trap port.
An SNMPv2 trap may need to be translated to an SNMPv1 trap. The following table
shows the notification parameters that make up an SNMPv1 trap and SNMPv2 traps.
SNMPv2 Trap
SNMPv1 Trap
timestamp
variable-bindings
Deployment Instructions:
The deployed environment should have the following installed:
1. The .NET Framework version 1.1 redistributable package to run applications
developed using the .NET Framework.
The application meant for deployment should have the following in the PATH
In addition to the above, if the application has some reference to the MIB, the
following needs to be in the PATH
vjslib (part of the Microsoft® Visual J#™ .NET version 1.1 redistributable)
AdventNetMibsAPI.dll.
This is the main parts on AdventNet package features that the project has deal with
and so the implementation part of the project is complete, this package give the project
the following benefits keys:
Command line utilities: Perform SNMP operations such as, SNMP GET, SNMP
GETNEXT, SNMP SET, SNMP BULK, SNMP WALK, etc. on remote agents.
USER MANUAL:
this part contain the correct way to use this software using figures to each state in the
application:
the following picture show the main form for this SNMP interface , and below it the
function of each button in that form:
the main form contain four button and three menu items each one has a function to open
another forms , each button do the following:
Configuration: open the following configuration form :
Brows: enable the user to load the MIB file from any location , this MIB file will
contain the standard MIB variables according to the SNMP version this
Application can deal with the two version SNMPV1 and SNMPV2 , those
variables must be arranged as a MIB tree on the list area under the browse textbox ,
this will help the user not to memorize all the MIB variables (surely he can't) , so
he can take any MIB variable ID from this part.
Get NMS Values: by it name it will open a form that enable the user to get the
wanted variable parameters , the following figure show the opened form :
FIG 3: Get NMS Values form
Get NMS values: will return the values of this variable in a sorted form using
browser list that arrange the values in beautiful way , this need the ID for that
variable which can be taken from the configuration form if not been memorized by
the user , the other part needed to achieve the GET command is the IP address for
the remote managed device , after apply the a correct GET command the following
figure appear containing the wanted values:
FIG 4 : Correct Get Command
the File menu on each form contain Exit submenu that will close the corresponding form ,
and the help menu will activate this CHM file help , on this way the GET operation is
completed.
Get Next NMS: represent an event that can retrieve the next variable parameters to
that OID on the text box, and update the text box with the new retrieved OID, this
enable the user to walk over the MIB and also get the variables parameters also.
Get Bulk NMS Values: represent an event that can retrieve a set of variables from
the given kind of MIB node ID, and arrange them on the list box at the same row.
Set NMS value: from the configuration form this button from it name used to
enable user to open the form that enable him to set the value for a given variable ,
this button will activate the following form:
FIG 5: Set NMS Values Form
Set NMS New Values : button that will set the value of the wanted MIB variables
by the inserted value , the event need to choose the type of the remote variable
from the combo box that contain all type of the MIB variables , the event also
need the IP address for the remote device , and the ID of the MIB variable wanted
to reset , after the correct set command apply a list is appear with the new value to
be sure that the value is reset as the following :
FIG 6: Correct Set Command.
NW FM : this button from the configuration form is related with the network trap
messages that come from the different network devices , the mentioned SNMP trap
services on the system is the median between the network nodes and this
application you must configure that services to be able to catch the trap messages,
this button will open a form that act as a server that listen to any coming trap
message and put it format on the form body to enable the administrator to read it
and to take a good decision according to that message , the following figure show
the NW FM form catching a trap message.
FIG 7: NW FM catching message.
Statistics: is a button that open the following form that can apply walk command
on the MIB or on the Agent, this will return all variable (statistics) on the MIB or
on the agent, the MIB group that the user select from the combo box will help in
getting the leaves of the same MIB group node forming the mib tree.
help: button used to activate this help file.
the option menu contain three submenus this menu option is can be used to do all
the operations mentioned , the submenu are:
1. configuration : which contain submenu named (load mib file) work as the
configuration button..
2. NW FM : work as the NW FM button.
3. statistics : Forming the MIB tree from MIB file or Agent.
******END******