Network simulation method and apparatus
Patent Information
- Application Number
- CN202510575519.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]但是,采用网络仿真技术对异构网络进行仿真的准确性较低
[0027]第五方面,提供了一种计算机程序产品,该计算机程序产品包括程序或代码,该程序或代码被执行时实现如上述第一方面或第一方面的任一可选方式所提供的方法。
Smart Images

Figure CN123020384A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technology, and in particular to a network simulation method and apparatus. Background Technology
[0002] In the routine maintenance, service delivery, network monitoring (i.e., observing the communication network), and network dynamics (e.g., modifying network configuration or changing network topology) of communication networks, it is often necessary to simulate the communication network in order to identify potential problems in advance.
[0003] Currently, network simulation technology can be used to simulate communication networks. Network simulation technology is a technique that uses software tools to simulate network behavior, network performance, and protocol characteristics. In the process of simulating a communication network using network simulation technology: first, a virtual network is obtained by modeling the communication network to be simulated (which is a real network, also known as a physical network); then, the protocol behavior of the communication network is simulated based on this virtual network, and the simulation results are output to facilitate network analysis based on these results. Network simulation technology is a technique that simulates specific network conditions in a real or partially real network environment, aiming to construct a 1:1 simulation environment that replicates the real network, thereby testing and verifying the network behavior of the real network based on the simulated environment. In the process of simulating a communication network using network simulation technology: First, a virtual network corresponding to the communication network is generated based on the device images of the network devices in the communication network to be simulated. This virtual network includes multiple virtual nodes that correspond one-to-one with the multiple network devices in the communication network. Each virtual node is a mirror instance obtained by running the device image of the corresponding network device. Each virtual node can process data plane messages and control plane messages according to the protocol behavior of the corresponding network device. Then, the protocol behavior of the communication network is simulated based on the virtual network, and the protocol behavior simulation results are output to facilitate network analysis based on the protocol behavior simulation results.
[0004] However, the accuracy of simulating heterogeneous networks using network simulation technology is relatively low. Furthermore, network simulation technology relies on device mirroring, and running device mirroring incurs significant resource overhead, resulting in high resource costs for simulating communication networks using network simulation technology. Heterogeneous networks, also known as patchwork networks, refer to networks composed of different types of devices and / or devices from different manufacturers. Summary of the Invention
[0005] This application provides a network simulation method and apparatus. The technical solution of this application is as follows.
[0006] Firstly, a network simulation method is provided. The method includes: in response to a simulation request for a communication network, constructing a virtual network corresponding to the communication network, the virtual network including a bridging node, a simulation node corresponding to a first network device in the communication network, a simulated node corresponding to a second network device in the communication network, and a virtual link corresponding to a communication link in the communication network. The simulation node is a virtual node obtained by device modeling based on the configuration information of the first network device, the simulated node is a virtual node generated based on the device image of the second network device, and the virtual link is obtained by link modeling based on the configuration information of the network devices at both ends of the communication link. The virtual link includes a simulated link connected to the simulation node and the simulated node, and the simulated link includes the bridging node, which is used to realize the connection between the simulation node and the simulated node; and simulating protocol behavior of the communication network according to the virtual network, obtaining and outputting the protocol behavior simulation results.
[0007] The technical solution provided in this application uses virtual nodes obtained by modeling devices based on the configuration information of a first network device, and virtual nodes generated based on device images of a second network device. The simulation links connecting the simulation nodes and the virtual nodes include bridging nodes, which facilitate the connection between the simulation nodes. Therefore, this application integrates network simulation and network emulation technologies to simulate communication networks, and uses bridging nodes to connect the simulation nodes. Compared to current network simulation technologies, the technical solution provided in this application has lower support for third-party devices, improves the accuracy of heterogeneous network simulation, and increases the coverage of protocol characteristics. Compared to current network emulation technologies, the technical solution provided in this application has lower resource overhead and is applicable to large-scale communication networks. While leveraging the advantages of network simulation and network emulation technologies, the technical solution provided in this application can, to some extent, address the existing problems of these technologies.
[0008] Optionally, the bridging node is used to enable the connection between the simulation node and the analog node, including at least one of the following: the bridging node is used to perform format conversion on messages transmitted through the simulation link, wherein the message format matching the simulation node is different from the message format matching the analog node; the bridging node is used to establish a neighbor relationship with the analog node based on the address of the simulation node; the bridging node is used to perform clock simulation based on the address of the simulation node and the messages periodically sent by the analog node.
[0009] For example, the virtual network includes at least one bridging node, at least one emulation node corresponding to at least one first network device in the communication network, at least one emulation node corresponding to at least one second network device in the communication network, and at least one virtual link corresponding to at least one communication link in the communication network. Each of the at least one emulation node is a virtual node obtained by device modeling based on the configuration information of the corresponding first network device. Each of the at least one emulation node is a virtual node generated based on the device image of the corresponding second network device. Each of the at least one virtual link is a link modeled based on the configuration information of the network devices at both ends of the corresponding communication link. The at least one virtual link includes at least one emulation link. The at least one bridging node corresponds one-to-one with the at least one emulation link, and each emulation link includes a corresponding bridging node. Each bridging node is used to connect the corresponding emulation node to the corresponding emulation link. The emulation node and the emulation link corresponding to each bridging node are the emulation nodes and emulation links at both ends of the emulation link where each bridging node is located. Specifically, each bridging node is used to connect the corresponding simulation node with the corresponding analog node, including at least one of the following: each bridging node is used to perform format conversion on messages transmitted through the corresponding simulation link; each bridging node is used to establish a neighbor relationship with the corresponding simulation node based on the address of the corresponding simulation node; each bridging node is used to perform clock simulation based on the address of the corresponding simulation node and the messages periodically sent by the corresponding analog node.
[0010] Optionally, the message format matching the simulation node is a first format, and the message format matching the simulation node is a second format. During the process of simulating the protocol behavior of the communication network according to the virtual network, the bridging node is used to: convert the first format message sent by the simulation node through the simulation link into a second format message and send the second format message to the simulation node; and / or convert the second format message sent by the simulation node through the simulation link into a first format message and send the first format message to the simulation node.
[0011] The technical solution provided in this application allows the bridging node to perform format conversion on messages transmitted through the simulated link, so that the format of messages sent and received by the simulated node is a message format that matches the simulated node, and the format of messages sent and received by the simulated node is a message format that matches the simulated node, thereby enabling message communication between the simulated nodes.
[0012] Optionally, during the process of simulating the protocol behavior of the communication network according to the virtual network, the simulation node is used to generate an information-related table based on the received first format message, and the simulation node is used to generate an information-related table based on the received second format message, wherein the information-related table includes at least one of a routing table, a neighbor table, a label table, a link-state database (LSDB) table, or a tunnel information table.
[0013] Optionally, the data structure of the first format message is a human-readable data structure, while the data structure of the second format message is a machine-readable byte stream. For example, the first format message is a data structure obtained by abstracting the message through object-oriented programming, while the second format message is the message itself. The first format message is also called a simulation message or abstract message, and the second format message is also called an emulation message or concrete message.
[0014] Optionally, during the process of simulating the protocol behavior of the communication network according to the virtual network, the bridging node is further configured to: establish a neighbor relationship with the simulated node based on the address of the simulated node, according to the message sent by the simulated node to establish a neighbor relationship between the simulated node and the simulated node. The neighbor relationship established by the bridging node with the simulated node based on the address of the simulated node is the neighbor relationship between the simulated node and the simulated node. During the process of the bridging node establishing a neighbor relationship with the simulated node based on the address of the simulated node: the source address of the message sent by the bridging node to the simulated node to establish the neighbor relationship is the address of the simulated node, and the destination address is the address of the simulated node; the source address of the message sent by the simulated node to the simulated node to establish the neighbor relationship is the address of the simulated node, and the destination address is the address of the simulated node.
[0015] The technical solution provided in this application establishes a neighbor relationship between the bridging node and the simulated node based on the address of the simulated node. Therefore, the bridging node performs the operations that should have been performed by the simulated node in the process of establishing a neighbor relationship, thereby simulating the establishment of a neighbor relationship.
[0016] Optionally, during the process of simulating the protocol behavior of the communication network according to the virtual network, the bridging node is further configured to: receive a first message sent by the simulated node for maintaining the neighbor relationship between the simulated node and the simulated node; and, based on the first message sent by the simulated node for maintaining the neighbor relationship, send a second message to the simulated node for maintaining the neighbor relationship, wherein the source address of the second message is the address of the simulated node, and the destination address of the second message is the address of the simulated node.
[0017] The technical solution provided in this application allows the bridging node to respond to the first message sent by the simulated node for maintaining the neighbor relationship between the simulated node and the simulation node, thereby enabling the maintenance of the neighbor relationship between the simulated node and the simulation node.
[0018] Optionally, the simulated node includes a timing unit. During the simulation of protocol behavior of the communication network according to the virtual network, the simulated node is used to: periodically send a first message to the simulated node to maintain the neighbor relationship between the simulated node and the simulated node, triggered by the timing unit; the bridge node is used to: each time it receives the first message from the simulated node to maintain the neighbor relationship, send a second message to the simulated node to maintain the neighbor relationship. Since the simulated node periodically sends the first message to the simulated node, the bridge node periodically replies to the simulated node with the second message. Thus, the bridge node achieves clock simulation by means of the clock mechanism of the simulated node. Since the simulated node can periodically receive messages whose source address is the address of the simulated node, the simulated node believes that the simulated node has a clock mechanism. Since the simulated node cannot receive the corresponding messages periodically sent by the simulated node, the simulated node is unaware of the clock mechanism of the simulated node.
[0019] Optionally, the bridging node is integrated into the simulation node; or, the bridging node is integrated into the simulation node; or, the bridging node is independent of both the simulation node and the simulation node. When the bridging node is integrated into the simulation node, the simulation node becomes a bridging-enabled simulation node by integrating the bridging node and connects directly to the simulation node. When the bridging node is independent of both the simulation node and the simulation node, the bridging node is positioned between the simulation nodes.
[0020] Optionally, the communication network includes multiple network devices and at least one communication link. In response to a simulation request for the communication network, a virtual network corresponding to the communication network is constructed, including: in response to the simulation request, determining a first network device and a second network device among the multiple network devices; performing device modeling based on the configuration information of the first network device to obtain a simulation node corresponding to the first network device; generating a simulation node corresponding to the second network device based on the device image of the second network device; and performing link modeling based on the configuration information of the two network devices at both ends of the communication link to obtain a virtual link corresponding to the communication link. Further, a bridging node is constructed on the simulated link.
[0021] Optionally, the number of first network devices is at least one, and the number of second network devices is at least one. Determining the first and second network devices from among the plurality of network devices includes: determining the number of first and second network devices based on the number of the plurality of network devices, the amount of resources available for simulating the communication network, the amount of resources required by a single simulated node, and the amount of resources required by a single simulated node. Furthermore, the first and second network devices are determined based on the number of first and second network devices.
[0022] The technical solution provided in this application determines the number of the first network device and the number of the second network device based on the number of the multiple network devices, the amount of resources available for simulating the communication network, the amount of resources required by a single simulation node, and the amount of resources required by a single simulated node, so that the number of the first network device and the number of the second network device can meet the amount of resources available for simulating the communication network.
[0023] Optionally, the number of first network devices is a first quantity, and the number of second network devices is a second quantity. Determining the first and second network devices based on the number of first and second network devices includes: dividing the multiple network devices into two groups, where the number of network devices in the first group is the first quantity, and the number of network devices in the second group is the second quantity, and there is no overlap between the network devices in the first and second groups; determining the network devices in the first group as the first network devices; and determining the network devices in the second group as the second network devices. For example, the multiple network devices can be randomly divided into two groups. Another example is dividing the multiple network devices into two groups according to a partitioning strategy, which can be specified by the user or by a specific algorithm.
[0024] In a second aspect, a network simulation apparatus is provided, comprising at least one functional module for performing the method provided by the first aspect or any alternative method thereof. The at least one functional module may be implemented based on software, hardware, or a combination of both, and may be arbitrarily combined or divided based on a specific implementation.
[0025] Thirdly, a network emulation apparatus is provided, including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to cause the network emulation apparatus to perform the methods provided by the first aspect or any alternative of the first aspect.
[0026] Fourthly, a computer-readable storage medium is provided that stores a computer program, which, when executed, implements the method provided by the first aspect or any alternative method of the first aspect described above.
[0027] Fifthly, a computer program product is provided, comprising a program or code that, when executed, implements the method provided as described in the first aspect or any alternative method of the first aspect.
[0028] In a sixth aspect, a chip is provided that includes programmable logic circuitry and / or program instructions, which, when operated, are used to implement the methods provided by the first aspect or any alternative method of the first aspect described above.
[0029] It should be understood that the beneficial effects achieved by the second to sixth aspects described above can be derived from the beneficial effects achieved by the first aspect and its corresponding possible implementations, and will not be elaborated upon here. Furthermore, the network simulation device mentioned in the second and third aspects can be a server or a functional component within a server, and the chip mentioned in the sixth aspect can be a chip within that server. Attached Figure Description
[0030] Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application;
[0031] Figure 2 This is a schematic diagram of a communication network provided in an embodiment of this application;
[0032] Figure 3 This is a schematic diagram of another communication network provided in an embodiment of this application;
[0033] Figure 4 This is a schematic diagram of another communication network provided in an embodiment of this application;
[0034] Figure 5 This is a schematic diagram of yet another communication network provided in an embodiment of this application;
[0035] Figure 6 This is a flowchart of a network simulation method provided in an embodiment of this application;
[0036] Figure 7 This is a schematic diagram illustrating message format conversion performed by a bridging node according to an embodiment of this application;
[0037] Figure 8 This is a schematic diagram of a Border Gateway Protocol (BGP) message provided in this application.
[0038] Figure 9 This is a schematic diagram illustrating the interaction between a bridging node and a simulated node, provided in an embodiment of this application.
[0039] Figure 10 This is a finite state machine (FSM) state transition diagram provided in an embodiment of this application;
[0040] Figure 11 This is a schematic diagram of a bridging node performing clock simulation according to an embodiment of this application;
[0041] Figure 12 This is a schematic diagram of a virtual network provided in an embodiment of this application;
[0042] Figure 13 This is a schematic diagram of another virtual network provided in an embodiment of this application;
[0043] Figure 14 This is a schematic diagram of another virtual network provided in the embodiments of this application;
[0044] Figure 15 This is a schematic diagram of yet another virtual network provided in the embodiments of this application;
[0045] Figure 16 This is a schematic diagram of yet another communication network provided in an embodiment of this application;
[0046] Figure 17 This is a flowchart of a network simulation method provided in an embodiment of this application;
[0047] Figure 18 This is a schematic diagram of a network simulation device provided in an embodiment of this application;
[0048] Figure 19 This is a schematic diagram of another network simulation device provided in the embodiments of this application. Detailed Implementation
[0049] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0050] With the development of network technology, communication networks are becoming increasingly large-scale (for example, involving thousands or even tens of thousands of network devices and millions of user devices). The network protocols and their characteristics are also becoming increasingly complex (for example, there are many network protocols involved, different protocols influence each other, different protocols may conflict, and each network protocol has a large number of characteristics, resulting in a massive and complex overall set of protocol characteristics). The services carried by communication networks are becoming increasingly complex, and they need to handle traffic from different services. This makes communication networks prone to problems, leading to various possible consequences. For example, in large-scale communication networks, even small-scale problems can have a chain reaction throughout the entire network, resulting in a wide-ranging impact. Any service interruption or data loss caused by network problems can lead to customer complaints, penalties, legal proceedings, and social problems.
[0051] Therefore, in the daily maintenance, service delivery, network monitoring, and network operation of communication networks, it is often necessary to simulate the network's operational status and identify potential problems in advance. Currently, network simulation or network emulation techniques can be used to simulate communication networks.
[0052] Network simulation technology is a technique that uses software tools (i.e., network simulation tools) to simulate network behavior, network performance, and protocol characteristics. In simulating a communication network using network simulation technology: First, the network simulation tool models the communication network to be simulated (the communication network to be simulated is a real network, also known as a physical network) to obtain a virtual network corresponding to that communication network. This virtual network includes multiple virtual nodes corresponding one-to-one with multiple network devices in the communication network, and multiple virtual links corresponding one-to-one with multiple communication links in the communication network. Each virtual node is used to simulate the protocol behavior of the corresponding network device to achieve the corresponding protocol characteristics (for example, if a network device supports the protocol characteristic of route optimization, the virtual node corresponding to that network device is used to simulate the route optimization behavior of that network device to achieve route optimization). Then, the network simulation tool simulates the protocol behavior of the communication network based on this virtual network (specifically, each virtual node simulates the protocol behavior of the corresponding network device) and outputs the protocol behavior simulation results to facilitate network analysis based on these simulation results. Network simulation tools, also known as network simulators, include common tools such as Network Simulator Version (NS) 2, NS3, Wide Area Network Design and Laboratory (WANDL), Optimized Network Engineering Tools - Modeler (OPNET-Modeler), and Optimized Network Engineering Tools - Flow Analysis (OPNET-FlowAn). Some current network verification tools, such as Batfish, also possess network simulation capabilities and can be used for network simulation.
[0053] Network emulation technology boasts advantages such as high simulation speed and low resource consumption. However, its implementation heavily relies on requests for comments (RFCs). Network emulation technology struggles to adapt to the protocol behavior of devices from different vendors, resulting in its inability to simulate the protocol behavior of third-party devices or low accuracy in such simulations. Furthermore, its accuracy in simulating the protocol behavior of network devices that do not support certain protocol features is also low, leading to overall low accuracy in simulating heterogeneous networks (also known as patchwork networks). In addition, network emulation technology has difficulty supporting a massive number of protocol features. It should be noted that in network emulation technology, third-party devices refer to devices from a different vendor than the network emulation tool used to simulate the communication network. These third-party devices are also called third-party vendor devices, and the third-party vendor is different from the vendor of the network emulation tool used to simulate the communication network.
[0054] Specifically, heterogeneous networks include different types of equipment from the same vendor and / or equipment from different vendors. Different types of equipment from the same vendor may support different protocol features. For network devices that do not support certain protocol features, network emulation techniques can simulate their protocol behavior using default behaviors that enable these features (i.e., these network devices implement these protocol features by simulating default behaviors). However, the default behaviors differ from the actual behaviors that implement these protocol features, resulting in low accuracy for network emulation techniques when simulating the protocol behavior of network devices that do not support these features. Equipment from different vendors often exhibits different protocol behaviors for the same protocol feature, and the protocol behaviors of each vendor's equipment are usually not publicly available. Descriptions of protocol behavior in RFCs and vendor product manuals are not comprehensive, making it difficult for network emulation techniques to adapt to the protocol behaviors of equipment from different vendors and unable to simulate the protocol behavior of third-party devices. Alternatively, for third-party devices, default behaviors can be used to simulate their protocol behavior, but the default behaviors differ from the actual behaviors of third-party devices, resulting in low accuracy for network emulation techniques when simulating the protocol behavior of third-party devices. Alternatively, extensive experiments could be conducted to investigate the real-world behavior of third-party devices, thereby simulating their actual behavior. However, investigating the real-world behavior of third-party devices requires significant investment of experimental resources and manpower, resulting in high costs. Therefore, network simulation technology has low accuracy in simulating heterogeneous networks and faces significant challenges in supporting third-party devices. Furthermore, the number of network protocols is vast, and each protocol has a large number of protocol features, resulting in an overall massive number of protocol features. For example, there are currently over 26 network protocols, with an average of over 100 protocol features per protocol, totaling over 2600 protocol features. The development workload of network simulation tools is limited, and the number of protocol features they can cover is also limited, making it difficult for network simulation technology to support such a massive number of protocol features.
[0055] Network emulation is a technique that simulates specific network conditions in a real or partially real network environment. It aims to construct a 1:1 simulation environment that replicates the real network, allowing for the testing and verification of the real network's behavior. In simulating a communication network using network emulation: First, the network simulation tool generates a virtual network corresponding to the network devices in the network to be simulated. This virtual network includes multiple virtual nodes corresponding one-to-one with multiple network devices and multiple virtual links corresponding one-to-one with multiple communication links in the network. Each virtual node is a mirror instance obtained by running the device image of the corresponding network device, and each virtual node can process data plane and control plane messages according to the protocol behavior of the corresponding network device. Then, the network simulation tool simulates the protocol behavior of the communication network based on this virtual network and outputs the simulation results, facilitating network analysis based on these results. Network simulation tools, also known as network emulators, include common tools such as Graphical Network Simulator 3 (GNS3), Emulated Virtual Environment-Next Generation (EVE-NG), Mininet, Packet Tracer, and Enterprise Network Simulation Platform (ENSP). Some current network simulation tools, such as CrystalNet, also possess network verification capabilities, which can be used to verify network properties.
[0056] Network simulation technology uses device images to simulate networks, achieving a high degree of simulation of device protocol behavior (i.e., the simulated protocol behavior is closest to the actual behavior of the device). It can accommodate the protocol behavior of different types of devices from the same vendor, as well as devices from different vendors. Therefore, network simulation technology offers high accuracy for simulating heterogeneous networks. Furthermore, in solutions using network simulation technology to simulate communication networks, users do not need to implement the protocol behaviors specified in RFCs. Network simulation technology supports various protocol features and has high coverage of protocol characteristics. However, network simulation technology relies on device images, and running device images requires starting virtual machines (VMs) or containers (Docker), resulting in significant resource overhead for simulating communication networks using network simulation technology.
[0057] Specifically, running a device image requires starting a VM or container. Starting a VM or container consumes significant central processing unit (CPU) and memory resources, resulting in substantial resource overhead. Consequently, simulating communication networks using network simulation technology also incurs significant resource overhead, making network simulation technology difficult to apply to large-scale communication networks. For example, running a single device image requires 1 vCPU + 2GB of memory. Simulating a communication network with 1000 network devices using network simulation technology would require 1000 vCPU + 2000GB of memory, demonstrating substantial resource overhead. Enterprise networks, campus networks, data center networks, and carrier networks can reach scales of tens of thousands (including tens of thousands of network devices), with some reaching over 20,000. Network devices can also expand their network resources (e.g., by adding cards, interfaces, etc.), with individual network devices potentially having 30+ interfaces. Simulating these communication networks using network simulation technology would incur even greater resource overhead, making network simulation technology difficult to apply to these large-scale communication networks. The "1vCPU + 2GB memory" refers to one virtual CPU and 2 gigabytes (GB) of memory resources. vCPU is a virtualized CPU resource unit, representing the computing power available to a virtual machine or container. Furthermore, the limited resources that a single device image can occupy make it difficult for a network device image to fully cover the network device (e.g., the number of interfaces in the network device image is less than the number of interfaces on the actual network device). When network simulation tools generate a virtual network corresponding to a communication network based on the device images of network devices in the communication network, it is difficult to recreate some communication links in the original communication network (i.e., the generated virtual network does not contain virtual links corresponding to some communication links in the original communication network). This makes it difficult to simulate the protocol behavior of the network devices corresponding to these communication links, resulting in low accuracy in simulating the communication network. The network devices corresponding to a communication link are the network devices connected to that communication link.
[0058] This application provides a network simulation method and apparatus. The network simulation method is a hybrid simulation approach that integrates network simulation and network emulation technologies to simulate communication networks. Compared to current network simulation technologies, the network simulation method provided in this application has lower requirements for supporting third-party devices, improves the accuracy of simulating heterogeneous networks, and increases the coverage of protocol characteristics. Compared to current network emulation technologies, the network simulation method provided in this application has lower resource overhead and can be applied to large-scale communication networks. The network simulation method provided in this application leverages the advantages of both network simulation and network emulation technologies while addressing some of their existing problems.
[0059] It should be noted that, in the embodiments of this application, "third-party device" refers to a device from a different manufacturer than the device simulating the communication network (i.e., the device executing the network simulation method) in the communication network to be simulated. Third-party device is also called third-party vendor device, where the third-party vendor is different from the manufacturer of the device simulating the communication network. Specifically, the network simulation method provided in the embodiments of this application is executed by a network simulation device, and the third-party device refers to a device from a different manufacturer than the network simulation device in the communication network to be simulated.
[0060] The technical solutions of the embodiments of this application are described below. First, the application scenarios of the embodiments of this application are introduced.
[0061] Please refer to Figure 1 The diagram illustrates an application scenario provided by an embodiment of this application. This application scenario includes a communication network 10 and a network simulation device 20 connected to the communication network 10. The network simulation device 20 is used to simulate the communication network 10.
[0062] The network simulation device 20 may be a server; or, the network simulation device 20 may be a functional component within a server; or, the functionality of the network simulation device 20 may be distributed across multiple servers. For example, the network simulation device 20 includes multiple functional modules, some of which are located on one server, while others are located on one or more other servers. These multiple servers may form a server cluster, or they may be located in a cloud computing service center; this embodiment of the application does not limit this.
[0063] Communication network 10 can be any type of network, such as an enterprise network, metropolitan area network, wide area network, campus network, Internet, private network, data center network, or carrier network. Communication network 10 includes multiple network devices and at least one communication link, with each communication link deployed between two network devices. Network devices can be devices used for service forwarding, such as switches or routers, or security devices (e.g., firewalls). All network devices in communication network 10 can be of the same type and from the same vendor, or communication network 10 can include different types of network devices from the same vendor and / or network devices from different vendors. When communication network 10 includes different types of network devices from the same vendor and / or network devices from different vendors, communication network 10 is also referred to as a heterogeneous network or a mixed network. When all network devices in communication network 10 are from the same manufacturer, the manufacturer of all network devices in communication network 10 may be the same as or different from the manufacturer of network emulation device 20. If the manufacturers of all network devices in communication network 10 are different from the manufacturer of network emulation device 20, all network devices in communication network 10 are third-party devices. If the manufacturers of all network devices in communication network 10 are the same as the manufacturer of network emulation device 20, all network devices in communication network 10 are non-third-party devices (also referred to as devices from the same manufacturer). When communication network 10 includes network devices from different manufacturers, some network devices in communication network 10 may have the same manufacturer as network emulation device 20, while others may have different manufacturers. Network devices with the same manufacturer as network emulation device 20 are non-third-party devices, while network devices with different manufacturers are third-party devices.
[0064] For an example, please refer to Figure 2 This illustration shows a schematic diagram of a communication network 10 provided in an embodiment of this application. The communication network 10 includes network devices R1 to R15 and multiple communication links (a connection between any two network devices R1 to R15 represents a communication link deployed between those two network devices). Network simulation device 20 ( Figure 2 (Not shown) It can communicate with network devices R1 to R15. The network emulation device 20 is used for... Figure 2 The communication network 10 shown is simulated. Network devices R1 to R15 can be network devices of the same type from the same manufacturer, or network devices R1 to R15 can include network devices of different types from the same manufacturer and / or network devices from different manufacturers.
[0065] For another example, please refer to Figure 3This illustration shows a schematic diagram of another communication network 10 provided in an embodiment of this application. The communication network 10 is a ring network. The communication network 10 includes network devices R1 to R8 and multiple communication links. The network devices R1 to R8 are connected sequentially to form a ring. The connection between any two network devices R1 to R8 represents the communication link deployed between those two network devices. Network simulation device 20 ( Figure 3 (Not shown in the image) It can communicate with network devices R1 to R8. The network emulation device 20 is used for... Figure 3 The communication network 10 shown is simulated. In... Figure 3 In the communication network 10 shown, network devices R1 to R8 can be network devices of the same type from the same manufacturer, or network devices R1 to R8 can include network devices of different types from the same manufacturer and / or network devices from different manufacturers.
[0066] In another example, please refer to Figure 4 This illustration shows a schematic diagram of another communication network 10 provided in an embodiment of this application. The communication network 10 includes network devices R1 to R14 and multiple communication links (a connection between any two network devices R1 to R14 represents a communication link deployed between those two network devices). Network simulation device 20 ( Figure 4 (Not shown in the image) It can communicate with network devices R1 to R14. The network emulation device 20 is used for... Figure 4 The communication network 10 shown is simulated. Network devices R1 to R14 can be network devices of the same type from the same manufacturer, or network devices R1 to R13 can include network devices of different types from the same manufacturer and / or network devices from different manufacturers.
[0067] In this embodiment, when the communication network 10 is a mixed-signal network, the network devices in the communication network 10 may include third-party devices (i.e., devices from a different manufacturer than the network emulation device 20). As another example, please refer to... Figure 5, which shows a schematic diagram of still another communication network 10 provided in the embodiments of the present application. This communication network 10 is a flower arrangement network. The communication network 10 includes network devices R1 to R13, a network devices located in area 1, b network devices located in area 2, c network devices located in area 3, d network devices located in area 4, and e network devices located in area 5. In addition, the communication network 10 includes a plurality of communication links (for example, the connection line between any two network devices among the network devices R1 to R13 represents a communication link deployed between the two network devices). The a network devices in area 1 are communicatively connected, and the a network devices are communicatively connected to network devices R12 to R13, where the a network devices include a1 third-party devices. The b network devices in area 2 are communicatively connected, and the b network devices are communicatively connected to network device R11, where the b network devices do not include any third-party device. The c network devices in area 3 are communicatively connected, and the c network devices are communicatively connected to network devices R9 to R10, where the c network devices include c1 third-party devices. The d network devices in area 4 are communicatively connected, and the d network devices are communicatively connected to network devices R7 to R8, where the d network devices include d1 third-party devices. The e network devices in area 5 are communicatively connected, and the e network devices are communicatively connected to network devices R5 to R6, where the e network devices include e1 third-party devices. The network devices R1 to R13 may also include third-party devices. Wherein a, a1, b, c, c1, d, d1, e, and e1 are all positive integers, and a1<a, c1<c, d1<d, e1<e. For example, a=1000, a1=100, b=1000, c=1000, c1=100, d=1500, d1=200, e=1500, e1=500. For example, the a network devices in area 1 include network devices X1 to X23. The network simulation apparatus 20( Figure 5 not shown in the figure) can communicate with Figure 5 each network device in the illustrated communication network 10, and the network simulation apparatus 20 is configured to Figure 5 perform simulation on the illustrated communication network 10.
[0068] It should be noted that, in the embodiments of the present application, the network simulation apparatus 20 may simulate the entire communication network 10, or may simulate the network in a partial area of the communication network 10. For example, Figure 5 a network change occurs in the illustrated communication network 10, the affected range is area 1, and the network simulation apparatus 20 simulates the network in area 1. It should also be noted that Figure 5 each area in the figure is only used to indicate Figure 5The fact that multiple network devices are not shown does not imply that these multiple network devices are necessarily located in the same geographical area or the same network area (or network domain). Figure 5 Multiple network devices within each region can be located in the same geographical region or different geographical regions, and can be in the same network domain or different network domains. For example, network device 'a' in region 1 can be located in the same geographical region or different geographical regions, and can be in the same network domain or different network domains. Similarly, network device 'b' in region 2 can be located in the same geographical region or different geographical regions, and can be in the same network domain or different network domains. And so on.
[0069] It should be noted that, Figure 1 The application scenarios shown and Figures 2 to 5 The communication network shown is for illustrative purposes only and is not intended to limit the technical solutions of the embodiments of this application. The network architecture of the communication network and the application scenarios of the embodiments of this application can be set according to actual conditions. For example, the application scenario of the embodiments of this application may also include a client, which is used to provide a human-computer interaction interface to realize human-computer interaction. The client is communicatively connected to the network simulation device 20, and the network simulation device 20 is used to simulate the communication network 10 according to the simulation request for the communication network 10 sent by the client. In some embodiments, the client may be integrated into the network simulation device 20. As another example, the application scenario of the embodiments of this application may also include a database, which is used to store the configuration information of each network device in the communication network 10 (e.g., storing the configuration files of the network devices, which are used to record the configuration information of the network devices) and the device images of all or some of the network devices in the communication network 10, so that the network simulation device 20 can obtain the configuration information of each network device in the communication network 10 and the device images of all or some of the network devices in the communication network 10 from the database, and simulate the communication network 10 according to the configuration information of each network device in the communication network 10 and the device images of all or some of the network devices in the communication network 10. The client can be an application (App) installed on a user device, which may include a mobile phone, tablet, laptop, desktop computer, smart TV, Internet of Things (IoT) device, etc. The database and network simulation device 20 may reside on the same server, or they may reside on different servers; this embodiment does not limit this.
[0070] The above describes the application scenarios of the embodiments of this application. The following describes the network simulation method provided by the embodiments of this application.
[0071] Please refer to Figure 6 The diagram illustrates a flowchart of a network simulation method provided in an embodiment of this application. This network simulation method is executed by a network simulation device. The network simulation device may be... Figure 1 The network simulation device 20 in the middle. The network simulation method includes the following steps S601 to S602.
[0072] S601. In response to a simulation request for a communication network, a virtual network corresponding to the communication network is constructed. The virtual network includes a bridging node Q1, a simulation node S1 corresponding to a first network device in the communication network, a simulation node E1 corresponding to a second network device in the communication network, and a virtual link corresponding to a communication link in the communication network. The simulation node S1 is a virtual node obtained by device modeling based on the configuration information of the first network device. The simulation node E1 is a virtual node generated by device mirroring based on the second network device. The virtual link is obtained by link modeling based on the configuration information of the network devices at both ends of the communication link. The virtual link includes a simulation link A1 connected to the simulation node S1 and the simulation node E1. The simulation link A1 includes a bridging node Q1, which is used to realize the docking of the simulation node S1 and the simulation node E1.
[0073] The simulation request for the communication network can be a fusion simulation request, which requests a fusion simulation of the communication network. The network simulation device receives the simulation request, responds to the simulation request, and constructs a virtual network corresponding to the communication network. In an optional embodiment, the network simulation device communicates with a client. The user operates the client to trigger the simulation request, the client sends the simulation request to the network simulation device, and the network simulation device receives the simulation request.
[0074] In this embodiment, the communication network includes multiple network devices and at least one communication link. The multiple network devices are the network devices participating in the simulation within the communication network. Each communication link is deployed between two network devices among the multiple network devices. The multiple network devices can be all the network devices in the communication network, or they can be a subset of the network devices in the communication network. For example, the communication network is as follows: Figure 2 The communication network 10 shown includes network devices R1 to R15, which are the network devices participating in this simulation. These multiple network devices represent all the network devices in the communication network 10. For example, the communication network is as follows: Figure 3 The communication network 10 shown includes network devices R1 through R8, which are the network devices participating in this simulation. These multiple network devices represent all the network devices in the communication network 10. For example, the communication network is as follows: Figure 4The communication network 10 shown includes network devices R1 to R14, which are the network devices participating in this simulation. These multiple network devices represent all the network devices in the communication network 10. For example, the communication network is as follows: Figure 5 The network devices in area 1 of the communication network 10 shown are all network devices participating in this simulation. These multiple network devices are part of the network devices in the communication network 10.
[0075] The plurality of network devices may include at least one first network device and at least one second network device, wherein the at least one first network device and the at least one second network device do not overlap (i.e., a network device is either a first network device or a second network device, and cannot be both). For example, the sum of the number of first network devices and the number of second network devices equals the number of the plurality of network devices. In an optional embodiment, the virtual network constructed by the network simulation device includes at least one bridging node, at least one simulation node corresponding one-to-one with the at least one first network device, at least one simulated node corresponding one-to-one with the at least one second network device, and at least one virtual link corresponding one-to-one with the at least one communication link. Each simulation node in the at least one simulation node is a virtual node obtained by device modeling based on the configuration information of the corresponding first network device. Each simulated node in the at least one simulation node is a virtual node generated based on the device image of the corresponding second network device. Each virtual link in the at least one virtual link is obtained by link modeling based on the configuration information of the network devices at both ends of the corresponding communication link. The at least one virtual link includes at least one simulated link, with one end of each simulated link connected to a simulated node and the other end connected to a simulated node. The at least one bridging node corresponds one-to-one with the at least one simulation link, and each simulation link includes a corresponding bridging node. Each bridging node is used to connect the corresponding simulation node to the corresponding simulation node. The simulation node and the simulation node corresponding to each bridging node are the simulation nodes at both ends of the simulation link where each bridging node is located. Bridging node Q1 is one of the at least one bridging nodes, simulation node S1 is one of the at least one simulation nodes, simulation node E1 is one of the at least one simulation nodes, and simulation link A1 is one of the at least one simulation link. Bridging node Q1 corresponds to simulation link A1, simulation node S1, and simulation node E1.
[0076] It is understood that both the aforementioned at least one simulated node and the aforementioned at least one virtual node are virtual nodes. Therefore, the virtual network constructed by the network simulation device includes multiple virtual nodes corresponding one-to-one with the multiple network devices and at least one virtual link corresponding one-to-one with the aforementioned at least one communication link. In an optional embodiment, the at least one communication link is multiple communication links, and the at least one virtual link is multiple virtual links corresponding one-to-one with the multiple communication links. The at least one virtual link also includes at least one simulated link (or "simulation-simulation link") and / or, at least one simulated link (or "simulation-simulation link"). The two virtual nodes at both ends of the simulated link are both simulated nodes, and the simulated link is deployed between the two simulated nodes. The two virtual nodes at both ends of the simulated link are both simulated nodes, and the simulated link is deployed between the two simulated nodes.
[0077] In optional embodiments, bridging node Q1 is integrated into simulation node S1 (or the function of bridging node Q1 is integrated into simulation node S1). Alternatively, bridging node Q1 is integrated into simulation node E1 (or the function of bridging node Q1 is integrated into simulation node E1). Alternatively, bridging node Q1 is independent of simulation node S1 and simulation node Q1. When bridging node Q1 is integrated into simulation node S1, simulation node S1 becomes a bridging node by integrating bridging node Q1 and is directly connected to simulation node E1. When bridging node Q1 is integrated into simulation node E1, simulation node E1 becomes a bridging node by integrating bridging node Q1 and is directly connected to simulation node S1. When bridging node Q1 is independent of simulation node S1 and simulation node Q1, bridging node Q1 is positioned between simulation node S1 and simulation node Q1. This application does not limit the form in which bridging node Q1 exists. In one embodiment, in the virtual network, each bridging node is integrated with a corresponding simulation node; or, each bridging node is integrated with a corresponding simulation node; or, each bridging node is independent of both the corresponding simulation node and the corresponding simulation node. In another embodiment, in the virtual network, some bridging nodes are integrated with corresponding simulation nodes, some bridging nodes are integrated with corresponding simulation nodes, and some bridging nodes are independent of both the corresponding simulation nodes and the corresponding simulation node. This embodiment does not limit the scope of this embodiment. The following description uses the example of bridging nodes being independent of both the corresponding simulation nodes and the corresponding simulation node.
[0078] In a specific embodiment, the network simulation device, in response to the simulation request, obtains the configuration information of each of the plurality of network devices and the device image of each of the at least one second network device. The network simulation device performs device modeling based on the configuration information of each of the at least one first network device, obtaining a simulation node corresponding to each first network device. The network simulation device generates a simulated node corresponding to each of the at least one second network device based on the device image of each of the at least one second network device. The network simulation device can obtain at least one simulation node corresponding to each of the at least one first network device and at least one simulated node corresponding to each of the at least one second network device. Both the at least one simulation node and the at least one simulated node are virtual nodes; therefore, the network simulation device can obtain multiple virtual nodes corresponding to each of the plurality of network devices. After obtaining the multiple virtual nodes corresponding to each of the plurality of network devices, the network simulation device determines the at least one communication link between the plurality of network devices based on the configuration information of the plurality of network devices. For each of the at least one communication link, the network simulation device performs link modeling based on the configuration information of the network devices at both ends of each communication link, obtaining a virtual link corresponding to each communication link. The network simulation device can obtain at least one virtual link corresponding one-to-one with the at least one communication link through link modeling. Each virtual link is deployed between two virtual nodes among the plurality of virtual nodes. Furthermore, each at least one virtual link includes at least one simulated link, and each simulated link is deployed between one simulated node and another simulated node. One end of each simulated link is connected to one simulated node, and the other end is connected to another simulated node. The network simulation device determines the at least one simulated link among the at least one virtual links, and constructs a bridging node on each of the at least one simulated link.
[0079] In an optional embodiment, the network simulation device obtains the configuration information of each of the plurality of network devices and the device image of each of the at least one second network device from a database. The configuration information of the plurality of network devices and the device images of the at least one second network device are pre-stored in the database. The database may also store the device images of each of the at least one first network device. That is, the database may store the configuration information of each of the plurality of network devices and the device image of each of the plurality of network devices. The configuration information of each network device includes the configuration information of the network device's interface, the network protocols supported by the network device, the protocol features supported by the network device, the protocol behavior of the network device in implementing specific protocol features, and other configuration-related information. The interface configuration information includes the interface speed, the network protocols enabled by the interface, protocol features, and other configuration-related information. The protocol features are the protocol characteristics of the network protocol. For example, if the network protocol is a routing protocol, the protocol characteristics of the routing protocol include route advertising, route withdrawal, route optimization, route crossing, and route introduction. As another example, if the network protocol is a security protocol, the protocol characteristics of the security protocol include security policies. In an optional embodiment, a snapshot of the communication network and a device image of each network device in the communication network are obtained in advance, and the snapshot of the communication network and the device images of each network device in the communication network are stored in the database. The snapshot of the communication network includes a configuration file for each network device in the communication network, and the configuration file of each network device includes the configuration information of the network device. The network simulation device obtains the configuration file of each of the multiple network devices from the database, and obtains the configuration information of each network device from its configuration file.
[0080] In an optional embodiment, the simulation request carries an identifier of the communication network. For example, the simulation request carries an identifier of a snapshot of the communication network, which indicates a snapshot of the communication network, thereby indicating the communication network. In response to the simulation request, the network simulation device determines the communication network based on the identifier of the communication network, and then determines the at least one first network device and the at least one second network device among the plurality of network devices included in the communication network. For example, if the plurality of network devices are all the network devices in the communication network, the network simulation device can determine the plurality of network devices after determining the communication network, and then determine the at least one first network device and the at least one second network device among the plurality of network devices. As another example, if the plurality of network devices are a subset of the network devices in the communication network, the simulation request may also carry identifiers of the plurality of network devices. After determining the communication network, the network simulation device determines the plurality of network devices in the communication network based on the identifiers of the plurality of network devices, and then determines the at least one first network device and the at least one second network device among the plurality of network devices. For example, the plurality of network devices are part of a communication network that includes multiple areas, and the plurality of network devices are at least one of those areas (e.g., the multiple areas are as follows). Figure 5 The at least one area is a network device in area 1). The simulation request may also carry the identifier of the at least one area. After the network simulation device determines the communication network, the network simulation device determines the at least one area based on the identifier of the at least one area. The network simulation device determines the network device in the at least one area as the plurality of network devices. Then, the network simulation device determines the at least one first network device and the at least one second network device among the plurality of network devices.
[0081] In an optional embodiment, the network simulation device determines the number of first network devices and the number of second network devices based on the number of the plurality of network devices, the amount of resources available for simulating the communication network, the amount of resources required by a single simulation node, and the amount of resources required by a single simulated node. The network simulation device then determines at least one first network device and at least one second network device from among the plurality of network devices based on the number of first network devices and the number of second network devices. The resources required for network simulation include computing resources and storage resources. Computing resources may be CPU resources, and storage resources include memory resources, and may also include other storage resources. For each type of resource (e.g., computing resources and memory resources are each a type of resource), the amount of each type of resource required by a single simulated node is typically greater than the amount of each type of resource required by a single simulated node. The amount of each type of resource required by a single simulated node may be the amount of each type of resource required to construct a single simulated node. The amount of each type of resource required by a single simulated node may be the amount of each type of resource required to construct a single simulated node (e.g., running a device image). Taking the resources required for network simulation, including computing resources and memory resources, as an example, the number of multiple network devices is x0, the number of the first network device is x1, the number of the second network device is x2, the amount of computing resources available for simulating the communication network is y0, the amount of computing resources required for a single simulation node is y1, the amount of computing resources required for a single simulation node is y2, the amount of memory resources available for simulating the communication network is z0, the amount of memory resources required for a single simulation node is z1, and the amount of memory resources required for a single simulation node is z2. Then the number of multiple network devices, the number of the first network device, the number of the second network device, the amount of resources available for simulating the communication network, the amount of resources required for a single simulation node, and the amount of resources required for a single simulation node satisfy the following relationships (1) to (3).
[0082] x0 = x1 + x2 (1);
[0083] y0≥x1*y1+x2*y2 (2);
[0084] z0≥x1*z1+x2*z2 (3).
[0085] In the above relations (2) to (3), the symbol “*” represents the multiplication sign.
[0086] The network simulation device solves the above-mentioned relationships (1) to (3) to determine the number of the first network devices and the number of the second network devices. It should be noted that the network simulation device may obtain multiple results when solving the above-mentioned relationships (1) to (3), and each of the multiple results includes an x1 and an x2. The network simulation device determines the number of the first network devices and the number of the second network devices based on the optimal result among the multiple results. The x2 in the optimal result is greater than the x1 in the optimal result, and the x2 in the optimal result can be the maximum value of x2 among the multiple results. This application embodiment does not limit this.
[0087] After determining the number of first network devices and the number of second network devices, the network simulation device determines at least one first network device and at least one second network device from among the multiple network devices based on the number of first network devices and the number of second network devices. For ease of description, the number of first network devices is referred to as the first quantity, and the number of second network devices is referred to as the second quantity. The network simulation device divides the multiple network devices into two groups, with the number of network devices in the first group being the first quantity and the number of network devices in the second group being the second quantity. There is no overlap between the network devices in the first group and the network devices in the second group (i.e., a network device either belongs to the first group or the second group, and cannot belong to both). The network simulation device determines the network devices in the first group as first network devices and the network devices in the second group as second network devices. For example, the network simulation device randomly divides the multiple network devices into two groups. Another example is that the network simulation device divides the multiple network devices into two groups according to a partitioning strategy. This partitioning strategy can be specified by the user or by a specific algorithm; this embodiment does not limit this.
[0088] For ease of description, the method of obtaining the virtual node (i.e., simulation node) corresponding to a network device by modeling the device based on its configuration information is called the first method, and the method of generating the virtual node (i.e., simulated node) corresponding to the network device based on the device image of the network device is called the second method. The first method can be a method of generating virtual nodes in network simulation technology, and the second method can be a method of generating virtual nodes in network emulation technology. Therefore, the first method can also be called the simulation method, and the second method can also be called the emulation method. The second method has a higher degree of support for third-party devices than the first method (e.g., the first method does not support third-party devices, while the second method does). The above-mentioned first group corresponds to the first method, and the above-mentioned second group corresponds to the second method. Therefore, the first group can also be called the simulation group, and the second group can also be called the emulation group. Network devices in the first group can constitute a first region, and network devices in the second group can constitute a second region. Therefore, the first region can also be called a simulation region, and the second region can also be called an emulation region. It can be understood that at least one first network device belongs to the simulation region, and at least one second network device belongs to the emulation region. In this embodiment, the partitioning strategy may consider at least one of the following factors: whether the network device is a third-party device, the degree of support for third-party devices by the first method, the degree of support for third-party devices by the second method, the degree of support for command lines recorded in the configuration file of the network device by the first method, the degree of support for command lines recorded in the configuration file of the network device by the second method, the number of interfaces of the network device (i.e., the number of interfaces), and the protocol characteristics supported by the network device. The degree of support for command lines recorded in the configuration file of any network device by the first method may be: the percentage of the number of command lines that the virtual node corresponding to the network device can execute using the first method in the configuration file of that network device, to the total number of command lines in the configuration file of that network device. The degree of support for command lines recorded in the configuration file of any network device by the second method may be: the percentage of the number of command lines that the virtual node corresponding to the network device can execute using the second method in the configuration file of that network device, to the total number of command lines in the configuration file of that network device.
[0089] The following four examples illustrate how the network simulation device can group multiple network devices according to different partitioning strategies.
[0090] In one embodiment, the capacity of the first group (i.e., the maximum number of network devices that the first group can include) is a first quantity, and the capacity of the second group (i.e., the maximum number of network devices that the second group can include) is a second quantity. The partitioning strategy is as follows: non-third-party devices (i.e., devices from this manufacturer, specifically devices from the same manufacturer as the network emulation device) are preferentially assigned to the first group, and third-party devices (i.e., devices from other manufacturers, specifically devices from different manufacturers than the network emulation device) are preferentially assigned to the second group; if the number of non-third-party devices exceeds the capacity of the first group, the remaining non-third-party devices are assigned to the second group; if the number of third-party devices exceeds the capacity of the second group, the remaining third-party devices are assigned to the first group. The network simulation device, following this partitioning strategy, prioritizes assigning non-third-party devices among the multiple network devices to a first group and prioritizes assigning third-party devices among the multiple network devices to a second group. If the number of non-third-party devices among the multiple network devices exceeds a first number, the network simulation device assigns a first number of non-third-party devices to the first group and then assigns the remaining non-third-party devices among the multiple network devices to the second group. If the number of third-party devices among the multiple network devices exceeds a second number, the network simulation device assigns a second number of third-party devices to the second group and then assigns the remaining third-party devices among the multiple network devices to the first group. In this embodiment, since the network simulation device groups the multiple network devices according to whether they are third-party devices, and the first group corresponds to the first method, the second group corresponds to the second method, and the second method has a higher support for third-party devices than the first method, this partitioning strategy considers the following factors: whether the network device is a third-party device, the support for third-party devices by the first method, and the support for third-party devices by the second method. According to this partitioning strategy, the network simulation device will assign non-third-party devices to the first group as much as possible and third-party devices to the second group as much as possible. In this way, the resource overhead of simulating communication networks can be reduced while improving the accuracy of simulation results, and it is applicable to large-scale communication networks (the first method can reduce resource overhead and is applicable to large-scale communication networks, while the second method can improve accuracy).
[0091] In another embodiment, the capacity of the first group is a first quantity, and the capacity of the second group is a second quantity. The partitioning strategy is as follows: network devices with more than the target number of interfaces are preferentially assigned to the first group, and network devices with no more than the target number of interfaces are preferentially assigned to the second group; if the number of network devices with more than the target number of interfaces exceeds the capacity of the first group, the remaining network devices with more than the target number of interfaces are assigned to the second group; if the number of network devices with no more than the target number of interfaces exceeds the capacity of the second group, the remaining network devices with no more than the target number of interfaces are assigned to the first group. The target number is set according to the actual situation; for example, if the second method has an interface quantity limit (specifically, the device image has an interface quantity limit), the target number is the maximum number of interfaces that the second method can support. According to the partitioning strategy, the network simulation device identifies network devices with more than the target number of interfaces and network devices with fewer than the target number of interfaces among the plurality of network devices. The network simulation device prioritizes assigning network devices with more than the target number of interfaces to the first group and network devices with fewer than the target number of interfaces to the second group. If the number of network devices with more than the target number of interfaces is greater than the first number, the network simulation device partitions the first number of network devices into the first group and then partitions the remaining network devices with more than the target number of interfaces into the second group. If the number of network devices with fewer than the target number of interfaces is greater than the second number, the network simulation device partitions the second number of network devices into the second group and then partitions the remaining network devices with fewer than the target number of interfaces into the first group. In this embodiment, since the network simulation device groups the multiple network devices according to the number of interfaces, and the first group corresponds to the first method, the second group corresponds to the second method, and the second method has a higher support for third-party devices than the first method, the division strategy takes into account the following factors: the number of interfaces of the network devices, the support for third-party devices by the first method, and the support for third-party devices by the second method.According to this partitioning strategy, the network simulation device should, as far as possible, group network devices with more than the target number of interfaces into the first group and network devices with fewer than or equal to the target number of interfaces into the second group. This can reduce the resource overhead of simulating communication networks while maximizing the accuracy of simulation results and is applicable to large-scale communication networks (the first method can reduce resource overhead, is applicable to large-scale communication networks, and has no interface number limit; the second method has an interface number limit. If network devices with more than the target number of interfaces are grouped into the second group, the simulation results for these network devices will not include the results for at least some interfaces, resulting in lower accuracy of the simulation results for these network devices. Therefore, network devices with more than the target number of interfaces should be grouped into the first group as much as possible).
[0092] In another embodiment, the capacity of the first group is a first quantity, and the capacity of the second group is a second quantity. For ease of description, the support level of the command lines recorded in the configuration file of the network device by the first method is referred to as the first command line support level, and the support level of the command lines recorded in the configuration file of the network device by the second method is referred to as the second command line support level. Each of the plurality of network devices corresponds to one first command line support level and one second command line support level. The first command line support level corresponding to each network device is the support level of the command lines recorded in the configuration file of each network device by the first method, and the second command line support level corresponding to each network device is the support level of the command lines recorded in the configuration file of each network device by the second method. The partitioning strategy is as follows: For any network device: if the first command line support of any network device is greater than the second command line support of any network device, the network device is preferentially assigned to the first group; if the first command line support of any network device is not greater than the second command line support of any network device, the network device is preferentially assigned to the second group; if the number of network devices with the first command line support greater than the second command line support is greater than a first number, the remaining network devices with the first command line support greater than the second command line support are assigned to the second group; if the number of network devices with the first command line support not greater than the second command line support is greater than a second number, the remaining network devices with the first command line support not greater than the second command line support are assigned to the first group.The network simulation device, according to the partitioning strategy, determines the first command-line support and the second command-line support for each of the plurality of network devices. For each of the plurality of network devices: the network simulation device determines the relationship between the first command-line support and the second command-line support for each network device; if the first command-line support for each network device is greater than the second command-line support for each network device, and the number of network devices assigned to the first group is less than the first number, the network simulation device assigns each network device to the first group; if the first command-line support for each network device is greater than the second command-line support for each network device, the network simulation device assigns each network device to the first group. If the second command-line support for each network device is equal to the number of network devices assigned to the first group, the network simulation device assigns each network device to the second group. If the first command-line support for each network device is not greater than the second command-line support for each network device, and the number of network devices assigned to the second group is less than the second number, the network simulation device assigns each network device to the second group. If the first command-line support for each network device is not greater than the second command-line support for each network device, and the number of network devices assigned to the second group is equal to the second number, the network simulation device assigns each network device to the first group. In this embodiment, the partitioning strategy considers the support for command lines recorded in the configuration file of the network device using both the first and second methods. According to this partitioning strategy, the network simulation device assigns network devices with higher first command-line support to the first group and, as far as possible, network devices with higher second command-line support to the second group. During the simulation of the communication network, this improves the accuracy of the virtual nodes executing the command lines recorded in the configuration file of each network device, thereby maximizing the accuracy of the simulation results.
[0093] In another embodiment, the capacity of the first group (i.e., the maximum number of network devices that the first group can include) is a first quantity, and the capacity of the second group (i.e., the maximum number of network devices that the second group can include) is a second quantity. The partitioning strategy is as follows: network devices whose support for protocol features in the protocol feature set is greater than the target support are preferentially assigned to the first group; network devices whose support for protocol features in the protocol feature set is not greater than the target support are preferentially assigned to the second group; if the number of network devices whose support for protocol features in the protocol feature set is greater than the target support exceeds the capacity of the first group, the remaining network devices whose support for protocol features in the protocol feature set is greater than the target support are assigned to the second group; if the number of network devices whose support for protocol features in the protocol feature set is not greater than the target support exceeds the capacity of the second group, the remaining network devices whose support for protocol features in the protocol feature set is not greater than the target support are assigned to the first group. The protocol feature set includes at least one protocol feature, and the protocol feature in the protocol feature set is the protocol feature that needs to be implemented in this network simulation. The support level of any network device for a protocol feature in the protocol feature set can be defined as the percentage of the number of protocol features supported by that network device and belonging to that protocol feature set to the total number of protocol features in that protocol feature set. The network simulation device, according to this partitioning strategy, determines the support level of each of the plurality of network devices for the protocol features in the protocol feature set; based on the support levels of the plurality of network devices for the protocol features in the protocol feature set, the network simulation device determines network devices among the plurality of network devices whose support for the protocol features in the protocol feature set is greater than a target support level, and determines network devices among the plurality of network devices whose support for the protocol features in the protocol feature set is not greater than a target support level; the network simulation device prioritizes classifying network devices among the plurality of network devices whose support for the protocol features in the protocol feature set is greater than a target support level into the first group, and prioritizes classifying network devices among the plurality of network devices whose support for the protocol features in the protocol feature set is not greater than a target support level. The network devices with support for the protocol features in the protocol feature set are assigned to the second group. If the number of network devices with support for the protocol features in the protocol feature set greater than the target support is greater than a first number, the network simulation device assigns a first number of network devices to the first group, and then assigns the remaining network devices with support for the protocol features in the protocol feature set greater than the target support to the second group. If the number of network devices with support for the protocol features in the protocol feature set less than the target support is greater than a second number, the network simulation device assigns a second number of network devices to the second group, and then assigns the remaining network devices with support for the protocol features in the protocol feature set less than the target support to the first group.In this embodiment, the partitioning strategy considers the protocol characteristics supported by network devices. According to this strategy, the network simulation device, as far as possible, assigns network devices whose support for protocol characteristics in the protocol characteristic set is greater than the target support to the first group, and assigns network devices whose support for protocol characteristics in the protocol characteristic set is not greater than the target support to the second group. This reduces the resource overhead of simulating the communication network while maximizing the accuracy of the simulation results, and is applicable to large-scale communication networks (the first group corresponds to the first method, and the second group corresponds to the second method; the first method reduces resource overhead and is applicable to large-scale communication networks, while the second method improves the accuracy of the simulation results).
[0094] It should be noted that in practical applications, the four embodiments regarding the partitioning strategy and the grouping of network devices according to the partitioning strategy described above can be implemented individually or in combination, and this application does not limit this. Furthermore, the above embodiments illustrate how a network simulation device determines a first network device and a second network device from among multiple network devices by grouping them. The network simulation device can also use other methods to determine the first and second network devices from among multiple network devices. For example, in some embodiments, the simulation request carries the identifier of at least one first network device and the identifier of at least one second network device. The network simulation device determines the at least one first network device based on the identifier of the at least one first network device carried in the simulation request, and the network simulation device determines the at least one second network device based on the identifier of the at least one second network device carried in the simulation request. For example, if a user selects at least one first network device and at least one second network device from among the multiple network devices by operating a client (e.g., clicking with a mouse, touching, etc.) and triggers a simulation request, then the simulation request carries the identifier of the at least one first network device and the identifier of the at least one second network device.
[0095] After determining the at least one first network device and the at least one second network device, the network simulation device performs device modeling based on the configuration information of each of the at least one first network device to obtain a simulation node corresponding to each first network device. The network simulation device generates a simulated node corresponding to each of the at least one second network device based on the device image of each of the at least one second network device. The network simulation device determines at least one communication link between the multiple network devices according to their configuration information, and performs link modeling based on the configuration information of the network devices at both ends of each communication link to obtain a virtual link corresponding to each communication link. The network simulation device determines at least one simulated link from the at least one virtual link that corresponds one-to-one with the at least one communication link, and constructs a bridging node on each of the at least one simulated link. The simulated node corresponding to each second network device can be an image instance obtained by running the device image of each second network device. The network simulation device runs the device image of each of the at least one second network device to obtain the simulated node corresponding to each second network device. Each simulation link is connected to a simulation node at one end and to a virtual node at the other end (both simulation nodes are virtual nodes). The network simulation device determines at least one simulation link in the at least one virtual link based on the virtual nodes at both ends of each virtual link.
[0096] In this embodiment, each virtual node (including emulated nodes or simulated nodes) is used to simulate the corresponding network device. For example, each virtual node is used to simulate the protocol behavior of the corresponding network device. Network devices from different vendors typically exhibit different protocol behaviors when implementing the same protocol feature; therefore, virtual nodes corresponding to network devices from different vendors typically simulate different protocol behaviors for the same protocol feature. The virtual node's simulation of the corresponding network device's protocol behavior includes: simulating message sending and receiving by the corresponding network device, and simulating the generation of relevant information tables (i.e., tables related to the simulated protocol behavior) by the corresponding network device. These relevant information tables may include at least one of a routing table, neighbor table, label table, link state database (LSDB) table, or tunnel-info table, and may also include any other possible tables related to the simulated protocol behavior. Each relevant information table includes at least one table entry. The routing table may be, for example, an Open Shortest Path First (OSPF) routing table, an Internet Protocol version 4 (IPv4) routing table, or an Internet Protocol version 6 (IPv6) routing table, and various other possible routing tables. The neighbor table can be any of the following: OSPF peer table, Border Gateway Protocol (BGP) peer table, etc.
[0097] In this embodiment, each bridging node is located on a simulated link. One end of each simulated link is connected to a simulated node, and the other end is connected to a simulated node. The simulated node is a virtual node corresponding to the network device obtained using the first method described above, and the simulated node is a virtual node corresponding to the network device obtained using the second method described above. The first method can be the simulation method, and the second method can be the emulation method. The bridging node is also called a bridge or a simulation emulation bridge (SE bridge). Each bridging node corresponds to the simulated link it is located on, as well as the simulated nodes at both ends of the simulated link. The message format matching the simulated node and the message format matching the simulated node are usually different. The simulated node usually adopts a discrete event simulation (DES) working mechanism and does not have a clock mechanism, while the simulated node usually has a clock mechanism. The simulated node usually does not simulate the protocol behavior of the neighbor relationship establishment process, nor does it maintain the finite state machine (FSM) state, while the simulated node usually simulates the protocol behavior of the neighbor relationship establishment process and maintains the FSM state during the neighbor relationship establishment process. For example, during the process of establishing neighbor relationships, simulated nodes maintain FSM state according to RFC specifications. It is evident that the operating modes of simulated nodes differ from those of analog nodes, resulting in a communication barrier between them. Therefore, this embodiment constructs a bridging node on the simulated link to enable communication between simulated nodes. The message format matching the simulated node can be one that the simulated node can recognize and process, and the message format matching the analog node can also be one that the analog node can recognize and process.
[0098] In this embodiment, a bridging node can act as a proxy node for a corresponding simulated node to interface with the corresponding simulated node, thereby achieving the interface between the corresponding simulated nodes. Taking the interface between simulated node S1 and simulated node E1 implemented by bridging node Q1 as an example, the specific functions of bridging node Q1 in achieving the interface between simulated node S1 and simulated node E1 include at least one of the following: bridging node Q1 performs format conversion on messages transmitted through simulated link A1; bridging node Q1 establishes a neighbor relationship with simulated node E1 based on the address of simulated node S1; and bridging node Q1 performs clock simulation based on the address of simulated node S1 and the periodically sent messages by simulated node E1. In an optional embodiment, in the above virtual network, each bridging node is used to achieve the interface between the corresponding simulated node and the corresponding simulated node. Each bridging node is used to connect the corresponding emulation node and the corresponding simulation node, specifically including at least one of the following: each bridging node is used to perform format conversion on messages transmitted through the corresponding emulation link; each bridging node is used to establish a neighbor relationship with the corresponding simulation node based on the address of the corresponding emulation node; each bridging node is used to perform clock simulation based on the address of the corresponding emulation node and the periodically sent messages by the corresponding simulation node. Wherein, both the emulation node and the simulation node are virtual nodes. The address of any virtual node may include an Internet Protocol (IP) address and a Media Access Control (MAC) address. The IP address of any virtual node may be the IP address of the network device corresponding to the virtual node, or an IP address set for the virtual node based on the IP address of the network device corresponding to the virtual node. The MAC address of any virtual node may be the MAC address of the network device corresponding to the virtual node, or a MAC address set for the virtual node based on the MAC address of the network device corresponding to the virtual node. In the embodiments of this application, the address of the emulation node may be an IP address or a MAC address, and different types of addresses (IP addresses or MAC addresses) may be used in different scenarios.
[0099] In an optional embodiment, bridging node Q1 is used to perform format conversion on messages transmitted through the simulated link A1. For example, bridging node Q1 is used to perform format conversion on messages used for route propagation transmitted through the simulated link A1, enabling message communication between simulated node S1 and simulated node E1. For example, in BGP, the message used for route propagation can be an update message. In a specific embodiment, the message format matching the simulated node is a first format, and the message format matching the simulated node is a second format. Bridging node Q1 is used to: convert the first format message sent by simulated node S1 through the simulated link A1 into a second format message and send the second format message to simulated node E1; and / or, convert the second format message sent by simulated node E1 through the simulated link A1 into a first format message and send the first format message to simulated node S1. In an optional embodiment, in the above virtual network, each bridging node is used to perform format conversion on messages transmitted through the corresponding simulated link. For example, each bridging node is used to: convert a message in a first format sent by the corresponding simulation node through the corresponding simulation link into a message in a second format, and send the message in the second format to the corresponding simulation node; and / or convert a message in the second format sent by the corresponding simulation node through the corresponding simulation link into a message in the first format, and send the message in the first format to the corresponding simulation node.
[0100] In this embodiment, the first format message is a data structure obtained by abstracting the message through object-oriented programming, and the data structure of the first format message is a human-readable data structure. The second format message can be a message, and the data structure of the second format message is a machine-readable byte stream (e.g., a binary bit stream). The first format message can also be called a simulation message, and the second format message can also be called an emulation message. In some scenarios, the first format message is also called an abstract message, and the second format message is also called a concrete message. In optional embodiments, the first format message is a network communication protocol message such as an intermediate system-to-intermediate system (IS-IS) message, OSPF message, or BGP message expressed in the first format, and the second format message includes network communication protocol messages such as IS-IS messages, OSPF messages, or BGP messages expressed in the second format. The second format message may also include other content, which is also expressed in the second format. The other content in the second format message may include message headers such as IP headers and Ethernet headers. For example, when a message in the second format includes an IS-IS message expressed in the second format, the message body of the second-format message is the IS-IS message, and the second-format message also includes headers such as IP headers and Ethernet headers. Similarly, when a message in the second format includes an OSPF message expressed in the second format, the message body of the second-format message is the OSPF message, and the second-format message also includes headers such as IP headers and Ethernet headers. Likewise, when a message in the second format includes a BGP message expressed in the second format, the message body of the second-format message is the BGP message, and the second-format message also includes headers such as IP headers and Ethernet headers.
[0101] In one example, the first format message is an IS-IS message expressed in the first format, and the second format message includes an IS-IS message expressed in the second format, an IP header, and an Ethernet header, which are sequentially encapsulated outside the IS-IS message expressed in the second format, and are also represented in the second format. The bridging node is used to: convert the IS-IS message expressed in the first format sent by the corresponding simulation node through the corresponding simulation link into an IS-IS message expressed in the second format; generate an IP header and an Ethernet header according to the corresponding simulation link; sequentially encapsulate the IP header and the Ethernet header outside the IS-IS message expressed in the second format to obtain a message in the second format; and send the message in the second format to the corresponding simulation node; and / or convert the message in the second format sent by the corresponding simulation node through the corresponding simulation link into an IS-IS message expressed in the first format, and send the message in the first format to the corresponding simulation node. Specifically, the bridging node strips the IP header and Ethernet header from the message in the second format to obtain the IS-IS message expressed in the second format. The bridging node then converts the IS-IS message expressed in the second format into an IS-IS message expressed in the first format.
[0102] In another example, the first format message is an OSPF message expressed in the first format, and the second format message includes an OSPF message expressed in the second format, an IP header, and an Ethernet header, which are sequentially encapsulated outside the OSPF message expressed in the second format, and are also represented in the second format. The bridging node is used to: convert the OSPF message expressed in the first format sent by the corresponding emulator node through the corresponding emulator link into an OSPF message expressed in the second format; generate an IP header and an Ethernet header according to the corresponding emulator link; sequentially encapsulate the IP header and the Ethernet header outside the OSPF message expressed in the second format to obtain a message in the second format; and send the message in the second format to the corresponding emulator node; and / or convert the message in the second format sent by the corresponding emulator node through the corresponding emulator link into an OSPF message expressed in the first format, and send the message in the first format to the corresponding emulator node. Specifically, the bridging node strips the IP header and Ethernet header from the message in the second format to obtain the OSPF message expressed in the second format. The bridging node then converts the OSPF message expressed in the second format into an OSPF message expressed in the first format.
[0103] In another example, the first format message is a BGP message expressed in the first format, and the second format message includes a BGP message expressed in the second format, an IP header, and an Ethernet header, which are sequentially encapsulated outside the BGP message expressed in the second format, and are also represented in the second format. The bridging node is used to: convert the BGP message expressed in the first format sent by the corresponding simulation node through the corresponding simulation link into a BGP message expressed in the second format; generate an IP header and an Ethernet header according to the corresponding simulation link; sequentially encapsulate the IP header and the Ethernet header outside the BGP message expressed in the second format to obtain a message in the second format; and send the message in the second format to the corresponding simulation node; and / or convert the message in the second format sent by the corresponding simulation node through the corresponding simulation link into a BGP message expressed in the first format, and send the message in the first format to the corresponding simulation node. Specifically, the bridging node strips the IP header and Ethernet header from the message in the second format to obtain a BGP message expressed in the second format. The bridging node then converts this BGP message expressed in the second format into a BGP message expressed in the first format.
[0104] In a specific embodiment, the bridging node generates an IP header based on the simulated link by: the bridging node generating an IP header based on the IP address of the simulated node corresponding to the simulated link and the IP address of the simulated node corresponding to the simulated link. The source IP address in the IP header is the IP address of the corresponding simulated node, and the destination IP address in the IP header is the IP address of the corresponding simulated node. The bridging node generates an Ethernet header based on the MAC address of the simulated node corresponding to the simulated link and the MAC address of the simulated node corresponding to the simulated link. The source MAC address in the Ethernet header is the MAC address of the corresponding simulated node, and the destination MAC address in the Ethernet header is the MAC address of the corresponding simulated node.
[0105] Taking bridging node Q1 as an example, please refer to [link / reference]. Figure 7 This diagram illustrates message format conversion performed by bridging node Q1. Simulation node S1 includes an ISIS unit, an OSPF unit, and a BGP unit. The ISIS unit generates and processes ISIS messages expressed in a first format. The OSPF unit generates and processes OSPF messages expressed in a first format. The BGP unit generates and processes BGP messages expressed in a first format. Simulation node E1 includes interfaces 1-3, all of which can be used to send and receive messages in a second format. In one example, simulation node S1 simulates link A1 (… Figure 7(Not shown) Sends and receives ISIS messages expressed in a first format. Simulated node E1 sends and receives messages in a second format via simulated link A1. Bridge node Q1 is used to: convert the IS-IS messages expressed in the first format sent by simulated node S1 via simulated link A1 into IS-IS messages expressed in the second format; generate IP headers and Ethernet headers according to simulated link A1; encapsulate the IP headers and Ethernet headers sequentially outside the IS-IS messages expressed in the second format to obtain the second format messages; and send the second format messages to simulated node E1; and / or convert the second format messages sent by simulated node E1 via simulated link A1 into IS-IS messages expressed in the first format and send the first format IS-IS messages to simulated node S1. In another example, simulated node S1 sends and receives OSPF messages in a first format via simulated link A1, and simulated node E1 sends and receives messages in a second format via simulated link A1. Bridge node Q1 is configured to: convert the OSPF messages in the first format sent by simulated node S1 via simulated link A1 into OSPF messages in the second format; generate an IP header and an Ethernet header based on simulated link A1; encapsulate the IP header and Ethernet header sequentially outside the OSPF messages in the second format to obtain the second format message; and send the second format message to simulated node E1; and / or convert the second format message sent by simulated node E1 via simulated link A1 into OSPF messages in the first format and send the first format OSPF message to simulated node S1. In another example, simulated node S1 sends and receives BGP messages in a first format via simulated link A1, and simulated node E1 sends and receives messages in a second format via simulated link A1. Bridge node Q1 is used to: convert the BGP messages in the first format sent by simulated node S1 via simulated link A1 into BGP messages in the second format; generate IP headers and Ethernet headers according to simulated link A1; encapsulate the IP headers and Ethernet headers sequentially around the BGP messages in the second format to obtain the second format message; and send the second format message to simulated node E1; and / or, convert the second format message sent by simulated node E1 via simulated link A1 into BGP messages in the first format and send the first format BGP message to simulated node S1. The data structure of the first format message is a human-readable data structure, and the BGP message in the first format can be expressed as follows: Figure 8As shown. Specifically, the IP header generated by bridging node Q1 based on the simulated link A1 includes: bridging node Q1 generates an IP header based on the IP addresses of simulated node S1 and simulated node E1. The source IP address in this IP header is the IP address of simulated node S1, and the destination IP address is the IP address of simulated node E1. The Ethernet header generated by bridging node Q1 based on the simulated link A1 includes: bridging node Q1 generates an Ethernet header based on the MAC addresses of simulated node S1 and simulated node E1. The source MAC address in this Ethernet header is the MAC address of simulated node S1, and the destination MAC address is the MAC address of simulated node E1.
[0106] In an optional embodiment, bridging node Q1 is used to establish a neighbor relationship with emulator E1 based on the address of emulator S1. This neighbor relationship is a neighbor relationship between emulator E1 and emulator S1. For example, each bridging node is used to establish a neighbor relationship with a corresponding emulator based on the address of that emulator. This neighbor relationship is a neighbor relationship between the corresponding emulator and the corresponding emulator. Thus, the bridging node acts as a proxy node for the corresponding emulator, performing the operations that should be performed by the corresponding emulator during the neighbor relationship establishment process, in order to establish the neighbor relationship between the corresponding emulator and the corresponding emulator. During the process of establishing the neighbor relationship between emulators, the emulator maintains the FSM state, while the emulator is unaware of the neighbor relationship establishment process and does not maintain the FSM state.
[0107] In this embodiment, the process of establishing a neighbor relationship between a simulated node and a emulated node can be initiated by the simulated node, with the bridging node responding to the simulated node on behalf of the emulated node to establish the neighbor relationship. Specifically, in this embodiment, the bridging node is used to: establish a neighbor relationship with the corresponding simulated node based on the address of the corresponding simulated node, according to the message sent by the corresponding simulated node to establish a neighbor relationship between the corresponding simulated node and the corresponding emulated node. For example, bridging node Q1 is used to: establish a neighbor relationship with simulated node E1 based on the address of simulated node S1, according to the message sent by simulated node E1 to establish a neighbor relationship between simulated node E1 and emulated node S1.
[0108] The neighbor relationship can be an OSPF neighbor relationship or a BGP neighbor relationship. The following example illustrates the establishment of a BGP neighbor relationship between simulated node E1 and simulated node S1. Figure 9 This is a schematic diagram of the interaction between bridging node Q1 and simulated node E1 provided in an embodiment of this application (including the process of establishing the BGP neighbor relationship between simulated node E1 and simulated node S1). Figure 10This is an example of an embodiment of this application providing an FSM state transition diagram for simulated node E1 during the process of establishing a BGP neighbor relationship between simulated node E1 and simulated node S1. See also... Figure 9 and Figure 10After the simulated node E1 starts the BGP protocol, it will wait for a period of time (default 32 seconds) during which it is in an idle state. After this period, the simulated node E1 switches to a connect state, listens on its own port 179, and attempts to establish a TCP connection with its BGP neighbor (i.e., the simulated node S1). Since the simulated node S1 does not simulate the protocol behavior during the neighbor relationship establishment process, in this embodiment, the bridging node Q1 replaces the simulated node S1 in establishing the TCP connection with the simulated node E1 (during the three-way handshake between the bridging node Q1 and the simulated node E1, the bridging node Q1 interacts with the simulated node E1 using the address of the simulated node S1; from the simulated node E1's perspective, it believes it is establishing a TCP connection with the simulated node S1). After the simulated node E1 successfully establishes a TCP connection with the simulated node S1, the simulated node E1 switches to an opensent state. If the simulated node E1 fails to establish a TCP connection with the simulated node S1, the simulated node E1 switches to an active state. In the active state, simulated node E1 waits for a TCP connection from its BGP neighbor (i.e., simulated node S1). It also periodically falls back to the connect state (set by the BGP retransmission timer) and re-attempts to establish a TCP connection with its BGP neighbor (i.e., simulated node S1). In the opensent state, simulated node E1 sends an open message 1 to simulated node S1 through the TCP connection between simulated node E1 and simulated node S1 (this PCT connection is carried on the first simulated link). The source address of open message 1 is the address of simulated node E1, and the destination address is the address of simulated node S1. Open message 1 contains parameters used by simulated node E1 to establish BGP neighbor relationships, such as the autonomous system (AS) number, identifier, and authentication password of simulated node E1. After receiving open message 1, bridge node Q1 replies to open message 2 on behalf of simulation node S1 to simulation node E1. The source address of open message 2 is the address of simulation node S1, and the destination address of open message 2 is the address of simulation node E1. Open message 2 contains some parameters of simulation node S1 used to establish BGP neighbor relationships, such as the AS number of simulation node S1, the identifier of simulation node S1, authentication password, etc.After receiving the open message 2, simulated node E1 switches to the open confirm state and sends a keepalive message 1 to simulated node S1 via the TCP connection between simulated node E1 and simulated node S1. The source address of keepalive message 1 is the address of simulated node E1, and the destination address is the address of simulated node S1. After receiving keepalive message 1, bridge node Q1 replies to keepalive message 2 on behalf of simulated node S1. The source address of keepalive message 2 is the address of simulated node S1, and the destination address is the address of simulated node E1. After receiving keepalive message 2, simulated node E1 switches to the establish state, indicating that the BGP neighbor relationship between simulated node E1 and simulated node S1 is officially established. During the above process, if parameter negotiation fails (e.g., the parameters negotiated in the open message fail) or other events occur, simulated node E1 will fall back to the idle state. See also. Figure 9 It can be seen that the simulated node S1 is unaware of the process of establishing BGP neighbor relationships, nor does it maintain the FSM state. Furthermore, see... Figure 9 After simulated node E1 establishes a BGP neighbor relationship with simulated node S1, simulated node E1 sends an update message to simulated node S1 via simulated link A1 for route propagation. This update message is in a second format. After receiving the second format update message, bridging node Q1 converts it into a first format update message and sends it to simulated node S1. During (or after) the establishment of the BGP neighbor relationship between simulated node E1 and simulated node S1, simulated node E1 can build a BGP neighbor table (i.e., the BGP peer table mentioned above). During the exchange of update messages between simulated node E1 and simulated node S1, simulated node E1 and simulated node S1 can also build routing tables; this embodiment does not limit this.
[0109] It should be noted that the above example of establishing BGP neighbor relationships is merely an example of an embodiment of this application and does not constitute a limitation on the embodiments of this application. Simulated nodes and emulated nodes can also establish other neighbor relationships (such as OSPF neighbor relationships). During the process of establishing other neighbor relationships between simulated nodes and emulated nodes, the corresponding bridging node can also perform the relevant operations in place of the emulated node during the neighbor relationship establishment process. Simulated nodes can also maintain FSM state during the establishment of other neighbor relationships. The process of establishing other neighbor relationships and the changes in the FSM state of simulated nodes during this process can be referred to relevant protocols, which will not be elaborated upon in this embodiment.
[0110] In an optional embodiment, bridging node Q1 is used to perform clock simulation based on the address of simulation node S1 and messages periodically sent by simulation node E1. For example, each bridging node is used to perform clock simulation based on the address of the corresponding simulation node and messages periodically sent by the corresponding simulation node. In a specific embodiment, the simulation node includes a timing unit, which can be a clock unit or a timer implemented based on the clock unit. The simulation node periodically sends messages to the corresponding simulation node under the triggering of the timing unit of the simulation node. The messages sent by the simulation node to the corresponding simulation node can be received by the corresponding bridging node. The bridging node is used to send messages to the corresponding simulation node based on the address of the corresponding simulation node and the messages periodically sent by the corresponding simulation node, thereby realizing clock simulation. Specifically, the bridging node is used to: each time it receives a message sent by the corresponding simulation node to the corresponding simulation node, reply to the corresponding simulation node with a message; the source address and destination address of the message replied by the bridging node to the corresponding simulation node are the address of the corresponding simulation node. Therefore, the bridging node acts as a proxy node for the corresponding simulation node, replying to the corresponding simulation node on behalf of the corresponding simulation node. Because the simulated nodes periodically send messages to their corresponding emulation nodes, the bridge nodes periodically reply to these emulation nodes. Thus, the bridge nodes passively respond to the periodically sent messages by the corresponding emulation nodes, mimicking a clock mechanism using the emulation node's clock mechanism. Since the simulated nodes can periodically receive messages with source addresses matching the emulation node's address, they perceive the emulation node as having a clock mechanism. Conversely, if the simulated nodes cannot receive the periodically sent messages from the emulation node, they are unaware of the emulation node's clock mechanism.
[0111] In an optional embodiment, after a simulated node establishes a neighbor relationship with a corresponding simulated node, it periodically sends a first message to the corresponding simulated node to maintain the neighbor relationship between each simulated node and the corresponding simulated node. The bridging node is configured to: receive the first message sent by the corresponding simulated node to maintain the neighbor relationship between the corresponding simulated node and the corresponding simulated node; and, based on the first message, send a second message to the corresponding simulated node to maintain the neighbor relationship between the corresponding simulated node and the corresponding simulated node. The source address and destination address of the second message sent by the bridging node to the corresponding simulated node are the addresses of the corresponding simulated node and the corresponding simulated node. For example, after simulated node E1 establishes a neighbor relationship with simulated node S1, simulated node E1 periodically sends a first message to simulated node S1 to maintain the neighbor relationship between simulated node E1 and simulated node S1. For instance, simulated node E1 includes a timing unit, and when triggered by the timing unit, simulated node E1 periodically sends the first message to simulated node S1 to maintain the neighbor relationship between simulated node E1 and simulated node S1. Bridge node Q1 is used to: upon receiving a first message from simulated node E1 to maintain the neighbor relationship between simulated node E1 and simulated node S1, send (i.e., reply) a second message to simulated node E1 to maintain the neighbor relationship between simulated node E1 and simulated node S1. The source address of the first message sent by simulated node E1 to simulated node S1 is the address of simulated node E1, and the destination address is the address of simulated node S1. Similarly, the source address of the second message sent by bridge node Q1 to simulated node E1 to maintain the neighbor relationship between simulated node E1 and simulated node S1 is the address of simulated node S1, and the destination address is the address of simulated node E1. Thus, bridge node Q1 passively responds to the messages periodically sent by simulated node E1 on behalf of simulated node S1, achieving clock simulation using the clock of simulated node E1. Since simulated node E1 can periodically receive messages with the source address of simulated node S1, simulated node E1 considers simulated node S1 to have a clock mechanism. Since simulation node S1 cannot receive the messages periodically sent by simulation node E1, simulation node S1 is unaware of simulation node E1's clock mechanism. In an optional embodiment, in BGP, both the first and second messages are keepalive messages.
[0112] The clock simulation is illustrated using the example of the messages periodically sent by the bridging node Q1 based on the simulated node E1 to keep the BGP neighbor relationship between the simulated node E1 and the simulated node S1 alive. Figure 11 This is a schematic diagram of clock simulation performed by the bridging node Q1 provided in an embodiment of this application. Figure 11As shown, the simulated node E1 includes a timing unit, which can be a BGP keepalive timer. Triggered by this timing unit, simulated node E1 periodically sends keepalive messages to simulated node S1 via simulated link A1 to maintain the BGP neighbor relationship between simulated node E1 and simulated node S1. The source address of the keepalive message sent by simulated node E1 to maintain the BGP neighbor relationship between simulated node E1 and simulated node S1 is the address of simulated node E1, and the destination address is the address of simulated node S1. Bridge node Q1 is located on simulated link A1 and can receive the keepalive messages sent by simulated node E1 via simulated link A1. Each time bridging node Q1 receives a keepalive message from simulated node E1 to maintain the BGP neighbor relationship between simulated node E1 and simulated node S1, bridging node Q1 replies to simulated node E1 with a keepalive message on behalf of simulated node S1. The source address of the keepalive message replied by bridging node Q1 to simulated node E1 is the address of simulated node S1, and the destination address is the address of simulated node E1. For example, in the first cycle, simulated node E1 sends keepalive message 1 to simulated node S1 through simulated link A1 to maintain the BGP neighbor relationship between simulated node E1 and simulated node S1. The source address of keepalive message 1 is the address of simulated node E1, and the destination address is the address of simulated node S1. After receiving keepalive message 1, bridging node Q1, on behalf of emulator S1, replies to emulator E1 with keepalive message 2 to maintain the BGP neighbor relationship between emulator E1 and emulator S1. Keepalive message 2 has the source address of emulator S1 and the destination address of emulator E1. In the second cycle, emulator E1 sends keepalive message 3 to emulator S1 via emulator link A1 to maintain the BGP neighbor relationship between emulator E1 and emulator S1. Keepalive message 3 has the source address of emulator E1 and the destination address of emulator S1. After receiving keepalive message 3, bridging node Q1, on behalf of emulator S1, replies to emulator E1 with keepalive message 4 to maintain the BGP neighbor relationship between emulator E1 and emulator S1. Keepalive message 4 has the source address of emulator S1 and the destination address of emulator E1.In the third cycle, simulated node E1 sends keepalive message 5 to simulated node S1 via simulated link A1 to maintain the BGP neighbor relationship between simulated node E1 and simulated node S1. The source address of keepalive message 5 is the address of simulated node E1, and the destination address is the address of simulated node S1. After receiving keepalive message 5, bridge node Q1 replies to simulated node E1 on behalf of simulated node S1 with keepalive message 6 to maintain the BGP neighbor relationship between simulated node E1 and simulated node S1. The source address of keepalive message 6 is the address of simulated node S1, and the destination address is the address of simulated node E1. And so on. Thus, bridge node Q1 passively responds to the keepalive messages periodically sent by simulated node E1 to maintain the BGP neighbor relationship between simulated node E1 and simulated node S1, achieving clock simulation with the help of simulated node E1's clock, and maintaining the BGP neighbor relationship between simulated node E1 and simulated node S1.
[0113] The above example of maintaining BGP neighbor relationships is merely an illustration of an embodiment of this application and does not constitute a limitation on the embodiments of this application. Simulated nodes and emulated nodes can also establish other neighbor relationships, thereby maintaining other neighbor relationships. During the process of maintaining other neighbor relationships between simulated nodes and emulated nodes, the corresponding bridging node can also perform the relevant operations in place of the emulated node. The process of maintaining other neighbor relationships can refer to relevant protocols, which will not be elaborated upon here.
[0114] In this embodiment, during the process of establishing neighbor relationships between simulated nodes and emulated nodes, the messages exchanged between the simulated nodes and the bridge node can be messages in a second format. Similarly, during the process of keeping neighbor relationships alive between simulated nodes and emulated nodes, the messages exchanged between the simulated nodes and the bridge node can also be messages in a second format. In both cases, the bridge node does not need to perform format conversion on the second-format messages sent by the simulated nodes; instead, it replies to the simulated nodes on their behalf. Therefore, in this embodiment, the bridge node can be used to perform format conversion on messages for route propagation, and to reply to messages for establishing neighbor relationships and keeping neighbor relationships alive without performing format conversion.
[0115] In the embodiments of this application, Figure 6 The communication network described in the illustrated embodiment can be Figures 2 to 5 Any of the communication networks shown 10. The following is in conjunction with... Figures 2 to 5 The communication network 10 shown in any of the examples is a virtual network constructed by the network simulation device corresponding to the communication network 10.
[0116] In one embodiment, the communication network is Figure 2 The communication network 10 shown above includes all network devices. Taking network devices R11-R15 as the first network device and network devices R1-R10 as the second network device as an example, network devices R1-R10 may include third-party devices, network devices with no more than the target number of interfaces, network devices with a first command-line support level no greater than the corresponding second command-line support level, and network devices with a support level for protocol features in the protocol feature set no greater than the target support level. The virtual network 30 constructed by the network simulation device corresponding to the communication network 10 can be as follows... Figure 12 As shown. Combined with Figure 2 and Figure 12 The virtual network 30 includes virtual nodes N1 to N15 corresponding one-to-one with network devices R1 to R15, and at least one virtual link corresponding one-to-one with at least one communication link in the communication network 10. Figure 12 In this diagram, the connection between any two virtual nodes N1 to N15 represents a virtual link deployed between those two virtual nodes. Virtual nodes N1 to N10 are analog nodes corresponding one-to-one with network devices R1 to R10, and virtual nodes N11 to N15 are emulated nodes corresponding to network devices R11 to R15. The virtual link deployed between analog node N7 and emulated node N11 (for example, referred to as virtual link L) 7-11 The virtual link deployed between simulation node N8 and simulation node N11 (for example, this virtual link is called virtual link L) 8-11 The virtual link deployed between simulation node N9 and simulation node N12 (for example, this virtual link is called virtual link L) 9-12 The virtual link deployed between simulation node N10 and simulation node N12 (for example, this virtual link is called virtual link L) 10-12 A virtual link deployed between simulation node N2 and simulation node N13 (for example, this virtual link is called virtual link L). 2-13 A virtual link deployed between simulation node N2 and simulation node N14 (for example, this virtual link is called virtual link L). 2-14 A virtual link deployed between simulation node N4 and simulation node N14 (for example, this virtual link is called virtual link L). 4-14 And, a virtual link deployed between simulation node N4 and simulation node N15 (for example, referred to as virtual link L). 4-15All are simulated links. A virtual link between any two simulated nodes N1 to N10 is a simulated link. A virtual link between any two simulated nodes N11 to N15 is a simulated link. Virtual network 30 also includes bridging nodes B1 to B8. Bridging node B1 is located at the simulated link L. 7-11 Bridge node B1 is used to connect simulation node N7 and simulation node N11. Bridge node B2 is located on simulation link L. 8-11 Bridge node B2 is used to connect simulation node N8 and simulation node N11. Bridge node B3 is located on simulation link L. 9-12 Above, bridging node B3 is used to connect simulation node N9 and simulation node N12. Bridging node B4 is located on simulation link L. 10-12 Above, bridging node B4 is used to connect simulation node N10 and simulation node N12. Bridging node B5 is located on simulation link L. 2-13 Bridge node B5 is used to connect simulation node N2 and simulation node N13. Bridge node B6 is located on simulation link L. 2-14 Bridge node B6 is used to connect simulation node N2 and simulation node N14. Bridge node B7 is located on simulation link L. 4-14 Bridge node B7 is used to connect simulation node N4 and simulation node N14. Bridge node B8 is located on simulation link L. 4-15 In the above, bridging node B8 is used to connect simulation node N4 and simulation node N15. The implementation process of each bridging node (B1-B8) connecting simulation nodes can be referred to the description above, and will not be repeated here.
[0117] In another embodiment, the communication network is Figure 3 The communication network 10 shown above includes all the network devices in the aforementioned network network 10. Taking network devices R2-R7 as first network devices and network devices R1 and R8 as second network devices as an example, network devices R1 and R8 are third-party devices. The virtual network 40 constructed by the network simulation device corresponding to the communication network 10 is as follows... Figure 13 As shown. Combined with Figure 3 and Figure 13 The virtual network 40 includes virtual nodes N1 to N8 corresponding one-to-one with network devices R1 to R8, and at least one virtual link corresponding one-to-one with at least one communication link in the communication network 10. Figure 13In this diagram, the connection between any two virtual nodes N1 to N8 represents a virtual link deployed between those two virtual nodes. Virtual nodes N2 to N7 are emulated nodes corresponding one-to-one with network devices R2 to R7, virtual node N1 is the emulated node corresponding to network device R1, and virtual node N8 is the emulated node corresponding to network device R8. The virtual link deployed between emulated node N1 and emulated node N2 (for example, referred to as virtual link L) 1-2 And the virtual link deployed between simulation node N8 and simulation node N7 (for example, this virtual link is called virtual link L). 8-7 All are simulated links. The virtual link deployed between simulated node N1 and simulated node N8 is a simulated link. The virtual link deployed between any two simulated nodes N2 to N7 is also a simulated link. Virtual network 40 also includes bridging nodes B1 to B2. Bridging node B1 is located on simulated link L. 1-2 In the above section, bridging node B1 is used to connect simulation node N1 and simulation node N2. Bridging node B2 is located on simulation link L. 8-7 In the above, bridging node B2 is used to connect simulation node N8 and simulation node N7. The implementation process of each bridging node B1 to B2 to connect simulation nodes can be referred to the description above, and will not be repeated here.
[0118] In another embodiment, the communication network is Figure 4 The communication network 10 shown above includes all the network devices in the network network 10. Taking network devices R5-R14 as the first network devices and network devices R1-R4 as the second network devices as an example, for instance, network devices R1-R2 are third-party devices, and network devices R3-R4 have a support level for protocol features in the protocol feature set that is no greater than the target support level. The virtual network 50 constructed by the network simulation device corresponding to the communication network 10 is as follows... Figure 14 As shown. Combined with Figure 4 and Figure 14 The virtual network 50 includes virtual nodes N1 to N14 corresponding one-to-one with network devices R1 to R14, and at least one virtual link corresponding one-to-one with at least one communication link in the communication network 10. Figure 14 In this diagram, the connection between any two virtual nodes N1 to N14 represents a virtual link deployed between those two virtual nodes. Virtual nodes N5 to N14 are emulated nodes corresponding one-to-one with network devices R5 to R14, and virtual nodes N1 to N4 are simulated nodes corresponding one-to-one with network devices R1 to R4. A virtual link is deployed between simulated node N1 and emulated node N11 (for example, this virtual link is called virtual link L). 1-11The virtual link deployed between simulation node N1 and simulation node N12 (for example, this virtual link is called virtual link L) 1-12 A virtual link deployed between simulation node N2 and simulation node N13 (for example, this virtual link is called virtual link L). 2-13 A virtual link deployed between simulation node N2 and simulation node N14 (for example, this virtual link is called virtual link L). 2-14 A virtual link deployed between simulation node N3 and simulation node N10 (for example, this virtual link is called virtual link L). 3-10 And, a virtual link deployed between simulation node N4 and simulation node N9 (for example, referred to as virtual link L). 4-9 All are simulated links. A virtual link between any two simulated nodes N1 to N4 is a simulated link. A virtual link between any two simulated nodes N5 to N14 is a simulated link. Virtual network 50 also includes bridging nodes B1 to B6. Bridging node B1 is located at the simulated link L. 1-11 Bridge node B1 is used to connect simulation node N1 and simulation node N11. Bridge node B2 is located on simulation link L. 1-12 Above, bridging node B2 is used to connect simulation node N1 and simulation node N12. Bridging node B3 is located on simulation link L. 2-13 Above, bridging node B3 is used to connect simulation node N2 and simulation node N13. Bridging node B4 is located on simulation link L. 2-14 Above, bridging node B4 is used to connect simulation node N2 and simulation node N14. Bridging node B5 is located on simulation link L. 3-10 Above, bridging node B5 is used to connect simulation node N3 and simulation node N10. Bridging node B6 is located on simulation link L. 4-9 In the above, bridging node B6 is used to connect simulation node N4 and simulation node N9. The process of each bridging node (B1-B6) connecting simulation nodes can be referred to the description above, and will not be repeated here.
[0119] In another embodiment, the communication network is Figure 4The communication network 10 shown above includes all the network devices in the aforementioned network network 10. Taking network devices R1, R3-R11 as the first network devices and network devices R2, R13-R14 as the second network devices as an example, for instance, network devices R2, R13-R14 are in the same autonomous system (AS) 100, and the network devices in AS 100 are third-party devices (i.e., network devices R2, R13-R14 are third-party devices), or AS 100 deploys protocols with limited scope of influence, such as the Virtual Router Redundancy Protocol (VRRP). The virtual network 60 constructed by the network simulation device corresponding to the communication network 10 is as follows... Figure 15 As shown. Combined with Figure 4 and Figure 15 The virtual network 60 includes virtual nodes N1 to N14 corresponding one-to-one with network devices R1 to R14, and at least one virtual link corresponding one-to-one with at least one communication link in the communication network 10. Figure 15 In this diagram, the connection between any two virtual nodes N1 to N14 represents a virtual link deployed between those two virtual nodes. Virtual nodes N1, N3 to N11 are emulated nodes corresponding one-to-one with network devices R1, R3 to R11, and virtual nodes N2, N13 to N14 are simulated nodes corresponding one-to-one with network devices R2, R13 to R14. The virtual link deployed between simulated node N1 and emulated node N2 (for example, referred to as virtual link L) 1-2 And the virtual link deployed between simulation node N2 and simulation node N10 (for example, this virtual link is called virtual link L). 2-10 All are simulated links. A virtual link between any two simulated nodes N2, N13-N14 is a simulated link. A virtual link between any two simulated nodes N1, N3-N11 is a simulated link. Virtual network 60 also includes bridging nodes B1-B2. Bridging node B1 is located at the simulated link L. 1-2 In the above section, bridging node B1 is used to connect simulation node N1 and simulation node N2. Bridging node B2 is located on simulation link L. 2-10 In the above, bridging node B2 is used to connect simulation node N10 and simulation node N2. The process of each bridging node B1 to B2 connecting simulation nodes can be referred to the description above, and will not be repeated here.
[0120] In another embodiment, the communication network is Figure 5The communication network 10 shown above includes a network devices in region 1 of the communication network 10. These a network devices include network devices X1 to X23. Taking network devices X10 to X23 as the first network devices and network devices X1 to X9 as the second network devices as an example, the virtual network 70 constructed by the network simulation device corresponding to the communication network 10 (specifically, the virtual network corresponding to region 1 of the communication network 10) can be constructed as follows: Figure 16 As shown. Combined with Figure 5 and Figure 16 The virtual network 70 includes virtual nodes N1 to N23 corresponding one-to-one with network devices X1 to X23, and at least one virtual link corresponding one-to-one with at least one communication link in the communication network 10. Figure 16 In this diagram, the connection between any two virtual nodes N1 to N23 represents a virtual link deployed between those two virtual nodes. Virtual nodes N10 to N23 are emulated nodes corresponding one-to-one with network devices X10 to X23, and virtual nodes N1 to N9 are emulated nodes corresponding one-to-one with network devices X1 to X9. A virtual link is deployed between emulated node N1 and emulated node N16 (for example, this virtual link is called virtual link L). 1-16 A virtual link deployed between simulation node N2 and simulation node N10 (for example, this virtual link is called virtual link L). 2-10 The virtual link deployed between simulation node N2 and simulation node N11 (for example, this virtual link is called virtual link L) 2-11 A virtual link deployed between simulation node N2 and simulation node N19 (for example, this virtual link is called virtual link L). 2-19 The virtual link deployed between simulation node N3 and simulation node N12 (for example, this virtual link is called virtual link L) 3-12 The virtual link deployed between simulation node N4 and simulation node N13 (for example, this virtual link is called virtual link L) 4-13 A virtual link deployed between simulation node N4 and simulation node N14 (for example, this virtual link is called virtual link L). 4-14 And, a virtual link deployed between simulation node N9 and simulation node N15 (for example, referred to as virtual link L). 9-15 All of these are simulated links.
[0121] A virtual link between any two simulated nodes deployed among simulated nodes N1 to N9 is a simulated link. A virtual link between any two simulated nodes deployed among simulated nodes N10 to N23 is a simulated link. Virtual network 70 also includes bridging nodes B1 to B8. Bridging node B1 is located at the simulated link L. 3-12Above, bridging node B1 is used to connect simulation node N3 and simulation node N12. Bridging node B2 is located on simulation link L. 4-13 Bridge node B2 is used to connect simulation node N4 and simulation node N13. Bridge node B3 is located on simulation link L. 4-14 In the above section, bridging node B3 is used to connect simulation node N4 and simulation node N14. Bridging node B4 is located on simulation link L. 9-15 Above, bridging node B4 is used to connect simulation node N9 and simulation node N15. Bridging node B5 is located on simulation link L. 1-16 Above, bridging node B5 is used to connect simulation node N1 and simulation node N16. Bridging node B6 is located on simulation link L. 2-10 Above, bridging node B6 is used to connect simulation node N2 and simulation node N10. Bridging node B7 is located on simulation link L. 2-19 Above, bridging node B7 is used to connect simulation node N2 and simulation node N19. Bridging node B8 is located on simulation link L. 2-11 In the above, bridging node B8 is used to connect simulation node N2 and simulation node N11. The implementation process of each bridging node B1 to B8 to connect simulation nodes can be referred to the description above, and will not be repeated here.
[0122] S602. Simulate the protocol behavior of the communication network based on the virtual network, obtain the protocol behavior simulation results, and output them.
[0123] As previously described, the virtual network includes a simulation node S1 corresponding to a first network device in the communication network, a simulation node E1 corresponding to a second network device in the communication network, and a simulation link A1 connected to simulation nodes S1 and E1. Simulation link A1 includes a bridging node Q1. Simulation node S1 simulates the corresponding first network device, and simulation node E1 simulates the corresponding second network device. The network simulation device controls simulation node S1 to simulate protocol behavior according to the configuration information of the corresponding first network device (i.e., the network simulation device controls simulation node S1 to simulate the protocol behavior of the corresponding first network device according to its configuration information). The network simulation device controls simulation node E1 to simulate protocol behavior according to the configuration information of the corresponding second network device (i.e., the network simulation device controls simulation node E1 to simulate the protocol behavior of the corresponding second network device according to its configuration information).
[0124] In specific embodiments, the network simulation device controls simulation node S1 to send and receive messages according to the configuration information of the corresponding first network device, and processes the received and sent messages. The network simulation device controls simulation node E1 to send and receive messages according to the configuration information of the corresponding second network device, and processes the received and sent messages. For example, the network simulation device controls simulation node S1 to reply to received messages, and the network simulation device controls simulation node S1 to generate relevant information tables such as routing tables, neighbor tables, label tables, LSDB tables, or tunnel-info tables based on the received and sent messages. The network simulation device controls simulation node E1 to reply to received messages, and the network simulation device controls simulation node E1 to generate relevant information tables such as routing tables, neighbor tables, label tables, LSDB tables, or tunnel-info tables based on the received and sent messages.
[0125] During the protocol behavior simulation between simulated node S1 and simulated node E1, bridge node Q1 performs at least one of the following: format conversion of messages transmitted via simulated link A1 (e.g., format conversion of messages used for route propagation); establishing a neighbor relationship with simulated node E1 based on the address of simulated node S1; and clock simulation based on the address of simulated node S1 and the periodically sent messages by simulated node E1. For example, if the message format matching the simulated node is a first format and the message format matching the simulated node is a second format, during the protocol behavior simulation between simulated node S1 and simulated node E1, simulated node S1 can send messages of the first format to simulated node E1 via simulated link A1, and bridge node Q1 converts the messages of the first format sent by simulated node S1 via simulated link A1 into messages of the second format and sends the messages of the second format to simulated node E1. And / or, simulated node E1 can send messages of the second format to simulated node S1 via simulated link A1, and bridge node Q1 converts the messages of the second format sent by simulated node E1 via simulated link A1 into messages of the first format and sends the messages of the first format to simulated node S1.
[0126] In an optional embodiment, the virtual network includes multiple virtual nodes corresponding one-to-one with multiple network devices in the communication network and at least one virtual link corresponding one-to-one with at least one communication link in the communication network. The multiple virtual nodes include at least one emulated node and at least one simulated node. The at least one virtual link includes at least one simulated link. The at least one emulated node includes emulated node S1, the at least one simulated node includes emulated node E1, and the at least one simulated link includes simulated link A1. Each of the multiple virtual nodes is used to simulate a corresponding network device. The network simulation device controls each of the multiple virtual nodes to simulate protocol behavior according to the configuration information of the corresponding network device (that is, the network simulation device controls each of the multiple virtual nodes to simulate the protocol behavior of the corresponding network device according to the configuration information of the corresponding network device), so as to simulate the protocol behavior of the communication network according to the virtual network. In a specific embodiment, the network simulation device controls each of the multiple virtual nodes to send and receive messages according to the configuration information of the corresponding network device, and processes the sent and received messages. For example, the network simulation device controls each of the multiple virtual nodes to reply to received messages. Each virtual node generates relevant information tables such as routing tables, neighbor tables, label tables, LSDB tables, or tunnel-info tables based on the sent and received messages. The network simulation device performs protocol behavior simulation on the communication network based on this virtual network, obtaining protocol behavior simulation results corresponding to each of the multiple virtual nodes. The protocol behavior simulation results corresponding to each virtual node are obtained by simulating the protocol behavior of each virtual node according to the configuration information of the corresponding network device. These simulation results include relevant information tables such as routing tables, neighbor tables, label tables, LSDB tables, or tunnel-info tables.
[0127] In an optional embodiment, during the process of the network simulation device simulating the protocol behavior of the communication network according to the virtual network, the bridging node is used to perform at least one of the following: format conversion of messages transmitted through the corresponding simulated link (e.g., format conversion of messages used for route propagation); establishing a neighbor relationship with the corresponding simulated node based on the address of the corresponding simulated node; and performing clock simulation based on the address of the corresponding simulated node and the messages periodically sent by the corresponding simulated node.
[0128] The bridging node performs format conversion on messages transmitted through the corresponding simulated link, ensuring that the format of messages sent and received by the simulated node matches that of the simulated node, and vice versa, thus enabling message communication between the simulated nodes. For example, during the process of a network simulation device simulating the protocol behavior of a communication network based on the virtual network, the bridging node is used to: convert messages in a first format sent by the corresponding simulated node through the corresponding simulated link into messages in a second format, and send the second format messages to the corresponding simulated node; and / or, convert messages in a second format sent by the corresponding simulated node through the corresponding simulated link into messages in a first format, and send the first format messages to the corresponding simulated node.
[0129] In an optional embodiment, the network simulation device controls each of the at least one simulation node to send a message in a first format according to the configuration information of the corresponding network device (i.e., the first network device), and controls each of the at least one simulation node to process the received message in the first format. For example, the network simulation device controls each of the at least one simulation node to generate an information-related table based on the received message in the first format. Furthermore, the network simulation device controls each of the at least one simulation node to send a message in a second format according to the configuration information of the corresponding network device (i.e., the second network device), and controls each of the at least one simulation node to process the received message in the second format. For example, the network simulation device controls each of the at least one simulation node to generate an information-related table based on the received message in the second format.
[0130] In one embodiment, under the control of the network simulation device, the simulation node S1 generates a message in a first format according to the configuration information of the network device (i.e., the first network device) corresponding to the simulation node S1, and sends the message in the first format through the simulation link A1; after receiving the message in the first format, the bridging node Q1 located on the simulation link A1 converts the message in the first format into a message in a second format and sends the message in the second format to the simulation node E1; after receiving the message in the second format, the simulation node E1 processes it according to the message in the second format (for example, generating relevant information tables such as routing tables, label tables, LSDB tables or tunnel-info tables according to the message in the second format). Furthermore, under the control of the network simulation device, simulated node E1 generates a message in a second format according to the configuration information of the network device (i.e., the second network device) corresponding to simulated node E1, and sends the message in the second format through simulated link A1; after receiving the message in the second format, bridging node Q1 located on simulated link A1 converts the message in the second format into a message in a first format and sends the message in the first format to simulated node S1; after receiving the message in the first format, simulated node S1 processes it according to the message in the first format (for example, generating relevant information tables such as routing tables, label tables, LSDB tables, or tunnel-info tables according to the message in the first format). It should be noted that this embodiment of the application uses the interaction between the simulated node (i.e., simulated node S1) corresponding to simulated link A1 and the simulated node (i.e., simulated node E1) corresponding to simulated link A1 to simulate protocol behavior as an example for illustration. Simulation link A1 is any one of the above at least one simulation link. The process of the simulation node corresponding to each simulation link interacting with the simulation node corresponding to each simulation link to simulate protocol behavior can be referred to as the process of simulation node S1 interacting with simulation node E1 to simulate protocol behavior. This application embodiment will not be described in detail here.
[0131] In an optional embodiment, the aforementioned at least one simulation node may be multiple simulation nodes, and different simulation nodes among these multiple simulation nodes may interact to simulate protocol behavior. For example, the aforementioned at least one virtual link includes at least one simulation link (or simulation-simulation link), with each end of each simulation link connected to a simulation node, and each simulation link deployed between two simulation nodes. The two simulation nodes at both ends of each simulation link can interact with messages of a first format through each simulation link to simulate protocol behavior. Taking the interaction of messages of a first format between the two simulation nodes at both ends of a first simulation link to simulate protocol behavior as an example, for instance, the multiple simulation nodes include simulation node S2 and simulation node S3, one end of the first simulation link is connected to simulation node S2, and the other end of the first simulation link is connected to simulation node S3. One of the simulation nodes S2 and simulation node S3 may be the same simulation node as simulation node S1, or simulation node S1, simulation node S2, and simulation node S3 may be three different simulation nodes. Under the control of the network simulation device, simulation node S2 generates a message in a first format according to the configuration information of the network device (i.e., the first network device) corresponding to simulation node S2, and sends the message in the first format through the first simulation link; simulation node S3 receives the message in the first format through the first simulation link, and processes it according to the message in the first format (e.g., generating relevant information tables such as routing tables, label tables, LSDB tables, or tunnel-info tables according to the message in the first format); and simulation node S3 generates a message in the first format according to the configuration information of the network device (i.e., the first network device) corresponding to simulation node S3, and sends the message in the first format through the first simulation link; simulation node S2 receives the message in the first format through the first simulation link, and processes it according to the message in the first format (e.g., generating relevant information tables such as routing tables, label tables, LSDB tables, or tunnel-info tables according to the message in the first format). It should be noted that this embodiment of the application uses the interaction of two simulation nodes (i.e., simulation node S2 and simulation node S3) corresponding to the first simulation link to simulate protocol behavior as an example. The first simulation link is any one of the above-mentioned at least one simulation link. The process of two simulation nodes interacting to simulate protocol behavior for each simulation link can be referred to as the process of simulation node S2 and simulation node S3 interacting to simulate protocol behavior. This application embodiment will not be described in detail here.
[0132] In an optional embodiment, the aforementioned at least one simulated node may be multiple simulated nodes, and different simulated nodes among these multiple simulated nodes may interact to simulate protocol behavior. For example, the aforementioned at least one virtual link includes at least one simulated link (or simulated-simulated link), with each end of each simulated link connected to a simulated node, and each simulated link deployed between two simulated nodes. The two simulated nodes at both ends of each simulated link can interact with messages of a second format through each simulated link to simulate protocol behavior. Taking the two simulated nodes at both ends of a first simulated link interacting with messages of a second format through the first simulated link to simulate protocol behavior as an example, for instance, the multiple simulated nodes include simulated node E2 and simulated node E3, one end of the first simulated link is connected to simulated node E2, and the other end of the first simulated link is connected to simulated node E3. One of the simulated nodes, simulated node E2 and simulated node E3, may be the same simulated node as simulated node E1, or simulated node E1, simulated node E2, and simulated node E3 may be three different simulated nodes. Under the control of the network simulation device, simulated node E2 generates a message in a second format according to the configuration information of the network device (i.e., the second network device) corresponding to simulated node E2, and sends the message in the second format through the first simulated link; simulated node E3 receives the message in the second format through the first simulated link, and processes it according to the message in the second format (e.g., generating relevant information tables such as routing tables, label tables, LSDB tables, or tunnel-info tables according to the message in the second format); and simulated node E2 receives the message in the second format through the first simulated link, and processes it according to the message in the second format (e.g., generating relevant information tables such as routing tables, label tables, LSDB tables, or tunnel-info tables according to the message in the second format). It should be noted that this embodiment of the application uses the interaction between two simulated nodes (i.e., simulated node E2 and simulated node E3) corresponding to the first simulated link to illustrate the protocol behavior simulation. The first simulated link is any one of the at least one simulated link mentioned above. The process of two simulated nodes interacting to simulate protocol behavior for each simulated link can be referred to as the process of simulated node E2 and simulated node E3 interacting to simulate protocol behavior. This application embodiment will not be described in detail here.
[0133] In an optional embodiment, the network simulation device controls the simulated nodes to simulate the protocol behavior of the neighbor relationship establishment process, and controls the simulated nodes to maintain the FSM state during the neighbor relationship establishment process. The bridging node is also used to establish a neighbor relationship with the corresponding simulated node based on the address of the corresponding simulated node. This neighbor relationship is between the corresponding simulated node and the corresponding simulated node. For example, under the control of the network simulation device, simulated node E1 sends a message to simulated node S1 through simulated link A1 to establish a neighbor relationship between simulated node E1 and simulated node S1. Bridging node Q1, based on the message sent by simulated node E1 to establish a neighbor relationship between simulated node E1 and simulated node S1, establishes a neighbor relationship with simulated node E1 based on the address of simulated node S1 (the neighbor relationship established by bridging node Q1 with simulated node E1 based on the address of simulated node S1 is the neighbor relationship between simulated node E1 and simulated node S1). In a specific embodiment, bridging node Q1 interacts with simulated node E1 based on the address of simulated node S1 to exchange messages for establishing a neighbor relationship between simulated node E1 and simulated node S1, thereby establishing a neighbor relationship between simulated node E1 and simulated node S1. During the process of bridging node Q1 establishing a neighbor relationship between simulated node E1 and simulated node S1: the source address of the message sent by simulated node E1 to establish the neighbor relationship between simulated node E1 and simulated node S1 is the address of simulated node E1, and the destination address is the address of simulated node S1; the source address of the message sent by bridging node Q1 to simulated node E1 to establish the neighbor relationship between simulated node E1 and simulated node S1 is the address of simulated node S1, and the destination address is the address of simulated node E1. Furthermore, the messages exchanged between bridging node Q1 and simulated node E1 are messages in the second format. The process of simulated node E1 interacting with bridging node Q1 to establish the neighbor relationship between simulated node E1 and simulated node S1, as well as the FSM state transition process of simulated node E1 during the establishment of the neighbor relationship, can be referred to S601 and its related description, and will not be elaborated upon here in this embodiment. It should be noted that this application embodiment takes the establishment of the neighbor relationship between the simulation node (i.e., simulation node E1) corresponding to simulation link A1 and the simulation node (i.e., simulation node S1) corresponding to simulation link A1 as an example. The process of establishing the neighbor relationship between the simulation node corresponding to each of the above at least one simulation link and the simulation node corresponding to each simulation link can refer to the process of establishing the neighbor relationship between simulation node E1 and simulation node S1, and will not be repeated here in this application embodiment.
[0134] Furthermore, when at least one of the aforementioned simulated nodes is multiple simulated nodes, neighbor relationships are also established between different simulated nodes among these multiple simulated nodes. Each simulated node maintains its FSM state during the neighbor relationship establishment process. For example, two simulated nodes at both ends of each simulated link establish a neighbor relationship by exchanging messages of the second format through each simulated link, and these two simulated nodes maintain their FSM states during the neighbor relationship establishment process. The process of any two simulated nodes interacting to establish a neighbor relationship can be referenced to the process of simulated node E1 and bridge node Q1 interacting to establish a neighbor relationship between simulated node E1 and simulated node S1. The difference is that in the process of simulated node E1 and bridge node Q1 interacting to establish a neighbor relationship between simulated node E1 and simulated node S1, bridge node Q1 uses the address of simulated node S1 to interact with simulated node E1; while in the implementation of any two simulated nodes interacting to establish a neighbor relationship, each of the two simulated nodes uses its own address to interact with the other. That is, in any two simulated nodes: the source address of the message sent by one simulated node to the other to establish a neighbor relationship between the two simulated nodes is the address of the first simulated node, and the destination address is the address of the other simulated node; the source address of the message sent by the other simulated node to the first simulated node to establish a neighbor relationship between the two simulated nodes is the address of the other simulated node, and the destination address is the address of the first simulated node. For example, one end of the first simulated link is connected to simulated node E2, and the other end of the first simulated link is connected to simulated node E3. Under the control of the network simulation device, simulated node E2 and simulated node E3 establish a neighbor relationship by exchanging messages of the second format through the first simulated link, and simulated node E2 and simulated node E3 maintain FSM state during the process of establishing a neighbor relationship. The source address of the message sent by simulated node E2 to simulated node E3 to establish a neighbor relationship between simulated node E2 and simulated node E3 is the address of simulated node E2, and the destination address is the address of simulated node E3. The source address of the message sent by simulated node E3 to simulated node E2 to establish a neighbor relationship between simulated node E2 and simulated node E3 is the address of simulated node E3, and the destination address is the address of simulated node E2.
[0135] Simulated nodes can generate a neighbor table by simulating the protocol behavior of the neighbor relationship establishment process. For example, for any simulated node, after establishing a neighbor relationship with a corresponding simulated node, the simulated node generates a neighbor table entry (e.g., called neighbor table entry 1) corresponding to the corresponding simulated node. Neighbor table entry 1 is used to record the neighbor relationship between the simulated node and the corresponding simulated node. After establishing a neighbor relationship with another simulated node, the simulated node generates a neighbor table entry (e.g., called neighbor table entry 2) corresponding to the other simulated node. Neighbor table entry 2 is used to record the neighbor relationship between the simulated node and the other simulated node.
[0136] In an optional embodiment, after the network simulation device controls the simulated nodes to simulate the protocol behavior of establishing neighbor relationships, the network simulation device controls the simulated nodes to maintain the neighbor relationship. For example, after the network simulation device controls simulated node E1 to establish a neighbor relationship with simulated node S1, the network simulation device controls simulated node E1 to maintain the neighbor relationship between simulated node E1 and simulated node S1. In a specific embodiment, under the control of the network simulation device, simulated node E1 sends a first message for maintaining the neighbor relationship between simulated node E1 and simulated node S1 to simulated node S1 through simulated link A1; after receiving the first message for maintaining the neighbor relationship between simulated node E1 and simulated node S1 sent by simulated node E1, bridge node Q1 sends (e.g., replies) a second message for maintaining the neighbor relationship between simulated node E1 and simulated node S1 to simulated node E1 based on the first message sent by simulated node E1. The source address of the first message is the address of the simulated node E1, and the destination address of the first message is the address of the simulated node S1; the source address of the second message is the address of the simulated node S1, and the destination address of the second message is the address of the simulated node E1. Thus, bridging node Q1 interacts with simulated node E1 based on the address of simulated node S1 to exchange messages used to maintain the neighbor relationship between simulated node E1 and simulated node S1, thereby achieving the maintenance of that neighbor relationship.
[0137] In a specific embodiment, under the control of the network simulation device, simulated node E1 periodically sends a first message to simulated node S1 to maintain the neighbor relationship between simulated node E1 and simulated node S1. For example, simulated node E1 includes a timing unit, which triggers the simulation node E1 to periodically send the first message to simulated node S1 to maintain the neighbor relationship between simulated node E1 and simulated node S1. Each time bridge node Q1 receives the first message from simulated node E1 to maintain the neighbor relationship between simulated node E1 and simulated node S1, bridge node Q1 sends (e.g., a reply) a second message to simulated node E1 to maintain the neighbor relationship between simulated node E1 and simulated node S1. Since simulated node E1 periodically sends the first message to simulated node S1, and bridge node Q1 sends (e.g., a reply) the second message to simulated node E1 each time it receives the first message, bridge node Q1 can periodically send the second message to simulated node E1. By passively responding to the first message periodically sent by the simulated node E1, the bridging node Q1 not only maintains the neighbor relationship between the simulated node E1 and the simulation node S1, but also realizes clock simulation.
[0138] In an optional implementation, the duration of the period used to keep the neighbor relationship between simulated node E1 and simulated node S1 alive is a first duration, and the aforementioned timing unit of simulated node E1 is a timer (for example, in BGP, this timer could be a BGP keepalive timer). Under the control of the network simulation device, simulated node E1 controls the timer to count down for the first duration. When the timer counts down to the end, simulated node E1 sends a first message to simulated node S1 to keep the neighbor relationship between simulated node E1 and simulated node S1 alive, and then restarts the timer to count down for the first duration. When the timer counts down again to the end, simulated node E1 again sends the first message to simulated node S1 to keep the neighbor relationship between simulated node E1 and simulated node S1 alive. And so on. Thus, simulated node E1 periodically sends the first message to simulated node S1 to keep the neighbor relationship between simulated node E1 and simulated node S1 alive under the trigger of this timing unit.
[0139] It should be noted that during the process of bridging node Q1 and simulation node E1 interacting to maintain the neighbor relationship between simulation node E1 and simulation node S1, the messages exchanged between bridging node Q1 and simulation node E1 are messages in the second format. The process of simulation node E1 and bridging node Q1 interacting to maintain the neighbor relationship between simulation node E1 and simulation node S1 can be referred to S601 and its related description. Furthermore, this embodiment uses maintaining the neighbor relationship between the simulation node corresponding to simulation link A1 (i.e., simulation node E1) and the simulation node corresponding to simulation link A1 (i.e., simulation node S1) as an example. The process of maintaining the neighbor relationship between the simulation node corresponding to any one of the above at least one simulation link and the simulation node corresponding to that simulation link can be referred to the process of maintaining the neighbor relationship between simulation node E1 and simulation node S1. Moreover, during the interaction process of maintaining the neighbor relationship between the simulation node corresponding to any simulation link and the simulation node corresponding to that simulation link, the bridging node on that simulation link can implement clock simulation, which will not be elaborated upon in this embodiment.
[0140] As mentioned earlier, when at least one simulated node is multiple simulated nodes, neighbor relationships are also established between different simulated nodes among these multiple simulated nodes. Therefore, after establishing neighbor relationships, these different simulated nodes maintain those neighbor relationships. For example, two simulated nodes at both ends of each simulated link maintain their neighbor relationship by exchanging messages of a second format through each simulated link. During the process of any two simulated nodes exchanging messages to maintain their neighbor relationship, each of these two simulated nodes sends a message to the other to maintain the neighbor relationship, triggered by its own timing unit. For example, one end of the first simulated link is connected to simulated node E2, and the other end of the first simulated link is connected to simulated node E3. Under the control of the network simulation device, simulated node E2 and simulated node E3 maintain their neighbor relationship by exchanging messages of a second format through the first simulated link. Specifically, simulated nodes E2 and E3 each include a timing unit. Under the control of the network simulation device, simulated node E2 periodically sends messages to simulated node E3 to maintain the neighbor relationship between simulated nodes E2 and E3, triggered by its timing unit. Simulated node E3, in turn, periodically sends messages to simulated node E2 to maintain the neighbor relationship. The source address of the messages sent by simulated node E2 to simulated node E3 to maintain the neighbor relationship is the address of simulated node E2, and the destination address is the address of simulated node E3. Conversely, the source address of the messages sent by simulated node E3 to simulated node E2 to maintain the neighbor relationship is the address of simulated node E3, and the destination address is the address of simulated node E2. After receiving the message from simulated node E2 regarding maintaining the neighbor relationship between simulated nodes E2 and E3, simulated node E3 can reply to simulated node E2 with a message. The source address of the reply message from simulated node E3 to simulated node E2 is the address of simulated node E3, and the destination address is the address of simulated node E2. Similarly, after receiving the message from simulated node E3 regarding maintaining the neighbor relationship between simulated nodes E2 and E3, simulated node E2 can reply to simulated node E3 with a message. The source address of the reply message from simulated node E2 to simulated node E3 is the address of simulated node E2, and the destination address is the address of simulated node E3. The period at which simulated node E2 sends the message regarding maintaining the neighbor relationship between simulated nodes E2 and E3 can be the same as or different from the period at which simulated node E3 sends the same message to simulated node E2. This embodiment of the application does not limit this.
[0141] In this embodiment of the application, the virtual network corresponding to the communication network can be Figures 12 to 16 Any virtual network in the network.
[0142] In one embodiment, the virtual network is Figure 12 The virtual network 30 is shown. Simulation link A1 is a virtual link between any one of the simulation nodes N1 to N10 and any one of the simulation nodes N11 to N15. The first simulation link is a virtual link between any two simulation nodes N11 to N15.
[0143] In another embodiment, the virtual network is Figure 13 The virtual network 40 is shown. Simulation link A1 is a virtual link deployed between simulation node N1 and simulation node N2, or a virtual link deployed between simulation node N8 and simulation node N7. The first simulation link is a virtual link deployed between any two simulation nodes N2 to N7. The first simulation link is a virtual link deployed between simulation node N1 and simulation node N8.
[0144] In another embodiment, the virtual network is Figure 14 The virtual network 50 shown. Simulation link A1 is a virtual link between any one of the simulation nodes N1-N4 and any one of the simulation nodes N5-N14. The first simulation link is a virtual link between any two simulation nodes N5-N14. The first simulation link, which is a virtual link between any two simulation nodes N1-N4, is a simulation link.
[0145] In yet another embodiment, the virtual network is Figure 15 The virtual network 60 is shown. Simulation link A1 is a virtual link between any one of the simulation nodes N2, N13-N14 and any one of the simulation nodes N1, N3-N11. The first simulation link is a virtual link between any two simulation nodes N1, N3-N11.
[0146] In yet another embodiment, the virtual network is Figure 16 The virtual network 70 is shown. Simulation link A1 is a virtual link between any one of the simulation nodes N1-N9 and any one of the simulation nodes N10-N23. The first simulation link is a virtual link between any two simulation nodes N10-N23.
[0147] After the network simulation device simulates the protocol behavior of the communication network based on the virtual network and obtains the simulation results, it outputs the protocol behavior simulation. In an optional embodiment, the simulation request is sent by the client to the network simulation device, which then sends the protocol behavior simulation results to the client to output those results. The client receives the protocol behavior simulation results sent by the network simulation device. After receiving the simulation results, the client can also display them for easy viewing. The user can also analyze the communication network based on the simulation results. For example, the user can calculate traffic paths, verify the connectivity of the calculated traffic paths, and perform network capacity analysis based on the simulation results; this embodiment does not limit this specific action.
[0148] In an optional embodiment, the client displays the received protocol behavior simulation results simultaneously with the protocol behavior simulation results sent by the network simulation device. That is, the client receives and displays the received protocol behavior simulation results from the network simulation device at the same time. In a specific embodiment, the network simulation device performs protocol behavior simulation on the communication network based on the virtual network, obtaining protocol behavior simulation results corresponding one-to-one with multiple virtual nodes in the virtual network. The network simulation device sends these protocol behavior simulation results to the client. The client receives and displays these protocol behavior simulation results corresponding to the multiple virtual nodes. For each simulated node among the multiple virtual nodes, the client receives and displays the protocol behavior simulation results corresponding to each simulated node simultaneously. For example, while receiving the protocol behavior simulation results corresponding to each simulated node, the client also displays the protocol behavior simulation results corresponding to each simulated node based on user actions (e.g., user-input command lines). For example, the client receives the simulation results of the protocol behavior corresponding to the simulated node E1, and displays the simulation results of the protocol behavior corresponding to the simulated node E1 based on the user's operation.
[0149] In summary, the technical solution provided in this application is a fusion simulation solution that integrates network simulation and network emulation technologies to simulate communication networks. Compared to current network simulation technologies, the technical solution provided in this application has lower difficulty in supporting third-party devices, improves the accuracy of simulating heterogeneous networks, and increases the coverage of protocol characteristics. Compared to current network emulation technologies, the technical solution provided in this application has lower resource overhead and is applicable to large-scale communication networks. The technical solution provided in this application leverages the advantages of network simulation and network emulation technologies while addressing their existing problems to a certain extent.
[0150] In this embodiment, the simulation link is deployed between simulation nodes. The simulation link includes a bridging node. The simulation node is a virtual node obtained using a first method (i.e., a virtual node obtained by device modeling based on the network device's configuration information), and the emulation node is a virtual node obtained using a second method (i.e., a virtual node generated based on the network device's device image). The first method is also called the simulation method, and the second method is also called the emulation method. In this embodiment, the bridging node bridges the differences in the technology stacks between the simulation node and the emulation node (or in other words, bridges the differences between network simulation technology and network emulation technology), allowing these two technology stacks to remain independent.
[0151] It should be noted that, for Figure 5 The communication network 10 shown can have network devices X1 to X23 that are part of the network devices in region 1; correspondingly, for Figure 16The virtual network 70 shown has virtual nodes N1 to N23, which are a subset of virtual nodes within it. For example, region 1 includes 1000 network devices. During the construction of the virtual network 70 by the network simulation device, 200 of these 1000 network devices are designated as second network devices, and the remaining 800 are designated as first network devices. Correspondingly, the virtual network 70 constructed by the network simulation device includes 1000 virtual nodes, each corresponding to one of the 1000 network devices. These 1000 virtual nodes include 200 simulated nodes and 800 simulated nodes. The 200 simulated nodes correspond one-to-one with the 200 second network devices, and the 800 simulated nodes correspond one-to-one with the 800 first network devices. Due to limitations in resources and device mirroring, the current network emulation technology supports a maximum network size of 200 network devices. If the current network emulation technology is used to simulate region 1, only 200 of the 1000 network devices can be simulated, leaving the remaining 800 network devices unsimulated. Therefore, it is impossible to obtain simulation results of the protocol behavior corresponding to these 800 network devices. However, in this embodiment, during the construction of the virtual network 70, 200 of the 1000 network devices are designated as second network devices, and the remaining 800 are designated as first network devices. The second method (e.g., emulation) is used to obtain virtual nodes (i.e., simulation nodes) corresponding to the 200 second network devices, and the first method (e.g., simulation) is used to obtain virtual nodes (i.e., simulation nodes) corresponding to the 800 first network devices. This allows each virtual node to simulate the protocol behavior of its corresponding network device. Thus, by combining the first and second methods, simulation of all 1000 network devices can be achieved, and simulation results of the protocol behavior corresponding to these 1000 network devices can be obtained. Therefore, the technical solution provided in this application supports a larger network scale. The network scale supported by the technical solution provided in this application is not limited to 1000 network devices, but can also support larger-scale networks, such as networks with more than 6000 network devices. This application integrates network simulation technology and network emulation technology, thus expanding the supported network scale.
[0152] Please refer to Figure 17 The diagram illustrates a flowchart of a network simulation method provided in an embodiment of this application. Figure 17 As shown, the network simulation method includes steps S701 to S710. For the sake of brevity, in Figure 17The numbers S701 to S710 are not mentioned in the following description.
[0153] like Figure 17 As shown, a user's interaction with the client triggers a login request D for logging into the simulation system. For example, the client displays the simulation system's login interface, where the user triggers login request D. This login interface includes a user account input box, a password input box, and an "OK" button. The user enters their user account in the user account input box and their password in the password input box, then clicks the "OK" button to trigger login request D. Login request D carries the user account and password.
[0154] After receiving login request D, the client interacts with the network simulation device (e.g., a server) to log in to the simulation system. For example, the client sends login request D to the network simulation device, which verifies the login request D (e.g., verifies whether the user account and password carried in login request D match). After successful verification, the device logs into the simulation system and sends a login response to the client indicating successful login. The client confirms successful login based on this login response.
[0155] Subsequently, the user's client triggers a simulation request C for communication network 10, carrying an identifier of communication network 10. After receiving simulation request C, the client sends simulation request C to the network simulation device. Responding to simulation request C, the network simulation device determines communication network 10 based on the identifier carried in simulation request C. The network simulation device identifies at least one first network device and at least one second network device among the multiple network devices (e.g., all network devices) included in communication network 10. The network simulation device retrieves the configuration information of each of the multiple network devices and the device image of each of the at least one second network device from a database. Based on the configuration information of the multiple network devices and the device image of the at least one second network device, the network simulation device constructs a virtual network corresponding to communication network 10. The network simulation device performs protocol behavior simulation on communication network 10 based on the virtual network, obtaining protocol behavior simulation results. The network simulation device sends the protocol behavior simulation results to the client. The client presents the protocol behavior simulation results to the user (e.g., the client displays the protocol behavior simulation results). The implementation process of the network simulation device constructing the virtual network corresponding to the communication network 10 and the implementation process of simulating the protocol behavior of the communication network 10 based on the virtual network can be referred to the previous embodiments, and will not be repeated here.
[0156] The above is a description of the method embodiments of this application. The following describes the apparatus embodiments of this application, which are used to execute the method of this application. For details not disclosed in the apparatus embodiments, please refer to the method embodiments.
[0157] This application provides a network simulation device, which includes at least one functional module, the at least one functional module being used to perform, for example... Figure 6 The method provided in the illustrated embodiment. The at least one functional module can be implemented based on software, hardware, or a combination of both, and the at least one functional module can be arbitrarily combined or divided based on the specific implementation. The network simulation device can be as follows: Figure 1 The network simulation device 20 shown is described above. Furthermore, the network simulation device can be a server or a functional component within a server; alternatively, the functionality of the network simulation device can be distributed across multiple servers (e.g., the network simulation device is deployed in a server cluster).
[0158] As an example, please refer to Figure 18 The diagram illustrates a network simulation device 1800 provided in an embodiment of this application. The network simulation device 1800 includes a construction module 1810 and a simulation module 1820.
[0159] The construction module 1810 is used to construct a virtual network corresponding to the communication network in response to a simulation request for the communication network. The virtual network includes a bridging node, a simulation node corresponding to a first network device in the communication network, a simulated node corresponding to a second network device in the communication network, and a virtual link corresponding to a communication link in the communication network. The simulation node is a virtual node obtained by device modeling based on the configuration information of the first network device. The simulated node is a virtual node generated based on the device image of the second network device. The virtual link is obtained by link modeling based on the configuration information of the network devices at both ends of the communication link. The virtual link includes a simulated link connected to the simulation node and the simulated node. The simulated link includes the bridging node, which is used to realize the docking between the simulation node and the simulated node.
[0160] The simulation module 1820 is used to simulate the protocol behavior of the communication network based on the virtual network, obtain the simulation results, and output them. The implementation of the construction module 1810 can be found in the relevant description in S601 above, and the implementation of the simulation module 1820 can be found in the relevant description in S602 above.
[0161] In an optional embodiment, the bridging node is used to enable the docking between the simulation node and the analog node, including at least one of the following: the bridging node is used to perform format conversion on messages transmitted through the simulation link, wherein the message format matching the simulation node is different from the message format matching the analog node; the bridging node is used to establish a neighbor relationship with the analog node based on the address of the simulation node; the bridging node is used to perform clock simulation based on the address of the simulation node and the messages periodically sent by the analog node.
[0162] In an optional embodiment, the message format matching the simulation node is a first format, and the message format matching the simulation node is a second format. During the process of the simulation module 1820 simulating the protocol behavior of the communication network according to the virtual network, the bridging node is used to: convert the first format message sent by the simulation node through the simulation link into a second format message and send the second format message to the simulation node; and / or convert the second format message sent by the simulation node through the simulation link into a first format message and send the first format message to the simulation node.
[0163] In an optional embodiment, during the process of the simulation module 1820 simulating the protocol behavior of the communication network according to the virtual network, the simulation node is used to generate an information-related table according to the received first format message, and the simulation node is used to generate an information-related table according to the received second format message, wherein the information-related table includes at least one of a routing table, a neighbor table, a label table, an LSDB table, or a tunnel information table.
[0164] In an optional embodiment, the data structure of the message in the first format is a human-readable data structure, and the data structure of the message in the second format is a machine-readable byte stream.
[0165] In an optional embodiment, during the process of the simulation module 1820 simulating the protocol behavior of the communication network according to the virtual network, the bridging node is further configured to: establish a neighbor relationship with the simulated node based on the address of the simulated node according to the message sent by the simulated node for establishing a neighbor relationship between the simulated node and the simulated node.
[0166] In an optional embodiment, during the process of the simulation module 1820 simulating the protocol behavior of the communication network according to the virtual network, the bridging node is further configured to: receive a first message sent by the simulation node for maintaining the neighbor relationship between the simulation node and the simulation node; and send a second message for maintaining the neighbor relationship to the simulation node according to the first message sent by the simulation node, wherein the source address of the second message is the address of the simulation node.
[0167] In an optional embodiment, the simulated node includes a timing unit. During the process of the simulation module 1820 simulating the protocol behavior of the communication network according to the virtual network, the simulated node is used to: periodically send a first message to the simulated node to maintain the neighbor relationship between the simulated node and the simulated node when triggered by the timing unit; the bridging node is used to: send a second message to the simulated node to maintain the neighbor relationship each time it receives the first message sent by the simulated node to maintain the neighbor relationship.
[0168] In optional embodiments, the bridging node is integrated into the simulation node; or, the bridging node is integrated into the simulation node; or, the bridging node is independent of both the simulation node and the simulation node.
[0169] In an optional embodiment, the communication network includes multiple network devices and at least one communication link, and the construction module 1810 is used for:
[0170] In response to the simulation request, a first network device and a second network device are determined from the plurality of network devices;
[0171] Based on the configuration information of the first network device, device modeling is performed to obtain the simulation node corresponding to the first network device;
[0172] Based on the device image of the second network device, generate a simulated node corresponding to the second network device;
[0173] Link modeling is performed based on the configuration information of the two network devices at both ends of the communication link to obtain the virtual link corresponding to the communication link.
[0174] In an optional embodiment, the number of first network devices is at least one, the number of second network devices is at least one, and the construction module 1810 is used to: determine the number of first network devices and the number of second network devices based on the number of the plurality of network devices, the amount of resources available for simulating the communication network, the amount of resources required by a single simulation node, and the amount of resources required by a single simulation node.
[0175] In summary, the technical solution provided in this application integrates network simulation and network emulation technologies to simulate communication networks. Compared to current network simulation technologies, the technical solution provided in this application has lower difficulty in supporting third-party devices, improves the accuracy of simulating heterogeneous networks, and increases the coverage of protocol characteristics. Compared to current network emulation technologies, the technical solution provided in this application has lower resource overhead and is applicable to large-scale communication networks. The technical solution provided in this application leverages the advantages of network simulation and network emulation technologies while addressing their existing problems to a certain extent.
[0176] It should be understood that the network simulation device provided in this application embodiment can also be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The network simulation method provided in the above method embodiment can also be implemented in software. When the network simulation method provided in the above method embodiment is implemented in software, each module in the above network simulation device can also be a software module.
[0177] This application provides a network simulation device, including a memory and a processor. The memory stores computer programs. The processor executes the computer programs stored in the memory to cause the network simulation device to perform actions such as... Figure 6 The method provided in the illustrated embodiment. The network simulation device can be, for example, as shown in the example. Figure 1 The network simulation device 20 shown is described above. Furthermore, the network simulation device can be a server or a functional component within a server; alternatively, the functionality of the network simulation device can be distributed across multiple servers.
[0178] As an example, please refer to Figure 19 This illustration shows a schematic diagram of a network simulation device 1900 provided in an embodiment of this application. For example, the network simulation device 1900 is a server or a functional component deployed within a server. The network simulation device 1900 is used to perform actions such as... Figure 6The method provided in the illustrated embodiment. Figure 19 As shown, the network simulation device 1900 includes a processor 1901 and a memory 1902.
[0179] The processor 1901 and the memory 1902 are connected via bus 1903. Figure 19 The processor 1901 and memory 1902 are described independently. However, the processor 1901 and memory 1902 can also be integrated together, and this embodiment does not limit this.
[0180] The memory 1902 is used to store the computer program that executes the technical solution of this application and is controlled by the processor 1901 to execute it. The computer program stored in the memory 1902 includes, but is not limited to, program code, program instructions, data, etc. The memory 1902 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or it may be a non-volatile random access memory (NVRAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, 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.
[0181] Processor 1901 can be a general-purpose processor or a special-purpose processor. A general-purpose processor is a processor that performs specific steps and / or operations by reading and executing a computer program stored in memory (e.g., memory 1902). The general-purpose processor may use the computer program stored in memory (e.g., memory 1902) in the process of performing the aforementioned steps and / or operations. The computer program is executed, for example, to implement the relevant functions of the aforementioned building module 1810 and analog module 1820. A general-purpose processor is, for example, but not limited to, a central processing unit (CPU). A special-purpose processor is a processor specifically designed to perform specific steps and / or operations. A special-purpose processor is, for example, but not limited to, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. Processor 1901 can implement or execute various logic blocks, modules, and circuits described in conjunction with the disclosure of embodiments of this application. Processor 1901 can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. For example, processor 1901 is used to: in response to a simulation request for a communication network, construct a virtual network corresponding to the communication network, simulate the protocol behavior of the communication network based on the virtual network, obtain the simulation results of the protocol behavior, and output them.
[0182] In an optional embodiment, processor 1901 may be a single-core processor or a multi-core (multi-CPU) processor. A single-core processor may be a single-core CPU. A multi-core processor may be a multi-core CPU. Processor 1901 includes at least one circuit to perform all or part of the steps of the network emulation method provided in the above embodiments.
[0183] In an optional embodiment, the network emulation device 1900 further includes a network interface 1904, which is connected to the processor 1901 and the memory 1902 via a bus 1903. The network interface 1904 enables the network emulation device 1900 to communicate with other devices. The network interface 1904 may include physical interfaces and logical interfaces. The physical interface may be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, a Terabit Ethernet (TbE) interface, a 400GE interface, an Asynchronous Transfer Mode (ATM) interface, etc., used to enable the network emulation device 700 to communicate with other devices. The logical interface may be an internal interface of the network emulation device 1900, used to interconnect devices within the network emulation device 1900. It is readily understood that the network interface 1904 is used for the network emulation device 1900 to communicate with other devices or communication networks. For example, network interface 1904 is used for sending and receiving signals between network emulation device 1900 and other devices or communication networks. Network interface 1904 can also be a device that uses any transceiver (such as optical transmitters, optical receivers, and other optical devices), and the communication network can be Ethernet, optical transport network (OTN), secret private network (SPN), fiber channel, infinite bandwidth, etc.
[0184] In an optional embodiment, the network emulation device 1900 further includes an input / output (I / O) interface 1905. The I / O interface 1905 is connected to the processor 1901 and the memory 1902 via a bus 1903. The processor 1901 can receive input commands or data through the I / O interface 1905. The I / O interface 1905 is used for the network emulation device 1900 to connect input / output devices, such as a keyboard, mouse, and monitor; however, this embodiment does not limit the specific devices used.
[0185] In some possible scenarios, the aforementioned network interface 1904 and I / O interface 1905 are collectively referred to as communication interfaces. Furthermore, the communication interface also includes a transceiver for sending and receiving information, which is not limited in this embodiment.
[0186] Bus 1903 is used to transfer information between processor 1901, memory 1902, network interface 1904, and I / O interface 1905. Bus 1903 can be any type of bus used to implement communication between processor 1901, memory 1902, network interface 1904, and I / O interface 1905. For example, bus 1903 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. Bus 1903 can be divided into address bus, data bus, control bus, etc.
[0187] The aforementioned devices in the network emulation device 1900 can be disposed on separate chips, or at least partially or entirely on the same chip. Whether the devices are disposed independently on different chips or integrated on one or more chips often depends on the needs of the product design. This application does not limit the specific implementation of the aforementioned devices.
[0188] It should be noted that, Figure 19 The network simulation device 1900 shown is merely an example. In the implementation process, the network simulation device 1900 may also include other components, which will not be listed one by one in this article. Figure 19 The network simulation device 1900 shown can simulate a communication network by performing all or part of the steps of the network simulation method provided in the above embodiments.
[0189] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed (e.g., by a network emulation device, server, or server cluster), implements... Figure 6 At least some steps of the method embodiment shown.
[0190] Based on the same inventive concept, embodiments of this application provide a computer program product, which includes a program or code, which, when executed (e.g., by a network emulation device, server, or server cluster), implements the following: Figure 6 At least some steps of the method embodiment shown.
[0191] Based on the same inventive concept, embodiments of this application provide a chip, which includes programmable logic circuitry and / or program instructions, and which, when running, is used to implement, as... Figure 6 At least some steps of the method embodiment shown.
[0192] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially as a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-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, the 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, or a semiconductor medium (e.g., solid-state drive), etc.
[0193] It should be understood that the term "at least one" in this application refers to one or more, and "multiple" refers to two or more. In this application, unless otherwise stated, the symbol " / " generally means "or," for example, A / B can mean A or B. The term "and / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, for clarity, this application uses terms such as "first," "second," and "third" to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," and "third" do not limit the quantity or order of execution.
[0194] The different types of embodiments, such as the method embodiments and device embodiments provided in this application, can be referenced to each other. The order of operations in the method embodiments can be adjusted appropriately, and the operations can be added or removed in response to the situation. Any variations that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application, and therefore will not be described in detail.
[0195] In the corresponding embodiments provided in this application, it should be understood that the disclosed devices, etc., can be implemented through other configurations. 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 coupling or direct coupling or communication connection shown or discussed between devices or modules may be through some interfaces, or indirect coupling or communication connection between devices or modules, which may be electrical or other forms. Modules described as separate components may or may not be physically separate, and components described as modules may or may not be physical modules; they may be located in one place or distributed across multiple network nodes. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0196] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any equivalent modifications or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A network simulation method, characterized in that, The method includes: In response to a simulation request for a communication network, a virtual network corresponding to the communication network is constructed. The virtual network includes a bridging node, a simulation node corresponding to a first network device in the communication network, a simulated node corresponding to a second network device in the communication network, and a virtual link corresponding to a communication link in the communication network. The simulation node is a virtual node obtained by device modeling based on the configuration information of the first network device. The simulated node is a virtual node generated based on the device image of the second network device. The virtual link is obtained by link modeling based on the configuration information of the network devices at both ends of the communication link. The virtual link includes a simulation link connected to the simulation node and the simulated node. The simulation link includes the bridging node, which is used to realize the docking between the simulation node and the simulated node. The communication network is simulated using the virtual network to obtain and output the simulation results.
2. The method according to claim 1, characterized in that, The bridging node is used to connect the simulation node and the simulation node, including at least one of the following: The bridging node is used to convert the format of messages transmitted through the simulated link, wherein the message format matched with the simulation node is different from the message format matched with the simulated node. The bridging node is used to establish a neighbor relationship with the simulated node based on the address of the simulated node; The bridging node is used to perform clock simulation based on the address of the simulation node and the messages periodically sent by the simulation node.
3. The method according to claim 2, characterized in that, The message format matching the simulation node is a first format, and the message format matching the simulated node is a second format. During the process of simulating the protocol behavior of the communication network according to the virtual network, the bridging node is used for: The message in the first format sent by the simulation node through the simulation link is converted into a message in the second format, and then the message in the second format is sent back to the simulation node. And / or, The second-format message sent by the simulated node through the simulation link is converted into a first-format message, and then the first-format message is sent back to the simulated node.
4. The method according to claim 3, characterized in that, During the process of simulating the protocol behavior of the communication network according to the virtual network, the simulation node is used to generate an information-related table according to the received message of the first format, and the simulation node is used to generate an information-related table according to the received message of the second format. The information-related table includes at least one of a routing table, a neighbor table, a label table, a link-state database (LSDB) table, or a tunnel information table.
5. The method according to claim 4, characterized in that, The data structure of the message in the first format is a human-readable data structure, while the data structure of the message in the second format is a machine-readable byte stream.
6. The method according to any one of claims 2 to 5, characterized in that, During the process of simulating the protocol behavior of the communication network according to the virtual network, the bridging node is also used to: establish a neighbor relationship with the simulated node based on the address of the simulated node according to the message sent by the simulated node for establishing a neighbor relationship between the simulated node and the simulated node.
7. The method according to claim 6, characterized in that, During the process of simulating the protocol behavior of the communication network based on the virtual network, the bridging node is also used for: Receive the first message sent by the simulated node for maintaining the neighbor relationship; Based on the first message sent by the simulated node for keeping the neighbor relationship alive, a second message for keeping the neighbor relationship alive is sent to the simulated node, wherein the source address of the second message is the address of the simulated node.
8. The method according to claim 7, characterized in that, The simulated node includes a timing unit, which performs protocol behavior simulation of the communication network based on the virtual network. The simulated node is used to: periodically send the first message for maintaining the neighbor relationship to the simulated node under the trigger of the timing unit; The bridging node is configured to: each time it receives the first message from the simulated node for maintaining the neighbor relationship, send the second message to the simulated node for maintaining the neighbor relationship.
9. The method according to any one of claims 1 to 8, characterized in that, The bridging node is integrated into the simulation node; or, the bridging node is integrated into the simulation node; or, the bridging node is independent of both the simulation node and the simulation node.
10. The method according to any one of claims 1 to 9, characterized in that, The communication network includes multiple network devices and at least one communication link. The step of constructing a virtual network corresponding to the communication network in response to a simulation request for the communication network includes: In response to the simulation request, the first network device and the second network device are determined from the plurality of network devices; Based on the configuration information of the first network device, device modeling is performed to obtain the simulation node corresponding to the first network device; Based on the device image of the second network device, generate a simulated node corresponding to the second network device; Link modeling is performed based on the configuration information of the two network devices at both ends of the communication link to obtain the virtual link corresponding to the communication link.
11. The method according to claim 10, characterized in that, The number of the first network devices is at least one, and the number of the second network devices is at least one. The step of determining the first network device and the second network device among the plurality of network devices includes: The number of the first network devices and the number of the second network devices are determined based on the number of the plurality of network devices, the amount of resources available for simulating the communication network, the amount of resources required for a single simulation node, and the amount of resources required for a single simulation node.
12. A network simulation device, characterized in that, The network simulation device includes: A construction module is used to construct a virtual network corresponding to the communication network in response to a simulation request for the communication network. The virtual network includes a bridging node, a simulation node corresponding to a first network device in the communication network, a simulated node corresponding to a second network device in the communication network, and a virtual link corresponding to a communication link in the communication network. The simulation node is a virtual node obtained by device modeling based on the configuration information of the first network device. The simulated node is a virtual node generated based on the device image of the second network device. The virtual link is obtained by link modeling based on the configuration information of the network devices at both ends of the communication link. The virtual link includes a simulation link connected to the simulation node and the simulated node. The simulation link includes the bridging node, which is used to realize the docking between the simulation node and the simulated node. The simulation module is used to simulate the protocol behavior of the communication network based on the virtual network, obtain the simulation results, and output them.
13. The network simulation device according to claim 12, characterized in that, The bridging node is used to connect the simulation node and the simulation node, including at least one of the following: The bridging node is used to convert the format of messages transmitted through the simulated link, wherein the message format matched with the simulation node is different from the message format matched with the simulated node. The bridging node is used to establish a neighbor relationship with the simulated node based on the address of the simulated node; The bridging node is used to perform clock simulation based on the address of the simulation node and the messages periodically sent by the simulation node.
14. The network simulation device according to claim 13, characterized in that, The message format matching the simulation node is a first format, and the message format matching the simulation node is a second format. During the process of the simulation module simulating the protocol behavior of the communication network according to the virtual network, the bridging node is used for: The message in the first format sent by the simulation node through the simulation link is converted into a message in the second format, and then the message in the second format is sent back to the simulation node. And / or, The second-format message sent by the simulated node through the simulation link is converted into a first-format message, and then the first-format message is sent back to the simulated node.
15. The network simulation device according to claim 14, characterized in that, During the process of the simulation module simulating the protocol behavior of the communication network according to the virtual network, the simulation node is used to generate an information information table according to the received message of the first format, and the simulation node is used to generate an information information table according to the received message of the second format. The information information table includes at least one of the following: routing table, neighbor table, label table, link state database (LSDB) table, or tunnel information table.
16. The network simulation device according to claim 15, characterized in that, The data structure of the message in the first format is a human-readable data structure, while the data structure of the message in the second format is a machine-readable byte stream.
17. The network simulation apparatus according to any one of claims 13 to 16, characterized in that, During the process of the simulation module simulating the protocol behavior of the communication network according to the virtual network, the bridging node is also used to: establish a neighbor relationship with the simulation node based on the address of the simulation node according to the message sent by the simulation node for establishing a neighbor relationship between the simulation node and the simulation node.
18. The network simulation device according to claim 17, characterized in that, During the process of the simulation module simulating the protocol behavior of the communication network based on the virtual network, the bridging node is also used for: Receive the first message sent by the simulated node for maintaining the neighbor relationship; Based on the first message sent by the simulated node for keeping the neighbor relationship alive, a second message for keeping the neighbor relationship alive is sent to the simulated node, wherein the source address of the second message is the address of the simulated node.
19. The network simulation device according to claim 18, characterized in that, The simulated node includes a timing unit, which is used during the simulation module's process of simulating the protocol behavior of the communication network based on the virtual network. The simulated node is used to: periodically send the first message for maintaining the neighbor relationship to the simulated node under the trigger of the timing unit; The bridging node is configured to: each time it receives the first message from the simulated node for maintaining the neighbor relationship, send the second message to the simulated node for maintaining the neighbor relationship.
20. The network simulation apparatus according to any one of claims 12 to 19, characterized in that, The bridging node is integrated into the simulation node; or, the bridging node is integrated into the simulation node; or, the bridging node is independent of both the simulation node and the simulation node.
21. The network simulation apparatus according to any one of claims 12 to 20, characterized in that, The communication network includes multiple network devices and at least one communication link, and the building module is used for: In response to the simulation request, the first network device and the second network device are determined from the plurality of network devices; Based on the configuration information of the first network device, device modeling is performed to obtain the simulation node corresponding to the first network device; Based on the device image of the second network device, generate a simulated node corresponding to the second network device; Link modeling is performed based on the configuration information of the two network devices at both ends of the communication link to obtain the virtual link corresponding to the communication link.
22. The network simulation device according to claim 21, characterized in that, The number of the first network devices is at least one, the number of the second network devices is at least one, and the construction module is configured to: The number of the first network devices and the number of the second network devices are determined based on the number of the plurality of network devices, the amount of resources available for simulating the communication network, the amount of resources required for a single simulation node, and the amount of resources required for a single simulation node.
23. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 11.
24. A computer program product, characterized in that, The computer program product includes a program or code that, when executed, implements the method as described in any one of claims 1 to 11.
