An Internet Standard protocol for managing device information on an IP network. First released in 1988 with RFC 1065, 1066 & 1067; These three constitute SNMPv1

  • RFC 1065 — Structure and identification of management information for TCP/IP-based internets
  • RFC 1066 — Management information base for network management of TCP/IP-based internets
  • RFC 1067 — A simple network management protocol SNMP can be used to monitor and configure managed devices in a network. There are two main types of devices in SNMP:
  1. Managed Devices
    • These are devices being managed by SNMP (duh!)
    • Ex.: Routers, switches
  2. Network Management Station (NMS)
    • The device/devices managing the managed devices
    • This is the SNMP ‘server’

Note

Don’t let the ‘Simple’ fool you! There’s nothing simple about later iterations of SNMP… Thankfully, you only need to know some basics of SNMP for a Cisco CCNA exam!


SNMP Operations

There are three main operations used in SNMP:

  1. Managed devices can notify the NMS of events
  2. The NMS can ask the managed devices for information about their current status
  3. The NMS can tell the managed devices to change aspects of their configuration

SNMP Components

flowchart TB

    app[SNMP Application]

    man[SNMP Manager]

    ag1[SNMP Agent]

    ag2[SNMP Agent]

    mb1[Management Information Base]

    mb2[Management Information Base]

  

    subgraph NMS

        app <--> man

    end

  

    subgraph md1 [Managed Device 1]

        ag1 <--> mb1

    end

  

    subgraph md2 [Managed Device 2]

        ag2 <--> mb2

    end

  

    man <-.SNMP Messages.-> ag1

    man <-.SNMP Messages.-> ag2
  • SNMP Manager - the software on the NMS that interacts with the managed devices
    • Receives notifications, sends requests for information, sends configuration changes, etc.
  • SNMP Application - provides an interface for the network admin to interact with
    • Displays alerts, statistics, charts, etc.
  • SNMP Agent - the SNMP software running on the managed devices that interacts with the SNMP Manager on the NMS
    • Sends notifications to/receives messages from the NMS
  • Management Information System (MIB) - the structure that contains the variables that are managed by SNMP
    • Each variable is identified with an Object ID (OID)
    • Ex.: Interface status, traffic throughput, CPU usage, temperature, etc.

OIDs

SNMP Object IDs (OID) are organized in a hierarchical structure.

Example

(These are not necessarily real or even valid numbers, just for example. You can check out www.oid-info.com for more information on OIDs)


Versions

While many versions have been proposed and even developed, only three major versions have achieved wide-spread use:

  • SNMPv1
    • The original SNMP
  • SNMPv2c
    • Allows the NMS to retrieve large amounts of information in a single request, so it is more efficient
    • ’c’ refers to the ‘community strings’ used as passwords in SNMPv1, remove from SNMPv2, then added back with SNMPv2c
  • SNMPv3
    • A much more secure version of SNMP that supports strong encryption and authentication
    • Whenever possible, this is the version that should be used!

SNMP Messages

Message ClassDescriptionMessages
ReadMessages sent by the NMS to read information from the managed devices.
(i.e. What’s your current CPU usage?)
Get
GetNext
GetBulk
WriteMessages sent by the NMS to change information on the managed devices.
(i.e. Change an IP address)
Set
NotificationMessages sent by the managed devices to alert the NMS of a particular event.
(i.e. Interface going down)
Trap
Inform
ResponseMessages sent in response to a previous message/request.Response

’Read’ Messages

  • Get
    • A request from the manager to the agent to retrieve the value of a variable (OID), or multiple variables. The agent will send a Response message with the current value of each variable
  • GetNext
    • A request sent from the manager to the agent to discover the available variables in the MIB
  • GetBulk
    • A more efficient version of the GetNext message (introduced in SNMPv2)

‘Write’ Messages

  • Set
    • A request from the manager to the agent to change the value of one or more variables. The agent will send a Response message with the new values

’Notification’ Messages

  • Trap
    • A notification sent from the agent to the manager. The manager does not send a Response message to acknowledge Trap messages, so they are considered ‘unreliable’
  • Inform
    • A notification message that is acknowledged with a Response message
    • Originally used for communications between managers, but later updates allow agents to send Inform messages too

’Response’ Messages

  • Response
    • A message send to acknowledge receipt of a previous message/request

Configuration

Cisco IOS

  • (config)#snmp-server contact email-address
    • Optional information
  • (config)#snmp-server location location
    • Optional information
  • (config)#snmp-server community string {ro | rw}
    • Configure SNMP community strings (passwords). ro = read only = no ‘Set’ messages; rw = read/write = can use ‘Set’ messages
    • There are default public (ro) and private (rw) community strings, but they should be avoided as they are less secure.
  • (config)#snmp-server host ip-address version version community-string
    • Specify the NMS, SNMP version, and community
  • (config)#snmp-server enable traps {traps}
    • Configure the Trap types to send to the NMS