Introduction to SNMP
After I joined Ericsson, I run into many internet protocols every now and then which I have never heard or use before.
SNMP is one of them.
This post is purposed to summarize some basics about SNMP for newbie to SNMP.
What is SNMP?
Simple Network Management Protocol(SNMP) is an application-layer protocol defined by the Internet Architecture Board(IAB) in RFC1157 for exchanging management information between network devices. It is a part of the Transmission Control Protocol/Internet Protocol(TCP/IP) protocol suite. SNMP is one of widely accepted protocols used to manage and monitor network elements. Most of the professional-grade network elements come bundled with and SNMP Agent. These Agents have to be enabled and configured to communicate with the Network Management System(NMS).
SNMP basic components and its functions
The SNMP architecture consists of:
* The SNMP Manager * A managed device * An SNMP Agent * Management Information Base(MIB)
The SNMP Manager - (Usually the Network Management System - NMS) communicate with the multiple SNMP Agents implemented in the network.
A Managed device - or the network element is a part of the network that requires some form of monitoring and management e.g. routers, switches, servers, workstations, printers, UPSs, etc..
An SNMP Agent - is a program that is bundled within the managed device. Enabling this agent allows it to collect the Management Information Base from the device locally to make it available to the SNMP Manager on request. These Agents could be standard(e.g. Net-SNMP) or specific to a vendor(e.g.HP Insight Agent)
Management Information Base/Database - The commonly shared database between the Agent and Manager is called MIB. In short, MIB files are the set of questions that the SNMP Manager can ask the Agent. The Agent collects theses data locally and stores it, as defined in the MIB. The MIBs contain a standard set of statistical and control values defined for the managed devices on a network. The SNMP protocol also allows the extension of these standard and private questions for every type of Agent.
Basic Commands of SNMP
The simplicity involved in the information exchange has made SNMP one of the most widely accepted management protocols. The main reason being a concise set of commands:
GET : The GET operation is a request sent by the Manager to the managed device. It is performed to retrieve one or more values from the managed device.
GET NEXT: This operation is similar to the GET. The significant difference is that the GET NEXT operation retrieves the value of the next OID in the MIB tree.
. GET BULK: The GET BULK operation is used to retrieve voluminous data from a large MIB table.
SET: This operation is used by the Managers to modify or assign the value to the managed device.
TRAPS: Unlike the above commands which are initiated from the SNMP Manager, TRAPS are initiated by the Agents, it is a signal to the SNMP Manager by the Agent on the occurrence of an event in the managed device.
INFORM: This command is similar to the TRAP initiated by the Agent, additionally INFORM includes confirmation from the SNMP Manager on receiving the message.
RESPONSE: It is the command used to carry back the values or signal of actions directed by the SNMP Manager.
Typical SNMP communication
Being the part of TCP/IP protocol suite, the SNMP messages are wrapped as User Datagram Protocol(UDP) and intern wrapped and transmitted in the Internet Protocol. The following diagram will illustrate the four-layer model developed by Department of Defense(DoD).
GET/GET NEXT/GET BULK/SET
By default, SNMP uses port 161 and TRAP/INFORM uses port 162 for communication.