SNMP訊息格式_第1頁
SNMP訊息格式_第2頁
SNMP訊息格式_第3頁
SNMP訊息格式_第4頁
SNMP訊息格式_第5頁
已閱讀5頁,還剩14頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、SNMP 訊息格式IP 標頭UDP 標頭SNMP 訊息SNMP 標頭PDU 標頭PDU 資料1SNMP HeaderSNMP MessageVersion IdentifierCommunity Name ( “public”)Protocol Data UnitThe length of SNMP messages should not exceed 484 octets.Message := SEQUENCE versionINTEGER version-1(0),communityOCTET STRING,data ANY VersionCommunitySNMP PDU2SNMP 區(qū)域

2、名稱CommunityRelationship between an Agent and Managers.Community NameUsed to validate the SNMP messages.A device can participate in more than one community (password).A community name (password) defines the scope of control that a manager has over elements in a community. Default community name: “pub

3、lic”.3PDU Header可分成兩種形式針對 GetRequest , GetNextRequest , SetRequest , GetReponse針對 Trap 而言PDU 型態(tài)要求代號錯誤狀況錯誤索引PDU typeenterpriseagent-addrgeneric-trapvariable-bindingsspecific-traptime-stamp4PDU 型態(tài)五種 SNMP-PDUs 型態(tài)SNMP-PDUs:= CHOICE getrequest GetRequest-PDU, get-next-request GetNextRequest-PDU, get-resp

4、onse GetResponse-PDU, set-request SetRequest-PDU, trap Trap-PDU5SNMP PDURequest-idError-statusError-indexPDU := SEQUENCE request-id INTEGER,error-status INTEGER noError(0),tooBig(1),noSuchName(2),badValue(3),readOnly(4)genErr(5),error-index INTEGER,variable-bindingsSEQUENCE OF nameObjectName,valueOb

5、jectSyntax 6SNMP PDUs (cont.)GetRequest, GetNextRequest, SetRequestGetResponsePDU typerequest-id00variable-bindingsPDU typerequest-iderror-statuserror-indexvariable-bindings7Trap PDUEnterprise: Type of Object generating trap.Agent Address:Address of object generating trap.Generic Trap:Generic trap t

6、ype.Specific Trap:Enterprise specific trap.Time Stamp:表示該 Agent 啟動後,到發(fā)出 trap的時間Variable Bindings“Interesting” informationTrap-PDU := 4IMPLICIT SEQUENCE enterprise OBJECT IDENTIFIER,agent-addr NetworkAddress, generic-trapINTEGER coldStart(0), warmStart(1), linkDown(2), linkUp(3), authenticationFailur

7、e(4), egpNeighborLoss(5), enterpriseSpecific(6),specific-trapINTEGER,time-stampTimeTicks,variable-bindingsVarBindList 8PDU 資料Variable binding VarBindListVarBindList:=SEQUENCE OF VarBindVarBind:=SEQUENCE name ObjectName, value ObjectSyntaxObject NameObject SyntaxObject NameObject Syntax9完整 SNMP 訊息格式S

8、NMP 標頭PDU 標頭PDU 資料10BER 基本編碼方式BER 主要是將 ASN.1所描述的網(wǎng)管物件轉換成 a string of octets 的格式,包含以下三個欄位:Type : 表示該網(wǎng)管物件的資料型態(tài)Length : 表示該網(wǎng)管物件內(nèi)容的長度,以 Byte為單位Value : 表示該網(wǎng)管物件內(nèi)容值11BER 基本編碼方式(cont.)INTEGER (0 x02)OCTET STRING (0 x04)OBJECT IDENTIFIER (0 x06)NULL (0 x05)SEQUENCE/SEQUENCE OF (Ox30)GetRequest-PDU (0 xA0)GetN

9、extRequest-PDU (0 xA1)12BER 基本編碼方式(cont.)GetResponse-PDU (0 xA2)SetRequest-PDU (0 xA3)Trap-PDU (0 xA4)13Example 1Question:Manager 利用 SNMP protocol 去詢問 Agent 的 sysName (.) 經(jīng)過 BER 的編碼過後的 SNMP MessageSNMP 標頭PDU 標頭PDU 資料14Example 1 (cont.)0:30 29 02 01 00 04 06 70 75 62 6C 69 63 a0 1c 02 16:04 05 ae 56

10、02 02 01 00 02 01 00 30 0e 30 0c 06 32:08 2b 06 01 02 01 01 05 00 05 00 紅色:資料型態(tài) 黃色:長度 白色:內(nèi)容INTEGER (0 x02)OCTET STRING (0 x04)OBJECT IDENTIFIER (0 x06)NULL (0 x05)SEQUENCE/SEQUENCE OF (Ox30)GetRequest-PDU (0 xA0)15Object ID 編碼方式針對 object ID 的前面兩個位數(shù)表示方法:例如:.Content:the first two numbers, x and y, enc

11、oded as 40 x+y in 1 byte1.3 - 2B16Example 2 當 Agent 收到 Manager 傳送過來的 Request message 時,立刻作 get Response message 的動作,如下:0:30 3e 02 01 00 04 06 70 75 62 6C 69 63 a2 31 02 16:04 05 ae 56 02 02 01 00 02 01 00 30 23 30 21 06 32:08 2b 06 01 02 01 01 05 00 04 15 INTEGER (0 x02)OCTET STRING (0 x04)OBJECT ID

12、ENTIFIER (0 x06)NULL (0 x05)SEQUENCE/SEQUENCE OF (Ox30)GetRequest-PDU (0 xA0)17Example 330 2C02 01 0004 07 69 6E 74 65 72 6F 70A0 1E02 04 23 41 3D 3E02 01 0002 01 0030 1030 0E06 0A 2B 06 01 02 01 02 02 01 0B 0105 00Message := SEQUENCE (0 x30)versionINTEGER (0 x02)communityOCTET STRING (0 x04)GetRequest-PDU := 0 (10 1 00000 = 0 xA0)request-idRequestID := INTEGER (0 x02)error-statusErrorStatus := INTEGER (0 x02)error-indexErrorIndex := INTEGER (0 x02)variable-bindings VarBindList := SEQUENCE OF (0 x30)VarBind := SEQUENCE (0 x30)nameObjectNa

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論