Network simulation method, apparatus, computer device, and computer program product
By combining analog simulation and numerical simulation with a two-layer simulation architecture, the limitations of scale and efficiency in traditional network simulation are solved, and high-precision large-scale network simulation is achieved, which is suitable for low-performance devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PURPLE MOUNTAIN LAB
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-23
Smart Images

Figure CN122268771A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network simulation technology, and in particular to a network simulation method, apparatus, computer equipment, and computer program product. Background Technology
[0002] Traditional network simulation technology mainly includes two technical routes: numerical simulation and analog simulation. Numerical simulation simulates network behavior by constructing mathematical models and algorithms, and its core lies in using abstract models to simulate network communication protocols; analog simulation, on the other hand, replicates the operating logic of real networks on physical devices using virtualization and other technologies, and can more realistically reflect the behavioral characteristics of actual networks.
[0003] However, the above technologies all have shortcomings in practical applications. Numerical simulation often makes simplified assumptions about protocols in its models and algorithms, which can easily lead to the loss of protocol details and make it difficult to simulate dynamic changes in the network. Simulation is limited by the performance bottleneck of physical devices, and traffic simulation is prone to distortion under high load scenarios, making it difficult to reproduce the randomness and burstiness of real traffic. Moreover, when facing large-scale network simulation, the exponential growth of service routing calculations makes it susceptible to the bottleneck of computing resources, resulting in low simulation efficiency.
[0004] Therefore, how to overcome the limitations of traditional network simulation technology in terms of simulation scale and computational efficiency has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0005] This application provides a network simulation method, apparatus, computer equipment, and computer program product, which realizes a network simulation method that takes into account the limitations of simulation scale and computational efficiency.
[0006] To achieve the above objectives, the main technical solutions adopted in this application include: In a first aspect, embodiments of this application provide a network simulation method, the method comprising: Obtain network topology and service information of the network to be simulated; Based on the network topology information, a simulated network matching the network to be simulated is constructed in a preset simulation environment, and route convergence is triggered based on a preset internal gateway protocol, so that the simulated network reaches a stable state. After the simulated network reaches a stable state, the network state information of the simulated network is obtained, and based on the network state information and the service information, service path calculation and statistics are performed in a preset numerical simulation model to generate the simulation results of the network to be simulated.
[0007] The network simulation method proposed in this application introduces a numerical simulation model to handle service path calculation and statistics, overcoming the performance bottlenecks of traditional simulation in terms of traffic simulation distortion and large-scale routing calculation. Simultaneously, it utilizes a simulated network to implement network protocols and perform routing-related steps, compensating for the accuracy loss caused by the simplification of models and algorithms in numerical simulation. This method constructs a two-layer simulation architecture of "simulated network + numerical calculation model," breaking through the functional limitations of a single simulation mode and improving the scale and operational efficiency of network simulation while ensuring high simulation accuracy.
[0008] Secondly, embodiments of this application provide a network simulation device, the device comprising: The data acquisition unit is used to acquire network topology information and service information of the network to be simulated. The topology construction unit is used to construct a simulated network that matches the network to be simulated in a preset simulation environment based on the network topology information, and to trigger route convergence based on a preset internal gateway protocol so that the simulated network reaches a stable state. The result statistics unit is used to obtain the network state information of the simulated network after the simulated network reaches a stable state, and to perform business path calculation and statistics in a preset numerical simulation model based on the network state information and the business information, so as to generate the simulation results of the network to be simulated.
[0009] Thirdly, embodiments of this application provide a computer device, including: The system includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the network simulation method described in the first aspect.
[0010] Fourthly, embodiments of this application provide a computer program product, including computer instructions, which are used to cause a computer to execute the network simulation method described in the first aspect. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0012] Figure 1 A structural example diagram of an IP bearer network provided in an embodiment of this application; Figure 2A flowchart illustrating the steps of a network simulation method provided in this application embodiment; Figure 3 A schematic diagram illustrating the logical division and mapping relationship between numerical simulation and analog simulation during the implementation of the network simulation method provided in this application embodiment; Figure 4 A structural diagram of the network simulation device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of a computer device example provided in an embodiment of this application. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0014] In modern network architecture, the IP bearer network is a network built on IP technology to carry various services. It can be specifically divided into the access layer, aggregation layer, and core layer. The access layer directly faces various service terminals and user equipment, responsible for introducing service traffic into the network and providing interface access and basic forwarding capabilities. The aggregation layer, located between the access layer and the core layer, is used to converge and integrate access traffic from multiple regions and implement QoS, security, route aggregation, and other policy controls to reduce the pressure on the core layer. The core layer, as the network backbone, focuses on high-speed, high-capacity, long-distance data forwarding, achieving efficient and reliable backbone traffic scheduling and cross-domain interconnection through label switching technology.
[0015] The core layer features high-speed transmission and label switching. Label switching is a general term for a class of technologies. Its core lies in the fact that during the forwarding of IP service packets, intermediate network nodes no longer rely on the service IP prefix inside the packet for routing table lookups and path selection. Instead, they use the label encapsulated in the outer layer of the packet as the sole basis for routing. The service IP prefix only serves as the service information carried within the packet. The entire forwarding path of the packet from the ingress to the egress is completely determined by the outer label, thereby achieving fast and deterministic forwarding.
[0016] like Figure 1The diagram illustrates an example of an IP bearer network structure. It shows six network nodes, specifically four service edge routers (PEs) and two backbone routers (Ps). These six nodes form an Autonomous System (AS), which communicates and distributes information based on the pre-defined Interior Gateway Protocol (IGP) and Label Switching (LSP), forming FIB forwarding tables and label forwarding tables. The four PEs are also configured as BGP peers (communication interfaces for communicating with other ASs based on the Exterior Gateway Protocol (BGP)) and carriers of actual services. For example, a PE with the address 1.1.1.1, named VPNA, carries two actual services, distinguished by service prefix-1 and service prefix-2.
[0017] To better simulate the aforementioned network structure, two technical approaches are proposed: numerical simulation and analog simulation. For numerical simulation, the simplified model may lead to the loss of protocol details and inaccurate interactions. The failure to consider parameter estimation biases and dynamic changes can affect the accuracy of simulation results. Differences between different implementation versions and vulnerabilities or features in protocol implementations may also be overlooked, resulting in insufficient simulation accuracy and inaccurate network simulation results, affecting subsequent network optimization. For analog simulation, firstly, the simulation of network traffic is distorted. Resource limitations in virtualized environments can lead to inaccurate or even infeasible traffic simulations under high load scenarios, and it is difficult to fully simulate the randomness, burstiness, and diversity of traffic in real networks. Secondly, the scale of service routing is limited. Analog simulation requires handling a large number of routing calculations and packet forwarding tasks. As the network scale increases, the size of the routing table and the complexity of routing calculations grow exponentially, leading to bottlenecks in computing resources (such as CPU and memory), making the simulation process slow or even impossible to complete.
[0018] The first embodiment of this application provides a network simulation method to solve the above-mentioned problems. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in a different order than that shown here. Figure 2 As shown, the method flow specifically includes the following steps: Step 110: Obtain the network topology information and service information of the network to be simulated.
[0019] The network to be simulated can be an existing physical network or a planned network architecture. This embodiment proposes that, before simulation, it is necessary to collect the basic input data corresponding to the network to be simulated, which is required to build the simulation environment.
[0020] Network topology information mainly describes the physical connection relationships and basic configurations of network nodes, and may include, but is not limited to: a list of devices in the network (such as routers, switches, etc.), link connections between devices, device parameters (such as device model, version, interface bandwidth, latency characteristics), and basic configuration information of the underlying network.
[0021] Business information mainly describes the logical application data running on the topology, and may include, but is not limited to: the source and destination addresses / prefixes of the business, the size of the business traffic, the required rate of the business, and the logical affiliation of the business, such as VPN instances.
[0022] This information can be obtained in the following ways: by importing information files in a preset data format, such as XML, JSON, or Excel; by receiving information through a preset data interface; or by collecting information from the live network in real time through a network management interface.
[0023] Step 120: Based on the network topology information, construct a simulated network that matches the network to be simulated in the preset simulation environment, and trigger route convergence based on the preset internal gateway protocol so that the simulated network reaches a stable state.
[0024] This embodiment proposes to construct a simulated network that matches the network to be simulated based on simulation. Here, "matching" can mean that the simulated network and the network to be simulated have the same topology, or it can mean that the simulated network and the network to be simulated have the same core functions in their topologies.
[0025] The pre-defined simulation environment runs a pre-defined Interior Gateway Protocol (IGP), which can recreate the physical behavior of the network using real network protocol interactions. Therefore, after the simulated network is built, network nodes in the simulated network will trigger route convergence based on the IGP. The specific implementation method for triggering route convergence is determined by the IGP. For example, for protocols with a heartbeat mechanism, the construction of a new simulated network can be triggered when new network topology information is detected based on the heartbeat mechanism; alternatively, a message can be actively sent each time new network topology information is obtained to trigger topology reconstruction. Similarly, the handshake method, communication message format, and route flooding mechanism between network nodes can also be specifically defined based on the adopted IGP protocol.
[0026] A simulated network reaches a stable state when, through the exchange of protocol messages, the routing tables of each network node are continuously updated until the routing information within the entire AS reaches a consensus and no longer changes. At this point, each network node in the simulated network generates a local FIB (Forwarding Information Base) table and a Label FIB (LFIB), signifying that the network has entered a stable state.
[0027] The above process replicates the startup and convergence process of a real physical network, ensuring that the simulation environment has the same underlying capabilities as the real network.
[0028] Step 130: After the simulated network reaches a stable state, obtain the network state information of the simulated network, and perform business path calculation and statistics in the preset numerical simulation model based on the network state information and business information to generate the simulation results of the network to be simulated.
[0029] This embodiment proposes to process services based on numerical simulation, on the basis of the aforementioned simulation, that is, to perform service path calculation and statistics in a preset numerical simulation model.
[0030] Specifically, the simulation generates a stable simulated network. Once the simulated network stabilizes, the current network state information is obtained, such as the forwarding table entries, next-hop information, and label allocation of each network node. Then, this network state information, along with the business information obtained in the preceding steps, is input into the numerical simulation model.
[0031] The numerical simulation model operates similarly to a numerical simulation, but it does not involve actual low-level network protocol interactions. Instead, it directly calculates the forwarding path of data packets for each service within the business data based on existing network state information. It then performs statistical analysis on all service paths, including but not limited to the load on each link, service latency calculated using algorithms, and congestion or interruption levels. Finally, the statistically obtained data is compiled into simulation results, which visually demonstrate the network's operational status under specific topologies and service loads, thereby supporting subsequent network planning, troubleshooting, and policy verification decisions.
[0032] Unlike traditional numerical simulation methods, the numerical simulation model in this embodiment pre-generates a realistic network topology and reaches a stable state. Therefore, it eliminates the need for designing additional routing protocol algorithms to mimic the dynamic convergence process of the network, and also eliminates the need to independently maintain the network topology of the network to be simulated within the model. The numerical simulation model can directly use network state information obtained from the simulation environment as static constraints or known input parameters. Based on this, the numerical simulation model only needs to focus on the logical computation at the business layer, directly performing business path mapping and data statistics based on the network view under stable conditions. This significantly improves the computational efficiency of large-scale business simulations while ensuring simulation accuracy.
[0033] by Figure 1 Taking the IP bearer network shown as an example, traditional IP bearer networks can be logically divided into Underlay networks and Overlay networks. An Underlay network is a physical network composed of numerous interconnected devices, including switches and routers. These devices ensure smooth connectivity between IP addresses through network layer routing protocols and data link layer transport protocols in the OSI seven-layer model. An Overlay network is a logical network built on top of the Underlay network. It abstracts and integrates physical network resources through Virtual Private Network (VPN) technology, providing flexible and diverse services for upper-layer applications. In this embodiment, to better adapt to the simulation of the IP bearer network, the data types of network topology information and service information, as well as the architecture of the simulated network and numerical simulation model, were specifically designed.
[0034] In this embodiment, the simulated network can be considered to approximately correspond to the Underlay network, and its network topology and network state information also fall within the scope of the Underlay network. For example... Figure 1 As shown, the network topology information specifically includes: the AS addresses of each network node (PE and P) (e.g., "1.1.1.1", "2.2.2.2", etc.), and the configuration parameters of the four PE nodes as BGP peers. After creating all network nodes based on the above topology information, route convergence is triggered based on real network protocols, ultimately generating network state information such as routing tables and forwarding tables for each node. It can be considered that the network state information and the network topology together constitute a complete simulated network.
[0035] In this embodiment, the simulated network can be considered to correspond approximately to the Overlay network, and the business information involved also falls within the scope of the Overlay network. For example... Figure 1 As shown, the service information includes the name or code of each network node (e.g., "VPNA", "VPNB", etc.) and the service prefix of each network node (e.g., "service prefix-1", "service prefix-3", etc.).
[0036] The method described in this embodiment employs numerical simulation to process upper-layer services and utilizes network state information generated by the simulation as a bridge connecting the simulation network and the numerical computation model. Using this network state information as the basis and constraint of the numerical simulation model can alleviate the accuracy issues caused by protocol simplification in pure numerical simulation, while also reducing the performance pressure of pure simulation in large-scale service scenarios. This method is particularly suitable for running large-scale simulation tasks in low-performance simulation environments. For example, the simulation equipment provided by existing vendors has limited performance; the bandwidth limit between many existing simulation network nodes is only 1G, making it difficult to support large-scale simulation needs solely through simulation. The "simulation network + numerical computation model" two-layer architecture proposed in this embodiment can overcome the functional limitations of a single simulation mode and can be applied to these devices, further improving the scale and operational efficiency of network simulation while ensuring simulation accuracy.
[0037] The second embodiment of this application further specifies the network simulation method in the first embodiment in a more detailed and specific way. Some or all of the technical features in the second embodiment can be combined with or replaced by the first embodiment, either individually or in combination, to obtain more feasible network simulation methods.
[0038] The network simulation method in the second embodiment of this application is described in detail below: Optionally, based on the network status information and service information of the simulated network, service path calculation and statistics are performed in a preset numerical simulation model, including: determining the routing and forwarding paths of each service in the service information based on the network status information; determining the service set carried by each physical communication link in the network topology of the simulated network based on the routing and forwarding paths and service information, wherein a physical communication link is a communication link between any two directly connected network nodes in the network topology; and for each physical communication link, statistically analyzing the link communication information of the physical communication link based on the service set and service information.
[0039] This embodiment further defines the method by which the numerical simulation model performs business path calculations and statistics.
[0040] Specifically, the routing and forwarding path for each specific service in the service information is determined based on the network status information obtained from the simulated network. The core of this step lies in mapping the logical service flow to the node connection relationship of the physical network topology, that is, clarifying which network element nodes each service data traverses from its origin to its destination node.
[0041] After determining the routing and forwarding paths, the physical communication links in the network topology are analyzed. Here, a physical communication link refers to the connection path between any two directly connected network nodes in the network topology. By comparing the forwarding paths of all services, the specific services currently carried by each physical communication link are determined, thus constructing the service set for each physical communication link. This step establishes the association between physical link resources and service logic, realizing the connection between the upper-layer numerical simulation model and the lower-layer simulated network.
[0042] Finally, for each physical communication link in the network topology, based on the service set corresponding to the link and the various service parameters (such as bandwidth, priority, etc.) contained in the service information, the communication status of the link is statistically analyzed to generate link communication information that reflects the actual operation of the network, such as link load rate, packet loss rate prediction, or latency distribution.
[0043] Through the above process, the method of this embodiment does not require actual data packet forwarding in the lower-layer simulation network. It can quickly and accurately restore the distribution of large-scale business traffic in the network using numerical calculations, thereby effectively alleviating the technical bottleneck of traditional simulation being unable to handle the simulation of massive business traffic.
[0044] Optionally, based on network status information, the routing and forwarding paths for each service in the service information are determined, including: obtaining the source address and destination address of each service in the service information; for each service, querying the routing and forwarding table in the network status information hop by hop to determine the sequence of network nodes traversed from the source address to the destination address; for each service, extracting all physical communication links formed by two directly connected network nodes in the network node sequence corresponding to the service, and generating the routing and forwarding path of the service.
[0045] This embodiment provides a specific implementation method for path restoration based on a routing forwarding table.
[0046] Specifically, after the numerical simulation model obtains the network state information after the simulated network has stabilized, for each service in the service information, the source address and destination address configured for that service are first extracted as the starting point and end point of the path lookup.
[0047] To achieve the above mapping, the service information must contain service IP communication pairs, or be able to deduce service IP communication pairs from it, for example, through deduction from service prefixes. Service IP communication pairs may specifically include, but are not limited to: source network node, source VPN, source service prefix, destination network node, destination VPN, destination service prefix, and other data. Figure 1 Taking the IP bearer network shown as an example, the data format of an IP communication pair can be found in Table 1: Table 1 Examples of IP Communication Content The significance of service IP communication pairs lies in establishing the relationship between upper-layer and lower-layer networks in a multi-layer network architecture. This is especially important when there is no explicit correspondence between the upper-layer logical network and the lower-layer physical network protocols. For example, in... Figure 1 In this context, the upper-layer service prefix -1 can be configured as 11.1.1.0 / 24, and the service prefix -3 can be configured as 12.1.1.0 / 24. Obviously, due to the different network protocols of the upper and lower layers, the addresses of the lower layers 1.1.1.1 and 2.2.2.2 cannot form a clear correspondence at this time, and the correspondence needs to be established by relying on the service IP communication pair.
[0048] It should be understood that even if the business information does not explicitly contain the business IP communication pair, it should be able to be deduced from the existing information, which means that the business IP communication pair is implicitly present in the business information.
[0049] In one embodiment, the communication pairs are unidirectional. If a service is bidirectional, it needs to be represented by two communication pairs. All communication pairs constitute the service communication relationship of the entire network to be simulated.
[0050] Subsequently, a hop-by-hop lookup operation is performed based on the routing table. It should be noted that the routing table can be a routing table (RIB) and / or a forwarding table (FIB). The routing table is typically stored at the device's control plane, such as the CPU, and contains complete routing information learned by network nodes through routing protocols; while the forwarding table is generally generated based on the routing table and stored at the hardware level, such as the device's ASIC chip, to guide the rapid forwarding of data packets at the hardware level.
[0051] The specific implementation details of the query may vary depending on the type of table entry being queried, but the core logic remains consistent. Specifically, starting from the network node containing the source address of the service, the routing table of that node is searched, and the corresponding next-hop network node is matched based on the destination address. Then, this next-hop network node is used as the current node, and its routing table is searched again to determine the next-next-hop network node. This process is repeated until the queried next-hop network node is the network node containing the destination address or the egress node. By simulating the logic of real data packet forwarding, all traversed network nodes are recorded sequentially, forming a complete network node sequence.
[0052] Finally, based on the generated network node sequence, all adjacent pairs of network nodes in the sequence are extracted, and their connections are identified as physical communication links. For example, if the node sequence is A→B→C, then physical communication links AB and BC are extracted. Combining these physical communication links in sequence generates the actual routing and forwarding path of the service in the simulated network.
[0053] By using this hop-by-hop query and path construction method, this embodiment can accurately reconstruct the actual transmission trajectory of the service in the network topology of the network to be simulated, providing a reliable data foundation for subsequent statistics on the communication status of each link.
[0054] Optionally, for each physical communication link, based on the service set and service information, the link communication information of the physical communication link is statistically analyzed, including: according to the service set corresponding to each physical communication link, the load of each service in the service set is accumulated to the physical communication link to obtain the total link load of each physical communication link; and the simulation results of the network to be simulated are generated, including: based on the service information, the total link load of all physical communication links and the routing and forwarding path, structured data is generated as the simulation results of the network to be simulated according to the preset data structure.
[0055] This embodiment limits the statistical method for link communication information and the content of the simulation results.
[0056] Specifically, for each physical communication link, a load accumulation operation is performed based on its corresponding service set: traverse each service contained in the service set, extract the load parameters of each service (such as bandwidth requirements, traffic volume, etc.), and accumulate these load parameters to the physical communication link.
[0057] By performing the above cumulative calculations, the total link load of each physical communication link in the current simulation scenario can be obtained. This process simulates the link communication state when multiple service traffic flows converge to the same physical link.
[0058] After completing the load statistics of all physical communication links in the entire network, the simulation results of the network to be simulated are generated. Specifically, based on the preset data structure (such as database tables, JSON objects, or specific report formats), the acquired service information, the total load of each physical communication link, and the routing and forwarding paths of each service are integrated and organized into structured data, which serves as the final simulation result of the network to be simulated.
[0059] Through the above load accumulation and structured generation steps, the generated simulation results can intuitively present the load distribution, bottleneck location, and service flow of each link in the network, thereby providing data support and decision-making basis for network optimization.
[0060] Please refer to Figure 3 Based on the description of the foregoing embodiments, the embodiments of this application implement network simulation based on a combination of numerical simulation (Overlay) and analog simulation (Underlay). Figure 3 It visually demonstrates the relationship between the two and the flow of data.
[0061] like Figure 3 As shown, the network simulation architecture in this embodiment mainly includes two layers: the upper numerical simulation model / Overlay layer and the lower simulation network / Underlay.
[0062] exist Figure 3 In the numerical simulation layer (Overlay), corresponding to the definition of business information in the aforementioned embodiments, parameters such as "business VPN", "communication pair" and "business traffic" are listed.
[0063] Figure 3 In the simulation layer (Underlay), the physical network topology is realistically simulated, including specific network nodes (such as routers, switches, etc.) and the physical communication links between nodes. This layer reflects the actual state of the network, is implemented based on the Interior Gateway Protocol (IGP) and label forwarding, and stores a routing table (LFIB / FIB) to guide packet forwarding based on route convergence.
[0064] Based on the "service IP communication pair" involved in the foregoing embodiments. Figure 3 The dashed arrows in the diagram specifically illustrate the mapping process from business logic to physical links: Service node mapping: This corresponds to mapping the source / destination addresses in the service information to specific network nodes in the simulated network, which is the basis for path calculation.
[0065] Service path mapping: This corresponds to the "hop-by-hop lookup" process in the aforementioned embodiments. That is, using the routing table of the Underlay layer, the packet forwarding logic is simulated to calculate the "label-switched path" that the service traverses in the physical topology, thereby determining the specific routing and forwarding path.
[0066] Traffic-load mapping: This corresponds to the "link communication information statistics" process in the aforementioned embodiments. That is, based on the determined path, the "service traffic" of the Overlay layer is accumulated onto the specific physical communication links of the Underlay layer, and finally the "link load" of each link is calculated.
[0067] In summary, Figure 3 This clearly demonstrates how the method of this application utilizes the network state (such as routing tables and topology) of the Underlay layer to transform the service requirements of the Overlay layer into specific loads on physical links, thereby achieving accurate simulation of the network state.
[0068] Optionally, the network topology information includes complete network topology information or network topology change information of the network to be simulated; based on the network topology information, a simulated network matching the network to be simulated is constructed in a preset simulation environment, including: if complete network topology information is obtained, creating a complete simulated network matching the network to be simulated in a preset simulation environment; if network topology change information is obtained, updating the topology of an existing simulated network in a preset simulation environment based on the network topology change information.
[0069] In this embodiment, the network topology information may specifically include the complete network topology information of the network to be simulated, or it may include network topology change information. Based on different types of topology information, the numerical simulation model employs different construction or update strategies.
[0070] Specifically, in one embodiment, when the complete network topology information of the network to be simulated is obtained, a complete simulated network matching the network to be simulated is created from scratch in a preset simulation environment. This process is similar to building a completely new network on a network simulation platform, ensuring the consistency between the simulation environment and the network to be simulated in their initial state.
[0071] In another embodiment, when network topology change information (such as incremental information like added nodes, link interruptions, or interface parameter adjustments) is obtained, the entire network topology is not reconstructed. Instead, the existing simulation network is updated based on the network topology change information. For example, if the change information shows that a link between two nodes is broken, the link connection is directly deleted from the current simulation network; if the change information shows that a new network node has been added, the model adds the node at the corresponding location and establishes a connection.
[0072] By supporting both full-scale construction and incremental updates, this embodiment can not only quickly build the initial simulation environment but also efficiently respond to dynamic changes in the existing network topology. This allows the method to adapt to various simulation needs, such as new network planning or existing network modification analysis, avoiding the high cost of rebuilding the entire network due to minor changes and reducing the maintenance cost and computational resource consumption of the simulation environment.
[0073] Optionally, upon obtaining network topology change information, service path calculation and statistics are performed in a preset numerical simulation model based on network status information and service information. This includes: updating the topology of the existing simulated network after obtaining network topology change information, and obtaining the network status information of the simulated network as second network status information after the simulated network reaches a stable state; determining the routing and forwarding paths of each service in the service information after the topology change of the simulated network based on the second network status information; comparing the routing and forwarding paths of each service in the service information before and after the topology change of the simulated network to determine the target service set affected by the network topology change, wherein the target service set includes services interrupted due to the network topology change, services reconnected due to the network topology change, and services whose routing and forwarding paths have changed due to the network topology change; updating the service set carried by each physical communication link in the network topology of the simulated network based on the service information and the routing and forwarding paths of each service in the target service set; and statistically analyzing the link communication information of the updated physical communication links in the service set based on the service set and service information.
[0074] This embodiment proposes that, in order to save computing resources, when network topology change information is obtained, only the services that have changed can be calculated and statistically analyzed.
[0075] Specifically, upon receiving information related to network topology changes (e.g., link interruption, node addition, or configuration modification), the simulated network triggers reconvergence of the internal gateway protocol. After convergence is complete and the entire simulated network reaches a stable state again, the network state information of the simulated network after the network topology change is obtained and recorded as the second network state information.
[0076] After obtaining the second network state information, instead of recalculating all services across the network indiscriminately, an efficient incremental analysis process is initiated. In this process, the routing paths for each service are first redefined based on the second network state information. Then, the routing paths for each service before and after the topology change are compared to identify the set of target services affected by the topology change.
[0077] The target business set specifically includes the following three categories of affected businesses: Interrupted services: refers to services that had a valid path in the simulation network before the topology change, but cannot find a reachable path from the source address to the destination address in the simulation network after the topology change.
[0078] Reconnected services: refers to services that were interrupted for some reason in the simulated network before the topology change, but have been determined to have a reachable path in the simulated network after the topology change.
[0079] Path-change services refer to services in which valid reachable paths exist in both the simulated network before and after the topology change, but the physical communication link sequences traversed by the two reachable paths are not exactly the same.
[0080] This embodiment uses a comparative routing forwarding path method to determine the target service, rather than relying on direct comparison of network state information or network topology change information. The reason for this is that when the network topology changes, not only are services directly affected by the changed physical communication links impacted, but other services that initially appeared unaffected may also be affected. For example, when a new physical communication link is established or a link is restored, the routing convergence algorithm may calculate a shorter transmission path, causing services that previously used other paths to switch their traffic to the new path. Therefore, identifying changes and determining the target service by comparing routing forwarding paths is a superior way to ensure the accuracy of the identification results.
[0081] After determining the target service set, the service set carried on the relevant physical communication links in the simulated network is updated only for each service in the set and its latest routing and forwarding path, and the link communication information is re-counted only for the physical communication links where these service sets have been updated.
[0082] This embodiment avoids large-scale, repetitive calculations caused by local network changes by using an incremental change-based calculation mechanism. It can further improve the response speed and computational efficiency of the simulation system in dynamic scenarios while ensuring the accuracy and timeliness of the simulation results.
[0083] Optionally, a simulated network matching the network to be simulated is constructed in a preset simulation environment, including: constructing a virtualized environment as a simulation environment based on virtualization technology, mapping network nodes in the network topology information to virtualized simulated network elements, establishing communication links between simulated network elements, and constructing a simulated network matching the network to be simulated.
[0084] This embodiment proposes that virtualization technology can be used to construct the underlying simulation environment.
[0085] Specifically, a lightweight virtualization environment is built based on virtualization technologies, such as containerization technology Docker and virtual machine technology KVM, to serve as a simulation environment. Within this environment, each physical network node (such as a router, switch, or firewall) in the network topology information is mapped to a simulated network element in the virtualization environment. These simulated network elements possess the same or similar operating system kernel or network protocol stack as the physical nodes, enabling them to run real routing protocols and forwarding logic. Furthermore, virtual communication links (such as virtual Ethernet pairs or virtual lines) are established between these simulated network elements based on the connection relationships in the network topology information.
[0086] In this way, the topology and node behavior of the network to be simulated are reconstructed in a virtualized environment, and a simulated network that highly matches the network to be simulated is constructed.
[0087] By introducing virtualization technology, this embodiment can achieve high-fidelity network simulation with lower resource overhead. Compared with simulation based on pure mathematical models, simulation based on virtualized network elements can more realistically reflect the protocol interaction, forwarding latency, and resource consumption of devices in actual operation, thereby significantly improving the accuracy and reliability of simulation results. At the same time, the isolation and flexibility of virtualization technology can support rapid deployment and parallel testing of large-scale network scenarios.
[0088] The third embodiment of this application also proposes a network simulation device, such as... Figure 4 As shown, the device includes: The data acquisition unit 410 is used to acquire network topology information and service information of the network to be simulated. The topology building unit 420 is used to build a simulated network that matches the network to be simulated in a preset simulation environment based on network topology information, and to trigger route convergence based on a preset internal gateway protocol so that the simulated network reaches a stable state. The result statistics unit 430 is used to obtain the network state information of the simulated network after the simulated network reaches a stable state, and to perform business path calculation and statistics in the preset numerical simulation model based on the network state information and business information, so as to generate the simulation results of the network to be simulated.
[0089] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0090] In this embodiment, the network simulation device is presented in the form of functional units. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0091] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application, such as... Figure 5 As shown, the computer device includes one or more processors 510, memory 520, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take the 510 processor as an example.
[0092] Processor 510 may be a central processing unit, a network processor, or a combination thereof. Processor 510 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0093] The memory 520 stores instructions executable by at least one processor 510 to cause the at least one processor 510 to perform the method shown in the above embodiments.
[0094] The memory 520 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 520 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 520 may optionally include memory remotely located relative to the processor 510, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0095] The memory 520 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 520 may also include a combination of the above types of memory.
[0096] The computer device also includes a communication interface 530 for communicating with other devices or communication networks.
[0097] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.
[0098] This application provides a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method of any embodiment of this application.
[0099] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.
[0100] The methods, apparatus, computer devices, computer-readable storage media, or computer program products described in the above embodiments can be implemented by a computer chip or entity, or by a product having a certain function. A typical implementing device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0101] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0102] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, computer devices, computer-readable storage media, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-readable program code.
[0103] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, computer devices, computer-readable storage media, or computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0104] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0106] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0107] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, computer equipment, computer-readable storage media, or computer program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0108] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
[0109] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A network simulation method, characterized in that, The method includes: Obtain network topology and service information of the network to be simulated; Based on the network topology information, a simulated network matching the network to be simulated is constructed in a preset simulation environment, and route convergence is triggered based on a preset internal gateway protocol, so that the simulated network reaches a stable state. After the simulated network reaches a stable state, the network state information of the simulated network is obtained, and based on the network state information and the service information, service path calculation and statistics are performed in a preset numerical simulation model to generate the simulation results of the network to be simulated.
2. The method according to claim 1, characterized in that, The step of performing service path calculation and statistics in a preset numerical simulation model based on the network state information of the simulated network and the service information includes: Based on the network status information, determine the routing and forwarding paths for each service in the service information; Based on the routing and forwarding path and the service information, determine the set of services carried by each physical communication link in the network topology of the simulated network, wherein the physical communication link is the communication link between any two directly connected network nodes in the network topology; For each physical communication link, based on the service set and the service information, the link communication information of the physical communication link is statistically analyzed.
3. The method according to claim 2, characterized in that, The step of determining the routing and forwarding paths for each service in the service information based on the network status information includes: Obtain the source address and destination address of each service item in the service information; For each service, the routing table in the network status information is queried hop by hop to determine the sequence of network nodes traversed from the source address to the destination address; For each service, extract all physical communication links consisting of two directly connected network nodes in the network node sequence corresponding to the service, and generate the routing and forwarding path for the service.
4. The method according to claim 2, characterized in that, For each physical communication link, based on the service set and the service information, the link communication information of the physical communication link is statistically analyzed, including: Based on the service set corresponding to each physical communication link, the load of each service in the service set is accumulated to the physical communication link to obtain the total link load of each physical communication link; The generation of simulation results for the network to be simulated includes: Based on the preset data structure, structured data is generated using the service information, the total load of all physical communication links, and the routing and forwarding paths, and serves as the simulation result of the network to be simulated.
5. The method according to claim 1, characterized in that, The network topology information includes complete network topology information or network topology change information of the network to be simulated; The step of constructing a simulated network matching the network to be simulated in a preset simulation environment based on the network topology information includes: Having obtained the complete network topology information, a complete simulation network matching the network to be simulated is created in a preset simulation environment; Upon obtaining the network topology change information, the existing simulated network topology is updated in a preset simulation environment based on the network topology change information.
6. The method according to claim 5, characterized in that, Upon obtaining the network topology change information, the step of performing service path calculation and statistics in a preset numerical simulation model based on the network status information and the service information includes: Upon obtaining the network topology change information, the existing simulated network undergoes topology updates, and after the simulated network reaches a stable state, the network state information of the simulated network is obtained as the second network state information. Based on the second network status information, determine the routing and forwarding paths of each service in the service information after the topology of the simulated network changes; By comparing the routing and forwarding paths of each service in the service information before and after the network topology change in the simulated network, the target service set affected by the network topology change is determined. The target service set includes services interrupted due to the network topology change, services reconnected due to the network topology change, and services whose routing and forwarding paths have changed due to the network topology change. Based on the service information and the routing and forwarding paths of each service in the target service set, update the service set carried by each physical communication link in the network topology of the simulated network; For a service set with updated physical communication links, based on the service set and the service information, the link communication information of the updated physical communication links in the service set is statistically analyzed.
7. The method according to claim 1, characterized in that, The step of constructing a simulation network matching the network to be simulated in a preset simulation environment includes: A virtualized environment is constructed based on virtualization technology as the simulation environment. The network nodes in the network topology information are mapped as virtualized simulation network elements, and communication links are established between the simulation network elements to construct a simulation network that matches the network to be simulated.
8. A network simulation device, characterized in that, The device includes: The data acquisition unit is used to acquire network topology information and service information of the network to be simulated. The topology construction unit is used to construct a simulated network that matches the network to be simulated in a preset simulation environment based on the network topology information, and to trigger route convergence based on a preset internal gateway protocol so that the simulated network reaches a stable state. The result statistics unit is used to obtain the network state information of the simulated network after the simulated network reaches a stable state, and to perform business path calculation and statistics in a preset numerical simulation model based on the network state information and the business information, so as to generate the simulation results of the network to be simulated.
9. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the network simulation method of any one of claims 1 to 7 by executing the computer instructions.
10. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the network simulation method according to any one of claims 1 to 7.