Search

CN-121984829-A - Network static route configuration method based on SNMP protocol and YANG model compatibility

CN121984829ACN 121984829 ACN121984829 ACN 121984829ACN-121984829-A

Abstract

The application discloses a network static route configuration method compatible with a YANG model based on an SNMP protocol, which comprises the following steps of step 1, serialization conversion from SNMP to YANG, step 2, backward synchronization from the SNMP to the YANG, wherein idxBuf of the SNMP is encoded into a static_route_ args structural body compatible with the YANG, the protocol stack module returns a corresponding processing result to the SNMP after receiving configuration parameter data and processing the configuration parameter data, and then writes an FRR configuration state back to an MIB library through IDB operation of the SNMP, and step 3, large-scale static route configuration is saved and restored. The application can manage YANG equipment without modifying the stock SNMP network management system, reduce the upgrade cost of operators, realize the atomicity guarantee of configuration transaction, ensure that the configuration change is either all effective or all rollback, avoid intermediate state, eliminate the performance bottleneck of large-scale static route configuration preservation, and optimize the configuration recovery speed when the equipment is restarted.

Inventors

  • HU QING
  • YANG GUOWEN

Assignees

  • 北京卓越信通电子股份有限公司

Dates

Publication Date
20260505
Application Date
20251209

Claims (4)

  1. 1. The network static route configuration method compatible with the YANG model based on the SNMP protocol is characterized by comprising the following steps: Step 1, serialization conversion from SNMP to YANG, namely encoding idxBuf of SNMP into a YANG compatible static_route_ args structure body, and supporting efficient compression storage of IPv4/IPv6 addresses, CIDR masks and expansion attributes; Step 2, backward synchronization from YANG to SNMP, namely, after the protocol stack module receives the configuration parameter data and processes the configuration parameter data, returning a corresponding processing result to the SNMP, and writing the FRR configuration state back to the MIB library through IDB operation of the SNMP to ensure that the actual configuration of the SNMP network management system and the equipment is consistent; And 3, large-scale static route configuration preservation and restoration, namely informing a static route protocol module of a configuration preservation and restoration message through an IDB operation of SNMP, preserving YANG model data of the static route as a corresponding XML/JSON/YANG/binary format file by the static route module, and independently carrying out configuration restoration by the static route module when the configuration is restored, reading data from the XML/JSON/YANG/binary format file and restoring the corresponding YANG model.
  2. 2. The network static route configuration method compatible with the YANG model based on the SNMP protocol as set forth in claim 1, wherein the specific implementation procedure of step 1 is as follows: step 1.1, a user issues static route configuration in a CLI, and equipment acquires a parameter configuration request; Step 1.2, the device confirms the device state information of the target device and the parameter configuration data of the user from the acquired parameter configuration request; step 1.3, the equipment encapsulates the explicit equipment state information and the parameter configuration data of the user according to a specified data format, so as to obtain encapsulated data; step 1.4, converting the equipment state information and the parameter configuration data of the user contained in the package data into a standard format static_route_ args compatible with YANG through a preset standard library in a serialization manner to obtain standard package data idxBuf; Step 1.5, the standard encapsulation data are sent to an IDB processing module, the IDB module analyzes the standard encapsulation data to determine the equipment state information and the network parameter configuration data of the target equipment in the standard encapsulation data, and according to the equipment state information and the network parameter configuration data, the standard encapsulation data are subjected to corresponding MIB operation, IPC is carried out through Unix sockets, and YANG compatible standard encapsulation data are transmitted to a corresponding protocol stack module for processing.
  3. 3. The network static route configuration method compatible with the YANG model based on the SNMP protocol as set forth in claim 1, wherein the specific implementation procedure of step 2 is as follows: step 2.1, after receiving standard encapsulation data, the protocol stack module performs data analysis and inverse serialization, and converts idxBuf arrays into a static_route_ args configuration parameter structure according to a predefined rule; Step 2.2, after the reverse serialization is completed, the protocol stack module calls a corresponding FRR interface, submits the static_route_ args configuration to the YANG model, after the YANG model performs some column operations, submits the static_route_ args configuration to the running configuration of the system, completes the installation of the static route and the updating of the routing table item, and returns a status code corresponding to the processing result; And 2.3, receiving the configuration completion message by SNMP, displaying a corresponding error prompt on the CLI if the configuration fails, rolling back the configuration, and displaying the issued configuration correspondingly if the configuration is successful.
  4. 4. The network static route configuration method compatible with the YANG model based on the SNMP protocol as set forth in claim 1, wherein the specific implementation procedure of step 3 is as follows: Step 3.1, a user issues a save configuration at the CLI, and equipment acquires a save configuration request; Step 3.2, after the device obtains the request for storing the configuration, the system calls the callback function of each module to serialize the current running configuration into a configuration character string and writes the configuration character string into a starting configuration file startupCfg in Flash; Step 3.3, when the static route configuration is stored, the IDB module sends an announcement to the static route module through IPC, and sends a storage configuration request to the corresponding static route module for processing; Step 3.4, after the static route receives the saving configuration restart notification, utilizing the API of libyang to directly export struct lyd _node of running_config into an XML/JSON/YANG/binary format and storing the format into a STATICDCFG file in Flash; step 3.5, after the restarting of the operating system is completed, automatically reading a starting configuration file from a designated path, loading configuration into a memory to become current running configuration, and sending a configuration restoration notice to the static routing module through the IDB module; And 3.6, after the static route receives the configuration restoration notification, directly loading the configuration from the STATICDCFG file through the API of libyang, restoring to struct lyd _node, and then assigning the configuration to the running_configuration- > dnode so as to restore the static route operation configuration.

Description

Network static route configuration method based on SNMP protocol and YANG model compatibility Technical Field The invention relates to a compatibility solution between a traditional SNMP (simple network management protocol) network management system and a new generation of YANG model driven network equipment (such as FRRouting, FRR for short), in particular to a network static route configuration method based on the compatibility of SNMP and YANG models, which is suitable for the upgrade transition period, the mixed network management system and the high-density route configuration scene of the network equipment of an operator. Background Traditional network management systems rely on SNMP protocols for device management, but they are based on unstructured MIB (management information base) operations, lacking transactional support for complex routing configurations. The MIB field needs to be written for many times when a static route is configured, the operation is complex, and the configuration part is easy to take effect due to network interruption. The novel network equipment (such as FRR) only supports YANG/NETCONF protocol, and cannot directly interact with the stock SNMP system to form operation and maintenance fracture. Operators need to maintain two sets of management systems at the same time, so that resource waste and operation complexity are increased, and the prior art lacks an efficient mapping method from SNMP parameters to YANG models, and especially has insufficient processing capability on structured data (such as nested routing tables and strategy routing). The OCTET STRING type of SNMP cannot be mapped directly to the leaf-list structure of the YANG model. Meanwhile, when the number of static route configurations exceeds 500, it takes more than 120 seconds for FRR save configuration. The root cause is that YANG/Libyang's data structure is tree-shaped, each static route is a node on the tree, when submitting configuration changes, it is necessary to make depth comparisons (diff) of candidate_config (candidate configuration) and running_config (running configuration) to determine the content of the changes, diff operation essentially recursively traverses each node of two trees, the more nodes, the deeper the recursion, the more times of traversing and comparing, and in the commit preparation process, the snapshot (deep copy) is usually made of candidate_config or running_config for subsequent rollback or revocation. Deep copying recursively allocates and replicates each node, and when the data volume is large (such as thousands of static routes), the allocation and replication times are extremely large, and the time consumption is long naturally, and for large-scale and simple-structure data (such as static routes), the efficiency is far lower than that of a special data structure (such as an array, a linked list and a database). The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art. Disclosure of Invention The invention aims to provide a network static route configuration method compatible with a YANG model based on an SNMP protocol, so as to solve the problems in the prior art. In order to achieve the above purpose, the present invention adopts the following technical scheme: the invention provides a network static route configuration method compatible with a YANG model based on an SNMP protocol, which specifically comprises the following steps: Step 1, serialization conversion from SNMP to YANG, namely encoding idxBuf (index buffer array) of SNMP into a YANG compatible static_route_ args structure body, and supporting efficient compression storage of IPv4/IPv6 addresses, CIDR masks and expansion attributes (such as BFD and MPLS labels); Step 2, backward synchronization from YANG to SNMP, namely, after the protocol stack module receives the configuration parameter data and processes the configuration parameter data, returning a corresponding processing result to the SNMP, and writing the FRR configuration state back to the MIB library through IDB operation of the SNMP to ensure that the actual configuration of the SNMP network management system and the equipment is consistent; And 3, large-scale static route configuration preservation and restoration, namely informing a static route protocol module of a configuration preservation and restoration message through an IDB operation of SNMP, preserving YANG model data of the static route as a corresponding XML/JSON/YANG/binary format file by the static route module, and independently carrying out configuration restoration by the static route module when the configuration is restored, reading data from the XML/JSON/YANG/binary format file and restoring the corresponding YANG model. Further, step 1 includes