博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Example: Encoded SNMP Message - SNMP Tutorial
阅读量:6909 次
发布时间:2019-06-27

本文共 2669 字,大约阅读时间需要 8 分钟。

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 an octet containing 30 (hexadecimal); the next octet specifies the number of following octets that comprise the sequence.

  Figure 30.11 contains an example SNMP message that illustrates how values are encoded into octets. The message is a get-request that specifies data item sysDescr (numeric object identifier 1.3.6.1.2.1.1.1.0).Because the example shows an actual message, it includes many details. In particular, the message contains a msgSecurityParameters section which has not been discussed above. This particular message uses the UsmSecurityParameters form of security parameters. It should be possible, however, to correlate other sections of the message with the definitions above.

  As Figure 30.11 shows, the message starts with a code for SEQUENCE which has a length of 103 octets8. The first item in the sequence is a 1-octet integer that specifies the protocol version; the value 3 indicates that this is an SNMPV3 message. Successive fields define a message ID and the maximum message size the sender can accept in a reply. Security information, including the name of the user (ComerBook) follows the message header.

  The GetRequest-PDU occupies the tail of the message. The sequence labeled ScopedPDU specifies a context in which to interpret the remainder of the message. The octet A0 specifies the operation as a get-Request. Because the high-order bit is turned on, the interpretation of the octet is context specific. That is, the hexadecimal value A0 only specifies a GetRequest-PDU when used in context; it is not a universally reserved value. Following the request octet, the length octet specifies the request is 26 octets long. The request ID is 2 octets, but each of the error-status and error-index are one octet. Finally, the sequence of pairs contains one binding, a single object identifier bound to a null value. The identifier is encoded as expected except that the fist two numeric labels are combined into a single octet.

 

8Sequence items occur frequently in an SNMPmessage because SNMP uses SEQUENCE instead of conventional

programming language constructs like arrayor struct

 

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

转载于:https://www.cnblogs.com/klchang/p/5147859.html

你可能感兴趣的文章
设计模式-观察者模式(上)<转>
查看>>
RabbitMQ 集群与高可用配置
查看>>
Android IOS WebRTC 音视频开发总结(六二)-- 大数据解密国外实时通讯行业开发现状...
查看>>
openvas
查看>>
消息推送技术
查看>>
flume 自己定义 hbase sink 类
查看>>
组织目标与个人目标
查看>>
Educational Codeforces Round 8 E. Zbazi in Zeydabad 树状数组
查看>>
自己主动下载源代码_并编译_打包_部署_重新启动服务的Shell脚本
查看>>
常思己过 如切如磋
查看>>
Android中使用Handler造成内存泄露的分析和解决
查看>>
《ArcGIS Engine+C#实例开发教程》第六讲 右键菜单添加与实现
查看>>
ArrayList与LinkedList区别
查看>>
Linux 学习之路:认识shell和bash
查看>>
POJ 3041(最小点覆盖)
查看>>
Viewing the interface of your Swift code,查看Swift代码的头文件的三种方法
查看>>
Custom Accessories
查看>>
【转】xcode APP 打包以及提交apple审核详细流程(新版本更新提交审核)
查看>>
DirectX 3D 之C#开发
查看>>
隐藏nginx 版本号信息(转)
查看>>