Troubleshooting methods, devices, equipment, and media
By keeping the target member unchanged in the ECMP group and using other normal member links as backup, load balancing hash calculation and forwarding are achieved, which solves the transmission instability problem caused by transmission path failure in ECMP technology and ensures the reliability and rationality of message transmission.
Patent Information
- Application Number
- CN202211649683.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-12-21
AI Technical Summary
In ECMP technology, when a transmission path fails, the reliability and rationality of transmission need to be improved. The existing processing method may cause the hash value calculated for the same message to be indexed to different member exits, affecting the message forwarding service on the normal link, resulting in resource waste and unstable transmission.
By keeping the target member unchanged in the ECMP group and using other normal member links as backup, load balancing hash calculation and forwarding are performed to ensure that traffic can still be evenly distributed after a link failure, achieving session persistence and load balancing.
Before and after a link failure, the forwarding traffic on the normal link is ensured to be unaffected, achieving session persistence and load balancing, improving the reliability and rationality of message transmission, and avoiding the increase of hardware cost and complexity.
Smart Images

Figure CN116319533B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a fault handling method, apparatus, device and medium. Background Art
[0002] ECMP (Equal Cost Multi-path) technology can be used in routing communications to achieve load balancing and link backup for equal-cost multi-paths. When there is only a single path to the next hop of the route, the transmission bandwidth is low, and when problems occur in the link, communication will be interrupted. Using ECMP technology, the next hop of the route is an ECMP group. An ECMP group contains multiple members, each of which represents an available transmission path. When the message to be transmitted enters the forwarding device, it performs a hash calculation on the relevant fields of the message according to pre-configured rules, such as a hash algorithm, and selects a path from the ECMP group based on the calculation result to send the message. Since multiple paths are available, load balancing is achieved.
[0003] However, research has found that when message transmission based on ECMP technology occurs, the reliability and rationality of transmission need to be improved when a transmission path failure occurs. Summary of the Invention
[0004] One of the purposes of the present invention includes, for example, providing a fault handling method, apparatus, device and medium to at least partially improve the reliability and rationality of message transmission based on ECMP technology when a transmission path fails.
[0005] The embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, the present invention provides a fault handling method applied to a forwarding device, wherein the forwarding device includes an ECMP group, and the ECMP group includes multiple members. The method includes:
[0007] Determine whether there is a target member in the ECMP group whose corresponding link has failed;
[0008] If so, a link corresponding to at least one member other than the target member in the ECMP group is used as a target link corresponding to the target member, so that when a message corresponding to the target member is received, the message is forwarded based on the target link.
[0009] In an optional implementation manner, the taking a link corresponding to at least one member other than the target member in the ECMP group as a target link corresponding to the target member includes:
[0010] Using links corresponding to all members in the ECMP group except the target member as target links corresponding to the target member;
[0011] When receiving a message corresponding to the target member, forwarding the message based on the target link includes:
[0012] When a message corresponding to the target member is received, one of the target links is selected in turn according to the set rules to forward the message, so that the message corresponding to the target member is evenly forwarded by the links corresponding to all other members in the ECMP group except the target member.
[0013] In an optional embodiment, the forwarding device maintains multiple databases, including an ECMP member DB and an ECMP DB, the ECMP member DB stores all members of the ECMP group, the ECMP DB stores currently used ECMP entries, and the ECMP DB is a repeated rollout of the ECMP member DB;
[0014] The taking links corresponding to all members of the ECMP group except the target member as target links corresponding to the target member includes:
[0015] Using all other members in the ECMP member DB except the target member, sequentially replacing the target member in the ECMP DB to obtain an updated ECMP DB;
[0016] The updated ECMP DB is issued so that the message corresponding to the target member is evenly forwarded by the links corresponding to all other members of the ECMP group except the target member.
[0017] In an optional embodiment, the method further comprises:
[0018] Determine whether the faulty link corresponding to the target member has returned to normal;
[0019] If so, the link that has recovered to normal is used as the only link corresponding to the target member.
[0020] In an optional embodiment, the database further includes an ECMP Backup DB, and the method further includes:
[0021] Backing up the ECMP DB before the failure to the ECMP Backup DB;
[0022] The step of resetting the restored link to normal as the only link corresponding to the target member includes:
[0023] Traversing the ECMP Backup DB, determining the location of the target member whose link is restored to normal in the ECMP DB;
[0024] Replace the member at the corresponding position in the ECMP DB with the target member whose link has returned to normal to obtain the adjusted ECMP DB;
[0025] The adjusted ECMP DB is issued so that the message corresponding to the target member is forwarded again by the link that has recovered to normal.
[0026] In an optional embodiment, the method further comprises:
[0027] In the case that a target member with a corresponding link failure exists in the ECMP group, the target member is retained in the ECMP group and is not deleted; and the ECMP member DB remains unchanged.
[0028] In an optional embodiment, the method further comprises:
[0029] In response to a member add request, the ECMP DB is saved to the ECMP Backup DB, the member corresponding to the member add request is added to the ECMP member DB, the ECMP DB is updated, and the ECMP member DB after the member is added is repeatedly rolled out to obtain an updated ECMP DB;
[0030] In response to a member deletion request, the ECMP DB is saved to the ECMP Backup DB, the member corresponding to the member deletion request is deleted from the ECMP member DB, the ECMP DB is updated, and the ECMP member DB after the member deletion is repeatedly rolled out to obtain an updated ECMP DB.
[0031] In a second aspect, an embodiment of the present invention provides a fault handling apparatus, applied to a forwarding device, wherein the forwarding device includes an ECMP group, the ECMP group includes multiple members, and the fault handling apparatus includes:
[0032] An information determination module is used to determine whether there is a target member in the ECMP group whose corresponding link has failed;
[0033] An information processing module is used to, when there is a target member in the ECMP group whose corresponding link fails, use the link corresponding to at least one other member in the ECMP group except the target member as the target link corresponding to the target member, so as to forward the message corresponding to the target member based on the target link when receiving the message.
[0034] In a third aspect, the present invention provides a forwarding device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the fault handling method described in any one of the aforementioned implementation methods is implemented.
[0035] In a fourth aspect, the present invention provides a computer-readable storage medium, which includes a computer program. When the computer program is running, it controls the forwarding device where the computer-readable storage medium is located to execute the fault handling method described in any one of the aforementioned implementation methods.
[0036] The beneficial effects of the embodiments of the present invention include, for example: through clever design, after a member link of the ECMP group fails, traffic can still be forwarded through other normally working ECMP member links, thereby achieving session preservation without affecting normal links before and after the member link of the ECMP group fails. By ensuring that the forwarding traffic on the normal link is not affected, the problem of switching forwarding paths due to the impact of normal link traffic forwarding caused by link failure is solved, thereby ensuring the stability of the corresponding business and ensuring the reliability and rationality of message transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention is shown.
[0039] Figure 2 A schematic flow chart of a fault handling method provided by an embodiment of the present invention is shown.
[0040] Figure 3 A schematic diagram of an application architecture provided by an embodiment of the present invention is shown.
[0041] Figure 4 A schematic diagram of a message transmission path provided by an embodiment of the present invention is shown.
[0042] Figure 5 A schematic diagram of a message transmission path when a fault occurs is shown in an embodiment of the present invention.
[0043] Figure 6 A schematic diagram of a message transmission path after fault recovery provided by an embodiment of the present invention is shown.
[0044] Figure 7 An exemplary structural block diagram of a fault handling device provided by an embodiment of the present invention is shown.
[0045] Icons: 100 - forwarding device; 110 - memory; 120 - processor; 130 - communication module; 140 - fault handling device; 141 - information determination module; 142 - information processing module. DETAILED DESCRIPTION
[0046] Nowadays, when ECMP technology is used to transmit packets, when a transmission path fails, the common processing method is to delete the member corresponding to the failed link from the ECMP group. This ensures that when the forwarding device receives the packet and performs hash calculation, it will not select the failed transmission path when selecting the next-hop transmission path from the ECMP group, thus achieving link backup.
[0047] Research has found that when the member corresponding to the faulty transmission path is deleted from the ECMP group using the above method, the number and order of members in the ECMP group will change. As a result, the same hash value calculated for the same message may be indexed to different member exits, including traffic on normal links, making it impossible to ensure the normal operation of various services, such as session persistence services.
[0048] For example, if an ECMP group has three members A, B, and C, message one is forwarded from member B based on the hash calculation result. When the link of member A fails, after member A is deleted from the ECMP group using the above method, there are only two members B and C in the ECMP group. After performing hash calculation on message one, it is very likely that the original message one needs to go out from the member C link, that is, the deleted member A affects the message forwarding service on the normal link, making the reliability and rationality of the transmission need to be improved. For example, when message one is forwarded through member B, member B stores the processing-related information of message one. After switching to member C, member C may need to reprocess and store the processing-related information of message one, thereby affecting processing efficiency and causing waste of resources.
[0049] To improve transmission reliability and rationality, hardware-based backup links can be considered. After a link failure, the ECMP group membership remains unchanged, and packets are forwarded using normal hash calculations. When the calculated path is the failed link, a normal link is selected from the backup path as the actual egress for forwarding.
[0050] However, hardware implementation is bound to increase the corresponding hardware cost, maintenance cost and complexity.
[0051] Based on the above research, an embodiment of the present invention provides an equal-cost multi-path fault handling solution and proposes a load balancing elastic hashing implementation method. Through clever configuration, the traffic can still be evenly distributed to different ECMP member links after a member link of the ECMP group fails, thereby achieving session preservation without affecting the normal links before and after the member link failure of the ECMP group. By ensuring that the forwarding traffic on the normal link is not affected, the problem of switching the forwarding path due to the impact of normal link traffic forwarding caused by link failure is solved, thereby ensuring the stability of the corresponding business and ensuring the reliability and rationality of message transmission.
[0052] The defects in the above solutions are the results obtained by the inventors after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed in the embodiments of the present invention below should be the contributions made by the inventors in the invention process.
[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0054] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.
[0055] It should be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes 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 "comprises a ..." does not preclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0056] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0057] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0058] Please refer to Figure 1 is a block diagram of a forwarding device 100 provided in this embodiment. The forwarding device 100 in this embodiment can be a server, processing device, processing platform, etc. capable of data exchange and processing, such as a router or communication server. The forwarding device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected to each other, directly or indirectly, to enable data transmission or exchange. For example, these components can be electrically connected via one or more communication buses or signal lines.
[0059] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0060] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions.
[0061] The communication module 130 is used to establish a communication connection between the forwarding device 100 and other communication terminals through the network, and to send and receive data through the network.
[0062] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the forwarding device 100. The forwarding device 100 may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0063] Please refer to Figure 2 , which is a flowchart of a fault handling method provided by an embodiment of the present invention, can be Figure 1 The forwarding device 100 executes, for example, the processor 120 in the forwarding device 100. The forwarding device 100 includes an ECMP group, and the ECMP group includes multiple members. The fault handling method includes S110 and S120.
[0064] S110: Determine whether there is a target member in the ECMP group whose corresponding link has failed. If so, execute S120. If not, end or continue to execute S110.
[0065] S120: Use a link corresponding to at least one member other than the target member in the ECMP group as a target link corresponding to the target member, so as to forward a message corresponding to the target member based on the target link when the message is received.
[0066] By adopting the above solution, when messages are transmitted based on ECMP technology and a transmission path fails, the members of the ECMP group can be kept unchanged, so that after a member link of the ECMP group fails, the messages can still be forwarded through other normally functioning ECMP member links. This ensures that the forwarding traffic on the normal links is not affected while processing the traffic on the failed link, thereby improving the reliability and rationality of message transmission.
[0067] In S110, there are multiple ways to determine whether a link is faulty. For example, link detection technology can be used to determine whether a link is operating normally or faulty. In another example, detection messages can be used to determine whether a link is operating normally or faulty. In another example, error information can be used to analyze which links may be faulty.
[0068] In S120, the link corresponding to at least one member other than the target member in the ECMP group is used as the target link corresponding to the target member. There are many ways to implement this.
[0069] For example, based on the load balancing principle, the link corresponding to the member with the smallest load among all members except the target member in the ECMP group can be determined as the target link to ensure that the message corresponding to the target member can be processed in time.
[0070] For another example, the user may specify links corresponding to one or more members from all members except the target member in the ECMP group as target links.
[0071] For another example, links corresponding to all members of the ECMP group except the target member can be used as target links corresponding to the target member. Accordingly, upon receiving a message corresponding to the target member, forwarding the message based on the target link can include: upon receiving a message corresponding to the target member, sequentially selecting one of the target links according to a set rule and forwarding the message, so that the message corresponding to the target member is evenly forwarded by links corresponding to all members of the ECMP group except the target member.
[0072] There are many possible setting rules. For example, the links can be arranged in a certain order. Another example is that a set of all target links is randomly called. Through polling, unused target links in the set are randomly called until all target links in the set have been called in the current round. Then, the next poll is performed for each target link in the set.
[0073] In this embodiment, using the links corresponding to all members of the ECMP group except the target member as the target links corresponding to the target member can be implemented in various ways. In one implementation, a forwarding device can maintain multiple databases, including an ECMP member DB and an ECMP DB. The ECMP member DB stores all members of the ECMP group, and the ECMP DB stores currently used ECMP entries. The ECMP DB is a repeated rollout of the ECMP member DB.
[0074] Accordingly, all members in the ECMP member DB, excluding the target member, can be used to sequentially replace the target member in the ECMP DB to obtain an updated ECMP DB. The updated ECMP DB is distributed so that packets corresponding to the target member are evenly forwarded by links corresponding to all members in the ECMP group, excluding the target member.
[0075] On this basis, in order to ensure the utilization rate of normal links, it is also possible to determine whether the faulty link corresponding to the target member has recovered. If so, the recovered link is used as the only link corresponding to the target member.
[0076] The method of re-using the link that has been restored to normal as the only link corresponding to the target member can be flexibly selected. For example, when multiple databases are maintained in the forwarding device, the database can also include an ECMP Backup DB, and the method further includes: backing up the ECMP DB before the failure to the ECMP Backup DB. Accordingly, re-using the link that has been restored to normal as the only link corresponding to the target member can include: traversing the ECMP Backup DB and determining the position of the target member whose link has been restored to normal in the ECMP DB. Replacing the member at the corresponding position in the ECMP DB with the target member whose link has been restored to normal to obtain an adjusted ECMP DB. The adjusted ECMP DB is issued so that the message corresponding to the target member is forwarded again by the link that has been restored to normal.
[0077] In this embodiment, if a target member in an ECMP group has a corresponding link failure, the target member is retained in the ECMP group without being deleted, and the ECMP memberDB remains unchanged. This ensures that when a link fails, the same message corresponds to the same member, ensuring that forwarding traffic on normal links is not affected.
[0078] When multiple databases are maintained in the forwarding device, a member addition operation can be performed. Accordingly, the forwarding device can save the ECMP DB to the ECMP Backup DB in response to the member addition request, add the member corresponding to the member addition request to the ECMP member DB, update the ECMP DB, and repeatedly roll out the ECMPmember DB after the member is added to obtain the updated ECMP DB.
[0079] Similarly, a member deletion operation can be performed. The forwarding device can save the ECMP DB to the ECMP Backup DB in response to the member deletion request, delete the member corresponding to the member deletion request from the ECMP member DB, update the ECMP DB, and repeatedly roll out the ECMP member DB after the member is deleted to obtain an updated ECMPDB.
[0080] In order to more clearly illustrate the fault handling solution in this embodiment, the following scenario is taken as an example to illustrate the implementation principle of the embodiment of the present invention.
[0081] The main design idea of the embodiment of the present invention is that, when a link fails, the member corresponding to the normal link is used to replace the member corresponding to the faulty link in the ECMP group, ensuring that the position of the member of the ECMP group indexed by the hash value calculated according to the message characteristics remains unchanged, that is, the traffic forwarding on the normal link is not affected. The ECMP group members are repeatedly tiled, and the normal link members are used as backups to replace the faulty link members in the ECMP group in turn, thereby ensuring a certain degree of load balancing. A backup DB (DoggaByt, dog byte, also known as data storage unit, database) is added. When the link failure is restored, it is restored according to the member position of the backup DB, ensuring that the normal link data flow is not affected during the restoration.
[0082] For example:
[0083] If the ECMP group supports a maximum of m members, but the actual number of members n is less than m, that is, when the environment is normal, n links implement load balancing and redundancy backup. When the forwarding device receives a message, it calculates the hash value based on the message characteristics, selects a member exit from n members such as A, B, C, D, etc., and sends the message.
[0084] See also Figure 3 and Figure 4 ,The application architecture is as follows: the forwarding device includes the user ,configuration interface, algorithm and corresponding DB, and forwarding chip.
[0085] The user configuration interface includes command lines, World Wide Web (World Wide Web), SNMP (Simple Network Management Protocol) and other configuration methods to configure corresponding routes and form an ECMP group.
[0086] The algorithm and corresponding DB are used to implement the update of ECMP group members, the corresponding processing logic when failures occur and recovery, and the updated ECMP group is downloaded to the forwarding chip.
[0087] The forwarding chip is used to receive the message, calculate the hash value according to the corresponding field of the message, select one member from the ECMP group as the egress, and send the message out.
[0088] Forwarding devices maintain three databases: the ECMP member DB, the ECMP DB, and the ECMP Backup DB. The ECMP member DB stores all members of the ECMP group. The ECMP DB stores currently used ECMP entries. The ECMP entries in the forwarding chip come from the ECMP DB. The ECMP DB can be thought of as a replicated ECMP member DB. The ECMP Backup DB is a backup of the ECMP DB before a failure occurs and is used to replace members during failure recovery.
[0089] Based on the above application architecture and configuration, under normal circumstances:
[0090] When configuring the first member, a new ECMP group is created. Since there is only one member, such as member A, this member is used to fill the entire ECMP group, generate the ECMP DB and ECMP Backup DB, and send the ECMP DB to the forwarding chip. A member is added to the ECMP member DB.
[0091] Because the members of the current ECMP group are all the same, the forwarding device receives the message and calculates the hash value based on the message characteristics. Regardless of the hash value, the selected egress is the same. The ECMP DB example is as follows:
[0092]
[0093] When adding more members, the ECMP DB is first saved to the ECMP Back DB before updating the ECMP DB. To ensure a uniform hash, the ECMP DB is updated with the duplicate sequence of the previously existing members and the newly added member. The ECMP DB is then sent to the forwarding chip, and another member is added to the ECMP Member DB.
[0094] Here, we use the example of adding a second member, such as member B. Compared to the case with only one member A, the exit selected by the hash value calculated based on the message characteristics may be A or B, as shown below:
[0095]
[0096]
[0097] When deleting a member, before updating the ECMP DB, the ECMP DB is first saved to the ECMP Back DB, the ECMP DB is updated with the repeat sequence of the remaining members, the count is reduced by 1, and the ECMP DB is sent to the forwarding chip. The member is found in the ECMPmember DB and then deleted.
[0098] For example, if one member is deleted from an ECMP group consisting of three members, A, B, and C, the corresponding DB updates are as follows when member C is deleted:
[0099]
[0100] When a fault occurs:
[0101] When the link corresponding to an ECMP group member fails, the ECMP DB is saved to the ECMP Back DB. All members in the ECMP DB are traversed. If the current member is the member corresponding to the failed link, the members in the ECMP member DB (except the failed members in the ECMP member) are used to replace the members in turn to obtain the updated ECMP DB.
[0102] The ECMP member DB remains unchanged, and the updated ECMP DB is used to deliver data to the forwarding chip.
[0103] For example, if member B fails in an ECMP group consisting of four members, A, B, C, and D, the corresponding DB updates are as follows:
[0104]
[0105] Because only the members of the failed link in the ECMP group are replaced, the members corresponding to the functioning links remain unchanged. Therefore, after subsequent packets enter the forwarding device, the traffic that needs to be forwarded on the functioning links remains unchanged through hash calculation. Meanwhile, for traffic that needs to be forwarded on the failed link, the members corresponding to the calculated hash value have been replaced with members of the functioning link, so the corresponding traffic can also be forwarded normally. This achieves both traffic flow preservation and link backup, while also achieving a certain degree of load balancing at the replaced locations.
[0106] See also Figure 5 , which shows an example of a switchover during a failure. The dashed line represents traffic before the failure, and the solid line represents traffic after the failure. Lines with the same symbol have the same calculated hash value. As can be seen from the figure, traffic originally destined for members A and D is maintained, while traffic originally destined for member B is forwarded through port A, where it is backed up.
[0107] When the faulty link recovers:
[0108] Traverse the ECMP backup DB group, find the location of the restored member, and replace the member at the corresponding position in the ECMP DB with the restored member. The ECMP backup DB and ECMP member DB remain unchanged. Send the ECMP DB to the forwarding chip.
[0109] Taking the ECMP group with four members A, B, C, and D as an example, the DB update after member B recovers from the failure is as follows:
[0110]
[0111] See also Figure 6 , which shows an example of forwarding after failure recovery. The dashed line represents traffic flow during the failure, while the solid line represents traffic flow after failure recovery. Lines with the same symbol have the same calculated hash value. As can be seen from the figure, traffic that originally routed through members A and D has been maintained, and traffic that was originally destined for member A has been redirected to member B and has resumed normal forwarding.
[0112] Based on the above design concept, routing load balancing elastic hashing processing is implemented.
[0113] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a fault handling device is given below. Figure 7 , Figure 7 This is a functional module diagram of a fault handling device 140 provided in an embodiment of the present invention. The fault handling device 140 can be applied to Figure 1 The forwarding device 100 is shown. The forwarding device 100 includes an ECMP group, which includes multiple members. It should be noted that the basic principles and technical effects of the fault handling device 140 provided in this embodiment are the same as those in the above-mentioned embodiment. For the sake of brevity, any details not mentioned in this embodiment are referred to the corresponding contents in the above-mentioned embodiment. The fault handling device 140 includes an information determination module 141 and an information processing module 142.
[0114] The information determination module 141 is used to determine whether there is a target member in the ECMP group whose corresponding link has failed.
[0115] The information processing module 142 is used to, when there is a target member in the ECMP group whose corresponding link fails, use the link corresponding to at least one other member in the ECMP group except the target member as the target link corresponding to the target member, so as to forward the message corresponding to the target member based on the target link when receiving the message.
[0116] Based on the above, an embodiment of the present invention further provides a computer-readable storage medium, which includes a computer program. When the computer program is executed, it controls the forwarding device where the computer-readable storage medium is located to execute the above-mentioned fault handling method.
[0117] By adopting the above-mentioned scheme in the embodiment of the present invention, session maintenance before and after the link failure and load balancing after the failure can be achieved. When the link is normal, the members are used to lay out the ECMP table entries in sequence; when a link fails, the members in the ECMP table entries are traversed, and the members of the normal link are used to replace the members corresponding to the faulty link in turn, so that the session on the normal link is maintained and the traffic on the faulty link can be evenly distributed to the normal link. After the fault is resolved, the replaced members are replaced, and the traffic on the normal link remains unaffected, ensuring the stability of traffic forwarding as much as possible, and ensuring the reliability and rationality of traffic transmission. The design is ingenious and the implementation is relatively convenient.
[0118] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified functions or actions, or can be implemented using a combination of dedicated hardware and computer instructions.
[0119] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0120] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, 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 method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0121] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A fault handling method, characterized in that: Applied to a forwarding device, the forwarding device includes an ECMP group, the ECMP group includes multiple members, the forwarding device maintains multiple databases, the multiple databases include ECMPmemberDB and ECMPDB, the ECMPmemberDB stores all members of the ECMP group, the ECMPDB stores currently used ECMP entries, and the ECMPDB is a repeated rollout of the ECMPmemberDB; the method includes: Determine whether there is a target member in the ECMP group whose corresponding link has failed; If so, the link corresponding to at least one member other than the target member in the ECMP group is used as the target link corresponding to the target member, so that when a message corresponding to the target member is received, the message is forwarded based on the target link, including: using all other members in the ECMPmemberDB except the target member to replace the target member in the ECMPDB in turn to obtain an updated ECMPDB; and issuing the updated ECMPDB so that the message corresponding to the target member is evenly forwarded by the links corresponding to all other members in the ECMP group except the target member.
2. The fault handling method according to claim 1, characterized in that: The method further comprises: Determine whether the faulty link corresponding to the target member has returned to normal; If so, the link that has recovered to normal is used as the only link corresponding to the target member.
3. The fault handling method according to claim 2, characterized in that: The database further includes ECMPBackupDB, and the method further includes: Backing up the ECMPDB before the failure to the ECMPBackupDB; The step of resetting the restored link to normal as the only link corresponding to the target member includes: Traversing the ECMPBackupDB, determining the location of the target member whose link has been restored to normal in the ECMPDB; Replace the member at the corresponding position in the ECMPDB with the target member whose link has recovered to normal, and obtain the adjusted ECMPDB; The adjusted ECMPDB is issued so that the message corresponding to the target member is forwarded again via the link that has recovered to normal.
4. The fault handling method according to claim 3, characterized in that: The method further comprises: In the case that a target member with a corresponding link failure exists in the ECMP group, the target member is retained in the ECMP group and is not deleted; and the ECMPmemberDB remains unchanged.
5. The fault handling method according to claim 3, characterized in that: The method further comprises: In response to a member adding request, the ECMPDB is saved to the ECMPBackupDB, the member corresponding to the member adding request is added to the ECMPmemberDB, the ECMPDB is updated, and the ECMPmemberDB after the member is added is repeatedly rolled out to obtain an updated ECMPDB; In response to a member deletion request, the ECMPDB is saved to the ECMPBackupDB, the member corresponding to the member deletion request is deleted from the ECMPmemberDB, the ECMPDB is updated, and the ECMPmemberDB after the member is deleted is repeatedly rolled out to obtain an updated ECMPDB.
6. A fault handling device, characterized in that: Applied to a forwarding device, the forwarding device includes an ECMP group, the ECMP group includes multiple members, the forwarding device maintains multiple databases, the multiple databases include ECMPmemberDB and ECMPDB, the ECMPmemberDB stores all members of the ECMP group, the ECMPDB stores currently used ECMP entries, and the ECMPDB is a repeated rollout of the ECMPmemberDB; the fault handling device includes: An information determination module is used to determine whether there is a target member in the ECMP group whose corresponding link has failed; An information processing module is configured to, when a target member whose corresponding link fails exists in the ECMP group, use a link corresponding to at least one member of the ECMP group other than the target member as a target link corresponding to the target member, so as to forward a message corresponding to the target member based on the target link when the message is received, including: using all other members of the ECMPmemberDB other than the target member to sequentially replace the target member in the ECMPDB to obtain an updated ECMPDB; and issuing the updated ECMPDB so that the messages corresponding to the target member are evenly forwarded by the links corresponding to all other members of the ECMP group other than the target member.
7. A forwarding device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the fault handling method according to any one of claims 1 to 5 when executing the program.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a computer program, and when the computer program is executed, the forwarding device where the computer-readable storage medium is located is controlled to execute the fault handling method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Route switching method and device
CN102347885A
Method and device for realizing load balancing
CN110838974A