Traffic injection test method, device and equipment for high-speed ports of switches
By configuring a serpentine flow chain in the switch, using a packet port of the flow meter, mixing the loopback module and wire and cable media module, the full coverage problem of high-speed port testing of the switch is solved, and resource conservation and testing simplification is achieved.
Patent Information
- Application Number
- CN202211557196.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-06
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-12-06
AI Technical Summary
In the prior art, the flow test of the high-speed port of the switch has problems such as not being able to fully cover, occupying multi-port resources of the flow meter, and complex testing processes. Especially in the switch with complex configuration, it is impossible to verify the ports of the mixed access of the loopback module and the wire and cable media.
By configuring a serpentine flow chain in the switch, using a packet port of the flow meter, mixing the loopback module and wire and cable media module, the full coverage test of the switch's high-speed port is achieved, including configuring forwarding rules to cover the loopback module and bidirectional wire and cable media.
It saves flow meter port resources, simplifies the test process, and realizes full coverage testing of the hybrid access ports of loopback modules and wire and cable media modules, saving material costs.
Smart Images

Figure CN115766512B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment testing, and in particular to a method, device and equipment for testing the flow of a high-speed port of a switch. Background Art
[0002] With the continuous advancement of internet technology, switches are increasingly being used as multi-port network bridges. Typically, switches provide a large number of ports for cable connections, used to connect multiple personal computers to the network. To ensure stable switch operation, testing switch traffic flow is crucial. To address this, traffic meters, which can be used to test switch traffic flow, have emerged.
[0003] In the prior art, all ports of a switch are interconnected with the packet sending port of a traffic meter in a one-to-one manner, and testing is performed by testing two ports against each other, thereby achieving the purpose of full port coverage of the traffic testing.
[0004] However, for switches with particularly complex configurations, the above solution may not fully cover the switch ports and may occupy multiple ports of the flow meter, occupying port resources. At the same time, the test process and configuration are also complicated. Summary of the Invention
[0005] The present application provides a method, device and equipment for testing the high-speed port of a switch, which is used to solve the problem that a serpentine flow link cannot be designed to simultaneously cover the flow verification test of the switch port with mixed access of loopback modules and wire and cable media.
[0006] In a first aspect, the present application provides a method for testing a high-speed port of a switch, comprising:
[0007] Use the flow meter to send test data packets to the switch to be tested and start timing to obtain the timing duration;
[0008] When the timing duration reaches a preset test duration, controlling the flow meter to stop sending the test data packet;
[0009] Determining whether packet loss occurs in the switch to be tested based on the test data packet sent by the traffic meter and the data packet output by the switch to be tested;
[0010] The switch to be tested includes multiple high-speed ports, which are configured as a serpentine flow ring chain. One of the multiple high-speed ports is connected to the flow meter, and the other high-speed ports include: paired ports connected through wire and cable media and ports configured with a loopback module.
[0011] In conjunction with the first aspect, in some embodiments, a method for testing traffic on a high-speed port of a switch includes:
[0012] The wire and cable media include optical modules or high-speed cable DACs.
[0013] In combination with the first aspect, in some embodiments, the method further includes:
[0014] The forwarding rules in the serpentine flow ring chain in the switch to be tested are configured, where the forwarding rules are used to configure unidirectional coverage of the loopback module and bidirectional coverage of the optical module or the high-speed cable DAC.
[0015] In combination with the first aspect, in some embodiments, the plurality of high-speed ports include port 1, port 2, port 3, port 4, port 5, port 6, port 7, and port 8;
[0016] in,
[0017] The port 1 is connected to the flow meter, and the port 2, the port 3 and the port 4 are respectively configured with a loopback module;
[0018] The port 5 and the port 6 are interconnected via the wire and cable medium, and the port 7 and the port 8 are interconnected via the wire and cable medium.
[0019] In a second aspect, the present application provides a flow testing device for a high-speed port of a switch, comprising:
[0020] The sending module is used to send test data packets to the switch to be tested through the flow meter;
[0021] Timing module, used to start timing and obtain timing duration;
[0022] A control module, configured to control the flow meter to stop sending test data packets when the timing duration reaches a preset test duration;
[0023] a processing module, configured to determine whether packet loss occurs in the switch to be tested based on the test data packet sent by the flow meter and the data packet output by the switch to be tested;
[0024] The switch to be tested includes multiple high-speed ports, which are configured as a serpentine flow ring chain. One of the multiple high-speed ports is connected to the flow meter, and the other high-speed ports include: paired ports connected through wire and cable media and ports configured with a loopback module.
[0025] In combination with the second aspect, in some embodiments, a traffic testing device for a high-speed port of a switch includes: the wire and cable medium includes an optical module or a high-speed cable DAC.
[0026] In conjunction with the second aspect, in some embodiments, the apparatus further includes:
[0027] A configuration module is used to configure forwarding rules in the serpentine flow ring chain in the switch to be tested, wherein the forwarding rules are used to configure unidirectional coverage of the loopback module and bidirectional coverage of the optical module or the high-speed cable DAC.
[0028] In conjunction with the second aspect, in some embodiments, the plurality of high-speed ports include port 1, port 2, port 3, port 4, port 5, port 6, port 7, and port 8;
[0029] in,
[0030] The port 1 is connected to the flow meter, and the port 2, the port 3 and the port 4 are respectively configured with a loopback module;
[0031] The port 5 and the port 6 are interconnected via the wire and cable medium, and the port 7 and the port 8 are interconnected via the wire and cable medium.
[0032] In a third aspect, the present application provides a control device, comprising:
[0033] memory, processors, and controllers;
[0034] The memory stores computer instructions;
[0035] The processor executes the computer instructions stored in the memory, so that the control device executes the flow testing method for the high-speed port of the switch described in the first aspect.
[0036] In a fourth aspect, the present application provides a storage medium storing a computer program;
[0037] When the computer program is executed, the flow testing method for the high-speed port of the switch described in the first aspect is implemented.
[0038] In a fifth aspect, the present application provides a switch, comprising: a plurality of high-speed ports configured as a serpentine flow ring chain;
[0039] Among them, one high-speed port among the multiple high-speed ports is used to connect to the flow meter, and the other high-speed ports include paired ports connected through optical modules or high-speed cables DAC and ports configured with loopback modules;
[0040] The optical module or DAC is configured for unidirectional overlay forwarding, and the optical module or DAC is configured for bidirectional overlay forwarding.
[0041] The present invention provides a method, device, and apparatus for testing high-speed switch ports. Unlike existing technologies, this method utilizes only one packet-sending port of a traffic meter to form a serpentine flow ring chain, which is then connected to a hybrid module covering all high-speed switch ports, thereby achieving traffic testing of the switch's high-speed ports. This effectively conserves traffic meter port resources, saves materials, and achieves the purpose of mixed testing of virtual and physical media. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0043] Figure 1 This is an application scenario diagram of the flow testing method for a high-speed port of a switch provided in an embodiment of the present application;
[0044] Figure 2 A flow chart of a first embodiment of a method for testing a high-speed port flow on a switch provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of a link for a specific configuration of a switch high-speed port provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the structure of a first embodiment of a flow testing device for a high-speed port of a switch provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of the control device structure provided in an embodiment of the present application.
[0048] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0049] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0050] First, let’s explain the terms involved in this application:
[0051] The loopback module is a software-based virtual interface. Any network datagram sent to this interface is considered to be sent to the device itself. Most platforms support the use of this interface to simulate a real interface.
[0052] High-speed cable (Direct Attach Cable, DAC), high-speed cable is a low-cost short-distance connection solution as an alternative to optical modules.
[0053] In today's rapidly developing information age, the demand for switches is growing. In daily life, switches serve as a network bridge, connecting numerous personal computers to the internet and increasing the convenience of people's work and life. As this demand grows, so too does the demand for higher throughput on switches. Consequently, traffic testing on switch high-speed ports is gaining increasing attention. Traffic testing involves connecting a traffic meter port to each high-speed switch port, performing a two-port traffic test to fully cover all high-speed switch ports. However, this method consumes the traffic meter's port resources and is complex in terms of testing procedures and configuration. Connecting one high-speed switch port to the traffic meter and connecting all other high-speed ports to a loopback module, creating a serpentine flow link, allows for full high-speed port coverage. However, since the loopback module is a virtual interface, this method cannot verify traffic connected to physical media modules. If the first and last high-speed ports of the switch are connected to a traffic meter and the other high-speed ports are connected to wire and cable media modules, two bidirectional serpentine flow links are established for the upstream traffic port and the downstream traffic port respectively, and a traffic test with full coverage of the high-speed ports can be achieved. However, this method of connecting all high-speed ports to wire and cable media modules cannot simultaneously verify the traffic connected to the virtual module, and wastes material costs.
[0054] To address the above-mentioned issues, the present application provides a method for testing the high-speed ports of a switch. This method implements a method for testing the high-speed ports of a switch by using a packet sending port of a packet sender to connect multiple high-speed ports of the switch to a mixed loopback module and a wire and cable media module to fully cover the high-speed ports. Specifically, current testing of a switch requires access to a loopback module or a wire and cable module to perform the test. During research, the inventors discovered that when the packet sender port is connected to multiple high-speed ports of the switch, a method of performing a packet sender port-to-port test to fully cover the high-speed ports of the switch is used. However, this method occupies the port resources of the packet sender and is also very complicated in terms of the test process and configuration. If a loopback module or a wire and cable module is connected to conduct a packet sender test on multiple high-speed ports of the switch, it is impossible to perform a packet sender test on multiple high-speed ports of the switch by mixed access to the loopback module and the wire and cable media module. In view of these issues, the inventors investigated whether it is possible to use a packet sender port of the packet sender to connect multiple high-speed ports of the switch to a mixed loopback module and the wire and cable media module to achieve a packet sender test with a single flow covering all high-speed ports. Based on this, the technical solution of the present application is proposed.
[0055] Figure 1 This is an application scenario diagram of the flow testing method for the high-speed port of the switch provided in the embodiment of the present application. Figure 1 As shown, in a scenario where a switch and a traffic meter perform a traffic test, at least a control device, a traffic meter, and a switch are involved. The control device can be a computer or other device capable of controlling the traffic meter, but this solution does not impose any restrictions on this. The traffic meter has multiple traffic ports, and the switch includes multiple high-speed ports to be tested. The specific models of the traffic meter and switch, as well as the number of ports, are not specifically limited.
[0056] This application does not limit the specific form of each device.
[0057] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0058] The traffic testing method for a high-speed switch port provided in the present embodiment requires configuration of forwarding rules in the serpentine traffic ring chain of the switch to be tested. The forwarding rules are used to configure unidirectional coverage for loopback modules and bidirectional coverage for wire and cable media, including optical modules or DACs.
[0059] Specifically, a high-speed port of the switch is connected to the traffic meter, and at least two of the other high-speed ports in the switch are connected to the loopback module, and at least two of the high-speed ports are connected to the optical module or DAC to achieve paired interconnection. The test data packet sent by the traffic meter flows through the high-speed port connected to the traffic meter to the high-speed port connected to the loopback module, and then flows out from the high-speed port connected to the loopback module to the paired high-speed port connected to the optical module or DAC, and then flows out from the paired high-speed port connected to the optical module or DAC to another high-speed port connected to the loopback module, and after flowing out through the high-speed port connected to the loopback module, it flows back to the paired high-speed port connected to the optical module or DAC, and finally flows back from the paired high-speed port connected to the optical module or DAC to the high-speed port connected to the traffic meter, and then flows back to the traffic meter from the high-speed port connected to the traffic meter.
[0060] Figure 2 The flow chart of the embodiment 1 of the flow test method for the high-speed port of the switch provided in the embodiment of the present application, wherein the switch to be tested includes multiple high-speed ports, and the multiple high-speed ports are configured as a serpentine flow ring chain. The specific configuration of the forwarding rules is similar to the implementation principle and technical effect of the forwarding rules mentioned above, and will not be repeated here. Figure 2 As shown, the specific steps include:
[0061] S101: Send a test data packet to the switch to be tested through a flow meter, and start timing to obtain a timing duration.
[0062] In the specific implementation of this step, when the high-speed port of the switch to be tested needs to be tested, the flow meter is controlled by the control device to send a test data packet to the switch to be tested, so that the test data packet is transmitted in each port of the switch. The specific transmission includes:
[0063] According to the above forwarding rules, after the high-speed port of the switch to be tested is configured, the test data packet sent by the traffic meter flows through the high-speed port connected to the traffic meter to the high-speed port of the access loopback module, and then flows out from the high-speed port of the access loopback module to the paired high-speed port of the access optical module or DAC, and then flows out from the paired high-speed port of the access optical module or DAC to another high-speed port of the access loopback module, and after flowing out through the high-speed port of the access loopback module, it flows back to the paired high-speed port of the access optical module or DAC, and finally flows back from the paired high-speed port of the access optical module or DAC to the high-speed port connected to the traffic meter, and then flows back to the traffic meter from the high-speed port connected to the traffic meter.
[0064] Since the test process needs to last for a certain period of time and ultimately needs to be compared based on the data packets sent to the switch to be tested and the data packets finally output, the end time needs to be determined based on the specific test duration. Therefore, when the flow meter starts sending test data packets to the switch to be tested, the timer is started to count and the timing duration is obtained.
[0065] S102: When the timing duration reaches the preset test duration, the flow meter is controlled to stop sending the test data packet.
[0066] In the specific implementation of this step, the test time required to complete the test of all ports of the switch to be tested is obtained according to the number of high-speed ports of the switch to be tested, and this test time is pre-set in the control device. The control device starts timing according to the pre-set test time. During the specific test process, the timing time is dynamically compared with the pre-set predicted time. When the timing time reaches the pre-set test time, the flow meter is controlled to stop sending test data packets.
[0067] S103: Determine whether packet loss occurs in the switch to be tested based on the test data packet sent by the traffic meter and the data packet output by the switch to be tested.
[0068] In this step, after the traffic meter stops sending data packets, the test data packets sent by the traffic meter and the data packets output by the switch to be tested are obtained, and the test data packets sent by the traffic meter are compared with the data packets output by the switch to be tested to determine whether the switch to be tested has lost packets.
[0069] In one specific embodiment, after the ping meter stops sending data packets, the test ends, the ping meter displays test result information, and obtains data packets output by the switch under test. Based on the test data packets sent by the ping meter, it is determined whether the data packets output by the switch under test are the same as the test data packets sent by the ping meter. If the data packets output by the switch under test are the same as the test data packets sent by the ping meter, it is determined that the high-speed port of the switch is normal. If the data packets output by the switch under test are different from the test data packets sent by the ping meter, it is determined that packet loss has occurred. The specific location of the packet loss in the serpentine flow ring chain can be determined based on the test result information displayed on the ping meter and the data packets output by the switch under test.
[0070] This embodiment provides a method for testing high-speed switch ports using traffic. By connecting a mix of loopback modules and cable media modules to multiple high-speed switch ports, a serpentine traffic ring chain is established. This method utilizes only a single packet-sending port on the traffic meter to achieve full coverage of the high-speed ports. This method conserves the traffic meter's port resources, simplifies the testing process, and simultaneously enables traffic testing of switch high-speed ports using a mix of loopback modules and cable media modules.
[0071] In the flow testing method for the high-speed ports of a switch provided in the embodiment of the present application, the rules for establishing a serpentine flow chain are described by taking multiple high-speed ports including port 1, port 2, port 3, port 4, port 5, port 6, port 7, and port 8 as an example, specifically including:
[0072] Port 1 is connected to the flow meter, and ports 2, 3, and 4 are configured with loopback modules.
[0073] Port 5 and port 6 are interconnected through a wire and cable medium, and port 7 and port 8 are interconnected through a wire and cable medium.
[0074] This embodiment provides a method for testing the high-speed ports of a switch. Using multiple high-speed ports (Port 1, Port 2, Port 3, Port 4, Port 5, Port 6, Port 7, and Port 8) as an example, the method specifically illustrates the rules for establishing a serpentine loop chain. This establishment rule allows for the establishment of a serpentine loop chain by intermixing loopback modules and wire and cable media modules across multiple high-speed ports of the switch. This allows for testing traffic using only a single packet-sending port on a traffic analyzer, conserving resources on the traffic analyzer.
[0075] The following uses eight Quad Small Form-factor Pluggable (QSFP) ports on a Linux switch and an external traffic testing instrument as an example to establish a serpentine traffic ring to configure the switch's internal forwarding rules and illustrate the traffic testing method for high-speed switch ports proposed in this application. Figure 3 A schematic diagram of a link showing the specific configuration of a switch high-speed port according to an embodiment of the present application.
[0076] First, connect the switch's QSFP1 port to an external traffic meter. Each of the QSFP2, QSFP3, and QSFP4 ports is connected to a loopback module for self-looping. QSFP5, QSFP6, QSFP7, and QSFP8 ports are interconnected in pairs using optical modules or DACs. QSFP1, QSFP2, QSFP3, QSFP4, QSFP5, QSFP6, QSFP7, and QSFP8 are 100G ports. As shown in the figure, numbered arrows indicate the flow direction of traffic test packets. Solid arrows indicate data forwarded via wire and cable media modules, while dashed arrows indicate data flow directed by the switch configuration for internal forwarding.
[0077] Specifically, the controller controls the external flow meter to make the flow meter send a test data packet to the switch. The test data packet flows into the switch through QSFP1, and then flows into QSFP2 connected to the loopback module. Due to the self-loop effect of the loopback module, the data packet flows out from QSFP2, passes through QSFP3 connected to the loopback module, flows out from QSFP3, and is introduced into the uplink traffic port of QSFP5 interconnected in pairs through optical modules or DACs. It flows from the uplink traffic port of QSFP5 into the downlink traffic port of QSFP6, flows out from the downlink traffic port of QSFP6, and then flows into the uplink traffic port of QSFP7 interconnected in pairs through optical modules or DACs. The test data packet flows from the upstream traffic port of QSFP7 to the downstream traffic port of QSFP8, and then is forwarded to the reserved QSFP4 access loopback module. Through the self-loop function of the loopback module, the test data packet flows out of QSFP4 and flows into the upstream traffic port of QSFP8. Then it flows out from the upstream traffic port of QSFP8 and flows into the downstream traffic port of QSFP7. After passing through the downstream traffic port of QSFP7, it flows into the upstream traffic port of QSFP6, and then flows from the upstream traffic port of QSFP6 to the downstream traffic port of QSFP5. Finally, it flows into QSFP1 through the downstream traffic port of QSFP5 and then flows back to the flow meter.
[0078] The embodiment of the present application provides a specific implementation method for the high-speed port flow testing method of a switch. By configuring the switch with 8 QSFPs, the QSFP1 port of the switch is connected to an external flow meter, and QSFP2, QSFP3, and QSFP4 are each connected to a loopback module to achieve port self-looping. QSFP5 and QSFP6, QSFP7 and QSFP8 are interconnected in pairs through optical modules or DACs. This achieves the establishment of a serpentine flow ring chain and the flow testing of the switch high-speed port by mixing the loopback module and the wire and cable media module.
[0079] Figure 4 The structural diagram of the embodiment 1 of the flow testing device for the high-speed port of the switch provided by the embodiment of the present application is as follows Figure 4 As shown, the switch high-speed port flow testing device 200 includes:
[0080] The sending module 201 is configured to send a test data packet to the switch to be tested via a flow meter.
[0081] The timing module 202 is used to start timing and obtain the timing duration.
[0082] The control module 203 is used to control the flow meter to stop sending the test data packet when the timing duration reaches a preset test duration.
[0083] The processing module 204 is configured to determine whether packet loss occurs in the switch to be tested based on the test data packet sent by the traffic meter and the data packet output by the switch to be tested.
[0084] The configuration module 205 is used to configure the forwarding rules in the serpentine flow ring chain in the switch to be tested. The forwarding rules are used to configure the unidirectional coverage of the loopback module and the bidirectional coverage of the optical module or high-speed cable DAC.
[0085] The switch to be tested includes multiple high-speed ports, which are configured as a serpentine flow ring chain. One of the multiple high-speed ports is connected to a flow meter, and the other high-speed ports include: paired ports connected through wire and cable media and ports configured with loopback modules.
[0086] In the switch high-speed port flow testing device provided in the embodiment of the present application, the wire and cable media include an optical module or a DAC. In the switch high-speed port flow testing device provided in the embodiment of the present application, the multiple high-speed ports include port 1, port 2, port 3, port 4, port 5, port 6, port 7, and port 8.
[0087] Port 1 is connected to the flow meter, and ports 2, 3, and 4 are configured with loopback modules.
[0088] Port 5 and port 6 are interconnected through a wire and cable medium, and port 7 and port 8 are interconnected through a wire and cable medium.
[0089] Figure 5 A schematic diagram of a control device structure provided in an embodiment of the present application is shown as follows: Figure 5 The control device 300 shown includes:
[0090] The memory 301 is used to store computer instructions.
[0091] The controller 302 is used to control the flow meter to send a test data packet and to control the flow meter to stop sending the test data packet.
[0092] The processor 303 is configured to execute computer instructions stored in the memory, so that the control device executes the technical solution of any of the aforementioned method embodiments.
[0093] An embodiment of the present application further provides a storage medium storing a computer program. When the computer program is executed, the technical solution of any of the aforementioned method embodiments is implemented.
[0094] An embodiment of the present application further provides a switch, comprising: a plurality of high-speed ports configured as a serpentine flow ring chain.
[0095] Among them, one high-speed port among the multiple high-speed ports is used to connect to the flow meter, and the other high-speed ports include paired ports connected through optical modules or DACs and ports configured with loopback modules.
[0096] The loopback module is configured for unidirectional overlay forwarding, and the optical module or DAC is configured for bidirectional overlay forwarding.
[0097] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0098] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for testing traffic on a high-speed port of a switch, characterized in that: The switch to be tested includes a plurality of high-speed ports, wherein the plurality of high-speed ports are configured as a serpentine flow ring chain; the method includes: Configuring forwarding rules in the serpentine flow ring chain in the switch to be tested, wherein the forwarding rules are used to configure unidirectional coverage of loopback modules and bidirectional coverage of wire and cable media; Send a test data packet to the switch to be tested and start timing to obtain the timing duration; When the timing duration reaches the preset test duration, stop sending the test data packet; Determining whether packet loss occurs in the switch to be tested based on the sent test data packet and the data packet output by the switch to be tested; Among them, one of the plurality of high-speed ports is connected to a flow meter, and the other high-speed ports include: paired ports connected via wire and cable media and ports configured with a loopback module; The plurality of high-speed ports include port 1, port 2, port 3, port 4, port 5, port 6, port 7, and port 8; The port 1 is connected to the flow meter, and the port 2, the port 3 and the port 4 are respectively configured with a loopback module; The port 5 and the port 6 are interconnected via the wire and cable medium, and the port 7 and the port 8 are interconnected via the wire and cable medium; Among them, the test data packet flows into the switch through the port 1, flows into the port 2, flows out from the port 2 and then flows into the port 3, flows out from the port 3 and then flows into the upstream traffic port of the port 5, flows from the upstream traffic port of the port 5 into the downstream traffic port of the port 6, flows out from the downstream traffic port of the port 6, flows into the upstream traffic port of the port 7, flows from the upstream traffic port of the port 7 into the downstream traffic port of the port 8, and then is forwarded to the reserved port 4. The test data packet flows out from the port 4, flows into the upstream traffic port of the port 8, flows out from the upstream traffic port of the port 8, flows into the downstream traffic port of the port 7, passes through the downstream traffic port of the port 7, flows into the upstream traffic port of the port 6, flows from the upstream traffic port of the port 6 into the downstream traffic port of the port 5, flows into the port 1 through the downstream traffic port of the port 5, and then flows back to the flow meter.
2. The method according to claim 1, characterized in that The wire and cable media include optical modules or high-speed cable DACs.
3. A traffic testing device for a high-speed port of a switch, characterized in that: The switch to be tested includes a plurality of high-speed ports, wherein the plurality of high-speed ports are configured as a serpentine flow ring chain; the device includes: A configuration module, configured to configure forwarding rules in the serpentine flow ring chain in the switch to be tested, wherein the forwarding rules are used to configure unidirectional coverage of the loopback module and bidirectional coverage of wire and cable media; The sending module is used to send test data packets to the switch to be tested through the flow meter; Timing module, used to start timing and obtain timing duration; A control module, configured to control the flow meter to stop sending test data packets when the timing duration reaches a preset test duration; a processing module, configured to determine whether packet loss occurs in the switch to be tested based on the test data packet sent by the flow meter and the data packet output by the switch to be tested; Among them, one of the plurality of high-speed ports is connected to a flow meter, and the other high-speed ports include: paired ports connected via wire and cable media and ports configured with a loopback module; The plurality of high-speed ports include port 1, port 2, port 3, port 4, port 5, port 6, port 7, and port 8; The port 1 is connected to the flow meter, and the port 2, the port 3 and the port 4 are respectively configured with a loopback module; The port 5 and the port 6 are interconnected via the wire and cable medium, and the port 7 and the port 8 are interconnected via the wire and cable medium; Among them, the test data packet flows into the switch through the port 1, flows into the port 2, flows out from the port 2 and then flows into the port 3, flows out from the port 3 and then flows into the upstream traffic port of the port 5, flows from the upstream traffic port of the port 5 into the downstream traffic port of the port 6, flows out from the downstream traffic port of the port 6, flows into the upstream traffic port of the port 7, flows from the upstream traffic port of the port 7 into the downstream traffic port of the port 8, and then is forwarded to the reserved port 4. The test data packet flows out from the port 4, flows into the upstream traffic port of the port 8, flows out from the upstream traffic port of the port 8, flows into the downstream traffic port of the port 7, passes through the downstream traffic port of the port 7, flows into the upstream traffic port of the port 6, flows from the upstream traffic port of the port 6 into the downstream traffic port of the port 5, flows into the port 1 through the downstream traffic port of the port 5, and then flows back to the flow meter.
4. The device according to claim 3, characterized in that The wire and cable media include optical modules or high-speed cable DACs.
5. A control device, characterized in that: include: memory, processors, and controllers; The memory stores computer instructions; The processor executes the computer instructions stored in the memory, so that the control device executes the flow testing method for the high-speed port of the switch according to any one of claims 1 to 2.
6. A storage medium, characterized in that The storage medium stores a computer program; When the computer program is executed, the flow testing method for a high-speed port of a switch according to any one of claims 1 to 2 is implemented.
7. A switch, characterized in that: include: Multiple high-speed ports configured as a serpentine flow ring chain; Among them, one high-speed port among the plurality of high-speed ports is used to connect to a flow meter, and the other high-speed ports include paired ports connected through wire and cable media and ports configured with a loopback module; The loopback module is configured for unidirectional coverage forwarding, and the wire and cable media is configured for bidirectional coverage forwarding; The plurality of high-speed ports include port 1, port 2, port 3, port 4, port 5, port 6, port 7, and port 8; The port 1 is connected to the flow meter, and the port 2, the port 3 and the port 4 are respectively configured with a loopback module; The port 5 and the port 6 are interconnected via the wire and cable medium, and the port 7 and the port 8 are interconnected via the wire and cable medium; Among them, the test data packet flows into the switch through the port 1, flows into the port 2, flows out from the port 2 and then flows into the port 3, flows out from the port 3 and then flows into the upstream traffic port of the port 5, flows from the upstream traffic port of the port 5 into the downstream traffic port of the port 6, flows out from the downstream traffic port of the port 6, flows into the upstream traffic port of the port 7, flows from the upstream traffic port of the port 7 into the downstream traffic port of the port 8, and then is forwarded to the reserved port 4. The test data packet flows out from the port 4, flows into the upstream traffic port of the port 8, flows out from the upstream traffic port of the port 8, flows into the downstream traffic port of the port 7, passes through the downstream traffic port of the port 7, flows into the upstream traffic port of the port 6, flows from the upstream traffic port of the port 6 into the downstream traffic port of the port 5, flows into the port 1 through the downstream traffic port of the port 5, and then flows back to the flow meter.
Citation Information
Patent Citations
Linux-based snakelike flow test system and method
CN110191380A