Equivalent multipath routing method, apparatus and device, and readable storage medium

By calculating the total number of virtual nodes and allocating virtual nodes, the problem of data flow forwarding path changes caused by equivalent link failures was solved, thus achieving the stability of data flow forwarding paths and business continuity.

CN121728019APending Publication Date: 2026-03-24FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
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-17
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In the event of an equivalent link failure, the existing technology's hash modulo method causes changes in the forwarding path of the data stream, affecting the service continuity of session maintenance.

Method used

By calculating the total number of virtual nodes in the equal-cost multipath routing group, and based on the total number of virtual nodes and the bandwidth of each equal-cost link, a corresponding number of virtual nodes are allocated to each equal-cost link. In the event of a link failure, the virtual nodes corresponding to the failed equal-cost link are transferred and allocated to the remaining valid equal-cost links.

Benefits of technology

In the event of an equivalent link failure, maintain the stability of the data flow forwarding path, reduce the probability of service interruption, and ensure the stability of the data flow through the fixed virtual node mapping relationship.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121728019A_ABST
    Figure CN121728019A_ABST
Patent Text Reader

Abstract

An equivalent multi-path routing method, apparatus and device, and a readable storage medium, the equivalent multi-path routing method comprising: based on available resource capacity of a network device and equivalent multi-path routing group capacity, calculating to obtain the total number of virtual nodes of an equivalent multi-path routing group, the equivalent multi-path routing group comprising a plurality of equivalent links; based on the total number of the virtual nodes and the bandwidth of each equivalent link, allocating a corresponding number of virtual nodes to each equivalent link; aiming at the data flow of the equivalent multipath routing group received by the network equipment, calculating through a Hash algorithm to obtain a data flow Hash value, and performing modulo operation on the data flow Hash value and the total number of the virtual nodes to obtain the virtual nodes corresponding to the data flow so as to forward the data flow through equivalent links corresponding to the virtual nodes; and when the fault of the equivalent link is detected, transferring and distributing the virtual node corresponding to the fault equivalent link to the remaining effective equivalent links. According to the invention, the probability of service interruption is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and in particular to an equivalent multipath routing method, apparatus, device, and readable storage medium. Background Technology

[0002] As network traffic continues to increase, more and more users are abandoning traditional single links and choosing to deploy multiple links and ECMP (Equal-Cost Multi-Path) to improve bandwidth and link reliability. ECMP is a mechanism where routers or switches use multiple "equal-cost" (i.e., with the same routing metric) links to forward traffic when they find that there are multiple links leading to the same destination address.

[0003] Hash is a load-sharing mode of link aggregation technology. When applied to ECMP, a hash algorithm is used to calculate the hash value of the key characteristics of the data flow (such as the quintuple). Then, the hash value is moduloed with the number of equivalent links to map the data flow to the corresponding equivalent links and forward it.

[0004] However, when a link failure causes a change in the number of equivalent links, the hash modulo method used in existing technologies will cause the forwarding of data streams to be redistributed across multiple equivalent links. This can easily lead to changes in the original forwarding path of the data stream, with the same user's request being forwarded to different server responses, which can significantly impact services that require session persistence. Summary of the Invention

[0005] This application provides an equal-cost multipath routing method, apparatus, device, and readable storage medium, aiming to solve the technical problem that when a link failure causes a change in the number of equal-cost links, the hash modulo method used in the prior art will cause the forwarding of data streams to be redistributed on multiple equal-cost links, which will easily lead to changes in the original forwarding path of the data stream, and the same user's request will be forwarded to different server responses, thus greatly affecting the technical problem of services that require session persistence.

[0006] In a first aspect, embodiments of this application provide an equal-cost multi-path routing method, the equal-cost multi-path routing method comprising: Based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group, the total number of virtual nodes in the equal-cost multi-path routing group is calculated. The equal-cost multi-path routing group includes multiple equal-cost links. Based on the total number of virtual nodes and the bandwidth of each equivalent link, allocate a corresponding number of virtual nodes to each equivalent link; For the data flow of the equal-cost multipath routing group received by the network device, the hash value of the data flow is calculated by the hash algorithm. The hash value of the data flow is moduloed by the total number of virtual nodes to obtain the virtual node corresponding to the data flow, so that the data flow can be forwarded through the equal-cost link corresponding to the virtual node. When an equal-cost link failure is detected, the virtual node corresponding to the failed equal-cost link will be transferred and assigned to the remaining valid equal-cost links.

[0007] Optionally, after transferring and assigning the virtual node corresponding to the failed equivalent link to the remaining valid equivalent links when an equivalent link failure is detected, the following steps are included: When the recovery of the faulty equivalent link is detected, the transfer and allocation of the virtual node corresponding to the original faulty equivalent link is cancelled.

[0008] Optionally, the calculation of the total number of virtual nodes in the equal-cost multi-path routing group based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group includes: Based on the available resource capacity of network devices and the capacity of equal-cost multi-path routing groups, the total number of virtual nodes in an equal-cost multi-path routing group is calculated using Formula 1, which is: M = T / E; Where M is the total number of virtual nodes in the equal-cost multipath routing group, T is the available resource capacity of the network device, and E is the capacity of the equal-cost multipath routing group of the network device.

[0009] Optionally, allocating a corresponding number of virtual nodes to each equivalent link based on the total number of virtual nodes and the bandwidth of each equivalent link includes: Based on the total number of virtual nodes and the bandwidth of each equivalent link, a corresponding number of virtual nodes are allocated to each equivalent link using Formula 2, which is: ; Where, N L Let C be the number of virtual nodes corresponding to the Lth equivalent link. L Let z be the bandwidth of the Lth equivalent link, and z be the total number of equivalent links. M represents the total bandwidth of all equal-cost links, and M represents the total number of virtual nodes in the equal-cost multipath routing group.

[0010] Optionally, after allocating a corresponding number of virtual nodes to each equivalent link based on the total number of virtual nodes and the bandwidth of each equivalent link, the process includes: Based on the bandwidth variation of each equivalent link and the total number of virtual nodes, the number of virtual nodes allocated to each equivalent link is adjusted using Formula 3, which is: ; Where, NL (t) represents the number of virtual nodes allocated to the Lth equivalent link after adjustment, C L (t) represents the bandwidth of the Lth equivalent link after the change, and z represents the total number of equivalent links. M represents the total bandwidth of all equivalent links after the change, and M represents the total number of virtual nodes in the equivalent multipath routing group.

[0011] Optionally, transferring and allocating the virtual node corresponding to the failed equivalent link to the remaining valid equivalent links includes: The virtual nodes corresponding to the faulty equivalent links are evenly divided according to the number of remaining valid equivalent links, and then transferred and allocated to the remaining valid equivalent links.

[0012] Secondly, embodiments of this application provide an equal-cost multi-path routing apparatus, the equal-cost multi-path routing apparatus comprising: The calculation module is used to calculate the total number of virtual nodes in the equal-cost multi-path routing group based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group, wherein the equal-cost multi-path routing group includes multiple equal-cost links; The allocation module is used to allocate a corresponding number of virtual nodes to each equal-cost link based on the total number of virtual nodes and the bandwidth of each equal-cost link; The receiving module is used to calculate the hash value of the data stream received by the network device from the equal-cost multipath routing group using a hash algorithm, and then take the modulo between the hash value of the data stream and the total number of virtual nodes to obtain the virtual node corresponding to the data stream, so that the data stream can be forwarded through the equal-cost link corresponding to the virtual node. The transfer module is used to transfer the virtual node corresponding to the faulty equivalent link to the remaining valid equivalent links when an equivalent link failure is detected.

[0013] Optionally, the equivalent multipath routing device further includes a recovery module for: When the recovery of the faulty equivalent link is detected, the transfer and allocation of the virtual node corresponding to the original faulty equivalent link is cancelled.

[0014] Thirdly, embodiments of this application provide an equal-cost multipath routing device, which includes a processor, a memory, and an equal-cost multipath routing program stored in the memory and executable by the processor. When the equal-cost multipath routing program is executed by the processor, it implements the steps of the equal-cost multipath routing method as described above.

[0015] Fourthly, embodiments of this application provide a readable storage medium storing an equal-cost multipath routing program, wherein when the equal-cost multipath routing program is executed by a processor, it implements the steps of the equal-cost multipath routing method as described above.

[0016] The beneficial effects of the technical solutions provided in this application include: In this embodiment, based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group, the total number of virtual nodes in the equal-cost multi-path routing group is calculated. The equal-cost multi-path routing group includes multiple equal-cost links. Based on the total number of virtual nodes and the bandwidth of each equal-cost link, a corresponding number of virtual nodes are allocated to each equal-cost link. For the data flow received by the network device from the equal-cost multi-path routing group, a hash value of the data flow is calculated using a hash algorithm. The hash value of the data flow is moduloed with the total number of virtual nodes to obtain the virtual node corresponding to the data flow, which is then used to forward the data flow through the equal-cost link corresponding to the virtual node. When an equal-cost link failure is detected, the virtual node corresponding to the failed equal-cost link is transferred and allocated to the remaining valid equal-cost links. Through this embodiment, based on the existing technology of establishing a mapping relationship between data flow and equal-cost links through hash value modulo, a new layer of virtual node mapping relationship is added, that is, establishing a mapping relationship between data flow-virtual node-equal-cost link, thereby decoupling the data flow from the equal-cost link. First, the total number of virtual nodes required is calculated, and a corresponding number of virtual nodes are allocated to each equicost link. For the data flow of the equicost multipath routing group received by network devices (such as routers or switches), a fixed mapping relationship between the data flow and virtual nodes is established by taking the modulo of the data flow hash value with the fixed total number of virtual nodes. When all equicost links are functioning correctly, the data flow will be forwarded through the equicost link corresponding to the virtual node. If an equicost link fails, the virtual node corresponding to the failed equicost link is transferred and allocated to the remaining valid equicost links. Therefore, even if an equicost link fails, the data flow will still be forwarded through the equicost link corresponding to the virtual node. This method modulo the total number of virtual nodes, ensuring that the virtual nodes corresponding to the data stream remain constant. When an equivalent link fails, only the correspondence between virtual nodes and equivalent links changes. The data stream from the failed equivalent link will be forwarded through the remaining valid equivalent links. Only the forwarding path of the data stream from the failed equivalent link changes; the forwarding path of the data stream from the remaining valid equivalent links remains unchanged. Compared to existing technologies that use the hash value of the data stream and the number of valid equivalent links to determine the forwarding path when an equivalent link fails, this method redistributes the forwarding of the data stream across multiple equivalent links, significantly reducing the probability of service interruption. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating an embodiment of the equivalent multipath routing method of this application; Figure 2 This is a schematic diagram of virtual node allocation in one embodiment of the equivalent multipath routing method of this application; Figure 3 This is a schematic diagram of the first virtual node transition in an embodiment of the equivalent multipath routing method of this application; Figure 4 This is a schematic diagram of the second virtual node transition in an embodiment of the equivalent multipath routing method of this application; Figure 5 This is a schematic diagram illustrating the cancellation of virtual node transfer in an embodiment of the equivalent multipath routing method of this application; Figure 6 This is a schematic diagram of the functional modules of an embodiment of the equivalent multipath routing device of this application; Figure 7 This is a schematic diagram of the hardware structure of the equivalent multipath routing device involved in the embodiments of this application. Detailed Implementation

[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0020] In a first aspect, embodiments of this application provide an equal-cost multi-path routing method.

[0021] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the equivalent multipath routing method of this application, as shown below. Figure 1 As shown, the equivalent multipath routing methods include: Step S10: Based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group, calculate the total number of virtual nodes in the equal-cost multi-path routing group, wherein the equal-cost multi-path routing group includes multiple equal-cost links.

[0022] In this embodiment, if the network device is a router or switch, the network device first calculates the total number of virtual nodes in the equal-cost multipath routing group, such as using the formula M = T / E, where T is the available resource capacity of the network device (such as the memory, CPU, and other resources supported by the device), and E is the capacity of the equal-cost multipath routing group (the maximum ECMP group capacity supported by the network device). This ensures the matching between the number of virtual nodes and the device resources and ECMP group capacity. For example, if the available resource capacity T of the device is 400Kbytes and the equal-cost multipath routing group capacity E is 2Kbytes, then the total number of virtual nodes M = 400K / 2K = 200, that is, the total number of virtual nodes is 200. This calculation method ensures that the number of virtual nodes is neither too many, leading to resource waste, nor too few, affecting traffic distribution, laying the foundation for subsequent traffic allocation. Moreover, the total number of virtual nodes M is directly proportional to the available resource capacity T of the network device and inversely proportional to the ECMP group capacity E. This allows the system to dynamically adjust the total number of virtual nodes according to the actual capabilities of the device, improving resource utilization and the adaptability of the solution.

[0023] In this context, an ECMP group (Equal Cost Multipath Routing Group) refers to a set of next-hops that point to the same destination and have the same routing cost. It's important to note that by introducing a fixed number of virtual nodes (logical entities), compared to existing technologies that establish a mapping relationship between data flows and equal-cost links through hash value modulo, an additional layer of virtual node mapping is added. This establishes a mapping relationship between data flows, virtual nodes, and equal-cost links, thereby decoupling data flows from equal-cost links. In the event of an equal-cost link failure, this provides a flexible basis for transferring and recovering the data flow corresponding to the failed equal-cost link.

[0024] Step S20: Based on the total number of virtual nodes and the bandwidth of each equivalent link, allocate a corresponding number of virtual nodes to each equivalent link.

[0025] In this embodiment, based on the total number of virtual nodes M and the bandwidth of each equivalent link, a corresponding number of virtual nodes are allocated to each equivalent link, as shown by the formula... This ensures that the number of virtual nodes allocated to each equivalent link is proportional to the bandwidth of the equivalent link, thereby achieving load balancing of traffic across all links. (Refer to...) Figure 2 , Figure 2 This is a schematic diagram of virtual node allocation in an embodiment of the equivalent multipath routing method of this application, as shown below. Figure 2As shown, a certain ECMP group has 4 equivalent links, namely physical links 1, 2, 3 and 4, with bandwidths of 10Gbps, 6Gbps, 2Gbps and 2Gbps respectively, and a total bandwidth ∑Cz = 20Gbps. Therefore, the number of virtual nodes allocated to physical link 1 is N1 = (10 / 20)*200 = 100, the number of virtual nodes allocated to physical link 2 is N2 = (6 / 20)*200 = 60, and the number of virtual nodes allocated to physical links 3 and 4 is N3 = N4 = (2 / 20)*200 = 20. Virtual node IDs are sequentially increased. Therefore, virtual nodes assigned to physical link 1 are ID1-100, those assigned to physical link 2 are ID101-160, those assigned to physical link 3 are ID161-180, and those assigned to physical link 4 are ID181-200. This virtual node allocation method ensures that equivalent-cost links with higher bandwidth can carry more traffic, while equivalent-cost links with lower bandwidth carry less traffic, thus achieving reasonable traffic distribution and avoiding link congestion.

[0026] Step S30: For the data flow of the equal-cost multi-path routing group received by the network device, the hash value of the data flow is calculated by a hash algorithm. The hash value of the data flow is moduloed by the total number of virtual nodes to obtain the virtual node corresponding to the data flow, so that the data flow can be forwarded through the equal-cost link corresponding to the virtual node.

[0027] In this embodiment, after receiving the data stream from the equal-cost multipath routing group, the network device calculates the hash value of the data stream using a hash algorithm. The hash value is then moduloed by the total number of virtual nodes M to obtain the virtual node ID corresponding to the data stream. Since M is a fixed value, the mapping relationship between the data stream and the virtual node is fixed and does not change with the number of equal-cost links. For example, if the hash value of the data stream is 153 and M=200, then 153 % 200 = 153, and the data stream will be mapped to virtual node 153, and then forwarded through the equal-cost link corresponding to virtual node 153. By moduloing the data stream hash value with the fixed total number of virtual nodes M, a fixed mapping between the data stream and the virtual node is achieved. The mapping relationship between the data stream and the virtual node does not change with the number of effective equal-cost links. In step S20, a virtual node has been allocated to each equal-cost link. Therefore, the data stream can be mapped to the corresponding virtual node by moduloing the hash value with the fixed total number of virtual nodes M, and then forwarded through the equal-cost link corresponding to the virtual node. A data stream refers to a series of messages with the same characteristics between two endpoints, which are usually uniquely identified by a 5-tuple (source IP address, destination IP address, source port number, destination port number, and transport layer protocol).

[0028] Step S40: When an equal-cost link failure is detected, the virtual node corresponding to the failed equal-cost link is transferred and assigned to the remaining valid equal-cost links.

[0029] In this embodiment, refer to Figure 3 , Figure 3 This is a schematic diagram of the first virtual node transition in an embodiment of the equivalent multipath routing method of this application, as shown below. Figure 3 As shown, for example, when physical link 3 fails, there are 3 remaining valid links. The virtual nodes 161-180 (20 in total) corresponding to link 3 can be evenly divided into 3 segments, each with 6-7 nodes, pointing to links 1, 2, and 4 respectively. In this way, the data flow originally mapped to virtual nodes 161-180 will be redistributed to the remaining valid links without affecting the data flow forwarding paths of other links. This processing method ensures that even in the event of a link failure, the change in the data flow forwarding path is limited to the data flow on the failed link; the forwarding paths of the data flow on other links remain unchanged. Compared to existing technologies that use the hash value of the data flow and the number of valid equivalent links to determine the forwarding path when an equivalent link fails, resulting in the redistribution of data flow forwarding across multiple equivalent links, this significantly reduces the probability of service interruption. (Refer to...) Figure 4 , Figure 4 This is a schematic diagram of the second virtual node transition in an embodiment of the equivalent multipath routing method of this application, as shown below. Figure 4 As shown, after physical link 3 fails, physical link 4 fails immediately. The ECMP group now has 2 failed links and 2 valid links. In order to distribute the links evenly, the virtual nodes that originally corresponded to the failed physical links 3 and 4 can be re-divided into 2 segments, with each segment pointing to the other two valid links.

[0030] It should be noted that when an equivalent link failure is detected, the virtual node corresponding to the failed equivalent link is transferred and reassigned to the remaining valid equivalent links. Only the mapping relationship between the virtual node and the equivalent link is changed. The data flow is mapped to the corresponding virtual node by taking the hash value modulo the fixed total number of virtual nodes M. This is a fixed mapping relationship. Therefore, changes in the data flow forwarding path will only affect the failed equivalent link. The forwarding path of the corresponding data flow on the valid equivalent links will not change, which greatly reduces the probability of service interruption.

[0031] In this embodiment, if the network device is a router or switch, the total number of virtual nodes in the equal-cost multi-path routing group can be calculated using a formula based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group. This ensures the matching of the number of virtual nodes with the device resources and ECMP group capacity, ensuring that the number of virtual nodes is neither too many, leading to resource waste, nor too few, affecting traffic distribution. This lays the foundation for subsequent traffic allocation. The system can dynamically adjust the total number of virtual nodes according to the actual capacity of the device, improving resource utilization and the adaptability of the solution. Based on the total number of virtual nodes and the bandwidth of each equal-cost link, a corresponding number of virtual nodes can be allocated to each equal-cost link using a formula, achieving load balancing of traffic on each link. By taking the modulo of the data flow hash value with the fixed total number of virtual nodes M, a fixed mapping between the data flow and virtual nodes is achieved. The mapping relationship between the data flow and virtual nodes does not change with the change of the effective equal-cost link. In step S20, virtual nodes have been allocated to each equal-cost link. Therefore, the data flow can be mapped to the corresponding virtual node by taking the modulo of the hash value with the fixed total number of virtual nodes M, and then forwarded through the equal-cost link corresponding to the virtual node. When an equivalent link failure is detected, the virtual node corresponding to the failed equivalent link is transferred and reassigned to the remaining valid equivalent links. This ensures that even in the event of a link failure, the change in the forwarding path of the data flow is limited to the data flow of the failed link, while the forwarding paths of the data flow on other links remain unchanged. Compared to existing technologies that use the hash value of the data flow and the number of valid equivalent links to determine the forwarding path when an equivalent link fails, resulting in the redistribution of the data flow forwarding across multiple equivalent links, this significantly reduces the probability of service interruption.

[0032] Further, in one embodiment, after step S40, the following is included: When the recovery of the faulty equivalent link is detected, the transfer and allocation of the virtual node corresponding to the original faulty equivalent link is cancelled.

[0033] In this embodiment, refer to Figure 5 , Figure 5 This is a schematic diagram illustrating the cancellation of virtual node transfer in an embodiment of the equivalent multipath routing method of this application, as shown below. Figure 5 As shown, for example, if physical link 3 is detected to have recovered, the ECMP group now has three active links. First, the virtual nodes 161-180 initially assigned to link 3 are redirected back to link 3. At this point, the original data flow on link 3 can be switched back to link 3. Then, link 4 is re-segmented from the original two segments into three segments, each pointing to one of the three newest active links. This process ensures that after the link recovers, the data flow forwarding path can be restored to its pre-failure state, maintaining service continuity and stability.

[0034] Further, in one embodiment, step S10 includes: Based on the available resource capacity of network devices and the capacity of equal-cost multi-path routing groups, the total number of virtual nodes in an equal-cost multi-path routing group is calculated using Formula 1, which is: M = T / E; Where M is the total number of virtual nodes in the equal-cost multipath routing group, T is the available resource capacity of the network device, and E is the capacity of the equal-cost multipath routing group of the network device.

[0035] In this embodiment, the total number of virtual nodes is calculated using the formula M = T / E, ensuring a match between the number of virtual nodes and the device resources and ECMP group capacity. T represents the available resource capacity of the device, which can be resources such as memory and CPU; E represents the device's equivalent multipath routing group capacity, i.e., the maximum ECMP group capacity supported by the device. By reasonably setting T and E, it can be ensured that the number of virtual nodes is neither too many, leading to resource waste, nor too few, affecting traffic distribution. For example, when the available resource capacity T of the device increases or the ECMP group capacity E decreases, the total number of virtual nodes M will increase accordingly, thereby supporting more data flow mappings. This design allows the system to adapt to the resource conditions of different devices, improving the applicability and flexibility of the solution.

[0036] Further, in one embodiment, step S20 includes: Based on the total number of virtual nodes and the bandwidth of each equivalent link, a corresponding number of virtual nodes are allocated to each equivalent link using Formula 2, which is: ; Where, N L Let C be the number of virtual nodes corresponding to the Lth equivalent link. L Let z be the bandwidth of the Lth equivalent link, and z be the total number of equivalent links. M represents the total bandwidth of all equal-cost links, and M represents the total number of virtual nodes in the equal-cost multipath routing group.

[0037] In this embodiment, the number of virtual nodes corresponding to each equivalent link is calculated using a formula, ensuring that the number of virtual nodes is proportional to the link bandwidth. In this way, links with higher bandwidth are allocated more virtual nodes, thus carrying more traffic and achieving load balancing. For example, link 1 with a bandwidth of 10Gbps (gigabits per second) is allocated 100 virtual nodes, while links 3 and 4 with bandwidths of 2Gbps (gigabits per second) are each allocated 20 virtual nodes, conforming to the bandwidth ratio. This allocation method not only achieves reasonable traffic distribution but also avoids link congestion, improving network stability and reliability.

[0038] Further, in one embodiment, after step S20, the following is included: Based on the bandwidth variation of each equivalent link and the total number of virtual nodes, the number of virtual nodes allocated to each equivalent link is adjusted using Formula 3, which is: ; Where, N L (t) represents the number of virtual nodes allocated to the Lth equivalent link after adjustment, C L (t) represents the bandwidth of the Lth equivalent link after the change, and z represents the total number of equivalent links. M represents the total bandwidth of all equivalent links after the change, and M represents the total number of virtual nodes in the equivalent multipath routing group.

[0039] In this embodiment, when the bandwidth of each equivalent link changes, the allocation of virtual nodes needs to be recalculated based on the changed bandwidth. The number of virtual nodes corresponding to each equivalent link can be dynamically adjusted using a formula to ensure that traffic allocation is synchronized with changes in link bandwidth. For example, if the bandwidth of link 1 increases from 10Gbps to 12Gbps, then N1(t) = (12 / 22) * 200≈109, requiring 9 additional virtual nodes. The number of virtual nodes for other links decreases accordingly to keep the total number of virtual nodes M constant. This dynamic adjustment mechanism allows the system to adapt to changes in link bandwidth, ensuring the accuracy and efficiency of traffic allocation.

[0040] Further, in one embodiment, the step of transferring and allocating the virtual node corresponding to the failed equivalent link to the remaining valid equivalent links includes: The virtual nodes corresponding to the faulty equivalent links are evenly divided according to the number of remaining valid equivalent links, and then transferred and allocated to the remaining valid equivalent links.

[0041] In this embodiment, for example, when one link fails and three valid links remain, the virtual node corresponding to the failed link is divided into three segments, and each segment is mapped sequentially to the remaining three valid links. This ensures that the traffic from the failed link is evenly distributed across the remaining valid links, preventing overload on any one link, while maintaining the traffic forwarding paths of other links. This approach ensures that the network can quickly resume traffic forwarding in the event of a link failure, reducing service interruption time and improving network reliability and user experience.

[0042] Secondly, embodiments of this application also provide an equivalent multipath routing device.

[0043] In one embodiment, reference is made to Figure 6 , Figure 6 This is a functional block diagram of an embodiment of the equivalent multipath routing device of this application, as shown below. Figure 6 As shown, the equivalent multipath routing device includes: The calculation module 10 is used to calculate the total number of virtual nodes in the equal-cost multi-path routing group based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group, wherein the equal-cost multi-path routing group includes multiple equal-cost links; The allocation module 20 is used to allocate a corresponding number of virtual nodes to each equal-cost link based on the total number of virtual nodes and the bandwidth of each equal-cost link; The receiving module 30 is used to calculate the hash value of the data stream of the equal-cost multipath routing group received by the network device through a hash algorithm, and take the modulo of the hash value of the data stream with the total number of virtual nodes to obtain the virtual node corresponding to the data stream, so as to forward the data stream through the equal-cost link corresponding to the virtual node; The transfer module 40 is used to transfer the virtual node corresponding to the faulty equivalent link to the remaining valid equivalent links when an equivalent link failure is detected.

[0044] Furthermore, in one embodiment, the equal-cost multipath routing device further includes a recovery module, used for: When the recovery of the faulty equivalent link is detected, the transfer and allocation of the virtual node corresponding to the original faulty equivalent link is cancelled.

[0045] Furthermore, in one embodiment, the calculation module 10 is used for: Based on the available resource capacity of network devices and the capacity of equal-cost multi-path routing groups, the total number of virtual nodes in an equal-cost multi-path routing group is calculated using Formula 1, which is: M = T / E; Where M is the total number of virtual nodes in the equal-cost multipath routing group, T is the available resource capacity of the network device, and E is the capacity of the equal-cost multipath routing group of the network device.

[0046] Furthermore, in one embodiment, the allocation module 20 is used for: Based on the total number of virtual nodes and the bandwidth of each equivalent link, a corresponding number of virtual nodes are allocated to each equivalent link using Formula 2, which is: ; Where, N L Let C be the number of virtual nodes corresponding to the Lth equivalent link. L Let z be the bandwidth of the Lth equivalent link, and z be the total number of equivalent links. M represents the total bandwidth of all equal-cost links, and M represents the total number of virtual nodes in the equal-cost multipath routing group.

[0047] Furthermore, in one embodiment, the equal-cost multipath routing device further includes an adjustment module, used for: Based on the bandwidth variation of each equivalent link and the total number of virtual nodes, the number of virtual nodes allocated to each equivalent link is adjusted using Formula 3, which is: ; Where, N L (t) represents the number of virtual nodes allocated to the Lth equivalent link after adjustment, C L (t) represents the bandwidth of the Lth equivalent link after the change, and z represents the total number of equivalent links. M represents the total bandwidth of all equivalent links after the change, and M represents the total number of virtual nodes in the equivalent multipath routing group.

[0048] Furthermore, in one embodiment, the transfer module 40 is used for: The virtual nodes corresponding to the faulty equivalent links are evenly divided according to the number of remaining valid equivalent links, and then transferred and allocated to the remaining valid equivalent links.

[0049] The functions of each module in the above-mentioned equivalent multipath routing device correspond to the steps in the above-mentioned equivalent multipath routing method embodiment, and their functions and implementation processes will not be described in detail here.

[0050] Thirdly, embodiments of this application provide an equivalent multipath routing device.

[0051] Reference Figure 7 , Figure 7 This is a schematic diagram of the hardware structure of the equivalent multipath routing device involved in the embodiments of this application. In the embodiments of this application, the equivalent multipath routing device may include a processor, a memory, a communication interface, and a communication bus.

[0052] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.

[0053] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting devices within the equal-cost multipath routing device, as well as interfaces used for interconnecting the equal-cost multipath routing device with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user equipment can be displays, keyboards, etc.

[0054] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0055] The processor can be a general-purpose processor, which can call an equivalent multipath routing program stored in memory and execute the equivalent multipath routing method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the equivalent multipath routing program is called can be referred to in various embodiments of the equivalent multipath routing method of this application, and will not be repeated here.

[0056] Those skilled in the art will understand that Figure 7 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0057] Fourthly, embodiments of this application also provide a readable storage medium.

[0058] The present application has an equivalent multipath routing program stored on a readable storage medium, wherein when the equivalent multipath routing program is executed by a processor, it implements the steps of the equivalent multipath routing method as described above.

[0059] The method implemented when the equal-cost multipath routing procedure is executed can be referred to in various embodiments of the equal-cost multipath routing method of this application, and will not be repeated here.

[0060] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0061] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.

[0062] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.

[0063] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0064] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.

[0065] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.

[0066] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. An equal-cost multi-path routing method, characterized in that, The equivalent multipath routing method includes: Based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group, the total number of virtual nodes in the equal-cost multi-path routing group is calculated. The equal-cost multi-path routing group includes multiple equal-cost links. Based on the total number of virtual nodes and the bandwidth of each equivalent link, allocate a corresponding number of virtual nodes to each equivalent link; For the data flow of the equal-cost multipath routing group received by the network device, the hash value of the data flow is calculated by the hash algorithm. The hash value of the data flow is moduloed by the total number of virtual nodes to obtain the virtual node corresponding to the data flow, so that the data flow can be forwarded through the equal-cost link corresponding to the virtual node. When an equal-cost link failure is detected, the virtual node corresponding to the failed equal-cost link will be transferred and assigned to the remaining valid equal-cost links.

2. The equal-cost multi-path routing method as described in claim 1, characterized in that, After transferring and assigning the virtual node corresponding to the failed equivalent link to the remaining valid equivalent links when an equivalent link failure is detected, the process includes: When the recovery of the faulty equivalent link is detected, the transfer and allocation of the virtual node corresponding to the original faulty equivalent link is cancelled.

3. The equal-cost multi-path routing method as described in claim 1, characterized in that, The total number of virtual nodes in the equivalent multipath routing group, calculated based on the available resource capacity of the network device and the capacity of the equivalent multipath routing group, includes: Based on the available resource capacity of network devices and the capacity of equal-cost multi-path routing groups, the total number of virtual nodes in an equal-cost multi-path routing group is calculated using Formula 1, which is: M = T / E; Where M is the total number of virtual nodes in the equal-cost multipath routing group, T is the available resource capacity of the network device, and E is the capacity of the equal-cost multipath routing group of the network device.

4. The equal-cost multi-path routing method as described in claim 1, characterized in that, The allocation of a corresponding number of virtual nodes to each equivalent link based on the total number of virtual nodes and the bandwidth of each equivalent link includes: Based on the total number of virtual nodes and the bandwidth of each equivalent link, a corresponding number of virtual nodes are allocated to each equivalent link using Formula 2, which is: ; Where, N L Let C be the number of virtual nodes corresponding to the Lth equivalent link. L Let z be the bandwidth of the Lth equivalent link, and z be the total number of equivalent links. M represents the total bandwidth of all equal-cost links, and M represents the total number of virtual nodes in the equal-cost multipath routing group.

5. The equal-cost multi-path routing method as described in claim 4, characterized in that, After allocating a corresponding number of virtual nodes to each equivalent link based on the total number of virtual nodes and the bandwidth of each equivalent link, the process includes: Based on the bandwidth variation of each equivalent link and the total number of virtual nodes, the number of virtual nodes allocated to each equivalent link is adjusted using Formula 3, which is: ; Where, N L (t) represents the number of virtual nodes allocated to the Lth equivalent link after adjustment, C L (t) represents the bandwidth of the Lth equivalent link after the change, and z represents the total number of equivalent links. M represents the total bandwidth of all equivalent links after the change, and M represents the total number of virtual nodes in the equivalent multipath routing group.

6. The equal-cost multi-path routing method as described in claim 1, characterized in that, The step of transferring and allocating the virtual node corresponding to the failed equivalent link to the remaining valid equivalent link includes: The virtual nodes corresponding to the faulty equivalent links are evenly divided according to the number of remaining valid equivalent links, and then transferred and allocated to the remaining valid equivalent links.

7. An equivalent multipath routing device, characterized in that, The equivalent multipath routing device includes: The calculation module is used to calculate the total number of virtual nodes in the equal-cost multi-path routing group based on the available resource capacity of the network device and the capacity of the equal-cost multi-path routing group, wherein the equal-cost multi-path routing group includes multiple equal-cost links; The allocation module is used to allocate a corresponding number of virtual nodes to each equal-cost link based on the total number of virtual nodes and the bandwidth of each equal-cost link; The receiving module is used to calculate the hash value of the data stream received by the network device from the equal-cost multipath routing group using a hash algorithm, and then take the modulo between the hash value of the data stream and the total number of virtual nodes to obtain the virtual node corresponding to the data stream, so that the data stream can be forwarded through the equal-cost link corresponding to the virtual node. The transfer module is used to transfer the virtual node corresponding to the faulty equivalent link to the remaining valid equivalent links when an equivalent link failure is detected.

8. The equivalent multipath routing device as described in claim 7, characterized in that, The equivalent multipath routing device further includes a recovery module for: When the recovery of the faulty equivalent link is detected, the transfer and allocation of the virtual node corresponding to the original faulty equivalent link is cancelled.

9. An equivalent multipath routing device, characterized in that, The equal-cost multipath routing device includes a processor, a memory, and an equal-cost multipath routing program stored in the memory and executable by the processor, wherein when the equal-cost multipath routing program is executed by the processor, it implements the steps of the equal-cost multipath routing method as described in any one of claims 1 to 6.

10. A readable storage medium, characterized in that, The readable storage medium stores an equal-cost multipath routing program, wherein when the equal-cost multipath routing program is executed by a processor, it implements the steps of the equal-cost multipath routing method as described in any one of claims 1 to 6.