Testing device and testing method of network switch
By designing a network switch testing device including a central processing unit, an acceleration port and a transmission port, using a virtual LAN and flooding mechanism to make the packet reach a predetermined line speed, the problems of test accuracy and efficiency in the prior art are solved, and efficient and economical network switch testing is achieved.
Patent Information
- Application Number
- CN202311703635.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2025-06-13
AI Technical Summary
The prior art is difficult to improve accuracy when testing network switches, reduce test time and cost, and cannot meet the requirements of external network performance testing equipment in the industry.
A test device for a network switch is designed, including a central processing unit, a first acceleration port, a second acceleration port and at least one transmission port. By setting these ports as the same virtual local area network, the packet reaches a predetermined line speed using an internal loopback and flooding mechanism, and the network switch to be tested is connected through the transmission port.
It realizes efficient and accurate testing of network switch transmission speed, reduces test time and cost, and supports synchronous testing of multiple network switches, meeting the industry's testing requirements.
Smart Images

Figure CN120151257A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a test device and a test method, and particularly to a test device and a test method for a network switch. Background Art
[0002] In the process of manufacturing a network switch, it is necessary to test its packet forwarding function. With the substantial increase in the requirement for network transmission data speed, testing the network switch also needs to support high-speed data transmission speed. Currently, the tests in the industry include Loopback test, Saturation test, Line rate test, Line rate unicast test, Snake test, and External test.
[0003] The Loopback test enables the Central Processing Unit (CPU) of the network switch under test to send / receive a specific packet format through its own transmission port, and then the CPU verifies the packet content. On the one hand, the Loopback test can check the packet transmission path, and on the other hand, it can check whether the direct memory access (DMA) transmission from the Media Access Control (MAC) to the CPU is normal. Its disadvantage is that the CPU has to generate packets and verify the packet content at the same time, resulting in the inability to increase the packet transmission rate.
[0004] The Saturation test places all the ports of the network switch under test in the same Virtual Local Area Network (VLAN), and then the network switch under test broadcasts packets of different sizes until the network switch under test is close to the line full-load state, preliminarily checks the packets, waits for a predetermined detection time, and then checks whether error packets are received during the predetermined detection period. The Saturation test is more likely to detect problems that occur only during high-speed transmission, but because the line is filled with packets of different sizes, it is impossible to accurately calculate the network speed.
[0005] Line speed testing sets two transmission ports of the network switch under test to the same VLAN. Through the VLAN mechanism, packets of a fixed length are sent, received, and forwarded in the network switch under test in a broadcast manner until the network switch under test reaches full load. Then, the overall transmission speed is calculated using the number of sent and received packets and the fixed length. However, the memory management unit (MMU) inside the new system on a chip (SoC) has usage limitations for unknown unicast, multicast, and broadcast when allocating limited resources for packet transmission. When the forwarded packets are smaller than a specific length, it will cause the network transmission speed to fail to meet the standard. Therefore, line speed testing cannot use small packets for network speed testing.
[0006] Unicast line speed testing sets two transmission ports of the network switch under test to belong to two different VLANs and each to a port-based VLAN. Through external wiring, L2 table modification, and the VLAN mechanism, unicast packets of a unified length are sent, received, and forwarded in the network switch under test until the packets reach full load in the network switch under test. Then, the overall transmission speed is calculated using the number of sent and received packets and the fixed length. Unicast line speed testing can solve the problem that the network transmission speed standard cannot be reached when forwarding multicast packets smaller than a specific length in line speed testing, but it does not meet the requirements of the industry for testing with external network performance testing equipment.
[0007] The serpentine test connects all the transmission ports of the network switch under test in series, causing the packets to be forwarded from the first transmission port all the way to the last transmission port. Since the serpentine test also requires the CPU of the network switch under test to generate and check the packets, it is impossible to generate enough packet quantities to reach the full line speed under the limitation of the CPU.
[0008] External testing is set the same as the serpentine test. Through an external network performance testing device, packets are sent and received and the overall transmission speed is calculated. Although external testing can reach the full line speed and verify the VLAN function, the prices of network performance testing devices on the market (such as Spirent Test Center, IXIA, etc.) are very expensive and there are subsequent maintenance costs, which do not meet the production cost - effectiveness. In addition, the number of transmission ports of commercially available network performance testing devices is small, and multiple network switches under test cannot be tested simultaneously, resulting in an extended test time and increased expenditure costs.
[0009] Therefore, how to improve the accuracy of testing network switches, reduce the time and cost of testing high-speed network switches, and meet the industry's requirements for testing with external network performance testing equipment is the main purpose of developing this application. Summary of the invention
[0010] One purpose of the present application is to provide a test device for a network switch, the test device comprising a central processing unit, a first acceleration port, a second acceleration port and at least one transmission port. The central processing unit is used to generate at least one packet. The first acceleration port clears packet statistics, stops media access control address learning (MAC AddressLearning), and turns on internal loopback (Internal Loopback). The second acceleration port clears packet statistics, stops media access control address learning, and turns on internal loopback. The transmission port clears packet statistics and forwarding list (ForwardingList), stops media access control address learning, and connects to at least one transmission port to be tested of at least one network switch to be tested. The first acceleration port, the second acceleration port and the transmission port are set to the same virtual local area network, and the central processing unit transmits the packet to the first acceleration port; the first acceleration port and the second acceleration port make the packet reach a predetermined line rate (Line Rate) and transmit it to the transmission port through internal loopback and the flooding mechanism (Flooding) of the virtual local area network; the transmission port transmits the packet reaching the predetermined line rate to the transmission port to be tested of the network switch to be tested; the central processing unit stops the transmission port from transmitting the packet when the test time expires.
[0011] Optionally, the testing device is a network switch that has been verified to comply with the predetermined line speed.
[0012] Optionally, the packet may specify a source address (Source Address), a destination address (DestinationAddress), an Ethernet type (Ethernet Type), packet data (Packet Data), a packet size (PacketSize), and a tagged or untagged packet (Tag / Untag Packet).
[0013] Optionally, the number of the transmission ports is plural, the number of the network switches to be tested is plural, and different transmission ports can be set to the same or different predetermined line speeds to simultaneously transmit the packets to the transmission ports to be tested of different network switches to be tested.
[0014] Optionally, the central processing unit stops the plurality of transmission ports from transmitting the packet by clearing a forwarding list of the first acceleration port.
[0015] Another object of the present application is to provide a testing method for a network switch. The testing method includes: providing a testing device and at least one network switch to be tested, wherein the testing device includes a central processing unit and a plurality of ports, and the network switch to be tested includes at least one transmission port to be tested; the central processing unit removes the virtual local area network of a plurality of the ports of the testing device, and sets a first acceleration port, a second acceleration port, and at least one transmission port among the plurality of ports; the central processing unit clears the packet statistics of the first acceleration port, the second acceleration port, and the transmission port, and clears the forwarding list of the transmission port; the central processing unit stops the media access control address learning of the first acceleration port, the second acceleration port, and the transmission port; the central processing unit enables the internal loopback of the first acceleration port and the second acceleration port; the central processing unit sets the first acceleration port, the second acceleration port, and the transmission port to the same virtual local area network; the central processing unit transmits at least one packet to the first acceleration port; the first acceleration port and the second acceleration port make the packet reach a predetermined line rate through internal loopback and the flooding mechanism of the virtual local area network and transmit it to the transmission port; the transmission port transmits the packet that reaches the predetermined line rate to the transmission port to be tested of the network switch to be tested, and the transmission port or the port receives the packet returned by the transmission port to be tested; the central processing unit stops the transmission port from transmitting the packet when a test time expires; and the quality of the packet transmitted by the network switch to be tested is inspected according to the number of the packets transmitted and received by the testing device.
[0016] Optionally, the packet can specify a source address, a destination address, an Ethernet type, packet data, a packet size, and a tagged or untagged packet.
[0017] Optionally, the number of the transmission ports is plural, and the number of the network switches to be tested is plural. Different transmission ports can be set to the same or different predetermined line rates to simultaneously transmit the packets to the transmission ports to be tested of different network switches to be tested.
[0018] Optionally, before the central processing unit transmits the packet to the first acceleration port, the test time is preset by a timer.
[0019] Optionally, the central processing unit stops the transmission port from transmitting the packet by clearing the forwarding list of the first acceleration port.
[0020] To further illustrate the purpose, technical features and effects of the present application, specific embodiments are given below in conjunction with the accompanying drawings for detailed description. However, the accompanying drawings provided are only for reference and illustration, and are not used to limit the present application. Description of the Drawings
[0021] Figure 1 It is a block diagram of a test device for a network switch of the present application;
[0022] Figure 2A It is a schematic diagram of a two-way packet transmission test of a test device for a network switch according to an embodiment of the present application;
[0023] Figure 2B It is a schematic diagram of a one-way packet transmission test of a test device for a network switch according to an embodiment of the present application; and
[0024] Figure 3 It is a flowchart of a test method for a network switch of the present application. Detailed Embodiments
[0025] To make the purpose, technical solutions and advantages of the present application clearer, the following further details the embodiments related to the "test device and test method for network switches" disclosed in the present application in conjunction with specific embodiments and with reference to the accompanying drawings. Those skilled in the art can understand the advantages and effects of the present application from the content disclosed in this specification. The present application can be implemented or applied through other different specific embodiments, and various details in this specification can also be modified and changed based on different viewpoints and applications without departing from the concept of the present application. Additionally, it is stated in advance that the accompanying drawings of the present application are only for simple schematic illustration and are not drawn according to actual dimensions. Although this document can provide examples containing parameters with specific values, it should be understood that the parameters do not necessarily exactly equal the corresponding values, but can be approximated to the corresponding values within an acceptable error tolerance or design constraint. Furthermore, unless clearly indicated or defined in the context, the meanings of "a", "the", and "said" in the present application include plural forms.
[0026] It should be understood that although the terms first, second, etc. may be used herein to describe various components or signals, each of the components or signals should not be limited by the aforementioned terms, which are mainly used to distinguish one component from another component or one signal from another signal. Furthermore, the directional terms mentioned in the subsequent embodiments, such as "up", "down", "front", "back", "left", "right", etc., are only referenced to the directions of the accompanying drawings. Therefore, the directional terms used are used to illustrate and are not used to limit the scope of protection of this application. In addition, the term "or" used herein may include any one or more combinations of the associated listed items depending on the actual situation.
[0027] Furthermore, the terms "substantially" or "approximately" as used in this document may refer to a numerical value or an average value of multiple numerical values within a deviation range for a specific value that can be recognized or determined by those skilled in the art, including certain specific errors that may arise when measuring the specific value due to limitations of the measurement system or equipment. For example, the numerical value referred to substantially may include ±5%, ±3%, ±1%, ±0.5%, ±0.1% or one or more standard deviation ranges of the specific value.
[0028] The present application is a testing device and a testing method for a network switch. Figure 1 The block diagram of the test device of the network switch of the present application is shown in FIG. Figure 1 As shown, the network switch testing device 1 includes: a central processing unit 11, a first acceleration port 12, a second acceleration port 13 and a plurality of transmission ports 14. The central processing unit 11, the first acceleration port 12, the second acceleration port 13 and the plurality of transmission ports 14 are connected via internal lines of the device. The plurality of transmission ports 14 can be connected to a plurality of transmission ports to be tested of at least one network switch to be tested (not shown) via external lines.
[0029] Specifically, the network switch to be tested is, for example, an Ethernet network switch, and the test device 1 of the network switch can select an Ethernet network switch that has been tested and meets a predetermined line speed (for example: 100 Gb / s, 200 Gb / s, 400 Gb / s, 800 Gb / s or higher) and specifications. The test device 1 of the network switch includes a central processing unit 11 and a plurality of ports 10, and stores the software of the Ethernet Traffic Generator (ETG) of this application. Before testing the network switch, the central processing unit 11 performs the following steps: Remove the virtual local area networks of all ports 10, set a first acceleration port 12 and a second acceleration port 13 among the plurality of ports 10, and set some of the remaining ports 10 as transmission ports 14; Set the first acceleration port 12, the second acceleration port 13, and the transmission port 14 into the same virtual local area network V1; Clear the packet statistics of the first acceleration port 12, stop the media access control address learning of the first acceleration port 12, and turn on the internal loopback of the first acceleration port 12; Clear the packet statistics of the second acceleration port 13, stop the media access control address learning of the second acceleration port 13, and turn on the internal loopback of the second acceleration port 13; Clear the packet statistics and forwarding list of the transmission port 14, and stop the media access control address learning of the transmission port 14. Through the ETG software, the central processing unit can set the first acceleration port 12, the second acceleration port 13, and the transmission port 14 as a Traffic Generator.
[0030] When testing the network switch, the central processing unit 11 generates at least one type of packet and transmits the packet to the first acceleration port 12; The first acceleration port 12 and the second acceleration port 13 use the internal loopback and the flooding mechanism of the virtual local area network V1 to make the packet reach a predetermined line speed and transmit it to the transmission port 14. The predetermined line speed can be determined according to the line full speed of the network switch to be tested; The transmission port 14 transmits the packet that reaches the predetermined line speed to the to-be-tested transmission port of the network switch to be tested, and receives the packet returned by the to-be-tested transmission port; The central processing unit 11 stops the transmission port 14 from transmitting packets when the test time expires. By testing the number of packets transmitted and received by the device 1, the quality of the packets transmitted by the network switch to be tested can be inspected, including: whether the number of packets is correct, whether there are incorrect packets, and whether the packet size meets the expectations.
[0031] Figure 2A It is a schematic diagram of a two-way packet transmission test of a test device for a network switch according to an embodiment of this application. As Figure 2AAs shown, the network switch test device 2 includes: a central processing unit (not shown), a first acceleration port 22, a second acceleration port 23, and a plurality of transmission ports 24. The central processing unit, the first acceleration port 22, the second acceleration port 23, and the plurality of transmission ports 24 are connected via internal circuits of the device, and six transmission ports 24 of the plurality of transmission ports 24 are respectively connected to two transmission ports 251 to be tested of the network switch 25 to be tested, two transmission ports 261 to be tested of the network switch 26 to be tested, and two transmission ports 271 to be tested of the network switch 27 to be tested via external circuits 201, 202, 203. The setting method of the first acceleration port 22, the second acceleration port 23, and the transmission port 24 is as follows.
[0032] The network switch test device 2 includes a central processing unit and a plurality of ports, and stores the software of the Ethernet traffic generator (ETG) of the present application. Before testing the network switches 25, 26, and 27, the central processing unit performs the following steps according to the ETG software: remove the virtual local area network of all ports on the network switch test device 2; set the first acceleration port 22 and the second acceleration port 23 in the plurality of ports, and set all or part of the remaining ports as transmission ports 24; connect the first acceleration port 22, the second acceleration port 23 and the transmission ports 251, 261, and 271 to be tested; The six connected transmission ports 24 are set to the same virtual LAN V2; the packet statistics of the first acceleration port 22, the second acceleration port 23 and the six transmission ports 24 connected to the transmission ports 251, 261, and 271 to be tested are cleared, the media access control address learning of the first acceleration port 22, the second acceleration port 23 and the six transmission ports 24 connected to the transmission ports 251, 261, and 271 to be tested is stopped, the internal loopback of the first acceleration port 22 and the second acceleration port 23 is enabled, and the forwarding list of the six transmission ports 24 connected to the transmission ports 251, 261, and 271 to be tested is cleared.
[0033] In this embodiment, the user can generate the same or different packets through the central processing unit, and can also set the predetermined line speed of each transmission port 24 through the central processing unit to synchronously and bidirectionally test the three network switches 25, 26, and 27 to be tested. The packets can be adjusted according to actual needs, such as but not limited to specifying the source address, destination address, Ethernet type, packet data, packet size, and marked or unmarked packets. The predetermined line speed of each transmission port 24 for transmitting packets can be the same or different.
[0034] When testing the network switches 25, 26, and 27 under test, the central processing unit generates a certain number (e.g., single-digit, two-digit, three-digit) of two different types of packets and transmits the two types of packets to the first acceleration port 22. The two types of packets loop back within the first acceleration port 22. Since the first acceleration port 22 and the second acceleration port 23 are set to the same virtual local area network V2, the two types of packets will flood to the second acceleration port 23 after looping back within the first acceleration port 22 and flood to the first acceleration port 22 after looping back within the second acceleration port 23. After the two types of packets loop between the first acceleration port 22 and the second acceleration port 23 for a certain period of time, they reach the predetermined line speed. The predetermined line speed can be determined according to the line full speed of the individual network switches 25, 26, 27 under test. For example, if the set speed of the transmission port 24 connected to the network switches 25 and 26 under test is 400G and the set speed of the transmission port 24 connected to the network switch 27 under test is 100G, the network switches 25 and 26 under test with a line speed of 400G and the network switch 27 under test with a line speed of 100G can be verified simultaneously. Since the six transmission ports 24 connected to the test transmission ports 251, 261, 271 are also set to the virtual local area network V2, the two types of packets in the first acceleration port 22 and the second acceleration port 23 will also flood to the six transmission ports 24 connected to the test transmission ports 251, 261, 271. As a result, the six transmission ports 24 can respectively transmit the two types of packets that have reached the predetermined line speed to the test transmission ports 251, 261, 271. After receiving the packets, the three network switches 25, 26, 27 under test respectively transmit the packets back to the transmission port 24 via the test transmission ports 251, 261, 271.
[0035] Figure 2B It is a schematic diagram of the unidirectional packet transmission test of the network switch test device according to an embodiment of the present application. As Figure 2B shown, the network switch test device 2 includes: a central processing unit (not shown), a first acceleration port 22, a second acceleration port 23, a transmission port 24, and a port 20. The central processing unit, the first acceleration port 22, the second acceleration port 23, the transmission port 24, and the port 20 are connected via the internal lines of the device. The transmission port 24 and the port 20 are respectively connected to the two test transmission ports 251 of the network switch 25 under test, the two test transmission ports 261 of the network switch 26 under test, and the two test transmission ports 271 of the network switch 27 under test via the external lines 201, 202, 203. The setting methods of the first acceleration port 22, the second acceleration port 23, and the transmission port 24 are as described below.
[0036] The test device 2 of the network switch includes a central processing unit and a plurality of ports, and stores the software of the Ethernet traffic generator (ETG) of the present application. Before testing the network switches 25, 26, 27, the central processing unit performs the following steps: Remove the virtual local area network of all ports on the test device 2 of the network switch; Set the first acceleration port 22 and the second acceleration port 23 among the plurality of ports, and set some of the remaining ports as transmission ports 24; Set the first acceleration port 22, the second acceleration port 23 and the transmission port 24 into the same virtual local area network V2, and the unconfigured port 20 is not in the virtual local area network V2 and will not transmit packets to other ports; Clear the packet statistics of the first acceleration port 22, the second acceleration port 23 and the transmission port 24, stop the media access control address learning of the first acceleration port 22, the second acceleration port 23 and the transmission port 24, turn on the internal loopback of the first acceleration port 22 and the second acceleration port 23, and clear the forwarding list of the transmission port 24.
[0037] When testing the network switches 25, 26, 27 to be tested, the central processing unit generates a certain number (for example: single digit, tens digit, hundreds digit) of packets and transmits the packets to the first acceleration port 22. The packets are looped back within the first acceleration port 22. Since the first acceleration port 22 and the second acceleration port 23 are set to the same virtual local area network V2, the packets will flood to the second acceleration port 23 after looping back within the first acceleration port 22 and flood to the first acceleration port 22 after looping back within the second acceleration port 23; After the packets loop between the first acceleration port 22 and the second acceleration port 23 for a certain time, the predetermined line speed is reached. The predetermined line speed can be determined according to the line full speed of the individual network switches 25, 26, 27 to be tested. For example: The set speed of the transmission port 24 connected to the network switches 25, 26 to be tested is 400G, and the set speed of the transmission port 24 connected to the network switch 27 to be tested is 100G. Thus, the network switches 25, 26 to be tested with a line speed of 400G and the network switch 27 to be tested with a line speed of 100G can be verified simultaneously. Since the transmission ports 24 connected to the test transmission ports 251, 261, 271 are also set to the virtual local area network V2, the packets in the first acceleration port 22 and the second acceleration port 23 will also flood to the transmission ports 24 connected to the test transmission ports 251, 261, 271. Thus, the transmission ports 24 can respectively transmit the packets reaching the predetermined line speed to a test transmission port 251, 261, 271; After receiving the packets, the three network switches 25, 26, 27 to be tested respectively transmit the packets back to the port 20 via another test transmission port 251, 261, 271.
[0038] Whether it is a bidirectional or unidirectional packet transmission test, the user can preset or determine the test time in real time. For example, for transmitting packets for 5 minutes, the test time can be preset to 5 minutes, or the user can stop transmitting packets through an instruction when 5 minutes expire. When the test time expires, the forwarding list of the first acceleration port 22 is cleared through the central processing unit, so that the packets stop flooding, and the transmission port 24 stops transmitting packets. After a period of time (for example: 0.2 seconds), the forwarding list of the first acceleration port 22 is restored, waiting for the next test. The user can use an external computer device to connect to the central processing unit of the test device 2, and check the line speed and quality (including: packet loss rate, error rate, etc. of transmitting and receiving packets) of the network switches 25, 26, 27 to be tested according to the number of transmitted and received packets of the transmission port 24 and the test time.
[0039] The test device of the network switch of the present application can transmit specified packets at a predetermined line speed, and the user can adjust the packets according to actual needs, such as but not limited to: specifying different packet data, packet sizes, tagged / untagged packets, improving the test scope and accuracy; the number of ports of existing network switches can reach 32 ports or 48 ports. By using software settings to use the network switch that has passed the inspection and meets the product specifications as the test device, multiple network switches to be tested (up to (N - 2) / 2 ports at most) can be tested synchronously, greatly reducing the test time and test cost, thereby improving the production capacity of the network switch.
[0040] Figure 3 It is a flowchart of the test method of the network switch of the present application. As Figure 3As shown in the figure, the test method for the network switch of the present application includes: Step S30: Provide a test device and at least one network switch to be tested, where the test device includes a central processing unit and a plurality of ports, and the network switch to be tested includes a plurality of transmission ports to be tested; Step S31: The central processing unit removes the virtual local area network of all ports, and sets a first acceleration port, a second acceleration port, and at least one transmission port among the plurality of ports; Step S32: The central processing unit clears the packet statistics of the first acceleration port, the second acceleration port, and the transmission port, and clears the forwarding list of the transmission port; Step S33: The central processing unit stops the media access control address learning of the first acceleration port, the second acceleration port, and the transmission port; Step S34: The central processing unit enables the internal loopback of the first acceleration port and the second acceleration port; Step S35: The central processing unit sets the first acceleration port, the second acceleration port, and the transmission port to the same virtual local area network; Step S36: The central processing unit transmits a packet to the first acceleration port; Step S37: The first acceleration port and the second acceleration port use the internal loopback and the flooding mechanism of the virtual local area network to make the packet reach a predetermined line speed and transmit it to the transmission port; Step S38: The transmission port transmits the packet that reaches the predetermined line speed to the transmission port to be tested of the network switch to be tested, and the transmission port or the port receives the packet returned by the transmission port to be tested; Step S381: Check whether the test time has expired. If not, return to Step S38; if so, enter Step S39: When the test time expires, the central processing unit stops the transmission port from transmitting packets, and checks the packet transmission quality of the network switch to be tested according to the number of packets transmitted and received by the test device.
[0041] Specifically, the network switch to be tested is, for example, an Ethernet switch, and the test device can be an Ethernet switch that has been tested to meet the predetermined line speed (for example: 100 Gb / s, 200 Gb / s, 400 Gb / s, 800 Gb / s or higher) and specifications. The packets can be single or different, and the packets can be adjusted according to actual needs, such as but not limited to: specifying the source address, destination address, Ethernet format, packet data, packet size, and tagged or untagged packets. The predetermined line speed can be set according to the actual needs of individual network switches to be tested, and packets with different predetermined line speeds are sent from different transmission ports to synchronously test multiple network switches to be tested.
[0042] It is worth mentioning that there is no restriction on the order of Steps S32 to S35. Before performing Step S36, the user can use the timer of the central processing unit to default the test time. By providing an option for defaulting the test time, the user can determine the start and stop times and lengths of the test, increasing the test flexibility; in Step S39, the central processing unit can stop the transmission port from transmitting packets by clearing the forwarding list of the first acceleration port; after a certain time (for example: 0.2 seconds) of completing Step S39, the central processing unit can restore the forwarding list of the first acceleration port and wait for the next test.
[0043] In summary, for the test device and test method of the network switch of the present application, the first acceleration port, the second acceleration port, and the transmission port of the test device are set as traffic generators through software. Users can adjust packets according to actual needs, such as but not limited to: specifying different packet data, packet sizes, tagged / untagged packets, and can set different transmission ports to send packets at different predetermined line speeds to synchronously test multiple network switches to be tested, which not only meets the industry's test requirements, but also improves the test scope and accuracy, greatly reduces the test time and test cost, and thus improves the production capacity of the network switch.
[0044] As described above, the above are only the preferred feasible embodiments of the present application, and do not limit the protection scope of the claims of the present application. Therefore, any equivalent changes that can be thought of by those skilled in the art without creative labor based on the technical content disclosed in the present application should be included in the protection scope of the claims of the present application.
Claims
1. A test device for a network switch, It is characterized in that The testing device comprises: A central processing unit, configured to generate at least one packet; - First acceleration port, clear packet statistics, stop media access control address learning, and enable internal loopback; a second acceleration port, clearing packet statistics, stopping media access control address learning, and enabling internal loopback; and At least one transmission port, clears packet statistics and forwarding lists, stops media access control address learning, and connects at least one transmission port to be tested of at least one network switch to be tested; The first acceleration port, the second acceleration port and the transmission port are set to the same virtual local area network, and the central processing unit transmits the packet to the first acceleration port; the first acceleration port and the second acceleration port make the packet reach a predetermined line speed and transmit it to the transmission port through internal loopback and the flooding mechanism of the virtual local area network; the transmission port transmits the packet reaching the predetermined line speed to the transmission port to be tested of the network switch to be tested; the central processing unit stops the transmission port from transmitting the packet when the test time expires.
2. The testing device according to claim 1, It is characterized in that The testing device is a network switch that has been verified to comply with the predetermined line speed.
3. The testing device according to claim 1, It is characterized in that The packet may specify a source address, a destination address, an Ethernet type, packet data, a packet size, and whether the packet is tagged or untagged.
4. The testing device according to claim 1, It is characterized in that The number of the transmission ports is plural, the number of the network switches to be tested is plural, and different transmission ports can be set to the same or different predetermined line speeds to simultaneously transmit the packets to the transmission ports to be tested of different network switches to be tested.
5. The testing device according to claim 1, It is characterized in that The central processing unit stops the plurality of transmission ports from transmitting the packet by clearing the forwarding list of the first acceleration port.
6. A method for testing a network switch, It is characterized in that The test method includes: A test device and at least one network switch to be tested are provided, wherein the test device comprises a central processing unit and a plurality of ports, and the network switch to be tested comprises at least one transmission port to be tested; The central processing unit removes the virtual local area network of the plurality of ports of the test device, and sets a first acceleration port, a second acceleration port and at least one transmission port among the plurality of ports; The central processing unit clears the packet statistics of the first acceleration port, the second acceleration port and the transmission port, and clears the forwarding list of the transmission port; The central processing unit stops the media access control address learning of the first acceleration port, the second acceleration port and the transmission port; The central processing unit enables the internal loopback of the first acceleration port and the second acceleration port; The central processing unit sets the first acceleration port, the second acceleration port and the transmission port to be the same virtual local area network; The central processing unit transmits at least one packet to the first acceleration port; The first acceleration port and the second acceleration port enable the packet to reach a predetermined line speed and be transmitted to the transmission port via internal loopback and the flooding mechanism of the virtual local area network; The transmission port transmits the packet that reaches the predetermined line speed to the to-be-tested transmission port of the to-be-tested network switch, and the transmission port or the port receives the packet returned by the to-be-tested transmission port; The central processing unit stops the transmission port from transmitting the packet when a test time expires; and Examine the quality of the packet transmitted by the to-be-tested network switch according to the number of packets transmitted and received by the test device.
7. The test method according to claim 6, wherein, The packet can specify a source address, a destination address, an Ethernet format, packet data, a packet size, and a tagged or untagged packet.
8. The test method according to claim 6, wherein, The number of the transmission ports is plural, and the number of the to-be-tested network switches is plural. Different transmission ports can be set to the same or different predetermined line speeds to simultaneously transmit the packets to the to-be-tested transmission ports of different to-be-tested network switches.
9. The test method according to claim 6, wherein, Before the central processing unit transmits the packet to the first acceleration port, preset the test time with a timer.
10. The test method according to claim 6, wherein, The central processing unit stops the transmission port from transmitting the packet by clearing the forwarding list of the first acceleration port.
