Load balancing method, device and equipment

By using the state storage table in the load balancing method to determine the forwarding port, the problem of probability path selection polarization of packets in the prior art is solved, and more efficient load balancing and lower delay are achieved.

CN119484413APending Publication Date: 2025-02-18RUIJIE NETWORKS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311017471.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The load balancing method in the prior art can easily lead to probabilistic path selection polarization of packets, resulting in congestion and out-of-order problems.

Method used

When receiving a message, based on the unsequential queue identifier and sequence number of the logical frame to which the message belongs, the status storage table is queried, the forwarding port is determined, and the message is forwarded to the target line card through this port to ensure that all forwarding ports are forwarded at least A logical frame to avoid congestion and idle situations.

Benefits of technology

It reduces the possibility of probabilistic path selection polarization of packets, avoids outdated messages in logical frames, improves load balancing efficiency, and reduces end-to-end forwarding delay in the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484413A_ABST
    Figure CN119484413A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and discloses a load balancing method, device and equipment, which are used for solving the problem that a load balancing method in the related technology is easy to cause message probabilistic routing polarization. In the embodiment of the invention, polling is carried out on a received message on a forwarding port according to a descrambling queue identifier and a serial number of a logic frame to which the message belongs, so that all the forwarding ports at least forward one logic frame, and a corresponding relationship between the logic frame and the forwarding port is recorded in a state storage table; the condition that one forwarding port is congested and the other forwarding port is idle can be avoided, the probability of message probabilistic routing polarization is reduced, and by recording the corresponding relation between the logic frame subjected to load balancing and the forwarding port in the state storage table, the probability of message probabilistic routing polarization is reduced on the premise that the logic frame is subjected to load balancing. The messages in the same logic frame are ensured to be forwarded to the same path, disorder of the messages in the logic frame is avoided, and high load balance of the router is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a load balancing method, device and equipment. Background Art

[0002] The mainstream frame-type equipment in the industry currently mainly adopts the CLOS architecture to forward messages between different line cards. Any upstream line card (IM) reaches any downstream line card (OM) through the forwarding port of the switching network card. Under the relevant technical solution, the messages arriving at the same downstream line card complete the action of grouping logical frames on the upstream line card, and complete the routing of the internal forwarding process of the device on the upstream line card. Since the messages in the same logical frame have the same sequence number, the messages in the same logical frame follow the same forwarding path. In order to ensure that there is no disorder, the downstream line card needs to perform de-sequencing. Multipath load balancing is the cause of the disorder.

[0003] At present, load balancing of logical frames is mainly based on serial numbers. The specific implementation method is: the uplink line card and FE card (switch network card) perform load balancing according to the serial number and the port group that needs load balancing, select the forwarding port, such as polling according to the serial number, and map the load balancing port to achieve multi-path load balancing. However, the above method has the following problems:

[0004] Since the transmission speed of logical frames is different, there is a possibility of probabilistic routing polarization of messages when the logical frames are load balanced. For example, if there are 3 logical frames and 3 forwarding ports, each logical frame will be load balanced during load balancing, that is, the messages in 1 logical frame will be forwarded by 1 forwarding port, which may cause 1 forwarding port to process 3 logical frames at the same time, while the other 2 forwarding ports have no logical frames to process. The congestion caused by polarization may increase the disorder burden of the downstream switching node and increase the demand for de-sequencing buffer, or even cause local message loss.

[0005] It can be seen that the load balancing method in the related art is likely to cause the problem of message probabilistic routing polarization. Summary of the invention

[0006] The purpose of the present application is to provide a load balancing method, device and equipment to solve the problem that the load balancing method in the related art easily leads to the occurrence of probabilistic routing polarization of messages.

[0007] In a first aspect, the present application provides a load balancing method, the method comprising:

[0008] Receive at least one message; for each message, perform the following operations:

[0009] Based on the de-arrangement queue identifier and the sequence number of the logical frame to which the message belongs, querying the state storage table, the state storage table is used to record the corresponding relationship between the logical frame currently subjected to load balancing and the forwarding port;

[0010] If it is determined through query that the logical frame to which the message belongs does not belong to a new logical frame, a first forwarding port corresponding to the logical frame to which the message belongs is determined according to the corresponding relationship, and the message is forwarded to the target line card through the first forwarding port; the new logical frame is a logical frame that is not currently load balanced;

[0011] If it is determined through query that the logical frame to which the message belongs is a new logical frame, each forwarding port in the state storage table is polled to determine a second forwarding port that meets the forwarding conditions of the current message, and the message is forwarded to the target line card through the second forwarding port.

[0012] In a possible implementation, the method further includes:

[0013] After the message is forwarded from the current switching node to the next switching node through the second forwarding port, the corresponding relationship between the new logical frame to which the message belongs and the second forwarding port is stored in the state storage table.

[0014] In a possible implementation manner, the query status storage table includes:

[0015] Based on the de-arrangement queue identifier and the sequence number of the logical frame to which the message belongs, compare the de-arrangement queue identifier and the sequence number of the logical frame currently being load balanced in the state storage table;

[0016] If it is determined that the logical frame to which the message belongs has been load balanced, then determining that the logical frame to which the message belongs does not belong to a new logical frame;

[0017] If it is determined that the logical frame to which the message belongs is not load balanced, it is determined that the logical frame to which the message belongs belongs to a new logical frame.

[0018] In a possible implementation manner, polling each forwarding port in the state storage table to determine a second forwarding port that meets the condition for forwarding the current message includes:

[0019] Determine the previous forwarding port corresponding to the previous load-balanced logical frame of the logical frame to which the current message belongs;

[0020] According to the arrangement order of the forwarding ports, the next forwarding port of the previous forwarding port is used as the second forwarding port.

[0021] In a possible implementation, the method further includes:

[0022] If the next forwarding port of the previous forwarding port is not a forwarding port with a low congestion level, continue to poll the forwarding ports in the status storage table until a forwarding port with a low congestion level is used as the second forwarding port, wherein the forwarding port with a low congestion level is a forwarding port whose cache occupancy level is lower than a preset threshold.

[0023] In a possible implementation, the method further includes:

[0024] If it is determined that multiple messages belonging to the same logical frame are all forwarded from the current switching node to the next switching node, the corresponding relationship between the current logical frame and the forwarding port in the state storage table is deleted.

[0025] In a possible implementation manner, the state storage table corresponds to at least one de-shuffle queue, and the method further includes:

[0026] Determine the state storage capacity of the single de-arrangement queue according to the maximum bandwidth of the single de-arrangement queue, the maximum degree of disorder and the size of the logical frame;

[0027] Determine the overall state storage capacity of the state storage table according to the number of de-shuffling queues included in the state storage table and the state storage capacity of the single de-shuffling queue;

[0028] Based on the overall state storage capacity, the corresponding relationship between the currently load-balanced logical frames and the forwarding ports is stored in the state storage table.

[0029] In a second aspect, the present application provides a load balancing device, applied to a switching network card, the device comprising:

[0030] A message receiving module, configured to receive at least one message;

[0031] A state query module is configured to query a state storage table based on a de-arrangement queue identifier and a sequence number of a logical frame to which the message belongs, wherein the state storage table is used to record a correspondence between a logical frame that has been currently load balanced and a forwarding port;

[0032] The first message forwarding module is configured to determine the first forwarding port corresponding to the logical frame to which the message belongs according to the corresponding relationship if it is determined through query that the logical frame to which the message belongs does not belong to a new logical frame, and forward the message to the target switching node through the first forwarding port; the new logical frame is a logical frame that is not currently load balanced;

[0033] The second message forwarding module is configured to poll each forwarding port in the status storage table if it is determined through query that the logical frame to which the message belongs belongs to a new logical frame, determine the second forwarding port that meets the conditions for forwarding the current message, and forward the message to the target switching node through the second forwarding port.

[0034] In a possible implementation, the device further includes:

[0035] The state updating module is configured to store the correspondence between the new logical frame to which the message belongs and the second forwarding port in the state storage table after forwarding the message from the current switching node to the next switching node through the second forwarding port.

[0036] In a possible implementation, the query status storage table is executed, and the status query module is configured to:

[0037] Based on the de-arrangement queue identifier and the sequence number of the logical frame to which the message belongs, compare the de-arrangement queue identifier and the sequence number of the logical frame currently being load balanced in the state storage table;

[0038] If it is determined that the logical frame to which the message belongs has been load balanced, then determining that the logical frame to which the message belongs does not belong to a new logical frame;

[0039] If it is determined that the logical frame to which the message belongs is not load balanced, it is determined that the logical frame to which the message belongs belongs to a new logical frame.

[0040] In a possible implementation, the polling of each forwarding port in the state storage table is performed to determine a second forwarding port that meets the condition for forwarding the current message, and the second message forwarding module is configured as follows:

[0041] Determine the previous forwarding port corresponding to the previous load-balanced logical frame of the logical frame to which the current message belongs;

[0042] According to the arrangement order of the forwarding ports, the next forwarding port of the previous forwarding port is used as the second forwarding port.

[0043] In a possible implementation manner, the second message forwarding module is further configured to:

[0044] If the next forwarding port of the previous forwarding port is not a forwarding port with a low congestion level, continue to poll the forwarding ports in the status storage table until a forwarding port with a low congestion level is used as the second forwarding port, wherein the forwarding port with a low congestion level is a forwarding port whose cache occupancy level is lower than a preset threshold.

[0045] In a possible implementation, the device further includes:

[0046] The state deletion module is configured to delete the corresponding relationship between the current logical frame and the forwarding port in the state storage table if it is determined that multiple messages belonging to the same logical frame are forwarded from the current switching node to the next switching node.

[0047] In a possible implementation, the state storage table corresponds to at least one de-shuffle queue, and the apparatus further includes a state storage capacity module configured to:

[0048] Determine the state storage capacity of the single de-arrangement queue according to the maximum bandwidth of the single de-arrangement queue, the maximum degree of disorder and the size of the logical frame;

[0049] Determine the overall state storage capacity of the state storage table according to the number of de-shuffling queues included in the state storage table and the state storage capacity of the single de-shuffling queue;

[0050] Based on the overall state storage capacity, the corresponding relationship between the currently load-balanced logical frames and the forwarding ports is stored in the state storage table.

[0051] In a third aspect, the present application provides an electronic device, including:

[0052] Processor and memory;

[0053] The memory is used to store executable instructions of the processor;

[0054] The processor is used to execute the executable instructions to implement the load balancing method as described in the first aspect above.

[0055] In a fourth aspect, the present application provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the load balancing method described in the first aspect above.

[0056] In a fifth aspect, the present application provides a computer program product, including a computer program:

[0057] When the computer program is executed by a processor, the load balancing method as described in the first aspect above is implemented.

[0058] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0059] In an embodiment of the present application, by polling the received message on the forwarding port according to the de-arrangement queue identifier and sequence number of the logical frame to which the message belongs, so that all forwarding ports forward at least one logical frame, and recording the correspondence between the logical frame and the forwarding port in a state storage table, it is possible to avoid the situation where one forwarding port is congested while the other forwarding port is idle, thereby reducing the possibility of probabilistic routing polarization of the message. By recording the correspondence between the load-balanced logical frame and the forwarding port in a state storage table, under the premise of load balancing of the logical frame, it is ensured that the messages in the same logical frame are forwarded to the same path, thereby avoiding the disorder of the messages in the logical frame, satisfying the high load balancing of the router, improving the message forwarding efficiency, reducing the end-to-end forwarding delay within the device, and providing a good foundation for expanding the frame device to a cluster device.

[0060] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0062] Figure 1 A schematic diagram of a load balancing framework provided in an embodiment of the present application;

[0063] Figure 2 A schematic diagram of the overall flow of the load balancing method in the present application provided in an embodiment of the present application;

[0064] Figure 3 A schematic diagram of a process for querying a state storage table provided in an embodiment of the present application;

[0065] Figure 4 A flow chart of storing the correspondence between the currently load-balanced logical frames and forwarding ports through a state storage table provided in an embodiment of the present application;

[0066] Figure 5 A schematic diagram of the structure of a load balancing device 500 provided in an embodiment of the present application.

[0067] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Among them, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0069] Furthermore, in the description of the embodiments of the present application, unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0070] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.

[0071] The mainstream frame-type devices in the industry currently mainly use the CLOS architecture to forward messages between different line cards. Any uplink line card reaches any downlink line card through the switching network card. Figure 1 As shown, the message reaches the downstream line card OM from the upstream line card IM via the switching network card. Based on the mainstream implementation, the traffic of different upstream line cards under the CLOS architecture will form independent de-sequencing queues according to the downstream destination line cards. The messages in the queues are numbered in sequence for de-sequencing at the downstream line cards. De-sequencing is a private implementation of the device, and de-sequencing can also be performed without combining an upstream line card and a downstream line card, such as de-sequencing for VOQ (Virtual Output Queue) and de-sequencing for quintuples.

[0072] The disorder is caused by the multiple paths that are load balanced when the message passes through the switching network. Because the multiple paths are not completely equivalent, the cache status of each forwarding node is different at a certain moment.

[0073] Load balancing and de-ordering are performed according to the numbering of each message. There is load imbalance caused by the large difference in the length of the message. Therefore, load balancing is performed by combining multiple messages into a logical frame of approximately fixed length, which can eliminate the load imbalance. Therefore, a unique serial number is arranged for the entire logical frame, and the forwarding path of the logical frame with the same serial number is consistent in the switching network. There is no disorder inside the logical frame, and the disorder between logical frames is eliminated by the de-ordering module of the downstream line card.

[0074] Under the related technical solution, the messages arriving at the same downlink line card complete the action of grouping logical frames on the uplink line card, and complete the routing of the internal forwarding process of the device on the uplink line card. Since the messages in the same logical frame have the same sequence number, the messages in the same logical frame follow the same forwarding path. In order to ensure that they are not out of order, the downlink line card needs to perform de-ordering. Multipath load balancing is the cause of the disorder.

[0075] At present, load balancing of logical frames is mainly based on serial numbers. The specific implementation method is: the uplink line card and FE card (switch network card) perform load balancing according to the serial number and the port group that needs load balancing, select the forwarding port, such as polling according to the serial number, and map the load balancing port to achieve multi-path load balancing. However, the above method has the following problems:

[0076] In microscopic situations, due to the different transmission speeds of logical frames, there is a possibility of probabilistic routing polarization of messages when the logical frames are load balanced. For example, if there are three logical frames and three forwarding ports, each logical frame will be load balanced during load balancing, that is, the messages in one logical frame will be forwarded by one forwarding port, which may cause one forwarding port to process three logical frames at the same time, while the other two forwarding ports have no logical frames to process. The congestion caused by polarization may increase the out-of-order burden of the downstream line card and increase the demand for de-out-of-order buffering, or even cause local message loss.

[0077] In view of this, the present application provides a load balancing method, apparatus and device to solve the problem that the load balancing method in the related art easily leads to the occurrence of probabilistic routing polarization of messages.

[0078] The inventive concept of the present application can be summarized as follows: by polling the received messages on the forwarding ports according to the de-arrangement queue identifier and sequence number of the logical frame to which the messages belong, so that all forwarding ports forward at least one logical frame, and recording the correspondence between the logical frames and the forwarding ports in the state storage table, it is possible to avoid the situation where one forwarding port is congested while the other forwarding ports are idle, thereby reducing the possibility of probabilistic routing polarization of messages; by recording the correspondence between the load-balanced logical frames and the forwarding ports in the state storage table, under the premise of load balancing of the logical frames, it is ensured that the messages in the same logical frame are forwarded to the same path, thereby avoiding the disorder of the messages in the logical frame, satisfying the high load balancing of the router, improving the message forwarding efficiency, reducing the end-to-end forwarding delay within the device, and providing a good foundation for the expansion of frame devices to cluster devices.

[0079] After introducing the main inventive ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0080] In order to facilitate understanding of the load balancing method provided in the embodiment of the present application, it is further described below with reference to the accompanying drawings.

[0081] In a possible implementation, the present application provides a load balancing method, the process of which is as follows: Figure 2 As shown, including the following:

[0082] In step 201, at least one message is received.

[0083] It should be added that the subject that performs load balancing can be an uplink line card or a switching network card, because the uplink line card needs to forward multiple de-ordered queue messages with "same source card but different destination cards", and the switching network card needs to forward multiple de-ordered queue messages with "different source cards but different destination cards". These queues need to be load balanced at the egress of the uplink line card and the switching network card respectively.

[0084] In step 202, for each message, the following operations are performed:

[0085] Based on the de-arranged queue identifier and the sequence number of the logical frame to which the message belongs, the state storage table is queried, and the state storage table is used to record the corresponding relationship between the logical frame currently subjected to load balancing and the forwarding port.

[0086] It should be noted that the embodiments of the present application can determine the de-arrangement queue to which the logical frame belongs according to the de-arrangement queue identifier of the logical frame to which the message belongs, and distinguish the logical frame to which the message belongs according to the sequence number of the logical frame to which the message belongs. For example, there is an uplink line card, which includes 3 de-arrangement queues, each of which needs to process 3 logical frames, and each logical frame can be recorded as A1, A2 and A3, where A is the de-arrangement queue identifier of the logical frame, and 1, 2, and 3 are the sequence numbers of the logical frames. Based on the de-arrangement queue identifier and sequence number of the above logical frame, the present application can distinguish the messages in the logical frame and avoid disorder.

[0087] In step 203, if it is determined through query that the logical frame to which the message belongs does not belong to a new logical frame, the first forwarding port corresponding to the logical frame to which the message belongs is determined according to the corresponding relationship, and the message is forwarded to the target line card through the first forwarding port; the new logical frame is a logical frame that is not currently load balanced.

[0088] In step 204, if it is determined through query that the logical frame to which the message belongs is a new logical frame, each forwarding port in the state storage table is polled to determine a second forwarding port that meets the forwarding conditions of the current message, and the message is forwarded to the target line card through the second forwarding port.

[0089] In a possible implementation, the state storage table is queried, and the process is as follows: Figure 3 As shown, it can be implemented as:

[0090] In step 301, based on the de-arrangement queue identifier and sequence number of the logical frame to which the message belongs, the de-arrangement queue identifier and sequence number of the logical frame currently undergoing load balancing in the state storage table are compared.

[0091] In step 302, if it is determined that the logical frame to which the message belongs has been load balanced, it is determined that the logical frame to which the message belongs does not belong to a new logical frame.

[0092] In step 303, if it is determined that the logical frame to which the message belongs is not load balanced, it is determined that the logical frame to which the message belongs belongs to a new logical frame.

[0093] For example, the state storage table records the de-arranged queue identifiers and sequence numbers of the logical frames that are currently load balanced as A1, A2, and A3, respectively. If the logical frame to which the currently received message belongs is A1, it is determined that the logical frame to which the message belongs has been load balanced and is not a new logical frame; if the logical frame to which the currently received message belongs is A4, it is determined that the logical frame to which the message belongs has not been load balanced and is a new logical frame.

[0094] It should be noted that the first forwarding port is a forwarding port recorded in the state storage table and corresponding to the load-balanced logical frame, and the second forwarding port is a forwarding port that meets the conditions for forwarding the current message.

[0095] In a possible implementation manner, there are two situations for the second forwarding port that meets the condition of forwarding the current message, and in step 204, each forwarding port in the state storage table is polled to determine the second forwarding port that meets the condition of forwarding the current message, including the following two situations:

[0096] Case 1: determine the previous forwarding port corresponding to the previous load-balanced logical frame of the logical frame to which the current message belongs;

[0097] According to the arrangement order of the forwarding ports, the next forwarding port of the previous forwarding port is used as the second forwarding port.

[0098] Case 2: If the next forwarding port of the previous forwarding port is not a forwarding port with low congestion, continue to poll the forwarding ports in the status storage table until a forwarding port with low congestion is used as the second forwarding port, wherein the forwarding port with low congestion is a forwarding port whose cache occupancy is lower than a preset threshold.

[0099] For example, corresponding to the above situation 1, the state storage table records the following corresponding relationship and the forwarding port that does not forward the message as follows:

[0100] Logical frame A1 and forwarding port 1; logical frame A2 and forwarding port 2; logical frame A3 and forwarding port 3; forwarding port 4; forwarding port 5. If the logical frame to which the currently received message belongs is A1, it is determined that the logical frame to which the message belongs does not belong to a new logical frame, and the first forwarding port corresponding to the logical frame to which the message belongs is determined to be forwarding port 1 according to the corresponding relationship, and the message is forwarded to the target line card through forwarding port 1; if the logical frame to which the currently received message from the uplink line card belongs is A4, it is determined that the logical frame to which the message belongs belongs to a new logical frame, that is, A4 is a logical frame that has not been load balanced, and each forwarding port in the state storage table is polled, and it is determined that the second forwarding port that meets the conditions for forwarding the current message is forwarding port 4, and the message is forwarded to the target line card through forwarding port 4.

[0101] Corresponding to the above situation 2, the state storage table records the following corresponding relationship and the forwarding port that does not forward the message as follows:

[0102] Logical frames A1 and B1 are connected to forwarding port 1; logical frames A2 and B2 are connected to forwarding port 2; logical frames A3 and B3 are connected to forwarding port 3; logical frame A4 is connected to forwarding port 4; logical frame A5 is connected to forwarding port 5. If the logical frame to which the message of the currently received uplink line card belongs is B4, it is determined that the logical frame to which the message belongs belongs to a new logical frame, that is, B4 is a logical frame that has not been load balanced, and each forwarding port in the state storage table is polled. Since the last logical frame that has been load balanced is B3, the corresponding last forwarding port is 3, and the next forwarding port of the last forwarding port is 4. The cache occupancy of forwarding port 4 is relatively high, for example, 50%, which is higher than the preset value of 40%. Therefore, forwarding port 4 does not belong to a forwarding port with low congestion. The forwarding ports in the state storage table are continuously polled. The cache occupancy of forwarding port 5 is 30%, which is lower than the preset threshold value. Then, forwarding port 5 with low congestion is determined to be the second forwarding port, and the message is forwarded to the target line card through forwarding port 5.

[0103] In a possible implementation, after forwarding the message from the current switching node to the next switching node through the second forwarding port, the correspondence between the new logical frame to which the message belongs and the second forwarding port is stored in a state storage table, wherein the current switching node can be an upstream line card or a switching network card, and correspondingly, the next switching node can be a switching network card or a downstream line card. For example, after forwarding the message from the current switching node to the next switching node through forwarding port 4, the correspondence between the logical frame A4 to which the message belongs and forwarding port 4 is stored in a state storage table, wherein the next switching node is not necessarily a target line card, for example, forwarding the message from the upstream line card to the switching network card also realizes the forwarding of the message, and the embodiment of the present application stores the correspondence between the new logical frame to which the message belongs and the second forwarding port in the upstream line card in the state storage table.

[0104] In another possible implementation, if it is determined that multiple messages belonging to the same logical frame are all forwarded from the current switching node to the next switching node, the corresponding relationship between the current logical frame and the forwarding port in the state storage table is deleted. For example, logical frame A4 includes 3 messages, and it is determined that the 3 messages are all forwarded to the next switching node, such as forwarded from the uplink line card to the switching network card, and the corresponding relationship between logical frame A4 and forwarding port 4 in the state storage table is deleted.

[0105] In a possible implementation, for the case of plugging and unplugging the switching network card, in the related technology, if a message in a logical frame is not completely sent, other forwarding ports will be automatically selected for forwarding, which will cause internal disorder of the logical frame received by the downstream line card; in the present application, since the correspondence between the logical frame and the forwarding port is recorded in the state storage table, for the above-mentioned case of plugging and unplugging the switching network card, the message that is not completely forwarded is still forwarded according to the original forwarding port, which will not cause internal disorder of the logical frame, reducing the burden of de-sequencing the downstream line card.

[0106] In a possible implementation, in the process of recording the forwarding path of the logical frame through the state storage table, since the storage capacity of the forwarding node is limited, and for one de-arrangement queue of the uplink line card, its logical frame is constantly forwarding, the state storage table of the forwarding node only needs to store the logical frame currently being processed and its corresponding forwarding port, not all logical frames and their corresponding forwarding ports need to be recorded at the same time, the embodiment of the present application adopts the following steps to reduce the storage requirements of the logical frame forwarding state, such as Figure 4 As shown, it can be implemented as:

[0107] In step 401, the state storage capacity of the single de-arrangement queue is determined according to the maximum bandwidth of the single de-arrangement queue, the maximum degree of disorder and the size of the logical frame.

[0108] In step 402, the overall state storage capacity of the state storage table is determined according to the number of de-arrangement queues included in the state storage table and the state storage capacity of a single de-arrangement queue, wherein the state storage table corresponds to at least one de-arrangement queue.

[0109] In step 403, based on the overall state storage capacity, the corresponding relationship between the currently load-balanced logical frames and the forwarding ports is stored in the state storage table.

[0110] It should be added that, usually, the uplink line card includes multiple de-arrangement queues. The embodiment of the present application assumes that the state storage capacity of each de-arrangement queue is the same. Therefore, after determining the state storage capacity of a de-arrangement queue through the above steps 401 to 403, the overall state storage capacity of the state storage table can be determined based on the number of de-arrangement queues included in the state storage table.

[0111] To summarize, in the embodiments of the present application, by polling the received messages on the forwarding ports according to the de-ordering queue identifier and sequence number of the logical frame to which the messages belong, all forwarding ports forward at least one logical frame, and recording the correspondence between the logical frames and the forwarding ports in the state storage table, it is possible to avoid the situation where one forwarding port is congested while the other forwarding ports are idle, thereby reducing the possibility of probabilistic routing polarization of messages. By recording the correspondence between the load-balanced logical frames and the forwarding ports in the state storage table, under the premise of load balancing of the logical frames, it is ensured that the messages in the same logical frame are forwarded to the same path, thereby avoiding the disorder of the messages in the logical frame, satisfying the high load balancing of the router, improving the message forwarding efficiency, reducing the end-to-end forwarding delay within the device, and providing a good foundation for expanding the frame device to the cluster device.

[0112] Based on the same inventive concept, the embodiment of the present application also provides a load balancing device, which is applied to a switching network card, such as Figure 5 As shown, the device 500 includes:

[0113] The message receiving module 501 is configured to receive at least one message;

[0114] The state query module 502 is configured to query the state storage table based on the de-arrangement queue identifier and sequence number of the logical frame to which the message belongs, and the state storage table is used to record the correspondence between the logical frame currently subjected to load balancing and the forwarding port;

[0115] The first message forwarding module 503 is configured to determine the first forwarding port corresponding to the logical frame to which the message belongs according to the corresponding relationship if it is determined through query that the logical frame to which the message belongs does not belong to the new logical frame, and forward the message to the target line card through the first forwarding port; the new logical frame is a logical frame that is not currently load balanced;

[0116] The second message forwarding module 504 is configured to poll each forwarding port in the status storage table if it is determined through query that the logical frame to which the message belongs belongs to a new logical frame, determine the second forwarding port that meets the conditions for forwarding the current message, and forward the message to the target line card through the second forwarding port.

[0117] In a possible implementation, the device further includes:

[0118] The state updating module is configured to store the correspondence between the new logical frame to which the message belongs and the second forwarding port in the state storage table after forwarding the message from the current switching node to the next switching node through the second forwarding port.

[0119] In a possible implementation, the query status storage table is executed, and the status query module is configured to:

[0120] Based on the de-arrangement queue identifier and the sequence number of the logical frame to which the message belongs, compare the de-arrangement queue identifier and the sequence number of the logical frame currently being load balanced in the state storage table;

[0121] If it is determined that the logical frame to which the message belongs has been load balanced, then determining that the logical frame to which the message belongs does not belong to a new logical frame;

[0122] If it is determined that the logical frame to which the message belongs is not load balanced, it is determined that the logical frame to which the message belongs belongs to a new logical frame.

[0123] In a possible implementation, the polling of each forwarding port in the state storage table is performed to determine a second forwarding port that meets the condition for forwarding the current message, and the second message forwarding module is configured as follows:

[0124] Determine the previous forwarding port corresponding to the previous load-balanced logical frame of the logical frame to which the current message belongs;

[0125] According to the arrangement order of the forwarding ports, the next forwarding port of the previous forwarding port is used as the second forwarding port.

[0126] In a possible implementation manner, the second message forwarding module is further configured to:

[0127] If the next forwarding port of the previous forwarding port is not a forwarding port with a low congestion level, continue to poll the forwarding ports in the status storage table until a forwarding port with a low congestion level is used as the second forwarding port, wherein the forwarding port with a low congestion level is a forwarding port whose cache occupancy level is lower than a preset threshold.

[0128] In a possible implementation, the device further includes:

[0129] The state deletion module is configured to delete the corresponding relationship between the current logical frame and the forwarding port in the state storage table if it is determined that multiple messages belonging to the same logical frame are forwarded from the current switching node to the next switching node.

[0130] In a possible implementation, the state storage table corresponds to at least one de-shuffle queue, and the apparatus further includes a state storage capacity module configured to:

[0131] Determine the state storage capacity of the single de-arrangement queue according to the maximum bandwidth of the single de-arrangement queue, the maximum degree of disorder and the size of the logical frame;

[0132] Determine the overall state storage capacity of the state storage table according to the number of de-shuffling queues included in the state storage table and the state storage capacity of the single de-shuffling queue;

[0133] Based on the overall state storage capacity, the corresponding relationship between the currently load-balanced logical frames and the forwarding ports is stored in the state storage table.

[0134] like Figure 6 As shown, the electronic device 130 is in the form of a general electronic device. The components of the electronic device 130 may include but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).

[0135] Bus 133 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.

[0136] The memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and / or a cache memory 1322 , and may further include a read-only memory (ROM) 1323 .

[0137] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0138] The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 130, and / or communicate with any device that enables the electronic device 130 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 135. Furthermore, the electronic device 130 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 136. As shown, the network adapter 136 communicates with other modules for the electronic device 130 via a bus 133. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0139] In an exemplary embodiment, the present application further provides a computer-readable storage medium including instructions, such as a memory 132 including instructions, and the instructions can be executed by a processor 131 of an electronic device 130 to complete the load balancing method. Optionally, the computer-readable storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0140] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by the processor 131, the load balancing method provided in the present application is implemented.

[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0145] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A load balancing method, characterized in that: The method comprises: Receive at least one message; for each message, perform the following operations: Based on the de-arrangement queue identifier and the sequence number of the logical frame to which the message belongs, querying the state storage table, the state storage table is used to record the corresponding relationship between the logical frame currently subjected to load balancing and the forwarding port; If it is determined through query that the logical frame to which the message belongs does not belong to a new logical frame, a first forwarding port corresponding to the logical frame to which the message belongs is determined according to the corresponding relationship, and the message is forwarded to the target line card through the first forwarding port; the new logical frame is a logical frame that is not currently load balanced; If it is determined through query that the logical frame to which the message belongs is a new logical frame, each forwarding port in the state storage table is polled to determine a second forwarding port that meets the forwarding conditions of the current message, and the message is forwarded to the target line card through the second forwarding port.

2. The method according to claim 1, characterized in that The method further comprises: After the message is forwarded from the current switching node to the next switching node through the second forwarding port, the corresponding relationship between the new logical frame to which the message belongs and the second forwarding port is stored in the state storage table.

3. The method according to claim 1, characterized in that The query status storage table includes: Based on the de-arrangement queue identifier and the sequence number of the logical frame to which the message belongs, compare the de-arrangement queue identifier and the sequence number of the logical frame currently being load balanced in the state storage table; If it is determined that the logical frame to which the message belongs has been load balanced, then determining that the logical frame to which the message belongs does not belong to a new logical frame; If it is determined that the logical frame to which the message belongs is not load balanced, it is determined that the logical frame to which the message belongs belongs to a new logical frame.

4. The method according to claim 1, characterized in that: The polling of each forwarding port in the state storage table to determine a second forwarding port that meets the condition for forwarding the current message includes: Determine the previous forwarding port corresponding to the previous load-balanced logical frame of the logical frame to which the current message belongs; According to the arrangement order of the forwarding ports, the next forwarding port of the previous forwarding port is used as the second forwarding port.

5. The method according to claim 4, characterized in that The method further comprises: If the next forwarding port of the previous forwarding port is not a forwarding port with a low congestion level, continue to poll the forwarding ports in the status storage table until a forwarding port with a low congestion level is used as the second forwarding port, wherein the forwarding port with a low congestion level is a forwarding port whose cache occupancy level is lower than a preset threshold.

6. The method according to claim 1, characterized in that The method further comprises: If it is determined that multiple messages belonging to the same logical frame are all forwarded from the current switching node to the next switching node, the corresponding relationship between the current logical frame and the forwarding port in the state storage table is deleted.

7. The method according to any one of claims 1 to 6, characterized in that: The state storage table corresponds to at least one de-shuffle queue, and the method further includes: Determine the state storage capacity of the single de-arrangement queue according to the maximum bandwidth of the single de-arrangement queue, the maximum degree of disorder and the size of the logical frame; Determine the overall state storage capacity of the state storage table according to the number of de-shuffling queues included in the state storage table and the state storage capacity of the single de-shuffling queue; Based on the overall state storage capacity, the corresponding relationship between the currently load-balanced logical frames and the forwarding ports is stored in the state storage table.

8. A load balancing device, characterized in that: The device comprises: A message receiving module, configured to receive at least one message; A state query module is configured to query a state storage table based on a de-arrangement queue identifier and a sequence number of a logical frame to which the message belongs, wherein the state storage table is used to record a correspondence between a logical frame that has been currently load balanced and a forwarding port; a first message forwarding module, configured to determine a first forwarding port corresponding to the logical frame to which the message belongs according to the corresponding relationship if it is determined through query that the logical frame to which the message belongs does not belong to a new logical frame, and forward the message to a target line card through the first forwarding port; the new logical frame is a logical frame that is not currently load balanced; The second message forwarding module is configured to poll each forwarding port in the status storage table if it is determined through query that the logical frame to which the message belongs belongs to a new logical frame, determine the second forwarding port that meets the conditions for forwarding the current message, and forward the message to the target line card through the second forwarding port.

9. A device, characterized in that: include: Processor and memory; The memory is used to store the processor executable instructions; The processor is configured to execute the instructions to implement the load balancing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of a device, the device is enabled to execute the load balancing method according to any one of claims 1 to 7.