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
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 represen ...
- 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.所以,不太可能出现对于sa ...
- Centos 6.5下一个SNMP简单配置(snmp protocol v3,监控宝)
Centos 6.5下一个SNMP简单配置(snmp protocol v3.监控宝) jom_ch@2014/7/25 1,安装 >yum -y install net-snmp net-sn ...
- 浅议SNMP安全、SNMP协议、网络管理学习
相关学习资料 tcp-ip详解卷1:协议.pdf(重点看25章SNMP部分) http://www.rfc-editor.org/rfc/rfc1213.txt http://www.rfc-edit ...
- 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. ...
- python解析处理snmp回显----snmp
查看服务端配置:https://www.cnblogs.com/dpf-10/p/9175409.html 查看内容示例: D:\python>snmpwalk -v 2c -c public ...
- SNMP Tutorial
Applications: Internet Management (SNMP) 30.1 Introduction 30.2 The Level Of Management Protocols 30 ...
- SNMP: Simple? Network Management Protocol(转)
转自:http://www.rane.com/note161.html An SNMP Overview The Message Format The Actual Bytes Introductio ...
- C++开源库集合
| Main | Site Index | Download | mimetic A free/GPL C++ MIME Library mimetic is a free/GPL Email lib ...
随机推荐
- 从AdventureWorks学习数据库建模——保留历史数据
在业务需求中,经常需要我们在系统中能够记录历史信息,能够查看到历史变动情况,这时我们可以通过增加开始结束时间字段来记录数据的历史版本.对数据的历史记录主要分为:关系.属性历史,实体历史和变更历史. 关 ...
- 《Java JDK7 学习笔记》课后练习题1
1.()组织负责监督审查Java相关技术规格的演进. A. JCP B. Apache C. EU D. W3C 2.Java技术规格必须以()正式文件提交审查. A. RFC B. JSR C. I ...
- Oracle索引梳理系列(五)- Oracle索引种类之表簇索引(cluster index)
版权声明:本文发布于http://www.cnblogs.com/yumiko/,版权由Yumiko_sunny所有,欢迎转载.转载时,请在文章明显位置注明原文链接.若在未经作者同意的情况下,将本文内 ...
- Content-Type 之 application/json 与 text/javascript
我们一般在服务端返回 json 格式数据给浏览器端时,会使用下面的代码: response.setContentType("text/javascript;charset=UTF-8&quo ...
- 关于Thinkcmf中热门文章的使用
今天在做一个首页新闻列表页面的功能时候,因为要读取大量的新闻内容列表.如果每条数据都要从数据按照文章id和term_id来对应取值,无疑是很痛苦的. 然而机智如我,发现cmf框架中热门文章的用法: 在 ...
- Silicon Labs
Silicon Labs(美国芯科实验室)总部位于美国德克萨斯州的奥斯汀,成立于1996年,拥有全球化的运营.销售和研发团队,是一家业界领先的高性能混合信号IC供应商,为业界提供易用的高度集成化产品方 ...
- sql server 2012 数据引擎任务调度算法解析(上)
微软在sql server 2012版本之后,引入了新的任务调度算法,这个算法与之前的版本有一些细微的差别.我在这里试着简单描述一下,一些基本概念就不再赘述了,比如NUMA.scheduler.wor ...
- 在Azure上实现Linux Server故障转移
要充分利用公有云的弹性扩展和高可用, 首先要在应用系统层面支持横向扩展(scale out),这个说起来很容易,或者说对新开发的应用系统而言已经成为标配.但是对已有的.老旧的应用系统来说,这就比较困难 ...
- MATLAB数字图像处理基础
图像的输入.输出和显示 1.图像的输入 imread('filename'), 实际中写的是 >> f = imread('sky.jpg'); 2.图像的显示 imshow ...
- 学UNITY的基础
先看线性代数教材 再看计算机图形学第三章-几何造型技术 和第五章的法向量高等数学教材 的基础 就没有任何疑问了