pCOWeb
+030220966 – rel. 1.1 – 12.12.2017
34
6
SNMP
SNMP (Simple Network Management Protocol) is a protocol used in Ethernet networks for controlling and setting the parameters for the network devices, for
example switches and network printers. A complete description of the SNMP protocol is not within the scope of this document. The system integrator, who is
usually responsible for setting the various parameters, checking network communication and setting up the supervision system, should know how SNMP
works. A simple system based on the SNMP protocol normally features a series of devices, each containing an SNMP Agent, as well as a central supervisor
called the NMS – Network Management Station – which periodically queries the devices, acquiring the status and where necessary setting the operating
parameters. The simplicity of its messages means that SNMP is becoming increasingly widespread, above all for the control of industrial devices.
pCOWeb
includes an SNMP v2c Agent, that is, an application that responds to network queries in SNMP protocol version 1 and 2c.
The
pCOWeb
SNMP
Agent is developed using the Net-SNMP open source package, version 5.7.3; refer to this application for further information.
TRAP/INFORM
pCOWeb
features a TRAP generator that sends notification messages to an NMS in SNMP TRAP or INFORM v2C format when events occur relating to the
pCO
variables, as set by the user. The TRAP/INFORM messages are useful because they are sent by the Agent, thus providing information in real time
regardless of whether they have been queried by the supervisor. To set the SNMP TRAP notifications, see paragraph 4.3 on page 20.
6.1
OVERVIEW OF SNMP
OID
The main concept found in the SNMP protocol involves the definition of the variables, which in
this language are called objects. Each object, within an Agent, is identified by a unique sequence
of numbers, separated by decimal points, as follows:
1.3.6.1.4.1.9839.2.1.2.45
Reading from left to right, each sequence can be graphically represented as a unique path of
branches in a tree, in which the numbers on the left are closer to the root.
The SNMP standard has issued a series of rules for using the numbers in the tree, and has
reserved some specific paths for common uses or specific organisations. The standard also
allows as each number to be replaced by a name. In the example, the path is rewritten with the
standardised name, in brackets:
1(iso).3(organization).6(dod).1(internet).4(private).1(ente
rprises)
The path shown above is reserved for companies (“enterprises”), for specific developments.
Within that path, any company can apply for and obtain a specific identifier, and, within that
branch, allocate the identifiers of the objects defined in its own products. The enterprises
identifier assigned to CAREL is 9839. Therefore the path:
1.3.6.1.4.1.9839
identifies the CAREL space within each SNMP device.
Inside the CAREL space, the objects that correspond to the
pCO
variables and some typical
objects of the
pCOWeb
have been added; for the description of this space, see 6.2 on page 35.
As the SNMP Agent is based on the Net-SNMP package, it also supports all the typical objects of
that application. For information on this part of the SNMP tree in
pCOWeb
, see the documents on
Net-SNMP (
www.net-snmp.sourceforge.net
).
BASIC SNMP COMMANDS
The basic SNMP commands used by the NMS manage the variable read/write operations.
•
snmpget / snmpset: read and write a specified SNMP object respectively;
•
snmpgetnext: based on an initial SNMP object, reads the object implemented in the Agent
that is next to the one specified, considering the lexicographical order of the path of the MIB
tree;
•
snmpwalk: based on an initial SNMP object, reads the entire part of the SNMP tree
implemented in the device, next to the specified object (in reality, this command uses a
sequence of snmpgetnext commands to request the “next” object each time).
COMMUNITY
SNMP v2 does not feature authentication (Username / Password). In version 2 the data is also
exchanged without encryption.
Nonetheless, version 2c uses an identifier word (sent without encryption) called the “Community”
that acts as a filter for the reception of the data or executing commands.
When an NMS needs to read the value of an object in an Agent, it must send a “ReadOnly
Community” or a “ReadWrite Community” string that matches the identifier set in the Agent.
The same is true for the “ReadWrite Community” string when writing data.
Similarly, when an Agent sends an SNMP notification message (TRAP or INFORM), it specifies a
“Trap Community”; if this does not coincide with the recipient “Trap Community”, the message will
be ignored.
Figure 6.a - SNMP tree – example of a pCOWeb OID
(Object IDentifier)