Simple Network Management Protocol i.e. SNMP is a simple request/response protocol in which SNMP manager communicates with SNMP agents/managed devices using SNMP PDU’s (Packet Data Unit). There are 7 types of SNMP PDUs which are used by SNMP manager to manage SNMP agents. These PDUs are used to communicate with managed devices by retrieving information from them, configuring and monitoring them. Let us now understand what are these 7 PDUs and what are their functions:
1. Get: It is a SNMP request sent by a manager to the agent to fetch the values of a specified variable or a list of variables. In SNMPv1, if in a get request one of the object instance in multiple-attribute request does not exist or is invalid, no response would be given, only an error message would return. In SNMPv2, in such a scenario, response would return for all other object instances or attributes except the invalid value i.e. partial response would be there rather than an error.
2. GetNext: It is a SNMP request sent by a manager to the agent to fetch the value of lexicographically next variable in the MIB (next to the one specified in variable binding). Iterative application of this request allows manager to “walk” through the entire MIB of the agent and determine all attribute names and values the agent support.
3. GetBulk: GetBulk is introduced in SNMPv2. The GetBulk operation is used by the manager to efficiently retrieve large blocks of data, such as multiple rows in a table. If in a GetBulk request one of the object instance in multiple-attribute request does not exist or is invalid, agent provides partial results. GetBulk request has two additional parameters “non-repeators” and “max-repetition”. For an instance if in getbulk pdu, non-repeators is set to n and max-repetitions is set to m, it implies that first n variables specified in variable binding will be treated like a normal getnext request and next variables in variable binding will be treated like getnext operation is repeated m times for each of them.
4. Set: It is a SNMP request sent by a manager to the agent to configure the required parameters on the managed device. If in a set request one of the object instance in multiple-attribute request does not exist or is invalid, value will not be set for any attribute i.e. the operation needs to be atomic.
5. Trap: It is a SNMP message sent by an agent to the manager to notify the manager of a problem with the device. This typically requires each device on the network to be configured to issue SNMP traps to one or more network managers that are awaiting these traps.
6. Informs: Informs are similar to traps but they are acknowledged and apart from being sent by an agent to manager, informs can be sent from one manager to another manager. Informs is introduced in SNMPv2.
7. Response: Respons PDU is the information sent by agent to the manager in response to the performed operation. It returns variable bindings and acknowledgement from agent to manager for Get, GetNext, GetBulk, Set and Inform. Error reporting is provided by error-status and error-index fields.
To understand format of each of the above SNMP PDU, visit here.
Hope you find the information presented here useful. Feel free to leave your footprints for any queries, feedback or suggestions in the comments section below.