SNMPv1/SNMPv2c
Add SNMP agent functionality to the stack
The emNet SNMP agent is an optional extension which adds SNMP agent functionality to the stack. It combines a maximum of performance with a small memory footprint.
Overview
The SNMP agent allows an embedded system to handle SNMP requests from an SNMP manager and sending TRAP and INFORM messages to managers. It comes with all features typically required by embedded systems: Maximum flexibility, easily portable and low RAM usage. RAM usage has been kept to a minimum by smart buffer handling.
Key features
- Low memory footprint
- Only few SNMP knowledge required
- Easy MIB tree setup
- Supports SNMPv1 and SNMPv2c
- Supports SNMPv1 & SNMPv2 TRAP messages
- Supports SNMPv2 INFORM messages
- Support for SNMPv3 User-based Security Model (USM) available
- MIB-II support (System and Interfaces branch) for emNet out of the box
- Easy to use API for all typical SNMP types (Unsigned32, Counter32, ...)
- Independent of the TCP/IP stack: any stack with sockets can be used
- Can even be used without sockets e.g. with zero-copy API
- Demo with custom sample MIB with sockets or zero-copy API included
- Project for executable on PC for Microsoft Visual Studio included
SNMP Backgrounds
The Simple Network Management Protocol is a standard protocol to manage IP based devices in a network. Typical usage is to monitor counters and status in network switches and other network equipment but can also be used for configuration read/write operations.
The development of SNMP is coordinated by the IETF (Internet Engineering Task Force) with the widely used SNMPv2c inspired from several other sources. The current protocol version supported by the emNet SNMP agent is v1 and v2c. The latest protocol version is v3.
Application layer | Application layer protocol: SNMP agent |
---|---|
Transport layer | Tranport layer protocol: UDP |
Network layer | Network layer protocol: IP |
Link layer | Link layer protocol: Ethernet (IEEE 802.3), ... |
The SNMP agent is the part that is implemented directly inside a device to fulfill requests like status information and configuration of the device.
Requirements
TCP/IP Stack
The emNet SNMP agent requires a UDP/IP stack. It is optimized for emNet, but any RFC-compliant UDP/IP stack can be used. The shipment includes a Win32 simulation, which uses the standard Winsock API and an implementation which uses the socket API of emNet as well as an implementation which uses the zero-copy API of emNet.
IANA Private Enterprise Number (PEN)
For implementing SNMP in your own product you need to acquire a Private Enterprise Number (PEN) from the IANA. A PEN can be requested free of charge at https://www.iana.org/assignments/enterprise-numbers/.
The PEN used in the samples (dec. 46410) is the PEN registered for SEGGER Microcontroller GmbH & Co. KG. This needs to be be changed to your own PEN in your product and the content of the MIB is subject to change in the future.
Resource Usage
The ROM usage depends on the compiler options, the compiler version and the used CPU. The memory requirements of the SNMP agent module presented in the tables below have been measured on a Cortex-M4 system. Details about the further configuration can be found in the sections of the specific example.
Configuration used:
#define IP_SNMP_AGENT_WORK_BUFFER 64
ROM usage on a Cortex-M4 System
The following resource usage has been measured on a Cortex-M4 system using the SEGGER compiler with size optimization.
Add-on | ROM |
---|---|
emNet SNMP Agent | Approximately 6.2 KByte |
RAM Usage
The following resource usage shows typical RAM requirements for an SNMPv2c Agent implementation.
Most of the RAM is consumed for building the MIB tree in the application which is not subject of this measurement as it depends upon the application itself.
Add-on | RAM |
---|---|
emNet SNMP Agent | Approximately 300 bytes |
Relevant parts
The SNMP agent implements the relevant parts of the following Request For Comments (RFC).
RFC# | Description |
---|---|
[RFC 2578] | Direct Link: Structure of Management Information Version 2 (SMIv2) |
[RFC 3416] | Direct Link: Version 2 of the Protocol Operations for the Simple Network Management Protocol (SNMP) |
[RFC 4181] | Direct Link: Guidelines for Authors and Reviewers of MIB Documents |