ECMP group failure recovery method and apparatus, electronic device, and storage medium
By sending neighbor requests and restoring next hop information when the next hop in the ECMP group fails, routing changes and load balancing problems caused by ECMP group failure are solved, and data flow stability is achieved when the path is restored.
Patent Information
- Application Number
- PCT/CN2023/141595
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-14
- Filing Date
- 2023-12-25
- Publication Date
- 2024-09-19
AI Technical Summary
ECMP group failure leads to route changes, causing flows that should not be affected to be affected and redistributed to new paths, causing data flow turmoil, and load balancing cannot be quickly restored when the path is restored.
When the next hop in the ECMP group fails, neighbor requests are sent according to the preset period, and neighbor responses of the failed next hop are obtained to reacquire next hop information, and the failed next hop is restored based on this information to ensure load balancing.
By quickly restoring the failed next hop, load balancing is achieved, reducing the impact on data flows on non-failed paths, and ensuring the stability of data flows during the recovery process.
Smart Images

Figure CN2023141595_19092024_PF_FP_ABST
Abstract
Description
ECMP group failure recovery method, device, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to a Chinese patent application filed with the Patent Office of China on March 14, 2023, with application number 202310239663.8 and application name “ECMP group failure recovery method, device, electronic device and storage medium”, all contents of which are incorporated by reference into this application. Technical Field
[0003] Embodiments of the present application relate to the field of Internet technology, and in particular to a method for recovering from an ECMP group failure, a device for recovering from an ECMP group failure, an electronic device, and a computer non-volatile readable storage medium. Background Art
[0004] Whether in traditional networks or data center networks, ECMP (Equal Cost Multi-Path) is widely used to achieve higher reliability and load balancing. Typically, this routing is calculated by routing protocols (such as BGP (Border Gateway Protocol) and OSPF (Open Shortest Path First)) or configured through static routes. Data flows are processed using a hashing algorithm based on key fields in the message, assigning the flow to a member of the ECMP group based on the hash value. When a link or device fails, the route changes to another ECMP group with fewer members. Every data flow traversing this route is reassigned (although some traffic may remain in the original group). This requires stateful nodes along the path, such as firewalls, to rebuild their tables, causing significant disruption to traffic along other paths that should not be affected. To alleviate this situation, some devices support an elastic HASH technology. When a single-path exception occurs, the data on that path is evenly distributed to other paths (some processing will distribute all data to a specific path). However, when the path is restored, the flows on other paths can only be randomly placed on the new path based on the HASH value, which will still cause the originally stable flow to become unstable.
[0005] In actual deployments, due to reasons such as link anomalies, all routes referencing the relevant ECMP group must change and be updated. Furthermore, in actual operation, changes in the connectivity of some ECMP members can either directly lead to routing changes, resulting in drastic routing updates, or go undetected by the system, resulting in the loss of some packet forwarding. Furthermore, when NEIGH / NEIGHBOR information changes (such as ARP (Address Resolution Protocol) aging), even if the switch chip sends packets assigned to the failed path to the CPU (Central Processing Unit), the differences in the upper and lower layer hash algorithms cannot ensure that the traffic will trigger neighbor requests for the relevant paths, thus preventing the current path from being quickly repaired. Furthermore, the use of a flexible hash algorithm can evenly distribute the traffic on a single path to other paths when the path fails. However, when the path recovers, a large number of flows that should not have been affected will be affected and redistributed to the new path.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a method, apparatus, electronic device, and computer non-volatile readable storage medium for recovering from ECMP group failures to resolve or partially resolve the problem that routing changes and re-updates caused by path anomalies may affect a large number of flows that should not have been affected and be redistributed to new paths.
[0008] The present application discloses a method for recovering from an ECMP group failure. The ECMP group is composed of multiple next hops, each of which includes next hop information. The method includes:
[0009] When the next hop in the ECMP group fails, a neighbor request is sent to the failed next hop according to the preset period;
[0010] When the failed next hop returns a neighbor response for the neighbor request, reacquire the next hop information corresponding to the failed next hop according to the neighbor response and obtain the neighbor information for the next hop information; wherein the neighbor response includes the neighbor information corresponding to the failed next hop;
[0011] Based on the neighbor information, the failed next hop is restored to restore the ECMP group.
[0012] Optionally, the method further comprises:
[0013] When the next hop in the ECMP group fails, the next hop information corresponding to the failed next hop is entered into the state database
[0014] Optionally, after restoring the failed next hop to restore the ECMP group based on the neighbor information, the method further includes:
[0015] The next hop information corresponding to the invalid next hop is deleted from the state database.
[0016] Optionally, the next hop information includes an IP address corresponding to the next hop and an outbound interface of the next hop.
[0017] Optionally, the neighbor information is a correspondence between the next hop and the MAC address of the next hop.
[0018] Optionally, based on neighbor information, restore the failed next hop to restore the ECMP group, including:
[0019] According to the correspondence between the failed next hop and the MAC address of the failed next hop, the failed next hop is restored to restore the ECMP group.
[0020] Optionally, the method further comprises:
[0021] When the next hop in the ECMP group fails, the next hop is marked as a failed next hop.
[0022] Optionally, the method further comprises:
[0023] When the next hop is marked as invalid, the invalid next hop is deleted from the ECMP group.
[0024] Optionally, when the next hop is marked as invalid, the invalid next hop in the ECMP group is deleted, including:
[0025] When the outbound interface status of the failed next hop is Down, the failed next hop is deleted from the ECMP group.
[0026] Optionally, when the next hop is marked as invalid, the invalid next hop in the ECMP group is deleted, including:
[0027] When neighbor information becomes invalid, the invalid next hop in the ECMP group is deleted.
[0028] Optionally, the ECMP group is configured with a bidirectional forwarding detection protocol. When a next hop is marked as a failed next hop, the failed next hop in the ECMP group is deleted, including:
[0029] When the bidirectional forwarding detection protocol detects that the connection to the next hop is interrupted, the failed next hop in the ECMP group is deleted.
[0030] Optionally, the next hop in the ECMP group includes multiple HASH buckets, each of which corresponds to a HASH value. The method further includes:
[0031] When the ECMP group recovers, obtain the affinity and update generation value corresponding to the HASH bucket;
[0032] According to the affinity and the update generation value, the priority value of the HASH bucket is obtained;
[0033] According to the priority value and the number of hash buckets corresponding to each next hop in the ECMP group, the failed next hop is restored to allocate the hash buckets to the restored next hop.
[0034] Optionally, the priority value is used as a basis for allocating the HASH bucket to the next hop after recovery.
[0035] Optionally, the method further comprises:
[0036] In response to the HASH bucket allocation instruction, the HASH bucket is allocated to the next hop in the ECMP group.
[0037] Optionally, obtain the affinity and update generation value corresponding to the HASH bucket, including:
[0038] When a HASH bucket is initially allocated to a next hop in an ECMP group, the affinity between the HASH bucket and its corresponding next hop is recorded.
[0039] Optionally, update the attribute information of the generation value to the HASH bucket.
[0040] Optionally, the method further comprises:
[0041] When the next hop in the ECMP group fails and / or the failed next hop recovers, the updated generation value of the HASH bucket corresponding to the next hop of the current ECMP group is updated.
[0042] Optionally, based on the affinity and the update generation value, a priority value of the HASH bucket is obtained, including:
[0043] In response to the weighted instruction of the affinity and the update generation value, a numerical value of the priority of the HASH bucket is obtained.
[0044] The embodiment of the present application further discloses a device for recovering from an ECMP group failure. The ECMP group is composed of multiple next hops, each of which includes next hop information. The device includes:
[0045] A neighbor request sending module is used to send neighbor requests to the failed next hop according to a preset period when the next hop in the ECMP group fails;
[0046] a neighbor information acquisition module configured to, when the failed next hop returns a neighbor response to a neighbor request, reacquire the next hop information corresponding to the failed next hop according to the neighbor response and obtain neighbor information for the next hop information; wherein the neighbor response includes the neighbor information corresponding to the failed next hop;
[0047] The ECMP group recovery module is used to restore the failed next hop based on neighbor information to restore the ECMP group.
[0048] Optionally, the device further comprises:
[0049] The information input module is used to input the next hop information corresponding to the failed next hop into the state database when the next hop in the ECMP group fails.
[0050] Optionally, the device further comprises:
[0051] The information deletion module is used to delete the next hop information corresponding to the invalid next hop from the state database.
[0052] Optionally, the ECMP group recovery module is specifically configured to:
[0053] According to the correspondence between the failed next hop and the MAC address of the failed next hop, the failed next hop is restored to restore the ECMP group.
[0054] Optionally, the device further comprises:
[0055] The next hop marking module is used to mark the next hop as a failed next hop when the next hop in the ECMP group fails.
[0056] Optionally, the device further comprises:
[0057] The next hop deletion module is used to delete the failed next hop in the ECMP group when the next hop is marked as a failed next hop.
[0058] Optionally, the next hop deletion module is specifically configured to:
[0059] When the outbound interface status of the failed next hop is Down, the failed next hop is deleted from the ECMP group.
[0060] Optionally, the next hop deletion module is specifically configured to:
[0061] When neighbor information becomes invalid, the invalid next hop in the ECMP group is deleted.
[0062] Optionally, the ECMP group is configured with a bidirectional forwarding detection protocol, and the next hop deletion module is specifically configured to:
[0063] When the bidirectional forwarding detection protocol detects that the connection to the next hop is interrupted, the failed next hop in the ECMP group is deleted.
[0064] Optionally, the next hop in the ECMP group includes multiple HASH buckets, each of which corresponds to a HASH value. The apparatus further includes:
[0065] The data acquisition module is used to obtain the affinity and updated generation value corresponding to the HASH bucket when the ECMP group recovers;
[0066] The priority value acquisition module is used to obtain the priority value of the HASH bucket based on affinity and update generation value;
[0067] The next hop recovery module is used to recover the failed next hop according to the priority value and the number of HASH buckets corresponding to each next hop in the ECMP group to allocate the HASH bucket to the recovered next hop.
[0068] Optionally, the device further comprises:
[0069] The HASH bucket allocation module is configured to allocate the HASH bucket to the next hop in the ECMP group in response to a HASH bucket allocation instruction.
[0070] Optionally, the data acquisition module is specifically used to:
[0071] When a HASH bucket is initially allocated to a next hop in an ECMP group, the affinity between the HASH bucket and its corresponding next hop is recorded.
[0072] Optionally, the device further comprises:
[0073] The update generation value update module is used to update the update generation value of the HASH bucket corresponding to the next hop of the current ECMP group when the next hop in the ECMP group fails and / or the failed next hop is restored.
[0074] Optionally, the priority value acquisition module is specifically used to:
[0075] In response to the weighted instruction of the affinity and the update generation value, a numerical value of the priority of the HASH bucket is obtained.
[0076] The embodiment of the present application further discloses an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0077] Memory for storing computer programs;
[0078] The processor is used to implement the method of the embodiment of the present application when executing the program stored in the memory.
[0079] An embodiment of the present application further discloses a computer non-volatile readable storage medium having instructions stored thereon, which, when executed by one or more processors, causes the processors to execute a method as in an embodiment of the present application.
[0080] The embodiments of the present application include the following advantages:
[0081] In an embodiment of the present application, an ECMP group is composed of multiple next hops, each of which contains next hop information. When a next hop in the ECMP group fails, a neighbor request is sent to the failed next hop according to a preset period. When the failed next hop returns a neighbor response to the neighbor request, the next hop information corresponding to the failed next hop is retrieved based on the neighbor response and neighbor information corresponding to the next hop information is obtained. The neighbor response includes the neighbor information corresponding to the failed next hop. Based on the neighbor information, the failed next hop is restored to restore the ECMP group. By sending a neighbor request to the failed next hop and retrieving the next hop information corresponding to the failed next hop based on the neighbor response returned by the neighbor request to obtain the neighbor information, the failed next hop can be restored more quickly based on the neighbor information and can be quickly discovered to re-achieve load balancing. During the recovery process, data flows on non-failed next hops are rarely or almost unaffected. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] FIG1 is a flowchart of a method for recovering from an ECMP group failure provided in an embodiment of the present application;
[0083] FIG2 is a schematic diagram of a configuration structure of an ECMP group provided in an embodiment of the present application;
[0084] FIG3 is a schematic diagram of a flow chart of a priority algorithm provided in an embodiment of the present application;
[0085] FIG4 is a structural block diagram of an ECMP group failure recovery device provided in an embodiment of the present application;
[0086] FIG5 is a schematic diagram of the structure of a computer non-volatile readable storage medium provided in an embodiment of the present application;
[0087] FIG6 is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application. DETAILED DESCRIPTION
[0088] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0089] As an example, both in traditional networks and data center networks, ECMP is widely used to achieve higher reliability and load balancing. Generally, this type of routing can be calculated by routing protocols and the OSPF protocol or configured through static routes. Data flows are processed by a hash algorithm based on key fields in the message, and the data flow is assigned to a member of the ECMP group based on the hash value for transmission. When a related link or device fails, the route changes, pointing to another ECMP group with fewer members. Every data flow passing through this route is redistributed (although a small amount of traffic may be assigned to the original group). For stateful nodes along the path (such as firewalls), all table entries need to be almost completely rebuilt, causing significant turbulence to traffic on other paths that should not be affected. To alleviate this problem, some devices support a flexible hashing technology. When a single path fails, data on that path is evenly distributed to other paths (some even allocate all traffic to a specific path). However, when the path recovers, flows on other paths are randomly relocated to the new path, which can still cause instability in previously stable flows. Specifically, in actual deployments, due to reasons such as link failures, all routes referencing the relevant ECMP group must change and be updated. Furthermore, in actual operation, changes in the connectivity of some ECMP members can either directly lead to routing changes, causing drastic routing updates, or go undetected by the system, resulting in some packet forwarding loss. Furthermore, when neighbor information changes, even if the switch chip sends the information assigned to the failed path to the CPU, due to differences in the hashing algorithms at the upper and lower layers, there's no guarantee that traffic will trigger neighbor requests on the relevant paths, preventing a prompt restoration of the current path. Furthermore, while the flexible hashing algorithm can evenly distribute flows on a single path when it fails, when the path recovers, a large number of flows that should not have been affected are affected and redistributed to new paths.
[0090] In this regard, one of the core inventions of this application is that an ECMP group is composed of multiple next hops, each of which contains next hop information. When a next hop in the ECMP group fails, a neighbor request is sent to the failed next hop according to a preset period. When the failed next hop returns a neighbor response to the neighbor request, the next hop information corresponding to the failed next hop is retrieved based on the neighbor response and neighbor information for the next hop information is obtained. The neighbor response contains the neighbor information corresponding to the failed next hop. Based on the neighbor information, the failed next hop is restored to restore the ECMP group. By sending a neighbor request to the failed next hop and retrieving the next hop information corresponding to the failed next hop based on the neighbor response returned by the neighbor request to obtain neighbor information, the failed next hop can be restored more quickly based on the neighbor information and can be quickly discovered to re-achieve load balancing. During the recovery process, the data flow on the non-failed next hop is rarely or almost unaffected.
[0091] 1 , a flowchart of a method for recovering from an ECMP group failure provided in an embodiment of the present application is shown. The ECMP group is composed of multiple next hops, each of which includes next hop information. Specifically, the method may include the following steps:
[0092] Step 101: When the next hop in the ECMP group fails, a neighbor request is sent to the failed next hop according to a preset period;
[0093] Among them, ECMP is an equal-cost multi-path routing. ECMP exists in a network environment where multiple different links can reach the same destination address; among them, the ECMP group is composed of multiple next hops, and the next hop contains next hop information. It should be noted that a next hop can be understood as a member, that is, the ECMP group can be composed of multiple members.
[0094] Optionally, the next hop information may include an IP (Internet Protocol) address corresponding to the next hop and an outbound interface of the next hop;
[0095] Among them, the preset period is the result of manual setting. Those skilled in the art can adjust the preset period according to actual circumstances, and the embodiments of the present application do not limit this.
[0096] The neighbor request is an information request sent to the failed next hop in order to obtain the next hop information and obtain the neighbor information according to the next hop information, so that the failed next hop can be restored according to the neighbor information.
[0097] In a specific implementation, the ECMP group is composed of multiple next hops, and the next hop includes next hop information. When the next hop of the ECMP group fails, a neighbor request can be sent to the failed next hop according to a preset period.
[0098] Step 102: When the failed next hop returns a neighbor response for the neighbor request, reacquire the next hop information corresponding to the failed next hop and obtain neighbor information for the next hop information based on the neighbor response; wherein the neighbor response includes the neighbor information corresponding to the failed next hop;
[0099] A neighbor request is an information request sent to a failed next hop in order to obtain next hop information and obtain neighbor information based on the next hop information.
[0100] The neighbor response is an information reply in response to the neighbor request. The neighbor response may include the neighbor information corresponding to the invalid next hop. The neighbor information is the correspondence between the next hop and the MAC (Media Access Control) address of the next hop. It can be understood that the next hop information in the ECMP group usually refers to the IP address of the next hop and the outbound interface of the next hop. The IP address and the outbound interface must have a corresponding MAC address to be sent on the Ethernet. That is, the neighbor information is the correspondence between the IP address of the next hop and the outbound interface of the next hop and the MAC address of the next hop. Therefore, the neighbor information is required for the next hop to take effect.
[0101] In a specific implementation, an ECMP group consists of multiple next hops, each of which contains next hop information. When a next hop in the ECMP group fails, a neighbor request can be sent to the failed next hop according to a preset period. When the failed next hop returns a neighbor response to the neighbor request, the next hop information corresponding to the failed next hop is retrieved based on the neighbor response, and the neighbor information for the next hop information is obtained. The neighbor response contains the neighbor information corresponding to the failed next hop, thereby providing data support for recovering the failed next hop.
[0102] Step 103: Restore the failed next hop based on the neighbor information to restore the ECMP group.
[0103] Optionally, when the next hop in the ECMP group fails, the next hop information corresponding to the failed next hop is input into the state database; after the failed next hop is restored to restore the ECMP group based on the neighbor information, the next hop information corresponding to the failed next hop is deleted from the state database.
[0104] Exemplarily, when the next hop in the ECMP group fails, the next hop information corresponding to the failed next hop is recorded in the state database and the state database is monitored by an independent process so that the independent process sends a neighbor request to the failed next hop according to the next hop information in the state database to restore the failed next hop to a valid state as soon as possible; and, after the ECMP group is restored, the next hop information corresponding to the failed next hop is deleted from the state database. It can be understood that neighbor requests can be sent to the next hop (member) in the ECMP group regularly to restore the failed next hop as soon as possible. A normal next hop does not need to send neighbor requests regularly or intensively, so the next hop information corresponding to the failed next hop needs to be deleted from the state database. It should be noted that the operation of deleting the next hop information corresponding to the failed next hop from the state database after the failed next hop is restored can be omitted, that is, after the failed next hop is restored, the next hop information corresponding to the failed next hop can be deleted from the state database or not, which has no effect on the recovery of the failed next hop. Those skilled in the art can adjust according to actual circumstances, and the embodiments of the present application are not limited to this.
[0105] In a specific implementation, an ECMP group is composed of multiple next hops, each of which contains next hop information. When the next hop of the ECMP group fails, a neighbor request can be sent to the failed next hop according to a preset period. At the same time, the next hop information corresponding to the failed next hop is recorded in a state database and monitored. Then, according to the neighbor request, the next hop information corresponding to the failed next hop can be retrieved and the neighbor information for the next hop information can be obtained. Therefore, according to the correspondence between the failed next hop and the MAC address of the failed next hop, the failed next hop can be restored to restore the ECMP group, so as to make up for the defect of unreliable traffic triggering for the ECMP group. Moreover, after the ECMP group is restored, the next hop information corresponding to the failed next hop is deleted from the state database.
[0106] Optionally, based on neighbor information, restore the failed next hop to restore the ECMP group, including:
[0107] According to the correspondence between the failed next hop and the MAC address of the failed next hop, the failed next hop is restored to restore the ECMP group.
[0108] In a specific implementation, the neighbor information is the correspondence between the IP address of the next hop and the outgoing interface of the next hop and the MAC address of the next hop. When it is necessary to restore the failed next hop to restore the ECMP group, the failed next hop can be restored to restore the ECMP group based on the correspondence between the IP address of the failed hop and the outgoing interface of the failed next hop and the MAC address of the failed next hop.
[0109] In an embodiment of the present application, an ECMP group is composed of multiple next hops, each of which includes next hop information. When a next hop of the ECMP group fails, a neighbor request is sent to the failed next hop according to a preset period. When the failed next hop returns a neighbor response to the neighbor request, the next hop information corresponding to the failed next hop is retrieved based on the neighbor response and neighbor information corresponding to the next hop information is obtained. The neighbor response includes the neighbor information corresponding to the failed next hop. Based on the neighbor information, the failed next hop is restored to restore the ECMP group. By sending a neighbor request to the failed next hop and retrieving the next hop information corresponding to the failed next hop based on the neighbor response returned by the neighbor request to obtain the neighbor information, the failed next hop can be restored more quickly based on the neighbor information and can be quickly discovered to re-achieve load balancing. During the recovery process, data flows on non-failed next hops are rarely or almost unaffected.
[0110] In an optional embodiment, when the next hop is marked as a failed next hop, the failed next hop in the ECMP group is deleted.
[0111] In a specific implementation, when a next hop is marked as an invalid next hop, the invalid next hop is deleted from the ECMP group.
[0112] Optionally, when the next hop in the ECMP group fails, the next hop needs to be marked as a failed next hop first. Specifically, the next hop in the ECMP group contains multiple HASH buckets. The HASH bucket can be understood as a modulo HASH value, and the modulo HASH value enters the HASH bucket, where the HASH bucket can be correspondingly allocated to all next hops in the ECMP group; when a next hop in the ECMP group fails, the next hop is first marked as an unreachable next hop, and the HASH bucket previously allocated to the unreachable next hop is distributed to other reachable next hops. It is worth mentioning that the marking process can also be understood as the process of deleting the failed next hop in the ECMP group.
[0113] Optionally, when the status of the outgoing interface of the failed next hop is outgoing interface DOWN, the failed next hop in the ECMP group is deleted. That is, when the status of the outgoing interface of the next hop is outgoing interface DOWN, it means that the link of the next hop has become abnormal, and the failed next hop in the ECMP group needs to be deleted.
[0114] In addition, when neighbor information becomes invalid, the invalid next hop in the ECMP group is deleted.
[0115] The failure of neighbor information is a type of change in neighbor information. Specifically, when neighbor information fails (such as when the status of neighbor information changes to INCOMPLETE (incomplete status) or FAIL (failed status)), the neighbor information no longer has a valid MAC address. At this time, the failed next hop corresponding to the neighbor information can be deleted.
[0116] It should be noted that for changes in neighbor information, there is also a situation where the next hop is updated. Specifically, when the MAC address in the neighbor information changes to another MAC address, there is no need to delete the corresponding next hop of the neighbor information in the ECMP group. The corresponding next hop in the ECMP group can be directly updated.
[0117] Regarding changes in neighbor information, it may be due to aging of ARP (Address Resolution Protocol). It can be understood that in actual applications, there may be many situations in which neighbor information becomes invalid. For the convenience of description, the examples listed are relatively simple, and the embodiments of this application will not provide detailed explanations for this.
[0118] Optionally, the ECMP group is provided with a bidirectional forwarding detection protocol. When the bidirectional forwarding detection protocol detects that a connection to the next hop is interrupted, the invalid next hop in the ECMP group is deleted.
[0119] Bidirectional Forwarding Detection (BFD) is a network protocol that can be used to detect failures between two forwarding points.
[0120] It can be understood that when the status of the outbound interface of the ECMP group is outbound interface DOWN, the neighbor information is invalid, and the connection to the next hop is interrupted, the invalid next hop in the ECMP group can be deleted, that is, the next hop (member) of the current ECMP group can be directly updated, so that the routes that reference the ECMP group do not need to be re-issued, and the traffic can be directed to other reachable paths (next hops) without having to fully update the routing table entries.
[0121] In a specific implementation, when the status of the outbound interface of the ECMP group is outbound interface DOWN, the neighbor information is aged or no longer reachable, and when a path failure such as a connection interruption to the next hop is discovered through protocols such as the bidirectional forwarding detection protocol, there is no need to update the route. Instead, the members of the current ECMP group are directly updated. That is, the failed next hop in the ECMP group is deleted, so that the routes referencing the ECMP group do not need to be re-issued, and the traffic is directed to other reachable paths (next hops) without having to fully update the routing table entries. In this way, the failed path can be restored more quickly and can be quickly discovered and load balancing can be re-achieved. In addition, during the recovery process, the data flow on the non-failed path is rarely or almost not affected. In addition, when the failed path is restored, the data of other links is directed to the restored path.
[0122] It is understandable that when the status of the outgoing interface of the failed next hop is outgoing interface UP, the failed next hop can be restored to restore the failed ECMP group; secondly, when the neighbor information for the failed next hop is regained, that is, when the corresponding relationship between the IP address of the failed next hop and the outgoing interface of the failed next hop and the MAC address of the failed next hop is regained, the failed next hop can be restored to restore the failed ECMP group. For example, when the ARP request receives an ARP response from the owner of the IP address, it can be understood that the neighbor information has been regained, that is, the corresponding relationship between the IP address and the outgoing interface and the MAC address has been regained; in addition, the connection to the next hop can be found to be failed or restored through protocols such as the bidirectional forwarding detection protocol to determine whether the next hop in the ECMP group is failed or effective. After restoring the failed next hop to restore the ECMP group, the data of other links can be directed to the restored path (next hop).
[0123] Referring to FIG2 , a schematic diagram of the configuration structure of an ECMP group provided in an embodiment of the present application is shown. As shown in FIG2 , the ECMP group can determine the working status of the next hop based on changes in neighbor information, changes in link status, and changes in the state of the bidirectional forwarding detection protocol. When a path fails, there is no need to update the route, but instead directly update the members of the current ECMP group, that is, update the next hop of the ECMP group, so that the routes that reference the ECMP group do not need to be re-issued, thereby directing traffic to other reachable paths without having to fully update the routing table entries. Secondly, when the failed path is restored, the data of other links is directed to the restored path. Among them, for the currently failed path, the failed next hop information can be recorded in the state database, and the database is monitored by an independent process. For the temporarily unreachable next hop information, neighbor requests are actively and regularly sent to re-acquire neighbor information to restore the ECMP group, thereby compensating for the defect of unreliable traffic triggering for the ECMP group. When the failed path is restored, the data of other links is directed to the restored path, and the failed next hop information is deleted from the state database.
[0124] In an embodiment of the present application, an ECMP group is composed of multiple next hops, each of which includes next hop information. When a next hop of the ECMP group fails, a neighbor request is sent to the failed next hop according to a preset period. When the failed next hop returns a neighbor response to the neighbor request, the next hop information corresponding to the failed next hop is retrieved based on the neighbor response and neighbor information corresponding to the next hop information is obtained. The neighbor response includes the neighbor information corresponding to the failed next hop. Based on the neighbor information, the failed next hop is restored to restore the ECMP group. By sending a neighbor request to the failed next hop and retrieving the next hop information corresponding to the failed next hop based on the neighbor response returned by the neighbor request to obtain the neighbor information, the failed next hop can be restored more quickly based on the neighbor information and can be quickly discovered to re-achieve load balancing. During the recovery process, data flows on non-failed next hops are rarely or almost unaffected.
[0125] At the same time, when the status of the ECMP group's outbound interface is DOWN, the neighbor information is aged or no longer reachable, or when the connection to the next hop is interrupted through protocols such as the bidirectional forwarding detection protocol, there is no need to update the route. Instead, the members of the current ECMP group are directly updated, so that the routes that reference the ECMP group do not need to be re-issued, and the traffic is directed to other reachable paths (next hop) without having to fully update the routing table entries.
[0126] In an optional embodiment, the next hop in the ECMP group includes multiple HASH buckets, each of which corresponds to a HASH value. The method further includes:
[0127] When the ECMP group recovers, obtain the affinity and update generation value corresponding to the HASH bucket;
[0128] According to the affinity and the update generation value, the priority value of the HASH bucket is obtained;
[0129] According to the priority value and the number of hash buckets corresponding to each next hop in the ECMP group, the failed next hop is restored to allocate the hash buckets to the restored next hop.
[0130] Among them, for the HASH bucket, it can be the HASH value after modulo, and the HASH value after modulo enters the HASH bucket. The HASH bucket can also be understood as a corresponding position; for the HASH value, it is usually a 32-bit unsigned integer value calculated by a hash algorithm.
[0131] For affinity and update generation values, they are the location affinity and update generation values of the state when the ECMP group first reaches the maximum number of group members;
[0132] Optionally, in response to the HASH bucket allocation instruction, the HASH bucket may be allocated to the next hop in the ECMP group, wherein when the HASH bucket is initially allocated to the next hop in the ECMP group, the affinity between the HASH bucket and its corresponding next hop is recorded.
[0133] It should be noted that the initial allocation can be understood as the process of sending the HASH bucket to all next hops of the ECMP group for the first time. Specifically, when sending it for the first time, the HASH bucket will be sent to the next hop first regardless of whether the next hop is reachable. After the initial sending of the HASH bucket is completed, if there is an unreachable next hop, the unreachable next hop will be deleted.
[0134] In a specific implementation, when the HASH bucket is initially allocated to the next hop in the ECMP group, the affinity between the HASH bucket and its corresponding next hop can be recorded. In the embodiment of the present application, the affinity between the HASH buckets initially allocated to the failed next hop is recorded as 1, and the affinity of the remaining positions is recorded as 0. It should be noted that in actual applications, each HASH bucket will record which next hop is more affinity. In the embodiment of the present application, the initial allocation is used as the basis for affinity. It is assumed that the initial allocation is 1 and the rest are 0. It can be understood that the value and basis of the affinity can be selected by those skilled in the art according to actual conditions, and the embodiment of the present application does not limit this.
[0135] Optionally, the updated generation value is the attribute information of the HASH bucket. When the next hop in the ECMP group fails and / or the failed next hop is restored, the updated generation value of the HASH bucket corresponding to the next hop of the current ECMP group can be updated. In an embodiment of the present application, when an update occurs due to the failure of the next hop, the updated generation value of all updated HASH buckets is increased by one. When an update occurs due to the recovery of the next hop, the updated generation value of all updated HASH buckets is reduced by one. It is understandable that those skilled in the art can adjust the calculation method of the updated generation value when it changes due to the failure of the next hop and / or the recovery of the failed next hop according to actual conditions, and the embodiment of the present application does not limit this.
[0136] Optionally, the priority value is used as the basis for allocating the HASH bucket to the next hop after recovery, wherein the priority value of the HASH bucket is obtained in response to the weighted instruction of the affinity and the update generation value. It can be understood that the priority value can be obtained by weighted calculation of the affinity and the update generation value.
[0137] In a specific implementation, the next hop in an ECMP group contains multiple HASH buckets, each of which corresponds to a HASH value. When the ECMP group recovers, the affinity and updated generation value corresponding to the HASH bucket are obtained. Based on the affinity and updated generation value, the priority value of the HASH bucket is then determined. Then, based on the priority value and the number of HASH buckets corresponding to each next hop in the ECMP group, the failed next hop is restored to assign the HASH bucket to the restored next hop. This allows for faster recovery of the failed next hop and rapid rebalancing of load. During the recovery process, data flows on non-failed next hops are minimally or almost unaffected. Furthermore, once the failed path is restored, data from other links is redirected to the restored path.
[0138] In order to help those skilled in the art better understand the technical solutions of the embodiments of the present application, an example is provided below for illustrative purposes:
[0139] 3 , a schematic diagram of a flow chart of a priority algorithm provided in an embodiment of the present application is shown;
[0140] In order to ensure that the data flow that is not on the faulty path is not affected during the path switching process, the system will calculate the priority value of each position as the basis for migration to the new position when the path is restored. That is, the priority value can be used as the basis for allocating the HASH bucket to the next hop after recovery. The priority value is calculated by weighting the position affinity of the state when the maximum number of group members is first reached and the update generation value (epoch). That is, the HASH bucket with a higher priority is migrated to the new path first. For the sake of simplicity, the embodiment of the present application is explained by distributing 16 HASH values (modulo HASH values) to an ECMP group consisting of 4 next hops.
[0141] As shown in Figure 3, when the data stream is first delivered, the next hops for the positions associated with each HASH value are placed as shown in the initial diagram (Figure 3, first row, first picture). When 3 fails, the HASH bucket with the original next hop of 3 is assigned to 1, 2, and 4 in sequence, and the updated epoch value of each changed position is increased by one (Figure 3, second row, second picture), resulting in the second-step diagram (Figure 3, first row, second picture). When 2 fails again, since 1 was previously assigned in excess, the allocation starts from 4 and is assigned to 4 and 1 respectively, maintaining the same number of 4 and 1. The updated epoch value of the changed position is increased by one again, resulting in the third-step diagram (Figure 3, first row, third picture).
[0142] In addition, when 3 is restored, the priority obtained by weighting the initial position of 3 (recorded as affinity, in this example, half of the number of next hops is used as affinity, that is, the affinity is weighted as 2 and the update generation value is weighted as 1) and the epoch value is calculated. The position with the highest priority in each value range is assigned to 3, and the update generation value of each position is changed by one to obtain the fourth step diagram. Similarly, when 2 is also restored, it is finally restored to the fifth step diagram. The principle of 2 recovery is similar to that of 3 recovery mentioned above, and the embodiment of this application will not be repeated here.
[0143] It should be noted that the restoration to the original state in this figure is a coincidence and is not a state that can necessarily be achieved. It can be understood that in actual application, there are many states after restoration, and the above-mentioned embodiment of the present application is only a coincidental state.
[0144] In an embodiment of the present application, an ECMP group is composed of multiple next hops, each of which includes next hop information. When a next hop of the ECMP group fails, a neighbor request is sent to the failed next hop according to a preset period. When the failed next hop returns a neighbor response to the neighbor request, the next hop information corresponding to the failed next hop is retrieved based on the neighbor response and neighbor information corresponding to the next hop information is obtained. The neighbor response includes the neighbor information corresponding to the failed next hop. Based on the neighbor information, the failed next hop is restored to restore the ECMP group. By sending a neighbor request to the failed next hop and retrieving the next hop information corresponding to the failed next hop based on the neighbor response returned by the neighbor request to obtain the neighbor information, the failed next hop can be restored more quickly based on the neighbor information and can be quickly discovered to re-achieve load balancing. During the recovery process, data flows on non-failed next hops are rarely or almost unaffected.
[0145] At the same time, when the status of the ECMP group's outbound interface is DOWN, the neighbor information is aged or no longer reachable, or when the connection to the next hop is interrupted through protocols such as the bidirectional forwarding detection protocol, there is no need to update the route. Instead, the members of the current ECMP group are directly updated, so that the routes that reference the ECMP group do not need to be re-issued, and the traffic is directed to other reachable paths (next hop) without having to fully update the routing table entries.
[0146] In addition, when the next hop on a path fails, the next hop information is recorded in a database. An independent process periodically requests the database content to retrieve the failed next hop as soon as possible. On the basis of not affecting the data flow distribution on the non-failed path when the path fails, the affinity value and the updated generation value of each position (HASH bucket) are calculated when the path is restored. The value obtained by weighting the affinity value and the updated generation value is used as the priority value of the position. The priority value is then used as the basis for migration to a new position, that is, as the basis for allocating the HASH bucket to the next hop after recovery, so as to minimize the impact on the original data flow on the non-failed path.
[0147] It should be noted that for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the order of the actions described, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0148] 4 shows a block diagram of a device for recovering from an ECMP group failure provided in an embodiment of the present application. The ECMP group is composed of multiple next hops, each of which includes next hop information. Specifically, the device may include the following modules:
[0149] A neighbor request sending module 401 is configured to send a neighbor request to the failed next hop according to a preset period when the next hop in the ECMP group fails;
[0150] a neighbor information acquisition module 402 configured to, when the failed next hop returns a neighbor response to a neighbor request, reacquire next hop information corresponding to the failed next hop based on the neighbor response and obtain neighbor information corresponding to the next hop information; wherein the neighbor response includes the neighbor information corresponding to the failed next hop;
[0151] The ECMP group recovery module 403 is configured to recover the failed next hop according to the neighbor information to recover the ECMP group.
[0152] In an optional embodiment, the apparatus further comprises:
[0153] The information input module is used to input the next hop information corresponding to the failed next hop into the state database when the next hop in the ECMP group fails.
[0154] In an optional embodiment, the apparatus further comprises:
[0155] The information deletion module is used to delete the next hop information corresponding to the invalid next hop from the state database.
[0156] In an optional embodiment, the ECMP group recovery module is specifically configured to:
[0157] According to the correspondence between the failed next hop and the MAC address of the failed next hop, the failed next hop is restored to restore the ECMP group.
[0158] In an optional embodiment, the apparatus further comprises:
[0159] The next hop marking module is used to mark the next hop as a failed next hop when the next hop in the ECMP group fails.
[0160] In an optional embodiment, the apparatus further comprises:
[0161] The next hop deletion module is used to delete the failed next hop in the ECMP group when the next hop is marked as a failed next hop.
[0162] In an optional embodiment, the next hop deletion module is specifically configured to:
[0163] When the outbound interface status of the failed next hop is Down, the failed next hop is deleted from the ECMP group.
[0164] In an optional embodiment, the next hop deletion module is specifically configured to:
[0165] When neighbor information becomes invalid, the invalid next hop in the ECMP group is deleted.
[0166] In an optional embodiment, the ECMP group is provided with a bidirectional forwarding detection protocol, and the next hop deletion module is specifically configured to:
[0167] When the bidirectional forwarding detection protocol detects that the connection to the next hop is interrupted, the failed next hop in the ECMP group is deleted.
[0168] In an optional embodiment, the next hop in the ECMP group includes multiple HASH buckets, each of which corresponds to a HASH value, and the apparatus further includes:
[0169] The data acquisition module is used to obtain the affinity and updated generation value corresponding to the HASH bucket when the ECMP group recovers;
[0170] The priority value acquisition module is used to obtain the priority value of the HASH bucket based on affinity and update generation value;
[0171] The next hop recovery module is used to recover the failed next hop according to the priority value and the number of HASH buckets corresponding to each next hop in the ECMP group to allocate the HASH bucket to the recovered next hop.
[0172] In an optional embodiment, the apparatus further comprises:
[0173] The HASH bucket allocation module is configured to allocate the HASH bucket to the next hop in the ECMP group in response to a HASH bucket allocation instruction.
[0174] In an optional embodiment, the data acquisition module is specifically configured to:
[0175] When a HASH bucket is initially allocated to a next hop in an ECMP group, the affinity between the HASH bucket and its corresponding next hop is recorded.
[0176] In an optional embodiment, the apparatus further comprises:
[0177] The update generation value update module is used to update the update generation value of the HASH bucket corresponding to the next hop of the current ECMP group when the next hop in the ECMP group fails and / or the failed next hop is restored.
[0178] In an optional embodiment, the priority value acquisition module is specifically configured to:
[0179] In response to the weighted instruction of the affinity and the update generation value, a numerical value of the priority of the HASH bucket is obtained.
[0180] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0181] In addition, an embodiment of the present application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and runnable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned ECMP group failure recovery method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0182] FIG5 is a schematic diagram of the structure of a computer non-volatile readable storage medium provided in an embodiment of the present application;
[0183] The present application also provides a non-volatile computer-readable storage medium 501, which stores a computer program. When executed by a processor, the computer program implements the various processes of the above-mentioned ECMP group failure recovery method embodiment and achieves the same technical effect. To avoid repetition, the details are not described here. The non-volatile computer-readable storage medium 501 is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0184] FIG6 is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application.
[0185] The electronic device 600 includes but is not limited to components such as a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611. Those skilled in the art will appreciate that the electronic device structure shown in FIG6 does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. In the embodiments of the present application, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0186] It should be understood that in the embodiments of the present application, the RF unit 601 may be used to receive and transmit signals during information transmission or calls. Specifically, it receives downlink data from the base station and transmits it to the processor 610 for processing; in addition, it transmits uplink data to the base station. Typically, the RF unit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, and the like. Furthermore, the RF unit 601 may communicate with the network and other devices via a wireless communication system.
[0187] The electronic device provides users with wireless broadband Internet access through the network module 602, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0188] The audio output unit 603 can convert audio data received by the RF unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output it as sound. In addition, the audio output unit 603 can also provide audio output related to a specific function performed by the electronic device 600 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, a receiver, etc.
[0189] The input unit 604 is used to receive audio or video signals. The input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The graphics processor 6041 processes image data of a still picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frames can be displayed on the display unit 606. The image frames processed by the graphics processor 6041 can be stored in the memory 609 (or other storage medium) or transmitted via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be sent to a mobile communication base station via the radio frequency unit 601 in the case of a telephone call mode.
[0190] The electronic device 600 also includes at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 6061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 6061 and / or the backlight when the electronic device 600 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 605 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0191] The display unit 606 is used to display information input by the user or information provided to the user. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0192] The user input unit 607 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the electronic device. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. The touch panel 6071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch panel 6071). The touch panel 6071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 610, which receives and executes the command sent by the processor 610. In addition, the touch panel 6071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 6071, the user input unit 607 may also include other input devices 6072. Specifically, other input devices 6072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.
[0193] Furthermore, the touch panel 6071 may be overlaid on the display panel 6061. When the touch panel 6071 detects a touch operation on or near it, it transmits the information to the processor 610 to determine the type of touch event. The processor 610 then provides a corresponding visual output on the display panel 6061 based on the type of touch event. Although in FIG6 , the touch panel 6071 and the display panel 6061 are used as two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 6071 and the display panel 6061 may be integrated to implement the input and output functions of the electronic device, which is not limited to this specific embodiment.
[0194] The interface unit 608 is an interface for connecting external devices to the electronic device 600. For example, the external devices may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 608 may be used to receive input (e.g., data information, power, etc.) from the external device and transmit the received input to one or more elements within the electronic device 600, or may be used to transmit data between the electronic device 600 and the external device.
[0195] Memory 609 can be used to store software programs and various data. Memory 609 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function or an image playback function); the data storage area may store data generated based on the use of the mobile phone (such as audio data, a phone book, etc.). Furthermore, memory 609 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0196] The processor 610 is the control center of the electronic device. It connects the various components of the electronic device using various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 609 and accessing data stored in the memory 609, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into the processor 610.
[0197] The electronic device 600 may also include a power supply 611 (such as a battery) to supply power to each component. Preferably, the power supply 611 may be logically connected to the processor 610 through a power management system, thereby enabling the power management system to manage functions such as charging, discharging, and power consumption.
[0198] In addition, the electronic device 600 includes some functional modules not shown, which will not be described here.
[0199] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0200] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course 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 the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of each embodiment of the present application.
[0201] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
[0202] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0203] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0204] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0205] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0206] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0207] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer non-volatile readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0208] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for recovering from an ECMP group failure, wherein the ECMP group is composed of multiple next hops, and the next hop includes next hop information, characterized in that: The method comprises: When the next hop in the ECMP group fails, a neighbor request is sent to the failed next hop according to a preset period; When the failed next hop returns a neighbor response for the neighbor request, reacquire the next hop information corresponding to the failed next hop according to the neighbor response and obtain the neighbor information for the next hop information; wherein the neighbor response includes the neighbor information corresponding to the failed next hop; The failed next hop is restored according to the neighbor information to restore the ECMP group.
2. The method according to claim 1, characterized in that The method further comprises: When a next hop in the ECMP group fails, the next hop information corresponding to the failed next hop is input into the state database.
3. The method according to claim 2, characterized in that After restoring the failed next hop according to the neighbor information to restore the ECMP group, the method further includes: The next hop information corresponding to the invalid next hop is deleted from the state database.
4. The method according to claim 1, characterized in that: The next hop information includes an IP address corresponding to the next hop and an outbound interface of the next hop.
5. The method according to claim 4, characterized in that The neighbor information is the correspondence between the next hop and the MAC address of the next hop.
6. The method according to claim 5, characterized in that The step of restoring the failed next hop according to the neighbor information to restore the ECMP group includes: According to the correspondence between the failed next hop and the MAC address of the failed next hop, the failed next hop is restored to restore the ECMP group.
7. The method according to claim 1, characterized in that The method further comprises: When the next hop in the ECMP group fails, the next hop is marked as a failed next hop.
8. The method according to claim 7, characterized in that The method further comprises: When the next hop is marked as an invalid next hop, the invalid next hop in the ECMP group is deleted.
9. The method according to claim 8, characterized in that When the next hop is marked as an invalid next hop, deleting the invalid next hop in the ECMP group includes: When the state of the outbound interface of the failed next hop is outbound interface DOWN, the failed next hop in the ECMP group is deleted.
10. The method according to claim 8, characterized in that When the next hop is marked as an invalid next hop, deleting the invalid next hop in the ECMP group includes: When the neighbor information becomes invalid, the invalid next hop in the ECMP group is deleted.
11. The method according to claim 8, characterized in that The ECMP group is provided with a bidirectional forwarding detection protocol, and when the next hop is marked as an invalid next hop, deleting the invalid next hop in the ECMP group includes: When the bidirectional forwarding detection protocol detects that the connection to the next hop is interrupted, the failed next hop in the ECMP group is deleted.
12. The method according to claim 1, characterized in that The next hop in the ECMP group includes a plurality of HASH buckets, each of which corresponds to a HASH value. The method further includes: When the ECMP group is restored, the affinity and updated generation value corresponding to the HASH bucket are obtained; Obtaining a value of the priority of the HASH bucket according to the affinity and the update generation value; According to the value of the priority and the number of HASH buckets corresponding to each next hop in the ECMP group, the failed next hop is restored to allocate the HASH bucket to the restored next hop.
13. The method according to claim 12, characterized in that The value of the priority is used as a basis for allocating the HASH bucket to the next hop after recovery.
14. The method according to claim 12, characterized in that The method further comprises: In response to the allocation instruction of the HASH bucket, the HASH bucket is allocated to the next hop in the ECMP group.
15. The method according to claim 14, characterized in that The obtaining the affinity and updating generation value corresponding to the HASH bucket includes: When the HASH bucket is initially allocated to the next hop in the ECMP group, the affinity between the HASH bucket and its corresponding next hop is recorded.
16. The method according to claim 12, characterized in that The updated generation value is the attribute information of the HASH bucket.
17. The method according to claim 16, characterized in that The method further comprises: When the next hop in the ECMP group fails and / or the failed next hop is restored, the updated generation value of the HASH bucket corresponding to the next hop of the current ECMP group is updated.
18. The method according to claim 12, characterized in that The obtaining of the value of the priority of the HASH bucket according to the affinity and the update generation value includes: In response to the weighted instruction of the affinity and the update generation value, a value of the priority of the HASH bucket is obtained.
19. A recovery device for failure of an ECMP group, wherein the ECMP group is composed of multiple next hops, and the next hop includes next hop information, characterized in that: The device comprises: A neighbor request sending module, used for sending a neighbor request to the failed next hop according to a preset period when the next hop in the ECMP group fails; A neighbor information acquisition module, configured to, when the failed next hop returns a neighbor response to the neighbor request, reacquire the next hop information corresponding to the failed next hop according to the neighbor response and obtain the neighbor information for the next hop information; wherein the neighbor response includes the neighbor information corresponding to the failed next hop; The ECMP group recovery module is used to recover the failed next hop according to the neighbor information to recover the ECMP group.
20. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 18 when executing the program stored in the memory.
21. A computer non-volatile readable storage medium, characterized in that: Instructions are stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 18.
Citation Information
Patent Citations
Method and system for failure detection
CN101989933A
Distributed parallel Skyline inquiring method based on cloud computing environment
CN102314521A
Router switching method and device
CN102316041A
ECMP group failure recovery method and device, electronic equipment and storage medium
CN115955434A
Internet protocol fast reroute for shared risk link group failure recovery
US20100315943A1
