Snmp introduction, take you to understand the simple network management protocol

foreword

With the rapid development of network technology (FS), the network structure is becoming more and more complex, and there are more and more types of network equipment. Different equipment manufacturers provide different management interfaces (such as CLI). At the same time, the number of network equipment is increasing. The number of geometric levels increases, which makes network management more and more complicated. In this context, SNMP came into being. It can provide a unified interface and protocol, solve the differences between different products, and realize the unified management of network equipment of different types and manufacturers. It simplifies network management, and at the same time, it uses the "network management network" method to realize efficient and batch management of network devices.

Before understanding the SNMP protocol, you must first understand the network models of ISO/OSI and TCP/IP. ISO/OSI divides the network into 7 layers, and the industry into 5 layers, as shown in the figure:

 

1. Introduction to Snmp         

1.1 What is SnmP

SNMP (Simple Network Management Protocol)

SNMP (Simple Network Management Protocol) is a network management standard protocol (application layer protocol) widely used in TCP/IP networks. It provides a central computer (that is, network management workstation) running network management software to monitor and A standardized management framework (method) for managing computer networks. Currently, three versions of SNMPv1, SNMPv2c and SNMPv3 have been promulgated, which are widely used in network devices such as network switches, routers, and printers.

1.2 Snmp function

Manage communication lines . The goal of SNMP is to manage the software and hardware platforms produced by many manufacturers on the Internet, so SNMP is greatly influenced by the Internet standard network management framework. . The architecture of SNMP is to keep the software cost of the management agent (agent) as low as possible; to maintain the function of remote management to the greatest extent so as to make full use of the network resources of the Internet; the architecture must have room for expansion; to maintain the independence of SNMP , It does not depend on specific computers, gateways and network transmission protocols.

1.3 Snmp and UDP

The basic functions of SNMP include monitoring network performance, detecting and analyzing network errors and configuring the network. Simply send the detected problems to the network management workstation. The UDP protocol is connectionless. Compared with TCP, its format has fewer fields and is much simpler. This is also a main reason for the high efficiency of data transmission and the adoption of SNMP.

1.4Snmp version

There are three versions of SNMP: SNMPv1, SNMPv2c and SNMPv3 . SNMPv1: The first version of SNMP, which provides a systematic method for monitoring and managing computer networks. It is based on community name authentication, has poor security, and returns fewer error codes. It is defined in RFC 1155 and RFC 1157. SNMPv2c: The second version of SNMPv2c introduces GetBulk and Inform operations, supports more standard error code information, and supports more data types.

2. The logical structure of Snmp

The SNMP protocol is mainly composed of two parts: SNMP management station and SNMP agent . The SNMP management station is a central node responsible for collecting and maintaining the information of each SNMP element, processing the information, and finally feeding it back to the network administrator; while the SNMP agent runs on each managed network node and is responsible for statistics of the It is responsible for interacting with the SNMP management station, receiving and executing commands from the management station, and uploading various local network information. . There is a loose coupling between the SNMP management station and the SNMP agent. . The communication between them is done through UDP protocol. . Generally, the SNMP management station sends various commands to the SNMP agent through the UDP protocol, and when the SNMP agent receives the command, it returns the parameters required by the SNMP management station.

3. Basic concepts related to Snmp

3.1 Model of agent and management station

 The model of agent and management station Snmp has two roles: SNMP management station (manager, our local machine 127.0.0.1) and SNMP agent (agent, the machine we want to operate, such as 192.168.1.144). A management station refers to a server that runs software that can perform network management tasks. It is usually called a network management station (NMS). The NMS is responsible for sampling agent information in the network and accepting agent traps. ...

3.2 SNMP operation commands

SNMP Operation Commands The reason why the SNMP protocol is easy to use is that it provides three basic operation commands for controlling MIB objects. They are: Get, Set and Trap. ...

3.4MIB 

MIB (Management Information Base) The management information (MIB) base can be understood as the management object database maintained by the agent, and the status and statistical information of most management objects defined in the MIB can be accessed by the NMS. ...

 4. The operation process of SNMP

The running process of SNMP,  the AGENT residing on the managed device receives the serialized message from the network management station through UDP port 161, and obtains the corresponding node of the management variable in the MIB tree through decoding, verification and analysis of the community name. The value of the management variable is obtained in the module, and then a response message is formed, and the code is sent back to the network management station.

5. Advantages and disadvantages of Snmp

5.1 Advantages

  • Based on UDP request response is faster
  • Structured echo (echo is still text, but the content is more structured and requires little parsing)
  • You can query the device at a higher frequency (the higher the frequency, the higher the CPU usage of the device, so it needs to be tested in advance)

5.2 Disadvantages

  • Based on UDP connection, the content is not reliable
  • Authentication ability is relatively weak
  • The correspondence between query items and OIDs is cumbersome

6. Snmp port

The SNMP port is the SNMP communication endpoint, and the SNMP message transmission is carried out through UDP, usually using UDP port number 161/162 . The Transport Layer Security (TLS) or Datagram Transport Layer Security (DTLS) protocols are also sometimes used, and the port usage is shown in the table below.

Guess you like

Origin blog.csdn.net/weixin_74021557/article/details/131192710
Recommended