Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2....

68
Introduction to SNMP Dr. Mohammad Iqbal Thanks to : Yen-Cheng Chen http://www.im.tj.mcu.edu.tw/~ycchen/

Transcript of Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2....

Page 1: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Introduction to SNMP

Dr. Mohammad Iqbal Thanks to : Yen-Cheng Chen

http://www.im.tj.mcu.edu.tw/~ycchen/

Page 2: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Contents

1. Basic Concepts

2. Management Information Base

3. Simple Network Management Protocol

4. SNMP Application Examples4. SNMP Application Examples

5. Reference

Appendix: ASN.1 Concept

Page 3: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

1. Basic Concepts

FDDI

ManagementStation

ManagementStation

....

...

PC UNIX

NMNMNMNM

3

InternetInternet

RMONDevice

UNIX....

UNIX PC

Firewall/ Router ....

...

PollingPolling NotificationNotification

PC

Page 4: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SNMP Standard

Internet SNMPv1, SNMPv2, SNMPv3

ISO/ITU-T X.700 Series: CMIP/S (Common Management Information Protocol /

4

CMIP/S (Common Management Information Protocol / Service)

ITU-T M.3000 Series: TMN (Telecommunication Management Networks)

Page 5: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SNMP Concepts

SNMP: Simple Network Management Protocol

De facto standards of network management for TCP/IP networks (Internet)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

Page 6: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SNMP Architectural Model

Key Components One or more Management Stations

• Perform management applications, i.e, Monitor & Control.

Multiple Network Elements Multiple Network Elements• hosts, routers, gateways, ..., which each contain an Agent.

Network Management Protocol• Exchange network management information.

Page 7: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SNMP Architectural Model (cont.)

SNMP SNMPSNMP

Manager Agent Agent

ManagementStation Host Router

Network Elements (NEs)

Network

Network

網路介面

SNMP

UDP

IP

網路介面

SNMP

UDP

IP

網路介面

SNMP

UDP

IP

. . .Network

ManagementProtocol

SNMP

Page 8: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Management Components

Manager

Agent

Network Management Protocol

8

Network Management Protocol

Management Information Base (MIB)

Page 9: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Management Components

Management Station (Manager) Network management applications. Provide an interface which the human network manager can

monitor and control the network.

Agent

9

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.

Page 10: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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.

10

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).

Page 11: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 AgentAgent

Managed Resources

MIBMIB 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

AgentAgent

NE: Network Element

Page 12: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SNMP Services

Four Services Get, Set, GetNext, Trap

Five SNMP PDUs GetRequest, SetRequest, GetNextRequest, GetResponse, Trap

Manager Agent(s)

Get, Set, GetNext Request

Get Response

Trap

PDU: Protocol Data Unit

Page 13: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SNMP Services

Get Request

Get ResponseManager Agent

GetNext Request

Get ResponseManager Agent

Get

GetNext

Get

GetNext

13

Get ResponseManager Agent

Set Request

Get ResponseManager Agent

Trap RequestManager Agent

GetNext

Set

Trap

GetNext

Set

Trap

Page 14: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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. 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.

Page 15: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Get-Next Request

MIB Tree :In SNMP, Only leaf objects have values.

:Non-Leaf Object

:Leaf Object1 2 3

4 5 6

Page 16: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Default UDP Ports for SNMP

SNMP

Manager

ManagementStation

Network Elements (NEs)

SNMP

Agent

網路介面

SNMP

UDP

IP

網路介面

SNMP

UDP

IP

162 Any 161 Any

Page 17: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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.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.

http://www.isi.edu/rfc-editor/rfc.html

Page 18: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 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, ...

Page 19: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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-ccitt0 1 2

0 3

directory

std regauthority

memberbody

org0

1 2 3

dod

internet

6

1

12 3 4

mgmt experimental private

MIB II

system1

interface2

at3

IP4

ICMP5

TCP6

UDP7

EGP8

Trans.10

SNMP11

1 1enterprises

1.3.6.1.2.1.2 1.3.6.1.4.1

1.3.6.1.2.1

MIB II

interface

enterprises

Page 20: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Private MIB Registration

Companies can register their private MIB extensions in the global MIB tree by contacting the Internet Assigned Numbers Authority (IANA).

20

Authority (IANA).

http://www.iana.org/http://www.iana.org/

Currently assigned enterprise subtrees

ftp://ftp.isi.edu/inftp://ftp.isi.edu/in--notes/iana/assignments/enterprisenotes/iana/assignments/enterprise--numbersnumbers

Page 21: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SMI (RFC1155)RFC1155-SMI DEFINITIONS ::= BEGINEXPORTS -- EVERYTHING

internet, directory, mgmt, experimental, private,enterprises, OBJECT-TYPE, ObjectName, ObjectSyntax, SimpleSyntax,ApplicationSyntax, NetworkAddress, IpAddress, ApplicationSyntax, NetworkAddress, IpAddress, Counter, Gauge, TimeTicks, Opaque;

internet OBJECT IDENTIFIER ::= { iso org(3) dod(6) 1 }directory OBJECT IDENTIFIER ::= { internet 1 }mgmt OBJECT IDENTIFIER ::= { internet 2 }experimental OBJECT IDENTIFIER ::= { internet 3 }private OBJECT IDENTIFIER ::= { internet 4 }enterprises OBJECT IDENTIFIER ::= { private 1 }

Page 22: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SMI (cont.)OBJECT-TYPE MACRO ::=

BEGINTYPE NOTATION ::=

"SYNTAX" type (TYPE ObjectSyntax)"ACCESS" Access"STATUS" Status

VALUE NOTATION ::= value (VALUE ObjectName)

ASN.1 Macro

VALUE NOTATION ::= value (VALUE ObjectName)Access ::= "read-only"

| "read-write"| "write-only"| "not-accessible"

Status ::= "mandatory" | "optional"| "obsolete"

END

ObjectName ::= OBJECT IDENTIFIER

Page 23: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

OBJECT-TYPE Example

sysDesc OBJECT-TYPE

SYNTAX DisplayString (SIZE (0..255))

ACCESS read-only

23

ACCESS read-only

STATUS mandary

::= { system 1}

Page 24: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

ObjectName ::= OBJECT IDENTIFIER

ObjectSyntax ::=CHOICE {

simple SimpleSyntax,application-wide

ApplicationSyntax}

SimpleSyntax ::=CHOICE {

number INTEGER,

NetworkAddress ::=CHOICE {

internet IpAddress}IpAddress ::=

[APPLICATION 0]IMPLICIT OCTET STRING (SIZE (4))

Counter ::=[APPLICATION 1]IMPLICIT INTEGER (0..4294967295)

Gauge ::=

SMI (cont.)

number INTEGER,string OCTET STRING,object OBJECT IDENTIFIER,empty NULL} }

ApplicationSyntax ::=CHOICE {

address NetworkAddress,counter Counter,gauge Gauge,ticks TimeTicks,arbitrary Opaque}

Gauge ::=[APPLICATION 2]IMPLICIT INTEGER (0..4294967295)

TimeTicks ::=[APPLICATION 3]IMPLICIT INTEGER (0..4294967295)

Opaque ::=[APPLICATION 4] IMPLICIT OCTET STRING

END

Page 25: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Object Syntax Summary

Simple Syntax Integer

Octet String

Object Identifier

Application Syntax Network Address

Counter

Gauge

25

Object Identifier

Null

Gauge

Time Ticks

Opaque

Page 26: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Concise MIB Definition (RFC 1212)

OBJECT-TYPE MACRO ::=

BEGIN

TYPE NOTATION ::=

"SYNTAX" type(ObjectSyntax)

"ACCESS" Access

"STATUS" Status

DescrPart

ReferPart

DescrPart ::=

"DESCRIPTION" value (description DisplayString)

| empty

ReferPart ::=

"REFERENCE" value (reference DisplayString)

| empty

IndexPart ::=

"INDEX" "{" IndexTypes "}" | emptyReferPart

IndexPart

DefValPart

VALUE NOTATION ::=

value (VALUE ObjectName)

"INDEX" "{" IndexTypes "}" | empty

IndexTypes ::=

IndexType | IndexTypes "," IndexType

IndexType ::=

value (indexobject ObjectName) | type (indextype)

DefValPart ::=

"DEFVAL" "{" value (defvalue ObjectSyntax) "}"

| empty

END

Page 27: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Examples: MIB II (RFC 1213)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 }

ifEntry OBJECT-TYPEifTable OBJECT-TYPESYNTAX IfEntryACCESS not-accessibleSTATUS mandatoryDESCRIPTION

"An interface entry containing objects at the subnetwork layer and below for a particular interface."

INDEX { ifIndex }::= { ifTable 1 }

SYNTAX SEQUENCE OF IfEntryACCESS not-accessibleSTATUS mandatory

DESCRIPTION"A list of interface entries. The number of entries is givenby the value of ifNumber."

::= { interfaces 2 }

Page 28: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Identification of Managed Objects

Use Object Identifier (OID)

OID = Object Type OID . Instance Identifier

Object Type OID:

28

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

Page 29: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Two Kinds of Managed Objects

Type-Specific Objects: sysDescr OBJECT-TYPE

SYNTAX DisplayString (SIZE(0..255))

::= {system 1}

OID: mib-2.system.1.0

29

OID: mib-2.system.1.0

Columnar Objects OID:

mib-2.interface.ifTable.ifEntry.ifDescr.2mib-2.interface.ifTable.ifEntry.ifDescr.6mib-2.interface.ifTable.ifEntry.ifType.2mib-2.interface.ifTable.ifEntry.ifType.6

Page 30: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Columnar Objects

ifTable OBJECT-TYPESYNTAX SEQUENCE OF IfEntry…::= { interface 2 }

IfEntry ::= SEQUENCE {ifIndex INTEGER,ifDescr DisplayString,ifType INTEGER,…

30

…}

ifEntry OBJECT-TYPESYNTAX IfEntry…INDEX {ifIndex }::= { ifTable 1}

ifDescr OBJECT-TYPESYNTAX DisplayString (SIZE(0..255))ACCESS read-onlySTATUS madatory

...::= {ifEntry 2}

Page 31: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Columnar Objects

ifIndex ifDescr ifType . . .

1 le0 6 . . .

6 llc0 1 . . .

.ifTable.ifEntry.1 (1.3.6.1.2.1.2.2.1.1)

.ifTable.ifEntry.2 (1.3.6.1.2.1.2.2.1.2)

.ifTable.ifEntry.3 (1.3.6.1.2.1.2.2.1.3)

31

6 llc0 1 . . .

7 lo0 24 . . .

9 le1 6 . . .

1.3.6.1.2.1.2.2.1.3.71.3.6.1.2.1.2.2.1.2.6

Page 32: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Index in MIB II ifEntry {ifIndex} atEntry {atNetIfIndex, atNetAddress}

ipAddrEntry {ipAdEntAddr }

ipRouteEntry {ipRouteDest}

ipNetToMediaEntry {ipNetToMediaIfIndex,

32

ipNetToMediaEntry {ipNetToMediaIfIndex,

ipNetToMediaNetAddress}

tcpConnEntry

{tcpConnLocalAddress, tcpConnLocalPort,

tcpConnRemoteAddress, tcpConnRemotePort}

udpEntry {udpLocalAddress, udpLocalPort}

egpNeighEntry {egpNeighAddr}

Page 33: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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”

33

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

Page 34: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 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.

Page 35: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 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.

Page 36: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

IETF MIBs

1213 MIB-II

1316 Character Stream

1317 RS-232-like Hardware

1471 PPP 1471 PPP

1513 RMON for Token Ring

1757 RMON

2021 RMON-II

.....

Page 37: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

3. SNMP

SNMP Message Version Identifier

Community Name

Protocol Data Unit

Message ::=SEQUENCE {

version INTEGER {version-1(0)},community OCTET STRING,data ANY

}

The length of SNMP messages should not exceed 484 octets.

Version Community SNMP PDU

Page 38: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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.

Page 39: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SNMP PDUPDU ::= SEQUENCE {

request-id INTEGER,error-status INTEGER {

noError(0),tooBig(1),noSuchName(2),badValue(3),readOnly(4)

GetRquest :GetNextRequest :

GetResponse :

[0] PDU[1] PDU[2] PDU

Five SNMP PDUs:

readOnly(4)genErr(5)},

error-index INTEGER,variable-bindings

SEQUENCE OF {name ObjectName,value ObjectSyntax

}}

GetResponse :SetRequest :

Trap :

[2] PDU[3] PDU[4] Trap-PDU

PDU: Protocol Data Unit

Page 40: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

SNMP PDU (cont.)

PDU type request-id 0 0 variable-bindings

GetRequest, GetNextRequest, SetRequest

GetResponse

PDU type request-id error-status error-index variable-bindings

GetResponse

variable-bindings

name value name value name value. . .

Page 41: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Trap-PDUTrap-PDU ::= [4]

IMPLICIT SEQUENCE {enterprise OBJECT IDENTIFIER,agent-addr NetworkAddress,

generic-trap INTEGER {coldStart(0),warmStart(1),linkDown(2),linkUp(3),

Enterprise:Type of Object generating trap.

Agent Address:Address of object generating trap.

Generic Trap:Generic trap type.

Specific Trap:Enterprise specific trap.

linkUp(3),authenticationFailure(4),egpNeighborLoss(5),enterpriseSpecific(6)},

specific-trap INTEGER,time-stamp TimeTicks,variable-bindings VarBindList

}

Enterprise specific trap.

Time Stamp:Time elapsed between the last initialization of the network entity andthe generation of the trap.

Variable Bindings“Interesting” information

PDU type enterprise agent-addr generic-trap variable-bindingsspecific-traptime-stamp

Page 42: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

How does a Manager do?

Translates Internal Data to

ASN.1 Format

Sends RequestPDU to Agent

NMApplication

Agent

Translates ASN.1Package to Internal

Data Format

Received ResponsePDU from Agent

NMApplication

Agent

Manager

Page 43: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

How does an Agent do?

Received SNMP Request PDU from Manager

Translates ASN.1Structure to

Internal Data

Maps MIB Variables to

Internal Variables

FromManager

Sends SNMP Response PDU

to Manager

Translates ResponsePDU to ASN.1

Format

Implement SNMP Request to Set orGet MIB Value

ToManager

Agent

Page 44: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 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.

Page 45: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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.

Page 46: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

What's New in SNMPv2

No more Trap PDU, 3 New PDUs:

getBulkReq, InformReq, SNMPv2-Trap

Added Security

18 Error Status Values 18 Error Status Values

SNMPv2 SMI / SNMPv2 MIB

M-to-M Communications

Table Operations

...

Page 47: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 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]

Page 48: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Example for snmpget>>snmpget -d 10.144.18.118 .1.3.6.1.2.1.1.1.0Transmitted 41 bytes to camry (10.144.18.118) port 161:

Initial Timeout: 0.80 seconds

0: 30 27 02 01 00 04 06 70 75 62 6c 69 63 a0 1a 02 0'.....public...

16: 02 18 bc 02 01 00 02 01 00 30 0e 30 0c 06 08 2b .........0.0...+

32: 06 01 02 01 01 01 00 05 00 -- -- -- -- -- -- -- ................

0: SNMP MESSAGE (0x30): 39 bytes

2: INTEGER VERSION (0x2) 1 bytes: 0 (SNMPv1)2: INTEGER VERSION (0x2) 1 bytes: 0 (SNMPv1)

5: OCTET-STR COMMUNITY (0x4) 6 bytes: "public"

13: GET-REQUEST-PDU (0xa0): 26 bytes

15: INTEGER REQUEST-ID (0x2) 2 bytes: 6332

19: INTEGER ERROR-STATUS (0x2) 1 bytes: noError(0)

22: INTEGER ERROR-INDEX (0x2) 1 bytes: 0

25: SEQUENCE VARBIND-LIST (0x30): 14 bytes

27: SEQUENCE VARBIND (0x30): 12 bytes

29: OBJ-ID (0x6) 8 bytes: .1.3.6.1.2.1.1.1.0

39: NULL (0x5) 0 bytes

Page 49: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Example for snmpget (cont.)Received 69 bytes from camry (10.144.18.118) port 161:

0: 30 43 02 01 00 04 06 70 75 62 6c 69 63 a2 36 02 0C.....public.6.16: 02 18 bc 02 01 00 02 01 00 30 2a 30 28 06 08 2b .........0*0(..+32: 06 01 02 01 01 01 00 04 1c 53 75 6e 20 53 4e 4d .........Sun SNM48: 50 20 41 67 65 6e 74 2c 20 53 55 4e 57 2c 55 6c P Agent, SUNW,Ul64: 74 72 61 2d 31 -- -- -- -- -- -- -- -- -- -- -- tra-1...........0: SNMP MESSAGE (0x30): 67 bytes2: INTEGER VERSION (0x2) 1 bytes: 0 (SNMPv1)2: INTEGER VERSION (0x2) 1 bytes: 0 (SNMPv1)5: OCTET-STR COMMUNITY (0x4) 6 bytes: "public"

13: RESPONSE-PDU (0xa2): 54 bytes15: INTEGER REQUEST-ID (0x2) 2 bytes: 633219: INTEGER ERROR-STATUS (0x2) 1 bytes: noError(0)22: INTEGER ERROR-INDEX (0x2) 1 bytes: 025: SEQUENCE VARBIND-LIST (0x30): 42 bytes27: SEQUENCE VARBIND (0x30): 40 bytes29: OBJ-ID (0x6) 8 bytes: .1.3.6.1.2.1.1.1.039: OCTET-STR (0x4) 28 bytes: "Sun SNMP Agent, SUNW,Ultra-1"

system.sysDescr.0 : DISPLAY STRING- (ascii): Sun SNMP Agent, SUNW,Ultra-1

Page 50: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Example of snmpwalk

snmpwalk 10.144.18.118 .1.3.6.1.2.1.1system.sysDescr.0 : DISPLAY STRING- (ascii): Sun SNMP Agent, SUNW,Ultra-1

system.sysObjectID.0 : OBJECT

IDENTIFIER: .iso.org.dod.internet.private.enterprises.42.2.1.1

system.sysUpTime.0 : Timeticks: (198219958) 22 days, 22:36:39.58system.sysUpTime.0 : Timeticks: (198219958) 22 days, 22:36:39.58

system.sysContact.0 : DISPLAY STRING- (ascii): [email protected]

system.sysName.0 : DISPLAY STRING- (ascii): camry

system.sysLocation.0 : DISPLAY STRING- (ascii): Information Technology

Laboratory 3F

system.sysServices.0 : INTEGER: 72 (01001000)B

Page 51: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Example of snmptrap snmptrap -d manager .1.3.6.1.4.1.612.1.1 10.144.18.116 6 99999

0 .1.3.6.1.1 octetstringascii "Trap test"Transmitted 64 bytes to manager (10.144.18.100) port 162:

0: 30 3e 02 01 00 04 06 70 75 62 6c 69 63 a4 31 06 0>.....public.1.16: 09 2b 06 01 04 01 84 64 01 01 40 04 0a 90 12 74 [email protected]: 02 01 06 02 03 01 86 9f 43 01 00 30 13 30 11 06 ........C..0.0..48: 04 2b 06 01 01 04 09 54 72 61 70 20 74 65 73 74 .+.....Trap test0: SNMP MESSAGE (0x30): 62 bytes2: INTEGER VERSION (0x2) 1 bytes: 0 (SNMPv1)5: OCTET-STR COMMUNITY (0x4) 6 bytes: "public"2: INTEGER VERSION (0x2) 1 bytes: 0 (SNMPv1)5: OCTET-STR COMMUNITY (0x4) 6 bytes: "public"

13: V1-TRAP-PDU (0xa4): 49 bytes15: OBJ-ID ENTERPRISE (0x6) 9 bytes: .1.3.6.1.4.1.612.1.126: IPADDRESS AGENT-ADDR (0x40) 4 bytes: 10.144.18.116 (manager2)32: INTEGER GENERIC-TRAP (0x2) 1 bytes: 635: INTEGER SPECIFIC-TRAP (0x2) 3 bytes: 9999940: TIMETICKS TIME-STAMP (0x43) 1 bytes: 0 (0x0)43: SEQUENCE VARBIND-LIST (0x30): 19 bytes45: SEQUENCE VARBIND (0x30): 17 bytes47: OBJ-ID (0x6) 4 bytes: .1.3.6.1.153: OCTET-STR (0x4) 9 bytes: "Trap test"

Page 52: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Get System Information

Get “System Group” of MIB II

Use get_request or get_next_requestsysDescr .1.3.6.1.2.1.1.1.0

sysObjectID .1.3.6.1.2.1.1.2.0

52

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

Page 53: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Get Interface Information

Get “Interface Group” of MIB II

Repeatedly Use “get_next_request”

Note: We don’t know the ifIndex values in

53

ifTable.First get the next object of .ifTable.ifEntry.0

Then repeatedly “get_next”

Until the whole subtree is visited.

Page 54: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

54

Page 55: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Traffic Monitoring

Get “ifInOctets” and “ifOutOctets” of MIB II Interface Group

t1: C1 t2: C2

55

(C2 - C1 ) 8

(t2 - t1) Bandwidth 100%Utilization (%) =

Page 56: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

56

Page 57: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 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

Page 58: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Development of SNMP Standards

SNMPv2 SNMPv3

RMON I

58

RMON II

Page 59: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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)

59

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)

Page 60: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

RMON I & II

APPLICATION Presentation

Session RMON2

RMON 2

Transport

60

Network Data Link

(MAC)RMON

1

Ethernet

TokenRing

FDDI

Frame Relay,HDLC, PPD,SDLL, X.25,

CIRPPhysical

V-series

T1 E1G703

Page 61: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 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)

Page 62: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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

Page 63: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

What are defined using ASN.1

Types: data structures

e.g. Counter, Gauge, IpAddess, ...

Values: instances (variables) of a type

63

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, ...

Page 64: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Modules

Module: A collection of ASN.1 descriptions

Module Structure<module name> DEFINITION ::= BEGIN

<module body>

END

ExampleEmptyModule

DEFINITION ::= BEGIN

END

Page 65: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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

Page 66: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Tags and Types (cont.) Universal Tag ASN.1 Type

1 BOOLEAN

2 INTEGER

3 BIT STRING

4 OCTET STRING

5 NULL

6 OBJECT IDENTIFIER

Universal Tag ASN.1 Type

18 NumericString

19 PrintableString

20 TeletexString

21 VediotextString

22 IA5String6 OBJECT IDENTIFIER

7 ObjectDescriptor

8 EXTERNAL

9 REAL

10 ENUMERATED

12-15 Reserved

16 SEQUENCE, SEQUENCE OF

17 SET, SET OF

23 UTCTime

24 GeneralizeTime

25 GraphicString

26 VisssibleString

27 GeneralString

28 CharacterString

29-... Reserved

Page 67: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

Values in ASN.1

General format of a value assignment <valuereference> <type> ::= <value>

Examples: BOOLEAN BOOLEAN

• Married ::= BOOLEAN

• currentStatus Married ::= FALSE

INTEGER• Color ::= INTEGER{red (0), blue (1), yellow (2)}

• defaultColor Color ::= 1

• defaultColor Color ::= blue

Page 68: Introduction to SNMPmohiqbal.staff.gunadarma.ac.id/Downloads/files/35177/mohiqbal+-+9+SNMP.pdf2. Management Information Base Structure of Management Information (SMI) Set of rules

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 BERbe 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 TL TL V V

V

L