snmp: Simple Network Management Protocol

Top  Previous  Next

Simple Network Management Protocol (SNMP) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks, and for modifying that information to change device behavior.

 

The manager can read and, when permitted, write to variables of managed devices.

The managed devices can send asynchronous notifications, called traps, to managing applications. Traps can contain variables with information about the event.

 

With an SNMP capable RTCU device, the application of the managed device can publish internal variables through SNMP. These variables can be read and possibly written to by the managing application.

 

The various variable types supported can be deduced from the offered variable read/write functions below.

 

All variables and traps are represented by an Object Identifier (OID).

Here the OID's must be used in a numerical dotted notation. For example: "1.3.6.1.2.1.1.5".

We only support OIDs in this notation, no OID translation is supported.

 

SNMP version 1, 2c and 3 are supported.

 

 

SNMP v3 security:

Both the USM (User-based Security Model) and TSM (Transport Security Model) methods are supported.

 

The USM method uses Users for identification and privacy.

A user is identified by username, and contains all the necessary parameters. (see the snmpUser structure)

 

The TSM method uses TLS/DTLS for identification and privacy.

The TLS/DTLS are based on certificates for security. (see certificates for more information)

Important: The certificates must not be password protected.

 

 

When working with traps, each managed device must be identified; this is done with two lists, a list of users for managed devices using the USM method, and a list of certificates for managed devices using the TSM method.

Both of the lists are persistent and will not be lost when the device is reset.

The lists are managed by the cert and user functions listed below.

 

 

The SNMP functionality offered here, can be divided into eight sections as:

 

Session handling
The following functions are used to setup a session to connect to a client.


snmpConnect

Connect to a SNMP service.


snmpDisonnect

Disconnect from a SNMP service.

 

Reading from clients
The following functions are used to read variables from a connected client:


snmpGetDouble

Read a double floating point value.


snmpGetFloat

Read a floating point value.


snmpGetInteger

Read an integer value.


snmpGetIP

Read an IP address value.


snmpGetOID

Read an OID value.


snmpGetString

Read a string value.


snmpGetTimeticks

Read a timetick value.

 

Writing to clients
The following functions are used to write variables to a connected client:


snmpSetDouble

Write a double floating point value.


snmpSetFloat

Write a floating point value.


snmpSetInteger

Write an integer value.


snmpSetIP

Write an IP address value.


snmpSetOID

Write an OID value.


snmpSetString

Write a string value.


snmpSetTimeticks

Write a timetick value.

 

Publishing variables
The following function are used for the application to publish internal variables as SNMP variables.


snmpStartAgent

Start the publishing agent.


snmpStopAgent

Stop the publishing agent.


snmpPublishDouble

Publish a double-precision floating-point type variable.


snmpPublishFloat

Publish a single-precision floating-point type variable.


snmpPublishInteger

Publish an integer type variable.


snmpPublishIP

Publish an IP-address type variable.


snmpPublishOID

Publish an OID type variable.


snmpPublishString

Publish a string type variable.


snmpPublishTimeticks

Publish a timeticks type variable.


snmpUnpublish

Remove published variables from the register.

 

Receiving traps
The following functions and structures are used to manage trap reception and handling.


snmpStartListen

Start listening for traps on an IP port.


snmpStopListen

Stop listening for traps on all IP ports.


snmpRegisterTrap

Register a trap to the event handler.


snmpUnregisterTrap

Unregister a trap from the event handler.

 

Sending traps
The following function are used to send traps to a managing application.


snmpCreateTrap

Establish the basic trap.


snmpDestroyTrap

Free resources from an establish trap.


snmpAddTrapVariable

Add variables to an established trap.


snmpSendTrap

Send a trap to a connected manager application.

 

Security handling
The following functions and structures are used to manage security for SNMP version 3.


snmpSecurityConfig

Configure TSM security.


snmpCertGet

Get the name of a certificate.


snmpCertSet

Set the name of a certificate.


snmpUser

Structure with USM user information.


snmpUserGet

Get a USM user profile for the trap handler.


snmpUserSet

Set a USM user profile for the trap handler.


snmpAgentUsersGet

Get a USM user profile for the publishing agent.


snmpAgentUsersSet

Set a USM user profile for the publishing agent.

 

Event handling
The following functions are used to handle SNMP events on manager and client.


snmpWaitEvent

Wait for incoming trap events or optional timeout.


snmpGetNextVar

Get the next variable of a received SNMP event.


snmpVariable

Structure to receive SNMP variables.

 

 

Limitations:

10 simultaneous connections.

It is only possible to have an RTCU device run as either a manager or a client (publishing agent).

It is possible to listen on 4 IP ports simultaneously.

There is a limit of 50 individual OIDs that can be published at a time.

30 trap OIDs to listen for can be registered at a time.

The maximum size of a trap is 10 kB.

10 traps for sending can be established at a time.

Each trap for sending can have at most 10 variables.

The NX32L compilation mode is required. (See Project Settings in the RTCU IDE)