SNMP (Simple Network Management Protocol) is a UDP-based application-layer protocol used to monitor and manage networked devices by reading and writing structured data objects called MIB variables. It is widely used in enterprise networking equipment such as routers, switches, and managed industrial gateways, and occasionally appears in embedded IoT and industrial devices that need to integrate into managed network infrastructures.
In practice
SNMP organizes device information in a Management Information Base (MIB), a hierarchical tree of object identifiers (OIDs). A manager (typically a network monitoring station running software like Nagios, Zabbix, or an enterprise NMS) sends GET/SET requests to an agent running on the managed device. The agent responds with or updates the corresponding MIB variables. Most bare-metal or small RTOS-based embedded systems do not include SNMP agents, but devices that sit at the network edge -- managed Ethernet switches, industrial PLCs with Ethernet ports, embedded Linux gateways -- often do.
SNMP versions matter in practice. SNMPv1 and SNMPv2c use cleartext community strings for authentication, which is considered weak by modern standards. SNMPv3 adds user-based authentication (e.g., HMAC-MD5 or HMAC-SHA, though MD5 and DES are now considered legacy) and optional encryption (DES or AES), with multiple defined security levels; but the added complexity makes it harder to implement on resource-constrained devices. Many embedded SNMP stacks (such as Net-SNMP on embedded Linux, or lightweight agents like mini_snmpd) support only v1/v2c by default; SNMPv3 support often requires additional configuration or a heavier stack.
A common pitfall is MIB design. Standard MIBs exist for common device types (RFC 1213 MIB-II covers basic IP/TCP/UDP statistics), but custom embedded hardware usually requires a private enterprise MIB. Defining and maintaining a private MIB, compiling it, and keeping the agent and MIB file in sync is a nontrivial ongoing effort. The OID namespace under the private enterprise subtree (1.3.6.1.4.1) requires an IANA-assigned enterprise number if the device is to be deployed broadly.
Trap and Inform messages allow the agent to proactively notify the manager of events (link down, threshold exceeded, etc.) rather than waiting to be polled. On embedded targets with intermittent connectivity or power constraints, implementing reliable trap delivery requires careful handling of retransmissions and buffering, since SNMP runs over UDP and provides no delivery guarantee at the protocol level.
Discussed on EmbeddedRelated
Frequently asked
What transport does SNMP use, and what ports?
SNMP uses
UDP as its standard transport. The agent listens for GET/SET requests on port 161. Trap and Inform messages are sent to the manager on port 162. TCP transport has been defined in some specifications and is supported by certain implementations, but standard SNMP operation is overwhelmingly UDP-based in practice.
What is the difference between SNMPv1, SNMPv2c, and SNMPv3?
SNMPv1 is the original version with limited data types and community-string-only authentication. SNMPv2c adds bulk operations (GETBULK), 64-bit counters, and Inform messages (an acknowledged notification mechanism introduced in the SNMPv2 family), but keeps the weak community-string security model. SNMPv3 adds user-based authentication and optional AES/DES encryption, but is significantly more complex to implement and configure. Most embedded deployments use v1 or v2c for simplicity, accepting the security trade-off.
Can SNMP run on a microcontroller without an OS?
Technically yes, but it is uncommon. SNMP requires a
UDP/IP
stack, MIB object storage, and ASN.1 BER encoding/decoding, which adds meaningful code and
RAM overhead. Some lightweight SNMP agent libraries target embedded Linux or RTOS environments (
FreeRTOS+TCP, lwIP). On bare-metal MCUs with limited
flash and RAM, SNMP is rarely a practical fit; simpler protocols such as
MQTT or
CoAP are usually preferred for IoT data reporting.
What is a MIB, and do I need to write one?
A MIB (Management Information Base) is a text file, written in ASN.1-based SMI syntax, that describes the OIDs your agent exposes -- their names, data types, access permissions, and descriptions. If your device exposes only standard MIBs (like MIB-II for basic IP statistics), you may not need to write one. If you expose custom device-specific data (sensor readings, configuration parameters, firmware version, etc.), you need to define a private enterprise MIB and register an IANA enterprise number for wide deployment.
How does SNMP compare to newer IoT management protocols?
SNMP is mature and deeply integrated into enterprise network management tooling, which makes it a natural fit when an embedded gateway or industrial device must slot into an existing managed network infrastructure. For IoT-scale deployments, protocols like
MQTT,
CoAP, LwM2M, or TR-069 are more commonly chosen due to lighter stacks, better support for intermittent connectivity, and more flexible data models. SNMP's polling model and predominant reliance on
UDP can also make it a poor fit for devices behind NAT or on constrained radio links such as SIGFOX or
LoRa, though gateways or relay architectures can mitigate some of those limitations.
Differentiators vs similar concepts
SNMP is sometimes confused with NETCONF/YANG or RESTCONF, which are newer network management protocols that use XML or JSON data models over TCP (SSH or HTTP/
TLS) and offer stronger security and richer data modeling at the cost of heavier
stack requirements. SNMP is also distinct from ICMP-based monitoring (ping, traceroute): ICMP only reports reachability and round-trip time, while SNMP provides structured read/write access to device internals. Within the SNMP family, the key distinction is between GET/SET operations (manager-initiated polling) and Trap/Inform messages (agent-initiated notifications).