Traffic forwarding method, network element device, storage medium and program product

By integrating load balancing decision and execution logic into network element devices, and combining hash distribution information and dynamic path mapping mechanisms, the problems of uneven ECMP traffic distribution and path congestion are solved, achieving efficient load balancing management and fast response, and improving the traffic scheduling capability of large-scale networks.

CN121728009APending Publication Date: 2026-03-24ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, uneven traffic distribution and path congestion in ECMP lead to low efficiency in load balancing, making it difficult to meet the high-efficiency traffic scheduling requirements of large-scale networks. Centralized controller solutions are limited by the performance and scalability of the external control plane, while terminal host solutions face challenges in protocol stack modification and standardized deployment.

Method used

By integrating load balancing decision and execution logic into network element devices, the target traffic exit path is dynamically determined based on traffic load balancing conditions. Traffic load information is collected through a mapping mechanism between hash distribution information and traffic exit path, combined with software polling and hardware push. Ant colony algorithm and hybrid optimization algorithm are used to dynamically adjust the path mapping relationship, thereby achieving real-time perception and rapid decision-making.

Benefits of technology

It improves the implementation efficiency and response speed of load balancing, enhances the network's scalability, meets the traffic scheduling needs of large-scale networks, avoids dependence on external devices, and realizes automated and precise management of load balancing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121728009A_ABST
    Figure CN121728009A_ABST
Patent Text Reader

Abstract

The invention relates to a traffic forwarding method, network element equipment, a storage medium and a program product, and the method comprises the steps: responding to the received target network traffic, and determining a target traffic exit path of the target network traffic based on a traffic load balancing condition; forwarding the target network traffic through the target traffic exit path; according to the method, decision and execution logic of load balancing are integrated into the network element equipment, and the implementation efficiency and the response speed of load balancing are improved by locally performing real-time perception and rapid decision while the flow unevenness and the performance bottleneck are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of traffic forwarding, and in particular to a traffic forwarding method, a network element device, a storage medium and a program product. BACKGROUND

[0002] In the prior art, in view of the defects of uneven traffic distribution and path congestion of traditional ECMP (Equal-Cost Multi-Path), network load balancing is usually implemented through a centralized controller scheme or a terminal host scheme; however, the centralized controller scheme is severely restricted in processing performance and system scalability due to its dependence on an external control plane, and the terminal host scheme needs to modify the terminal protocol stack or application program, and faces the problems of standardization and large-scale deployment in a heterogeneous network environment; both of the above two schemes are low in implementation efficiency of load balancing and limited in overall expansion capability due to external dependency at the architecture level, and it is difficult to meet the needs of large-scale networks for efficient traffic scheduling. SUMMARY

[0003] Embodiments of the present application provide a traffic forwarding method, a network element device, a storage medium and a program product, which can improve the implementation efficiency and response speed of load balancing while overcoming uneven traffic and performance bottlenecks. The technical solution is as follows.

[0004] In a first aspect, a traffic forwarding method is provided, applied to a network element device, and the method comprises: determining a target traffic egress path of the target network traffic based on a traffic load balancing condition in response to receiving the target network traffic; forwarding the target network traffic through the target traffic egress path.

[0005] In a second aspect, a network element device is provided, comprising a processor and a memory, and the memory stores at least one computer program, which is loaded and executed by the processor to implement the above traffic forwarding method.

[0006] In a third aspect, a computer readable storage medium is provided, which stores at least one computer program, and the computer program is loaded and executed by a processor to implement the above traffic forwarding method.

[0007] In a fourth aspect, a computer program product is provided, which comprises a computer program stored on a non-transitory computer readable storage medium, and the computer program comprises program instructions, which, when executed by a computer, cause the computer to perform the above traffic forwarding method.

[0008] The traffic forwarding method provided in this application is applied to network element devices. When a network element device receives target network traffic, it determines the target traffic exit path based on traffic load balancing conditions. Then, it forwards the target network traffic through the target traffic exit path. By integrating the load balancing decision-making and execution logic into the network element device itself, it overcomes traffic unevenness and performance bottlenecks. It also improves the implementation efficiency and response speed of load balancing by performing real-time perception and rapid decision-making locally. At the same time, since it does not rely on external devices, it can improve the overall scalability and meet the traffic scheduling needs of large-scale networks.

[0009] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0010] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0011] Figure 1 A flowchart of the traffic forwarding method provided in an embodiment of this application is shown; Figure 2 A schematic diagram of the traffic exit path determination process provided in an embodiment of this application is shown; Figure 3 This illustration shows a schematic diagram of traffic load information collection via software polling, provided in an embodiment of this application. Figure 4 This illustration shows a schematic diagram of traffic load information collection via hardware push according to an embodiment of this application; Figure 5 A schematic diagram of the path update operation provided in this application is shown; Figure 6 This illustration shows a schematic diagram of the process of updating mapping relationships based on the ant colony algorithm provided in an embodiment of this application; Figure 7 This illustration shows a process for updating mapping relationships using a hybrid optimization algorithm, as provided in an embodiment of this application. Figure 8 This illustration shows a mapping relationship replacement diagram provided in an embodiment of this application; Figure 9 A framework diagram of the traffic forwarding system provided in an embodiment of this application is shown. Detailed Implementation

[0012] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of methods consistent with some aspects of this application as detailed in the appended claims.

[0013] This application provides a traffic forwarding method that integrates load balancing decision-making and execution logic into the network element itself. This overcomes traffic unevenness and performance bottlenecks while improving load balancing implementation efficiency and response speed through real-time local sensing and rapid decision-making. Furthermore, since it does not rely on external devices, it enhances overall scalability and meets the traffic scheduling needs of large-scale networks. Figure 1 A flowchart of a traffic forwarding method provided in an embodiment of this application is shown. This method can be applied to network element devices, which are network devices that perform traffic forwarding, such as switches and routers.

[0014] For example, this traffic forwarding method can be applied to network elements in operator backbone networks, network elements in cloud service providers, and enterprise network devices in enterprise-level interconnected networks.

[0015] like Figure 1 As shown, the traffic forwarding method may include the following steps.

[0016] Step 110: Upon receiving the target network traffic, the network element device determines the target traffic exit path of the target network traffic based on the traffic load balancing conditions.

[0017] In this embodiment of the application, the network element device can perform local traffic monitoring through the data forwarding plane and receive target network traffic to be forwarded. The target network traffic can be composed of multiple independent target packets. Each packet can correspond to a different network connection or application session and contains five-tuple information for identifying the communication entity, including: source IP address, destination IP address, source port number, destination port number, and transport layer protocol.

[0018] When selecting the exit path for target traffic, network elements can dynamically determine the corresponding exit path for each packet in the received target traffic based on traffic load balancing conditions. In other words, the traffic exit path corresponding to each packet is not fixed, but will be dynamically adjusted as the network load changes, thereby ensuring that the overall network load distribution meets the preset traffic load balancing conditions.

[0019] Step 120: Forward the target network traffic through the target traffic exit path.

[0020] Network elements perform forwarding operations in the data forwarding plane, sending out target network traffic according to the determined target egress path. During the forwarding process, network elements can update the egress path mapping relationship in the data plane based on the dynamically adjusted results, and forward traffic based on the updated egress path mapping relationship, thereby ensuring that target network traffic is transmitted along the optimal or balanced path.

[0021] In summary, the traffic forwarding method provided in this application is applied to network element devices. Upon receiving target network traffic, the network element device determines the target traffic exit path based on traffic load balancing conditions. Then, it forwards the target network traffic through the target traffic exit path. This method integrates load balancing decision-making and execution logic within the network element device itself. While overcoming traffic unevenness and performance bottlenecks, it also improves the implementation efficiency and response speed of load balancing through real-time local perception and rapid decision-making. Furthermore, since it does not rely on external devices, it enhances overall scalability and meets the traffic scheduling needs of large-scale networks.

[0022] In some embodiments, in step 110, determining the target traffic egress path for the target network traffic based on traffic load balancing conditions may involve the following steps: Determine the target hash distribution information for each target packet in the target network traffic; Based on the preset mapping relationship between hash distribution information and traffic exit path, determine the backup traffic exit path corresponding to each target hash distribution information; Based on the traffic load balancing conditions and the backup traffic exit path corresponding to each target hash distribution information, the target traffic exit path of each target packet in the target network traffic is determined.

[0023] The target hash distribution information for each target packet can be obtained by hashing the five-tuple of each target packet. For example, the hash calculation process can be: taking the five-tuple of the packet as input, calculating through a predetermined hash function, and outputting a hash calculation result. The hash function can be a modulo operation after hashing the five-tuple, or it can be an offset addition modulo operation, that is, introducing a preset or dynamic offset before the standard modulo operation, and performing the modulo operation based on the added offset. In addition, the target hash distribution information for each target packet can also be based on a variety of other features or strategies, such as: taking the extended header information carried by the packet as input, which includes at least one of MPLS (Multiprotocol Label Switching) label, VLAN (Virtual Local Area Network) identifier, IPv6 (Internet Protocol version 6) flow label, or segment routing identifier.

[0024] The target hash distribution information of the target packet can be determined based on the hash calculation result. In one possible implementation, the hash calculation result is the target hash distribution information of the target packet, and the network element can maintain a preset mapping relationship between the hash distribution information and the traffic egress path. After obtaining the target hash distribution information of the target packet, the network element can uniquely determine the backup traffic egress path corresponding to the target packet by querying the mapping relationship.

[0025] In another possible implementation, the pre-defined mapping relationship between hash distribution information and traffic egress paths can be represented in other forms. For example, network elements can maintain logical member mapping relationships corresponding to the pre-defined mapping relationship between hash distribution information and traffic egress paths. This relationship can be represented as a logical member mapping table or logical member key-value pairs. Each logical member (also called a hash bucket) is mapped to its corresponding traffic egress path. In this case, after obtaining the hash calculation result of the packet, the hash calculation result can hit one of the logical members, which is the target hash distribution information of the target packet. Then, the traffic egress path corresponding to the target packet is determined based on this logical member. For example, in the hash calculation result of the target packet, the logical member can refer to the fact that the value of the hash calculation result of the target packet is the same as the value of the logical member identifier of the logical member. For example, the logical member mapping relationship can be implemented as a logical member mapping table. Figure 2 This illustration shows a schematic diagram of the traffic exit path determination process provided in an embodiment of this application, such as... Figure 2 As shown, the logical member mapping table defines the mapping relationship from "logical members" to "traffic exit paths".O =[ o 0, o 1, ..., o i ,..., o m 1], where m is the number of logical members. o i The value represents the identifier of the "traffic exit path" to which the logical member i is mapped, such as the mapping from index0 to path0 (index0 represents a logical member whose hash calculation result is 0, and path0 represents one of the traffic exit paths). o 1 (where 1 represents index1) = 0 (where 0 represents path0). When determining the traffic egress path, for a target packet, after performing a hash calculation modulo operation on the five-tuple of the target packet, the hash calculation result corresponding to the target packet can be obtained. Based on the hash calculation result corresponding to the target packet, its corresponding logical member can be determined. For example, if the hash calculation result of the target packet is 0, its matched logical member is index0; if the hash calculation result of the target packet is 1, its corresponding logical member is index1, and so on. Then, based on the mapping relationship between the logical member and the traffic egress path, the traffic egress path corresponding to the target packet can be determined, and this traffic egress path can be designated as the backup traffic egress path for the target packet.

[0026] Before forwarding packets, network element devices can also perform load balancing judgment based on the backup traffic egress paths and traffic load balancing conditions corresponding to each target hash distribution information to determine whether it is necessary to adjust the traffic egress paths of each target packet in the target network traffic. If the load balancing conditions are met, the packets are forwarded directly according to the backup traffic egress paths of each target packet. If the conditions are not met, the mapping relationship between hash distribution information and traffic egress paths is readjusted with the load balancing conditions as the optimization target. Based on the new mapping relationship between hash distribution information and traffic egress paths obtained after the adjustment, the target traffic egress paths of each target packet in the target network traffic are determined.

[0027] By introducing a mapping mechanism between hash distribution information and traffic exit paths, an initial allocation of exit paths for traffic is achieved. Simultaneously, by dynamically adjusting the pre-allocated paths in conjunction with traffic load balancing conditions, the system can flexibly respond to changes in network load, ensure load balancing, and improve overall link utilization and forwarding efficiency.

[0028] In some embodiments, based on traffic load balancing conditions and the backup traffic egress path corresponding to each target hash distribution information, the target traffic egress path for each target packet in the target network traffic is determined, including the following steps: Based on the backup traffic exit path corresponding to each target hash distribution information, determine the traffic distribution quality of the traffic exit path; In response to the traffic distribution quality of the traffic egress path satisfying the traffic load balancing condition, the backup traffic egress path corresponding to each target hash distribution information is used as the target traffic egress path for each target packet in the target network traffic.

[0029] When determining whether a backup traffic exit path meets the traffic load balancing conditions, you can first determine the traffic distribution quality of the traffic exit path, and then use the traffic distribution quality to determine whether the backup traffic exit path meets the traffic load balancing conditions.

[0030] To assess the traffic distribution quality along the traffic egress path, in this embodiment, the network element can be configured with a counter for each hash distribution information. This counter is used to statistically analyze the traffic load of the corresponding hash distribution information, collecting traffic load information for each hash distribution information. Schematic, the counter for each hash distribution information can be represented as... C =[ c 0, c 1, ..., c i ,..., c m 1], each element c i It records the traffic load of hash distribution information i within a unit of time; wherein, the network element device collects traffic information in the form of software polling and hardware push. Figure 3 This illustration shows a schematic diagram of traffic load information collection via software polling, as provided in an embodiment of this application. Figure 3 As shown, the network element device uses a software timer driven by the CPU (Central Processing Unit) to send a read command to the network processor's statistical data storage via the chip's SDK (Software Development Kit) to read the traffic load information counted by the counter from the statistical data storage and store it locally. Figure 4 This illustration shows a schematic diagram of traffic load information collection via hardware push according to an embodiment of this application, such as... Figure 4 As shown, the network processor chip can push the traffic load information counted by the counter to the CPU in real time or periodically through the DMA (Direct Memory Access) channel.

[0031] After collecting the traffic load information from each counter, the network element can use the CPU to evaluate the traffic distribution quality of the traffic outgoing path to determine whether the traffic load balancing conditions are met.

[0032] By analyzing the quality of traffic distribution along the traffic exit path, it can be determined whether the traffic load balancing conditions are met. Network elements can quantitatively analyze the load dispersion between each path, identify whether there is load imbalance or path congestion, and more accurately reflect the actual traffic scheduling balance, thus providing a basis for dynamically adjusting the mapping relationship.

[0033] In some embodiments, the traffic distribution quality of the traffic outflow path can be evaluated using two metrics, which can be applied independently or in combination. When applied independently, if either metric fails to meet its corresponding criteria, the traffic distribution quality is deemed not to meet the traffic load balancing condition. When applied in combination, if either metric fails to meet its corresponding criteria, the traffic distribution quality is deemed not to meet the traffic load balancing condition. Only when both metrics meet their respective criteria is the traffic distribution quality deemed to meet the traffic load balancing condition.

[0034] One possible metric is load imbalance, which refers to the quality of traffic distribution along a traffic exit path. Load imbalance characterizes the degree to which the target traffic load distribution of each traffic exit path deviates from the corresponding ideal traffic load distribution. In this case, the traffic load balancing condition includes: the load imbalance is lower than a first preset threshold.

[0035] In other words, load imbalance is a quantitative indicator that measures whether network traffic is evenly distributed across all exit paths. A higher load imbalance indicates that traffic is concentrated on a few paths, resulting in poorer overall load balancing. Conversely, a lower load imbalance indicates that traffic distribution is closer to the ideal state, resulting in better balancing. In this embodiment, a first preset threshold is set to evaluate load imbalance. When the load imbalance exceeds the first preset threshold, it indicates a severe load imbalance, requiring mapping adjustments to migrate traffic from heavily loaded paths to lightly loaded paths. When the load imbalance is below the first preset threshold, it indicates that the load imbalance is within an acceptable range, requiring no adjustment. This mapping adjustment method, triggered by a clearly defined threshold, automates and refines load balancing management, avoiding unnecessary frequent adjustments.

[0036] In some embodiments, the method for determining load imbalance includes the following steps: Based at least on the target traffic load of each target hash distribution information and the preset mapping relationship between hash distribution information and traffic exit path, determine the target traffic load distribution of each traffic exit path; The load imbalance degree is obtained by normalizing and summing the deviations between the flow load distribution and the corresponding ideal flow load distribution of each flow outlet path.

[0037] In other words, for the target network traffic to be processed, network elements can determine the target traffic load corresponding to the target network traffic carried by each traffic egress path through a two-level data aggregation method. This two-level data aggregation includes packet-level to hash-level aggregation and hash-level to path-level aggregation. Packet-level to hash-level aggregation means that the traffic load of each target hash distribution information is the sum of the traffic loads of all packets with the same hash distribution information. For example, if five packets all have a hash distribution of "1", and each packet has a total byte count of 10MB, their total byte count is 50MB, then the target traffic load of hash distribution information "1" is 50MB. Hash-level to path-level aggregation means that the target traffic load distribution of each traffic egress path is the sum of the target traffic loads of all target hash distribution information that has a mapping relationship with that traffic egress path. For example, the target traffic load of all traffic egress paths is defined as a vector. S =[ s 0, s 1, ..., s i ,..., s k-1 ], where k is the total number of traffic exit paths (in terms of... Figure 2 For example, k=4, meaning there are 4 traffic exit paths: path0, path1, path2, and path3. s i This represents the sum of traffic loads for all hash distributions mapped to traffic exit path i, for example, Figure 2 In the example shown, s 2 represents the sum of traffic load for all logical members index3 and index4... corresponding to path2.

[0038] It should be noted that the parameters of traffic load can be defined based on actual needs. For example, traffic load can refer to traffic bandwidth, number of session connections, number of packets, etc. This application embodiment does not limit this.

[0039] When determining the target traffic load distribution for each traffic egress path, network elements can employ various methods. One possible implementation is to directly determine the traffic load distribution calculated from the aggregation of data from the two levels as the final target traffic load distribution for each traffic egress path. Another possible implementation, to obtain an evaluation basis that more closely reflects the actual network conditions, allows network elements to consider not only the target network traffic itself (i.e., the hash distribution information of each packet and its traffic load) but also real-time network status information for comprehensive correction. This real-time status information can include the current congestion status of each traffic egress path, historical load data, etc. In this way, the final target traffic load distribution for each traffic egress path will be composed of the traffic load distribution based on the target network traffic and the correction information reflecting the actual network status, thereby improving the accuracy and reliability of subsequent assessments of traffic distribution quality.

[0040] Network elements can store the ideal traffic load distribution corresponding to each traffic outgoing path. Schematic, the ideal traffic load distribution corresponding to each traffic outgoing path is defined as a vector W = [w0, w1, ..., w...]. i , ..., w k-1 ], w i This represents the expected traffic load distribution of traffic exit path i under pre-configured weights. For example, with the weight ratio of path0-3 being [10, 10, 100, 100], the ideal traffic load distribution of 440M traffic distributed across the four traffic exit paths is W=[20, 20, 200, 200]. It should be noted that the above weight configuration is only illustrative and is not limited in this embodiment.

[0041] After determining the target traffic load distribution for each traffic outflow path, the network element can calculate the load imbalance by combining the ideal traffic load distribution corresponding to each traffic outflow path. Illustratively, this load imbalance can be the normalized sum of the absolute deviations between the traffic load distribution of each traffic outflow path and its corresponding ideal traffic load distribution. In this case, the formula for calculating the load imbalance can be expressed as:

[0042] in, This indicates the mapping relationship between the preset hash distribution information and the traffic exit path. The following is an example of imbalance, where k represents the total number of traffic exit paths, j represents the index value of the traffic exit path, and s... j w represents the traffic load distribution of the traffic exit path j. j This represents the ideal flow load distribution for the flow exit path j.

[0043] After determining the load imbalance, the network element can compare the load imbalance with a first preset threshold. If the load imbalance is lower than the first preset threshold, it means that the current network load is balanced based on the load imbalance. If the load imbalance is not lower than the first preset threshold, it means that the current network load is unbalanced based on the load imbalance.

[0044] Another measurement method is the traffic fluctuation value, that is, the traffic distribution quality of the traffic exit path includes: the traffic fluctuation value, which represents the degree of traffic load fluctuation corresponding to each hash distribution information; in this case, the traffic load balancing condition includes: the traffic fluctuation value corresponding to each hash distribution information is lower than the second preset threshold.

[0045] In other words, the traffic fluctuation value focuses on the stability of traffic changes within the hash distribution information, and is used to quantify the severity of traffic changes carried by the hash distribution information. By setting a second preset threshold, the computer equipment can assess the load stability of each hash distribution information. In one possible implementation, when the traffic fluctuation of the hash distribution information continuously exceeds the second preset threshold and forms a stable abnormal trend, load balancing adjustment is triggered. When the traffic fluctuation value corresponding to each hash distribution information is lower than the second preset threshold, it is determined that the current state is load balanced and no adjustment is required. This can avoid unnecessary path switching and network oscillation caused by short-term jitter, and ensure the transmission stability and service quality of critical business flows while improving link utilization.

[0046] In some embodiments, the method for determining the traffic fluctuation value includes: determining the traffic fluctuation value corresponding to each hash distribution information based at least on the traffic load of each hash distribution information within a consecutive multiple time windows.

[0047] The time length and number of time windows can be set based on actual needs. For each hash distribution information, the network element device can obtain its traffic load in multiple consecutive time windows from the corresponding counter, and then determine the traffic fluctuation value corresponding to each hash distribution information.

[0048] In one possible implementation, the traffic fluctuation value can be the difference between the maximum and minimum values ​​of the traffic load of the hash distribution information over multiple consecutive time windows, or it can be the sum of the cross-entropy of multiple time windows, or it can be the coefficient of variation; wherein, the cross-entropy of each time window is used to evaluate the difference between the traffic load distribution of the hash distribution information within the corresponding time window and the preset ideal traffic load distribution; the coefficient of variation is the ratio of the standard deviation to the average value of the traffic load of the hash distribution information over multiple consecutive time windows.

[0049] After determining the traffic fluctuation value corresponding to each hash distribution information, the network element can compare the traffic fluctuation value corresponding to each hash distribution information with a second preset threshold. If the traffic fluctuation value corresponding to each hash distribution information is lower than the second preset threshold, or if the number of hash distribution information with traffic fluctuation values ​​lower than the second preset threshold is greater than the first preset quantity threshold, then the current network load balance is determined based on the traffic fluctuation value corresponding to each hash distribution information. If each hash distribution information contains hash distribution information with corresponding traffic fluctuation values ​​higher than the second preset threshold, or if the number of hash distribution information with traffic fluctuation values ​​higher than the second preset threshold is greater than the second preset quantity threshold, then the current network load imbalance is determined based on the traffic fluctuation value corresponding to each hash distribution information.

[0050] By using traffic fluctuation values ​​as the basis for determining the load balancing status, dynamic perception and quantitative assessment of network load stability can be achieved, avoiding misjudgments caused by instantaneous load changes. Thus, in complex scenarios of local abnormal fluctuations and global load imbalance, traffic scheduling optimization can be adaptively triggered to improve network resource utilization efficiency and service quality stability.

[0051] In some embodiments, after determining the traffic distribution quality of the traffic outflow path, the method further includes the following steps: In response to the traffic distribution quality of the traffic egress path not meeting the traffic load balancing conditions, a new mapping relationship between the hash distribution information and the traffic egress path is determined based on the preset mapping relationship between hash distribution information and traffic egress path, as well as the hash distribution information of each target path. Based on the new mapping relationship between hash distribution information and traffic exit path, a new traffic exit path corresponding to each target hash distribution information is determined, which serves as the target traffic exit path for each target packet in the target network traffic.

[0052] The reason why the traffic distribution quality of the traffic egress path does not meet the traffic load balancing conditions is that the mapping relationship between hash distribution information and traffic egress path does not meet the current packet distribution of network traffic. This results in excessive traffic aggregation on some paths and insufficient traffic on others. In this case, network element devices can enter a dynamic mapping relationship optimization process. Through a series of path update operations, the hash distribution information is dynamically remapped to the allocation of traffic egress paths. Packets are transferred from overloaded traffic egress paths to underutilized traffic egress paths, generating a new mapping relationship between hash distribution information and traffic egress paths. Based on the new mapping relationship, the target traffic egress path for each target packet is determined. Thus, while ensuring the consistency of packet order within the target network data, the load is systematically migrated from overloaded paths to lightly loaded paths, achieving rapid global traffic rebalancing.

[0053] In some embodiments, network elements can determine new mapping relationships through iterative optimization. In this case, based on a preset mapping relationship between hash distribution information and traffic egress paths, and each target hash distribution information, a new mapping relationship between hash distribution information and traffic egress paths is determined, including the following steps: The path change operation is iterated based on a preset dynamic optimization algorithm to obtain a new mapping relationship between hash distribution information and traffic exit path; wherein, the path change operation is used to change the preset mapping relationship between hash distribution information and traffic exit path. The termination conditions for the iteration include: based on the new mapping relationship between hash distribution information and traffic egress paths, and the traffic distribution quality of the determined traffic egress paths satisfies the traffic load balancing condition.

[0054] In some embodiments, the termination condition for iterative optimization may also include the number of iterations reaching a preset iteration threshold, or the iteration duration reaching a preset iteration duration threshold, etc.

[0055] In other words, the optimization objective of this iterative optimization is to ensure that the traffic distribution quality of the traffic outgoing paths meets the traffic load balancing condition. Optionally, the ideal path load of each traffic outgoing path can also be used as a constraint during the iterative optimization process. Under these conditions, multiple new mapping relationships between hash distribution information that meet the requirements and traffic outgoing paths may be generated during the iterative optimization process. In one possible implementation, the network element can determine the first mapping relationship that meets the optimization condition as the new mapping relationship. Alternatively, in another possible implementation, the network element can randomly select one from multiple new candidate mapping relationships as the new mapping relationship. Or, in yet another possible implementation, the network element can select the one with the smallest load imbalance from multiple new candidate mapping relationships as the new mapping relationship.

[0056] In some embodiments, the path update operation during the iteration process includes: path modification operation and / or path swap operation; The path modification operation includes: changing the first traffic exit path corresponding to any hash distribution information to any second traffic exit path, wherein the first traffic exit path and the second traffic exit path are different; The path swapping operation includes swapping the traffic exit paths corresponding to any two hash distribution information.

[0057] Among them, the path modification operation is a relatively independent adjustment that migrates the traffic load of hash distribution information from one traffic exit path to another; the path exchange operation is a paired adjustment that swaps the traffic load between different traffic exit paths. By executing the two operations individually or in combination, different load distribution schemes can be explored to gradually divert the traffic load from congested paths to idle paths.

[0058] Taking path swapping operations as an example, Figure 5 A schematic diagram of the path update operation provided in this application is shown, such as... Figure 5 As shown, in Figure 2 Based on this, by swapping the traffic exit paths corresponding to index0 and indexN-1, the original mapping relationship between index0 and traffic exit path 0 is updated to the mapping relationship between index0 and traffic exit path 3.

[0059] In some embodiments, the dynamic optimization algorithm is a metaheuristic algorithm, or a hybrid optimization algorithm formed by combining at least two heuristic algorithms.

[0060] Among them, metaheuristic algorithms are algorithms that explore and utilize the solution space by simulating natural evolution, physical processes or swarm intelligence to approximate the global optimal solution of complex optimization problems. Illustratively, metaheuristic algorithms may include, but are not limited to: genetic algorithms, simulated annealing algorithms, ant colony algorithms, and particle swarm optimization algorithms.

[0061] Taking the ant colony algorithm as an example of a metaheuristic algorithm, the ant colony algorithm solves the load balancing optimization problem by simulating the process of ants finding the optimal path. In the application scenario of this application embodiment, each "ant" in the ant colony algorithm represents a complete path update operation sequence. This path update operation sequence consists of a series of path update operations, such as adjusting hash distribution information 1 from the current traffic exit path path1 to path2. The ant path in the ant colony algorithm is a path update operation sequence constructed by a single ant, representing an adjustment path that evolves from the current mapping relationship to a new mapping relationship. Pheromones in the ant colony algorithm, as a positive feedback mechanism, are stored in specific path update operations. That is, the pheromone concentration is related to the historical benefit of the path update operation of "mapping specific hash distribution information to a specific traffic exit path". If the execution of this strategy in the past improved the quality of traffic distribution, the pheromone concentration in this decision is enhanced, making it more likely to be selected by other "ants" in subsequent iterations. In ant colony optimization, heuristics are used to refer to the estimated value of the immediate, local benefit that a path update operation can bring. For example, it can be used to evaluate the immediate benefit of the operation of "migrating hash distribution information 1 from the current high-load path path1 to the low-load path path2".

[0062] Based on the above definition, Figure 6 This illustration shows a schematic diagram of the process of updating mapping relationships based on the ant colony algorithm provided in an embodiment of this application, such as... Figure 6 As shown, solving the mapping relationship between the optimal hash distribution information and the traffic exit path using the ant colony algorithm can include: Initialize the optimization parameters and pheromone matrix. The optimization parameters may include parameters such as ant colony size and iteration rounds. The pheromone matrix is ​​used to record the historical optimization effect of each candidate path update operation. Perform multiple rounds of iterative optimization until the preset termination condition is met; In each iteration, based on the pheromone matrix and heuristic information reflecting the immediate benefits of the operation, multiple candidate mapping relationships consisting of path update operation sequences are generated in parallel through a probabilistic selection mechanism; the quality of the traffic distribution corresponding to each candidate mapping relationship is evaluated to obtain the evaluation result; the pheromone matrix is ​​updated based on the evaluation result to strengthen the path update operation that guides the high-quality mapping relationship.

[0063] In one possible implementation, updating the pheromone matrix based on the evaluation results may include: globally attenuating all pheromone values ​​in the pheromone matrix; and enhancing the pheromone intensity of the path update operation corresponding to each candidate mapping relationship according to the traffic distribution quality of each candidate mapping relationship, wherein the magnitude of the pheromone enhancement is positively correlated with the traffic distribution quality of the corresponding candidate mapping relationship.

[0064] In addition, to improve search efficiency, an early termination mechanism can be set during the iteration process. That is, for each candidate mapping relationship construction process, if multiple consecutive path update operations fail to improve the traffic distribution quality, the construction process of the candidate mapping relationship will be terminated early.

[0065] Through multiple iterations, the optimal candidate mapping relationship is finally determined from all the generated candidate mapping relationships, and serves as the new mapping relationship between hash distribution information and traffic exit path.

[0066] Using metaheuristic algorithms for load balancing optimization, this algorithm simulates intelligent search mechanisms found in nature or physical processes. It can perform global exploration within a vast path allocation solution space, effectively avoiding getting trapped in local optima. The algorithm possesses strong adaptive capabilities, autonomously and intelligently generating a mapping relationship that balances global balance and local stability as network load conditions dynamically change.

[0067] Hybrid optimization algorithms can be combinations of at least two different heuristic algorithms to integrate their respective advantages and improve solution efficiency and quality. Illustratively, such hybrid optimization algorithms can first use genetic algorithms for global exploration to explore diverse solution spaces, and then combine them with local search algorithms for fast, fine-grained local optimization, thereby achieving fast and effective convergence. Figure 7 This illustration shows a schematic diagram of the process of updating mapping relationships using a hybrid optimization algorithm provided in an embodiment of this application. Figure 7 As shown, the process includes: Initialize the population, which consists of multiple individuals, each representing a sequence of multiple path update operations; Perform genetic iterative optimization until the preset termination condition is met; In each iteration: Calculate the fitness of the mapping relationship corresponding to each individual in the population. This fitness is positively correlated with the quality of the flow distribution corresponding to the mapping relationship. Based on the fitness of the mapping relationship corresponding to each individual, select the parent individual from the current one; Genetic operations are performed on the parent individuals to generate offspring individuals and update the population.

[0068] Based on the results of genetic iterative optimization, a local search is performed to refine the mapping relationship corresponding to the optimal individual obtained, and the new mapping relationship between the hash distribution information determined after the local search and the traffic exit path is output.

[0069] For example, the initial population consists of multiple initial individuals, each containing multiple initialization elements or genes. Each initialization element is a randomly generated path exchange (index1, index2, change) or path modification operation (index1, path1). Here, (index1, index2, change) represents the strategy action of exchanging the exit paths of index1 and index2; (index1, path1) represents modifying the exit path of index1 to path1. For example, one individual might be: {(index1, index2, change), (index1, path1), (index5, index8, change), ..., (indexN-1, path1)}. By identifying the path update operation as an individual within the population, the search space of the optimization problem can be effectively reduced, thereby improving the convergence speed and computational efficiency of the optimization process.

[0070] The fitness of the mapping relationship corresponding to an individual is used to evaluate the quality of the mapping relationship. This fitness can be the reciprocal of the load imbalance, expressed as Fitness(O')=1 / J(O'). The lower J(O'), the more balanced the load, the higher the fitness score, and the higher the probability that the individual will be preserved and reproduced in evolution.

[0071] The aforementioned genetic operations include hybridization and mutation. Hybridization involves swapping the positions of some path update operations in two parent individuals. For example, it involves traversing the path update operation sequences of the parent individuals and swapping the path update operations between different individuals with a certain probability. For instance, swapping the path update operation corresponding to the third element of the first individual with the path update operation corresponding to the fourth element of the second individual. Mutation involves randomly adding, deleting, or replacing path update operations in the path update operation sequence of an individual. Adding means adding a new random path update operation to the offspring individual; deleting means randomly removing a path update operation from the offspring individual; and replacing means randomly replacing an existing path update operation in the offspring individual.

[0072] When updating the population, newly generated individuals are added to the current population. In one possible implementation, to achieve "survival of the fittest," the network element can sort individuals based on their fitness, retaining the top few individuals with high fitness and eliminating others with low fitness, thereby improving the overall quality of the population and increasing optimization efficiency. The optimal individual refers to the individual with the highest fitness in the final population, and the path update operation sequence corresponding to this individual is the optimal path update operation sequence determined through genetic iterative optimization.

[0073] In one possible implementation, if the fitness value of the optimal individual is less than a preset minimum fitness threshold, the network element can determine the mapping relationship corresponding to the optimal path update operation sequence as a new mapping relationship between hash distribution information and traffic exit path. If the fitness value of the optimal individual is not less than the preset minimum fitness threshold, the network element can further refine the adjustment through a local search algorithm. The local optimization algorithm can start from the mapping relationship corresponding to the current optimal individual and try to exchange the mapping paths of the two hash distribution information multiple times to find a better one until the load imbalance converges, thus obtaining a new mapping relationship between hash distribution information and traffic exit path.

[0074] In one possible implementation, if a new mapping relationship that meets the termination condition is not generated after the number of iterations reaches a preset iteration threshold, the network device can increase the hash modulus to create more hash distribution information and expand the solution space for subsequent optimization cycles.

[0075] The hybrid optimization algorithm combines the advantages of different algorithms to achieve an effective synergy between the breadth of exploration and the depth of optimization in the load balancing optimization process. Specifically, the algorithm first uses a global exploration algorithm to conduct a broad search in the vast solution space, effectively avoiding getting trapped in local optima; then, a local search algorithm is introduced to refine the initially selected optimal solution, quickly converging to a better state near the solution. Through this two-stage optimization strategy of coarse screening followed by fine refinement, the algorithm ensures both the globality and diversity of solutions, while significantly improving the quality of the final solution and the overall convergence efficiency of the algorithm. This enables it to generate near-global optimal mapping relationships more intelligently and efficiently in dynamic network environments.

[0076] In some embodiments, after determining a new mapping relationship through iterative optimization, the network element can replace the mapping relationship through the data plane to perform traffic forwarding based on the new mapping relationship. That is, after determining the new mapping relationship between hash distribution information and traffic egress path, the method further includes: The preset mapping relationship between hash distribution information and traffic exit path is replaced with a new mapping relationship between hash distribution information and traffic exit path for traffic forwarding.

[0077] To achieve a stable policy switching process without traffic loss, one possible implementation is to use an "A / B" table switching mechanism to replace the aforementioned mapping relationship. Figure 8 This application provides a schematic diagram illustrating the mapping relationship replacement method according to an embodiment. Figure 8 As shown, this process can be implemented as follows: Write the new mapping relationship between hash distribution information and traffic exit path into the backup forwarding table of the network element device; After the write operation is completed, the forwarding logic of the network element device is switched to the backup forwarding table for forwarding through an atomic operation.

[0078] The backup forwarding table can be an inactive resource of the hardware forwarding table of the network element device. After the new mapping relationship is written, the network element device seamlessly switches the forwarding logic of the data plane to the new mapping relationship in the backup forwarding table through a one-time atomic operation, ensuring that the entire policy process is seamless and lossless, and preventing traffic loss during the mapping relationship change.

[0079] The traffic forwarding method provided in this application allows network element devices to continuously maintain a near-optimal load balance in a complex and ever-changing network environment by real-time and adaptively adjusting the mapping relationship between dynamic hash distribution information and traffic exit paths. In addition, by replacing the mapping relationship to achieve traffic forwarding under load balance, smooth traffic migration and global load optimization can be achieved.

[0080] To achieve such Figure 1The traffic forwarding method shown in this application embodiment constructs a corresponding traffic forwarding system framework in the network element device. This framework consists of a traffic monitoring module, a parameter adjustment module, and a policy deployment module integrated locally on the network element device, working together to form an autonomously operating, closed-loop controlled dynamic load balancing system. Figure 1 The traffic forwarding method shown enables efficient and intelligent scheduling of network traffic. Figure 9 A framework diagram of the traffic forwarding system provided in an embodiment of this application is shown, as follows: Figure 9 As shown, the traffic forwarding system includes a traffic monitoring module 910, a mapping relationship adjustment module 920, and a policy deployment module 930.

[0081] The traffic monitoring module, deployed on the data forwarding plane, collects network traffic load information in real time using counters and analyzes hash distribution information to continuously assess traffic distribution quality and determine whether load balancing optimization is triggered. When load balancing optimization is triggered, the mapping adjustment module uses a dynamic optimization algorithm to calculate the optimal mapping relationship between hash distribution information and traffic egress paths to minimize overall load imbalance. Finally, upon receiving the new mapping relationship, the policy deployment module deploys it to the data forwarding plane without interruption using an atomic switching mechanism, achieving seamless updates to the load balancing policy. When network traffic queries the mapping relationship through the data forwarding plane, it is forwarded according to the optimized mapping relationship to batch change the traffic distribution of each path, adjusting overloaded port traffic to underloaded traffic egress paths, thus achieving continuous network load balancing.

[0082] The implementation details of the above modules can be found by referring to... Figure 1 The relevant details of the illustrated embodiments will not be repeated here.

[0083] By implementing local traffic monitoring, parameter and policy deployment on network element devices, intelligent applications of network element devices can be supported, thereby significantly improving the efficiency, performance and autonomy of network management. For example, this traffic forwarding method can be applied in at least the following application environments: operator backbone networks, cloud service providers and enterprise-level interconnected networks.

[0084] In the backbone networks of operators, the transmission of massive data streams places extremely high demands on network performance and operational stability. The traffic forwarding method provided in this application is applied in this environment. By integrating traffic monitoring and dynamic optimization functions into network element devices, it can perceive the dynamic changes in network traffic and link load status in real time. Through intelligent monitoring and scheduling mechanisms based on local devices, it can significantly enhance the network's autonomous management and adaptive capabilities, thereby effectively improving the overall data throughput and resource utilization efficiency of the backbone network, and ensuring low latency and high reliability of critical business data transmission.

[0085] For cloud service providers, efficient management of network traffic within and across data centers is crucial. The traffic forwarding method provided in this application is applied in this environment, enabling cloud service providers to deploy localized traffic management solutions on network elements in each data center. By monitoring traffic load in real time and dynamically adjusting load balancing strategies, it achieves fine-grained scheduling and optimization of resources in virtualized or physical network environments. This solution can quickly respond to sudden traffic surges or changes in service demand, ensuring stable service quality. This localized processing significantly enhances the flexibility and adaptability of cloud infrastructure, thereby providing users with a more stable and efficient cloud service experience.

[0086] For enterprise-level interconnected networks, the traffic forwarding method provided in this application provides a lightweight and efficient load balancing solution for this application scenario. Compared with centralized solutions that require complex deployment and maintenance, this traffic forwarding method can be directly deployed on enterprise network devices and run independently, realizing dynamic traffic management of large interconnected links. By performing traffic monitoring and optimization processing locally on each network element device, it can effectively improve the transmission efficiency and overall performance of the enterprise network, ensure the stability and reliability of data transmission, and reduce system management complexity and operation and maintenance costs.

[0087] It should be noted that the above application scenarios are merely illustrative examples. This traffic forwarding method can be deployed in any network environment with network element devices to achieve load-balanced traffic scheduling.

[0088] In one exemplary embodiment, a network element device is also provided, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to implement the traffic forwarding method described above.

[0089] In one exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one computer program that is loaded and executed by a processor to implement all or part of the steps in the traffic forwarding method described above. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, or optical data storage device, etc.

[0090] In one exemplary embodiment, a computer program product is also provided, comprising a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the above-described actions. Figure 1 All or part of the steps of the embodiments shown in the examples.

[0091] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.

[0092] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A traffic forwarding method, characterized in that, Applied to network element devices, the method includes: In response to receiving target network traffic, the target traffic exit path of the target network traffic is determined based on traffic load balancing conditions; The target network traffic is forwarded through the target traffic exit path.

2. The method according to claim 1, characterized in that, The step of determining the target traffic exit path for the target network traffic based on traffic load balancing conditions includes: Determine the target hash distribution information for each target packet in the target network traffic; Based on the preset mapping relationship between hash distribution information and traffic exit path, determine the backup traffic exit path corresponding to each target hash distribution information; Based on the traffic load balancing conditions and the backup traffic exit path corresponding to each target hash distribution information, the target traffic exit path for each target packet in the target network traffic is determined.

3. The method according to claim 2, characterized in that, The step of determining the target traffic exit path for each target packet in the target network traffic based on the traffic load balancing conditions and the backup traffic exit path corresponding to each target hash distribution information includes: Based on the backup traffic exit path corresponding to each target hash distribution information, the traffic distribution quality of the traffic exit path is determined; In response to the traffic distribution quality of the traffic egress path satisfying the traffic load balancing condition, the backup traffic egress path corresponding to each target hash distribution information is used as the target traffic egress path for each target packet in the target network traffic.

4. The method according to claim 3, characterized in that, After determining the flow distribution quality of the flow exit path, the method further includes: In response to the traffic distribution quality of the traffic egress path not meeting the traffic load balancing conditions, a new mapping relationship between the hash distribution information and the traffic egress path is determined based on the preset mapping relationship between hash distribution information and traffic egress path and the hash distribution information of each target. Based on the new mapping relationship between hash distribution information and traffic exit path, a new traffic exit path corresponding to each target hash distribution information is determined, which serves as the target traffic exit path for each target packet in the target network traffic.

5. The method according to claim 3 or 4, characterized in that, The flow distribution quality of the flow outlet path includes: load imbalance; the load imbalance characterizes the degree to which the target flow load distribution of each flow outlet path deviates from the corresponding ideal flow load distribution; The traffic load balancing condition includes: the load imbalance degree is lower than a first preset threshold.

6. The method according to claim 5, characterized in that, The method for determining the load imbalance includes: Based at least on the target traffic load of each target hash distribution information and the preset mapping relationship between hash distribution information and traffic exit path, the target traffic load distribution of each traffic exit path is determined; The load imbalance degree is obtained by normalizing and summing the deviations between the flow load distribution and the corresponding ideal flow load distribution of each flow outlet path.

7. The method according to claim 3 or 4, characterized in that, The traffic distribution quality of the traffic exit path includes: traffic fluctuation value, which represents the degree of traffic load fluctuation corresponding to each hash distribution information; The traffic load balancing condition includes: the traffic fluctuation value corresponding to each hash distribution information is lower than a second preset threshold.

8. The method according to claim 7, characterized in that, The method for determining the value of the flow fluctuation includes: Based at least on the traffic load of each target hash distribution information within multiple consecutive time windows, the traffic fluctuation value corresponding to each hash distribution information is determined.

9. The method according to claim 4, characterized in that, The process of determining a new mapping relationship between hash distribution information and traffic exit paths based on a preset mapping relationship between hash distribution information and traffic exit paths, and the hash distribution information of each target path, includes: The path change operation is iterated based on a preset dynamic optimization algorithm to obtain a new mapping relationship between hash distribution information and traffic exit path; wherein, the path change operation is used to change the preset mapping relationship between hash distribution information and traffic exit path. The termination condition of the iteration includes: based on the new mapping relationship between the hash distribution information and the traffic egress path and the target hash distribution information, the traffic distribution quality of the determined traffic egress path satisfies the traffic load balancing condition.

10. The method according to claim 9, characterized in that, The path update operation includes: path modification operation and / or path swap operation; The path modification operation includes: modifying the first traffic exit path corresponding to any hash distribution information to any second traffic exit path, wherein the first traffic exit path and the second traffic exit path are different; The path swapping operation includes swapping the traffic exit paths corresponding to any two hash distribution information.

11. The method according to claim 9, characterized in that, The dynamic optimization algorithm is a metaheuristic algorithm, or a hybrid optimization algorithm formed by combining at least two heuristic algorithms.

12. The method according to claim 4, characterized in that, After determining the new mapping relationship between the hash distribution information and the traffic exit path, the process also includes: The preset mapping relationship between hash distribution information and traffic exit path is replaced with a new mapping relationship between hash distribution information and traffic exit path for traffic forwarding.

13. A network element device, characterized in that, The network element device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to implement the traffic forwarding method as described in any one of claims 1 to 12.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the traffic forwarding method as described in any one of claims 1 to 12.

15. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the traffic forwarding method as described in any one of claims 1 to 12.