SNMP Extra Lecture and examples

27
SNMP Extra Lecture and examples

description

SNMP Extra Lecture and examples. Outline. Reading Columnar Objects SNMP PDU messages GetRequest Example GetNextRequest Example Lexicographic Ordring- example GetBulkRequest Example SNMP Decentralized management Message Encapsulation and UDP Port. Two Kinds of Managed Objects. - PowerPoint PPT Presentation

Transcript of SNMP Extra Lecture and examples

Page 1: SNMP Extra Lecture and examples

SNMP Extra Lecture and examples

Page 2: SNMP Extra Lecture and examples

Outline

Reading Columnar Objects SNMP PDU messages GetRequest Example GetNextRequest Example Lexicographic Ordring- example GetBulkRequest Example SNMP Decentralized management Message Encapsulation and UDP Port

Page 3: SNMP Extra Lecture and examples

Two Kinds of Managed Objects

Type-Specific Objects: sysDescr OBJECT-TYPE

SYNTAX DisplayString (SIZE(0..255))

::= {system 1}

OID: mib-2.system.1.0 Columnar Objects

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

Page 4: SNMP Extra Lecture and examples

Columnar Objects

ifIndex ifDescr ifType . . .

1 le0 6 . . .

6 llc0 1 . . .

7 lo0 24 . . .

9 le1 6 . . .

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

1.3.6.1.2.1.2.2.1.3.71.3.6.1.2.1.2.2.1.2.6

Page 5: SNMP Extra Lecture and examples

SNMP PDU messages

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

var-bind 1

name value

var-bind 2

name value

var-bind n

. . .

error-status INTEGER { noError (0), tooBig (1), noSuchName(2), badValue (3), readOnly (4), genErr (5) }, error-index INTEGER,

Page 6: SNMP Extra Lecture and examples

GetRequest PDU

Sender includes the following fields: PDU Type request-id Variable-bindings

A list of object instances whose values are requested

SNMP dictates that a scalar object is identified by its OBJECT-IDENTIFIER concatenated with 0 e.g., sysDescr.0: distinguishes

between the object type and an instance of the object

sysServices (7)

sysLocation (6)

sysDescr (1)

system(mib-2 1)

sysObjectId (2)

sysUpTime (3) sysName (5)

sysContact (4)

Page 7: SNMP Extra Lecture and examples

GetRequest PDU

GetRequest (sysDescr.0)

GetResponse (sysDescr .0= "SunOS" )

GetRequest (sysObjectID.0)

GetResponse ( sysObjectID.0=enterprises.11.2.3.10.1.2 )

GetRequest (sysUpTime.0)

GetResponse (sysUpTime.0=2247349530)

GetRequest (sysContact.0)

GetResponse (sysContact.0=" ")

GetRequest (sysName.0)

GetResponse (sysName.0="noc1 ")

GetRequest (sysLocation.0)

GetResponse (sysLocation.0=" ")

GetRequest (sysServices.0)

GetResponse (sysServices.0=72)

ManagerProcess

AgentProcess

.0 indicates that the scalar value should be retrieved (scalar objects only)

The manager could have used only one message to obtain the values of all objects under system group: using “variable binding list”

Page 8: SNMP Extra Lecture and examples

GetRequest PDU

Get Request is atomic Either all values (of all variables

provided in the binding list) retrieved or none

error message is generated if at least one of the variables could not be found/returned; error-status: noSuchName tooBig genErr

error-index: indicate the problem object (i.e., variable in binding list that caused the problem)

With SNMP, only leaf objects in the MIB can be retrieved e.g. it is not possible to

retrieve an entire row of a table by simply accessing the Entry Object (e.g., ipRouteEntry)

the management stations has to include each object instance (in the row) in the binding listo By including the complete

object identifier and respecting the rule of indexing!

Page 9: SNMP Extra Lecture and examples

GetRequest PDU

GetRequest (ipRouteDest.9.1.2.3, ipRouteMetric1.9.1.2.3, ipRouteNextHop. 9.1.2.3 )

ipRouteDest ipRouteMetric1 ipRouteNextHop

9.1.2.3 3 99.0.0.310.0.0.51 5 89.1.1.4210.0.0.99 5 89.1.1.42

Index of table

Page 10: SNMP Extra Lecture and examples

GetNextRequest PDU

PDU format: same as GetReqest

Difference: each variable in the binding list refers

to an object instance next in the lexicographic order

GetNextRequest (sysDescr.0) return the value of the object instance of sysObjectId

Advantages: Allows a network manager to discover

a MIB structure dynamically Efficient way for searching through

tables whose entries are unknown

sysServices (7)

sysLocation (6)

sysDescr (1)

system(mib-2 1)

sysObjectId(2)

sysUpTime (3) sysName (5)

sysContact (4)

Page 11: SNMP Extra Lecture and examples

Error message: no object next to sysServices

GetNextRequest PDU

GetRequest (sysDescr.0)

GetResponse (sysDescr .0= "SunOS" )

GetNextRequest (sysDescr.0)

GetResponse ( sysObjectID.0=enterprises.11.2.3.10.1.2 )

Get-Next-Request Operation for System Group

ManagerProcess

AgentProcess

GetNextRequest (sysObjectID.0)

GetResponse (sysUpTime.0=2247349530)

GetNextRequest (sysUpTime.0)

GetResponse (sysContact.0=" ")

GetNextRequest (sysContact.0)

GetResponse (sysName.0="noc1 ")

GetNextRequest (sysName.0)

GetResponse (sysLocation.0=" ")

GetNextRequest (sysLocation.0)

GetResponse (sysServices.0=72)

GetNextRequest (sysServices.0)

GetResponse (noSuchName)

Page 12: SNMP Extra Lecture and examples

Generalized Case

T ZA B

1.1

E

2.1 3.1

1.2 2.2 3.2

A sample MIB that contains both scalar values and aggregate objects

Retrieving scalar as well as aggregate objects using get-request and get-next-request

Page 13: SNMP Extra Lecture and examples

Get-Next Request

:Non-Leaf Object

:Leaf Object1 2 3

4 5 6

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

Page 14: SNMP Extra Lecture and examples

Generalized Case

T.E.1.1 T.E.2.1 T.E.3.1

T.E.1.2 T.E.2.2 T.E.3.2

E

T

Z

A

B

GetRequest ( A )

GetResponse ( A )

GetRequest ( B )

GetResponse ( B )

GetRequest (T.E.1.1)

GetResponse ( T.E.1.1 )

GetRequest (T.E.1.2)

GetResponse ( T.E.1.2 )

GetRequest (T.E.2.1)

GetResponse ( T.E.2.1 )

GetRequest (T.E.2.2)

GetResponse ( T.E.2.2 )

GetRequest (T.E.3.1 )

GetResponse ( T.E.3.1 )

GetRequest (T.E.3.2 )

GetResponse ( T.E.3.2 )

GetRequest (Z )

GetResponse ( Z )

ManagerProcess

AgentProcess

Page 15: SNMP Extra Lecture and examples

Generalized Case

T.E.1.1 T.E.2.1 T.E.3.1

T.E.1.2 T.E.2.2 T.E.3.2

E

T

Z

A

B

Observations:

1)- we need to know all the elements in the MIB, including the # of columns and rows in a table

2)- a MIB is traversed from top to bottom (i.e., from left to right in the tree structure)

3)- data in tables is retrieved by traversing all instances of a columnar object

NOTES:

1)- dynamic table: # rows may not be known to manager

A request to T.E.1.3 results in error message

3)- GetNextRequest could avoid this!

4)- A convention is required for the definition of the next object in a MIB

SNMP uses lexicographic convention

Page 16: SNMP Extra Lecture and examples

Lexicographic Convention

Procedure for orderingStart with leftmost digit as first position Before increasing the order in the first position, select the lowest digit in the second position Continue the process till the lowest digit in the last position is captured Increase the order in the last position until all the digits in the last position are captured Move back to the last but one position and repeat the process Continue advancing to the first position until all the numbers are ordered

Tree structure for the above process

Numerical Order

Lexicographic order

1 1 2 1118 3 115 9 126 15 15 22 2 34 22 115 250 126 2509 250 3 321 321 1118 34 2509 9

Page 17: SNMP Extra Lecture and examples

Lexicographic Ordring- example

3 91 2

18

1

5

2

6

2 10

9

214

start end1 1.1 1.1.5 1.1.18 1.2 1.2.6 2 2.2 2.10 2.10.9 3 3.4 3.21 9

MIB example of lexicographic ordering

Page 18: SNMP Extra Lecture and examples

T.E.1.1 is next object to scalar B

GetNextRequest PDU

T.E.1.1 T.E.2.1 T.E.3.1

T.E.1.2 T.E.2.2 T.E.3.2

E

T

Z

A

B

GetRequest ( A )

GetResponse ( A )

GetNextRequest ( A )

GetResponse ( B )

GetNextRequest ( B )

GetResponse ( T.E.1.1 )

GetNextRequest (T.E.1.1 )

GetResponse ( T.E.1.2 )

GetNextRequest (T.E.1.2 )

GetResponse ( T.E.2.1 )

GetNextRequest (T.E.2.1 )

GetResponse ( T.E.2.2 )

GetNextRequest (T.E.2.2 )

GetResponse ( T.E.3.1 )

GetNextRequest (T.E.3.1 )

GetResponse ( T.E.3.2 )

GetNextRequest (T.E.3.2 )

GetResponse ( Z )

GetNextRequest ( Z )

GetResponse ( noSuchName )

ManagerProcess

AgentProcess

Page 19: SNMP Extra Lecture and examples

GetNextRequest PDU

GetRequest ( A )

GetResponse ( A )

GetNextRequest ( A )

GetResponse ( B )

GetNextRequest ( B )

GetResponse ( T.E.1.1 )

GetNextRequest (T.E.1.1 )

GetResponse ( T.E.1.2 )

GetNextRequest (T.E.1.2 )

GetResponse ( T.E.2.1 )

GetNextRequest (T.E.2.1 )

GetResponse ( T.E.2.2 )

GetNextRequest (T.E.2.2 )

GetResponse ( T.E.3.1 )

GetNextRequest (T.E.3.1 )

GetResponse ( T.E.3.2 )

GetNextRequest (T.E.3.2 )

GetResponse ( Z )

GetNextRequest ( Z )

GetResponse ( noSuchName )

ManagerProcess

AgentProcess

Advantages of Get-Next-Request

1)- no need to know the object ID of the next entity to retrieve its value2)- issues with dynamic table resolved

3)- allows NMS to discover the structure of a MIB view dynamically

4)- provides an efficient mechanism for searching a table whose entries are unknown

Page 20: SNMP Extra Lecture and examples

inform-requestmanager-to-manager messageThe receiving manager responds with a response messageEnhances interoperability

get-bulk-request transfer of large data, e.g. retrieval of table data

SNMPv2-trapSimilar to trap messages in SNMPv1

Additional Messages

Page 21: SNMP Extra Lecture and examples

GetBulkRequest-PDU Operation

T ZA B

1.1

E

1.2

1.3

1.4

2.1

2.2

2.3

2.4

3.1

3.2

3.3

3.4

T.E.1.1 T.E.2.1 T.E.3.1

T.E.1.2 T.E.2.2 T.E.3.2

E

T

Z

A

B

T.E.1.3 T.E.2.3 T.E.3.3

T.E.1.4 T.E.2.4 T.E.3.4

Page 22: SNMP Extra Lecture and examples

GetBulkRequest-PDU Operation

GetRequest ( A,B )

GetNextRequest (T.E.1,T.E.2,T.E.3)

GetResponse (T.E.1.1,T.E.2.1,T.E.3.1)

GetNextRequest (T.E.1.1,T.E.2.1,T.E.3.1)

GetResponse (T.E.1.2,T.E.2.2,T.E.3.2)

GetResponse (T.E.1.3,T.E.2.3,T.E.3.3)

GetNextRequest (T.E.1.3,T.E.2.3,T.E.3.3)

GetResponse (T.E.1.4,T.E.2.4,T.E.3.4)

GetResponse (T.E.2.1,T.E.3.1,Z)

Manager

Process

Agent

ProcessGetResponse (A,B)

GetNextRequest (T.E.1.4,T.E.2.4,T.E.3.4)

GetNextRequest (T.E.1.2,T.E.2.2,T.E.3.2)

Page 23: SNMP Extra Lecture and examples

GetBulkRequest-PDU Operation

T.E.1.1 T.E.2.1 T.E.3.1

T.E.1.2 T.E.2.2 T.E.3.2

E

T

Z

A

B

T.E.1.3 T.E.2.3 T.E.3.3

T.E.1.4 T.E.2.4 T.E.3.4

GetBulkRequest ( 2,3,A,B,T.E.1, T.E.2, T.E.3 )

Response ( A, B,T.E.1.1, T.E.2.1, T.E.3.1T.E.1.2, T.E.2.2, T.E.3.2

T.E.1.3, T.E.2.3, T.E.3.3 )

GetBulkRequest ( 0,3,T.E.1.3, T.E.2.3, T.E.3.3 )

Response ( T.E.1.4, T.E.2.4, T.E.3.4, Z , "endOfMibView")

ManagerProcess

AgentProcess

2 non repetitive objects (A, B)

3 repetitive instances Of the columnar objectT.E.1, T.E.2, T.E.3

3 more rows

Z is next in the lexicographic order

Page 24: SNMP Extra Lecture and examples

GetBulkRequest-PDU Operation

atIfIndex231316

atPhysAddress0000000C3920B40000000C3920AC0000000C3920AF

atNetAddress192.68.3.1

172.46.46.1172.46.49.1

GetBulkRequest ( 1,3,sysUpTime,

atPhysAddress )

Response( (sysUpTime.0 = "315131795"), (atPhysAddress.13.172.46.46.1 = "0000000C3920AC")(atPhysAddress.16.172.46.49.1 = "0000000C3920AF")(atPhysAddress.23.172.17.3.1 = "0000000C3920B4") )

Figure 6.42 Get-Bulk-Request Example

GetBulkRequest ( 1,3,sysUpTime,

atPhysAddress.23.192.168.3.1 )

Response( (sysUpTime.0 = "315131800"),(ipForwarding.0 = "1") )

ManagerProcess

AgentProcess

Page 25: SNMP Extra Lecture and examples

SNMP Decentralized management

MIBSNMPv2agent

MIBSNMPv2agent

MIBSNMPv2agent

MIB

SNMPv2Manager/agent

MIB

SNMPv2Manager/agent

MIB

Management Applications

SNMPv2 manager

Management server

Element manager

Agent

SNMPv2 Configuration

Page 26: SNMP Extra Lecture and examples

Message Encapsulation

Communication between remote peer processes Message consists of :

o Version identifiero Community name

Messages are exchanged in Protocol Data Unit PDU

Message encapsulated in UDP datagrams and transmitted Loss of message time out!

version community data

Like FTP, SNMP uses two well-known ports to operate: UDP Port 161 - SNMP

Messages UDP Port 162 - SNMP Trap

Messages Size of SNMP message:

1472 bytes

Page 27: SNMP Extra Lecture and examples

Default UDP Ports for SNMP

Ethernet

SNMP

UDP

IP

Manager

ManagementStation

Network Elements (NEs)

Ethernet

SNMP

UDP

IP

Agent

161 Any162 Any