Switch test method, device and system

By capturing and sending packets between the switch and the test machine, combined with the switch's clock synchronization function, and utilizing a multi-level packet capture process, the problem of accurate testing of the switch's Qbv gating scheduling function under the lack of professional testing instruments was solved, achieving high-precision and low-cost testing results.

CN119030899APending Publication Date: 2024-11-26深圳市三旺通信股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411065878.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Existing technologies make it difficult to accurately test the Qbv gating and scheduling function of switches in the absence of professional testing equipment, especially in TSN networks, to ensure that specified traffic is transmitted accurately within a set time.

Method used

By establishing packet capture and transmission ports between the switch and the test machine, a multi-level packet capture process is performed using a regular test machine. Combined with the switch's clock synchronization function, the accuracy of the switch's gating and scheduling is verified. This includes configuring gating list entries and using packet capture tools to perform multi-level packet capture analysis.

Benefits of technology

It enables accurate testing of the Qbv function of switches under normal testing conditions, improves testing accuracy and reliability, reduces testing costs and difficulty, and ensures the correct transmission of data packets under gating scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030899A_ABST
    Figure CN119030899A_ABST
Patent Text Reader

Abstract

The invention relates to the field of switches, and discloses a switch testing method, device and system, and the method is applied to a testing machine, and comprises the steps: carrying out the one-time package capturing of all data package flows forwarded by a to-be-tested switch, and taking all captured data package flows as subsequent package taking objects; after a packet taking condition is set, starting a first-level packet taking process to obtain a data packet flow of a target queue scheduled and forwarded by a switch based on a preset gating list entry; obtaining a first-level detection result according to the first-level packet taking result; after cancelling the setting of the packet taking condition, starting a second-level packet taking process to obtain all data packet flows forwarded by the switch; obtaining a second-level detection result according to the second-level packet taking result; and determining the accuracy of the gating scheduling of the switch according to the first-stage detection result and the second-stage detection result. According to the invention, the accuracy of the switch gating scheduling is determined through the two-stage packet taking process, and the precision and reliability of the gating scheduling test are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of switches, and in particular to a switch testing method, device and system. Background Art

[0002] TSN (Time Sensitive Network) is a new generation of network standards based on Ethernet, which mainly includes clock synchronization, flow control, reliability and other parts. It aims to ensure low-latency, high-reliability deterministic transmission of key data in Ethernet. IEEE 802.1Qbv Time Awareness Shaper (TAS, hereinafter referred to as Qbv) belongs to the flow control part of the TSN protocol cluster. Its function is to divide different channels for different flows at the switching node port according to the user's business plan. In a specific time slice, only one or several specified channels are opened to allow the time-sensitive flow of the channel to be transmitted, thereby isolating the interference of other types of flow on the time-sensitive flow in the time dimension, ensuring the transmission timeliness of the time-sensitive flow, that is, realizing gated scheduling.

[0003] Based on the role of Qbv, the key to the test is to verify that only the specified traffic is transmitted in the specified channel, and to ensure that the specified traffic is transmitted at the set time to achieve timeliness. Based on this, in order to ensure the accuracy of the Qbv gating scheduling function of the switch in actual scenarios, it is extremely important to provide an accurate switch Qbv gating scheduling function test solution. Summary of the invention

[0004] In a first aspect, the present application provides a switch testing method, which is applied to a testing machine, and the method includes:

[0005] Capturing all data packet flows forwarded by the switch to be tested, wherein all captured data packet flows are used as subsequent packet capture objects;

[0006] After setting the packet fetching condition, starting the first level packet fetching process to obtain the data packet flow of the target queue that the switch schedules to forward based on the preset gating list entry;

[0007] According to the first-level package taking result, the first-level detection result is obtained;

[0008] After canceling the setting of the packet acquisition condition, starting the second level packet acquisition process to obtain all the data packet flows forwarded by the switch;

[0009] According to the second-level package taking result, the second-level detection result is obtained;

[0010] The accuracy of the gating scheduling of the switch is determined according to the first-level detection result and the second-level detection result.

[0011] In an optional implementation manner, the first-level detection process includes:

[0012] Record the number of times a packet is fetched; wherein each time a packet is fetched, a corresponding data packet stream is obtained, and a data packet stream includes multiple data packets;

[0013] Determine whether each data packet in the obtained data packet stream satisfies all of the following preset conditions each time a packet is retrieved:

[0014] Condition 1: the number of packet fetches is equal to the number of data packet flows scheduled by the switch within the corresponding gate opening time based on the preset gate list entry;

[0015] Condition 2: Each time a packet is retrieved, the maximum number of packets in the acquired packet flow is equal to the maximum number of packets allowed to be forwarded within the gate opening time of the target gating list entry;

[0016] Condition three: the time interval between two consecutive packet fetches is equal to the gate closing time of the target gate list entry;

[0017] Condition 4: The time interval between two adjacent data packets in the same data packet flow is equal to the time required to send a data packet within the gate opening time of the target gating list entry.

[0018] In an optional implementation manner, the second level detection process includes:

[0019] Calculate the first sending time of the last data packet in the data packet flow of the target queue obtained by first packet fetching, and respectively calculate the second sending time of the first data packet in each of the data packet flows obtained by second to last packet fetching;

[0020] If the first sending time is within a first preset time range, and starting from the second packet fetching, each of the second sending times is within a second preset time range, it is determined that the second level detection has passed;

[0021] If the first sending time is not within the first preset time range, and / or the second sending time is not within the second preset time range, it is determined that the second level detection fails.

[0022] In an optional implementation manner, the calculation process of the first sending time or the second sending time includes:

[0023] Calculate the difference between the capture time of the target data packet in the target data packet flow and the capture time of the corresponding follow-up message; wherein the follow-up message is the most adjacent follow-up message before the target data packet in the target data packet flow is captured;

[0024] The sum of the actual sending time contained in the follow-up message and the difference value is used as the sending time of the target data packet in the target data packet flow.

[0025] In an optional implementation manner, determining the accuracy of the gating scheduling of the switch according to the first-level detection result and the second-level detection result includes:

[0026] If any one of the first-level detection result and the second-level detection result is a failure, it is determined that the gating scheduling test of the switch is inaccurate.

[0027] In a second aspect, the present application provides a switch testing method, which is applied to a switch to be tested, and the method includes:

[0028] configuring at least one gating list entry for scheduling a packet flow of a target queue;

[0029] The received data packet flow is scheduled and forwarded through the gating list entries, so that the test machine captures the data packet flow scheduled to be forwarded once, and then starts the corresponding packet capture process to determine the accuracy of the gating scheduling of the switch.

[0030] In an optional implementation, if the number of target queues for which gating scheduling is required to be tested is 1, configuring at least one gating list entry for scheduling a data packet flow of the target queue includes:

[0031] Configure a first gating list entry, and set the gating parameters of the first gating list entry accordingly, and set the first gating list entry to allow the data packet flow of the target queue to pass through, and not allow the data packet flow of the non-target queue to pass through;

[0032] A second gating list entry is configured, and gating parameters of the second gating list entry are set accordingly, and the second gating list entry is set to allow the data packet flow of the non-target queue to pass through, and not allow the data packet flow of the target queue to pass through.

[0033] In an optional implementation, if the number of target queues for which gating scheduling is required to be tested is greater than 1 and equal to a preset maximum number of configurable entries, configuring at least one gating list entry for scheduling a data packet flow of the target queue includes:

[0034] Configure multiple third gating list entries, and set gating parameters of each third gating list entry accordingly, and set each third gating list entry to allow a data packet flow of a target queue to pass through;

[0035] If the number of target queues for testing gating scheduling is greater than 1 and less than the preset maximum number of configurable entries, configuring at least one gating list entry for scheduling the data packet flow of the target queue includes:

[0036] Configure multiple third gating list entries and at least one fourth gating list entry, and set the gating parameters of each of the third gating list entries and the fourth gating list entries accordingly; set each of the third gating list entries to allow a packet flow of the target queue to pass through, and not allow packet flows of non-target queues to pass through; and set the fourth gating list entry to allow a packet flow of at least one non-target queue to pass through, and not allow packet flows of all target queues to pass through; wherein the total number of the third gating list entries and the fourth gating list entries is not greater than the preset maximum number of configurable entries.

[0037] In a third aspect, the present application provides a switch testing device, including:

[0038] A packet capture module, used for capturing all data packet flows forwarded by the switch to be tested, wherein all captured data packet flows are used as subsequent packet capture objects;

[0039] A first-level packet fetching module, used to start a first-level packet fetching process after setting the packet fetching conditions, so as to obtain a data packet flow of a target queue that is forwarded by the switch based on a preset gating list scheduling;

[0040] The first-level detection module is used to obtain the first-level detection result according to the first-level packet fetching result;

[0041] A second-level packet acquisition module, used to start a second-level packet acquisition process after canceling the setting of the packet acquisition condition, so as to obtain all the data packet flows forwarded by the switch;

[0042] The second-level detection module is used to obtain the second-level detection result according to the second-level packet fetching result;

[0043] A determination module is used to determine the accuracy of the gating scheduling of the switch according to the first-level detection result and the second-level detection result.

[0044] In a fourth aspect, the present application provides a switch testing system, comprising a switch to be tested and a testing machine; wherein the testing machine comprises a packet sending end and a packet capturing end; the packet sending end is connected to a receiving port of the switch, and the packet capturing end is connected to a sending port of the switch;

[0045] The packet sending end is used to send multiple data packet flows to the switch;

[0046] The switch is used to execute the switch testing method as described above to schedule and forward each of the data packet flows;

[0047] The packet capture end is used to execute the switch testing method as described above to determine the correctness of the gate control scheduling of the switch.

[0048] The embodiments of the present application have the following beneficial effects:

[0049] The embodiment of the present application provides a switch testing method, which, when applied to a test machine, includes: capturing all data packet flows forwarded by the switch to be tested, wherein all captured data packet flows are used as subsequent packet acquisition objects; after setting the packet acquisition conditions, starting the first-level packet acquisition process to obtain the data packet flow of the target queue that the switch schedules and forwards based on the preset gating list entry; obtaining the first-level detection result according to the first-level packet acquisition result; after canceling the setting of the packet acquisition condition, starting the second-level packet acquisition process to obtain all data packet flows forwarded by the switch; obtaining the second-level detection result according to the second-level packet acquisition result; determining the accuracy of the gating scheduling of the switch according to the first-level detection result and the second-level detection result. This embodiment determines the accuracy of the switch gating scheduling through a two-level packet acquisition process, thereby improving the accuracy and reliability of the switch gating scheduling test; and this embodiment also calculates the sending time of the data packet after the gating scheduling of the switch to be tested, to accurately verify the correctness of the type of data flow transmitted by the switch under the gating scheduling and the accuracy of the sending time, meeting the requirements of completing the Qbv synchronization protocol accuracy test under ordinary test conditions, while saving the test cost and reducing the test difficulty. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.

[0051] Figure 1 A first structural schematic diagram of a switch testing system in an embodiment of the present application is shown;

[0052] Figure 2 A second structural schematic diagram of the switch testing system in an embodiment of the present application is shown;

[0053] Figure 3 A third structural schematic diagram of the switch test system in an embodiment of the present application is shown;

[0054] Figure 4 A first flow chart of a switch testing method according to an embodiment of the present application is shown;

[0055] Figure 5 A second flow chart of the switch testing method in the embodiment of the present application is shown;

[0056] Figure 6 A schematic diagram of the structure of a switch testing device in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0057] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0058] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0059] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.

[0060] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0061] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0062] IEEE 802.1AS (AS) is a network time synchronization protocol, which is part of the IEEE 802.1 working group and is mainly used to support time synchronization of time-sensitive applications in bridged networks.

[0063] QoS (Quality of Service) refers to a network's ability to use various basic technologies to provide better service capabilities for designated network communications. It is a network security mechanism and a technology used to solve problems such as network delays and congestion.

[0064] IEEE 802.1Qbv, Time Awareness Shaper (TAS) is an important standard in the IEEE 802.1 family, which is specifically optimized for the time sensitivity of real-time traffic.

[0065] Generally speaking, the conventional test method for the switch Qbv gating function is to use a network tester that supports TSN protocol simulation, and test the Qbv function of the device under test through the clock synchronization simulation of the professional instrument, the precise packet sending start time control of the Qbv business simulation flow, and the statistical analysis of the Qbv business flow packet receiving bucket. This method can verify that the Qbv gating channel correctly transmits the corresponding type of business flow and the accuracy of the business flow transmission time, but it requires professional instruments that support the simulation function of specific protocols (such as TSN protocol, PTP protocol, etc.). As an emerging technology and a trend in network development, TSN switches have fewer corresponding professional instruments and are more expensive, so there are many scenarios where professional instruments are lacking.

[0066] Based on this, in this embodiment, a switch testing system is provided; the system can achieve accurate testing of the Qbv function of switches such as TSN switches without relying on professional testing instruments (ie, without requiring professional testing instruments).

[0067] For example, Figure 1 As shown, the system includes a switch 100 to be tested and a test machine 200; wherein the test machine 200 includes a packet sending end and a packet capturing end; the packet sending end is connected to the receiving port of the switch 100, and the packet capturing end is connected to the sending port of the switch 100.

[0068] Specifically, the packet sending end is used to run the packet sending tool to send a data packet stream to the switch 100; the switch 100 uses its own Qbv function configuration to schedule and forward the data packet stream; the packet capturing end is used to run the packet capturing tool to capture the data packet stream forwarded by the switch 100, and perform multi-level packet retrieval on the captured data packet stream, and then determine the correctness of the gated scheduling of the switch 100 based on the packet retrieval results.

[0069] It should be noted that the packet sending end and the packet capturing end of the test machine 200 can be integrated on the main body of the same test machine to become two transceiver ports of the test machine 200; but the packet sending end and the packet capturing end can also be two separate independent devices, and the two devices themselves can achieve communication connection through network communication or other methods; the specific structural design of the test machine 200 can be set accordingly according to actual needs and is not limited here.

[0070] In some examples, the switch test system includes two architectures, and any of the two architectures is used to detect the Qbv function configured on the switch 100 to be tested. The switch 100 to be tested is a switch with a Qbv function; the test machine 200 is an ordinary test machine. Obviously, this embodiment meets the need for accurate verification of the Qbv function by using an ordinary test machine that has no requirements for whether it supports protocol simulation functions such as PTP and TSN protocols, so that the switch transmits the specified traffic at the set time, so that even in the absence of professional test instruments, the Qbv function can be accurately tested by an ordinary test machine.

[0071] For reference, this embodiment can send packets to the device under test (the switch to be tested) through an ordinary tester / packet sending tool, and combine the clock synchronization function of the device under test (clock synchronization is a basic requirement in the TSN standard, and devices with Qbv function basically have clock synchronization function) to calculate the sending time of the data packet after being scheduled by the Qbv function of the device under test, so as to accurately verify the correctness of the transmission data stream type and the accuracy of time under Qbv gating, achieve the purpose of Qbv protocol testing, and thus meet the needs of accurate verification of Qbv function under most common test conditions.

[0072] For example, Figure 2 As shown, the first architecture includes: a switch to be tested (ie, DUT) and a tester; wherein the tester can be an ordinary tester without having additional functions.

[0073] Specifically, the sending port (Port1) of the tester is connected to the receiving port (Port1') of the switch, and the receiving port (Port2) of the tester is connected to the sending port (Port2') of the switch; the tester is used to send packets such as messages to the switch through the sending port (Port1), and the switch is used to call its own configured Qbv function to implement the scheduling and forwarding of the packet flow after receiving the packet flow such as messages; further, the tester is used to capture the packet flow forwarded by the switch through its own Qbv function through the receiving port (Port2), and perform multi-level packet fetching processing on the captured packet flow, so as to perform performance analysis on the Qbv function of the switch and implement the gated scheduling test of the switch. Among them, when capturing packets, the tester can capture the packet flow forwarded by the switch by running the corresponding packet capture tool, and analyze the packet flow.

[0074] It can be understood that the tester in the first structure described above is a test machine in which the packet sending end and the packet capturing end are integrated into the same main body, and the sending, packet capturing and packet retrieval of the data packet stream are only implemented on the same device.

[0075] In one example, if Figure 3 As shown, the second architecture of the system includes: a switch, a PC packet transmitter (PC1) and a PC packet capturer (PC2). The sending port of the PC packet transmitter is connected to the receiving port (Port1') of the switch, and the receiving port of the PC packet capturer is connected to the sending port (Port2') of the switch. Optionally, the PC packet transmitter and the PC packet capturer can both use PCs that can realize corresponding functions.

[0076] Similar to the working principle of the first architecture, the PC packet sender is used to send packets and other data packet flows to the switch, and the PC packet capturer is used to capture the data packet flow forwarded by the switch, and perform packet processing based on the captured data packet flow, and perform performance analysis on the Qbv function of the switch based on the packet capture results.

[0077] Correspondingly, an embodiment of the present application further provides a switch testing method, which is implemented based on the above-mentioned switch testing system. Specifically, the method is applied to the switch 100 to be tested.

[0078] Please refer to Figure 4 , the method is described in detail below.

[0079] S110, configuring at least one gating list entry for scheduling a data packet flow of a target queue.

[0080] S120, schedule and forward the received data packet flow of the target queue through the gating list entries, so that the test machine captures the scheduled forwarded data packet flow once through the test machine, and then starts the corresponding packet retrieval process to determine the accuracy of the switch's gating scheduling.

[0081] First, configure the basic information of the switch, such as port VLAN, global and port time synchronization protocol (IEEE802.1AS time synchronization protocol) function, Qos and Qbv function, and corresponding gating parameters. The gating parameters include cycle period, gating list (consisting of multiple gating list entries), etc. The specific configuration rules of the above basic information can be set accordingly according to actual needs, and this embodiment does not limit this.

[0082] For example, when configuring the switch for VLAN, the switch's sending port (i.e., Port1) and receiving port (i.e., Port2) are assigned to the same VLAN, and when the switch forwards a data packet flow, it automatically adds a VLAN tag to the data packet in the data packet flow, i.e., the switch outputs its own VLAN tag. Optionally, the two ports (i.e., Port1 and Port2) can be assigned to VLAN 2.

[0083] Then, the performance of the two ports of the switch is configured. The IEEE 802.1AS time synchronization protocol function is enabled on both ports, that is, the switch is provided with the time synchronization function. Furthermore, the switch is configured with the Qos and Qbv functions, wherein the Qbv gating rules of the switch sending port are configured accordingly, such as configuring the cycle time in the gating rules to be 1ms, and configuring at least two gating list entries, each of which is used to allow data from one or more queues to pass through.

[0084] In this embodiment, by setting the gating list entries accordingly, the switch periodically forwards the corresponding data packet flow based on its own Qbv function and the gating list entry settings.

[0085] It can be understood that after configuring the basic information, the switch schedules and forwards multiple data packet flows sent by the packet sending end, wherein the scheduling and forwarding process is implemented based on pre-configured gating list entries; wherein the switch only schedules and forwards one data packet flow of the target queue within a packet sending cycle.

[0086] Furthermore, the subsequent packet capture end can capture packets based on the data packet flow forwarded by the switch scheduling, and then perform a multi-level packet capture process based on the captured data packet flow, thereby realizing multi-level detection and analyzing the accuracy of the switch gating scheduling based on the detection results.

[0087] In this embodiment, the gated list entries and gated parameters can be set accordingly according to the number of target queues that need to be tested for gated scheduling, wherein the total number of gated list entries set is not greater than the preset maximum number of configurable entries, and the specific value of the preset maximum number of configurable entries can be set accordingly according to actual needs and is not limited here.

[0088] In some examples, if the number of target queues for testing gating scheduling is 1, two gating list entries may be configured when configuring the gating list entries.

[0089] Preferably, if two gating list entries are configured, a first gating list entry is configured first, and the gating parameters of the first gating list entry are set accordingly, and the first gating list entry is set to allow the data packet flow of the target queue to pass through, and not allow the data packet flow of the non-target queue to pass through; and a second gating list entry is configured, and the gating parameters of the second gating list entry are set accordingly, and the second gating list entry is set to allow the data packet flow of the corresponding non-target queue to pass through, and not allow the data packet flow of the target queue to pass through; wherein, the number of non-target queues allowed to pass in the second gating list entry can be set according to actual needs, and there is no limitation on this. That is, the switch can only schedule and forward the data packet flow of the target queue during the opening time of the first gating list entry, and schedule and forward the data packet flow of the corresponding queue during the closing time of the first gating list entry (i.e., the opening time of the second gating list entry).

[0090] It can be understood that when two gating list entries are configured, the switch periodically schedules the forwarding of the received data packet flow according to the configured gating list, and then the test machine captures the forwarded data packet flow. Correspondingly, the test machine can also perform multiple packet captures based on the captured data packet flow to detect the correctness of the switch's gating scheduling for the target queue based on the packet capture situation. Among them, the test machine only performs a packet capture operation once, and then captures all the data packet flows forwarded by the switch at one time.

[0091] It is worth noting that if the number of target queues that need to be tested for gated scheduling is greater than 1, multiple gated list entries can be configured to synchronously implement the gated scheduling test of multiple target queues, wherein each gated list entry is used to implement the gated scheduling of one target queue. Alternatively, only one target queue is tested for gated scheduling each time, and then, only two gated list entries are configured to implement the gated scheduling of one target queue each time. Among them, whether it is synchronously implementing the gated scheduling test of multiple target queues or sequentially implementing the gated scheduling test of multiple target queues, the principle and implementation process are the same, so it will not be repeated here.

[0092] In one embodiment, if the number of target queues required for test gating scheduling is greater than 1 and the number of target queues is equal to the preset maximum number of configurable entries, and the gating scheduling of multiple target queues is synchronously implemented during the test, then the process of configuring the corresponding gating list entries is: configuring multiple third gating list entries, and setting the gating parameters of each third gating list entry accordingly, and setting each third gating list entry to allow a data packet flow of a target queue to pass through.

[0093] Then, the switch periodically schedules the forwarding of the received data packet stream according to the configured gating list entries. Correspondingly, the test machine can capture all data packet streams forwarded by the switch and then perform packet fetching processing to detect the correctness of the switch's gating scheduling for the target queue according to the packet fetching situation.

[0094] Further, if the number of target queues required for test gating scheduling is greater than 1 and the number of target queues is less than the preset maximum number of configurable entries, and when the gating scheduling of multiple target queues is implemented in sequence during the test process, the process of configuring the corresponding gating list entries is the same as the process of configuring the gating list entries when the number of target queues required for test gating scheduling is 1; for example, multiple third gating list entries and at least one fourth gating list entry are configured, and the gating parameters of each third gating list entry and the fourth gating list entry are set accordingly; wherein each third gating list entry is set to allow a packet flow of a target queue to pass through, and not allow packet flows of non-target queues to pass through; and the fourth gating list entry is set to allow a packet flow of at least one non-target queue to pass through, and not allow packet flows of all target queues to pass through; wherein the total number of the third gating list entries and the fourth gating list entries is not greater than the preset maximum number of configurable entries; wherein the specific configuration process is not limited in this embodiment.

[0095] Optionally, when testing the gating scheduling of multiple target queues by the switch, this embodiment may also execute the gating scheduling of only any two or more target queues (less than the total number of target queues that need to test the gating scheduling) at a time until the gating scheduling detection of all target queues is achieved, wherein the setting of the gating list can be set accordingly according to the specific situation, and this embodiment does not limit this.

[0096] Correspondingly, an embodiment of the present application further provides a switch testing method, which is implemented based on the above-mentioned switch testing system. Specifically, the method is applied to a testing machine.

[0097] Please refer to Figure 5 , the method is described in detail below.

[0098] S210, capturing all data packet flows forwarded by the switch to be tested, wherein all captured data packet flows are used as subsequent packet capture objects.

[0099] S220, after setting the packet fetching condition, start the first level packet fetching process to obtain the data packet flow of the target queue that the switch schedules to forward based on the preset gating list entry.

[0100] S230, obtaining a first-level detection result according to the first-level packet fetching result.

[0101] First, the packet capture end performs packet capture processing to capture all data packet flows scheduled and forwarded by the switch, and then performs subsequent packet capture operations based on the captured data packet flows.

[0102] A packet-taking condition is set at the packet-capturing end so that the packet-capturing end captures packets according to the packet-capturing condition; wherein the packet-capturing condition is to capture only the data packet flow of the target queue.

[0103] After the packet fetching conditions are set, the packet fetching end starts the first-level packet fetching process, and periodically obtains the data packet flow of the target queue scheduled and forwarded by the switch, that is, performs multiple packet fetching operations; wherein, in each cycle, a data packet flow corresponding to the target queue is obtained, and a data packet flow contains multiple data packets. In other words, the first-level packet fetching process only periodically obtains the data packet flow of the target queue, and only one data packet flow is obtained each time a packet is fetched.

[0104] The process of first-level detection and analysis based on the first-level packet fetching results is specifically as follows: record the number of packet fetching times, and determine whether each data packet in the obtained data packet flow meets all of the following preset conditions each time a packet is fetched: Condition 1, the number of packet fetching times is equal to the number of data packet flows scheduled by the switch based on the corresponding gate opening time of the preset gating list entry; Condition 2, each time a packet is fetched, the maximum number of data packets in the obtained data packet flow is equal to the maximum number of data packets allowed to be forwarded within the gate opening time of the target gating list entry; Condition 3, the time interval between two adjacent packet fetches is equal to the gate closing time of the target gating list entry; Condition 4, the time interval between two adjacent data packets in the same data packet flow is equal to the time required to send a data packet within the gate opening time of the target gating list entry.

[0105] In this embodiment, the packet sending end is pre-set with basic information such as the total number of packets sent, the packet sending rate, and the frame length of the packets of the target queue, so as to determine the sending time of each packet. After the packet sending end transmits the corresponding packet flow to the switch, the switch schedules the forwarding of the packet flow based on the preset gate list, and only forwards the packet flow of the target queue within the gate opening time of the gate list entry corresponding to the target queue.

[0106] Furthermore, the number of times the packet capture end captures packets from the target queue's packet flow should be consistent with the number of times the switch schedules and forwards the target queue's packet flow (i.e., the number of packet flows scheduled by the switch within the gate opening time corresponding to the gating list entry of the target queue); if they are inconsistent, it means that packet loss or other abnormal conditions have occurred, proving that the switch's gating scheduling is inaccurate.

[0107] Secondly, since the sending duration of each data packet is fixed, the maximum number of packets sent within the gate opening time of the gating list entry corresponding to the target queue is fixed, that is, the maximum number of data packets allowed to be forwarded within the gate opening time of the gating list entry corresponding to the target queue is fixed. Therefore, the maximum number of data packets in the data packet flow obtained by the packet capture end in each cycle is also fixed, and is consistent with the maximum number of packets sent by the switch within the gate opening time, otherwise it means that the gating scheduling of the switch is inaccurate.

[0108] Secondly, the switch does not forward the data packet flow of the target queue within the closing time of the corresponding gating list entry. Therefore, when the packet capture end obtains the data packet flow of two adjacent cycles, the time interval between the two adjacent cycles should correspond to the closing time of the target gating list entry, otherwise it means that the gating scheduling of the switch is inaccurate.

[0109] In addition, the switch periodically schedules a packet flow of the forwarding target queue, and the interval between two adjacent packets in the same packet flow is fixed, that is, the sending duration of a packet. Therefore, after the packet capture end obtains a packet flow each time, the time interval between two adjacent packets in the same packet flow should be equal to the time required to send a packet within the gate opening time of the target gating list entry, otherwise it means that the gating scheduling of the switch is inaccurate.

[0110] It can be understood that if all the above conditions are met, it means that the first-level detection result passes, and then the second-level packet fetching process can be executed to perform the second-level detection analysis. If any of the above conditions is not met, the second-level detection result fails, indicating that the gating scheduling of the switch is inaccurate, and there is no need to execute the second-level packet fetching process.

[0111] S240, after canceling the setting of the packet acquisition condition, starting the second level packet acquisition process to obtain all data packet flows forwarded by the switch.

[0112] S250, obtaining a second-level detection result according to the second-level packet retrieval result.

[0113] After the first-level packet fetching process is completed, the setting of the packet fetching condition is canceled to execute the second-level packet fetching process. In the second-level packet fetching process, multiple packets are fetched for all data packet flows forwarded by the switch. Each time a packet is fetched, only all data packet flows scheduled and forwarded by the switch in a packet sending cycle are obtained, wherein all obtained data packet flows include data packet flows of different queues and time synchronization protocol messages, etc. In each cycle, the switch only forwards the data flow packets of the target queue within the gate opening time of the gate list entry of the target queue, and forwards the data flow packets or other data packet flows of other queues within the gate closing time of the gate list entry.

[0114] The process of the second-level detection is to calculate the first sending time of the last data packet in the data packet flow of the target queue obtained by the first packet fetching, and to calculate the second sending time of the first data packet in each data packet flow obtained from the second to the last packet fetching; if the first sending time is within the first preset time range, and starting from the second packet fetching, each second sending time is within the second preset time range, then it is determined that the second-level detection has passed; otherwise, if the first sending time is not within the first preset time range, and / or the second time interval is not within the second preset time range, then it is determined that the second-level detection has failed.

[0115] For example, the process of calculating the sending time (i.e., the first sending time or the second sending time) of the corresponding data packet in the data packet flow of the target queue obtained each time is to calculate the difference between the capture time of the target data packet in the data packet flow of the target queue (i.e., the target data packet flow) obtained each time and the capture time of the corresponding follow-up message (PTPv2 Follow Up Message, PTPv2 follow-up message, i.e., time synchronization protocol message); wherein the follow-up message corresponding to each data packet is the most adjacent follow-up message before the corresponding data packet is captured; for example, the follow-up message corresponding to the first data packet in a data packet flow is the most adjacent follow-up message before the first data packet is captured. The sum of the actual sending time contained in the follow-up message and the difference is used as the sending time of the target data packet in the target data packet flow.

[0116] Among them, when the packet capture tool is used to capture packets at the packet capture end, the packet capture time and packet sequence number of each data packet, the message sequence number of the following message, the packet capture time, and the real sending time (i.e., precise Origin Timestamp) in the message frame following the message can be recorded. Optionally, in the process of taking packets, the above parameters can be recorded in a form such as a table, and the specific recording form is not limited in this embodiment; the packet sequence number of each data packet is used to indicate the packet capture sequence of each data packet in the data packet stream.

[0117] Furthermore, the packet sequence number and packet capture time of the first data packet and the last data packet in the data packet flow of the target queue obtained by the same packet retrieval are obtained, as well as the packet sequence number, packet capture time and actual sending time contained in the message frame of the following message corresponding to the first data packet and the last data packet.

[0118] Among them, the calculation process of the sending time of any data packet in a data packet stream obtained each time the packet is taken is to first calculate the difference between the capture time of the target data packet and the capture time of the corresponding following message, and then calculate the sum of the difference and the actual sending time contained in the message frame of the following message to obtain the sending time of the target data packet.

[0119] Among them, the value of the above-mentioned preset time range can be set accordingly according to actual needs, and this embodiment does not limit this; for example, the first preset time range is: [integer multiples of the cycle + the opening time of the target queue gating list entry - the sending time of a data packet ~ integer multiples of the cycle + the opening time of the target queue gating list entry]; the second preset time range is: (integer multiples of the cycle ~ integer multiples of the cycle + the sending time of a data packet flow).

[0120] S260: Determine the accuracy of the gating scheduling of the switch according to the first-level detection result and the second-level detection result.

[0121] Specifically, if any of the first-level detection results and the second-level detection results fail, the gating scheduling test of the switch is determined to be inaccurate. That is, only when both the two-level detection results pass can the gating scheduling of the switch be determined to be accurate.

[0122] The following is an example to illustrate the accuracy determination process of the switch for the gating scheduling of any queue.

[0123] For example, if we verify the correctness of the switch's gating for queue 7, the specific process is as follows:

[0124] First, configure the cycle of the Qbv function of the switch to be tested to 1ms, and configure 2 gating list entries; among them, the gate opening time (i.e., GateOpenTime) of gating list entry 1 is 100us (i.e., 0-100us of a cycle of 1ms), and the gating list entry 1 allows the data of queue Que 7 to pass through, but does not allow the data of the other queues (Que 0-6) to pass through; the gate opening time of gating list entry 2 is 900us (i.e., 101-1000us of a cycle of 1ms), allowing the data of queues Que0-6 to pass through, but not allowing the data of the other queues (Que 7) to pass through.

[0125] Specifically, a packet flow of Que 7 is constructed through the packet sending end, wherein the vlan tag Vid of the packet flow is 2, priority is 7 (that is, the cos value is 7; when the data is sent to the switch, the Qos cos value on the switch is mapped to the queue, and under default conditions, cos7 is mapped to queue Que7), the packet frame length is 1230Byte, the packet sending rate is 10000fps, and the total number of packets sent is 100; furthermore, when the switch sends the packet flow of Que 7, it takes 10us to send one of the packets, so within the door opening time (100us), at most 10 of the 100 packets are sent each time (that is, the switch schedules to forward a packet flow of the target queue each time, and the packet flow contains at most 10 packets), and the interval between two adjacent packets in the same packet sending cycle is 10us.

[0126] The packet capture end is used to run a packet capture tool such as Wireshark to capture packets when the packet sending end is about to send packets (before sending packets), and the packet sending end is used to send the Que 7 data packet stream. After completing the packet capture, the Wireshark packet capture tool is set to filter the Que 7 data packet stream (by setting the filtering condition as the source MAC or the destination MAC, etc.), so that the packet capture end performs packet extraction processing on the captured Que 7 data packet stream.

[0127] If the packet capture tool obtains a total of 100 packets after filtering the packet flow of Que7, among which the number of packet acquisitions is 10 or 11, and the time interval between two adjacent packets is about 900us, and the time interval between two adjacent packets within the same number of packet acquisitions is about 10us, it means that the first-level detection has passed.

[0128] It can be understood that, under the condition that the switch's gating scheduling is accurate, if the packet capture tool takes 10 packets, then the number of packets obtained each time is 10; if the number of packet capture is 11, then the total number of packets obtained for the first and 11th times is 10; and for the remaining 9 times, the number of packets obtained each time is 10.

[0129] Furthermore, the packet fetching condition restriction is cancelled to obtain all data packet flows including the Que 7 data packet flow forwarded by the switch.

[0130] Among them, the packet sequence number and the packet capture time of all data packets at each packet capture, and the message sequence number, packet capture time and the actual sending time (ie, preciseOriginTimestamp) contained in the synchronization protocol message (such as PTPv2 Follow Up Message, PTPv2 follow message) are read.

[0131] Among them, among the multiple data packets obtained multiple times, the packet numbers of the first and last two data packets at each packet acquisition are recorded as No.B1F, No.B1L (first packet acquisition), No.B2F, No.B2L (second packet acquisition),..., No.B10F, No.B10L (tenth packet acquisition), No.B11F, No.B11L (eleventh packet acquisition) (the character after No. is a specific number, no specific example is given here, and the character can be directly displayed on the wireshark tool); and the packet capture time corresponding to the first and last two data packets at each capture is recorded as T: No.B1F, T: No.B1L, T: No.B2F, T: No.B2L,..., T: No.B10F, T: No.B10L, T: No.B11F, T: No.B11L (wherein, the specific time display format is the number of seconds elapsed from the start of capture, with an accuracy of ns, which can also be directly displayed on the wireshark tool).

[0132] Each data packet has a corresponding PTPv2 follow-up message that is closest to it before it is captured. The sending time of the data packet can be determined based on the capture time of the corresponding PTPv2 follow-up message and the actual sending time contained in the follow-up message frame. That is, the sending time of a data packet is related to the capture time of the data packet, the capture time of the PTPv2 follow-up message corresponding to the data packet, and the actual sending time in the follow-up message frame.

[0133] For example, when the packet is first fetched, the sending time of the most recent PTPv2 follow-up message (message number No.M) before the first data packet (sequence number No.B1F) is captured is T:No.M, and the actual sending time in the message frame of the follow-up message is preciseOriginTimestamp.

[0134] Furthermore, the sending time (Time_No.B1F) of the first data packet (No.B1F) obtained for the first time is calculated as:

[0135] Time_No.B1F=preciseOriginTimestamp+[(T:No.B1F)-(T:No.M)];

[0136] Similarly, the sending time Time_No.B1F to Time_No.B11L of the first and last data packets obtained each time can be calculated. Similarly, the sending time Time_No.BXL of the last data packet obtained for the first time can also be calculated.

[0137] By analogy, check whether the sending time Time_No.BXL of the last data packet of the first packet fetching is within the first preset time period (i.e., within the range of whole ms+90us to whole ms+100us), and check whether the sending time Time_No.BXF of the first data packet in each packet fetching except the first time is within the second preset range (i.e., within the range of whole ms to whole ms+10us).

[0138] In this embodiment, if the sending time of the last data packet when the packet is fetched for the first time and the sending time of the first data packet when the packet is fetched each time except the first time are both within the corresponding time range, it means that the second level detection passes and the gating function of the switch for the Que7 queue is correct.

[0139] In this embodiment, the accuracy of the switch gating scheduling is determined through a two-stage packet fetching process, thereby improving the accuracy and reliability of the switch gating scheduling test; and, this embodiment also calculates the sending time of the data packet after the gating scheduling of the switch to be tested, to accurately verify the correctness of the data flow type and the accuracy of the sending time of the switch under the gating scheduling, thereby meeting the requirements for completing the Qbv synchronization protocol accuracy test under ordinary test conditions, while saving test costs and reducing test difficulty.

[0140] Please refer to Figure 6 The embodiment of the present application also provides a switch testing device, wherein the device comprises:

[0141] The packet capture module 310 is used to capture all data packet flows forwarded by the switch to be tested, wherein all captured data packet flows are used as subsequent packet capture objects;

[0142] The first-level packet fetching module 320 is used to start the first-level packet fetching process after setting the packet fetching conditions, so as to obtain the data packet flow of the target queue that the switch schedules to forward based on the preset gating list entries;

[0143] The first level detection module 330 is used to obtain the first level detection result according to the first level packet fetching result;

[0144] The second-level packet acquisition module 340 is used to start the second-level packet acquisition process after canceling the setting of the packet acquisition condition to obtain all data packet flows forwarded by the switch;

[0145] The second level detection module 350 is used to obtain the second level detection result according to the second level packet fetching result;

[0146] The determination module 360 ​​is used to determine the accuracy of the gating scheduling of the switch according to the first-level detection result and the second-level detection result.

[0147] It can be understood that the switch testing device of this embodiment corresponds to the switch testing method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.

[0148] The embodiment of the present application also provides a test machine, which can be, but is not limited to, a tester, a PC packet capture tool, etc., and its existence form is not limited. Exemplarily, the test machine includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the test machine to execute the switch testing method of the present application, wherein the method includes: performing a packet capture on all data packet streams forwarded by the switch to be tested, wherein all captured data packet streams are used as subsequent packet capture objects; after setting the packet capture conditions, starting the first-level packet capture process to obtain the data packet stream of the target queue that the switch schedules to forward based on the preset gating list entries; obtaining the first-level detection result based on the first-level packet capture result; after canceling the setting of the packet capture conditions, starting the second-level packet capture process to obtain the packet stream forwarded by the switch. all data packet flows; according to the second-level packet fetching result, the second-level detection result is obtained; according to the first-level detection result and the second-level detection result, the accuracy of the switch's gating scheduling is determined; further, the accuracy of the switch's gating scheduling is determined through a two-level packet fetching process, thereby improving the accuracy and reliability of the switch's gating scheduling test; and, in addition, the present embodiment further calculates the sending time of the data packet after the gating scheduling of the switch to be tested, to accurately verify the correctness of the type of data stream transmitted by the switch under the gating scheduling and the accuracy of the sending time, thereby meeting the requirements for completing the Qbv synchronization protocol accuracy test under ordinary test conditions, while saving the test cost and reducing the test difficulty.

[0149] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. At least one of the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0150] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.

[0151] In addition, the present application also provides a computer storage medium for storing the computer program used in the above-mentioned test machine, wherein, when the computer program is executed on a processor, the switch testing method of the above-mentioned embodiment is implemented, and the method includes: capturing all data packet flows forwarded by the switch to be tested, wherein all captured data packet flows are used as subsequent packet capture objects; after setting the packet capture conditions, starting the first-level packet capture process to obtain the data packet flow of the target queue that the switch schedules forwarding based on the preset gating list entries; obtaining the first-level detection result based on the first-level packet capture result; after canceling the setting of the packet capture conditions, starting the second-level packet capture process to obtain all data packet flows forwarded by the switch; obtaining the second-level detection result based on the second-level packet capture result; and determining the accuracy of the gating scheduling of the switch based on the first-level detection result and the second-level detection result.

[0152] It can be understood that the options in the switch testing method of the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.

[0153] The computer storage medium may be a non-volatile storage medium or a volatile storage medium. For example, the computer storage medium may include, but is not limited to, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0154] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0155] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0156] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.

[0157] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A switch testing method, characterized in that: Applied to a testing machine, the method comprises: Capturing all data packet flows forwarded by the switch to be tested, wherein all captured data packet flows are used as subsequent packet capture objects; After setting the packet fetching condition, starting the first level packet fetching process to obtain the data packet flow of the target queue that the switch schedules to forward based on the preset gating list entry; According to the first-level package taking result, the first-level detection result is obtained; After canceling the setting of the packet acquisition condition, starting the second level packet acquisition process to obtain all the data packet flows forwarded by the switch; According to the second-level packet taking result, the second-level detection result is obtained; The accuracy of the gating scheduling of the switch is determined according to the first-level detection result and the second-level detection result.

2. The switch testing method according to claim 1, characterized in that: The first level detection process includes: Record the number of times a packet is fetched; wherein each time a packet is fetched, a corresponding data packet stream is obtained, and a data packet stream includes multiple data packets; Determine whether each data packet in the obtained data packet stream satisfies all of the following preset conditions each time a packet is retrieved: Condition 1: the number of packet fetches is equal to the number of data packet flows scheduled by the switch within the corresponding gate opening time based on the preset gate list entry; Condition 2: Each time a packet is retrieved, the maximum number of packets in the acquired packet flow is equal to the maximum number of packets allowed to be forwarded within the gate opening time of the target gating list entry; Condition three: the time interval between two consecutive packet fetches is equal to the gate closing time of the target gate list entry; Condition 4: The time interval between two adjacent data packets in the same data packet flow is equal to the time required to send a data packet within the gate opening time of the target gating list entry.

3. The switch testing method according to claim 1, characterized in that: The second level detection process includes: Calculate the first sending time of the last data packet in the data packet flow of the target queue obtained by first packet fetching, and respectively calculate the second sending time of the first data packet in each of the data packet flows obtained by second to last packet fetching; If the first sending time is within a first preset time range, and starting from the second packet fetching, each of the second sending times is within a second preset time range, it is determined that the second level detection has passed; If the first sending time is not within the first preset time range, and / or the second sending time is not within the second preset time range, it is determined that the second level detection fails.

4. The switch testing method according to claim 3, characterized in that: The calculation process of the first sending time or the second sending time includes: Calculate the difference between the capture time of the target data packet in the target data packet flow and the capture time of the corresponding follow-up message; wherein the follow-up message is the most adjacent follow-up message before the target data packet in the target data packet flow is captured; The sum of the actual sending time contained in the follow-up message and the difference is used as the sending time of the target data packet in the target data packet flow.

5. The switch testing method according to claim 1, characterized in that: Determining the accuracy of the gating scheduling of the switch according to the first-level detection result and the second-level detection result includes: If any one of the first-level detection result and the second-level detection result is a failure, it is determined that the gating scheduling test of the switch is inaccurate.

6. A switch testing method, characterized in that: Applied to a switch to be tested, the method comprises: configuring at least one gating list entry for scheduling a packet flow of a target queue; The received data packet flow is scheduled and forwarded through the gating list entries, so that the test machine captures the data packet flow scheduled to be forwarded once, and then starts the corresponding packet capture process to determine the accuracy of the gating scheduling of the switch.

7. The switch testing method according to claim 6, characterized in that: If the number of target queues to be tested for gating scheduling is 1, configuring at least one gating list entry for scheduling a data packet flow of the target queue includes: Configure a first gating list entry, and set the gating parameters of the first gating list entry accordingly, and set the first gating list entry to allow the data packet flow of the target queue to pass through, and not allow the data packet flow of the non-target queue to pass through; A second gating list entry is configured, and gating parameters of the second gating list entry are set accordingly, and the second gating list entry is set to allow the data packet flow of the non-target queue to pass through, and not allow the data packet flow of the target queue to pass through.

8. The switch testing method according to claim 6, characterized in that: If the number of target queues for testing gating scheduling is greater than 1 and equal to the preset maximum number of configurable entries, configuring at least one gating list entry for scheduling the data packet flow of the target queue includes: Configure multiple third gating list entries, and set gating parameters of each third gating list entry accordingly, and set each third gating list entry to allow a data packet flow of a target queue to pass through; If the number of target queues for testing gating scheduling is greater than 1 and less than the preset maximum number of configurable entries, configuring at least one gating list entry for scheduling the data packet flow of the target queue includes: Configure multiple third gating list entries and at least one fourth gating list entry, and set the gating parameters of each of the third gating list entries and the fourth gating list entries accordingly; set each of the third gating list entries to allow a packet flow of the target queue to pass through, and not allow packet flows of non-target queues to pass through; and set the fourth gating list entry to allow a packet flow of at least one non-target queue to pass through, and not allow packet flows of all target queues to pass through; wherein the total number of the third gating list entries and the fourth gating list entries is not greater than the preset maximum number of configurable entries.

9. A switch testing device, characterized in that: include: A packet capture module, used for capturing all data packet flows forwarded by the switch to be tested, wherein all captured data packet flows are used as subsequent packet capture objects; A first-level packet fetching module, configured to start a first-level packet fetching process after setting a packet fetching condition, so as to obtain a data packet flow of a target queue that is forwarded by the switch based on a preset gating list scheduling; A first-level detection module, used to obtain a first-level detection result according to the first-level packet fetching result; A second-level packet acquisition module, used to start a second-level packet acquisition process after canceling the setting of the packet acquisition condition, so as to obtain all the data packet flows forwarded by the switch; The second-level detection module is used to obtain the second-level detection result according to the second-level packet fetching result; A determination module is used to determine the accuracy of the gating scheduling of the switch according to the first-level detection result and the second-level detection result.

10. A switch testing system, characterized in that: The tester comprises a switch to be tested and a test machine; wherein the test machine comprises a packet sending end and a packet capturing end; the packet sending end is connected to a receiving port of the switch, and the packet capturing end is connected to a sending port of the switch; The packet sending end is used to send multiple data packet flows to the switch; The switch is used to execute the switch testing method according to any one of claims 6 to 8 to schedule and forward each of the data packet flows; The packet capture end is used to execute the switch testing method according to any one of claims 1 to 5 to determine the correctness of the gate scheduling of the switch.