SNMP stands for Simple Network Management Protocol. Its name itself defines its function- network management. In simpler words, SNMP is a network management protocol that is used to monitor and manage the network devices (like switches, routers, printers). It works on application layer.
How SNMP works? To understand this, first you have to understand the SNMP manager, SNMP agent and MIB and SNMP messages.
SNMP Manager: SNMP manager is an application running on a PC or server from where network devices are managed. This host, on which SNMP manager application is running, is known as network management station (NMS).
SNMP Agent: SNMP agent is a software running inside each device (router, switch, and so on) along with the information that describes the device’s configuration, status, and counters. This information is stored in a database that is known as Management Information Base (MIB).
Inside MIB information is stored in the form of variables and each variable is uniquely identified with their object ID (OID).
SNMP manager uses SNMP protocol to communicate to each SNMP agent.
Mainly there are 4 messages that are used by SNMP agent and manager to exchange information with each other.
SNMP manager messages:
1. SNMP Set: is used to write variables in MIB (to update or add information).
2. SNMP Get: When SNMP manager needs any information from agent side, it sends SNMP Get messages (SNMP Get, SNMP Getnext, SNMP Getbulk).
SNMP Agent Messages:
Trap and inform these 2 messages are sent by the agent to communicate with SNMP manager. These messages are normally appeared in the form of notification, that’s why also known as SNMP agent notifications.
Trap and Inform both are used to send notification (function-wise both are same). The only difference is there is no application recovery in trap message. It means, if packet lost, it is lost, there is no acknowledge in return (like packet is lost please resend the packet).
While in Inform message, if a packet lost, there is an acknowledge message is generated in response.
Inform and Trap both use UDP as the transport protocol.
How SNMP works?
Let’s understand how SNMP works with the help of above example.
1. Router R1 (SNMP agent) interface Gi0/0 fails.
2. To notify SNMP manager, it sends a SNMP trap message. My Gi0/0 interface failed! Have a look and please fix it.
3. When SNMP manager receives this notification, it sends a text message to network support team to fix this issue and highlights the down link.