Presentation is loading. Please wait.

Presentation is loading. Please wait.

SNMP 訊息格式 IP 標頭 UDP 標頭 SNMP 訊息 SNMP 標頭 PDU 標頭 PDU 資料.

Similar presentations


Presentation on theme: "SNMP 訊息格式 IP 標頭 UDP 標頭 SNMP 訊息 SNMP 標頭 PDU 標頭 PDU 資料."— Presentation transcript:

1 SNMP 訊息格式 IP 標頭 UDP 標頭 SNMP 訊息 SNMP 標頭 PDU 標頭 PDU 資料

2 SNMP Header SNMP Message
Version Identifier Community Name ( “public”) Protocol Data Unit The length of SNMP messages should not exceed 484 octets. Version Community SNMP PDU Message ::= SEQUENCE { version INTEGER {version-1(0)}, community OCTET STRING, data ANY }

3 SNMP 區域名稱 Community Relationship between an Agent and Managers.
Community Name Used 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: “public”.

4 PDU Header 可分成兩種形式 針對 GetRequest , GetNextRequest , SetRequest , GetReponse 針對 Trap 而言 PDU 型態 要求代號 錯誤狀況 錯誤索引 PDU type enterprise agent-addr generic-trap specific-trap time-stamp variable-bindings

5 PDU 型態 五種 SNMP-PDUs 型態 SNMP-PDUs::= CHOICE { getrequest GetRequest-PDU, get-next-request GetNextRequest-PDU, get-response GetResponse-PDU, set-request SetRequest-PDU, trap Trap-PDU}

6 SNMP PDU Request-id Error-status Error-index 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 }

7 SNMP PDUs (cont.) GetRequest, GetNextRequest, SetRequest GetResponse
PDU type request-id variable-bindings PDU type request-id error-status error-index variable-bindings

8 Trap PDU Enterprise: Agent Address: Generic Trap: Specific Trap:
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: 表示該 Agent 啟動後,到發出 trap 的時間 Variable Bindings “Interesting” information

9 PDU 資料 Variable binding VarBindList VarBindList::=SEQUENCE OF VarBind
VarBind::=SEQUENCE { name ObjectName, value ObjectSyntax} Object Name Object Syntax Object Name Object Syntax

10 完整 SNMP 訊息格式 SNMP 標頭 PDU 標頭 PDU 資料

11 BER 基本編碼方式 BER 主要是將 ASN.1所描述的網管物件轉換成 a string of octets 的格式,包含以下三個欄位:
Type : 表示該網管物件的資料型態 Length : 表示該網管物件內容的長度,以 Byte為單位 Value : 表示該網管物件內容值

12 BER 基本編碼方式(cont.) INTEGER (0x02) OCTET STRING (0x04)
OBJECT IDENTIFIER (0x06) NULL (0x05) SEQUENCE/SEQUENCE OF (Ox30) GetRequest-PDU (0xA0) GetNextRequest-PDU (0xA1)

13 BER 基本編碼方式(cont.) GetResponse-PDU (0xA2) SetRequest-PDU (0xA3)
Trap-PDU (0xA4)

14 Example 1 Question:Manager 利用 SNMP protocol 去詢問 Agent 的 sysName ( ) 經過 BER 的編碼過後的 SNMP Message SNMP 標頭 PDU 標頭 PDU 資料

15 Example 1 (cont.) 0: C a0 1c 02 16:04 05 ae e 30 0c 06 32:08 2b 紅色:資料型態 黃色:長度 白色:內容 INTEGER (0x02) OCTET STRING (0x04) OBJECT IDENTIFIER (0x06) NULL (0x05) SEQUENCE/SEQUENCE OF (Ox30) GetRequest-PDU (0xA0)

16 Object ID 編碼方式 針對 object ID 的前面兩個位數表示方法: 例如:1.3.6.1…………..
Content: the first two numbers, x and y, encoded as 40x+y in 1 byte > 2B

17 Example 2 當 Agent 收到 Manager 傳送過來的 Request message 時,立刻作 get Response message 的動作,如下: 0:30 3e C a 16:04 05 ae 32:08 2b … INTEGER (0x02) OCTET STRING (0x04) OBJECT IDENTIFIER (0x06) NULL (0x05) SEQUENCE/SEQUENCE OF (Ox30) GetRequest-PDU (0xA0)

18 Example 3 30 2C E F 70 A0 1E D 3E 30 10 30 0E 06 0A 2B B 01 05 00 Message ::= SEQUENCE (0x30) version INTEGER (0x02) community OCTET STRING (0x04) GetRequest-PDU ::= [0] ( = 0xA0) request-id RequestID ::= INTEGER (0x02) error-status ErrorStatus ::= INTEGER (0x02) error-index ErrorIndex ::= INTEGER (0x02) variable-bindings VarBindList ::= SEQUENCE OF (0x30) VarBind ::= SEQUENCE (0x30) name ObjectName ::= OBJECT IDENTIFIER (0x06) value ObjectSyntax (NULL)

19 Simple Network Management Protocol (SNMP) 參考
RFC 1157 (SNMPv1), RFC 1215 (SNMPv1 Traps) RFCs , (SNMPv2) RFCs (SNMPv3)


Download ppt "SNMP 訊息格式 IP 標頭 UDP 標頭 SNMP 訊息 SNMP 標頭 PDU 標頭 PDU 資料."

Similar presentations


Ads by Google