What SNMP Is: the Simple Network Management Protocol, Explained Without the Standards Document
Every switch, router, firewall, printer and UPS you will ever monitor speaks the same thirty-five-year-old language, and almost nobody who relies on it has read the specification. That is fine. SNMP was designed so that you would not have to. This guide explains what the Simple Network Management Protocol is, what it is used for, which ports it uses, what the acronyms MIB and OID mean, and which of its three versions you should be running. It is the page to read before the snmpwalk tutorial and after you have been handed a network to look after.
In this guide
- SNMP in one paragraph
- What SNMP is used for
- How the SNMP protocol works
- SNMP ports: 161, 162, and TCP or UDP
- What MIB means, what an OID is
- SNMP versions: v1, v2c and v3
- Traps and informs
- The other words you will meet
- Where to go next
SNMP in one paragraph
SNMP stands for Simple Network Management Protocol. It is a question-and-answer protocol: a manager (your monitoring server) asks a device for the value of a named counter, and a small program on the device called the agent answers. The names come from a catalogue called a MIB, each name has a numeric address called an OID, the questions travel over UDP port 161, and the device can also send unsolicited news, called a trap, to port 162. That is the whole thing. Everything else in this guide is detail about those six nouns.
What SNMP is used for
What is SNMP protocol used for, in practice? Reading numbers out of boxes that have no other way to report them. A switch has no disk to write logs to and no screen to show a graph on, but it keeps a counter of every byte that crossed every port, and SNMP is how you ask for the counter. The same goes for the router's CPU, the firewall's session table, the printer's toner, the UPS's battery, the NAS's disks and the temperature sensor in the rack.
A monitoring system polls those counters on a schedule, stores the answers, draws the graphs and raises the alerts. SNMP is also used, less often and less wisely, to change settings on a device with a SET request; most sites disable that and use SNMP read-only, which is the right default.
How the SNMP protocol works: managers, agents and five verbs
The manager sends one of a small set of requests; the agent replies with a response. The verbs are:
| Request | What it asks | When you meet it |
|---|---|---|
| GET | The value of one named object | Every poll of every single-valued sensor |
| GETNEXT | The object after this one in the tree | What snmpwalk does, over and over, to read a whole table |
| GETBULK (v2c and v3) | Many objects after this one, in one packet | A bulk walk of an interface table; far fewer packets than GETNEXT |
| SET | Change a value | Rarely, and usually disabled on purpose |
| TRAP / INFORM | Not a request: the agent tells the manager something happened | Link down, power supply failed, temperature high |
SNMP messages are small, stateless and cheap, which is why a modest server can poll thousands of devices. It is also why they are easy to lose: the protocol does not retry on its own, and a dropped packet is simply a missing sample unless the manager asks again.
SNMP ports: UDP 161 and 162, and whether SNMP is TCP or UDP
Is SNMP TCP or UDP? UDP, in practice everywhere. The default SNMP port for requests is UDP 161: the manager sends to port 161 on the device and the agent replies from it. Traps and informs go the other way, from the device to UDP 162 on the manager, which is the port your trap receiver listens on. So the answer to "snmp port 161 vs 162" is: 161 is where devices listen for questions, 162 is where the monitoring server listens for news.
A TCP mapping for SNMP exists on paper and almost nowhere in practice, so if a firewall rule or a port-scanner result talks about an SNMP TCP port number, the honest answer is that you will not need it. SNMP v3 uses the same ports as v1 and v2c; there is no separate "SNMP v3 port". What v3 changes is what is inside the packet, not where it goes.
Firewall checklist: allow UDP 161 from the monitoring server (and any remote probe) to the devices; allow UDP 162 from the devices to the monitoring server. Nothing else. If a device sits behind a NAT, remember that the trap's source address will be the NAT's, which is why a good trap receiver lets you tell it which device an address belongs to.
What MIB means, what MIB stands for, and what an OID is
MIB: the Management Information Base
What does MIB stand for? Management Information Base. The MIB meaning is simpler than the name: it is the catalogue of everything a device can be asked about, organised as a tree. A MIB file is a text document, written in a notation called SMI, that describes one branch of that tree: the names of the objects, their types (a counter, a gauge, a string, an enumeration), their units and a sentence of description. The standard branches are defined by the IETF and IEEE; vendors publish their own MIB files for their own counters. "MIB-2" is the standard set almost every device supports, and "IF-MIB" is the part of it that describes interfaces.
OID: the object identifier
An OID is the numeric address of one object in that tree, written as dotted integers: 1.3.6.1.2.1.2.2.1.10 is the inbound byte counter of an interface (ifInOctets), and 1.3.6.1.4.1.9 is the start of everything Cisco. An OID lookup, by hand or with a tool, turns the dotted number into the name and the description from the MIB, which is the only way to know what you are looking at. The vendor prefix 1.3.6.1.4.1. followed by an enterprise number tells you whose branch you are in before you have found the file.
Where MIB files come from: downloads, lookup, and the compiled set
Standard MIBs ship with every SNMP toolkit. Vendor MIBs come from the vendor's support site, usually as a zip of dozens of interdependent files, and a MIB downloader or lookup site exists for the ones that have gone missing. A monitoring tool that ships a compiled MIB set spares you most of this: the common vendors' counters are already named, and you upload a MIB file only for the device the set does not know. The OIDs and MIBs guide goes through reading a MIB file and translating numeric OIDs by hand.
SNMP versions: v1, v2c and v3, and which to use
| Version | Year | Security | What it added | Verdict today |
|---|---|---|---|---|
| SNMP v1 | 1988 | A "community name" sent in clear text | The original five verbs, 32-bit counters | Legacy only; the 32-bit counters wrap in minutes on a gigabit link |
| SNMP v2c | 1996 | The same community name, still in clear text | GETBULK, 64-bit counters, informs | What most networks actually run; acceptable on a management VLAN with ACLs, read-only |
| SNMP v3 | 2002 | Users with authentication (SHA) and privacy (AES) per user | Real security; the same data model | The right choice for anything that crosses an untrusted segment, and the only choice auditors accept |
SNMP v2 vs v3: the practical difference
The data is identical; what changes is the envelope. In v2c the password is a community string such as public (the default on far too many devices) sent in plain text in every packet, so anyone who can capture one packet can read every counter. In v3 each manager has a user name, an authentication key and a privacy key, and the packet is signed and optionally encrypted. The cost is configuration: v3 config means creating the user on every device, choosing SHA for authentication and AES for privacy ("authPriv"), and typing the same credentials into the monitoring server. The versions guide covers the migration path and the securing SNMP guide covers how attackers actually abuse v2c.
SNMP v3 setup and configuration (config): the four things you choose, and the context name
A user name; a security level (noAuthNoPriv, authNoPriv or authPriv, and only the last is worth having); an authentication protocol and passphrase (SHA, or SHA-256 where the device supports it, never MD5 for new work); and a privacy protocol and passphrase (AES, never DES). Some devices also expose a context name and an engine ID, which the manager discovers on first contact and which you only type by hand when a device has been cloned from another and kept its twin's ID.
Traps and informs: port 162 and the trap receiver
Polling asks; traps tell. A trap is a message the device sends on its own when something happens: a link went down, a power supply failed, a fan stopped, the configuration was saved. It goes to the manager's SNMP trap port, UDP 162, where a trap receiver turns it into an alert. An inform is a trap with an acknowledgement, added in v2c, so the device knows the manager received it and can resend if not. Traps are fast and cheap and easy to lose; polling is slower and certain. Serious monitoring uses both, and the traps versus polling guide explains what belongs in each channel and the classic missed-trap failure modes.
The SNMP port number: an agent receives requests on UDP port 161
Every SNMP agent listens on UDP 161 and every trap receiver on UDP 162; neither needs TCP. If a firewall between the manager and the device blocks 161, polling times out silently, which is the first thing to check when a device that answers snmpwalk from one machine does not answer from the monitor.
MIB: abbreviation, acronym, and the MIB codes you will see
MIB abbreviates Management Information Base. The “codes” are the OIDs, the dotted numbers that address each object, and the module names such as IF-MIB, HOST-RESOURCES-MIB and ENTITY-MIB that group them. A MIB downloader fetches a vendor's modules; a MIB walker or OID locator reads a live device and names what it finds.
SNMP tools by name: client, viewer, checker, enabler, sniffer and scanner
An SNMP client or viewer reads objects from one device by hand; a checker or scanner finds which devices on a subnet answer; an enabler is a vendor's script that turns the agent on; a sniffer captures SNMP packets to see what a manager is asking. A monitoring system does the first three continuously, and the snmpwalk tutorial covers the by-hand versions.
Which layer SNMP works at, and the SNMP messages on the wire
SNMP is an application-layer protocol carried in UDP datagrams. The messages are the GET, GETNEXT, GETBULK, SET, RESPONSE, TRAP and INFORM PDUs, encoded in ASN.1 BER, which is why a packet capture of SNMP needs a decoder to be readable.
What the major security weakness of SNMP v2c is, and what authPriv mode in v3 enables
v2c sends its community string in clear text, so one captured packet gives an attacker read access to every counter on the device, and write access if the read-write community is enabled. authPriv in v3 enables both authentication (the manager proves who it is with a key) and privacy (the payload is encrypted), which closes both holes.
The other words you will meet on day one
| Word | What it means |
|---|---|
| Community name (community string) | The shared password of v1 and v2c. Read-only and read-write communities are separate; the read-write one should usually not exist. |
| Agent | The SNMP service on the device. On Windows and Linux it is an installable service; on network gear it is built in and only needs enabling. |
| Manager / NMS | The monitoring server that polls agents and receives traps; a network management system is a manager with a database, graphs and alerts around it. |
| snmpwalk, snmpget, bulk walk | Command-line tools that read a whole subtree (walk), one object (get), or a subtree in bulk (GETBULK). The snmpwalk tutorial starts from install. |
| Instance | The suffix on an OID that picks one row of a table: ifInOctets.14 is interface index 14. Monitoring a table means monitoring instances, which is why interface names matter. |
| SNMP scanner / viewer / client / enabler | Marketing names for small tools that find SNMP-enabled devices on a subnet, browse their MIBs, or turn the agent on. A real monitoring system includes discovery and a MIB browser. |
| Timeout, retries, counter rollover | The three things that make SNMP numbers go wrong. The troubleshooting guide has the symptom-to-cause table. |
Where to go next
You now know what SNMP is and why every monitoring product starts with it. The next step is practical: read what a device will actually tell you with the snmpwalk tutorial, decide your version policy with v1 vs v2c vs v3, then turn it on everywhere with the setup cookbook. When the numbers look wrong, the troubleshooting guide is the one to open. And when you are ready to monitor rather than read about it, the SNMP monitoring software page describes how SysPeep polls, names and alerts on all of this. The whole series is collected in the SNMP Monitoring pillar.
Put this into practice with SysPeep Monitor
SysPeep speaks SNMP v2c and v3 to the whole switching and routing estate from one Windows service, ships a compiled MIB set that names the common vendors' counters out of the box, receives traps and informs on port 162, and leaves sensors unlimited so nobody rations the counters they watch. Up to 5 devices are free at full depth.
Download Free TrialLearn About SysPeep