This document provides an introduction to SNMP (Simple Network Management Protocol). It describes the basic concepts of SNMP including the management components of managers, agents, MIB (Management Information Base) and network management protocol. It also covers SNMP architectural model, services, PDUs (protocol data units) and standards. Key terms like OID (object identifier), data types and MIB structure are defined.
6. SNMP Concepts SNMP: Simple Network Management Protocol De facto standards of network management for TCP/IP networks (Internet) IAB recommends all IP & TCP implementations should be network manageable. That is, all TCP/IP network devices should support SNMP. IAB: Internet Activities Board
7. SNMP Architectural Model Key Components One or more Management Stations Perform management applications, i.e, Monitor & Control. Multiple Network Elements hosts, routers, gateways, ..., which each contain an Agent . Network Management Protocol Exchange network management information.
8. SNMP Architectural Model ( cont. ) Manager Agent Agent . . . Management Station Host Router Network Elements (NEs) Network Management Protocol SNMP Network 網路介面 SNMP UDP IP 網路介面 SNMP UDP IP 網路介面 SNMP UDP IP
11. Management Components Management Station (Manager) Network management applications. Provide an interface which the human network manager can monitor and control the network. Agent Network devices should be equipped with agent software so that they can be managed from a management station. Responds to requests for information from managers. Responds to requests for actions from managers. May asynchronously provide managers with important but unsolicited information.
12. Management Components (cont.) Network Management Protocol Communication protocol between managers and agents NM protocol provides a standard way to exchange management information between managers and agents. Management Information Base (MIB) A collection of Managed Objects. The resources to be managed are represented as objects, called Managed Objects (MOs).
13. Management Information Base (MIB) Each resource to be managed is represented by an object, called managed object (MO). The MIB is a structured collection of MOs. Essentially, each MO is a data variable. Each agent in an NE maintains an MIB. Monitor: by reading the values of MOs in the MIB. Control: by modifying the values of MOs in the MIB. 網路介面 SNMP UDP IP Agent Managed Resources MIB NE: Network Element
14. SNMP Services Four Services Get, Set, GetNext, Trap Five SNMP PDUs GetRequest, SetRequest, GetNextRequest, GetResponse, Trap Manager Agent(s) PDU: Protocol Data Unit Get, Set, GetNext Request Get Response Trap
15. SNMP Services Get GetNext Set Trap Get Request Get Response Manager Agent GetNext Request Get Response Manager Agent Set Request Get Response Manager Agent Trap Request Manager Agent
16. SNMP Services ( cont. ) Get Request: Retrieve the values of objects in the MIB of an agent. Get-Next Request: Retrieve the values of the next objects in the MIB of an agent. Set Request: Update the values of objects in the MIB of an agent. Trap Request Report extraordinary events to the manager.
17. Get-Next Request In SNMP, Only leaf objects have values. * :Non-Leaf Object :Leaf Object 1 2 3 4 5 6 MIB Tree :
18. Default UDP Ports for SNMP 網路介面 SNMP UDP IP Manager Management Station Network Elements (NEs) 網路介面 SNMP UDP IP Agent 162 Any 161 Any
19. SNMP Standards SNMP Protocol (Std 15) RFC1157 : Simple Network Management Protocol. Structure of Management Information (SMI) (Std 16) RFC1155 : Structure and Identification of Management Information for TCP/IP-based Internets. RFC1212 : Concise MIB Definitions. MIB-II (Std 17) RFC1213 : Management Information Base for Network Management of TCP/IP-based Internets: MIB-II.
20. 2. Management Information Base Structure of Management Information (SMI) Set of rules on how managed objects should be defined. Objects are defined using Abstract Syntax Notation One ASN.1 (ITU-T X.208 / ISO 8824) MIB The collection of all defined objects Contains hierarchically organized variables corresponding to managed objects. MIB-II, RMON MIB , Bridge MIB, Repeater MIB, X.25 MIB, FDDI MIB, Token Ring MIB, ...
21. Object Identifier Object Identifier (OID): Global identifier for a particular object type. An OID consists of a sequence of integers, which specify the position of the object in the global object identifier tree. root ccitt iso joint-iso-ccitt directory 0 1 2 std reg authority member body org 0 1 2 3 dod internet 6 1 1 2 3 4 mgmt experimental private MIB II system 1 interface 2 at 3 IP 4 ICMP 5 TCP 6 UDP 7 EGP 8 Trans. 10 SNMP 11 1 1 enterprises 1.3.6.1.2.1.2 1.3.6.1.4.1 1.3.6.1.2.1 MIB II interface enterprises
22. Private MIB Registration Companies can register their private MIB extensions in the global MIB tree by contacting the Internet Assigned Numbers Authority (IANA). http://www.iana.org/ Currently assigned enterprise subtrees ftp://ftp.isi.edu/in-notes/iana/assignments/enterprise-numbers
28. Concise MIB Definition (RFC 1212) OBJECT-TYPE MACRO ::= BEGIN TYPE NOTATION ::= "SYNTAX" type(ObjectSyntax) "ACCESS" Access "STATUS" Status DescrPart ReferPart IndexPart DefValPart VALUE NOTATION ::= value (VALUE ObjectName) DescrPart ::= "DESCRIPTION" value (description DisplayString) | empty ReferPart ::= "REFERENCE" value (reference DisplayString) | empty IndexPart ::= "INDEX" "{" IndexTypes "}" | empty IndexTypes ::= IndexType | IndexTypes "," IndexType IndexType ::= value (indexobject ObjectName) | type (indextype) DefValPart ::= "DEFVAL" "{" value (defvalue ObjectSyntax) "}" | empty END
29. Examples: MIB II (RFC 1213) ifEntry OBJECT-TYPE SYNTAX IfEntry ACCESS not-accessible STATUS mandatory DESCRIPTION "An interface entry containing objects at the subnetwork layer and below for a particular interface." INDEX { ifIndex } ::= { ifTable 1 } ifTable OBJECT-TYPE SYNTAX SEQUENCE OF IfEntry ACCESS not-accessible STATUS mandatory DESCRIPTION "A list of interface entries. The number of entries is given by the value of ifNumber." ::= { interfaces 2 } mib-2 OBJECT IDENTIFIER ::= { mgmt 1 } system OBJECT IDENTIFIER ::= { mib-2 1 } interfaces OBJECT IDENTIFIER ::= { mib-2 2 } at OBJECT IDENTIFIER ::= { mib-2 3 } ip OBJECT IDENTIFIER ::= { mib-2 4 } icmp OBJECT IDENTIFIER ::= { mib-2 5 } tcp OBJECT IDENTIFIER ::= { mib-2 6 } udp OBJECT IDENTIFIER ::= { mib-2 7 } egp OBJECT IDENTIFIER ::= { mib-2 8 } -- cmot OBJECT IDENTIFIER ::= { mib-2 9 } transmission OBJECT IDENTIFIER ::= { mib-2 10 } snmp OBJECT IDENTIFIER ::= { mib-2 11 }
30. Identification of Managed Objects Use Object Identifier (OID) OID = Object Type OID . Instance Identifier Object Type OID: Each Object type has a unique OID Instance Identifier: Identify instances of object type E.g .mib-2.interface.ifTable.ifEntry.ifDescr . 2
34. Index in MIB II ifEntry {ifIndex} atEntry {atNetIfIndex, atNetAddress} ipAddrEntry {ipAdEntAddr } ipRouteEntry {ipRouteDest} ipNetToMediaEntry {ipNetToMediaIfIndex, ipNetToMediaNetAddress} tcpConnEntry {tcpConnLocalAddress, tcpConnLocalPort, tcpConnRemoteAddress, tcpConnRemotePort} udpEntry {udpLocalAddress, udpLocalPort} egpNeighEntry {egpNeighAddr}
35. Index Example To get the state of the TCP connection: 10.144.18.118:1200 ===> 10.144.14.40:1600 Use snmp_get_req. to get the “tcpConnState” of the tcpConnTable in MIB II. tcpConnState ==> .1.3.6.1.2.1.6.13.1.1 .1.3.6.1.2.1.6.13.1.1.10.144.18.118.1200.10.144.14.40.1600
36. MIB II System Group Provide general information about the managed system. Interfaces Group Contains generic information about the physical interfaces. Address-Translation Group Contains information about the mapping between network addresses and physical addresses for each physical interface. IP Group Contains information about the implementation and operation of IP at the managed system. ICMP Group Contains information about the implementation and operation of ICMP at the managed system.
37. MIB-II ( cont. ) TCP Group Contains information about the implementation and operation of TCP at the managed system. UDP Group Contains information about the implementation and operation of UDP at the managed system. EGP Group Contains information about the implementation and operation of EGP at the managed system. Transmission Group Provides details about the underlying transmission media for each interface. SNMP Group Provides the statistics of SNMP operations at the managed system.
38. IETF MIBs 1213 MIB-II 1316 Character Stream 1317 RS-232-like Hardware 1471 PPP 1513 RMON for Token Ring 1757 RMON 2021 RMON-II .....
39. 3. SNMP SNMP Message Version Identifier Community Name Protocol Data Unit The length of SNMP messages should not exceed 484 octets. Message ::= SEQUENCE { version INTEGER {version-1(0)}, community OCTET STRING, data ANY } Version Community SNMP PDU
40. SNMP Authentication Community Relationship between an Agent and Managers. Community Name Used to validate the SNMP messages. SNMP Password. Default ‘Get’ community name: “public”. Authentication Failure Agent sends “ Authentication Failure Trap ” to Manager.
41. SNMP PDU PDU ::= SEQUENCE { request-id INTEGER, error-status INTEGER { noError(0), tooBig(1), noSuchName(2), badValue(3), readOnly(4) genErr(5)}, error-index INTEGER, variable-bindings SEQUENCE OF { name ObjectName, value ObjectSyntax } } GetRquest : GetNextRequest : GetResponse : SetRequest : Trap : [0] PDU [1] PDU [2] PDU [3] PDU [4] Trap-PDU Five SNMP PDUs: PDU: Protocol Data Unit
42. SNMP PDU ( cont. ) PDU type request-id 0 0 variable-bindings GetRequest, GetNextRequest, SetRequest PDU type request-id error-status error-index variable-bindings GetResponse variable-bindings name value name value name value . . .
44. Trap-PDU Trap-PDU ::= [4] IMPLICIT SEQUENCE { enterprise OBJECT IDENTIFIER, agent-addr NetworkAddress, generic-trap INTEGER { coldStart(0), warmStart(1), linkDown(2), linkUp(3), authenticationFailure(4), egpNeighborLoss(5), enterpriseSpecific(6)}, specific-trap INTEGER, time-stamp TimeTicks, variable-bindings VarBindList } Enterprise: Type of Object generating trap. Agent Address: Address of object generating trap. Generic Trap: Generic trap type. Specific Trap: Enterprise specific trap. Time Stamp: Time elapsed between the last initialization of the network entity and the generation of the trap. Variable Bindings “ Interesting” information PDU type enterprise agent-addr generic - trap variable-bindings specific - trap time-stamp
46. How does a Manager do? Translates Internal Data to ASN.1 Format Translates ASN.1 Package to Internal Data Format NM Application NM Application Agent Agent Manager Sends Request PDU to Agent Received Response PDU from Agent
47. How does an Agent do? From Manager To Manager Agent Received SNMP Request PDU from Manager Translates ASN.1 Structure to Internal Data Maps MIB Variables to Internal Variables Sends SNMP Response PDU to Manager Translates Response PDU to ASN.1 Format Implement SNMP Request to Set or Get MIB Value
48. Main Loop of Agent Agent waits for an incoming datagram in Port 161 Reads the datagram from UDP and notes the transport address of the sending entity. Increments the QUANTUM to keep track of the logical request-id being processed by agent De-serializes the datagram into an ASN.1 structure. If error occurs, log error and discard packet. The ASN.1 structure is translated into SNMP message. If error occurs, log error and discard packet. Check on VERSION-NUMBER field. If error occurs, log error and discard packet.
49. Main Loop of Agent (cont.) Community name is looked up. If community is unknown to agent, agent send AUTHENTICATION trap to Manager station in Port 162; log error and discard packet. Agent loops through list of variables in the request. If no prototype is found, return a GET-RESPONE with error noSuchName and discard package. Once prototype is fund, operation is checked against community profile. If mismatch occurs, return get-respone with error noSuchName or readOnly and discard package. Otherwise, agent invokes access routine to perform the desired operation.
50. What's New in SNMPv2 No more Trap PDU, 3 New PDUs: getBulkReq, InformReq, SNMPv2-Trap Added Security 18 Error Status Values SNMPv2 SMI / SNMPv2 MIB M-to-M Communications Table Operations ...
51. 4. SNMP Application Examples SNMP Commands snmpget [options] node variable [...] query a node using SNMP Get request snmpnext [options] node variable [...] query a node using SNMP GetNext request snmpwalk [options] node variable query a node repeatedly using SNMP GetNext/GetBulk requests snmptrap [-d] [-p port] [-c community] node enterprise agent-addr generic-trap specific-trap time-stamp variable type value [variable type value...] issue an SNMP Version 1 Trap options:[-d] [-t timeout] [-r retries] [-p port] [-c community] [-v version]
56. Get System Information Get “System Group” of MIB II Use get_request or get_next_request sysDescr .1.3.6.1.2.1.1.1.0 sysObjectID .1.3.6.1.2.1.1.2.0 sysUptime .1.3.6.1.2.1.1.3.0 sysContact .1.3.6.1.2.1.1.4.0 sysName .1.3.6.1.2.1.1.5.0 sysLocation .1.3.6.1.2.1.1.6.0
57. Get Interface Information Get “Interface Group” of MIB II Repeatedly Use “get_next_request” Note: We don’t know the ifIndex values in ifTable. First get the next object of .ifTable.ifEntry.0 Then repeatedly “get_next” Until the whole subtree is visited.
58.
59. Traffic Monitoring Get “ifInOctets” and “ifOutOctets” of MIB II Interface Group t 1 : C 1 t 2 : C 2 (C 2 - C 1 ) 8 (t 2 - t 1 ) Bandwidth 100% Utilization (%) =
60.
61. 6. Reference The Simple Book, marshall T.Rose, Prentice-Hall Inc. SNMP, SNMPv2 and RMON: The Practical Guide to Network Management, Willeam Stallings SMI; http://ds.internic.net/rfc/rfc1155.txt Concise MIB Format; http://ds.internic.net/rfc/rfc1212.txt SNMP; http://ds.internic.net/rfc/rfc1157.txt MIB II; http://ds.internic.net/rfc/rfc1213.txt Trap Format; http://ds.internic.net/rfc/rfc1215.txt ASN.1 and BER; ITU-T X.208, X.209
63. SNMPv3 An Architecture for Describing Internet Management Frameworks Local Processing Model for version 3 of the Simple Network Management Protocol (SNMPv3) Message Processing and Control Model for version 3 of the Simple Network Management Protocol (SNMP) User-based Security Model for version 3 of the Simple Network Management Protocol (SNMPv3) View-based Access Control Model (VACM) for version 3 of the Simple Network Management Protocol (SNMP) User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)
65. Appendix: ASN.1 Concepts ASN.1: Abstract Syntax Notation One ISO/ITU-T Standards: ISO 8824/ITU-T X.208 Abstract Syntax: Use a syntax to define data/data structure independent of machine-oriented structures and restrictions. Use in SNMP Define SNMP PDU format Define management information (MIB)
66. ASN.1 Reserved Words All reserved words MUST be upper case BOOLEAN INTEGER BIT STRING OCTET NULL OF SEQUENCE SET IMPLICIT CHOICE ANY EVTERNAL OBJECT END IDENTIFIER OPTIONAL DEFAULT TRUE COMPONTS FALSE BEGIN
67. What are defined using ASN.1 Types: data structures e.g. Counter, Gauge, IpAddess, ... Values: instances (variables) of a type e.g. sysContact, ifTable, ifSpeed, ... Macros: used to change the actual grammar of ASN.1 e.g. OBJECT-TYPE, ACCESS, ...
68. Modules Module: A collection of ASN.1 descriptions Module Structure <module name> DEFINITION ::= BEGIN <module body> END Example EmptyModule DEFINITION ::= BEGIN END
69. Tags and Types Tags Every type defined with ASN.1 is assigned a tag Tag = Class + Number Class: (Bit 8,7 in BER tag) Universal 0 0 Application 0 1 Context-specific 1 0 Private 1 1 Number: non-negative Integer BER: Basic Encoding Rules
70. Tags and Types (cont.) Universal Tag ASN.1 Type 1 BOOLEAN 2 INTEGER 3 BIT STRING 4 OCTET STRING 5 NULL 6 OBJECT IDENTIFIER 7 ObjectDescriptor 8 EXTERNAL 9 REAL 10 ENUMERATED 12-15 Reserved 16 SEQUENCE, SEQUENCE OF 17 SET, SET OF Universal Tag ASN.1 Type 18 NumericString 19 PrintableString 20 TeletexString 21 VediotextString 22 IA5String 23 UTCTime 24 GeneralizeTime 25 GraphicString 26 VisssibleString 27 GeneralString 28 CharacterString 29-... Reserved
71. Values in ASN.1 General format of a value assignment <valuereference> <type> ::= <value> Examples: BOOLEAN Married ::= BOOLEAN currentStatus Married ::= FALSE INTEGER Color ::= INTEGER{red (0), blue (1), yellow (2)} defaultColor Color ::= 1 defaultColor Color ::= blue
72. Basic Encode Rules BER A transfer syntax notation ISO/ITU-T Standards: ISO 8825/ITU-T X.209 Values from any abstract syntax defined using ASN.1 can be encoded with BER BER uses Tag, Length, Value (TLV) encoding Tag : “identifier”, Length : length of content, Value : “contents” Each value may itself be made up of one or more TLV-encoded values T T L T L V V V L