CN111988179A - YANG model management system, method and storage medium - Google Patents
YANG model management system, method and storage medium Download PDFInfo
- Publication number
- CN111988179A CN111988179A CN202010849332.2A CN202010849332A CN111988179A CN 111988179 A CN111988179 A CN 111988179A CN 202010849332 A CN202010849332 A CN 202010849332A CN 111988179 A CN111988179 A CN 111988179A
- Authority
- CN
- China
- Prior art keywords
- yang
- api
- module
- netconf
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/02—Standardisation; Integration
- H04L41/0246—Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
- H04L41/082—Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/145—Network analysis or design involving simulating, designing, planning or modelling of a network
Abstract
The invention discloses a YANG model management system, a method and a medium, comprising an API Tools module, an API Table module and a message processing module, wherein the API Tools module is used for acquiring user YANG files and generating an API mapping Table according to the user YANG files; the API Table module comprises a mapping file of a user YANG file on a device hardware interface, namely an API mapping Table; and the message processing module is used for processing and analyzing according to the API mapping table and returning the state message required by the user. According to the invention, by maintaining the mapping relation between the YANG file and the hardware interface of the device, a user can manage the DCI OTN device through NETCONF and YANG models without concerning the internal implementation of the YANG model.
Description
Technical Field
The invention relates to the field of communication, in particular to a YANG model management system, a YANG model management method and a storage medium.
Background
In order to meet the interaction requirement of large bandwidth flow of a data center under the cloud computing trend, the DCI network is constructed by the Internet and operators in a large scale by adopting optical transmission products. The OTN centralizes a specialized NMS management platform and large bandwidth with abundant management overhead, high reliability and diversified protection modes, is no longer a telecommunication network proprietary technology, and the rise of the Internet enables the traditional telecommunication network technology to enter the DCI network industry. At present, after the OTN-based network is combined with novel interfaces such as YANG model, REST API, NETCONF and the like, the same interface is developed for DCI transmission equipment management and IP network equipment management, and therefore unified platform network centralized management is better carried out. However, in the YANG model-based NETCONF system, the content of the YANG files is large and numerous, and if a user needs to use the system, the user must first understand the content of each YANG file, which is quite complex to process.
Disclosure of Invention
The invention aims to solve the technical problems that the content of YANG files is large and numerous, the content of each YANG file needs to be understood when the YANG files are used, and the processing is quite complex.
The invention is realized by the following technical scheme:
the YANG model management system comprises an API Tools module, an API Table module and a message processing module, wherein the API Tools module is used for acquiring a user YANG file and generating an API mapping Table according to the user YANG file; the API Table module comprises a mapping file of the user YANG file on a device hardware interface, namely an API mapping Table; and the message processing module is used for processing and analyzing configuration information according to the API mapping table and returning the state message required by the user.
The invention instantly generates the API mapping table according to the obtained YANG file of the user to adapt to the requirements of the YANG model under different configuration environments, matches the hardware interface of the device through the API mapping table, sets a message processing module to process and analyze the API mapping table, and returns the state message required by the user. Through the three modules, the YANG model is automatically managed, and when the user uses the YANG model, the user can randomly call the YANG model without paying attention to the specific content of each YANG file.
Further, the API Tools module performs the following operations: initializing the API mapping table by taking a YANG file in an OpenConfig YANG model as a reference; updating the API mapping table according to the user YANG file, which specifically comprises the following steps: and comparing the YANG files in the OpenConfig YANG model, updating the API mapping table when the user YANG files have new contents or changed contents, and otherwise reporting an error.
Further, the DCI-based OTN device further includes: the NETCONF Client module is based on a Client of a NETCONF protocol, configures an application program for a network and sends a configuration message to the NETCONF Server module; the NETCONF Server module is used for receiving a configuration message from a NETCONF Client and responding to the NETCONF Client module on the basis of a Server side of a NETCONF protocol; the Sysrepoo Engine module is an open source data storage library based on the YANG model and is used for storing configuration information; a Data files module including the configuration information; a YANG files module, which comprises YANG files needed by the DCI OTN equipment management; and the equipment hardware interface module is used for configuring or reading the operation interface for the hardware according to the API mapping table.
In another implementation manner of the present invention, a YANG model management method, a network device configured based on NETCONF, includes the following steps: s1: obtaining a YANG model file; s2: generating an API mapping table corresponding to the YANG model file; s3: according to the API mapping table, adapting a hardware interface program of the network equipment to the API mapping table; s4: compiling the API mapping table into a dynamic library; s5: loading the dynamic library into the network device program; s6: and starting the network equipment configured based on NETCONF.
Further, the network device configured based on NETCONF includes a DCI OTN device.
In another embodiment of the present invention, a computer-readable storage medium stores a computer program, which when executed by a processor implements the YANG model management method described above.
Compared with the prior art, the invention has the following advantages and beneficial effects:
according to the invention, by maintaining the mapping relation between the YANG file and the hardware interface of the device, a user can manage the DCI OTN device through NETCONF and YANG models without concerning the internal implementation of the YANG model.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:
fig. 1 is a structural block diagram of a DCI OTN device;
FIG. 2 is a flowchart of API Table update;
FIG. 3 is a flow chart of the practical application of the YANG model management system.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to examples and accompanying drawings, and the exemplary embodiments and descriptions thereof are only used for explaining the present invention and are not meant to limit the present invention.
Example 1
This embodiment 1 is a YANG management system, and the core idea is to automatically generate an API function set for operating DCI OTN devices based on an OpenConfig YANG model file set. When the file of the OpenConfig YANG Model is changed or a newly defined YANG file is added, the API functions corresponding to the YANG file required by the user can be quickly generated, and the user can complete the management of the DCI OTN device by the YANG Model-based NETCONF system only by realizing the adaptation with the hardware device in the API functions.
The YANG model is used as a modeling language of NETCONF and can be customized by users, but at present, Internet service providers such as Tencent, Baidu and Ali in China actively promote the OpenConfig YANG model, so that the system takes a file set of the OpenConfig YANG model as a basis for generating a device API function set.
Fig. 1 shows functional module components of the DCI OTN device. The NETCONF Server module and the Sysrepo Engine module are realized by using the existing open source code. The device hardware interface module is an interface implementation related to specific hardware configuration, and needs to be implemented by a user according to actual hardware. The YANG model management system described in this embodiment 1 is a part of the dashed box: the system comprises a message processing module, an API Tools module and an API Table module. These three modules cooperate together to accomplish the management of the YANG model.
The YANG model management system is used for maintaining the mapping relation between the YANG file and the hardware interface of the device, and a user can manage DCI OTN equipment through NETCONF and YANG models without concerning the internal implementation of the YANG model. Currently, most of DCI OTN device software implementations are based on C + +, so the example of this embodiment 1 is based on C + +, but this method is not limited to C + + language.
The function of each module of the following YANG model management system is described below.
First, API Table
The API Table is a mapping file of a group of YANG files and device hardware interfaces, and the mapping file is generated through an API Tools module according to the YANG files. And after the user completes the adaptation of the API and the hardware interface, a dynamic library is generated and loaded into a program of the DCI OTN equipment for operation.
The following API Table is introduced by taking the C + + environment as an example. In this environment, the API Table is two files, openconfig _ Table. hpp and openconfig _ Table. cpp.
The two file mapping principles of openconfig _ table. hpp and openconfig _ table. cpp:
1. one module id corresponds to one array table.
2. A leaf with config being false corresponds to a function of get. The leaf node with config being true corresponds to the function with set.
3. Dynamic create/delete management is supported.
4. A one-to-one correspondence relationship is formed by the XPATH of each leaf point and the API function.
5. The specific implementation of the API function is performed by the user according to the actual hardware interface.
The generation of API tables in the C + + environment will be described by taking openconfig-lldp module as an example.
The following is part of the content of the openconfig-lldp.yang file:
the above YANG file is generated into a corresponding table through an API Tools module, and the table is updated in openconfig _ table. hpp and openconfig _ table. cpp files. The following example is written with reference to two leaf points in the openconfig-lldp module.
The method comprises the steps of generating an openconfig _ lldp _ api _ table array corresponding to an openconfig-lldp module in openconfig _ table.
Naming rule of table array: the module name _ api _ table.
The naming rule of the API function is module name _ XPATH _ OPR, wherein XPATH is XPATH of the leaf point in YANG file. If the config attribute of a leaf point is false, the OPR is "get", and if the config attribute of a leaf is true, the OPR is "set".
Where "-" in the module name is changed to "_".
Some of the function pointer definitions and structure definitions used above are as follows:
API _ INFO is a structure representing the correspondence between leaf points and APIs. Wherein isConfig has the same attribute as the config of the leaf, xpathname represents XPATH corresponding to each leaf, and call _ back represents operation corresponding to each leaf or obtains API interface of hardware configuration.
typedef int(*fun_ptr)(int,string&);
The function pointer is used in the API _ INFO structure for storing the API corresponding to the leaf point.
And generating an empty function of the API corresponding to the two leaf points in the openconfig _ table. The user is required to realize the function according to the condition of hardware, and the main work is to complete the adaptation operation of the YANG API and the hardware device interface.
First parameter opr of API function: the operation of deletion, creation, or modification is indicated in the function of set, and is set to 0 in the function of get.
Second parameter value of API function: the set value is represented in the function of set and the read state value is represented in the function of get. An example of an API function prototype is shown below:
int openconfig_lldp_lldp_config_enabled_set(int opr,string&value)
{
}
int openconfig_lldp_lldp_state_counters_get(int opr,string&value)
{
}
second, API Tools module
The API Tools module is a program that can be executed independently of the DCI OTN device process. The following operations are mainly completed:
1. initialization of API tables
During initialization, an initial API Table is generated by using a YANG file of the OpenConfig YANG model as a reference, and in a C + + environment, OpenConfig _ Table. hpp and OpenConfig _ Table. cpp files are generated.
2. YANG file update
When the YANG file of the user is different from the YANG file in the OpenConfig YANG model, the API Tools will make a determination. As shown in fig. 2.
If the YANG file change is found to be due to a newly added module, then the API Table is updated, in the C + + environment, with the openconfig _ Table. hpp and openconfig _ Table. cpp files being updated.
If the YANG file does not add a new module, but only changes some leaf points, then the corresponding module id corresponding Table is found in the API Table, and the content is updated.
If none of the above is true, then error is reported.
Message processing module
This module is part of the DCI OTN running program. The function of the method is that when the DCI OTN equipment runs, the received configuration message is processed and analyzed, and the state message which needs to be acquired by a user is returned.
The specific flow of processing and analyzing the configuration message is as follows:
when the DCI OTN device is initialized, the message processing module reads the API Table, finds all module ids in the API Table, and registers the module ids to the Sysrepo engine through an interface function sr _ module _ change _ descriptor provided by the Sysrepo engine.
If the registration is successful, when the user performs configuration operation (including creation/deletion/modification) on any leaf of the module through NETCONF, the Sysrepo Engine module notifies the message processing module that the leaf point configuration of the module is changed.
The message processing module obtains the module id, XPATH and configuration value of the changed leaf point from the Sysrepo Engine.
And the message processing module searches a corresponding API interface function in the API Table according to the module id and the XPATH.
And if the API function is found, calling the corresponding API interface function to perform configuration operation. If not found, an error is reported. The specific flow of processing the user to acquire the status message is as follows:
when the DCI OTN equipment is initialized, the message processing module reads the API Table, finds out all leaf points with config attributes of false, and registers the XPATH and the API corresponding to the leaf points into the Sysrepo engine through the function sr _ dp _ get _ items _ describe provided by the Sysrepo engine.
If the registration is successful, when the user executes the operation of acquiring the status message of a certain leaf point through NETCONF, the Sysrepoo engine directly calls the corresponding API of the leaf point through the message module to perform the operation.
Various operations of the user on the DCI OTN equipment based on NETCONF can be completed through the message module.
The NETCONF Client module is a Client based on a NETCONF protocol, configures an application program for a network and sends a configuration message to the NETCONF Server module; the NETCONF Server module is used for receiving the configuration message from the NETCONF Client and responding to the NETCONF Client module on the basis of a Server side of a NETCONF protocol; the Sysrepoo Engine module is an open source data storage library based on the YANG model and is used for storing configuration information; a Data files module including configuration information; the YANG files module comprises YANG files required by DCI OTN equipment management; and the equipment hardware interface module is used for configuring or reading the operation interface for the hardware according to the API mapping table.
Example 2
In this embodiment 2, based on embodiment 1, the YANG model management system is actually applied, and as shown in fig. 3, the application flow is as follows:
1. the user imports the YANG model file that the user needs.
2. Running the API Tool to generate the API Table corresponding to the YANG model, wherein in the C + + environment, the API Table is as follows: openconfig _ table. hpp and openconfig _ table. cpp files.
3. The user completes the adaptation of the hardware interface program and the API of the specific device, namely, the content of the openconfig _ table. cpp function is realized in the C + + environment.
4. And programming the API Table, openconfig _ Table. hpp and openconfig _ Table. cpp in the C + + environment into a dynamic library, and loading the dynamic library into a DCI OTN device program.
5. And starting the DCI OTN device program.
Example 3
This embodiment 3 is a computer-readable storage medium based on embodiments 1 and 2, and when the storage medium is executed by a memory, the storage medium can implement the scheme of embodiment 1 or embodiment 2.
In the present invention, DCI: data Center Interconnect, Data Center Interconnect.
OTN: optical transport network, optical transport network.
The YANG model management system is not limited to DCI OTN equipment, and can be applied to network equipment configured based on NETCONF.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (6)
1. A YANG model management system is characterized in that the YANG model management system comprises an API Tools module, an API Table module and a message processing module,
the API Tools module is used for acquiring a user YANG file and generating an API mapping table according to the user YANG file;
the API Table module comprises a mapping file of the user YANG file on a device hardware interface, namely an API mapping Table; and the message processing module is used for processing and analyzing configuration information according to the API mapping table and returning the state message required by the user.
2. The YANG model management system of claim 1 wherein the API Tools module performs the following operations:
initializing the API mapping table by taking a YANG file in an OpenConfig YANG model as a reference;
updating the API mapping table according to the user YANG file specifically comprises the following steps: and comparing the YANG files in the OpenConfig YANG model, updating the API mapping table when the user YANG files have new contents or changed contents, and otherwise reporting an error.
3. The YANG model management system of claim 2 wherein the DCI-based OTN device further comprises:
the NETCONF Client module is based on a Client of a NETCONF protocol, configures an application program for a network and sends a configuration message to the NETCONF Server module;
the NETCONF Server module is used for receiving a configuration message from a NETCONF Client and responding to the NETCONF Client module on the basis of a Server side of a NETCONF protocol;
the Sysrepoo Engine module is an open source data storage library based on the YANG model and is used for storing configuration information;
a Data files module including the configuration information;
a YANG files module, which comprises YANG files needed by the DCI OTN equipment management;
and the equipment hardware interface module is used for configuring or reading the operation interface for the hardware according to the API mapping table.
4. A YANG model management method is characterized in that a network device configured based on NETCONF comprises the following steps:
s1: obtaining a YANG model file;
s2: generating an API mapping table corresponding to the YANG model file;
s3: according to the API mapping table, adapting a hardware interface program of the network equipment to the API mapping table;
s4: compiling the API mapping table into a dynamic library;
s5: loading the dynamic library into the network device program;
s6: and starting the network equipment configured based on NETCONF.
5. The YANG model management method of claim 4 wherein the NETCONF configuration based network devices comprise DCI OTN devices.
6. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program, when executed by a processor, implements the YANG model management method of claim 4 or 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010849332.2A CN111988179B (en) | 2020-08-21 | 2020-08-21 | YANG model management system, method and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010849332.2A CN111988179B (en) | 2020-08-21 | 2020-08-21 | YANG model management system, method and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111988179A true CN111988179A (en) | 2020-11-24 |
CN111988179B CN111988179B (en) | 2023-02-03 |
Family
ID=73442804
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010849332.2A Active CN111988179B (en) | 2020-08-21 | 2020-08-21 | YANG model management system, method and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111988179B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106559251A (en) * | 2015-09-30 | 2017-04-05 | 中兴通讯股份有限公司 | A kind of Compilation Method and corresponding interface, component and system based on YANG models |
CN108055143A (en) * | 2017-09-30 | 2018-05-18 | 广州西麦科技股份有限公司 | The collocation method and system of a kind of SDN-Hub |
CN108055142A (en) * | 2017-09-30 | 2018-05-18 | 广州西麦科技股份有限公司 | A kind of interface automatic configuration method and system of vCPE equipment |
CN109951315A (en) * | 2019-02-14 | 2019-06-28 | 烽火通信科技股份有限公司 | A kind of method and system realizing YANG model and being mapped to internal model |
WO2020094045A1 (en) * | 2018-11-08 | 2020-05-14 | Huawei Technologies Co., Ltd. | Method for enhancing status communications in a sdn-based communication system |
CN111416736A (en) * | 2020-03-12 | 2020-07-14 | 北京星网锐捷网络技术有限公司 | Configuration management method and device of network equipment, computing equipment and storage medium |
-
2020
- 2020-08-21 CN CN202010849332.2A patent/CN111988179B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106559251A (en) * | 2015-09-30 | 2017-04-05 | 中兴通讯股份有限公司 | A kind of Compilation Method and corresponding interface, component and system based on YANG models |
CN108055143A (en) * | 2017-09-30 | 2018-05-18 | 广州西麦科技股份有限公司 | The collocation method and system of a kind of SDN-Hub |
CN108055142A (en) * | 2017-09-30 | 2018-05-18 | 广州西麦科技股份有限公司 | A kind of interface automatic configuration method and system of vCPE equipment |
WO2020094045A1 (en) * | 2018-11-08 | 2020-05-14 | Huawei Technologies Co., Ltd. | Method for enhancing status communications in a sdn-based communication system |
CN109951315A (en) * | 2019-02-14 | 2019-06-28 | 烽火通信科技股份有限公司 | A kind of method and system realizing YANG model and being mapped to internal model |
CN111416736A (en) * | 2020-03-12 | 2020-07-14 | 北京星网锐捷网络技术有限公司 | Configuration management method and device of network equipment, computing equipment and storage medium |
Non-Patent Citations (5)
Title |
---|
P. SHAFER等: "An Architecture for Network Management Using NETCONF and YANG", 《IETF RFC6244》 * |
R. ENNS等: "Network Configuration Protocol (NETCONF)", 《IETF RFC6241》 * |
白煜: ""基于NETCONF的网络设备配置与管理系统设计与实现"", 《中国优秀硕士学位论文全文数据库》 * |
陈春霖: ""基于NETCONF的通用设备配置管理系统的设计与实现"", 《中国优秀硕士学位论文全文数据库》 * |
隋萌萌: ""基于SDN的校园专网研究与实现"", 《中国优秀硕士学位论文全文数据库》 * |
Also Published As
Publication number | Publication date |
---|---|
CN111988179B (en) | 2023-02-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4509916B2 (en) | SNMP-based network management apparatus and method | |
US8838653B2 (en) | Translating an object-oriented data model to a YANG data model | |
US20180278725A1 (en) | Converting a single-tenant application for multi-tenant use | |
KR101004576B1 (en) | Concatenation discovery web service | |
CN110324169B (en) | Interface management method and device | |
CN107426335B (en) | System capable of automatically generating cloud environment configuration file and use method | |
US10635408B2 (en) | Method and apparatus for enabling agile development of services in cloud computing and traditional environments | |
WO2020062959A1 (en) | Data configuration method and apparatus | |
JP2000504868A (en) | Management interworking unit and method of forming such a unit | |
CN113301116A (en) | Cross-network communication method, device, system and equipment for microservice application | |
CN113381870B (en) | Message processing method and device | |
CN113238740B (en) | Code generation method, code generation device, storage medium and electronic device | |
US11552868B1 (en) | Collect and forward | |
US8356085B2 (en) | Automated transformation of specifications for devices into executable modules | |
Jacoby et al. | FA 3 ST Service–An Open Source Implementation of the Reactive Asset Administration Shell | |
CN115202663A (en) | Data processing method, device and storage medium | |
CN111988179B (en) | YANG model management system, method and storage medium | |
Granderath et al. | A Resource Efficient Implementation of the RESTCONF Protocol for OpenWrt Systems | |
WO2023029881A1 (en) | Device control method and apparatus | |
CN108092959B (en) | BACnet protocol analysis method based on configuration | |
CN109117152B (en) | Service generation system and method | |
KR100545348B1 (en) | An integrated development system for a SyncML server application development | |
CN112182305A (en) | XML (extensive markup language) analysis module and method based on XML rules and management method of configuration data | |
US20060173907A1 (en) | Configuration management system and method using representative object instances | |
CN113886481B (en) | Database access method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |