Introduction to SNMP

1. Introduction to SNMP

Simple Network Management Protocol (SNMP) is a protocol used for monitoring and managing devices on a network. It allows network administrators to collect information about devices, monitor their status, and even control them remotely. SNMP simplifies the management of various devices like routers, switches, and servers.

Illustration of the simple network management protocol showing an NMS server using SNMP to monitor and manage network devices like routers through a switch.

Think of the SNMP Server as a doctor monitoring the health of their patients (the network devices).

Purpose and Importance of SNMP in Networking

SNMP plays a vital role in ensuring the health and performance of a network. Its main benefits include:

Centralized Monitoring: Administrators can oversee the health of all devices from a single management station.
Example: An administrator can monitor the CPU usage of routers across the network from one tool.

Real-Time Alerts: SNMP sends immediate alerts (Traps) to notify administrators of critical events like a failed interface or high CPU usage.
Example: If a switch port goes down, the SNMP Manager receives an alert in real time, enabling quick action.

Remote Configuration: Administrators can modify device configurations without physical access.
Example: An administrator can change a router’s hostname remotely through the SNMP Manager.

2. SNMP Architecture

The NMS (Network Management Station) acts as the central system that communicates with network devices to monitor and manage them. It sends requests for data (such as CPU usage, memory, traffic) and can issue commands to adjust configurations.

The SNMP Agent is software running on each managed network device (e.g., routers, switches) that collects and provides data requested by the Manager. It also sends alerts (Traps or Informs) to notify the Manager of critical events, such as a failed interface or high CPU usage.

SNMP architecture diagram showing how a simple network management protocol manager communicates with an SNMP agent on a managed device using MIBs to monitor and control network elements.

Management Information Base (MIB)

The MIB is a hierarchical database that organizes device information accessible via SNMP. It serves as a reference for retrieving or updating network metrics and configurations.

Structure:

  • The MIB is organized in a tree-like hierarchy.
  • Standardized branches store general data like system uptime.
  • Vendor-specific branches (e.g., Cisco-specific metrics) store manufacturer-specific information.

Example MIB Tree

MIB-2 (1.3.6.1.2.1)
├── system (1)                       // General device information
│   ├── sysDescr (1.3.6.1.2.1.1.1)   // Device description
│   ├── sysUpTime (1.3.6.1.2.1.1.3)  // Device uptime
├── interfaces (2)                   // Network interfaces
│   ├── ifNumber (1.3.6.1.2.1.2.1)   // Number of interfaces
│   └── ifTable (1.3.6.1.2.1.2.2)
└── enterprises (4.1)
    └── Cisco (9)                    // Vendor-specific data

Function: The MIB enables consistent device management by defining where each type of data (e.g., CPU usage, memory status) is stored. This standardization ensures compatibility across devices from different vendors.

Object Identifiers (OIDs)

OIDs are unique numerical addresses used to identify data points in the MIB (e.g., system uptime). Think of an OID as the exact “address” for retrieving specific information.

Format: OIDs are dot-separated sequences (e.g., 1.3.6.1.2.1.1.3 for system uptime). Each level in the sequence represents a branch in the MIB tree.

Function in SNMP: The SNMP Manager sends requests referencing OIDs to retrieve or modify data. The Agent retrieves the corresponding data from the MIB and sends it back.

Diagram showing how the simple network management protocol uses OIDs, with an SNMP manager sending a GET request to an SNMP agent to retrieve data from the MIB on a managed device.

Example: Using OIDs in SNMP

🔹 Scenario: A network administrator wants to check the uptime of a router.

  1. The SNMP Manager sends a Get Request for OID 1.3.6.1.2.1.1.3.
  2. The SNMP Agent on the router retrieves the uptime value from its MIB.
  3. The Agent responds with the uptime value, which the Manager displays for analysis.

This process ensures precise and efficient monitoring across network devices.

3. Basic SNMP Operations

SNMP (Simple Network Management Protocol) allows the Manager to interact with network devices (Agents). Here are the main SNMP Message Types used for network management:

SNMP Message Types

  • Get: Retrieves specific information from an SNMP Agent.
  • GetNext: Retrieves the next piece of data in a sequence, useful for lists.
  • Set: Modifies a configuration parameter remotely.
  • Trap: Sends an instant alert when a critical event occurs.

SNMP Get Request

The Get Request operation is initiated by the SNMP Manager to retrieve specific data from an SNMP Agent on a network device. This is the most common operation and is used to check various parameters, such as device status, resource usage, and network performance.

💡 Example: A network administrator wants to monitor CPU usage on a router. By sending a Get Request to the router’s SNMP Agent, the administrator can retrieve the current CPU load.

Illustration of a simple network management protocol Get Request, where the SNMP manager sends a request to the SNMP agent on a managed device and receives a response from the MIB.

SNMP Set Request

The Set Request allows the SNMP Manager to change a configuration parameter on a network device via the SNMP Agent. Unlike the Get Request, which only retrieves data, the Set Request can alter device settings directly.

💡 Example: The SNMP Manager sends a Set Request to modify the hostname of a router, changing it from Router1 to BranchRouter1. This operation updates the device configuration, allowing it to reflect its new role in the network topology.

Diagram showing a simple network management protocol Set Request where the SNMP manager modifies device configuration by sending a command to the SNMP agent via MIBs on a managed device.

SNMP Traps

SNMP Traps are alerts sent by the SNMP Agent to the SNMP Manager when specific events occur, such as a device rebooting, an interface going down, or a high CPU load. Unlike Get and Set Requests, Traps are initiated by the Agent, providing real-time updates without needing constant checks from the SNMP Manager.

💡 Example: When an interface on a switch goes down, the SNMP Agent on the switch sends a Trap to notify the SNMP Manager, allowing the administrator to investigate the issue quickly.

Illustration of a simple network management protocol trap message where the SNMP agent on a managed device sends an alert to the SNMP manager without waiting for a request.

Polling vs. Traps

SNMP provides two distinct mechanisms for monitoring device status. Here’s how they compare:

MechanismTriggerCommunicationBest Use Case
PollingManager requests data periodicallyManager-initiatedRoutine performance monitoring
TrapsEvent-driven notification by AgentAgent to Manager (one-way)Immediate event notifications

Summary of SNMP Operations

The following table summarizes SNMP operations, their purposes, and typical use cases:

OperationPurposeExampleUse Case
GetRetrieve specific informationChecking CPU load on a routerRoutine monitoring
GetNextRetrieve sequential data itemsQuerying interfaces on a switchDetailed data retrieval
SetChange device configurationAdjusting alert thresholdsRemote configuration
TrapReal-time alert for critical eventsNotifying an interface going downImmediate alerts without constant polling

4. SNMP Configuration

Basic SNMP Setup on Cisco Routers

Configuring SNMP on Cisco routers like R1 is straightforward and involves defining a community string to control access. Community strings act as passwords that determine the level of SNMP access—either Read-Only (RO) or Read-Write (RW).

Network diagram showing basic simple network management protocol configuration on a Cisco router using an SNMP community string between an NMS server and a managed device on the 192.168.1.0/24 network.

🔹 Step 1: Define Community Strings

Read-Only (RO): Recommended for basic monitoring, allowing the SNMP Manager to retrieve information without making changes.

🔹 Command:

R1(config)# snmp-server community public RO

This command creates an SNMP community named “public” with Read-Only (RO) access. The SNMP Manager can view router data but cannot modify settings.

Read-Write (RW): Allows the SNMP Manager to both view and modify data on the router. Use this cautiously, as it grants permission to change configurations.

🔹 Command:

R1(config)# snmp-server community private RW

This command creates an SNMP community named “private” with Read-Write (RW) access, allowing the SNMP Manager to make configuration changes on R1.

🔹 Step 2: Configure SNMP Ports

For SNMP to function across networks and through firewalls, understanding the default ports is essential:

  • UDP Port 161: Used for standard SNMP operations, such as Get and Set requests.
  • UDP Port 162: Used for SNMP Traps, allowing agents to send event notifications to the SNMP Manager.

⚠️ Note: These ports are relevant for firewall configurations, as they need to be open to allow SNMP messages to pass between the SNMP Manager and R1.

🔹 Step 3: Verify SNMP Configuration

After setting up SNMP, use the show snmp community command to check the current configuration, ensuring that community strings are correctly defined and access levels are accurate.

🔹 Command:

R1# show snmp community
Community name: public
Community access: RO
Community name: private
Community access: RW

Key Takeaways:

  • The public community string has Read-Only (RO) access, limiting the SNMP Manager to view-only permissions.
  • The private community string has Read-Write (RW) access, allowing the SNMP Manager to modify configurations on R1.

5. Conclusion

In this course, we covered the fundamental SNMP operations, including Get, GetNext, Set, and Trap messages. We also discussed the difference between polling and traps and how SNMP is configured on Cisco routers.

Next Steps

In the next lesson, we will explore SNMPv2, including its enhancements over SNMPv1, additional message types, and improved performance features.