• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Protocols - SNMP I/O
  • About SNMP Protocol
  • 5.0.0

SNMP I/O Configuration Manual Protocols - SNMP I/O

About SNMP Protocol

About SNMP

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. Devices that typically support SNMP include switches, routers, servers, cable modems, workstations, printers, UPSs, IP video cameras, IP telephones. SNMP is widely used in network management for network monitoring. SNMP exposes management data in the form of variables on the managed systems organized in a management information base (MIB) which describe the system status and configuration. MIB-files are readable text-files. These variables can then be remotely queried (and, in some circumstances, manipulated) by managing applications. Object Identifier (OID), a string of numbers derived from a global naming tree, is used to identify an object. E.g. :'1.3.6.1.4.1.16177.1.1.9.1'.

The principle of BER (Basic Encoding Rules) is that each field has an introducer that indicates the datatype of the contents and its length. The basic pattern used to encode a value is:

identifierlength (of the contents)contents

The identifier declares the datatype of the contents. SNMPManagerIO supports the following type identifiers:

Type (identifier)SNMP Byte-valueComment/Description
BOOLEAN0x010xFF or 0x00
INTEGER0x02-2147483648..2147483647
BIT_STRING0x03When decoded and length is <= 32 bits, it will be converted to hex-value
OCTET_STRING0x04sequence of arbitrary bytes
DISPLAYSTRING0x04a special case of the octet string type where all the bytes are printable ASCII characters
NULL0x05length and value following this type in SNMP packet: only one byte equal 0x00
OBJECT_IDENTIFIER0x06E.g. '1.3.6.1.4.1.16177.1.1.9.1'
SEQUENCE0x30an ordered list of objects
IP_ADDRESS0x40four byte 'IP version 4' address
COUNTER320x410..4294967295
GAUGE320x420..4294967295
TIME_TICKS0x43elapsed time in hundredths of a second, decoded to a null-terminated string containing corresponding days, hours, minutes, seconds and hundreth seconds
OPAQUE0x44wrapper for arbitrary ASN.1 types (treated as OCTET_STRING in SNMPManagerIO)
NSAP_ADDRESS0x45(treated as OCTET_STRING in SNMPManagerIO)
COUNTER640x460..18446744073709551615
UINTEGER320x470..4294967295

Protocol details

SNMP operates in the Application Layer, using UDP as transport layer:

IP headerUDP headerSNMP Message

SNMP Message is a Sequence of three smaller fields: the SNMP Version (Integer), the SNMP Community String (Octet String), and the SNMP PDU. There exist 7 SNMP protocol data unit (PDU) types: GetRequest, SetRequest, GetNextRequest, GetBulkRequest, Response, Trap and InformRequest. SNMPManagerIO may send GetRequest and SetRequest, and receive Response and Trap.

+------------------------------------------------------------------------+
|                      SNMP Message (Sequence type)                      |
+------+----------------+------------------------------------------------+
| Type | Length of Data |                      Data                      |
+------+----------------+-------------+-----------------------+----------+
| 0x30 |     Length     |SNMP Version | SNMP Community String | SNMP PDU |
|      |                |  (Integer)  |    (Octet String)     |          |
+------+----------------+-------------+-----------------------+----------+
                        |<--------------------Length-------------------->|

SNMP PDU for GetRequest v1 and v2, SetRequest v1 and v2, Response v1 and v2, Trap v2:

+------+--------+---------------------------------------------------------------------------------------------------------------------+
| PDU  | Length |                                             Data of SNMP PDU                                                        |
| type |  Data  |                                                                                                                     |
+------+--------+---------+---------+---------+---------------------------------------------------------------------------------------+
| PDU  | Length | Request | Error   | Error   |                             VarBind List (Sequence)                                   |
| type |  PDU   |   ID    | Status  | Index   +------+--------+--------------------------------+--------------------------------+-----+
|      |        |         |         |         | 0x30 | Length |           Varbind 1            |           Varbind 2            | ... |
|      |        |(Integer)|(Integer)|(Integer)|      |        |          (Sequence)            |          (Sequence)            | ... |
|      |        |         |         |         |      |        +------+-------+-------+---------+------+-------+-------+---------+-----+
|      |        |         |         |         |      |        | 0x30 | Len 1 | OID 1 | Value 1 | 0x30 | Len 2 | OID 2 | Value 2 | ... |
+------+--------+---------+---------+---------+------+--------+------+-------+-------+---------+------+-------+-------+---------+-----+
                |                                             |              |<-----Len 1----->|              |<-----Len 2----->|     |
                |                                             |<-------------------------------Length-------------------------------->|
                |<----------------------------------------------Lenght PDU----------------------------------------------------------->|

SNMP PDU for Trap v1:

+----+------+------------------------------------------------------------------------------------------------------------------------------+
|PDU |Length|                                             Data of SNMP PDU                                                                 |
|type| Data |                                                                                                                              |
+----+------+----------+-------+-------+--------+------+---------------------------------------------------- ------------------------------+
|0xA4|Length|Enterprise| Agent |Generic|Specific|Time  |                                VarBind List (Sequence)                            |
|    | PDU  |   OID    |Address| Trap  |  Trap  |Stamp +------+--------+------------------------------+------------------------------+-----+
|    |      |          |       | Type  | Number |      | 0x30 | Length |           Varbind 1          |         Varbind 2            | ... |
|    |      |  (OID)   |       |       |        |      |      |        |          (Sequence)          |         (Sequence)           | ... |
|    |      |          |       |       |        |      |      |        +----+-------+-------+---------+----+-------+-------+---------+-----+
|    |      |          |       |       |        |      |      |        |0x30| Len 1 | OID 1 | Value 1 |0x30| Len 2 | OID 2 | Value 2 | ... |
+----+------+----------+-------+-------+--------+------+------+--------+----+-------+-------+---------+----+-------+-------+---------+-----+
                       |                                               |            |<-----Len 1----->|            |<-----Len 2----->|     |
                       |                                               |<-----------------------------Length------------------------------>|
                       |<--------------------------------------------Lenght PDU----------------------------------------------------------->|

SNMP I/O Configuration Manual Protocols - SNMP I/O

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top