Network configuration method and device, equipment, storage medium and program product
By introducing a simulation verification method that isolates the simulation view from the configuration view on network devices, the problems caused by network configuration errors are solved, device-level configuration simulation verification is realized, and the safe and efficient operation and maintenance of network devices are ensured.
Patent Information
- Application Number
- CN202411135664.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2026-03-03
AI Technical Summary
In network operations and maintenance, incorrect configurations can easily cause network problems, and existing technologies make it difficult to perform configuration simulation verification without affecting actual business operations.
By isolating the simulation view and the configuration view, the target configuration is simulated and verified on the network device. The simulation is verified through the simulation view, and the configuration is applied in the configuration view after it meets the expectations, ensuring that the simulation verification process does not affect the actual business.
It enables device-level configuration simulation verification on network devices, avoiding configuration errors, ensuring secure operation of services, and improving the accuracy and efficiency of simulation verification.
Smart Images

Figure CN121603371A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network operation and maintenance technology, and in particular to network configuration methods, devices, equipment, storage media and program products. Background Technology
[0002] In network operations and maintenance (O&M) technology, configuring network devices is frequently required. Improper operation and incorrect configuration can easily lead to network problems. Therefore, knowing how to properly configure a network has become a pressing issue. Summary of the Invention
[0003] This application provides a network configuration method, apparatus, device, storage medium, and program product for implementing device-level configuration simulation verification.
[0004] In a first aspect, a network configuration method is provided, which includes: obtaining a target configuration to be configured on a network device; performing simulation verification on the target configuration on the network device based on a simulation view of the network device to obtain a simulation verification result, wherein the data between the simulation view and the configuration view of the network device are isolated from each other; and executing the target configuration on the network device when the simulation verification result indicates that the target configuration has passed the simulation verification.
[0005] In this method, the simulation view based on the network device enables simulation verification of the target configuration on the network device, achieving device-level configuration simulation verification. This ensures that the target configuration executed on the network device passes the simulation verification, avoiding configuration errors and thus preventing network problems caused by incorrect configurations. Furthermore, because the simulation view is isolated from the configuration view, the simulation verification process does not affect the actual services running on the network device, ensuring the safe operation of services during the simulation verification process.
[0006] In one possible implementation, before simulating and verifying the target configuration on the network device based on the network device's simulation view, the method further includes: entering the simulation view from the configuration view by executing a first command line. Entering the simulation view from the configuration view via the first command line makes the operation of entering the simulation view controllable, improving the operational flexibility of the simulation verification.
[0007] In one possible implementation, before simulating and verifying the target configuration on the network device based on the simulation view of the network device, the method further includes: copying at least one of the configuration results or states associated with the target configuration from the database corresponding to the configuration view to the simulation view. This copying method ensures that the simulation verification process is consistent with the actual configuration activation process, improving the accuracy of the simulation verification results. Furthermore, the copying method only needs to copy information related to the target configuration, eliminating the need to copy redundant information and reducing the amount of data stored in the simulation view.
[0008] In one possible implementation, the configuration in the database corresponding to the configuration view is synchronized with the configuration in the database corresponding to the simulation view. Real-time synchronization ensures that the simulation verification process and the actual configuration activation process are from the same source, improving the accuracy of the simulation verification results. Furthermore, the synchronization method allows the simulation view to store information related to the target configuration, which can be directly used when simulating the target configuration without needing to copy it separately, thus improving the efficiency of simulation verification.
[0009] In one possible implementation, after obtaining the simulation verification results, the method further includes: presenting the result of whether the target configuration passed the simulation verification in the simulation view. For example, issuing an exception alarm when the target configuration fails the simulation verification. This allows for quick viewing of the simulation verification results, early warning, and improved maintenance efficiency.
[0010] In one possible implementation, after obtaining the simulation verification results, the method further includes: presenting the change information corresponding to the simulation verification results in the simulation view. Therefore, presenting the change information helps maintenance personnel to analyze and judge the results, improving the accuracy of the simulation verification results.
[0011] In one possible implementation, the target is configured as a routing policy, and the change information includes at least one of the following: a summary of changes in the number of routes, detailed information about the changed routes, and a comparison result of detailed route information filtered by the routing policy. The summary of changes in the number of routes includes at least one of the following: statistical results of changes in the number of routes, statistical results of changes in the number of attributes, statistical results of the number of newly added routes, or statistical results of the number of deleted routes. This achieves a multi-layered presentation of change information under the routing policy.
[0012] In one possible implementation, executing the target configuration on the network device includes: applying the target configuration to the network device based on a configuration view. Thus, the simulation view can be switched back to the configuration view, and the actual configuration is applied based on the configuration view.
[0013] In a second aspect, a network configuration apparatus is provided for executing the method in the first aspect or any possible implementation thereof. Specifically, the network configuration apparatus includes a module for executing the method in the first aspect or any possible implementation thereof.
[0014] In one possible implementation, the apparatus includes: an acquisition module for acquiring a target configuration to be configured on a network device; a simulation module for performing simulation verification on the target configuration on the network device based on a simulation view of the network device to obtain a simulation verification result, wherein the data between the simulation view and the configuration view of the network device are isolated from each other; and an execution module for executing the target configuration on the network device when the simulation verification result indicates that the target configuration has passed the simulation verification.
[0015] In one possible implementation, the execution module is further configured to enter the simulation view by executing a first command line in the configuration view.
[0016] In one possible implementation, the apparatus further includes a copy module for copying at least one of the configuration results or states associated with the target configuration in the database corresponding to the configuration view to the simulation view.
[0017] In one possible implementation, the configuration in the database corresponding to the configuration view is synchronized with the configuration in the database corresponding to the simulation view.
[0018] In one possible implementation, the apparatus further includes a presentation module for presenting the result of whether the target configuration has passed simulation verification in a simulation view.
[0019] In one possible implementation, the presentation module is also used to present change information corresponding to the simulation verification results in the simulation view.
[0020] In one possible implementation, the target is configured as a routing policy, and the change information includes at least one of the following: a summary of changes in the number of routes, detailed information about the changed routes, and a comparison result of detailed route information filtered by the routing policy. The summary of changes in the number of routes includes at least one of the following: statistical results of changes in the number of routes, statistical results of changes in the number of attributes, statistical results of the number of newly added routes, or statistical results of the number of deleted routes. This achieves a multi-layered presentation of change information under the routing policy.
[0021] In one possible implementation, the execution module is used to apply the target configuration to the network device based on the configuration view.
[0022] Thirdly, a network device is provided, comprising: a processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the network device to implement the network configuration method as described in the first aspect or any one of the first aspects above.
[0023] Optionally, the processor may be one or more, and the memory may be one or more.
[0024] Optionally, the memory may be integrated with the processor, or the memory may be separated from the processor.
[0025] In the specific implementation process, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. This application does not limit the type of memory or the way the memory and processor are set.
[0026] Fourthly, a computer-readable storage medium is provided, the storage medium storing at least one instruction, the instruction being loaded and executed by a processor to enable a computer to implement the network configuration method described in the first aspect or any possible implementation of the first aspect.
[0027] Fifthly, a computer program (product) is provided, the computer program (product) comprising: computer program code, which, when executed by a computer, causes the computer to perform the network configuration methods described in the above aspects.
[0028] In a sixth aspect, a chip is provided, including a processor for retrieving and executing instructions stored in a memory, causing a communication device on which the chip is installed to perform the network configuration methods described in the preceding aspects.
[0029] In a seventh aspect, another chip is provided, comprising: an input interface, an output interface, a processor, and a memory, wherein the input interface, the output interface, the processor, and the memory are connected via an internal connection path, and the processor is used to execute code in the memory, wherein when the code is executed, the processor is used to execute the network configuration method in the above aspects.
[0030] It should be understood that the beneficial effects of the technical solutions of the second to seventh aspects of this application and the corresponding possible implementations can be referred to the above-described technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description
[0031] Figure 1 A schematic diagram illustrating the implementation environment of a network configuration method provided in this application embodiment;
[0032] Figure 2 A flowchart illustrating a network configuration method provided in an embodiment of this application;
[0033] Figure 3 A flowchart illustrating a routing policy copying process provided in this application embodiment;
[0034] Figure 4 This is a schematic diagram of the planar architecture of a device provided in an embodiment of this application;
[0035] Figure 5 A schematic diagram illustrating an online pre-verification process for a simulated plane, provided as an embodiment of this application;
[0036] Figure 6 This is a schematic diagram of the structure of a network configuration device provided in an embodiment of this application;
[0037] Figure 7 This application provides a schematic diagram of the structure of a network device according to an embodiment of the present application.
[0038] Figure 8 This is a schematic diagram of the structure of a network device provided in an embodiment of this application. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0040] In the field of communication technology, each device in a communication network operates based on its configuration. Sudden changes in configuration can lead to widespread damage to the communication network. For example, a major cause of configuration changes is improper configuration by network operations personnel, such as incorrectly configuring routing policies. In this scenario, because the incorrectly configured routing policy takes effect immediately and cannot be prevented in advance, it leads to sudden routing changes. Furthermore, the network problems caused by these changes are difficult to locate and time-consuming, ultimately resulting in communication failures and service disruptions. Therefore, configuration changes require a proactive anticipatory mechanism to prevent incorrect configurations from entering the network, helping the operations team to maintain network services with greater confidence and higher quality.
[0041] In one implementation, before implementing routing strategy changes such as adjustments, maintenance, and optimizations to the communication network, thorough testing and verification can be conducted in a digital twin network. Feedback generated on the digital twin network allows for continuous evaluation, correction, and optimization of the changes, minimizing the impact on the real communication network. Simultaneously, the digital twin network records the state and behavior of its digital twin in real time, supporting historical tracing and playback. This enables pre-verification without affecting network operations, significantly reducing trial-and-error costs.
[0042] A digital twin network is a network system that digitally constructs a virtual twin of a physical network entity and can interact and map with the physical network in real time. As a digital mirror image of the physical network infrastructure, the digital twin has almost identical network topology, service, and traffic data models to the physical network. It is a refined, multi-dimensional replica of the real physical network throughout its entire lifecycle, providing a digital verification environment for network operations and maintenance.
[0043] However, digital twin network operation and maintenance resides on the controller. The controller needs to manage network devices, i.e., obtain the configuration file content from the network devices, generate mirror paths and routes, etc. Due to the diversity of controllers from different operators, the management capabilities vary. Dynamic routes learned by the network devices also need to be manually imported into the digital twin network, making real-time updates impossible. Furthermore, routing policies and route selection systems for network devices need to be developed on the controller. Due to the massive number of route combinations, unsupported routing policies are ignored, leading to discrepancies between simulated and actual route selection results. In addition, after simulation verification on the controller, the configuration still needs to be distributed to the network devices, and errors may occur during the process of distributing configurations from the controller to the network devices.
[0044] This application provides a network configuration method applicable to any scenario requiring configuration changes, such as device cutover and upgrade scenarios. Device cutover and upgrade refers to the process of maintaining, updating, or upgrading network devices, which typically involves configuration changes, such as adding or modifying existing configurations. This network configuration method can be executed by any network device in the communication network that requires configuration changes, enabling device-level configuration simulation verification and helping to reduce misconfigurations by maintenance personnel. This application does not limit the applicable communication network for this method; it can be any network used to implement communication. For example, Figure 1 This is a schematic diagram of the architecture of a communication network provided in an embodiment of this application. The communication network may include multiple network devices, which are interconnected, and any two terminal devices can communicate through the communication network.
[0045] See Figure 2 , Figure 2 This is a flowchart illustrating a network configuration method provided in an embodiment of this application. Figure 2 As shown, the method includes, but is not limited to, the following steps 201-203.
[0046] Step 201: Obtain the target configuration to be configured on the network device.
[0047] In this application embodiment, target configuration can refer to any configurable content on the network device, such as routing policies, access control lists (ACLs), Internet Protocol (IP) addresses or subnet masks, border gateway protocols (BGP), intermediate system to intermediate system (IS-IS) and open shortest path first (OSPF) and other interior gateway protocols (IGP), multi-protocol label switching (MPLS) protocols, multicast, quality of service (QoS), virtual private networks (VPNs), segment routing, etc.
[0048] Optionally, the method of obtaining the target configuration is not limited in this embodiment. The target configuration can be written to the network device by maintenance personnel, for example, by sending the target configuration to the network device via command line; alternatively, the network device can receive the target configuration sent by other devices such as controllers. The target configuration can be used to add new configurations to the network device or to modify existing configurations on the network device. In network maintenance during cutover and upgrade scenarios, the target configuration can be a cutover script. By simulating the cutover operation by maintenance personnel using the cutover script, this direct simulation verification method can reduce configuration errors.
[0049] Step 202: Based on the simulation view of the network device, the target configuration is simulated and verified on the network device to obtain the simulation verification results. The data between the simulation view and the configuration view of the network device are isolated from each other.
[0050] Since incorrect configuration of a target configuration can lead to network paralysis or other problems after the target configuration is actually configured on the network device and takes effect, this application embodiment performs simulation verification (i.e., pre-verification) on the target configuration in the simulation view of the network device before the configuration is applied to the network device. This ensures that the configuration is applied to the network device only if the simulation verification results meet expectations, reducing the occurrence of incorrect configurations.
[0051] In this embodiment, the network device includes two views: a configuration view and a simulation view. The configuration view is the original interface used by the network device to issue configurations; for example, it can be a system view or an interface view. Maintenance personnel can write command lines in the configuration view and execute them to issue configurations. The simulation view is a new interface added in this embodiment to simulate and verify the target configuration. Maintenance personnel can write command lines in the simulation view and execute them to simulate the configuration.
[0052] In this design, the data in the simulation view and the configuration view are isolated from each other. Specifically, the database (db) corresponding to the simulation view and the database corresponding to the configuration view are two independent databases. These databases store configuration-related operations, results, and status data. Therefore, configuration operations and results in the simulation view do not affect the configuration in the configuration view. In other words, the target configuration simulated in the simulation view is ineffective in the configuration view. This isolation between the simulation plane in the simulation view and the system runtime plane in the configuration view prevents simulation from impacting system operations.
[0053] Before simulating and verifying the target configuration on the network device in the network device's simulation view, the network device needs to enter the simulation view first. Optionally, the network device can enter the simulation view in several ways, including but not limited to the following.
[0054] Method 1: The network device operates in configuration view, and enters the simulation view by executing a first command line in configuration view. The first command line is the command line used to enter the simulation view. Optionally, the first command line includes a view identifier, which indicates either the configuration view or the simulation view. That is, entering the simulation view by executing the first command line can include entering the simulation view if the view identifier included in the first command line indicates the simulation view. For example, if the target configuration is a routing policy, the first command line could be `simulate route-policy`, where `simulate` is the view identifier indicating the simulation view.
[0055] Method 2: After obtaining the target configuration to be configured, the network device automatically enters the simulation view, or enters the simulation view by default if the target configuration is used to change the configuration. Changing the configuration includes, but is not limited to, adding new configurations, deleting existing configurations, or modifying existing configurations.
[0056] Method 3: After obtaining the target configuration to be configured, the network device includes a field indicating that it should enter the simulation view in the command line for writing the target configuration. The simulation view is entered by executing the field indicating that it should enter the simulation view.
[0057] Therefore, the simulation view can be accessed through any of the three methods described above. Optionally, after accessing the simulation view, a simulation identifier (ID) field can be added to the target configuration. The simulation ID field is used to distinguish whether the target configuration is issued by the simulation view or the configuration view, thereby preventing the target configuration issued by the simulation view from taking effect in the configuration view.
[0058] In this embodiment, simulating and verifying the target configuration means simulating the execution of the target configuration under a simulation view to obtain the simulation verification results. Before simulating and verifying the target configuration on the network device based on the simulation view, relevant data required for simulating the execution of the target configuration is obtained based on the simulation view. For example, configuration content already configured on the network device and associated with the target configuration may include at least one of configuration results or states. Then, under the simulation view, the target configuration is simulated and verified based on at least one of the configuration results or states associated with the target configuration. This allows configuration simulation to be performed on the basis of the original configuration, ensuring that the simulation originates from the same source—that is, the data source used for simulating and verifying the target configuration under the simulation view is the same as the data source used for the configuration to take effect under the configuration view—thus improving the reliability of the simulation verification results.
[0059] In one possible implementation, the process of simulating and verifying the target configuration based on at least one of the configuration results or states associated with the target configuration to obtain the simulation verification result may include updating at least one of the configuration results or states associated with the target configuration according to the target configuration to obtain at least one of the updated new configuration results or new states; and simulating and running at least one of the new configuration results or new states in the service system of the network device based on the simulation view to obtain the simulation verification result.
[0060] In this embodiment, simulating at least one of the new configuration results or new states in the business system based on the simulation view is consistent with the execution logic of actually running at least one of the new configuration results or new states in the business system based on the configuration view. However, the simulated business results do not take effect on the actually running business, i.e., they do not affect the actually running business. For example, by executing a run command line under the simulation view, at least one of the updated new configuration results or new states is simulated and run once in the business system of the network device, obtaining the business results of the business system after the simulation run. These business results are the simulation verification results.
[0061] Optionally, the methods for obtaining the configuration results and status associated with the target configuration include, but are not limited to, the following two approaches: Approach 1: After entering the simulation view, copy the configuration results and status associated with the target configuration from the database under the configuration view to the simulation view according to the target configuration. Approach 2: Synchronize the data in the database under the configuration view to the database under the simulation view in real time, thereby directly obtaining the configuration results and status associated with the target configuration from the database under the simulation view. In other words, maintain dynamic synchronization between the database under the configuration view and the database under the simulation view. For example, generate a mirror image of the system running plane in the simulation plane, and store all the information of the mirror image through a container, i.e., the database under the simulation view.
[0062] The configuration results and status associated with the target configuration may include: the original configuration that has been issued based on the configuration view corresponding to the target configuration, the associated configurations related to the original configuration, the status affected by the original configuration or associated configurations, and the configuration results such as the name, identifier, and attributes corresponding to the original configuration or associated configurations.
[0063] For example, taking the target configuration as the IP address configuration of the first interface as an example, the configuration results and status associated with this IP address configuration may include: the IP address of at least one interface that has been configured under the configuration view. The process of simulating and verifying the target configuration on the network device based on the simulation view of the network device may include: copying the IP address of at least one configured interface stored in the database under the configuration view to the database under the simulation view; in the simulation view, configuring a new IP address based on the target configuration as the first interface, updating the copied configured IP address with the newly configured IP address, and obtaining the updated interface IP address.
[0064] For example, if the configured IP address does not include the IP address of the first interface, adding the IP address of the first interface to the configured IP address will result in an updated interface IP address that includes both the newly configured IP address and the previously configured IP address. Alternatively, if the configured IP address includes the IP address of the first interface, replacing the IP address of the first interface in the configured IP address with the newly configured IP address will result in an updated interface IP address that includes both the newly configured IP address and any previously configured IP addresses that were not replaced. Then, by simulating the corresponding service in the business system using the updated interface IP address, the service results for each interface of the network device under the updated IP address can be obtained. By comparing the service results under the updated IP address with those under the original IP address, the differences in service results before and after the interface IP address update can be identified, allowing analysis of whether the simulation verification results meet the expected configuration.
[0065] As another example, taking a routing policy as the target configuration, a routing policy consists of one or more nodes. Each node includes multiple if-match clauses and apply clauses. The if-match clauses define the matching conditions for that node, and the apply clauses define the operations to be performed on the matched routes. The routing policy uses filters to filter the matching conditions; these filters can include address prefix filters, community attribute filters, or extended community attribute filters, etc. The configuration results and status associated with the target configuration can include: the configuration content of the routing policy, which can include information about all nodes associated with the routing policy, as well as all apply clauses, if-match clauses, and filters associated with all nodes.
[0066] In one possible implementation, the process of simulating and verifying the routing policy to be configured on the network device based on the simulation view may include: obtaining the configuration content of the routing policy to be configured in the simulation view, and simulating and running the configuration content of the routing policy to be configured in the business system in the simulation view to obtain the simulation verification result. Optionally, the process of obtaining the configuration content of the routing policy to be configured may include: calling the configuration content of the routing policy already configured in the configuration view; updating the configuration content of the routing policy already configured in the called configuration view according to the changes in the configuration content of the routing policy to be configured compared to the original routing policy, to obtain the configuration content of the routing policy to be configured.
[0067] In this embodiment, it is assumed that the configuration content of the original routing policy already configured in the configuration view is as shown in Table 1 below. That is, the original routing policy name is aa (i.e., route-policy aa), and routing policy aa includes node 1, node 2, and node 3. Taking node 1 as an example, permit indicates that the matching mode of node 1 in routing policy aa is allowed. Node 1 includes an if-match clause and an apply clause, namely if-match prefix pf4 and apply community 1 delete, which means that if the route prefix matches the address configured in prefix filter pf4, the operation of deleting the community attribute 1 on the route is executed. The address configured in prefix filter pf4 is 1.1.1.1 32.
[0068] Table 1
[0069]
[0070] In the network device's configuration view, enter the simulation view by executing the command `simulate route-policy`. The simulation view can issue alerts to prompt operations personnel, and the simulation will continue only after the operations personnel confirm their request. For example, the alert message might be: "The policy in the simulation view does not take effect in the system view. The policy configuration in the simulation view occupies the policy specification in the system view. Continue?" Operations personnel can execute the `yes` command to force the simulation to continue.
[0071] For example, the configuration changes of the routing policy to be configured in the simulation view compared to the original routing policy aa are shown in Table 2 below. The changes include adding a new node 4 (i.e., route-policy aa permit node 4) and its matching condition (i.e., if-match cost 1), modifying the matching mode of node 1 to deny (i.e., route-policy aa deny node 1), and deleting the original node 2 (i.e., unroute-policy aa permit node 2).
[0072] Table 2
[0073]
[0074] Based on the configuration content of the original routing policy aa shown in Table 1 and the changed configuration content shown in Table 2, the configuration content of the routing policy aa to be configured can be shown in Table 3 below.
[0075] Table 3
[0076]
[0077] For example, when executing the command line for the routing policy to be configured in the simulation view, the name of the routing policy to be configured can be determined to be "aa". During the simulation verification process, the configuration content of the original routing policy "aa" already configured in the configuration view can be directly called. For example, the configuration content associated with the original routing policy "aa" already configured on the network device can be copied to the simulation view through automatic copying, ensuring that the routing policy "aa" to be configured in the simulation view and the original routing policy "aa" already configured in the configuration view are from the same source. Therefore, the configuration content of the routing policy "aa" to be configured in the simulation view is obtained based on the configuration content of the routing policy "aa" already configured in the configuration view, ensuring that the simulation verification result in the simulation view is consistent with the configuration effect result in the configuration view, thus improving the accuracy of the simulation verification result.
[0078] During the copying of the configuration content of the original routing policy 'aa', a new index ID can be generated for the routing policy 'aa' to be configured in the simulation view based on the routing policy name. This new index ID distinguishes between the simulation view and the configuration view, and is stored in the new routing policy 'db' corresponding to routing policy 'aa' in the simulation view. The new routing policy 'db' also stores the configuration content of the routing policy 'aa' to be configured, thus ensuring that the configuration content of the routing policy 'aa' to be configured corresponds to the new index ID. For example, if the routing policy 'aa' to be configured is stored in the routing policy 'db' in the simulation view, and the name of the routing policy 'aa' is the same as the policy name in the original configuration view (both are 'aa'), then the index ID for the routing policy 'aa' needs to be a new one, and the original index ID in the routing policy 'db' of the configuration view is no longer used. Therefore, by distinguishing between the routing policy 'db' in the simulation view and the routing policy 'db' in the configuration view through the difference between the original index ID and the new index ID stored in the routing policy 'db', the routing policy 'db' in the simulation view and the routing policy 'db' in the original configuration view are isolated.
[0079] In other words, in the routing policy database under the configuration view, the original routing policy aa corresponds to the original index ID. In the routing policy database under the simulation view, the routing policy aa to be configured corresponds to a new index ID, which is different from the original index ID. Optionally, the new index ID can be generated after the configuration content of the original routing policy aa is copied, or it can be generated when the copying of the configuration content of the original routing policy aa begins. This application embodiment does not limit the order of generating the new index ID and copying the configuration content of the original routing policy aa. Regardless of the order, after the copying process of the configuration content of the original routing policy aa is completed, the copied configuration content of the original routing policy aa is stored in the configuration content of the routing policy aa to be configured in the routing policy database under the simulation view, corresponding to the generated new index ID. In subsequent copying processes, it can be determined whether the configuration content of the routing policy aa has been copied by judging whether the routing policy database under the simulation view includes the new index ID of the configuration content of the routing policy aa.
[0080] In the embodiments of this application, the copying methods of the original routing policy aa configuration content include, but are not limited to, the following two. The different copying methods result in different ways of obtaining the configuration content of the routing policy aa to be configured.
[0081] Method 1: Directly copy all the configuration content of the original routing policy aa in the configuration view to the simulation view; after copying, in the simulation view, update the copied configuration content of the original routing policy aa according to the changes of the routing policy aa to be configured compared to the original routing policy aa, and obtain the configuration content of the routing policy aa to be configured.
[0082] Method 2: During the copying process of the original routing policy aa in the configuration view, the configuration of the routing policy aa to be configured is updated in conjunction with the changes made to the original routing policy aa compared to the original routing policy aa. This means updating while copying, allowing for rapid acquisition of the configuration of the routing policy aa to be configured after the copy is complete. Optionally, for the first node in the original routing policy aa that overlaps with the node in the changed configuration, during the copying process of the configuration of the first node in the original routing policy aa, the copied configuration of the first node is merged with the configuration of the first node in the changed configuration, and the merged configuration of the first node is stored in the routing policy db in the simulation view. For the second node in the original routing policy aa that does not overlap with the node in the changed configuration, the configuration of the second node in the original routing policy aa is directly copied and stored in the routing policy db in the simulation view. Further, for the third node in the changed configuration that does not overlap with the node in the original routing policy aa, the configuration of the third node is created and stored in the routing policy db in the simulation view based on the changed configuration. Therefore, the configuration content of routing policy aa stored in the routing policy db under the simulation view is the configuration content of the routing policy aa to be configured.
[0083] In summary, after obtaining the configuration content of the routing policy aa to be configured, the configuration content of the routing policy aa to be configured is simulated. Optionally, in the simulation view, by executing the simulation command line, all routes included in the network device are simulated and run through the routing system of the network device according to the configuration content of the routing policy aa to be configured, and the routing results of the simulation run are obtained. For example, the configuration content of the routing policy aa to be configured is stored in the routing policy db in the simulation view and corresponds to the new index ID; after executing the simulation command line used to simulate the routing policy aa to be configured, the index ID of the original routing policy aa at the routing system exit already configured on the network device is replaced with the new index ID of the routing policy aa to be configured, the routing results of all routes passing through the routing system are obtained, and then the new index ID at the routing system exit is replaced back with the index ID of the original routing policy aa.
[0084] The routing results from the simulation run do not affect the actual routing results of the network devices. In other words, the actual routing results of the network devices are still the routing results obtained by all routes according to the original routing policy 'aa' configuration in the routing system. By comparing the routing results from the simulation run with the actual routing results of the network devices, the differences in routing results before and after the simulation configuration of routing policy 'aa' can be obtained, and thus, it is possible to analyze whether the simulation verification results meet the expected configuration results.
[0085] Below, for ease of understanding, we will take method two above as an example, combined with... Figure 3 The following example illustrates the routing policy copying process. First, the configuration command line is executed. It is then determined whether the command line indicates entry into the configuration view or the simulation view. If it indicates entry into the configuration view, the original configuration view's configuration process is followed. If it indicates entry into the simulation view, it is checked whether the routing policy has been copied in the simulation view. If it has, the following merge copying process is executed. If the routing policy has not been copied in the simulation view, it is checked whether the configuration view includes the routing policy.
[0086] One way to check whether a routing policy has been copied in the simulation view is to query the routing policy database in the simulation view based on the routing policy name. If the routing policy database in the simulation view contains the new index ID corresponding to the routing policy to be configured, then the routing policy has been copied; if the routing policy database in the simulation view does not contain the new index ID corresponding to the routing policy to be configured, then the routing policy has not been copied. Alternatively, another way to check whether a routing policy has been copied in the simulation view is to query whether the routing policy database in the simulation view stores the configuration content of the routing policy database in the configuration view. If the routing policy database in the simulation view stores the configuration content of the routing policy database in the configuration view, then the routing policy has been copied; if the routing policy database in the simulation view does not store the configuration content of the routing policy database in the configuration view, then the routing policy has not been copied.
[0087] If a routing policy has not been copied in the simulation view, it is necessary to check whether the routing policy is included in the configuration view. If the routing policy is not included in the configuration view, the copying process ends directly, meaning no copying is required. The routing policy to be configured is created directly in the routing policy database in the simulation view, for example, storing the name, index ID, and configuration content of the routing policy to be configured. If the routing policy is included in the configuration view, the total number of nodes after copying the routing policy is calculated. For example, the total number of nodes is calculated based on the number of already configured nodes and the number of nodes to be configured. If the configuration operation of the node to be configured is an addition, the total number of nodes is the sum of the number of already configured nodes and the number of nodes to be configured. If the configuration operation of the node to be configured is a deletion, the total number of nodes is the difference between the number of already configured nodes and the number of nodes to be configured. It is then checked whether the total number of nodes exceeds the limit, for example, whether it exceeds the node total limit of the configured routing policy. If the total number of nodes exceeds the limit, an error is reported and the simulation verification process ends directly. If the total number of nodes does not exceed the limit, a new index ID is assigned to the routing policy to be configured in the routing policy database in the simulation view based on the name of the routing policy.
[0088] Then, for all nodes under the routing policy to be configured, it is determined whether each node under the routing policy to be configured exists in the already configured routing policies in the configuration view. If all nodes under the routing policy to be configured include nodes that exist in the already configured routing policies, then the merge copy process is executed. If none of the nodes under the routing policy to be configured exist in the already configured routing policies, that is, all nodes under the routing policy to be configured are newly added nodes, then the direct copy process is executed.
[0089] The direct copy process is as follows: Copy all apply clauses corresponding to all nodes under the configured routing policy in the configuration view to the new routing policy database; copy all filters referenced by the apply clauses in the routing policy; and generate a new index ID based on the filter whose name is "copy"; copy all if-match clauses corresponding to the node under the routing policy to the new routing policy database; copy all filters referenced by the if-match clauses in the routing policy; and generate a new index ID based on the filter whose name is "copy". Optionally, the copied filter is a filter that can be modified in the simulation view.
[0090] The merge copy process is as follows: Parse the content of the simulation verification, i.e., the routing policy to be configured. Based on the policy name of the routing policy to be configured (e.g., 'aa'), find the configuration content of the already configured routing policies under the configuration view. Iterate through the configuration content of each already configured routing policy and record it, inserting it into the new routing policy database. This is equivalent to directly copying all apply clauses and if-match clauses under the copy node in the process. Optionally, when the configuration content of an already configured routing policy and the configuration content of the routing policy to be configured belong to the same node, merge the configuration content of the routing policy under the configuration view with the configuration content of the routing policy to be configured. For example, merge the configuration content of the routing policy under the configuration view with the configuration content of the routing policy to be configured, or replace the configuration content of the routing policy under the configuration view with the configuration content of the routing policy to be configured.
[0091] exist Figure 3The copy process shown is based on the routing policy database, where the entire configuration content of the routing policy is copied. This means that the configuration content of all nodes under the routing policy is copied in a single copy, improving efficiency. Optionally, it can be copied node by node sequentially to make the copy process clearer and avoid missing nodes. For example, for each node in the original routing policy in the configuration view, it is checked whether it overlaps with a node in the routing policy to be configured. If a node in the original routing policy overlaps with a node in the routing policy to be configured, then during the copying process of the configuration content of that node in the original routing policy in the configuration view, a merge operation is performed between the two, and the merged configuration content of that node is copied to the simulation view. If the nodes in the original routing policy do not overlap with the nodes in the routing policy to be configured, the configuration content of that node in the original routing policy under the configuration view is directly copied to the simulation view. After each node copy is completed, it is determined whether the configuration content of all nodes under the original routing policy has been copied. If not, the next uncopyable node is obtained, and it is returned to determine whether the node overlaps. The corresponding copy process is executed according to whether they overlap, until all nodes of the original routing policy have been copied.
[0092] As another example, taking the target configuration as a filter, assume that the configuration content of the original filter already configured in the configuration view is as shown in Table 4 below. Here, ip-prefix aa indicates the use of a prefix list named aa, index 10 indicates the index of the prefix list where the matching address rule is configured, and permit 1.1.1.1 32 indicates that the route with address 1.1.1.1 / 32 is allowed to pass.
[0093] Table 4
[0094]
[0095] In the configuration view of the network device, enter the simulation view by executing the `simulate filter` command. For example, the configuration changes of the filter to be configured in the simulation view compared to the original filter are shown in Table 5 below. The changes include adding a new index 20 (i.e., `ip ip-prefix aaindex 20permit 2.2.2.2 32`), modifying the matching mode of index 30 to deny (i.e., `ip ip-prefix aa index30deny 3.3.3.3 32`), and deleting the original index 40 (i.e., `undo ip ip-prefix aa index 40permit 4.4.4.432`).
[0096] Table 5
[0097]
[0098] Similar to the simulation routing strategy described above, during the simulation filter process, when executing the prefix filter command line in the simulation view, the configuration content of the filters already configured in the configuration view can be automatically copied to the simulation view. Based on the copied configuration content of the filters already configured in the configuration view (e.g., the configuration content shown in Table 4) and the changes in the configuration content of the filter to be configured compared to the original filter (e.g., the configuration content shown in Table 5), the configuration content of the filter to be configured is obtained. For example, the configuration content of the filter to be configured can be shown in Table 6. After obtaining the configuration content of the filter to be configured, a simulation run is performed in the business system based on the configuration content of the filter to be configured in the simulation view to obtain simulation verification results.
[0099] Table 6
[0100]
[0101] Step 203: If the simulation verification result indicates that the target configuration has passed the simulation verification, execute the target configuration on the network device.
[0102] After obtaining the simulation verification results, it can be determined whether the target configuration has passed the simulation verification, and the result can be displayed in the simulation view. For example, if the target configuration fails the simulation verification, an alarm or exception message can be issued. Optionally, the simulation view can also display the change information corresponding to the simulation verification results, that is, all information that has changed due to the issuance of the target configuration. This change information can be used to analyze the reasons why the target configuration failed the simulation verification.
[0103] In one possible implementation, after obtaining the simulation verification result, the simulation view can automatically present at least one of the results of whether the target configuration passed the simulation verification or the change information corresponding to the simulation verification result; alternatively, it can present at least one of the results of whether the target configuration passed the simulation verification or the change information corresponding to the simulation verification result by executing a second command line, where the second command line is a command line used to present the simulation result. For example, when the simulation view and the configuration view are dynamically synchronized, since the database corresponding to the simulation view stores all the mirror information, the change information can be directly retrieved from the database after obtaining the simulation verification result. When the simulation view and the configuration view are not dynamically synchronized, relevant information can be copied from the database corresponding to the configuration view by executing the second command line, and then the change information can be retrieved based on the copied relevant information.
[0104] When the target is configured as a routing policy, the change information includes at least one of the following: a summary of changes in the number of routes, detailed information about the changed routes, and a comparison result of detailed route information filtered by the routing policy. The summary of changes in the number of routes includes at least one of the following: statistical results of changes in the number of routes, statistical results of changes in the number of attributes, statistical results of the number of newly added routes, or statistical results of the number of deleted routes.
[0105] For example, after obtaining the simulation verification results, the change information can be presented in a one-click, multi-level manner. For scenarios where BGP public networks support querying statistical information of results from neighbor exit policies using Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6), the command line for presenting a summary of route quantity changes with one click is shown in Table 7 below. This is achieved by executing `display bgp routing-table peer{`. <peeripv4addr> | <peeripv6addr>}route-policy-simulate <route-policy-name>The `export statistics` command line displays the results statistics of the routing policy. Optionally, before displaying, the simulation view issues a warning (Warning: The current CPU usage of 40% is too high and command execution is risky. Continue?) to alert operations personnel that the current 40% CPU usage in the simulation view is too high and command execution is risky. Continue? Continue by executing the `yes` command.
[0106] For example, the presented summary of route number changes includes: the number of route changes after the routing policy is issued, i.e., the number of changes from allow to deny is 10, the number of changes from deny to allow is 15, and the number of attribute changes is 20.
[0107] Table 7
[0108]
[0109] For scenarios where BGP public networks support querying summary information about results from IPv4 or IPv6 neighbor egress policies, the command line for one-click presentation of changed route details is shown in Table 8 below. This is achieved by executing `display bgprouting-table peer{`. <peeripv4addr> | <peeripv6addr>}route-policy-simulate <route-policy-name>The export command line displays the details of the changed routes.
[0110] For example, the presented changes in route details include: 1000 routes (Total number of routes: 1000), 400 allowed routes and 600 denied routes in the original routes (Original routes: permit: 400 deny: 600), 500 allowed routes and 500 denied routes in the simulated routes (Simulated routes: permit: 500 deny: 500), and simulated route changes including 100 changes from allowed to denied, 100 changes from denied to allowed, and 200 attribute changes.
[0111] Table 8
[0112]
[0113]
[0114] For scenarios where BGP public networks support querying and directly displaying the comparison results of detailed route information filtered by old and new routing policies through prefixes, the command line for one-click display of the comparison results of detailed route information filtered by routing policies is shown in Table 9 below. For example, by executing `display bgp routing-table peer{` <peeripv4addr> | <peeripv6addr>}route-policy-simulate <route-policy-name>export{ <ipv4-address> | <ipv6-address>} <mask-length>The command line displays the comparison results of detailed route information after routing policy filtering.
[0115] For example, the comparison results of the route details after filtering by the presented route policy include: details of the original route policy (i.e., the content displayed under Before) and details of the route policy to be configured (i.e., the content displayed under After). Among them, the changed route information is that the multi-exit discriminator (MED) metric value has changed from 0 to 100.
[0116] Table 9
[0117]
[0118]
[0119] Regardless of whether the above information is presented, the simulation verification results can be used to determine whether the target configuration has passed the simulation verification. Optionally, determining whether the target configuration has passed the simulation verification based on the simulation verification results can be done by obtaining the expected results of the target configuration. If the simulation verification results meet the expected results, the target configuration is determined to have passed the simulation verification; if the simulation verification results do not meet the expected results, the target configuration is determined to have failed the simulation verification. The expected results can be manually entered into the network device by the operations and maintenance personnel, or they can be inferred from the network device based on historical data. Alternatively, the change information corresponding to the simulation verification results can be presented first, and the operations and maintenance personnel can analyze the change information to manually determine whether the simulation verification results have passed.
[0120] Therefore, the simulation verification results can determine whether the target configuration has passed the simulation verification. If the simulation verification result indicates that the target configuration has failed the simulation verification, the target configuration will not be executed on the network device, that is, the target configuration will not be actually issued to the network device; if the simulation verification result indicates that the target configuration has passed the simulation verification, the target configuration will be executed on the network device, that is, the target configuration will be actually issued to the network device, making the target configuration effective.
[0121] Executing the target configuration on a network device can include applying the configuration to the network device based on a configuration view. That is, it requires switching back from the simulation view to the configuration view. The methods for switching back to the configuration view include, but are not limited to: automatically switching back to the configuration view when the simulation verification result indicates that the target configuration has passed the simulation verification; or switching back to the configuration view by executing a third command line, which is a command line used to enter the configuration view. Optionally, the third command line includes a view identifier indicating the configuration view. Applying the target configuration to the network device based on the configuration view can be done manually by operations and maintenance personnel based on the configuration view, or it can be done by directly switching from the simulation view to the configuration view via a command line and copying the target configuration to the configuration view.
[0122] Therefore, through the above steps 201-203, device-level configuration simulation verification can be achieved. Figure 4 This is a schematic diagram of the device's planar architecture provided in an embodiment of this application. It can be seen that in this embodiment, the device can be divided into a running plane and a simulation plane. The running plane is the plane running under the configuration view, and the simulation plane is the plane running under the simulation view. The running plane and the simulation plane are isolated. Taking the target configuration as a routing policy as an example, for the running plane, under steady-state operation, if the configuration is directly modified without simulation verification by the simulation plane, the configuration takes effect in real time, causing real-time changes in routing. If the routing is incorrect, it will cause problems, i.e., traffic will change from normal to interrupted. After adding the simulation plane, the routing policy is pre-verified through the simulation view, making the configuration simulation effective, and thus allowing real-time viewing of the routing changes after the simulation takes effect. This ensures that if the routing changes after the simulation take effect meet expectations, the configuration is modified on the running plane only, avoiding routing errors. The configuration taking effect on the simulation plane does not affect the services on the running plane.
[0123] See Figure 5 , Figure 5 This diagram illustrates an online pre-verification process for a simulation plane, as provided in an embodiment of this application. For any network device in the network, it first enters the simulation plane, simulates the original configuration, modifies the simulated original configuration, pre-verifies the modified configuration, and obtains the pre-verification configuration result. Thus, by constructing a simulation plane on the network device, the changes resulting from configuration changes are pre-verified. The simulation plane uses the device's own system architecture, enabling isolation from the system's running plane, preventing simulation from affecting existing service operations. It also ensures that the simulation configuration and system configuration are from the same source, improving the accuracy of simulation results and ensuring that erroneous configurations do not enter the network. Therefore, through device-level simulation, online verification of a single device is achieved without tools, network setup, or offline route import.
[0124] In summary, the method provided in this application, based on the simulation view of a network device, enables simulation verification of the target configuration on the network device. This ensures that the target configuration executed on the network device has passed simulation verification, avoiding configuration errors and thus preventing network problems caused by incorrect configurations. This device-level configuration simulation verification does not require device management or manual import of dynamic routes, avoiding errors that may occur during the controller's distribution of configurations to the network device. Furthermore, since the simulation view and configuration view are isolated, the simulation verification process will not affect the actual services running on the network device, ensuring the safety of service operation during the simulation verification process. By copying or synchronizing, the simulation verification process and the actual configuration activation process are made from the same source, improving the accuracy of the simulation verification results. The multi-layered presentation of change information corresponding to the simulation verification results helps maintenance personnel analyze and judge the data, improving the accuracy of the simulation verification results.
[0125] The network configuration method of this application embodiment has been described above. Corresponding to the above method, this application embodiment also provides a network configuration device. Figure 6 This is a schematic diagram of a network configuration device provided in an embodiment of this application. The device is applied to a network device, which is the aforementioned... Figure 2 The network device shown. Based on Figure 6 The following modules are shown. Figure 6 The network configuration device shown is capable of performing all or part of the operations performed by the network device. It should be understood that the device may include more additional modules than those shown, or may omit some of the modules shown; this application embodiment does not impose limitations in this regard. Figure 6 As shown, the device includes:
[0126] The acquisition module 601 is used to acquire the target configuration to be configured on the network device;
[0127] Simulation module 602 is used to perform simulation verification of the target configuration on the network device based on the simulation view of the network device, and obtain the simulation verification result. The data between the simulation view and the configuration view of the network device are isolated from each other.
[0128] The execution module 603 is used to execute the target configuration on the network device when the simulation verification result indicates that the target configuration has passed the simulation verification.
[0129] In one possible implementation, the execution module 603 is further configured to enter the simulation view by executing a first command line in the configuration view.
[0130] In one possible implementation, the apparatus further includes a copy module for copying at least one of the configuration results or states associated with the target configuration in the database corresponding to the configuration view to the simulation view.
[0131] In one possible implementation, the configuration in the database corresponding to the configuration view is synchronized with the configuration in the database corresponding to the simulation view.
[0132] In one possible implementation, the apparatus further includes a presentation module for presenting the result of whether the target configuration has passed simulation verification in a simulation view.
[0133] In one possible implementation, the presentation module is also used to present change information corresponding to the simulation verification results in the simulation view.
[0134] In one possible implementation, the target is configured as a routing policy, and the change information includes at least one of the following: a summary of changes in the number of routes, detailed information about the changed routes, and a comparison result of detailed route information filtered by the routing policy. The summary of changes in the number of routes includes at least one of the following: statistical results of changes in the number of routes, statistical results of changes in the number of attributes, statistical results of the number of newly added routes, or statistical results of the number of deleted routes. This achieves a multi-layered presentation of change information under the routing policy.
[0135] In one possible implementation, the execution module 603 is used to configure and apply the target configuration on the network device based on the configuration view.
[0136] It should be understood that the above Figure 6 The provided device, when implementing its functions, is only illustrated by the above-described division of functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process and beneficial effects are detailed in the method embodiments, and will not be repeated here.
[0137] See Figure 7 , Figure 7 A schematic diagram of the structure of a network device 2000 provided in an exemplary embodiment of this application is shown. Figure 7 The network device 2000 shown is used to perform the above. Figure 2 The network configuration method shown involves the operations described. The network device 2000 is, for example, a switch, a router, etc., and can be implemented using a general bus architecture.
[0138] like Figure 7 As shown, the network device 2000 includes at least one processor 2001, a memory 2003, and at least one communication interface 2004.
[0139] Processor 2001 may be, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the embodiments of this application. For example, processor 2001 includes application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A PLD may be, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in connection with the embodiments of this invention. A processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0140] Optionally, the network device 2000 also includes a bus. The bus is used to transfer information between the various components of the network device 2000. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by only one line, but this does not mean that there is only one bus or one type of bus.
[0141] Memory 2003 may be, for example, read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.); magnetic disk storage media or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 2003 may exist independently and be connected to processor 2001 via a bus. Memory 2003 may also be integrated with processor 2001.
[0142] The communication interface 2004 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), or wireless local area networks (WLAN). The communication interface 2004 can include wired and wireless communication interfaces. Specifically, the communication interface 2004 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a WLAN interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In this embodiment, the communication interface 2004 can be used by the network device 2000 to communicate with other devices.
[0143] In a specific implementation, as one example, the processor 2001 may include one or more CPUs, such as... Figure 7 The CPUs shown are CPU0 and CPU1. Each of these processors can be a single-core CPU or a multi-core CPU. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0144] In a specific implementation, as one example, the network device 2000 may include multiple processors, such as... Figure 7 The processors shown are 2001 and 2005. Each of these processors can be a single-core CPU or a multi-core CPU. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).
[0145] In a specific implementation, as one example, the network device 2000 may further include output devices and input devices. The output device communicates with the processor 2001 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with the processor 2001 and can receive user input in various ways. For example, the input device may be a mouse, keyboard, touchscreen device, or sensor device, etc.
[0146] In some embodiments, the memory 2003 stores program code 2010 for executing the solution of this application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. That is, the network device 2000 can implement the network configuration method provided in the method embodiment through the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 itself may also store program code or instructions for executing the solution of this application.
[0147] In a specific embodiment, the network device 2000 of this application embodiment can correspond to the network device in the above-described method embodiments. The processor 2001 in the network device 2000 reads the instructions in the memory 2003, causing... Figure 7 The network device 2000 shown can perform all or part of the operations performed by the network device.
[0148] Specifically, the processor 2001 is used to obtain the target configuration to be configured on the network device; to perform simulation verification on the target configuration on the network device based on the simulation view of the network device, and to obtain the simulation verification result. The data between the simulation view and the configuration view of the network device are isolated from each other; if the simulation verification result indicates that the target configuration has passed the simulation verification, the target configuration is executed on the network device.
[0149] Other alternative implementation methods will not be described in detail here for the sake of brevity.
[0150] Network device 2000 can also correspond to the above. Figure 6 The network configuration device shown in the diagram is implemented using software from the network device 2000. In other words, the functional modules included in the network configuration device are generated by the processor 2001 of the network device 2000 reading the program code 2010 stored in the memory 2003.
[0151] in, Figure 2 Each step of the network configuration method shown is completed through integrated logic circuits in the hardware or software instructions in the processor of the network device 2000. The steps of the method disclosed in the embodiments of this application can be directly implemented by the hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. Since this storage medium is located in memory, the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method; to avoid repetition, these will not be described in detail here.
[0152] See Figure 8 , Figure 8 This invention provides a schematic diagram of the structure of a network device 2100 according to another exemplary embodiment of the present application. Figure 8 The network device 2100 shown is used to perform the above. Figure 2 The network configuration method shown involves all or part of the operations. The network device 2100 is, for example, a switch, a router, etc., and can be implemented using a general bus architecture.
[0153] like Figure 8 As shown, the network device 2100 includes a main control board 2110 and an interface board 2130.
[0154] The main control board, also known as the main processing unit (MPU) or route processor card, is used to control and manage the various components in the network device 2100, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 2110 includes a central processing unit 2111 and a memory 2112.
[0155] Interface board 2130 is also called a line processing unit (LPU), linecard, or service board. Interface board 2130 provides various service interfaces and implements packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, etc., with Ethernet interfaces including, for example, Flexible Ethernet Clients (FlexE Clients). Interface board 2130 includes: a central processing unit 2131, a network processor 2132, a forwarding table entry memory 2134, and a physical interface card (PIC) 2133.
[0156] The central processing unit 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110.
[0157] Network processor 2132 is used to implement packet forwarding processing. Network processor 2132 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented using an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA). Specifically, network processor 2132 forwards received packets based on the forwarding table stored in forwarding table entry memory 2134. If the destination address of the packet is the address of network device 2100, the packet is sent to the CPU (such as central processing unit 2131) for processing; if the destination address of the packet is not the address of network device 2100, the next hop and outgoing interface corresponding to the destination address are looked up in the forwarding table according to the destination address, and the packet is forwarded to the outgoing interface corresponding to the destination address. Uplink packet processing may include: packet ingress interface processing, forwarding table lookup; downlink packet processing may include: forwarding table lookup, etc. In some embodiments, the central processing unit can also perform the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for a forwarding chip on the interface board.
[0158] The physical interface card 2133 is used to implement physical layer interfacing functions. Raw traffic enters the interface board 2130 through this card, and processed packets are sent out from the physical interface card 2133. The physical interface card 2133, also called a daughter card, can be installed on the interface board 2130. It is responsible for converting photoelectric signals into packets, performing validity checks on the packets, and forwarding them to the network processor 2132 for processing. In some embodiments, the central processing unit 2131 can also perform the functions of the network processor 2132, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for the network processor 2132 in the physical interface card 2133.
[0159] Optionally, network device 2100 includes multiple interface boards. For example, network device 2100 also includes interface board 2140, which includes: a central processing unit 2141, a network processor 2142, a forwarding table entry memory 2144, and a physical interface card 2143. The functions and implementation methods of each component in interface board 2140 are the same as or similar to those in interface board 2130, and will not be described in detail here.
[0160] Optionally, network device 2100 also includes a switching fabric board 2120. The switching fabric board 2120 can also be referred to as a switch fabric unit (SFU). When network device 2100 has multiple interface boards, the switching fabric board 2120 is used to complete data exchange between the interface boards. For example, interface boards 2130 and 2140 can communicate through the switching fabric board 2120.
[0161] The main control board 2110 and the interface boards are coupled. For example, the main control board 2110, interface boards 2130 and 2140, and the switching network board 2120 communicate with each other via a system bus connected to the system backplane. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and interface boards 2130 and 2140, and communication between the main control board 2110 and interface boards 2130 and 2140 is achieved through the IPC channel.
[0162] Logically, network device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit 2111, while the forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2134, a physical interface card 2133, and a network processor 2132. The control plane performs functions such as router operation, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining the status of network devices. The control plane distributes the generated forwarding tables to the forwarding plane. In the forwarding plane, the network processor 2132 forwards messages received by the physical interface card 2133 based on the forwarding tables distributed by the control plane. The forwarding tables distributed by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same network device.
[0163] It's worth noting that a network device may have one or more main control boards, including a primary and a backup main control board. It may also have one or more interface boards; the more powerful the network device's data processing capabilities, the more interface boards it provides. Each interface board may also have one or more physical interface cards. A switching board may or may not exist; multiple boards can share the load and provide redundancy. In a centralized forwarding architecture, the network device may not need a switching board, as the interface boards handle the entire system's business data processing. In a distributed forwarding architecture, the network device can have at least one switching board, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a distributed architecture network device are greater than those of a centralized architecture network device. Alternatively, the network device can also be a single board, without a switching board. The functions of the interface board and the main control board are integrated on this one board. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU to perform the combined functions. This type of network device has lower data exchange and processing capabilities (e.g., low-end switches or routers). The specific architecture adopted depends on the specific network deployment scenario, and no restrictions are imposed here.
[0164] In a specific embodiment, network device 2100 corresponds to the above. Figure 6 The network configuration apparatus shown. In some embodiments, Figure 6 The acquisition module 601, simulation module 602 and execution module 603 in the network configuration device shown are equivalent to the physical interface card 2133 in the network device 2100.
[0165] It should be understood that the aforementioned processor can be a CPU, or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Computing (RISC) machines (ARM) architecture.
[0166] Furthermore, in an alternative embodiment, the memory described above may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store device type information.
[0167] The memory can be volatile or non-volatile, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0168] This application also provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to enable a computer to implement any of the network configuration methods described above.
[0169] This application also provides a computer program (product) that, when executed by a computer, causes the processor or computer to perform the corresponding steps and / or processes in the above method embodiments.
[0170] This application also provides a chip, including a processor, for calling and executing instructions stored in a memory, causing a communication device with the chip installed to perform any of the network configuration methods described above.
[0171] This application embodiment also provides another chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute any of the network configuration methods described above.
[0172] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to this application are generated, in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk), etc.
[0173] Those skilled in the art will recognize that the method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0174] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0175] When implemented using software, it can be implemented wholly or partially as a computer program product. This computer program product includes one or more computer program instructions. As an example, the methods of this application embodiment can be described in the context of machine-executable instructions, such as program modules that execute on a device on a real or virtual processor of the target. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functionality of program modules can be combined or divided among the described program modules. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside on both local and remote storage media.
[0176] Computer program code used to implement the methods of the embodiments of this application may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the computer or other programmable data processing apparatus, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a computer, partially on a computer, as a standalone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.
[0177] In the context of the embodiments of this application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, etc.
[0178] Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.
[0179] A machine-readable medium can be any tangible medium that contains or stores programs for or relating to an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. More detailed examples of machine-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0180] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be found in the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0181] In the embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or modules, or they may be electrical, mechanical, or other forms of connection.
[0182] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0183] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0184] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0185] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have substantially the same function and purpose. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another. For example, without departing from the scope of various examples, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. Both the first image and the second image can be images, and in some cases, they can be separate and distinct images.
[0186] It should also be understood that, in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0187] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple second messages refer to two or more second messages. The terms "system" and "network" are often used interchangeably in this document.
[0188] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0189] It should also be understood that the term "and / or" as used herein refers to and covers any and all possible combinations of one or more of the associated listed items. The term "and / or" describes an association between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this application generally indicates that the preceding and following related objects are in an "or" relationship.
[0190] It should also be understood that the term "comprising" (also known as "includes", "including", "comprises" and / or "comprising") as used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0191] It should also be understood that the terms "if" and "if" can be interpreted as meaning "when" or "upon" or "in response to determination" or "in response to detection." Similarly, depending on the context, the phrases "if determination..." or "if detection [the stated condition or event]" can be interpreted as meaning "when determination..." or "in response to determination..." or "when detection [the stated condition or event]" or "in response to detection [the stated condition or event]."
[0192] It should be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0193] It should also be understood that the phrases "an embodiment," "a possible implementation," and "an embodiment" used throughout the specification mean that a specific feature, structure, or characteristic related to the embodiment or implementation is included in at least one embodiment of this application. Therefore, the phrases "in an embodiment," "a possible implementation," and "an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0194] The above description is only an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application. < / ipv6-address> < / ipv4-address> < / peeripv4addr> < / peeripv4addr> < / peeripv4addr>
Claims
1. A network configuration method, characterized in that, The method includes: Obtain the target configuration to be configured on the network device; Based on the simulation view of the network device, the target configuration is simulated and verified on the network device to obtain the simulation verification result. The data between the simulation view and the configuration view of the network device are isolated from each other. If the simulation verification result indicates that the target configuration has passed the simulation verification, the target configuration is executed on the network device.
2. The method according to claim 1, characterized in that, Before the simulation view based on the network device performs simulation verification of the target configuration on the network device, it further includes: In the configuration view, enter the simulation view by executing the first command line.
3. The method according to claim 1 or 2, characterized in that, Before the simulation view based on the network device performs simulation verification of the target configuration on the network device, it further includes: Copy at least one of the configuration results or states associated with the target configuration from the database corresponding to the configuration view to the simulation view.
4. The method according to claim 1, characterized in that, The configuration in the database corresponding to the configuration view is synchronized with the configuration in the database corresponding to the simulation view.
5. The method according to any one of claims 1-4, characterized in that, After obtaining the simulation verification results, the process also includes: The simulation view displays the result of whether the target configuration has passed simulation verification.
6. The method according to any one of claims 1-5, characterized in that, After obtaining the simulation verification results, the process also includes: The simulation view displays the change information corresponding to the simulation verification results.
7. The method according to claim 6, characterized in that, The target configuration is a routing policy, and the change information includes at least one of the following: a summary of changes in the number of routes, details of the changes in routes, and comparison results of detailed route information after filtering by the routing policy. The route quantity change summary includes at least one of the following: route quantity change statistics, attribute quantity change statistics, newly added route quantity statistics, or deleted route quantity statistics.
8. The method according to any one of claims 1-7, characterized in that, Executing the target configuration on the network device includes: The target configuration is configured and applied on the network device based on the configuration view.
9. A network configuration device, characterized in that, The device includes: The acquisition module is used to acquire the target configuration to be configured on the network device. The simulation module is used to perform simulation verification of the target configuration on the network device based on the simulation view of the network device, and obtain the simulation verification result. The data between the simulation view and the configuration view of the network device are isolated from each other. An execution module is configured to execute the target configuration on the network device if the simulation verification result indicates that the target configuration has passed the simulation verification.
10. The apparatus according to claim 9, characterized in that, The execution module is also used to enter the simulation view by executing a first command line in the configuration view.
11. The apparatus according to claim 9 or 10, characterized in that, The device further includes a copy module, used to copy at least one of the configuration results or states associated with the target configuration in the database corresponding to the configuration view to the simulation view.
12. The apparatus according to claim 9, characterized in that, The configuration in the database corresponding to the configuration view is synchronized with the configuration in the database corresponding to the simulation view.
13. The apparatus according to any one of claims 9-12, characterized in that, The device further includes a first presentation module, used to present the result of whether the target configuration has passed simulation verification in the simulation view.
14. The apparatus according to any one of claims 9-13, characterized in that, The device further includes a second presentation module, used to present the change information corresponding to the simulation verification result in the simulation view.
15. The apparatus according to claim 14, characterized in that, The target configuration is a routing policy, and the change information includes at least one of the following: a summary of changes in the number of routes, details of the changes in routes, and comparison results of detailed route information after filtering by the routing policy. The route quantity change summary includes at least one of the following: route quantity change statistics, attribute quantity change statistics, newly added route quantity statistics, or deleted route quantity statistics.
16. The apparatus according to any one of claims 9-15, characterized in that, The execution module is used to configure and apply the target configuration on the network device based on the configuration view.
17. A network device, characterized in that, The network device includes a processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the network device to implement the network configuration method according to any one of claims 1-8.
18. A computer-readable storage medium, characterized in that, The computer storage medium stores at least one instruction, which is loaded and executed by a processor to enable the computer to implement the network configuration method as described in any one of claims 1-8.
19. A computer program product, characterized in that, The computer program product includes: computer program code, which is loaded and executed by a computer to enable the computer to implement the network configuration method according to any one of claims 1-8.
Citation Information
Patent Citations
Simulation verification method and device and electric equipment
CN107480327A
Systems and methods for live, on-device configuration validation
CN111258880A
Network anomaly detection and mitigation simulation tool
US20220103576A1