What is SNMP | SNMP Basics | version | Commands in Cisco and Juniper
What is SNMP?
Simple Network Management Protocol (SNMP) is an application–layer protocol defined by the Internet Architecture Board (IAB) in RFC1157 . It is basically used for exchanging management information between network devices and any snmp enbled devises such as TV, UPS etc . It is a part of Transmission Control Protocol⁄Internet Protocol (TCP⁄IP) protocol suite.
Now a days SNMP is one of the widely accepted protocols to manage and monitor network elements including TV, UPS . Most of the professional–grade network elements come with bundled SNMP agent. These agents have to be enabled and configured to communicate with the network management system (NMS).
SNMP basic components and their functionalities
SNMP consists of the following componemts
SNMP Manager
Managed devices
SNMP agent
Management Information Database Otherwise called as Management Information Base (MIB)
1. SNMP Manager:
A manager or management system is a separate entity that is responsible to communicate with the SNMP agent implemented network devices. This is typically a computer that is used to run one or more network management systems.
The key functions of SNMP Manager’s are —
Queries agents
Gets responses from agents
Sets variables in agents
Acknowledges asynchronous events from agents
2. Managed Devices:
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, TV etc…
3. SNMP Agent:
The agent is a program that is packaged within the network element. Enabling the agent allows it to collect the management information database from the device locally and makes it available to the SNMP manager, when it is queried for. These agents could be standard (e.g. Net-SNMP) or specific to a vendor (e.g. HP insight agent)
The key functions SNMP agent’s are —
Collects management information about its local environment
Stores and retrieves management information as defined in the MIB.
Signals an event to the manager.
Acts as a proxy for some non–SNMP manageable network node.
4. Management Information database or Management Information Base (MIB)
Every SNMP agent maintains an information database describing the managed device parameters. The SNMP manager uses this database to request the agent for specific information and further translates the information as needed for the Network Management System (NMS). This commonly shared database between the Agent and the Manager is called Management Information Base (MIB).
Typically these MIB contains standard set of statistical and control values defined for hardware nodes on a network. SNMP also allows the extension of these standard values with values specific to a particular agent through the use of private MIBs.
In short, MIB files are the set of questions that a SNMP Manager can ask the agent. Agent collects these data locally and stores it, as defined in the MIB. So, the SNMP Manager should be aware of these standard and private questions for every type of agent.
Basic commands of SNMP
The simplicity in information exchange has made the SNMP as widely accepted protocol. The main reason being concise set of commands, here are they listed below:
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 GETBULK operation is used to retrieve voluminous data from large MIB table.
SET: This operation is used by the managers to modify or assign the value of 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.
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 value(s) 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).
SNMP uses port number 161 and TRAP⁄ INFORM uses port 162 for communication.
SNMP versions :
Since the inception SNMP, has gone through significant upgrades. However SNMP v1 and v2c are the most implemented versions of SNMP. Support to SNMP v3 has recently started catching up as it is more secured when compare to its older versions, but still it has not reached considerable market share.
SNMPv1:
This is the first version of the protocol, which is defined in RFCs 1155 and 1157
SNMPv2c:
This is the revised protocol, which includes enhancements of SNMPv1 in the areas of protocol packet types, transport mappings, MIB structure elements but using the existing SNMPv1 administration structure (“community based” and hence SNMPv2c). It is defined in RFC 1901, RFC 1905, RFC 1906, RFC 2578.
SNMPv3:
SNMPv3 defines the secure version of the SNMP. SNMPv3 also facilitates remote configuration of the SNMP entities. It is defined by RFC 1905, RFC 1906, RFC 3411, RFC 3412, RFC 3414, RFC 3415.
Enabling snmp in Cisco Router and Switch
Before starting to commands you people need to know about the basic architecture of Cisco and some basics concepts.
The SNMP managers generally run on dedicated computers called Network Management Systems (NMSs). Routers are one type of agent.When you want the NMS on your network to be able to monitor the device, you need to configure the device to be an SNMP agent:
To enable snmp in Cisco Router,below steps has to be followed:
Create an access list to allow only your network address which is only able to communicate through snmp string.
1. Go to configuration mode and allow your network segments and or any single IP address as shown below-
access-list 99 permit 10.177.2.0 0.255.255.255
access-list 99 permit 10.178.11.11
2. Now create a snmp community string and allow the acl you have created as below-
Cisco>enable
Cisco#
Cisco#conf t
Cisco(Conf)#snmp-server community" X " ro 99
To configure snmp in Juniper router, below steps has to be followed:
To transform the router into an agent, you place the router into an SNMP community using set snmp community public authorization read-only. This command uses one of the common SNMP communities, public.
[edit]
user@junos-device# set snmp community public authorization read-only
The second part of the command defines how the agent (your Junos OS) will respond to requests from the NMS system. An authorization of read-only means that the device will send its information to the NMS, but the NMS will not be able to modify any settings on the device (which it could do if you specified an authorization of read-write).
You can configure the device to respond to multiple communities, each with its own authorization level.You can configure basic information about the device for the NMS to collect when it queries the device, such as the device’s location and description and who to contact about the device. This information corresponds to leaves in the system group in the standard MIB-II, and NMS on the network can collect this information when querying the device (in this case, a router):
[edit snmp]
user@junos-device# set description “Juniper Router”
[edit snmp]
user@junos-device# set location “Assam”
[edit snmp]
user@junos-device# set contact “page-repair@juniper.net,
cell phone +XXXXX”
In normal SNMP operation, the NMS periodically queries the device. If any unexpected events occur on the device, the NMS finds out only after sending a query and examining the response.
However, you can configure the device to send notifications to the NMS when unexpected events occur. This notification means that the NMS, and the people monitoring the NMS, can find out about device problems more quickly. These notifications of serious events are called traps, and you can configure the types of events that trigger the device to send traps.
The following command configures the router to send traps when an NMS system uses the wrong community string when trying to access the device:
[edit snmp]
user@junos-device# set trap-group authentication-traps targets 192.168.10.30
user@junos-device#set trap-group authentication-traps categories authentication
SNMP TRAP CATEGORIES
Configuration Option MIB Description
authentication Standard MIB-II Authentication failures on the agent (the device)
chassis Juniper proprietary Chassis and router environment notifications
configuration Juniper proprietary Configuration mode notifications
Link Juniper proprietary Interface transitions, such as transitioning from up to
down
rmon-alarm Juniper proprietary SNMP remote monitoring (RMON) events
routing Juniper proprietary Routing protocol notifications
startup Standard MIB-II Device reboots (soft/warm and full reboots)
Post a Comment