Method and apparatus for generating test data packets based on internet routing configuration

By generating extended traffic forwarding atlases and port reachability tables, the problem of unstable data plane snapshot collection for distributed devices was solved, thereby improving the accuracy and efficiency of network testing.

CN116346647BActive Publication Date: 2026-01-20TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310193696.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2026-01-20
Estimated Expiration
2043-02-23

AI Technical Summary

Technical Problem

Existing technologies cannot effectively collect data plane snapshots with a large number of distributed devices, which leads to reduced stability and consistency in network testing and reduces the accuracy of network testing.

Method used

By generating an extended traffic forwarding atlas, a port reachability table is generated based on network configuration and topology information. Then, a minimum number of test packets are generated based on a greedy algorithm. The network configuration is updated to cover the entire network link, a second port reachability table is generated, and the test packets are updated.

Benefits of technology

It improves the accuracy and stability of network testing, meets user needs, and enhances the efficiency and flexibility of network testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116346647B_ABST
    Figure CN116346647B_ABST
Patent Text Reader

Abstract

This application relates to the field of network testing technology, and in particular to a method and apparatus for generating test data packets based on Internet routing configuration. The method includes: generating an extended traffic forwarding map based on the network configuration and topology information of routers in the network under test; generating a first port reachability table based on the extended traffic forwarding map; generating a minimum number of test data packets to cover the entire network link based on the port reachability table; updating the extended traffic forwarding map based on the updated network configuration, thereby updating the port reachability table to obtain a second port reachability table; and updating the test data packets based on the first and second port reachability tables to cover the entire network link. This solves the technical problems in related technologies where it is impossible to collect data plane snapshots with a large number of distributed devices, and network devices often provide their forwarding information tables at different times, thus reducing the stability and consistency of data plane snapshot collection and decreasing the accuracy of network testing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network testing, and particularly relates to a test data packet generation method and device based on Internet routing configuration. BACKGROUND

[0002] In the related art, test data packets are generated based on data plane snapshots, i.e., forwarding information tables, by ATPG (Automatic test pattern generation) and Pronto, to test each link and interface, which assumes that network administrators can collect network data plane snapshots through SNMP (Simple Network Management Protocol) or a terminal maintained by a device, and the collected data plane snapshots are consistent, so as to verify or test the correctness of the network.

[0003] However, the data plane snapshots of a large number of distributed devices cannot be collected in the related art, and network devices often provide their forwarding information tables at different times, thereby reducing the stability and consistency of collecting data plane snapshots, and reducing the accuracy of testing the network, which needs to be solved urgently. SUMMARY

[0004] The present application is based on the following problems and realizations of the inventors:

[0005] The network control plane manages the running of various routing protocols, such as BGP (Border Gateway Protocol), OSPF (Open Shortest Path First), RIP (Routing Information Protocol), and ISIS (ISIS-Intermediate system to intermediate system), and determines the forwarding path along which a data packet is forwarded from a source address to a destination address, which can be regarded as a program for establishing a data plane forwarding table after comprehensively considering the network topology and routing configuration information.

[0006] Recently, many static or dynamic checking tools are proposed to verify or test the correctness of the network. On the one hand, Batfish and the like verify whether the current configuration meets the user's intention based on the formal model of the Internet routing configuration, which is often used to detect configuration errors in the control plane. On the other hand, HSA and the like verify whether the forwarding information table violates the network reachability property to find logical errors in the forwarding information table. However, these methods cannot detect problems in the actual implementation of the network data plane, such as interface failure, fiber failure, etc. It is very challenging for network administrators to manually confirm that each interface in the data plane is correctly executed. Network administrators often cannot find problems such as line card failure before users complain about network problems. Then, the administrators use original tools such as ping, traceroute, etc. to check the devices in the network according to their professional experience. These tools can only feedback whether and how a single specific data packet reaches its destination each time, which has poor coverage and cannot effectively ensure the correctness of all links and interfaces.

[0007] Some recent work, such as ATPG and Pronto, generates test data packets based on the data plane snapshot, i.e., the forwarding information table, to test each link and interface. However, it has the following two problems. On the one hand, it assumes that the network administrator can collect the network data plane snapshot through SNMP or device maintenance terminal, etc. So far, there is no effective method to collect the data plane snapshot of a large number of distributed devices. On the other hand, it assumes that the collected data plane snapshot is consistent. However, in reality, network devices often provide their forwarding information tables at different times. Therefore, it is very challenging to collect stable and consistent data plane snapshots.

[0008] The application provides a test data packet generation method and device based on Internet routing configuration to solve the technical problem that in the related art, the data plane snapshot of a large number of distributed devices cannot be collected, and network devices often provide their forwarding information tables at different times, thereby reducing the stability and consistency of collecting data plane snapshots and reducing the accuracy of testing the network.

[0009] The first aspect embodiment of the present application provides a test data packet generation method based on Internet routing configuration, comprising the following steps: generating an extended traffic forwarding graph set according to network configuration and topology information of routers in a network under test, and generating a first port reachable table according to the extended traffic forwarding graph set; generating the least test data packet to cover all network links according to the port reachable table, and updating the extended traffic forwarding graph set according to updated network configuration; updating the port reachable table according to the updated extended traffic forwarding graph set to obtain a second port reachable table, and updating the test data packet to cover all network links according to the first port reachable table and the second port reachable table.

[0010] Optionally, in an embodiment of the present application, the generating an extended traffic forwarding graph set according to network configuration and topology information comprises: collecting configuration files on routers in the network under test, loading address prefix information in the configuration files on each router, calculating a set of address prefixes that are disjoint, and calculating all traffic classes in the network according to the set of address prefixes; modeling each traffic class in the all traffic classes according to routing configuration information and protocol RFC (Request For Comments); modeling interaction between processes as an edge in a device, and modeling interaction between the same routing processes in different devices as an edge between devices, so as to obtain the extended traffic forwarding graph based on the direction of traffic forwarding, the weight and label of each edge; removing corresponding edges in the extended traffic forwarding graph according to a routing filtering strategy and ACL (Access Control Lists), and obtaining a final extended traffic forwarding graph.

[0011] Optionally, in an embodiment of the present application, the generating a first port reachable table according to the extended traffic forwarding graph set comprises: calculating a shortest forwarding path from a source node to a destination node in the extended traffic forwarding graph corresponding to each traffic class; mapping the shortest forwarding path in the extended traffic forwarding graph to a forwarding path on an actual network topology graph; adding packet header space information corresponding to each extended traffic forwarding graph, the forwarding path in the actual network topology, packet entry port and packet exit port information as an entry of the port reachable table to the port reachable table, and generating the first port reachable table.

[0012] Optionally, in an embodiment of the present application, the generating the minimum test data packets to cover all network links according to the port reachable table comprises: calculating links that need to be covered according to the topology information, maintaining a covered link set and an uncovered link set; based on a greedy algorithm, selecting each time an entry that can cover the most links in the uncovered link set in the first port reachable table, adding a data packet corresponding to the entry to a test data packet set, adding a link covered by the entry to the covered link set, and updating the uncovered link set; until all links in the network are covered, or each entry in the port reachable table is checked.

[0013] Optionally, in an embodiment of the present application, the updating the extended traffic forwarding graph set according to the updated network configuration comprises: when the updated network configuration involves a basic configuration of a routing protocol, recalculating all extended traffic forwarding graph sets; when the updated network configuration involves a routing filtering policy or a static route, recalculating an extended traffic forwarding graph set corresponding to a traffic class affected by the updated network configuration, and updating edges of each extended traffic forwarding graph; when the updated network configuration involves an access control list, recalculating an extended traffic forwarding graph corresponding to a specific traffic class affected by the updated network configuration, and updating edges of the extended traffic forwarding graph, otherwise, ending the updating.

[0014] The second aspect embodiment of the present application provides a test data packet generation device based on Internet routing configuration, comprising: a first generation module configured to generate an extended traffic forwarding graph set according to network configuration and topology information of routers in a network under test, and generate a first port reachable table according to the extended traffic forwarding graph set; a second generation module configured to generate the minimum test data packets to cover all network links according to the port reachable table, and update the extended traffic forwarding graph set according to an updated network configuration; and an updating module configured to update the port reachable table according to the updated extended traffic forwarding graph set to obtain a second port reachable table, and update the test data packets to cover all network links according to the first port reachable table and the second port reachable table.

[0015] Optionally, in one embodiment of this application, the first generation module includes: a first calculation unit, configured to collect configuration files on routers in the network under test, load address prefix information from the configuration files on each router, calculate a set of address prefixes with disjoint prefix addresses, and calculate all traffic classes in the network based on the address prefix set; a first modeling unit, configured to model each traffic class among all traffic classes based on routing configuration information and protocol RFC specifications; a second modeling unit, configured to model the protocol interactions between processes as edges within a device, and the interactions between the same routing processes in different devices as edges between devices, and obtain the extended traffic forwarding graph based on directed edges obtained from the direction of traffic forwarding, the weights of each edge, and labels; and an acquisition unit, configured to obtain the final extended traffic forwarding graph by removing corresponding edges from the extended traffic forwarding graph based on routing filtering policies and ACLs.

[0016] Optionally, in one embodiment of this application, the first generation module includes: a second calculation unit, configured to calculate the shortest forwarding path from the source node to the destination node in the extended traffic forwarding graph corresponding to each traffic class; a mapping unit, configured to map the shortest forwarding path in the extended traffic forwarding graph to a forwarding path on the actual network topology graph; and a generation unit, configured to add the packet header space information, the forwarding path in the actual network topology, the packet ingress port, and the packet egress port information corresponding to each extended traffic forwarding graph as an entry in the port reachability table, thereby generating the first port reachability table.

[0017] Optionally, in one embodiment of this application, the second generation module includes: a third calculation unit, configured to calculate the links that need to be covered based on the topology information, and maintain a set of covered links and a set of uncovered links; a first update unit, configured to, based on a greedy algorithm, select the entry that can cover the most links in the set of uncovered links in the first port reachability table each time, add the data packet corresponding to the entry to the test data packet set, add the links covered by the entry to the set of covered links, and update the set of uncovered links; and a processing unit, configured to continue until all links in all networks are covered, or all entries in the port reachability table are checked.

[0018] Optionally, in one embodiment of this application, the second generation module includes: a fourth calculation unit, configured to recalculate all extended traffic forwarding graphs when the updated network configuration involves the basic configuration of the routing protocol; a fifth calculation unit, configured to recalculate the extended traffic forwarding graphs corresponding to the traffic classes affected by the updated network configuration when the updated network configuration involves routing filtering policies or static routes, and update the corresponding edges in each extended traffic forwarding graph; and a second update unit, configured to recalculate the extended traffic forwarding graphs corresponding to the specific traffic classes affected by the updated network configuration when the updated network configuration involves access control lists, and update the corresponding edges; otherwise, the update is terminated.

[0019] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the test data packet generation method based on Internet routing configuration as described in the above embodiments.

[0020] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for generating test data packets based on Internet routing configuration.

[0021] This application embodiment can generate an extended traffic forwarding atlas based on the network configuration and topology information of the routers in the network under test, and generate a first port reachability table based on the extended traffic forwarding atlas. It then generates a minimum number of test packets to cover the entire network link based on the port reachability table, and updates the extended traffic forwarding atlas according to the updated network configuration, thereby updating the port reachability table to obtain a second port reachability table. Finally, it updates the test packets based on the first and second port reachability tables to cover the entire network link, thus effectively improving the accuracy of the test network and meeting user needs. This solves the technical problems in related technologies where it is impossible to collect data plane snapshots with a large number of distributed devices, and network devices often provide their forwarding information tables at different times, thereby reducing the stability and consistency of data plane snapshot collection and reducing the accuracy of the test network.

[0022] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0023] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0024] Figure 1This is a flowchart illustrating a test data packet generation method based on Internet routing configuration according to an embodiment of this application;

[0025] Figure 2 This is a schematic diagram of a configured router according to a specific embodiment of this application;

[0026] Figure 3 This is a schematic diagram of extended traffic forwarding according to a specific embodiment of this application;

[0027] Figure 4 This is a schematic diagram of the structure of a test data packet generation device based on Internet routing configuration provided in an embodiment of this application;

[0028] Figure 5 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0029] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0030] The following describes a method and apparatus for generating test data packets based on Internet routing configuration, according to embodiments of this application, with reference to the accompanying drawings. Addressing the issues mentioned in the background section regarding the inability to collect data plane snapshots with a large number of distributed devices, and the fact that network devices often provide their forwarding information tables at different times, thus reducing the stability and consistency of data plane snapshot collection and lowering the accuracy of the test network, this application provides a method for generating test data packets based on Internet routing configuration. In this method, an extended traffic forwarding graph is generated based on the network configuration and topology information of the routers in the network under test. A first port reachability table is generated based on the extended traffic forwarding graph. The minimum number of test data packets is generated based on the port reachability table to cover the entire network link. The extended traffic forwarding graph is updated based on the updated network configuration, thereby updating the port reachability table to obtain a second port reachability table. Test data packets are then updated based on the first and second port reachability tables to cover the entire network link, effectively improving the accuracy of the test network and meeting user needs. This solves the technical problems in the related technologies where it is impossible to collect data plane snapshots with a large number of distributed devices, and network devices often provide their forwarding information tables at different times, thus reducing the stability and consistency of data plane snapshot collection and lowering the accuracy of the test network.

[0031] Specifically, Figure 1This is a flowchart illustrating a test data packet generation method based on Internet routing configuration provided in an embodiment of this application.

[0032] like Figure 1 As shown, the method for generating test packets based on Internet routing configuration includes the following steps:

[0033] In step S101, an extended traffic forwarding map is generated based on the network configuration and topology information of the routers in the network under test, and a first port reachability table is generated based on the extended traffic forwarding map.

[0034] It is understood that the embodiments of this application can generate an extended traffic forwarding map based on the network configuration and topology information of the router in the network under test in the following steps, and generate a first port reachability table based on the extended traffic forwarding map in the following steps, thereby effectively improving the executability of the test packet generation method.

[0035] In one embodiment of this application, generating an extended traffic forwarding graph based on network configuration and topology information includes: collecting configuration files on routers in the network under test, loading address prefix information from the configuration files on each router, calculating a set of address prefixes with disjoint prefixes, and calculating all traffic classes in the network based on the address prefix set; modeling each traffic class in all traffic classes according to routing configuration information and protocol RFC specifications; modeling protocol interactions between processes as edges within devices, and modeling interactions between the same routing processes in different devices as edges between devices, obtaining an extended traffic forwarding graph based on directed edges obtained from the direction of traffic forwarding, weights of each edge, and labels; and obtaining the final extended traffic forwarding graph by removing corresponding edges from the extended traffic forwarding graph according to routing filtering policies and ACLs.

[0036] In actual implementation, the embodiments of this application can collect configuration files on routers in the network under test, load address prefix information from the configuration files on each router, such as the prefixes in the interface addresses, access control lists, and routing filtering policies, and calculate the set of address prefixes that do not overlap. Each address prefix in the set corresponds to a subnet, and all traffic classes in the network, i.e. traffic from one subnet to another, can be calculated based on the prefix set.

[0037] Next, in this embodiment of the application, each traffic class can be modeled according to the routing configuration information and the protocol RFC specification. First, the processes on each router, such as BGP processes, are modeled as nodes in the extended traffic forwarding graph. Specifically, each process is modeled as a corresponding ingress node (IN) and egress node (OUT). The endpoint groups where the source address and destination address of the traffic class are located are modeled as source nodes (SRC) and destination nodes (DST), respectively.

[0038] Secondly, in this embodiment, the protocol interactions between processes can be modeled as edges within a device, and the interactions between the same routing processes in different devices can be modeled as edges between devices. Each edge in the extended traffic forwarding graph is a directed edge, and the direction of the edge is the direction of traffic forwarding. Each edge has a weight and a label. The metric value of each routing protocol is normalized and calculated, and the calculated value is the weight of the corresponding edge. The community label information carried by the BGP protocol is modeled as the label of the edge in the extended traffic forwarding graph.

[0039] Finally, the embodiments of this application can obtain the final extended traffic forwarding graph by removing the corresponding edges in the extended traffic forwarding graph according to the routing filtering policy and ACL, thereby effectively improving the feasibility of the test packet generation method.

[0040] In one embodiment of this application, generating a first port reachability table based on an extended traffic forwarding graph includes: calculating the shortest forwarding path from the source node to the destination node in the extended traffic forwarding graph corresponding to each traffic class; mapping the shortest forwarding path in the extended traffic forwarding graph to a forwarding path on the actual network topology graph; and adding the packet header space information, the forwarding path in the actual network topology, the packet ingress port, and the packet egress port information corresponding to each extended traffic forwarding graph as an entry in the port reachability table to generate the first port reachability table.

[0041] As one possible implementation, embodiments of this application can calculate the shortest forwarding path from the source node to the destination node in the extended traffic forwarding graph corresponding to each traffic class, and map the shortest forwarding path in the extended traffic forwarding graph to the forwarding path on the actual network topology graph. The packet header space information corresponding to each extended traffic forwarding graph, such as the source address and destination address, the forwarding path in the actual network topology, the packet ingress port, and the packet egress port information, is added as an entry to the port reachability table, and a first port reachability table is generated, thereby effectively improving the efficiency of the test network.

[0042] In step S102, a minimum number of test packets are generated based on the port reachability table to cover the entire network link, and the extended traffic forwarding atlas is updated based on the updated network configuration.

[0043] It is understood that the embodiments of this application can generate the minimum number of test packets to cover the entire network link according to the port reachability table in the following steps, and update the extended traffic forwarding atlas according to the updated network configuration in the following steps, thereby effectively improving the applicability and accuracy of the test network.

[0044] In one embodiment of this application, generating the minimum number of test packets to cover all network links based on the port reachability table includes: calculating the links that need to be covered based on topology information, maintaining a set of covered links and a set of uncovered links; based on a greedy algorithm, selecting the entry in the first port reachability table that can cover the most links in the uncovered link set each time, adding the data packet corresponding to the entry to the test data packet set, adding the links covered by the entry to the set of covered links, and updating the set of uncovered links; until all links in all networks are covered, or all entries in the port reachability table are checked.

[0045] In some embodiments, this application can calculate the links that need to be covered based on the network topology, maintain a set of covered links and a set of uncovered links, and based on a greedy algorithm, select the entry that can cover the most links in the uncovered link set in the first port reachability table each time, add the data packet corresponding to the entry to the test data packet set, and add the links covered by the entry to the covered link set, thereby updating the uncovered link set, until all links in all networks are covered, or all entries in the port reachability table are checked, thereby effectively improving the efficiency of verifying or testing the network.

[0046] In one embodiment of this application, updating the extended traffic forwarding graph based on the updated network configuration includes: when the updated network configuration involves the basic configuration of a routing protocol, recalculating all extended traffic forwarding graphs; when the updated network configuration involves routing filtering policies or static routes, recalculating the extended traffic forwarding graphs corresponding to the traffic classes affected by the updated network configuration, and updating the corresponding edges in each extended traffic forwarding graph; when the updated network configuration involves access control lists, recalculating the extended traffic forwarding graphs corresponding to the specific traffic classes affected by the updated network configuration, and updating the corresponding edges; otherwise, ending the update.

[0047] In actual implementation, firstly, when the updated network configuration involves the basic configuration of the routing protocol, all extended traffic forwarding maps are recalculated; otherwise, the following steps are performed to determine the situation.

[0048] Next, in this embodiment of the application, if the updated network configuration involves routing filtering policies or static routes, the extended traffic forwarding graph corresponding to the traffic class affected by the configuration is recalculated, and the corresponding edges are updated in each extended traffic forwarding graph. Otherwise, the following steps are performed to determine the situation.

[0049] Finally, in this embodiment of the application, when the updated network configuration involves access control lists, the extended traffic forwarding graph corresponding to a specific traffic class affected by the configuration is recalculated, and the corresponding edges in the extended traffic forwarding graph are updated; otherwise, the update of the extended traffic forwarding graph is terminated.

[0050] In summary, the embodiments of this application can effectively improve the applicability of verification or testing networks and increase the flexibility of testing.

[0051] In step S103, the port reachability table is updated according to the updated extended traffic forwarding map to obtain the second port reachability table, and the test data packets are updated according to the first port reachability table and the second port reachability table to cover the entire network link.

[0052] It is understood that, in the embodiments of this application, the port reachability table can be updated according to the updated extended traffic forwarding atlas in the following steps to obtain the second port reachability table, and the test data packets can be updated according to the first port reachability table and the second port reachability table in the following steps to cover the entire network link, thereby effectively improving test efficiency, saving manpower and material costs, and enhancing the robustness of the verification or test network.

[0053] As one possible implementation, embodiments of this application can compare the extended traffic forwarding graphs before and after the update to determine the updated traffic class and its corresponding extended traffic forwarding graph. The shortest forwarding path from the source node to the destination node in the affected extended traffic forwarding graph is calculated, and the shortest forwarding path in the extended traffic forwarding graph is mapped to the forwarding path on the actual network topology. Furthermore, the packet header space information corresponding to each extended traffic forwarding graph, such as source and destination addresses, forwarding paths in the actual network topology, packet ingress ports, and packet egress ports, is added as an entry to the updated port reachability table to obtain a second port reachability table.

[0054] In some embodiments, this application can compare the port reachability tables before and after the update, i.e., compare the first port reachability table and the second port reachability table. The entries can be divided into three categories, such as added entries, removed entries, and modified entries. One of the modified entries is converted into an added entry and a removed entry. Based on the removed entries, invalid test cases of the test data packets are removed, and a new set of links to be covered is generated. In the updated port reachability table, i.e., the second port reachability table, a set of entries that were not used for generating test data packets is selected. Based on this set, the minimum number of test data packets are generated to test the set of links to be covered, and the generated test data packets are added to the original test data packets to obtain the final test data packets. This can effectively improve testing efficiency, save manpower and material costs, and effectively improve the accuracy of the test network, meeting the user's needs.

[0055] For example, such as Figure 2 As shown, there are 4 routers in the network. Routers R1 to R4 run the OSPF protocol. Except for the weight (10) between R1 and R4, all costs are assigned a weight of 1. The routers are connected to five subnets, A to E. An ACL is configured on router R2 to block traffic from B to E.

[0056] Furthermore, such as Figure 3 The diagram shown is an extended traffic forwarding diagram corresponding to traffic classes A through E and B through E. Figure 3 R1 in the left figure I and R1 O This refers to the OSPF process on router R1, and R2. I R2 O R3 O R4 O Similarly, R1 I To R1 O Intra-device communication on edge-modeling router R1, R1 I To R2 O Model the routing adjacency between a pair of routing processes on R1 and R2. Edges within devices are assigned a weight of 0, while the weights of edges between devices are matched to the OSPF link costs. The label vectors for each edge are set to empty because there are no label-related configurations on these routers. Figure 3 In the diagram on the right, since the ACL on R2 filters the traffic from B to E, the corresponding edge, R1... I To R2 O The edge was removed.

[0057] Furthermore, in this embodiment of the application, the shortest path can be determined for each extended traffic forwarding graph, resulting in the port reachability table in Table 1, as detailed in Table 1 below:

[0058] Table 1

[0059]

[0060] Then, select the minimum number of test packets that can cover all links, namely the packets corresponding to Entry 1, Entry 2, Entry 3 and Entry 4.

[0061] In summary, the embodiments of this application can generate an extended traffic forwarding graph based on network configuration, topology, and routing announcement information. Based on the extended traffic forwarding graph, packet path information can be inferred, thereby forming a forwarding table. Based on the forwarding table, reachable packets between any two points in the network can be calculated, thereby generating the minimum number of test packets covering all links in the network. This effectively improves testing efficiency, saves manpower and material costs, and enhances the robustness of the verification or testing network.

[0062] The test data packet generation method based on Internet routing configuration proposed in this application can generate an extended traffic forwarding graph based on the network configuration and topology information of the routers in the network under test, generate a first port reachability table based on the extended traffic forwarding graph, generate a minimum number of test data packets to cover the entire network link based on the port reachability table, update the extended traffic forwarding graph based on the updated network configuration, thereby updating the port reachability table to obtain a second port reachability table, and update the test data packets based on the first and second port reachability tables to cover the entire network link. This effectively improves the accuracy of the test network and meets user needs. Therefore, it solves the technical problems in related technologies where it is impossible to collect data plane snapshots with a large number of distributed devices, and network devices often provide their forwarding information tables at different times, thus reducing the stability and consistency of data plane snapshot collection and reducing the accuracy of the test network.

[0063] Next, referring to the accompanying drawings, a test data packet generation apparatus based on Internet routing configuration is described according to an embodiment of this application.

[0064] Figure 4 This is a block diagram of a test data packet generation device based on Internet routing configuration according to an embodiment of this application.

[0065] like Figure 4 As shown, the test data packet generation device 10 based on Internet routing configuration includes: a first generation module 100, a second generation module 200, and an update module 300.

[0066] Specifically, the first generation module 100 is used to generate an extended traffic forwarding map based on the network configuration and topology information of the routers in the network under test, and to generate a first port reachability table based on the extended traffic forwarding map.

[0067] The second generation module 200 is used to generate the minimum number of test packets to cover the entire network link based on the port reachability table, and to update the extended traffic forwarding atlas based on the updated network configuration.

[0068] The update module 300 is used to update the port reachability table according to the updated extended traffic forwarding graph to obtain the second port reachability table, and update the test data packets according to the first port reachability table and the second port reachability table to cover the entire network link.

[0069] Optionally, in one embodiment of this application, the first generation module 100 includes: a first calculation unit, a first modeling unit, a second modeling unit, and an acquisition unit.

[0070] The first calculation unit is used to collect configuration files on routers in the network under test, load address prefix information from the configuration files on each router, calculate the set of address prefixes that do not overlap, and calculate all traffic classes in the network based on the address prefix set.

[0071] The first modeling unit is used to model each traffic class in all traffic classes based on routing configuration information and protocol RFC specifications.

[0072] The second modeling unit is used to model the protocol interaction between each process as edges within the device, and the interaction between the same routing process between different devices as edges between devices. An extended traffic forwarding graph is obtained by using directed edges obtained based on the direction of traffic forwarding, weights of each edge, and labels.

[0073] The acquisition unit is used to obtain the final extended traffic forwarding graph based on the routing filtering policy and the corresponding edges in the ACL removed from the extended traffic forwarding graph.

[0074] Optionally, in one embodiment of this application, the first generation module 100 includes: a second calculation unit, a mapping unit, and a generation unit.

[0075] The second calculation unit is used to calculate the shortest forwarding path from the source node to the destination node in the extended traffic forwarding graph corresponding to each traffic class.

[0076] The mapping unit is used to map the shortest forwarding path in the extended traffic forwarding graph to the forwarding path on the actual network topology graph.

[0077] The generation unit is used to add the packet header space information, the forwarding path in the actual network topology, the packet ingress port, and the packet egress port information corresponding to each extended traffic forwarding graph as an entry in the port reachability table, thereby generating the first port reachability table.

[0078] Optionally, in one embodiment of this application, the second generation module 200 includes: a third calculation unit, a first update unit, and a processing unit.

[0079] The third calculation unit is used to calculate the links that need to be covered based on the topology information, and to maintain the set of covered links and the set of uncovered links.

[0080] The first update unit is used to select, based on a greedy algorithm, the entry that can cover the most links in the uncovered link set in the first port reachability table each time, add the data packet corresponding to the entry to the test data packet set, add the links covered by the entry to the covered link set, and update the uncovered link set.

[0081] The processing unit is used until all links in all networks are covered, or all entries in the port reachability table are checked.

[0082] Optionally, in one embodiment of this application, the second generation module 200 includes: a fourth calculation unit, a fifth calculation unit, and a second update unit.

[0083] The fourth calculation unit is used to recalculate all extended traffic forwarding atlases when the updated network configuration involves the basic configuration of the routing protocol.

[0084] The fifth calculation unit is used to recalculate the extended traffic forwarding graph corresponding to the traffic class affected by the updated network configuration when the updated network configuration involves routing filtering policies or static routes, and update the corresponding edges in each extended traffic forwarding graph.

[0085] The second update unit is used to recalculate the extended traffic forwarding graph corresponding to the specific traffic class affected by the updated network configuration when the updated network configuration involves access control lists, so as to update the corresponding edges; otherwise, the update ends.

[0086] It should be noted that the foregoing explanation of the test data packet generation method embodiment based on Internet routing configuration also applies to the test data packet generation device based on Internet routing configuration in this embodiment, and will not be repeated here.

[0087] The test data packet generation device based on Internet routing configuration proposed in this application can generate an extended traffic forwarding map based on the network configuration and topology information of the routers in the network under test, generate a first port reachability table based on the extended traffic forwarding map, generate a minimum number of test data packets to cover the entire network link based on the port reachability table, update the extended traffic forwarding map based on the updated network configuration, thereby updating the port reachability table to obtain a second port reachability table, and update the test data packets based on the first and second port reachability tables to cover the entire network link. This effectively improves the accuracy of the test network and meets user needs. Therefore, it solves the technical problems in related technologies where it is impossible to collect data plane snapshots with a large number of distributed devices, and network devices often provide their forwarding information tables at different times, thus reducing the stability and consistency of data plane snapshot collection and reducing the accuracy of the test network.

[0088] Figure 5A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:

[0089] The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.

[0090] When processor 502 executes the program, it implements the test data packet generation method based on Internet routing configuration provided in the above embodiments.

[0091] Furthermore, electronic devices also include:

[0092] Communication interface 503 is used for communication between memory 501 and processor 502.

[0093] The memory 501 is used to store computer programs that can run on the processor 502.

[0094] The memory 501 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0095] If the memory 501, processor 502, and communication interface 503 are implemented independently, then the communication interface 503, memory 501, and processor 502 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0096] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.

[0097] Processor 502 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0098] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for generating test data packets based on Internet routing configuration.

[0099] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0100] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0101] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0102] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0103] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0104] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.

[0105] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0106] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for generating test data packets based on Internet routing configuration, characterized in that, Includes the following steps: An extended traffic forwarding map is generated based on the network configuration and topology information of the routers in the network under test, and a first port reachability table is generated based on the extended traffic forwarding map. Generate the minimum number of test packets based on the port reachability table to cover the entire network link, and update the extended traffic forwarding atlas based on the updated network configuration; as well as The port reachability table is updated according to the updated extended traffic forwarding atlas to obtain the second port reachability table, and the test data packet is updated according to the first port reachability table and the second port reachability table to cover the entire network link; The process of generating an extended traffic forwarding atlas based on network configuration and topology information includes: The configuration files on the routers in the network under test are collected, the address prefix information in the configuration files on each router is loaded, and the set of address prefixes with non-overlapping prefix addresses is calculated, so as to calculate all traffic classes in the network based on the set of address prefixes. Model each traffic class in all the traffic classes based on routing configuration information and a series of numbered RFC specifications of the protocol; The protocol interaction between each process is modeled as an edge within the device, and the interaction between the same routing process in different devices is modeled as an edge between devices. The extended traffic forwarding graph is obtained by using directed edges obtained based on the direction of traffic forwarding, weights of each edge, and labels. Based on the routing filtering policy and the Access Control List (ACL), the corresponding edges in the extended traffic forwarding graph are removed to obtain the final extended traffic forwarding graph; The step of updating the extended traffic forwarding atlas according to the updated network configuration includes: When updating network configurations involves the underlying configuration of routing protocols, recalculate all extended traffic forwarding atlases. When the updated network configuration involves routing filtering policies or static routes, the extended traffic forwarding graph corresponding to the traffic class affected by the updated network configuration is recalculated, and the corresponding edges are updated in each extended traffic forwarding graph. When the updated network configuration involves access control lists, the extended traffic forwarding graph corresponding to the specific traffic class affected by the updated network configuration is recalculated to update the corresponding edges; otherwise, the update is terminated.

2. The method according to claim 1, characterized in that, The step of generating the first port reachability table based on the extended traffic forwarding atlas includes: Calculate the shortest forwarding path from the source node to the destination node in the extended traffic forwarding graph corresponding to each traffic class; Map the shortest forwarding path in the extended traffic forwarding graph to the forwarding path on the actual network topology graph; The packet header space information, forwarding path in the actual network topology, packet ingress port, and packet egress port information corresponding to each extended traffic forwarding graph are added as an entry to the port reachability table to generate the first port reachability table.

3. The method according to claim 1, characterized in that, The step of generating the minimum number of test packets to cover the entire network link based on the port reachability table includes: Calculate the links that need to be covered based on the topology information, and maintain the set of covered links and the set of uncovered links; Based on the greedy algorithm, each time the entry that can cover the most links in the uncovered link set is selected in the first port reachability table, the data packet corresponding to the entry is added to the test data packet set, the link covered by the entry is added to the covered link set, and the uncovered link set is updated. This continues until all links in all networks are covered, or all entries in the port reachability table are checked.

4. A test data packet generation device based on Internet routing configuration, characterized in that, include: The first generation module is used to generate an extended traffic forwarding map based on the network configuration and topology information of the routers in the network under test, and to generate a first port reachability table based on the extended traffic forwarding map. The second generation module is used to generate the minimum number of test packets to cover the entire network link based on the port reachability table, and to update the extended traffic forwarding atlas based on the updated network configuration; as well as The update module is used to update the port reachability table according to the updated extended traffic forwarding map to obtain a second port reachability table, and update the test data packet according to the first port reachability table and the second port reachability table to cover the entire network link; The first generation module includes: The first calculation unit is used to collect the configuration files on the routers in the network under test, load the address prefix information in the configuration files on each router, calculate the set of address prefixes with non-overlapping prefix addresses, and calculate all traffic classes in the network based on the set of address prefixes. The first modeling unit is used to model each of the traffic classes based on routing configuration information and a series of numbered RFC specifications for the protocol. The second modeling unit is used to model the protocol interaction between each process as edges within the device, and to model the interaction between the same routing process between different devices as edges between devices. The extended traffic forwarding graph is obtained by using directed edges obtained based on the direction of traffic forwarding, weights of each edge, and labels. The acquisition unit is used to remove the corresponding edges in the extended traffic forwarding graph according to the routing filtering policy and the access control list (ACL) to obtain the final extended traffic forwarding graph. The second generation module includes: The fourth calculation unit is used to recalculate all extended traffic forwarding atlases when the updated network configuration involves the basic configuration of routing protocols; The fifth calculation unit is used to recalculate the extended traffic forwarding graph corresponding to the traffic class affected by the updated network configuration when the updated network configuration involves routing filtering policies or static routes, and update the corresponding edges in each extended traffic forwarding graph. The second update unit is used to recalculate the extended traffic forwarding graph corresponding to the specific traffic class affected by the updated network configuration when the updated network configuration involves access control lists, so as to update the corresponding edges; otherwise, the update is terminated.

5. The apparatus according to claim 4, characterized in that, The first generation module includes: The second calculation unit is used to calculate the shortest forwarding path from the source node to the destination node in the extended traffic forwarding graph corresponding to each traffic class; A mapping unit is used to map the shortest forwarding path in the extended traffic forwarding graph to a forwarding path on the actual network topology graph. The generation unit is used to add the packet header space information, the forwarding path in the actual network topology, the packet ingress port, and the packet egress port information corresponding to each extended traffic forwarding graph as an entry in the port reachability table, thereby generating the first port reachability table.

6. The apparatus according to claim 4, characterized in that, The second generation module includes: The third calculation unit is used to calculate the links that need to be covered based on the topology information, and to maintain the set of covered links and the set of uncovered links; The first update unit is used to select, based on a greedy algorithm, the entry that can cover the most links in the uncovered link set in the first port reachability table each time, add the data packet corresponding to the entry to the test data packet set, add the link covered by the entry to the covered link set, and update the uncovered link set. The processing unit is used until all links in all networks are covered, or all entries in the port reachability table are checked.

7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the test packet generation method based on Internet routing configuration as described in any one of claims 1-3.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the test packet generation method based on Internet routing configuration as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Method for detecting data plane link performance abnormity

    CN108494630A

  • Verification method and device for network configuration

    CN113872784A