Message forwarding method and device

By considering the number of flows and bandwidth thresholds in port status judgment, the problem of load imbalance in flow-by-flow forwarding is solved, achieving more balanced flow distribution and more efficient load balancing effects.

CN118540273APending Publication Date: 2024-08-23HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Application Number
CN202310114524.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-14
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the existing technology, the flow-by-flow forwarding method often relies on hash operation when determining the outgoing port, which leads to the problem of load imbalance and cannot effectively avoid the load imbalance caused by multiple high-pressure flow messages being congested on the same port.

Method used

By judging whether the status of the port meets preset conditions, including the number of flows and bandwidth thresholds, it is decided whether to forward elephant flows or throughput-sensitive flows through the port to ensure balanced distribution of flows and avoid overloading of a single port.

Benefits of technology

It improves the load balancing effect, reduces the consumption of computing resources, avoids congestion of multiple messages on the same port, and enables flows to be distributed more evenly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540273A
    Figure CN118540273A
Patent Text Reader

Abstract

The invention provides a message forwarding method and device, and relates to the technical field of communication. The method comprises the following steps: a message forwarding device determines that the type of a first stream is a preset type; the message forwarding device determines that the state of a first port meets a preset condition according to the number of the preset type of streams needing to be forwarded by the first port of the message forwarding device; and the message forwarding device forwards the message of the first flow through the first port. The method considers whether the state of the port meets a preset condition, and the preset condition can comprise the characteristics of the flow. In this way, the flow is distributed more evenly, and the load balancing effect is improved.
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 more specifically, to a message forwarding method, apparatus, computing device, computing device cluster, computer program product, and computer-readable storage medium. Background Art

[0002] Load balancing technology can achieve uniform sharing of network traffic among various ports. Among them, the flow-by-flow forwarding technology will distribute the messages belonging to the same flow to the same port, and the messages belonging to different flows may be distributed to different ports, thereby achieving multi-path sharing and avoiding the disorder problem. For example, when a message forwarding device receives a message, it can search the flow table according to the information of the flow corresponding to the message, thereby obtaining the corresponding port information and achieving flow-by-flow forwarding of the message. However, in the relevant technical solutions, the outbound port of a flow is determined only based on the hash operation, which often leads to the problem of load imbalance. Summary of the invention

[0003] The present application provides a method and device for forwarding a message. The method takes into account whether the status of a port meets a preset condition, so that the flow is distributed more evenly, thereby improving the effect of load balancing.

[0004] In a first aspect, a method for forwarding messages is provided, comprising: a message forwarding device determines that the type of a first flow is a preset type; the message forwarding device determines that the state of the first port meets a preset condition based on the number of flows of the preset type that need to be forwarded by the first port of the message forwarding device; and the message forwarding device forwards the message of the first flow through the first port.

[0005] In an embodiment of the present application, when the type of a flow is a preset type, the message forwarding device can determine whether the state of a port meets the preset condition, and if so, forward the message of the flow through the port. The message forwarding method provided by the present application considers whether the state of the port meets the preset condition, so that the flow is distributed more evenly, improving the effect of load balancing.

[0006] In combination with the first aspect, in some implementations of the first aspect, the preset type is elephant flow, or throughput sensitive type.

[0007] The number of bytes of the elephant flow is greater than or equal to a threshold of the number of bytes. Alternatively, the number of messages of the elephant flow is greater than or equal to a threshold of the number of messages.

[0008] In the embodiment of the present application, when the preset type of the first flow is an elephant flow or a throughput-sensitive flow, the message forwarding device determines whether the state of a certain port meets the preset conditions, and then forwards the elephant flow or the throughput-sensitive flow through the port. Elephant flows and throughput-sensitive flows often cause high pressure on ports. The forwarding message method provided in the embodiment of the present application can only judge the port preset conditions for flows with pressure on the port, saving computing resources, thereby improving the efficiency of load balancing.

[0009] In combination with the first aspect, in certain implementations of the first aspect, determining that the state of the first port satisfies a preset condition includes: when the number of flows of the preset type that need to be forwarded by the first port is greater than or equal to a threshold of the number of flows, determining that the state of the first port satisfies the preset condition.

[0010] When determining that the first port is a forwarding port, the embodiment of the present application will determine whether the number of flows of the preset type that the first port needs to forward is greater than or equal to a preset threshold. In other words, when determining that the state of the first port can undertake the task of forwarding the first flow, it is determined to forward the message of the first flow through the first port. In this way, each port forwards the flow within its own limit, avoiding the disadvantageous situation that multiple messages are congested in the same port, thereby improving the effect of load balancing.

[0011] In combination with the first aspect, in certain implementations of the first aspect, determining that the state of the first port meets a preset condition includes: determining that the state of the first port meets the preset condition based on the number of flows of the preset type that need to be forwarded by the first port, and at least one of the bandwidth currently occupied by the first port and the cache currently occupied by the first port.

[0012] When determining that the first port is a forwarding port, the embodiment of the present application will also determine whether the state of the first port meets the preset conditions. Specifically, considering the bandwidth currently occupied by a port and at least one of the buffers currently occupied by the port and the number of flows of the preset type that the port needs to forward, it is determined whether the state of the port meets the preset conditions. In this way, each port forwards the flow within its own limit, avoiding the disadvantageous situation that multiple messages are blocked in the same port, so that the flow can be distributed more evenly, and the effect of load balancing is improved.

[0013] In combination with the first aspect, in certain implementations of the first aspect, determining that the state of the first port meets a preset condition includes: determining at least one state value based on the number of flows of the preset type that need to be forwarded by the first port, and at least one of the bandwidth currently occupied by the first port and the cache currently occupied by the first port; determining that the state of the first port meets the preset condition based on a size relationship between the at least one state value and at least one threshold, wherein there is a one-to-one correspondence between the at least one state value and the at least one threshold.

[0014] When determining that the first port is a forwarding port, the embodiment of the present application will also determine whether the state of the first port meets the preset conditions. Specifically, at least one state value of the port can be determined based on the bandwidth currently occupied by a port and at least one of the caches currently occupied by the port and the number of flows of the preset type that the port needs to forward, and whether the port meets the preset conditions can be determined based on the size relationship between the at least state value and at least one preset threshold. In this way, each port forwards the flow within its own limit, avoiding the disadvantageous situation that multiple messages are congested in the same port, so that the flow is more evenly distributed, improving the effect of load balancing.

[0015] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: the message forwarding device determines that the type of the second flow is the preset type; the message forwarding device determines that the state of the first port does not meet the preset condition, and selects the second port of the message forwarding device; the message forwarding device determines that the state of the second port meets the preset condition; and the message forwarding device forwards the message of the second flow through the second port.

[0016] When the state of a port does not meet the preset condition, the message forwarding device can determine whether the state of the next port meets the preset condition, and if so, forward the message of the flow through the port. The message forwarding method provided by the present application can make the flow more evenly distributed and improve the effect of load balancing.

[0017] In a second aspect, an embodiment of the present application provides a message forwarding device, which includes a module for implementing the first aspect or any possible implementation method of the first aspect.

[0018] In a third aspect, a computing device is provided, including a processor and a memory, wherein the processor is used to execute instructions stored in the memory so that the computing device executes the message forwarding method of the first aspect or any possible implementation of the first aspect.

[0019] In a fourth aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the message forwarding method of the first aspect or any possible implementation of the first aspect.

[0020] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device, the computing device executes the message forwarding method of the first aspect or any possible implementation of the first aspect.

[0021] In a sixth aspect, a computer program product including instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the message forwarding method of the first aspect or any possible implementation manner of the first aspect.

[0022] In a seventh aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the message forwarding method of the first aspect or any possible implementation of the first aspect.

[0023] In an eighth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the message forwarding method of the first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a schematic diagram of a message forwarding method.

[0025] Figure 2 This is a schematic diagram of another method of forwarding messages.

[0026] Figure 3 It is a schematic flowchart of a message forwarding method provided in an embodiment of the present application.

[0027] Figure 4 It is a schematic diagram of a message forwarding method provided in an embodiment of the present application.

[0028] Figure 5 It is a schematic flowchart of another message forwarding method provided in an embodiment of the present application.

[0029] Figure 6 It is a schematic diagram of another message forwarding method provided in an embodiment of the present application.

[0030] Figure 7 It is a schematic flowchart of another method for forwarding messages provided in an embodiment of the present application.

[0031] Figure 8 It is a schematic block diagram of a message forwarding device provided in an embodiment of the present application.

[0032] Fig. 9 An embodiment of the present application provides a schematic diagram of the architecture of a computing device 900.

[0033] Fig.10 It is a schematic diagram of the architecture of a computing device cluster provided in an embodiment of the present application.

[0034] Fig.11 It is a schematic diagram of the connection between computing devices 900A and 900B through a network provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0036] The present application will present various aspects, embodiments or features around a system that may include multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. In addition, combinations of these schemes may also be used.

[0037] In addition, in the embodiments of the present application, words such as "exemplary" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present concepts in a concrete way.

[0038] In the embodiments of the present application, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.

[0039] The network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0040] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0041] The embodiment of the present application provides a method for forwarding a message, which can be executed by a message forwarding device. It should be noted that the message forwarding device can be one network device or multiple network devices.

[0042] In network traffic, a flow is a group of messages that contain the same flow ID. For Internet Protocol version 4 (IPv4) messages, the flow ID of an IPv4 message can be a five-tuple, namely the source IP address, destination IP address, source port, destination port and protocol type carried in the message header; the flow ID of an IPv4 message can also be the source IP address and destination IP address; the flow ID of an IPv4 message can also be the source IP address, destination IP address, source port and destination port. For Internet Protocol version 6 (IPv6) messages, the flow ID of an IPv6 message can be a flow label; in addition to the flow label, the flow ID of an IPv6 message can also include the source address and destination address.

[0043] Figure 1 A schematic flow chart of a message forwarding method is shown. Figure 1 Below server 1 and server 2 are the messages to be forwarded by the servers, respectively. The different shapes of the messages indicate that the messages belong to different flows. Figure 1 As shown in the legend, a circle indicates that the message belongs to the first flow, and a triangle indicates that the message belongs to the second flow. Messages belonging to the same flow have a certain order, and the size of the order is represented by the size of the numbers inside the figure. For example, the first message belonging to the first flow is marked with the number "1" in the circle, and the second message is marked with the number "2". See Figure 1, the message can be forwarded to device 1 and device 2 through port 1 and port 2 respectively. It should be noted that device 1 and device 2 can be the same device or different devices; device 1 and device 2 can receive messages, and device 1 and device 2 can be servers or other network devices.

[0044] Figure 2 A schematic flow chart of a method for forwarding a message is shown. Figure 2 Reflected Figure 1 The process of forwarding messages in the Figure 2 ,Compared with the packet-by-packet forwarding technology, Figure 2 The adopted flow-by-flow forwarding technology can distribute the messages belonging to the same flow to the same port, thus avoiding the disorder of the messages.

[0045] But, obviously Figure 2 The problem of load imbalance occurs because the number of messages (or bytes) in the first flow and the second flow is large. Figure 2 The method shown in the figure forwards both the first flow and the second flow to port 2 without distinction, resulting in a heavy load on port 2 and possible packet loss.

[0046] Figure 3 A method for forwarding a message provided in an embodiment of the present application is shown. It should be noted that: Figure 3 The method shown is only an example and does not constitute a limitation to the present application.

[0047] Step S310, obtaining a first message, determining that the first message belongs to a first flow; determining whether the type of the first flow is a preset type, if yes, executing step S320, if no, executing step S350.

[0048] Specifically, it can be determined that the message belongs to the first flow according to the flow identifier carried by the first message. The specific form of the flow identifier varies in different messages. Please refer to the description of the flow identifier in the previous text, which will not be repeated here.

[0049] The preset type can be an elephant flow or a throughput sensitive type. Among them, the elephant flow can be a flow whose number of bytes or number of messages exceeds a certain threshold. In some embodiments, the network device can use a sliding window algorithm to determine whether the preset type is an elephant flow. For example, whenever a message of the first stream is received, the count value is increased by 1. When the count value is greater than the preset message threshold, the network device can determine that the preset type of the first stream is an elephant flow. In other words, according to the size of the number of bytes or the number of messages, it can be divided into an elephant flow (also called a large flow) and a mouse flow (also called a small flow). It can be understood that more levels can be divided, such as a large flow, a medium flow, and a small flow.

[0050] An elephant flow is a continuous flow with a very large total number of bytes in a network link. The number of elephant flows may not be large, but the elephant flows occupy a large amount of bandwidth over a period of time.

[0051] In some embodiments, the number of bytes of the elephant flow is greater than or equal to a threshold number of bytes.

[0052] In some other embodiments, the number of packets in the elephant flow is greater than or equal to a threshold value of the number of packets.

[0053] For example, Figure 1 The first stream and the second stream can be elephant streams.

[0054] Throughput-sensitive refers to a type of business that contains a large number of messages or bytes and lasts for a long time. Throughput-sensitive flows consume a lot of resources. Statistical strategies can be designed to identify throughput-sensitive flows. For example, the duration of the table entry corresponding to the flow in the flow table can be monitored. If the duration exceeds the preset time threshold, the flow can be determined to be a throughput-sensitive flow. For another example, the number of bytes of a flow can be counted within a certain time period. If the number of bytes exceeds the preset byte threshold, the flow can be determined to be a throughput-sensitive flow. Delay-sensitive refers to a type of business that needs to reduce delay as much as possible. Delay-sensitive flows have a short duration and a small amount of data. In other words, flows can be divided into delay-sensitive and throughput-sensitive types based on a comprehensive judgment of duration and traffic rate.

[0055] For example, Figure 1 The first and second streams may be throughput-sensitive streams.

[0056] It can be understood that elephant flows or throughput-sensitive flows put greater pressure on the forwarding port. If multiple flows that meet the preset type correspond to the same forwarding port, packet loss may occur. In other embodiments, the preset type can also be other types (such as medium flow, small flow, delay-sensitive type). The present application does not limit the specific form of the preset type. For ease of description, it is assumed that the preset type includes elephant flows and throughput-sensitive types. In other words, it can be assumed that the preset type does not include small flows and delay-sensitive types.

[0057] If the type of the first stream is not the preset type, step S350 is performed. For example, when the first stream is a small stream or a delay-sensitive stream, step S350 may be performed.

[0058] Step S320, determining whether the first flow has a corresponding entry in the first flow table, if not, executing step S330, if yes, executing step S360.

[0059] The first flow table may include at least one table entry, for example, the table entry may include a keyword (key) and data (data), and each table entry may correspond to a flow. The key may be used to indicate the information of the flow, for example, it may be a flow identifier such as a five-tuple information, a flow label, etc. The data may be used to indicate the information of the port, such as a port identifier, an equal-cost multipath (ECMP) group member identifier, a weighted cost multipath (WCMP) group member identifier, a link aggregation group (LAG) member number, etc.

[0060] In step S310, it is determined that the type of the first flow is a preset type, and then step S320 is executed. That is to say, the flows corresponding to the entries in the first flow table can all be flows that meet the preset type, such as elephant flows and throughput-sensitive flows. In this way, only establishing entries for a part of the flows that meet the preset type can save entry resources and improve the efficiency of flow table configuration.

[0061] Step S330, determine the first port, and then determine whether the state of the first port meets the preset conditions. If so, execute step S340; if not, determine whether the state of the second port meets the preset conditions. If so, execute step S340; if not, continue to determine the next port.

[0062] The first port may be determined by random determination, polling determination, or by a hash algorithm, for example, a hash operation may be performed according to the flow identifier of the message to obtain a hash value, and the port may be determined according to the hash value.

[0063] Exemplarily, whether the state of a port satisfies a preset condition may be whether the number of flows of a preset type that the port needs to forward and a preset threshold value satisfy a preset size relationship. In some embodiments, a statistical table item of the number of flows of a preset type may be set in the first flow table, and the statistical table item of the number of flows of the preset type is used to count the number of flows of the preset type that the port needs to forward. For example, the preset threshold of a port may be set to 2. If the statistical table item of the number of flows of the preset type shows that the value of the port is 1, the port satisfies the preset condition, and step S340 may be executed. If the statistical table item of the number of flows of the preset type shows that the value of the port is 2, the port does not meet the preset condition. At this time, it may be determined whether the next port meets the preset condition. If the next port meets the preset condition, step S340 may be executed.

[0064] In one embodiment, if the states of various ports cannot meet the preset conditions after traversing various ports, a port with the smallest bandwidth load may be selected for sending.

[0065] Step S340: Create a first entry in the first flow table for the port that meets the preset condition, and determine, according to the first entry, to send the first message through the port.

[0066] If the state of a port meets the preset condition, a first table entry is created for the port in the first flow table, and a first message is sent through the port. Figure 2 Compared with the technical solution shown, the message forwarding method provided in the embodiment of the present application also needs to determine whether the port meets the preset conditions, thereby improving the load balancing effect.

[0067] Step S350, determining a port, and sending the first message through the port.

[0068] In one embodiment, if the type of the first message is not a preset type, a port may be determined by a hash algorithm, and the first message may be sent through the port. For example, for small flows or delay-sensitive messages, a forwarding port may be determined by a hash algorithm.

[0069] In another embodiment, if the type of the first message is not a preset type, a port may be randomly determined and the first message may be sent through the port.

[0070] In yet another embodiment, the first message that is not of the preset type may also be sent by querying the flow table.

[0071] Step S360: determine a port according to an entry corresponding to the first flow in the first flow table, and send the first message through the port.

[0072] If the first flow to which the first message belongs has a corresponding entry in the flow table, the port can be determined according to the entry. For example, the first message can be determined to belong to the first flow according to the flow identifier of the first message, the entry can be matched according to the information of the first flow, the information of the port can be determined according to the matched entry, and then the first message can be sent through the port.

[0073] The above describes some possible implementation methods of the embodiments of the present application. Figure 1 The specific situation shown is based on Figure 4 A detailed description of how the embodiments of the present application are performed is given. It is clear to those skilled in the art that the following content is only for the purpose of clearly illustrating the technical solution of the embodiments of the present application and does not constitute a limitation on the present application.

[0074] Figure 4 Reflected Figure 1 The load balancing effect of a specific implementation method of forwarding a message in the middle. For example, Figure 4 Can be based on Figure 1The specific circumstances and Figure 3 The forwarding message method shown is obtained. It can be understood that Figure 3 The message forwarding method shown may be executed by a network device.

[0075] See also Figure 1 ,Assume that there are messages from server 1 and server 2 to be sent to the port, set the elephant flow threshold of port 1 and port 2 to 1, and the preset condition is that the number of elephant flows that the port needs to forward is less than the elephant flow threshold of the port.

[0076] In some embodiments, the first flow and the second flow may be determined to be elephant flows by a sliding window algorithm.

[0077] In other embodiments, the first flow and the second flow may be determined to be large flows by information in a field carried in the message. For example, the information in a field carried in the message may indicate that the first flow and the second flow are large flows.

[0078] The following describes the forwarding process of each message in detail:

[0079] (1) For the first message of the fourth flow, the network device uses a hash algorithm to determine a port, assuming it is port 2, and sends the message through port 2.

[0080] (2) For the first message of the third flow, the network device uses a hash algorithm to determine a port, assuming it is port 1, and sends the message through port 1.

[0081] (3) For the first message of the second flow, since the type of the second flow is an elephant flow, the network device first searches the first flow table and determines that there is no entry corresponding to the second flow in the first flow table. The network device then determines port 2 and determines that the number of elephant flows that port 2 needs to forward (0 at this time) is less than the elephant flow threshold of port 2 (assuming it is set to 1), and establishes a corresponding entry for the second flow in the first flow table. The network device sends the message through port 2 according to the entry corresponding to the second flow. At this time, the number of elephant flows that port 2 needs to forward increases by 1.

[0082] (4) For the second message of the third flow, the network device sends it through port 1 according to the hash algorithm.

[0083] (5) For the first message of the fifth flow, the network device uses a hash algorithm to determine a port, assuming it is port 1, and the network device sends the message through port 1.

[0084] (6) For the first message of the first flow, since the type of the first flow is an elephant flow, the network device determines that there is no table entry corresponding to the second flow in the first flow table. The network device then determines port 2, and determines that the number of elephant flows that port 2 needs to forward (1 at this time) is not less than the elephant flow threshold of port 2 (assuming it is set to 1), which does not meet the preset condition. Then, the network device determines port 1, and determines that the number of elephant flows that port 1 needs to forward (0 at this time) is less than the elephant flow threshold of port 1, and the network device establishes a corresponding table entry for the first flow in the first flow table. The network device sends the message through port 1 according to the table entry corresponding to the first flow. At this time, the number of elephant flows that port 1 needs to forward increases by 1.

[0085] (7) For the second message of the second flow, since the type of the second flow is elephant flow, the network device first searches the first flow table, and sends the message through port 2 according to the entry corresponding to the second flow in the first flow table; and so on, until the sixth message is sent through port 2.

[0086] In some embodiments, the network device can identify the sixth message as the tail packet (for example, according to the information in the field carried by the sixth message), and can also set an aging time. When the sixth message is identified as the tail packet or the aging time expires, the table entry corresponding to the second flow can be deleted, and the number of elephant flows that port 2 needs to forward is reduced by 1.

[0087] (8) For the 2nd to 6th packets of the first flow, the process is similar to (7) and will not be repeated here.

[0088] After the above process, the effect of load balancing is as follows Figure 4 As shown in the figure, the first flow and the second flow are divided into different ports, which prevents multiple flows that put pressure on the port from being blocked on the same port, thereby improving the load balancing effect. Figure 4 , the message can be forwarded to device 1 and device 2 through port 1 and port 2, respectively. It should be noted that device 1 and device 2 can be the same device or different devices; device 1 and device 2 can receive messages, and device 1 and device 2 can be servers or network devices. The above describes an embodiment of the same device implementing flow table configuration and forwarding messages. It can be understood that the present application is not limited to the same device. For example, the first network device can perform flow table configuration and the second network device can perform message forwarding.

[0089] The present application provides another message forwarding method, involving a first network device and a second network device, wherein the interaction between the first network device and the second network device is shown in Figure 5 It should be noted that Figure 5 The following technical solutions are merely examples and do not constitute a limitation to the present application.

[0090] Step S510: The second network device receives a message of a first flow, determines that the first flow is a large flow according to the message of the first flow, and determines that the first flow table does not include a table entry corresponding to the first flow.

[0091] Step S520: The second network device sends first indication information to the first network device, where the first indication information is used to instruct the first network device to determine a port for the first flow.

[0092] In some embodiments, the first indication information is explicitly indicated, for example, information carried by the first indication information directly indicates that the first network device determines a port for the first flow.

[0093] In some other embodiments, the first indication information may also be implicitly expressed, for example, the first indication information includes information of the first flow (such as a five-tuple, a flow label, etc.), and when the first network device receives the first indication information including information of the first flow, the first network device may determine a port for the first flow. In the case of implicit expression, the second network device may also send the message to the first network device.

[0094] Step S530: The first network device determines whether the state of the first port meets a preset condition.

[0095] Step S540: When the state of the first port meets the preset condition, the first network device establishes a first entry in the first flow table, wherein the first entry includes information indicating the first port, and the first entry is used to send a message belonging to the first flow.

[0096] Step S550: The first network device sends second indication information to the second network device, where the second indication information includes the first table entry.

[0097] Step S560: The second network device sends the first flow message through the first port according to the second indication information.

[0098] Figure 6 A method for forwarding a message provided by an embodiment of the present application is shown. A second network device may request a first network device to configure a flow table, and the first network device may indicate a port to which a message of a first flow is to be sent to the second network device. For example, the first network device may send a first table entry to the second network device, and the first table entry is used to indicate a port to which a message of the first flow is to be sent.

[0099] Figure 7 A schematic flowchart of another message forwarding method provided in an embodiment of the present application is shown.

[0100] Step S710: The message forwarding device determines that the type of the first flow is a preset type.

[0101] In some embodiments, S710 includes: the message forwarding device determines that the type of the first flow is a preset type, and the first flow table does not include an entry corresponding to the first flow. The type of the first flow is a preset type, which can be determined by the first network device (for example Figure 3 ), or the second network device may determine and send an indication message to the first network device (for example Figure 5 ).

[0102] Among them, if it is a technical solution that the second network device sends the indication information, in some embodiments, the indication information is explicitly expressed, for example, the information carried by the indication information directly instructs the first network device to determine the port for the first flow.

[0103] In other embodiments, the indication information may also be implicitly expressed, for example, the indication information includes information of the first flow (such as a five-tuple, a flow label, etc.), and when the first network device receives the indication information including the information of the first flow, the first network device may determine a port for the first flow. In the case of implicit expression, the second network device may also send the message to the first network device.

[0104] The first network device can be a load balancing device, a switch, a router or other message forwarding device. The present application does not limit the specific name of the first network device. As long as the message forwarding method of the embodiment of the present application can be executed, it falls within the scope of the first network device.

[0105] The preset type can be an elephant flow or a throughput-sensitive type. Among them, an elephant flow can be a flow whose number of bytes or messages exceeds a certain threshold. A sliding window algorithm can be used to determine whether the preset type is an elephant flow. For example, whenever a message of the first flow is received, the count value is increased by 1. When the count value is greater than the preset message threshold, it can be determined that the preset type of the first flow is an elephant flow. In other words, according to the size of the number of bytes or the number of messages, it can be divided into elephant flows (also called large flows) and mouse flows (also called small flows). It can be understood that more levels can be divided, such as large flows, medium flows, and small flows. For example, a large flow can be a flow with a total number of bytes greater than 1MB and less than 50MB, and a small flow is a flow with a total number of bytes less than or equal to 1MB.

[0106] In one embodiment, the preset type may be a large flow or a medium flow. Accordingly, for a large flow or a medium flow, the preset conditions that the state of the first port must satisfy are different.

[0107] An elephant flow is a continuous flow with a very large total number of bytes in a network link. The number of elephant flows may not be large, but the elephant flows occupy a large amount of bandwidth over a period of time.

[0108] In some embodiments, the number of bytes of the elephant flow is greater than or equal to a threshold number of bytes.

[0109] In some other embodiments, the number of packets in the elephant flow is greater than or equal to a threshold value of the number of packets.

[0110] Throughput-sensitive refers to a type of business that contains a large number of messages or bytes and lasts for a long time. Throughput-sensitive flows consume a lot of resources. Statistical strategies can be designed to identify throughput-sensitive flows. For example, the duration of the table entry corresponding to the flow in the flow table can be monitored. If the duration exceeds the preset time threshold, the flow can be determined to be a throughput-sensitive flow. For another example, the number of bytes of a flow can be counted within a certain time period. If the number of bytes exceeds the preset byte threshold, the flow can be determined to be a throughput-sensitive flow. Delay-sensitive refers to a type of business that needs to reduce delay as much as possible. Delay-sensitive flows have a short duration and a small amount of data. In other words, flows can be divided into delay-sensitive and throughput-sensitive types based on a comprehensive judgment of duration and traffic rate.

[0111] It can be understood that elephant flows or throughput-sensitive flows put greater pressure on the forwarding port. If multiple flows that meet the preset type correspond to the same forwarding port, packet loss may occur. In other embodiments, the preset type can also be other types (such as medium flow, small flow, delay-sensitive type). The present application does not limit the specific form of the preset type. For ease of description, it is assumed that the preset type includes elephant flows and throughput-sensitive types. In other words, it can be assumed that the preset type does not include small flows and delay-sensitive types.

[0112] Step S720: The message forwarding device determines whether the state of the first port meets a preset condition according to the number of flows of the preset type that need to be forwarded by the first port of the message forwarding device.

[0113] For example, the message forwarding device may set a statistical table entry of the number of preset type flows of the first port in the flow table. When the preset type of flow is determined to be sent through the first port, the statistical table entry of the number of preset type flows is increased by 1, and when all messages of the preset type of flow are sent through the first port, the statistical table entry of the number of preset type flows is reduced by 1. The value of the statistical table entry of the number of preset type flows can be used to indicate the number of the preset type of flows that need to be forwarded by the first port.

[0114] For example, the flow that needs to be forwarded by the first port may be a flow that has been determined to be forwarded through the first port, but has not yet completed forwarding. For example, a flow has been determined to be forwarded through the first port, but the first packet of the flow has not yet been forwarded through the first port. Another example is that a part of the messages of a flow has been forwarded through the first port, but another part of the messages have not yet been forwarded through the first port.

[0115] Exemplarily, whether the state of the first port meets the preset condition can be judged according to the following three situations:

[0116] In case 1, whether the state of the first port meets the preset condition is determined according to the relationship between the number of flows of the preset type that the first port needs to forward and the corresponding preset threshold. For example, when the number of flows of the preset type that the first port needs to forward is less than the corresponding preset threshold, it is determined that the state of the first port meets the preset condition.

[0117] Case 2: Determine whether the state of the first port meets the preset condition based on the relationship between the bandwidth currently occupied by the first port and the corresponding preset threshold. For example, when the bandwidth currently occupied by the first port is less than the corresponding preset threshold, determine that the state of the first port meets the preset condition.

[0118] Case 3: Determine whether the state of the first port meets the preset condition based on the size relationship between the buffer currently occupied by the first port and the corresponding preset threshold. For example, when the buffer currently occupied by the first port is less than the corresponding preset threshold, determine that the state of the first port meets the preset condition.

[0119] The currently occupied bandwidth and currently occupied cache can be either specific bandwidth or cache occupied values, or bandwidth occupied percentages. For example, you can set the preset condition to be met when the bandwidth occupied percentage is below 30%; or set the preset condition to be met when the occupied bandwidth is less than 30Gbps. For example, you can set the preset condition to be met when the cache is less than 200KB.

[0120] In some embodiments, if the state of the first port satisfies one of the above three conditions, or satisfies any two of the above three conditions, or satisfies the above three conditions at the same time, it can be determined that the state of the first port satisfies the preset condition.

[0121] In other embodiments, the state of the first port satisfies case 1, or satisfies case 2 and case 3 at the same time, and it can be determined that the state of the first port satisfies the preset condition. That is, if only one of case 2 or case 3 is satisfied when case 1 is not satisfied, it cannot be determined that the state of the first port satisfies the preset condition.

[0122] Exemplarily, whether the state of the first port meets the preset condition can also be determined by first determining a state value based on at least two of the number of flows of a preset type that the first port needs to forward, the bandwidth currently occupied by the first port, and the cache currently occupied by the first port, and then determining whether the preset condition is met based on the size relationship between the state value and the corresponding preset threshold.

[0123] Exemplarily, whether the state of the first port satisfies the preset condition may not require a preset threshold. For example, a trigger condition may be preset, and if the number of flows of a preset type that the first port needs to forward reaches the trigger condition, the preset condition is satisfied. For example, if the trigger condition is 7, when the number of flows of the preset type that the first port needs to forward is 7, the first port satisfies the preset condition.

[0124] Step S730: the message forwarding device forwards the first-stream message through the first port.

[0125] In some embodiments, when the state of the first port meets the preset condition, the first network device establishes a first entry in the first flow table, wherein the first entry includes information indicating the first port, and the first entry is used to send a message belonging to the first flow.

[0126] The first network device may determine that the state of the first port meets a preset condition. At this time, the first network device may forward the message belonging to the first flow through the first port.

[0127] It is understandable that step S710, step S720 and step S730 may be performed by the same network device or by different network devices. In other words, determining the preset type, determining the port and forwarding the message to the port may be performed by multiple network devices.

[0128] In an embodiment of the present application, when the type of a flow is a preset type, the message forwarding device can determine whether the state of a port meets the preset condition, and if so, forward the message of the flow through the port. The message forwarding method provided by the present application considers whether the state of the port meets the preset condition, so that the flow is distributed more evenly, improving the effect of load balancing.

[0129] Optionally, the preset type is elephant flow, or throughput sensitive type.

[0130] For example, a large flow can be a flow whose total number of bytes exceeds a certain threshold, or a flow whose total number of packets exceeds a certain threshold. Throughput-sensitive flows consume a lot of resources.

[0131] In the embodiment of the present application, when the preset type of the first flow is an elephant flow or a throughput-sensitive flow, the message forwarding device determines whether the state of a certain port meets the preset conditions, and then forwards the elephant flow or the throughput-sensitive flow through the port. Elephant flows and throughput-sensitive flows often cause high pressure on ports. The forwarding message method provided in the embodiment of the present application can only judge the port preset conditions for flows with pressure on the port, saving computing resources, thereby improving the efficiency of load balancing.

[0132] Optionally, determining that the state of the first port meets a preset condition includes: when the number of flows of the preset type that need to be forwarded by the first port is greater than or equal to a threshold of the number of flows, determining that the state of the first port meets the preset condition.

[0133] When determining that the first port is a forwarding port, the embodiment of the present application will determine whether the number of flows of the preset type that the first port needs to forward is greater than or equal to a preset threshold. In other words, when determining that the state of the first port can undertake the task of forwarding the first flow, it is determined to forward the message of the first flow through the first port. In this way, each port forwards the flow within its own limit, avoiding the disadvantageous situation that multiple messages are congested in the same port, thereby improving the effect of load balancing.

[0134] Optionally, determining that the state of the first port meets a preset condition includes: determining that the state of the first port meets the preset condition based on the number of flows of the preset type that need to be forwarded by the first port, and at least one of a bandwidth currently occupied by the first port and a cache currently occupied by the first port.

[0135] For example, the first network device may determine whether the state of the first port meets the preset condition according to the number of flows of the preset type that need to be forwarded by the first port, the bandwidth currently occupied by the first port, and the cache currently occupied by the first port.

[0136] In some embodiments, the first table entry may include at least one of the number of flows of a preset type that the first port needs to forward, the bandwidth currently occupied by the first port, and the buffer currently occupied by the first port.

[0137] In other embodiments, there may be an auxiliary table, which may include at least one of the number of flows of a preset type that the first port needs to forward, the bandwidth currently occupied by the first port, and the buffer currently occupied by the first port.

[0138] Exemplarily, to determine whether the state of the first port meets the preset condition, a threshold can be set. When the first network device determines that the preset condition is met when at least one of the number of flows of a preset type that needs to be forwarded by the first port, the bandwidth currently occupied by the first port, or the cache currently occupied by the first port is less than the threshold, it is determined that the preset condition is met.

[0139] In other embodiments, it is determined whether the state of the first port meets the preset conditions, and it is also possible to determine whether at least one of the number of flows of the preset type that the first port needs to forward, the bandwidth currently occupied by the first port, or the cache currently occupied by the first port is lighter than the load of other ports. If the load is lighter, the preset conditions are met. In other words, the first network device can select a port with a lighter load of the number of flows of the preset type that needs to be forwarded, the bandwidth currently occupied, or the cache currently occupied to forward the message. For example, assuming that the port is a member of the ECMP group, the first network device can select a port with the smallest number of elephant flows that need to be forwarded to forward the message.

[0140] When determining that the first port is a forwarding port, the embodiment of the present application will also determine whether the state of the first port meets the preset conditions. Specifically, the bandwidth currently occupied by a port and at least one of the caches currently occupied by the port and the number of flows of the preset type that the port needs to forward are considered to determine whether the state of the port meets the preset conditions. In this way, each port forwards flows within its own limits, avoiding the disadvantageous situation of multiple messages being congested at the same port, so that flows can be distributed more evenly, improving the effect of load balancing.

[0141] Optionally, determining that the state of the first port satisfies a preset condition includes: determining at least one state value based on the number of flows of the preset type that need to be forwarded by the first port, and at least one of a bandwidth currently occupied by the first port and a cache currently occupied by the first port; and determining that the state of the first port satisfies the preset condition based on a size relationship between the at least one state value and at least one threshold, wherein there is a one-to-one correspondence between the at least one state value and the at least one threshold.

[0142] For example, weights can be set for the number of flows of the preset type that the first port needs to forward, the bandwidth currently occupied by the first port, or the cache currently occupied by the first port. For example, the weight of the number of flows of the preset type that the first port needs to forward (denoted as A0) can be set as W0, and the weight of the bandwidth currently occupied by the first port (denoted as A1) can be set as W1. In this way, the weight of the cache currently occupied by the first port (denoted as A2) can be (100-W0-W1). Therefore, the first state value can be calculated using the following formula:

[0143] First state value = (A0W0+A1W1+A2(100-W0-W1)) / 100

[0144] Wherein, W0 and W1 can be 0, and A0W0 in the above formula represents the number of flows of the preset type that the first port needs to forward multiplied by the weight W0. The operations between other parameters are similar and will not be described in detail.

[0145] Exemplarily, the currently occupied bandwidth and the currently occupied cache can also be converted into gear values ​​for calculation. For example, the port cache percentage of 0-30% belongs to gear 1, 30-90% belongs to gear 2, and 90-100% belongs to gear 3. For another example, the port cache occupancy between 0-30Gbps belongs to gear 1, 30-90Gbps belongs to gear 2, and 90-100Gbps belongs to gear 3. For another example, the port cache occupancy between 0-200KB belongs to gear 1, 200KB-1MB belongs to gear 2, and more than 1MB belongs to gear 3.

[0146] For another example, the state value 1 may be determined according to the number of flows of a preset type that the first port needs to forward, and the state value 2 may be determined according to the bandwidth currently occupied by the first port. The state value 1 and the state value 2 correspond to the threshold 1 and the threshold 2, respectively. If the magnitude relationship between the state value 1 and the threshold 1, and the magnitude relationship between the state value 2 and the threshold 2 meet the preset condition, it can be determined that the first network device determines that the state of the first port meets the preset condition.

[0147] For another example, the state value 3 may be determined according to the buffer currently occupied by the first port, and the state value 3 corresponds to the threshold value 3. If any one of the state value 1, the state value 2 and the state value 3 satisfies the magnitude relationship with the corresponding threshold value 1, the threshold value 2 or the threshold value 3, it can be determined that the first network device determines that the state of the first port satisfies the preset condition.

[0148] Exemplarily, a state value can be determined according to the number of flows of a preset type that need to be forwarded by the first port, and another state value can be determined according to the bandwidth currently occupied by the first port. The two state values ​​are compared with corresponding thresholds respectively. If both state values ​​are less than the thresholds corresponding to the two state values, the state of the first port meets the preset conditions.

[0149] When determining that the first port is a forwarding port, the embodiment of the present application will also determine whether the state of the first port meets the preset conditions. Specifically, at least one state value of the port can be determined based on the bandwidth currently occupied by a port and at least one of the caches currently occupied by the port and the number of flows of the preset type that the port needs to forward, and whether the port meets the preset conditions can be determined based on the size relationship between the at least state value and at least one preset threshold. In this way, each port forwards the flow within its own limit, avoiding the disadvantageous situation that multiple messages are congested in the same port, so that the flow is more evenly distributed, improving the effect of load balancing.

[0150] Optionally, the method further includes: after the tail packet of the first flow is sent out, the message forwarding device deletes the first table entry in the first flow table.

[0151] The tail packet of the first flow refers to the last message of the first flow. When the message is sent, all messages in the first flow have been sent. At this time, the first table entry corresponding to the first flow in the first flow table may not be enabled again, but the first table entry occupies the flow table resources, reducing the efficiency of looking up the flow table, thereby reducing the efficiency of forwarding messages.

[0152] In some embodiments, the first network device can identify the tail packet.

[0153] In other embodiments, the second network device may identify the tail packet and send information indicating the tail packet of the first flow to the first network device.

[0154] For example, the first network device or the second network device may identify the message as the tail packet of the first flow according to a field carried by the message.

[0155] In related technical solutions, an aging time is usually set for a table entry. When the aging time expires, the table entry will be deleted from the flow table. However, the aging time of the table entry is difficult to grasp. If it is set too early, subsequent messages cannot find the table entry, which reduces the efficiency of forwarding messages. If it is set too late, the table entry will occupy flow table resources, reducing the speed of finding the flow table, thereby reducing the efficiency of forwarding messages. The embodiment of the present application deletes the first table entry after the tail packet of the first flow is sent out, so that the aging of the flow table is more accurate and the efficiency of forwarding messages is improved.

[0156] Optionally, the message forwarding device includes a first network device. Before determining that the state of the first port meets a preset condition, the method further includes: the first network device determines the type of the first flow according to the message of the first flow; and determines that the type of the first flow is the preset type.

[0157] The first network device may obtain the type of the first flow and determine that the type of the first flow is a preset type. In this case, a judgment is made as to whether the state of the first port meets a preset condition.

[0158] Optionally, before determining whether the state of the first port meets a preset condition, the method further includes: receiving indication information, where the indication information is used to instruct the first network device to determine a port for the first flow.

[0159] Specifically, the second network device may identify the type of the first flow and determine that the type of the first flow is a preset type. Then, the second network device may send indication information to the first network device, and the indication information may be used to instruct the first network device to determine a port for the first flow.

[0160] It should be noted that the indication information may be explicitly indicated, for example, the information carried by the indication information directly instructs the first network device to determine a port for the first flow.

[0161] The indication information may also be implicitly expressed, for example, the indication information includes information of the first flow (such as a five-tuple, a flow label, etc.), and when the first network device receives the indication information including the information of the first flow, the first network device may determine a port for the first flow. In the case of implicit expression, the second network device may also send the message to the first network device.

[0162] In addition, determining that the first flow table does not include an entry corresponding to the first flow may be performed by the first network device or the second network device, and this application does not limit this.

[0163] Optionally, the method also includes: the message forwarding device determines that the type of the second flow is the preset type; the message forwarding device determines that the state of the first port does not meet the preset condition, and selects the second port of the message forwarding device; the message forwarding device determines that the state of the second port meets the preset condition; and the message forwarding device forwards the message of the first flow through the second port.

[0164] It can be understood that when the network device determines that the state of a port does not meet the preset condition, it can determine whether the state of the next port meets the preset condition.

[0165] In some embodiments, if all ports do not meet the preset conditions, the network device may select a port with the smallest bandwidth load as a forwarding port.

[0166] When the state of a port does not meet the preset condition, the message forwarding device can determine whether the state of the next port meets the preset condition, and if so, forward the message of the flow through the port. The message forwarding method provided by the present application can make the flow more evenly distributed and improve the effect of load balancing.

[0167] Combined with the above Figure 7 The method embodiments of the present application are described in detail. The device embodiments of the present application are described below. The device embodiments correspond to the method embodiments, so the parts not described in detail can refer to the previous method embodiments. The device can implement any possible implementation of the above method.

[0168] The present application also provides a message forwarding device, such as Figure 8 As shown, it includes: a determination module, used to determine that the type of the first flow is a preset type; a processing module, used to determine that the state of the first port meets the preset conditions according to the number of flows of the preset type that need to be forwarded by the first port of the message forwarding device; and a forwarding module, used to forward the message of the first flow through the first port.

[0169] The message forwarding device also includes at least one input port and at least one output port. The message forwarding device receives messages through the input port and forwards messages through the output port.

[0170] The determination module, the processing module and the forwarding module can all be implemented by software or by hardware. For example, the implementation of the processing module is described below by taking the processing module as an example. Similarly, the implementation of the determination module and the forwarding module can refer to the implementation of the processing module.

[0171] As an example of a software functional unit, a processing module may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the above-mentioned computing instance may be one or more. For example, the processing module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.

[0172] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0173] As an example of a hardware functional unit, the processing module may include at least one computing device, such as a server, etc. Alternatively, the processing module may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0174] The multiple computing devices included in the processing module can be distributed in the same region or in different regions. The multiple computing devices included in the processing module can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the processing module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0175] It should be noted that, in other embodiments, the determination module can be used to execute any step in the message forwarding method, the processing module can be used to execute any step in the message forwarding method, and the forwarding module can be used to execute any step in the message forwarding method. The steps that the determination module, the processing module and the forwarding module are responsible for implementing can be specified as needed. The full functions of the message forwarding device are realized by respectively implementing different steps in the message forwarding method through the determination module, the processing module and the forwarding module.

[0176] The present application also provides a computing device 900. Fig. 9 As shown, the computing device 900 includes: a bus 902, a processor 904, a memory 906, and a communication interface 908. The processor 904, the memory 906, and the communication interface 908 communicate through the bus 902. The computing device 900 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 900.

[0177] The bus 902 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The bus 904 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 904 may include a path for transmitting information between various components of the computing device 900 (eg, the memory 906, the processor 904, and the communication interface 908).

[0178] The processor 904 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0179] The memory 906 may include a volatile memory, such as a random access memory (RAM). The processor 904 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0180] The memory 906 stores executable program codes, and the processor 904 executes the executable program codes to respectively implement the functions of the aforementioned determination module, processing module, and forwarding module, thereby implementing the message forwarding method. That is, the memory 906 stores instructions for executing the message forwarding method.

[0181] The communication interface 908 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or communication networks. For example, the communication interface 908 may include Figure 8 The computing device 900 receives a message through the ingress port and forwards the message through the egress port.

[0182] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0183] like Fig.10 As shown, the computing device cluster includes at least one computing device 900. The memory 906 in one or more computing devices 900 in the computing device cluster may store the same instructions for executing the message forwarding method.

[0184] In some possible implementations, the memory 906 of one or more computing devices 900 in the computing device cluster may also store partial instructions for executing the message forwarding method. In other words, the combination of one or more computing devices 900 may jointly execute the instructions for executing the message forwarding method.

[0185] It should be noted that the memory 906 in different computing devices 900 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the message forwarding device. That is, the instructions stored in the memory 906 in different computing devices 900 can implement the functions of one or more modules among the determination module, the processing module and the forwarding module.

[0186] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network, etc. Fig.11 A possible implementation is shown. Fig.11 As shown, two computing devices 900A and 900B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 906 in the computing device 900A stores instructions for executing the functions of the processing module. At the same time, the memory 906 in the computing device 900B stores instructions for executing the functions of the determination module and the forwarding module.

[0187] Fig.11 The connection mode between the computing device clusters shown may be that considering that the forwarding message method provided in the present application requires a large number of judgments on whether the status of each port meets the preset conditions and a large number of forwarding messages, it is considered to hand over the functions implemented by the forwarding module to the computing device 900B for execution. For example, the computing device 900A may be Figure 5 The first network device, computing device 900B may be Figure 5 The second network device.

[0188] It should be understood that Fig.11 The functions of the computing device 900A shown in FIG. 9A may also be completed by multiple computing devices 900. Similarly, the functions of the computing device 900B may also be completed by multiple computing devices 900.

[0189] In some embodiments, the message forwarding method and message forwarding device provided in the embodiments of the present application can also be applied to the Clos network architecture. The Clos network architecture is a multi-stage switching architecture that can reduce the number of intermediate cross points as much as possible when the input and output increase. The Clos network can use multiple small-scale, low-cost units to build complex, large-scale networks. A simple Clos network is a three-level interconnection architecture, including an input level, an intermediate level, and an output level.

[0190] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the above-mentioned message forwarding method.

[0191] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by the computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned forwarding message method.

[0192] If this 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 application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0193] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for forwarding a message, characterized in that: include: The message forwarding device determines that the type of the first flow is a preset type; The message forwarding device determines, according to the number of flows of the preset type that need to be forwarded by the first port of the message forwarding device, that the state of the first port meets the preset condition; The message forwarding device forwards the message of the first flow through the first port.

2. The method according to claim 1, characterized in that The preset type is elephant flow, or throughput sensitive type.

3. The method according to claim 1 or 2, characterized in that: The determining that the state of the first port meets a preset condition includes: When the number of flows of the preset type that need to be forwarded by the first port is greater than or equal to a threshold of the number of flows, it is determined that the state of the first port meets the preset condition.

4. The method according to claim 1 or 2, characterized in that: The determining that the state of the first port meets a preset condition includes: According to the number of flows of the preset type that need to be forwarded by the first port, and at least one of a bandwidth currently occupied by the first port and a buffer currently occupied by the first port, it is determined that the state of the first port meets the preset condition.

5. The method according to claim 4, characterized in that The determining that the state of the first port meets a preset condition includes: Determine at least one state value according to the number of flows of the preset type that need to be forwarded by the first port, and at least one of a bandwidth currently occupied by the first port and a cache currently occupied by the first port; It is determined that the state of the first port meets the preset condition according to a magnitude relationship between the at least one state value and the at least one threshold, wherein there is a one-to-one correspondence between the at least one state value and the at least one threshold.

6. The method according to claim 1 or 2, characterized in that: Also includes: The message forwarding device determines that the type of the second flow is the preset type; The message forwarding device determines that the state of the first port does not meet the preset condition, and selects the second port of the message forwarding device; The message forwarding device determines that the state of the second port meets the preset condition; the message forwarding device forwards the message of the second flow through the second port.

7. A message forwarding device, characterized in that: include: A determination module, used to determine that the type of the first flow is a preset type; A processing module, configured to determine, based on the number of flows of the preset type that need to be forwarded by the first port of the message forwarding device, that the state of the first port meets a preset condition; A forwarding module is used to forward the message of the first flow through the first port.

8. The device according to claim 7, characterized in that The preset type is elephant flow, or throughput sensitive type.

9. The device according to claim 7 or 8, characterized in that The processing module is specifically used for: When the number of flows of the preset type that need to be forwarded by the first port is greater than or equal to a threshold of the number of flows, it is determined that the state of the first port meets the preset condition.

10. The device according to claim 7 or 8, characterized in that The processing module is specifically used for: According to the number of flows of the preset type that need to be forwarded by the first port, and at least one of a bandwidth currently occupied by the first port and a buffer currently occupied by the first port, it is determined that the state of the first port meets the preset condition.

11. The device according to claim 10, characterized in that The processing module is specifically used for: Determine at least one state value according to the number of flows of the preset type that need to be forwarded by the first port, and at least one of a bandwidth currently occupied by the first port and a cache currently occupied by the first port; It is determined that the state of the first port meets the preset condition according to a magnitude relationship between the at least one state value and the at least one threshold, wherein there is a one-to-one correspondence between the at least one state value and the at least one threshold.

12. The device according to claim 7 or 8, characterized in that The determining module is further configured to determine that the type of the second stream is the preset type; Wherein, the processing module is further used to determine that the state of the first port does not meet the preset condition, and select the second port of the message forwarding device; The processing module is further used to determine that the state of the second port meets the preset condition; The forwarding module is also used for the message forwarding device to forward the message of the second flow through the second port.

13. A computing device, characterized in that: The method comprises a processor and a memory, wherein the processor is configured to execute instructions stored in the memory so that the computing device executes the method according to any one of claims 1 to 6.

14. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 6.

15. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device, the computing device is caused to perform the method according to any one of claims 1 to 6.

16. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 6.

17. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computing device, the computing device performs the method as claimed in any one of claims 1 to 6.

18. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and apparatus for implementing load balance

    CN101478480A

  • Data center network routing method based on Fat-Tree structure

    CN106533960A

  • Method for realizing ECMP flow load balancing and electronic equipment

    CN114095441A

Cited By

  • Data processing method and apparatus, and network device

    WO2026066754A1