Tong Quan Ve Quan Ly Mang (4)

  • Published on
    07-Jul-2015

  • View
    179

  • Download
    0

Transcript

Bi 4 Giao thc qun l Mng SNMPv2

BI 4

SNMPv2

-

Gii thiu SNMPv2 v MIB: cung cp cu trc tng qut thng tin qun l. Nhn mnh s khc bit (m rng) so vi SNMPv1.

-

Hot

ng

ca

SNMPv2,

nhn

mnh

vo

GetBulkRequest

v

getInformationRequest cng s khc bit gia PDU ca v1 vi PDU ca v2.

I. SNMPv2 v MIBI.1 Tm tt lch sBan u SNMP ch l mt gii php mng n gin Internet bng n: c v phm vi, hiu nng v cu trc th h SNMP th 2 ra i vo

u nm 1993 v c ph chuNn vo nm 1996 sau 3 nm th nghim. SNMPv2 m rng so vi v1, n c thm cc chc nng v cng da trn m hnh mng OSI cng nh TCP/IP. Hai ci tin c th l: S ci tin trong SMI, c bit l s nh ngha ca bng thng tin Ci tin trong MIB, nh ngha thm cc i tng.

Cn ch , SMI nh ngha cu trc thng tin qun l cn MIB nh ngha i tng qun l.

Cc chu n lin quan n SNMPv2RFC 1902 1903 Tiu Cu trc thng tin qun l SNMPv2 Quy c bin i thng tin sang dng vn bn ca thng tin qun l SNMPv2

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Trang

1/11

Bi 4 Giao thc qun l Mng SNMPv2 1904 1905 1907 1908 Cc tuyn b tun th ca SNMPv2 Cc hot ng ca giao thc SNMPv2 MIB ca SNMPv2 Tha thun cng tn ti c hai phin bn SNMPv1 v v2

I.2. SMI ca SNMPv2SMI ca SNMPv2 (SMIv2), cng ging nh cho phin bn 1, ch ra c php v ng ngha ca i tng c qun l. SMIv2 c nh ngha trong RFC 1901 gm bn phn: cc nh ngha i tng, bng lun l, nh ngha thng bo v cc module thng tin. a. Cc nh ngha i tng Trong SNMPv1 SMI, macro ASN.1 c tn OBJECT-TYPE MACRO dng ch ra i tng qun l. SMIv2 ging ht, cng thm mt s khc bit: Kiu d liu BIT STRING gm counter32, counter64, NsapAddress, v UInteger64.

So snh cc kiu d liu trong SNMPv1 SMI vi v2 Kiu INTERGER OCTET STRING OBJECT IDENTIFIER BIT STRING Counter32 Counter64 Gauge32 IpAddress NsapAddress Opaque TimeTicks UInteger32 X X X X X SNMPv1 SMI X X X SNMPv2 SMI X X X X X X X X X X X X

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Trang

2/11

Bi 4 Giao thc qun l Mng SNMPv2

C php SMIv2 cng tng t SMIv1 ngoi tr mt s khc bit: Mt macro OBJECT-TYPE trong SNMPv2 c thm mt mnh Units Part, n cung cp ngha di dng vn bn v cc n v o lng. Mnh MAX-ACCESS thay th cho mnh ACCESS trong SNMPv1. T kha MAX nhn mnh rng y l mc truy xut cao nht cho php. SMIv2 khng c phng thc truy xut write-only Phng thc truy xut mi thm vo l read-create hot ng trn cc bng khi nim. b. nh ngha bng Ging nh SMIv1, ch c hai kiu cu trc d liu trong SNMPv2: v hng v cc bng khi nim. Cc bng khi nim cho php nh ngha cc thng tin v quan h phc tp. Bng khi nim bao gm nhiu dng, mi dng cha mt hoc nhiu i tng v hng. Ni cch khc, mi dng biu din mt n v thng tin vi nhiu thuc tnh khc nhau. Cu trc bng cng ging nh SNMPv1. Bng gm nhiu dng, mi dng gm mt tp (entry) c th t. o Tng c c php nh sau: SEQUENCE OF . o Mi dng ca bng l mt tp cc i tng v hng

SEQUENCE { , , . . ., } m mi gi tr type y c dng S khc bit (m rng) so vi SNMPv1 l: o T kha IMPLIED gip xy dng mt OID trong bng d dng hn. T kha ny c th ng trc tn mt OID gip n ngn gn hn. o Mnh AUGMENT l mt c ch m rng bng, cho php tng thm ct khi cn o Mt trng mi (ct) c thm vo, RowStatus, n c dng vn bn m t tnh trng sinh mi v xa b cc ca bng.

c. Cc hnh ng vi bng Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li Trang 3/11

Bi 4 Giao thc qun l Mng SNMPv2

To dng Mt nh qun l c th dng t hp SetRequest v Getrequest to cc dng mi. to mt dng mi, phng thc CreateAndWait c dng nh sau: 1. Manager gi PDU SetRequest cho Agent c cha ch s dng (Index) 2. Agent to dng, gn cc gi tr ngm nh. Nu tt c cc i tng read-create u c gi tr ngm nh th trng thi ca dng c t l notInServicce. Nu mt s khng c gi tr ngm nh th trng thi l notReady. 3. Agent gi PDU p tr. PDU mang tt c d liu thit lp cho tng trng i tng ca dng. Vi nhng i tng read-create c v khng c gi tr ngm nh th trng ny mang m li noSuchInstance 4. Manager gi PDU GetRequest cho Agent xc nh trng thi cho tng i tng read-create v c cc thay i vi nhng trng i tng c sn gi tr (nu cn) 5. Sau ht, Manager s gi SetRequest thit lp trng thi hot ng cho dng va to. Phng php to dng khc l CreateAndGo cng ging CreateAndWait tr bc 3. Thc cht phng php ny l tm thi manager ch quan tm n to lp bng, m cha quan tm n ni dung thi hnh, nhm tng tc thit lp h thng.

Xa dng Xa dng gm hai bc: 1. Manager gi SetRequest mang ch s dng cho Agent thit lp trng thi xa b (destroy) ti RowStatus. 2. Agent thi hnh xa n khi bng sau . Vic bo co xa dng ca Agent vi manager l khng bt buc.

nh ch dng Vic nh ch mt dng l kt qu m phn i bn manager v agent 1. Manager gi PDU SetRequest cho Agent thit lp trng thi RowStatus thnh inActive Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li Trang 4/11

Bi 4 Giao thc qun l Mng SNMPv2 2. Nu v l do no m Agent khng thi hnh ngay, n p tr bng m li wrongValue. Nu n thi hnh, th p tr bng noError

II. Cc dng thc PDU ca SNMPv2Cc thng ip PDU SNMPv2 c c php chung nh vi SNMPv1, gm ba trng: phin bn, community name v mt trong by PDU SNMPv2. Hai trng u gi l wrapper hay header ca thng ip SNMP.

Su kiu PDU SNMPv2 gm GetRequest, GetNextRequest, SetRequest, GetResponse, SNMPv2-Trap, v InforRequest c cng cu trc v cng ging nh GetRequest, GetNextRequest, SetRequest, and GetResponse trong SNMPv1

PDU-type request-id error-status error-index variable-bindingsMt PDU mi c trong SNMPv2, GetBulkRequest c dng sau:

PDU-type

request-id

non-repeater

max-repetitions

variable-bindings

Trng variable bindings c cu trc sau:

name1

value1

name2

value2

nameN

valueN

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Trang

5/11

Bi 4 Giao thc qun l Mng SNMPv2 Ta c th so snh hai phin bn bng bng sau:

SNMPv2 PDU GetRequest

SNMP PDU GetRequest

Ch thch SNMPv2 GetRequest v SNMPv1 GetRequest c cng c php, ng ngha SNMPv2 GetNextRequest v SNMPv1 GetNextRequest c cng c php, ng ngha SNMPv2 SetRequest v SNMPv1 SetRequest c cng c php, ng ngha SNMPv2 Response v SNMPv1 GetResponse c cng cu trc

GetNextRequestGetNextRequest

SetRequest

SetRequest

Response

GetResponse

nhng tn PDU khc nhau. Ngoi ra cn khc v cch thc m PDU SNMPv2 Response c sinh ra. SNMPv2-Trap v SNMPv1-Trap va khc tn, va khc cu trc, nhng ng ngha th ging nhau. SNMP Trap c cu trc c bit

SNMPv2-Trap Trap

khc vi cc request PDU khc. SNMPv2-Trap PDU li c cng cu trc vi cc SNMPv2 PDUs nh GetRequest, Response, GetNextRequest, SetRequest.

InformRequest No equivalent GetBulkRequestNo equivalent

y l SNMPv2 PDU mi nhng c cng cu trc nh cc SNMPv2 PDUs khc, tr GetBulkRequest. y l SNMPv2 PDU mi cc cu trc khc hn.

II.1 GetRequest PDU

-

Ging ht c c php v ng ngha nh trong SNMPv1 S khc bit cch p tr. Trong SNMPv1 c hai kh nng p tr, hoc tt c thng tin, hoc khng p. Trong SNMPv2 khng p tr bng tt c thng tin v, thng tin p tr thnh tng cp: tn bin gi tr v c a vo trong danh sch variable-bindings. Nu v l do no khng th ly c d liu, mt m li s c tr v (noSuchObject, noSuchInstance, endOfMib View).

II.2. GetNextRequest PDU Ging ht c c php v ng ngha nh trong SNMPv1 Trang 6/11

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Bi 4 Giao thc qun l Mng SNMPv2 S khc bit cch p tr. Nh trn, SNMPv1 p bng tt c d liu hoc khng p. Nhng SNMPv2 s dng n lc ti a n p tr nhiu d liu nht c th (nu ly c)

II.3. SetRequest PDU Cng ging ht SNMPv1 v c php v ng ngha. S khc bit cch x l thng ip p tr. Ngay khi nhn c SetRequest PDU, agent xc nh kch thc thng ip p tr, nu n ln hn cho php, n s xy dng li thng ip p tr.

II.4. Response PDU Agent sinh ra Response PDU p li mt trong cc PDU GetRequest, GetNextRequest, GetBulkRequest, or SetRequest PDU nhn c. S khc bit so vi SNMPv1 l cch x l thng ip p tr

II.5. GetBulkRequest PDU y l mt ci tin c bit trong SNMPv2 vi mc ch gim thiu s giao tip pht sinh trong qun l. PDU ny c hai trng mi: non-repeaters and max-repetitions. + Trng non-repeaters: ch ra s lng bin trong danh sch variable-bindings cn c tr v. + Trng max-repetitions: ch ra s lng bin m k t , tt c cc bin cho n ht danh sch variable-bindings s c tr v Ni chung, GetBulkRequest lm vic nh sau: n bao gm mt danh sch vi N+(M*R) tn bin c trong danh sch variable-bindings. Tng bin trong N bin u tin (trng non-repeaters) c x l ging nh trong PDU GetNextRequest. Phn cn li t bin th N+1 tr i cho n ht danh sch variable-bindings, s bin c ly s o bng gi tr trong trng max-repetitions

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Trang

7/11

Bi 4 Giao thc qun l Mng SNMPv2 II.6 Trap PDU Agent tun th SNMPv2 thc hin sinh Trap mi khi xut hin li. Chc nng ny c thc thi ging nh trong SNMPv1, nhng dng thc ca n trong SNMPv2 c khc bit ch l n ging vi a s cc PDU SNMPv2 khc. Hai trng u trong danh sch variable-bindings l sysUpTime v snmpTrapOID. Khng c PDU no p li Trap II.7. InformRequest PDU PDU ny mi c mt trong SNMPv2, c thc th manager sinh ra v gi ti agent thay mt mt ng dng. Hai trng u trong danh sch variable-bindings l sysUpTime.0 v SNMPv2EventId. Thc th SNMPv2 nhn c PDU ny s thc hin kim tra tnh hp l ca kch thc thng ip. Nu vi phm, n xy dng mt PDU p tr mng cng request-id vi InformRequest PDU nhn, km theo mt m li tooBig, mt trng error-index bng 0 v mt danh sch variable-bindings rng. Nu chiu di thng ip khng vi phm, n p tr cc thng tin cn thit.

III. SNMPv2 MIBSNMPv2 MIB c nh ngha trong RFC 1907. Mt thc th SNMP c th trong vai tr mt manager hay mt agent. SNMPv2 MIB c m rng thnh SNMP MIB-II theo RFC1212 v bao gm ba nhm sau: + System group: bao gm mt tp cc i tng cho php mt agent SNMPv2 c th theo di cc loi ti nguyn c cu hnh v cp pht ng + SNMP Group: l mt phin bn thu nh t SNMPv1 m n ch gm cc i tng cn thit trong SNMPv2 + MIB objects group: Mt tp cc i tng quan h mt thit vi SNMPv2-Trap cho php cc manager SNMPv2 cng iu hnh h thng nhp nhng.

III.1 Nhm h thng Cng l nhm h thng c trong SNMPv1 vi hai thnh phn m rng:

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Trang

8/11

Bi 4 Giao thc qun l Mng SNMPv2 + Mt i tng v hng sysORLastChange: dng lu li thi gian thay i sau cng ca i tng no trong bng. + Thm mt bng cha mt s i tng quan h vi ti nguyn h thng agent m n c th c cu hnh bi manager.

Tn i tng SysDescr

C php DisplayString (SIZE(0..255)) OBJECT IDENTIFIER TimeTicks

Phng thc truy ID xut RO

M t

SysObjectID SysUpTime SysContact

NA RO RW RW RW RO RO NA

Mt cch m t bng vn bn. Gi tr ny thng bao gm 1 tn y v s hiu phin bn ca kiu loi phn cuwsnng ca h thng, ca h iu hnh v phn mm mng. Chng thc ca nh phn phi. Gi tr ny c cp pht 2 theo ph h hnh cy SMI (1.3.6.1.4.1) cho php d dng v khng m h xc nh tn v kiu loi i tng. Thi gian tnh bng phn trm giy k t khi module qun l 3 mng khi chy. 4 Thng tin v ngi qun tr nt mng 5 Tn nt mng, thng l chi tit URL 6 V tr vt l ca nt trong cy ph h Mt s nguyn biu th s lng dch v m nt ny cung cp. Gi tr sysUpTime tnh t thi im thay i trng thi hay 8 gi tr gn nht ca bt c mt bn sao no ca sysORID Mt bng lit k cc kh nng ca cc thc th SNMPv2 cc 9 b trong vai tr agent m chng c cha cc ti nguyn cho php manager ty thay i 7

DisplayString (SIZE (0..255)) DisplayString SysName (SIZE (0..255)) DisplayString SysLocation (SIZE (0..255)) INTEGER SysServices (0..127) SysORLast TimeStamp Change SysORTable Sequence of Sys OREntry

III.2 Nhm SNMP Nhm ny bao gm cc i tng c nhim v kim sot v duy tr hot ng ca cc thc th SNMPv2. N cho php maganer theo di c cc tham s nh tng s thng ip SNMPv2 nhn c t mt thc th, s lng cc thng ip sai hng Ngoi ra nhm ny c b sung thm i tng snmpEnableAutheTraps kim sot vic sinh v kch hot cc trap mi khi mt agent thi hnh chng thc khng thnh cng, nhm tng chc nng bo mt.

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Trang

9/11

Bi 4 Giao thc qun l Mng SNMPv2

Tn i tng

C php

Phng thc truy ID xut RO RO RO 4 RO RO 5 6

M t

snmpInPkts snmpInBadVersion snmpInBad CommunityName snmpInBad CommunityUse

Counter Counter32 Counter32 Counter32

1 S thng ip ca giao thc SNMP gi cho dch v truyn gi 3 S thng ip ca khng h tr giao thc SNMP gi cho dch v truyn gi S thng ip ca giao thc SNMP gi cho dch v truyn gi nhng khng bit community name S thng ip ca giao thc SNMP gi cho dch v truyn gi nhng khng c cho php S li ASN.1 hay t s li bit BER gp phi khi gii m thng ip SNMP Biu th rng agent cho php sn sinh cc trap chng thc hay khng, enabled = 1 v disabled = 2. Gi tr ca i tng ny thc hin np chng tt c cc thit lp khc. S lng cc PDU: GetRequest, GetNextRequest, GetBulkRequest, SetRequest, v InformRequest gi ti thc th SNMPv2 nhng khng p tr do kch thc PDU vt qu cho php. S PDU GetRequest, GetBulkRequest, SetRequest, v InformRequest gi cho thc th SNMPv2 nhng b hy do truyn gi qua proxy.

snmpInASN ParseErrs Counter32 snmpEnable AutenTraps snmpSilentDrops snmpProxyDrops INTEGER

RO

30

Counter32 Counter32

RO RO

31 32

III.3 Nhm i tng MIB Nhm cc i tng MIB bao gm hai tp con quan h cc cc Trap sinh bi agent v phi hp lm vic vi cc SNMPv2 manager. Nhm con snmpTrap: gm hai i tng m chng lun c trong cc PDU Trap ca SNMPv2: o snmpTrapOID: l mt nh danh TRAP duy nht. Bin ny c trong mi PDU Trap ca SNMPv2 v c trong PDU InformRequest o snmpTrapEnterprise: l mt nh danh TRAP thng mi duy nht. Bin ny c trong mi PDU Trap ca SNMPv2 v c trong PDU InformRequest. Nhm con th hai snmpSetSerialNo: mt i tng kha ngh m n cho php cc bn ng iu hnh SNMPv2. i tng ny c to trn c s MIB. Mi dng gm mt gi tr (tuy khng bt buc).

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Trang

10/11

Bi 4 Giao thc qun l Mng SNMPv2

TM TTSNMPv2 SMI nh ngha cu trc ca thng tin qun l kh ging nh SNMPv1 SMI, v c thm: mnh AUGMENT cho php thm ct v bng v i tng RowSatus gip mm do trong to, xa cc dng ca bng khi nim. SNMPv2 MIB bao gm ba nhm i tng: h thng, SNMP v i tng MIB. Mc d cc PDU SNMPv2 da trn SNMPv1, nhng c hai kha cnh quan trng phn bit chng: cch m cc agent sinh ra cc p tr v SNMPv2 thm vo hai PDU na l GetBulkRequest and GetInformRequest.

CU HI1. Trnh by cc cc bit c bn gia SMIv1 v SMIv2 2. V sao trng SYNTAX li i thnh RowStatus. Nu cch thc mt dng c to v xa trong SNMPv2 3. Chc nng chnh ca mnh AUGMENT. 4. Nhng PDU no ging nhau gia hai phin bn SNMPv1 v SNMPv2? 5. C phi PDU SNMP-Trap ca c hai phin bn l ging nhau? Nu khng hy m t s khc bit?

Nguyn Nam Hng B mn K thut My tnh v Mng i hc Thy li

Trang

11/11