Snmp from entry to development

Network management based on TCP/IP consists of three components:

1) A Management Information Base MIB (Management InformaTIon Base). The Management Information Base contains all the parameters of all agent processes that can be queried and modified. RFC 1213 [McCloghrie and Rose 1991] defines the second edition of the MIB, called MIB-II.

2) A common set of structure and representation symbols for the MIB. It is called the Structure of Management InformaTI (SMI). This is defined in RFC 1155 [Rose and McCloghrie 1990]. For example, the SMI definition counter is a non-negative integer whose count range is 0~4294967295. When the maximum value is reached, it starts counting from 0.

3) The communication protocol between the management process and the agent process is called Simple Network Management Protocol (SNMP). Defined in RFC 1157 [Case et al. 1990]. SNMP includes the format of datagram exchange, and the like. Although a variety of protocols can be used at the transport layer, the most used protocol in SNMP is UDP.

Snmp from entry to development

I. Overview of SNMP protocol

Simple Network Management Protocol (SNMP) is a set of network management protocols defined by the Internet Engineering Task Force (IETF). The protocol is based on the Simple Gateway Monitor Protocol (SGMP). With SNMP, a management station can remotely manage all network devices that support this protocol, including monitoring network status, modifying network device configuration, and receiving network event alerts. Although SNMP was originally developed for IP-based network management, it was successfully used as an industry standard for telephone network management.

Second, the history of SNMP development

SNMP has undergone a relatively long development process and has gone through three versions so far. The most widely used of the moment is SNMPv2.

In 1989, the first version of SNMP was released, called SNMPv1.

In 1991, a supplement to SNMP was released - RMON (Remote Network Monitoring). RMON extends the capabilities of SNMP, including the management of LANs and the management of devices attached to them. Note: RMON does not modify and add the SNMP protocol itself and SMI. It only increases the ability of SNMP to monitor subnets, and monitors the entire subnet as an individual, providing a new MIB library and related MIB behavior.

An upgraded version of SNMPv1 was introduced in 1993, SNMPv2.

In 1995, SNMPv2 was officially released. v2 added the function of SNMPv1 and specified how to use SNMP in OSI-based networks. At the same time RMON expanded to RMONv2 this year.

In 1998, SNMPv3 was released. A series of documents defined the security of SNMP and defined the overall structure of future improvements. SNMPv3 can be used with v2 and v1.

Third, the working principle of SNMP

SNMP uses a special client/server model, the agent/management station model. The management and maintenance of the network is done through the interaction between the management workstation and the SNMP agent. Each SNMP slave agent is responsible for answering various queries from the SNMP management station (master agent) regarding MIB definition information.

The application scenario of SNMP is shown in Figure 1:

Snmp from entry to development

The management station and the agent use the MIB for interface unification, and the MIB defines the managed objects in the device. Both the management station and the agent implement the corresponding MIB object, so that both parties can identify each other's data and implement communication. The management station requests the data defined in the MIB from the agent, and after the agent recognizes, converts the related state or parameter data provided by the management device into a format defined by the MIB, and finally returns the information to the management station to complete a management operation.

Fourth, SNMP message type

Five message types are defined in SNMP: Get-Request, Get-Response, Get-Next-Request, Set-Request, and Trap.

(1) Get-Request, Get-Next-Request, and Get-Response

The SNMP management station retrieves information from the network device that owns the SNMP agent using the Get-Request message, while the SNMP agent responds with a Get-Response message. Get-Next-Request is used in combination with Get-Request to query column elements in a specific table object.

(2) Set-Request

The SNMP management station uses Set-Request to remotely configure network devices (including device name, device attributes, delete devices, or enable/disable a device attribute).

(3)Trap

The SNMP agent sends a non-request message to the SNMP management station, which is used to describe the occurrence of an event, such as the interface UP/DOWN and IP address change.

Among the above five kinds of messages, Get-Request, Get-Next-Request and Set-Request are sent by the management station to port 161 of the agent side; the latter two Get-Response and Trap are sent by the agent process to the management process, wherein The Trap message is sent to port 162 of the management process, and all data is UDP encapsulated. The SNMP workflow is shown in Figure 2:

Snmp from entry to development

V. SNMP message format

The SNMP agent and the management station communicate via standard messages in the SNMP protocol, each message being a separate datagram. SNMP uses UDP (User Datagram Protocol) as the Layer 4 protocol (Transport Protocol) for connectionless operation. An SNMP message message consists of two parts: an SNMP header and a protocol data unit PDU.

Snmp from entry to development

In an actual network transmission environment, the length of an SNMP packet depends on the encoding method used. SNMP uses BER (Basic Encoding Rule) encoding rules, and the ASN.1 syntax is used in the official SNMP specification. Abastract Syntax NotaTIon v1 is the abstract syntax description language. These two concepts will be further introduced in the later practice, so we only need to know a little about it, and it does not hinder our analysis of the agreement itself. Here we briefly explain the BER encoding rules:

BER, as the basic coding rule of ANS.1, describes how a specific ANS.1 object is encoded as a bitstream for transmission over the network. The BER encoding rule consists of three parts:

Snmp from entry to development

There are several basic data types defined in SNMP, some of which are changed in v1 and v2. For details, see the corresponding RFC documentation. Here we only introduce some of the most common types:

l INTEGER: an integer

l OCTER STRING: 0 or more 8-bit bytes, each byte takes values ​​from 0 to 255

l DisplayString: 0 or more 8 bit bytes, each byte must be ASCII code. In MIB-II, all variables of this type cannot exceed 255 characters (0 characters can be)

l NULL: represents the relevant variable has no value

l IpAddress: 4-byte long OCTER STRING, which represents the IP address in network byte order.

l PhyAddress: 6-byte OCTER STRING, representing the physical address

l Counter: A non-negative integer that can be incremented from 0 to 232-1(). Return to 0 after reaching the maximum value

l TImeTicks: The time counter is incremented by 0.01 second. Different variables can have different increments. So when defining this type of variable, you need to make an incremental range.

l SEQUENCE: similar to the structure in C language

l SEQUENCE OF: a vector, see the ANS.1 syntax details section later

SNMP packets are encapsulated in UDP packets at the transport layer, and UDP is based on IP networks. Therefore, we can get a complete packet description structure, as shown in the following figure:

Snmp from entry to development

The PDU type actually contains two bytes. The first byte indicates the type of the real PDU; the second byte indicates the total number of bytes in the subsequent message. For SNMPv1, the value of this field is as follows:

Table 1 PDU type

PDU type name proxy process initializes itself

An interface of 1warmStart has changed from working state to fault state (the first variable in the message identifies this interface)

3linkUp received an invalid community message from the SNMP management process

5egpNeighborLoss address)

6enterpriseSpecific "span times=""" new=" roman";="" mso-hansi-font-family:"times""" roman";mso-bidi-font-family:"times=" mso-font- Kerning:0pt "="" style="word-wrap: break-word; font-size: 9pt; font-family: Arial; "" find trap information in this particular code snippet

Capture the following SNMP message through the wireshark packet capture tool, and then analyze it carefully.

Snmp from entry to development

The rest are SNMP messages, and then we analyze them one by one against the previous message structure.

Snmp from entry to development

SNMPv2 trap packet

The format of the SNMPv2 Trap packet is shown in Figure 8.

Snmp from entry to development

Similarly, except that the trap type and the packet length are standard network byte order, the remaining protocol fields are also BER encoding. You can see that the v2 version of the trap packet is being developed to the unified packet format. It is very similar to the normal SNMP request and response packets.

SNMPv2 original message content:

Snmp from entry to development

The rest of the content is all SNMP message content, here we make a simple convention:

Xx label type; xx label length; xx label real data.

In this way, the above raw data is analyzed more.

Snmp from entry to development

ZGAR AZ Vape Pods 5.0S

ZGAR AZ Vape Pods 5.0S

ZGAR electronic cigarette uses high-tech R&D, food grade disposable pod device and high-quality raw material. All package designs are Original IP. Our designer team is from Hong Kong. We have very high requirements for product quality, flavors taste and packaging design. The E-liquid is imported, materials are food grade, and assembly plant is medical-grade dust-free workshops.

From production to packaging, the whole system of tracking, efficient and orderly process, achieving daily efficient output. WEIKA pays attention to the details of each process control. The first class dust-free production workshop has passed the GMP food and drug production standard certification, ensuring quality and safety. We choose the products with a traceability system, which can not only effectively track and trace all kinds of data, but also ensure good product quality.



We offer best price, high quality Pods, Pods Touch Screen, Empty Pod System, Pod Vape, Disposable Pod device, E-cigar, Vape Pods to all over the world.

Much Better Vaping Experience!




Pods, Vape Pods, Empty Pod System Vape,Disposable Pod Vape Systems

ZGAR INTERNATIONAL(HK)CO., LIMITED , https://www.oemvape-pen.com

Posted on