Load balancing test method of switch, electronic equipment, medium and product
By setting loopback and ECMP configuration on the switch, a data transmission link is established, and the load balancing status of the switch is directly determined, which solves the problem of cumbersome testing in the existing technology and improves the testing efficiency and automation.
Patent Information
- Application Number
- CN202411202104.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, the switch load balancing test process is cumbersome and the test efficiency is low. It requires manpower to set up physical connections, which consumes a lot of manpower and material resources.
By setting loopback on the switch port, performing equal-cost multipath ECMP configuration on the traffic inlet and traffic outlet, establishing an ECMP data transmission link, sending test data packets and judging whether the switch is load-balanced based on the number of data packets, without the need for auxiliary testing. Devices and physical connections.
It improves test efficiency and automation, reduces labor and material costs, and realizes efficient automation of switch load balancing testing.
Smart Images

Figure CN118740771A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a load balancing test method, electronic equipment, medium and product of a switch. Background Art
[0002] With the rapid development of communication technology, the throughput and port number of switches have been greatly improved. By performing load balancing tests on switches, we can effectively optimize network resource utilization and improve availability.
[0003] In the prior art, when a load balancing test is performed on a switch, a staff member usually builds a physical link corresponding to the number of switch ports through physical connections, and uses auxiliary test equipment to interconnect with the switch ports to perform the test.
[0004] However, the testing process of the existing technology is cumbersome and the testing efficiency is low. Summary of the invention
[0005] The embodiments of the present application provide a load balancing test method, electronic equipment, medium and product of a switch, so as to achieve the technical effect of improving the test efficiency.
[0006] In a first aspect, an embodiment of the present application provides a load balancing test method for a switch, comprising:
[0007] In response to a user operation, determining at least one traffic inlet and multiple traffic outlets from multiple ports of the target switch;
[0008] Performing equal-cost multi-path (ECMP) configuration on the at least one traffic inlet and the multiple traffic outlets to establish an ECMP data transmission link;
[0009] Sending a preset number of test data packets to the at least one traffic inlet, wherein the test data packets are load balanced to the multiple traffic outlets through the ECMP data transmission link;
[0010] Reading a first number of the test data packets passed from the at least one traffic inlet, and reading a second number of the test data packets passed from the plurality of traffic outlets;
[0011] According to the first number and the second number, it is determined whether the target switch is load balanced. If so, the load balancing test of the target switch passes.
[0012] In a possible implementation manner, before determining at least one traffic inlet and the multiple traffic outlets from the multiple ports of the target switch, the method further includes:
[0013] Perform loopback self-loop settings on multiple ports of the target switch.
[0014] In a possible implementation, performing equal cost multi-path ECMP configuration on the at least one traffic inlet and the multiple traffic outlets to establish an ECMP data transmission link includes:
[0015] Enabling L3 forwarding function for the at least one traffic inlet configuration;
[0016] configuring, for the plurality of traffic egresses, L3 forwarding egress objects corresponding to the L3 forwarding function;
[0017] Adding the L3 forwarding egress objects corresponding to the multiple traffic egresses to a preset equal cost multipath ECMP group;
[0018] Configure routing for the ECMP group and establish the ECMP data transmission link.
[0019] In a possible implementation manner, judging whether the target switch is load balanced according to the first quantity and the second quantity includes:
[0020] For any flow outlet, determining whether a second number corresponding to the flow outlet satisfies a product of a quotient of the first number and the number of flow outlets and a preset error;
[0021] and, determining whether the first quantity satisfies the sum of the second quantities corresponding to each flow outlet;
[0022] If the second number corresponding to any of the traffic outlets satisfies the product of the quotient of the first number and the number of traffic outlets and a preset error, and the first number satisfies the sum of the second numbers corresponding to each traffic outlet, the target switch is load balanced.
[0023] In a possible implementation, it further includes:
[0024] If the second number corresponding to any of the traffic outlets does not satisfy the product of the quotient of the first number and the number of traffic outlets and a preset error, or the first number does not satisfy the sum of the second numbers corresponding to each traffic outlet, the target switch is unbalanced in load.
[0025] In a possible implementation, the test data packet is load balanced to the multiple traffic outlets based on a hash algorithm.
[0026] In a second aspect, an embodiment of the present application provides a load balancing test device for a switch, comprising:
[0027] A determination module, configured to determine at least one flow inlet and multiple flow outlets from multiple ports of a target switch in response to a user operation;
[0028] A processing module, configured to perform an equal-cost multi-path ECMP configuration on the at least one traffic inlet and the multiple traffic outlets, and establish an ECMP data transmission link;
[0029] A sending module, configured to send a preset number of test data packets to the at least one traffic inlet, wherein the test data packets are load balanced to the multiple traffic outlets through the ECMP data transmission link;
[0030] A reading module, configured to read a first number of the test data packets passed through from the at least one traffic inlet, and read a second number of the test data packets passed through from the plurality of traffic outlets;
[0031] The test module is used to determine whether the target switch is load balanced according to the first number and the second number. If so, the load balancing test of the target switch passes.
[0032] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0033] The memory stores computer-executable instructions;
[0034] The processor executes the computer-executable instructions stored in the memory, so that the processor executes various possible implementations of the first aspect as described above.
[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement various possible implementation methods of the first aspect above.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements various possible implementation methods of the first aspect above.
[0037] The load balancing test method, electronic device, medium and product of the switch provided in the embodiment of the present application, by determining at least one traffic inlet and multiple traffic outlets from multiple ports of the target switch, performing equivalent multi-path ECMP configuration on at least one traffic inlet and multiple traffic outlets, establishing an ECMP data transmission link, and sending a preset number of test data packets to at least one traffic inlet, wherein the test data packets are load balanced to multiple traffic outlets through the ECMP data transmission link. A first number of passed test data packets is read from at least one traffic inlet, a second number of passed test data packets is read from multiple traffic outlets, and based on the first number and the second number, it is determined whether the target switch is load balanced, and if so, the load balancing test of the target switch passes. The present application does not require the use of auxiliary test equipment and the establishment of physical connections, and effectively improves the efficiency and automation of the test process by establishing a one-to-many or many-to-many traffic forwarding topology, i.e., an ECMP data transmission link. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] 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.
[0039] Figure 1 A schematic diagram of an existing application scenario provided for this application;
[0040] Figure 2 A schematic diagram of a flow chart of a load balancing test method for a switch provided in an embodiment of the present application;
[0041] Figure 3 A flow diagram of a test data packet provided in an embodiment of the present application;
[0042] Figure 4 A flowchart of a method for determining whether a target switch is load balanced provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of a load balancing test device for a switch provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0045] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0047] In the description of the embodiments of the present application, terms such as "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or component must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be understood as a limitation on the present application.
[0048] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0049] With the rapid development of communication technology and artificial intelligence (AI) technology, switches have greatly improved in throughput and port number. Switches connect multiple devices to achieve high-speed and efficient transmission of data packets between devices. In order to improve the stable operation of switches under high load conditions and reduce the overload of a single resource, it is usually necessary to perform load balancing tests on switches.
[0050] At present, when performing load balancing tests on switches, technicians usually test the load balancing of switches based on the number of switch ports. Assuming that the port configuration of the switch is 128×400G, technicians need to build 128 physical links between the auxiliary test equipment and the switch through physical connections to achieve interconnection. At the same time, complex network paths need to be configured at the connection end for testing.
[0051] For example, Figure 1 A schematic diagram of an existing application scenario provided for this application, such as Figure 1 As shown, the device 101 sends a data packet to the target device 103 through the switch 102 . When performing a load balancing test on the switch 102 , it is necessary to physically connect the auxiliary test device 104 between the ports of the switch 102 .
[0052] However, the current testing method requires manpower to perform physical connections, which is a cumbersome and time-consuming process, resulting in low testing efficiency and a high consumption of manpower and material resources.
[0053] Therefore, in view of the above technical problems in the prior art, the inventors found in the research process that by using the Equal Cost Multi-path (ECMP) technology, loopback self-loop is set for the port of the switch, and the traffic inlet and traffic outlet of the switch are configured with ECMP, an ECMP data transmission link is established, and the number of data packets at the traffic inlet and traffic outlet is counted through the transmission link, and whether the switch is load balanced can be determined based on the counting result. If the switch is load balanced, it means that the load balancing test of the switch has passed. Based on this, the present application proposes a load balancing test method, electronic device, medium and product for a switch.
[0054] The method of the present application does not require auxiliary test equipment, nor does it require a physical connection between the auxiliary test equipment and the switch; a single machine can perform the test, thereby improving the efficiency and automation of the test process and reducing manpower and material resources.
[0055] It is understandable that the application scenario of the present application may be a scenario in which a switch manufacturer verifies the load balancing capability of a switch.
[0056] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. 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.
[0057] Figure 2 The present invention provides a flow chart of a load balancing test method for a switch. The execution subject of the method can be a terminal with a load balancing test function for a switch, for example, a personal computer, a laptop, a smart phone, a tablet computer, a portable wearable device, a server or a server cluster, etc. The method in the present embodiment can be implemented by software, hardware or a combination of software and hardware. Figure 2 As shown, the method may include the following steps:
[0058] S201. In response to a user operation, determine at least one traffic inlet and multiple traffic outlets from multiple ports of a target switch.
[0059] In this embodiment, there is no limit on the number of ports of the target switch, which can be determined according to actual application conditions and the like.
[0060] Assuming that there are N ports in the target switch, the N ports can be numbered, for example, they can be numbered as P0~Pn-1, and all the ports are set to loopback to ensure that all the ports are in the linkup state.
[0061] By setting the loopback self-loop, the port is always in the "up" state, which can open the port's Tx and Rx traffic channel capabilities. The loopback self-loop can be a mac self-loop or a phy self-loop.
[0062] In this embodiment, in addition to performing loopback software settings on the port, a physical loopback head or a high-speed cable may be directly inserted into the port. For example, the high-speed cable may be a direct attach cable (DAC).
[0063] Users can determine the traffic ingress port and traffic egress port from N ports according to test requirements.
[0064] Exemplarily, the P0 port may be determined as the traffic inlet, and the remaining P1 to Pn-1 ports may be determined as the traffic outlets, or the P0 to P1 ports may be determined as the traffic inlet, and the remaining P2 to Pn-1 ports may be determined as the traffic outlets.
[0065] It can be understood that in this embodiment, there is no limitation on the number of determined flow inlets and the specific number of flow outlets.
[0066] S202: Perform ECMP configuration on at least one traffic inlet and multiple traffic outlets to establish an ECMP data transmission link.
[0067] One possible implementation is:
[0068] Enable the L3 forwarding function for at least one traffic inlet, configure L3 forwarding export objects corresponding to the L3 forwarding function for multiple traffic outlets, and then add the L3 forwarding export objects corresponding to the multiple traffic outlets to a preset equal-cost multi-path ECMP group, configure routing for the ECMP group, and establish a one-to-many or many-to-many ECMP data transmission link.
[0069] In this embodiment, it is assumed that the traffic inlet is P0 and the traffic outlet is P1~Pn-1. The L3 forwarding function is enabled for port P0 so that port P0 can complete the forwarding function. The corresponding L3 forwarding egress object (L3 egressobject) is configured for ports P1~Pn-1 so that ports P1~Pn-1 can complete the routing selection corresponding to port P0. The L3 forwarding egress object of the traffic outlet is added to the ECMP group to form routes with the same path cost. These routes can be used to forward data packets at the same time to achieve load balancing. By configuring routes for the ECMP group, the next hop of data transmission can be set to the ECMP group, thereby establishing a one-to-many ECMP data transmission link.
[0070] S203. Send a preset number of test data packets to at least one traffic inlet, and the test data packets are load balanced to multiple traffic outlets through the ECMP data transmission link.
[0071] In this embodiment, the type of the test data packet is not limited, and it can be determined according to the specific application scenario. For example, the type can be an SMAC message, a Vlan message, an L4 Port message, etc.
[0072] It should be noted that the number of test data packets sent must be greater than the number of traffic outlets, so that the test data packets can be sent to multiple traffic outlets and multiple traffic outlets can be tested.
[0073] The test data packet is directed to the traffic inlet determined in S201 through a central controller (CPU) and the like, and is sent through the traffic inlet. Since a self-loop has been set for the traffic inlet, the test data packet flows into the receiving end Rx of the traffic inlet again through the self-loop of the traffic inlet. Since the traffic inlet configuration enables the L3 forwarding function, the test data packet goes through the forwarding process, and according to the ECMP data transmission link established in S202, its next forwarding hop is the ECMP group including all traffic outlets, wherein the test data packet is load balanced to multiple traffic outlets based on a preset hash algorithm, and therefore, the test data packet can flow out from the sending end Tx of each traffic outlet.
[0074] For example, Figure 3 A flow diagram of a test data packet provided in an embodiment of the present application, such as Figure 3 As shown:
[0075] Among them, the traffic inlet is port P0, and the traffic outlet is P1~Pn-1. The test data packet is sent by port P0, and the test data packet flows into the receiving end Rx of port P0 again through the self-loop of port P0. Since the test data packet passes through the L3 forwarding function enabled by port P0 configuration and the established ECMP data transmission link, the test data packet is forwarded to the traffic outlet P1~Pn-1, so that the sending end Tx of P1~Pn-1 can obtain the outgoing test data packet.
[0076] S204. Read a first number of test data packets that pass through from at least one traffic inlet, and read a second number of test data packets that pass through from multiple traffic outlets.
[0077] A first number RPOK of the passed test data packets is read from a receiving end Rx of each traffic inlet, and a second number TPOK of the passed test data packets is read from a transmitting end Tx of each traffic outlet.
[0078] S205. Determine whether the target switch is load balanced according to the first quantity and the second quantity. If so, the load balancing test of the target switch passes.
[0079] Then, based on the obtained first quantity and second quantity, it is judged whether the target switch is load balanced. If the load is balanced, the test passes; otherwise, the test fails.
[0080] In the above-mentioned embodiment of the present application, at least one traffic inlet and multiple traffic outlets are determined from multiple ports of the target switch, and an equivalent multi-path ECMP configuration is performed on the at least one traffic inlet and the multiple traffic outlets, an ECMP data transmission link is established, and a preset number of test data packets are sent to at least one traffic inlet, wherein the test data packets are load balanced to multiple traffic outlets through the ECMP data transmission link. A first number of passed test data packets is read from at least one traffic inlet, and a second number of passed test data packets is read from multiple traffic outlets, and based on the first number and the second number, it is determined whether the target switch is load balanced, and if so, the load balancing test of the target switch passes. The method of this embodiment does not require the use of auxiliary test equipment and the establishment of physical connections, which effectively improves the efficiency and automation of the test process.
[0081] Further, based on the above embodiment, the following embodiment describes a process of determining whether the target switch is load balanced according to the first quantity and the second quantity. Figure 4 A flow chart of a method for determining whether a target switch is load balanced is provided in an embodiment of the present application, such as Figure 4 As shown, the method comprises the following steps:
[0082] S401. For any flow outlet, determine whether a second number corresponding to the flow outlet satisfies the product of a quotient of the first number and the number of flow outlets and a preset error.
[0083] Specifically, it can be judged by the following formula (1):
[0084]
[0085] in, Indicates the number The number of test data packets at the flow exit is the second number; Indicates the error range; Indicates the total number of ports for traffic ingress and egress on the target switch; Indicates the number of traffic inlets; Indicates the number The number of test data packets at the traffic inlet is the first number; Indicated as number Traffic entrance.
[0086] For example, assuming that the total number of traffic inlet and traffic outlet ports of the target switch is 3, where the traffic inlet is port P0 and the traffic outlets are P1 to P2, it is necessary to determine whether the second traffic of P1 and P2 satisfies the following relationship:
[0087]
[0088]
[0089] S402: Determine whether the first quantity satisfies the sum of the second quantities corresponding to each flow outlet.
[0090] Specifically, it can be judged by the following formula (2):
[0091]
[0092] in, Indicates the number The number of test data packets at the flow exit is the second number; Indicated as number The flow export.
[0093] Example 1: Assume that the total number of traffic inlets and traffic outlets of the target switch is 3, where the traffic inlet is port P0 and the traffic outlets are P1~P2. Then, it is necessary to determine whether the first number of the traffic inlet P0 satisfies the sum of the second numbers corresponding to the traffic outlets P1 and P2:
[0094]
[0095] Example 2: Assume that the total number of traffic inlets and traffic outlets of the target switch is 4, where the traffic inlets are ports P0 and P4, and the traffic outlets are P1 to P2. Then, it is necessary to determine whether the first number of traffic inlets P0 and P4 satisfies the sum of the second numbers corresponding to the traffic outlets P1 and P2:
[0096]
[0097] In this embodiment, the execution order of steps S401 and S402 is not limited. Step S401 may be executed first, or step S402 may be executed first, or steps S401 and S402 may be executed simultaneously.
[0098] S403: If the second number corresponding to any traffic outlet satisfies the product of the quotient of the first number and the number of traffic outlets and a preset error, and the first number satisfies the sum of the second numbers corresponding to each traffic outlet, the target switch is load balanced.
[0099] If steps S401 and S402 are satisfied at the same time, the target switch is load balanced and the load test passes.
[0100] S404: If the second number corresponding to any traffic outlet does not satisfy the product of the quotient of the first number and the number of traffic outlets and a preset error, or the first number does not satisfy the sum of the second numbers corresponding to each traffic outlet, the target switch is unbalanced in load.
[0101] If any one of steps S401 and S402 is not satisfied, the target switch is unbalanced in load and the load test fails.
[0102] In the above-mentioned embodiment of the present application, for any flow outlet, it is determined whether the second quantity corresponding to the flow outlet satisfies the product between the quotient of the first quantity and the number of flow outlets and the preset error, and it is determined whether the first quantity satisfies the sum of the second quantities corresponding to each flow outlet. If the second quantity corresponding to any flow outlet satisfies the product between the quotient of the first quantity and the number of flow outlets and the preset error, and the first quantity satisfies the sum of the second quantities corresponding to each flow outlet, the target switch is load balanced, otherwise, the load is unbalanced. The method of this embodiment performs a load balancing test on the switch by counting and judging the test data packets flowing into the flow inlet and out of the flow outlet, thereby improving the test efficiency.
[0103] Figure 5 A schematic diagram of a load balancing test device for a switch provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the load balancing test device of the switch provided in this embodiment includes:
[0104] The determination module 501 is used to determine at least one traffic inlet and multiple traffic outlets from multiple ports of the target switch in response to a user operation.
[0105] The processing module 502 is used to perform equal cost multi-path ECMP configuration on at least one traffic inlet and multiple traffic outlets to establish an ECMP data transmission link.
[0106] The sending module 503 is used to send a preset number of test data packets to at least one traffic inlet, and the test data packets are load balanced to multiple traffic outlets through the ECMP data transmission link.
[0107] The reading module 504 is used to read a first number of test data packets that pass through from at least one traffic inlet, and read a second number of test data packets that pass through from multiple traffic outlets.
[0108] The test module 505 is used to determine whether the target switch is load balanced according to the first number and the second number. If so, the load balancing test of the target switch passes.
[0109] In a possible implementation, before determining at least one traffic inlet and multiple traffic outlets from multiple ports of the target switch, the processing module 502 is further configured to perform loopback self-loop settings on multiple ports of the target switch.
[0110] In a possible implementation, the processing module 502 is further configured to:
[0111] Enable L3 forwarding for at least one traffic ingress.
[0112] An L3 forwarding export object corresponding to the L3 forwarding function is configured for multiple traffic exports.
[0113] Add L3 forwarding egress objects corresponding to multiple traffic egresses to the preset equal-cost multipath ECMP group.
[0114] Configure routing for the ECMP group and establish an ECMP data transmission link.
[0115] In a possible implementation, the testing module 505 is further configured to:
[0116] For any flow outlet, it is determined whether the second number corresponding to the flow outlet satisfies the product of the quotient of the first number and the number of flow outlets and the preset error.
[0117] And, it is determined whether the first quantity satisfies the sum of the second quantities corresponding to each flow outlet.
[0118] If the second number corresponding to any traffic outlet satisfies the product of the quotient of the first number and the number of traffic outlets and the preset error, and the first number satisfies the sum of the second numbers corresponding to each traffic outlet, the target switch is load balanced.
[0119] In a possible implementation, the testing module 505 is further configured to:
[0120] If the second number corresponding to any traffic outlet does not satisfy the product of the quotient of the first number and the number of traffic outlets and the preset error, or the first number does not satisfy the sum of the second numbers corresponding to each traffic outlet, the target switch is unbalanced in load.
[0121] The load balancing test of the switch provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
[0122] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes: at least one processor 601 and a memory 602. Optionally, the device 60 also includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected via a bus.
[0123] In a specific implementation process, at least one processor 601 executes the computer execution instructions stored in the memory 602, so that at least one processor 601 executes the above method.
[0124] The specific implementation process of the processor 601 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0125] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.
[0126] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0127] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0128] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0129] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0130] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. The readable storage medium may also be a component of the processor. The processor and the readable storage medium may be located in an application specific integrated circuit (ASIC). The processor and the readable storage medium may also exist in a device as discrete components.
[0131] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0134] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, 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. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0135] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0136] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0137] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A load balancing test method for a switch, It is characterized in that include: In response to a user operation, determining at least one traffic inlet and multiple traffic outlets from multiple ports of the target switch; Performing equal-cost multi-path ECMP configuration on the at least one traffic inlet and the multiple traffic outlets to establish an ECMP data transmission link; Sending a preset number of test data packets to the at least one traffic inlet, wherein the test data packets are load balanced to the multiple traffic outlets through the ECMP data transmission link; Reading a first number of the test data packets passed from the at least one traffic inlet, and reading a second number of the test data packets passed from the plurality of traffic outlets; According to the first number and the second number, it is determined whether the target switch is load balanced. If so, the load balancing test of the target switch passes.
2. The method according to claim 1, It is characterized in that Before determining at least one traffic inlet and the multiple traffic outlets from the multiple ports of the target switch, the method further includes: Perform loopback self-loop settings on multiple ports of the target switch.
3. The method according to claim 2, It is characterized in that The performing equal-cost multi-path ECMP configuration on the at least one traffic inlet and the multiple traffic outlets to establish an ECMP data transmission link includes: Enabling L3 forwarding function for the at least one traffic inlet configuration; configuring, for the plurality of traffic egresses, L3 forwarding egress objects corresponding to the L3 forwarding function; Adding the L3 forwarding egress objects corresponding to the multiple traffic egresses to a preset equal cost multipath ECMP group; Configure routing for the ECMP group and establish the ECMP data transmission link.
4. The method according to claim 3, It is characterized in that The determining, according to the first quantity and the second quantity, whether the target switch is load balanced includes: For any flow outlet, determining whether a second number corresponding to the flow outlet satisfies a product of a quotient of the first number and the number of flow outlets and a preset error; and, determining whether the first quantity satisfies the sum of the second quantities corresponding to each flow outlet; If the second number corresponding to any of the traffic outlets satisfies the product of the quotient of the first number and the number of traffic outlets and a preset error, and the first number satisfies the sum of the second numbers corresponding to each traffic outlet, the target switch is load balanced.
5. The method according to claim 4, It is characterized in that Also includes: If the second number corresponding to any of the traffic outlets does not satisfy the product of the quotient of the first number and the number of traffic outlets and a preset error, or the first number does not satisfy the sum of the second numbers corresponding to each traffic outlet, the target switch is unbalanced in load.
6. The method according to any one of claims 1 to 5, It is characterized in that The test data packets are load balanced to the multiple traffic outlets based on a hash algorithm.
7. A load balancing test device for a switch, It is characterized in that include: A determination module, configured to determine at least one flow inlet and multiple flow outlets from multiple ports of a target switch in response to a user operation; A processing module, configured to perform an equal-cost multi-path ECMP configuration on the at least one traffic inlet and the multiple traffic outlets, and establish an ECMP data transmission link; A sending module, configured to send a preset number of test data packets to the at least one traffic inlet, wherein the test data packets are load balanced to the multiple traffic outlets through the ECMP data transmission link; A reading module, configured to read a first number of the test data packets passed through from the at least one traffic inlet, and read a second number of the test data packets passed through from the plurality of traffic outlets; The test module is used to determine whether the target switch is load balanced according to the first number and the second number. If so, the load balancing test of the target switch passes.
8. An electronic device, It is characterized in that include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product, It is characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.
Citation Information
Cited By
Point-to-point load balancing method and device, equipment, storage medium and program product
CN120602415A
