SNMP Message Format - SNMP Tutorial

30.10 SNMP Message Format

  Unlike most TCP/IP protocols, SNMP messages do not have fixed fields. Instead, they use the standard ASN.1 encoding. Thus, a message can be difficult for humans to decode and understand. After examining the SNMP message definition in ASN.1 notation, we will review the ASN.l encoding scheme briefly, and see an example of an encoded SNMP message. Figure 30.7 shows how an SNMP message can be described with an ASN.l-style grammar. In general, each item in the grammar consists of a descriptive name followed by a declaration of the item‘s type. For example, an item such as

msgversion INTEGER (0..2147483647)

declares the name msgversion to be a nonnegative integer less than or equal to 2147483647.

  As the figure shows, each SNMP message consists of four main parts: an integer that identifies the protocol version, additional header data, a set of security parameters, and a data area that carries the payload. A precise definition must be supplied for each of the terms used. For example, Figure 30.8 illustrates how the contents of the Header-Data section can be specified.

  The data area in an SNMP message is divided into protocol data units (PDUs). Each PDU consists of a request (sent by client) or a response (sent by an agent). SNMPv3 allows each PDU to be sent as plain text or to be encrypted for privacy. Thus, the grammar specifies a CHOICE. In programming language terminology, the concept is known as a discriminated union.

ScopedPduData ::= CHOICE {

plaintext ScopedPDU,

encryptedPDU OCTET STRING -- encrypted ScopedPDU value

}

  An encrypted PDU begins with an identifier of the engine7that produced it. The engine ID is followed by the name of the context and the octets of the encrypted message.

ScopedPDU ::= SEQUENCE {

contextEngineID OCTET STRING,

ontextName OCTET STRING,

data ANY -- e.g., a PDU as defined below

}

  The item labeled data in the ScopedPDU definition has a type ANY because field contextName defines the exact details of the item. The SNMPv3 Message Processing Model (v3MP) specifies that the data must consist of one of the SNMP PDUs as Figure 30.9 illustrates:

  The definition specifies that each protocol data unit consists of one of eight types. To complete the definition of an SNMP message, we must further specify the syntax of the eight individual types. For example, Figure 30.10 shows the definition of a getrequest.

  Further definitions in the standard specify the remaining undefined terms. Both error-status and error-index are single octet integers which contain the value zero in a request. If an error occurs, the values sent in a response identify the cause of the error. Finally, VarBindList contains a list of object identifiers for which the client seeks values. In ASN.l terms, the definitions specify that VarBindList is a sequence of pairs of object name and value. ASN.l represents the pairs as a sequence of two items. Thus, in the simplest possible request, VarBindList is a sequence of two items: a name and a null.

7 SNMF‘v3 distinguishes between an application that uses the service SNMP supplies and an engine, which is the underlying software that transmits requests and receives responses.

Abstract from Internetworking With TCP/IP Vol I: Principles, Protocols, and Architecture Fourth Edition,

DOUGLAS E. COMER,

Department of Computer Sciences Purdue University, West Lafayette, IN 47907,

PRENTICE HALL,

Upper Saddle River, New Jersey 07458

时间: 2025-01-31 09:57:34

SNMP Message Format - SNMP Tutorial的相关文章

Example: Encoded SNMP Message - SNMP Tutorial

30.11 Example Encoded SNMP Message The encoded form of ASN.1 uses variable-length fields to represent items. In general, each field begins with a header that specifies the type of object and its length in bytes. For example, each SEQUENCE begins with

浅议SNMP安全、SNMP协议、网络管理学习

相关学习资料 tcp-ip详解卷1:协议.pdf(重点看25章SNMP部分) http://www.rfc-editor.org/rfc/rfc1213.txt http://www.rfc-editor.org/rfc/rfc1155.txt http://www.rfc-editor.org/rfc/rfc1157.txt http://network.51cto.com/art/201007/209214.htm http://zh.wikipedia.org/wiki/SNMP http

MySQL主从复制中断,报“Error on master: message (format)='Cannot delete or update a parent row: a foreign key constraint fails' error code=1217” 错误

前几天,发现从库挂了,具体报错信息如下: 分析思路 1. 因为我采用的是选择性复制,只针对以下几个库进行复制: card,upay,deal,monitor,collect.所以,不太可能出现对于sas_basic的操作能复制到该从库上. 2. 整个架构是1主2从,且都是选择性复制,上面这个从库是直接复制card,upay,deal,monitor,collect这几个数据库的数据,而另外一个从库则是忽略上述库,如下所示: 怀疑是在上述schema下,执行了DROP TABLE IF EXIST

Centos 6.5下SNMP简单配置(snmp protocol v3,监控宝)

[email protected]/7/25 1,安装 >yum -y install net-snmp net-snmp-devel 2,配置用户信息 > echo "rouser jkb auth" >> /etc/snmp/snmpd.conf > echo "createUser jkb MD5 iampassword" >> /etc/snmp/snmpd.conf 密码至少要有8个字节 3,启动 >serv

邮箱格式的正则表达式与RFC 5322 Internet Message Format

百度下邮箱格式的正则表示,能够搜索到各式各样,五花八门的表示.如果没有仔细甄别,错误使用其中的一些代码,则很可能造成在遇到一些特殊的邮箱格式时无法识别.这里就分析下邮件相关的RFC标准,可详见RFC 5322,  Internet Message Format或[2-RFC5322], 但在此之前需要先学习下[1-RFC5234]中关于ABNF的核心规则. [1-RFC5234] 中Appendix B.  Core ABNF of ABNF B.1.  Core Rules          

什么是SNMP?为什么需要SNMP,以及SNMP的优点?

SNMP是 "Simple Network Management Protocol" 的缩写,中文意思是简单网络管理协议,它是由互联网工作小组在RFC1157中定义的应用层协议,用于在网络实体或节点之间交换管理或监控信息. 作为运维人员,我们很大一部分的工作就是为了保证我们的网络能够正常.稳定的运行.因此监控,控制,管理各种网络设备成了我们日常的工作.在网络兴起的早期,维护方式就是运维人员蹲在近端对设备进行各种操作,当网络设备越来越多,网络规模越来越大时,管理工作会变得越来越单调乏味,

Zabbix的snmp监控一些snmp常用的一些OID (KEY)

摘自: http://www.iyunv.com/thread-167287-1-1.html System Group sysDescr 1.3.6.1.2.1.1.1 sysObjectID 1.3.6.1.2.1.1.2 sysUpTime 1.3.6.1.2.1.1.3 sysContact 1.3.6.1.2.1.1.4 sysName 1.3.6.1.2.1.1.5 sysLocation 1.3.6.1.2.1.1.6 sysServices 1.3.6.1.2.1.1.7 Int

Ubuntu配置SNMP/安装SNMP

   在网上搜了很多Ubuntu下SNMP的安装方法,结果都不能用,下面是自己总结出来的方法,仅供参考~    1.Installation    sudo -i    apt-get install snmpd snmp    2. Configuration    将/etc/snmp/snmpd.conf 这个配置文件,重命名为/etc/snmp/snmpd.conf.org:    mv /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf.org    

SNMP Tutorial

Applications: Internet Management (SNMP) 30.1 Introduction 30.2 The Level Of Management Protocols 30.3 Architectural Model 30.4 Protocol Framework 30.5 Examples of MIB Variables 30.6 The Structure Of Management Information 30.7 Formal Definitions Usi