Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
25Activity
0 of .
Results for:
No results containing your search query
P. 1
Understanding SNMP Stack

Understanding SNMP Stack

Ratings:

4.0

(1)
|Views: 3,167|Likes:
Published by Watsh Rajneesh
Old SNMP notes..covers some SNMP v1 and SMI v1 MIB syntax.
Old SNMP notes..covers some SNMP v1 and SMI v1 MIB syntax.

More info:

Published by: Watsh Rajneesh on Sep 09, 2007
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

08/18/2013

pdf

text

original

 
Understanding SNMP Stack
Following acticle is excerpted from various references and presents only what i deemed as relevant for myknowledge. It does not start from the basics of what SNMP is but deals with only those points which i think i can look back to for reference. Thats why its a notes on SNMP and no tutorial. In the references section anabsolute beginner may find some useful links which will be more enlightening for him. The main purpose behind this notes is to learn how an SNMP stack (for atleast version 1 of SNMP) is coded. To this end, istarted with the basics of SNMP data types, the PDU format, MIB syntax (though very briefly touchedupon just to illustrate the usage of the SNMP data types), and the different SNMP versions, their value-additions to the protocol. After the basics i will cover the implementation of SNMP stack taking one freelyavailable core SNMP stack which does not have the agent (extensible or otherwise) built into it nor does ithave a MIB parsing module because they are deemed only as utilities to the core of the Stack for buldingapplications.
 
- Compiled By -
 
Watsh Rajneesh
 
Software Engineer, Quark (R&D Labs)
 
Contents
 
1. Understanding SNMP
 
 b. Understanding of an SNMP Stack (Refer to the TCP/IP Illustrated Vol. II and one of the Java SNMPStacks you have preferably the Westhawk one.)
 
c. A brief intro on SNMP versions and basics (refer to FAQ you have and the network_doc.html explaningnetwork management concepts for 
Solistice
EM Solution of Sun Micro.).
 
d. If time permits and coding seems to be not too much then code a stack in C++. (Refer to the smaller JavaSNMP stack you have.Study it well, identify the objects and code it in C++.) The aim is to understand howthe stack is written and not to reinvent the wheel by rewriting the algos.
 
Understanding SNMP
How does SNMP use ASN.1?
 
ASN.1 is a interface definition language which defines the contract between the client and server applications. In SNMP, a subset of the ASN.1 language is used and its feature to define new textualconventions (eg. DisplayString, IpAddress,etc.) An SNMP MIB file is written in this subset of ASN.1 andthus the MIB defines the interface for the SNMP client (manager) and the SNMP server (agent).
 
The
Structure of Management Information (SMI)
defines the rules for describing managementinformation, using Abstract Syntax Notation One (ASN.1). The SNMPv1 SMI is defined in RFC 1155. TheSMI makes three key specifications:
 
ASN.1 data types
,
 
SMI-specific data types
, and
 
SNMP MIB tables
.
 
SNMPv1 and ASN.1 Data Types
 
The SNMPv1 SMI specifies that all managed objects have a certain subset of Abstract Syntax Notation One(ASN.1) data types associated with them. Three ASN.1 data types are required:
 
name
, The
name
serves as the object identifier (
object ID
).
 
syntax
, The
syntax
defines the
data type of the object
(for example,
integer
or 
string
). The SMIuses a
subset of the ASN.1 syntax definitions
.
 
 
encoding
. The
encoding data
describes how information associated with a managed object isformatted as a series of data items for transmission over the network. SNMP uses
ASN.1 BER (Basic Encoding Rate)
encoding type.
 
SNMPv1 and SMI-Specific Data Types
 
The SNMPv1 SMI specifies the use of a number of SMI-specific data types, which are divided into twocategories:
simple data types
and
application-wide data types
.
 
Three
simple data types
are defined in the SNMPv1 SMI, all of which are unique values:
 
integers
, The integer data type is a signed integer in the range of -2,147,483,648 to 2,147,483,647.
octet strings
, Octet strings are ordered sequences of 0 to 65,535 octets.
 
object IDs.
Object IDs come from the set of all object identifiers allocated according to the rulesspecified in ASN.1.
 
Seven
application-wide data types
exist in the SNMPv1 SMI:
 
Network addresses
 —Represent addresses from a protocol family. SNMPv1 supports only 32-bitIP addresses.
 
Counters
 —Nonnegative integers that increase until they reach a maximum value; then, theintegers return to zero. In SNMPv1, a 32-bit counter size is specified.
 
Gauges
 —Nonnegative integers that can increase or decrease but retain the maximum valuereached.
 
Time ticks
 —A hundredth of a second since some event.
 
Opaques
 —An arbitrary encoding that is used to pass arbitrary information strings that do notconform to the strict data typing used by the SMI.
 
Integers
 —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.
 
Unsigned integers
 —Unsigned integer-valued information that is useful when values are alwaysnonnegative. This data type redefines the integer data type, which has arbitrary precision in ASN.1 but bounded precision in the SMI.
 
SNMP MIB Tables:
The SNMPv1 SMI defines
structured tables
that are used to group the instances of a tabular object (an object that contains multiple variables). Tables contain zero or more rows that areindexed to allow SNMP to retrieve or alter an entire row with a single Get, GetNext, or Set command.
 
SNMP v1 Protocol Operations
 
SNMP is a simple request-response protocol. The NMS issues a request, and managed devices returnresponses. This behavior is implemented by using one of four protocol operations:
 
Get
 —Used by the NMS to retrieve the value of one or more object instances from an agent. If theagent responding to the Get operation cannot provide values for all the object instances in a list,the agent does not provide any values.
 
GetNext
 —Used by the NMS to retrieve the value of the next object instance in a table or listwithin an agent (appearing next in the lexicographical order of OID).
 
Set
 —Used by the NMS to set the values of object instances within an agent.
 
Trap
 —Used by agents to asynchronously inform the NMS of a significant event.
 
SNMP v2
 
 
In theory, SNMPv2 offers a number of improvements to SNMPv1, including additional protocol operations.The SNMPv2 SMI is described in RFC 1902. It makes certain additions and enhancements to the SNMPv1SMI-specific data types, such as including
 
bit strings,
Bit strings are defined only in SNMPv2 and comprise zero or more named bits thatspecify a value.
 
network addresses,
 Network addresses represent an address from a particular protocol family.SNMPv1 supports only 32-bit IP addresses, but SNMPv2 can support other types of addresses aswell.
 
counters.
Counters are non-negative integers that increase until they reach a maximum value andthen return to zero. In SNMPv1, a 32-bit counter size is specified. In SNMPv2, 32-bit and 64-bitcounters are defined.
 
The SNMPv2 SMI specifies information modules, which include a group of related definitions. Three typesof SMI information modules exist:
 
MIB modules
 —Contain definitions of interrelated managed objects.
 
Compliance statements
 —Provide a systematic way to describe a group of managed objects thatmust conform to a standard.
 
Capability statements
 —Used to indicate the precise level of support that an agent claims withrespect to a MIB group. An NMS can adjust its behavior towards agents according to thecapability statements associated with each agent.
 
The Get, GetNext, and Set operations used in SNMPv1 are exactly the same as those used in SNMPv2.SNMPv2, however, adds and enhances protocol operations. The SNMPv2 trap operation, for example,serves the same function as the one used in SNMPv1. However, a different message format is used.SNMPv2 also defines two new protocol operations:
 
GetBulk 
 —Used by the NMS to efficiently retrieve large blocks of data, such as multiple rows in atable. GetBulk fills a response message with as much of the requested data as fits.
 
Inform
 —Allows one NMS to send trap information to another NMS and receive a response. If theagent responding to GetBulk operations cannot provide values for all the variables in a list, theagent provides partial results.
 
SNMP is a distributed-management protocol. A system can operate exclusively as an NMS or an agent, or asystem can perform the functions of both. When a system operates as both an NMS and an agent, another  NMS can require the system to:
 
Query managed devices and provide a summary of the information learned.
 
Report locally stored management information.
 
SNMP lacks authentication capabilities, which results in a variety of security threats:
 
Masquerading
 —An unauthorized entity attempting to perform management operations byassuming the identity of an authorized management entity.
 
Modification of information
 —An unauthorized entity attempting to alter a message generated byan authorized entity, so the message results in unauthorized accounting management or configuration management operations.
 
Message sequence and timing modifications
 —Occurs when an unauthorized entity reorders,delays, or copies and later replays a message generated by an authorized entity.
 

Activity (25)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Lesly Zerna liked this
Lotus Perfaction liked this
Santosh Sharma liked this
Balaji Kani liked this
Nikhil Akhavi liked this
rajivlaxmi liked this
Vijay Chowdhary liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->