A fault processing method and device, electronic equipment and storage medium
By configuring primary and backup equal-cost routing groups in network devices and utilizing switching chips to monitor and quickly switch routes, the packet loss problem caused by switch port failures in Layer 3 networking was solved, achieving rapid traffic recovery and improved stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2024-12-12
- Publication Date
- 2026-07-07
AI Technical Summary
In a three-layer network, when a switch port fails or a connection is unplugged, existing technologies cause a large number of packets to be lost during traffic switching. The switching time is affected by the CPU and software processing flow, resulting in delays and packet loss.
By configuring primary and backup equivalent-cost routing groups in network devices, the inherent functions of the switching chip are utilized to monitor the availability of equivalent-cost routes and quickly switch to the backup routing group for forwarding in case of failure, avoiding the software-level route recalculation process and achieving rapid traffic recovery.
It effectively reduces packet loss when ports fail or connections are disconnected, improves the service stability and reliability of network devices, and shortens switching time.
Smart Images

Figure CN119814650B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technology, and in particular to a fault handling method, apparatus, electronic device and storage medium. Background Technology
[0002] In a typical three-layer network, it consists of multiple Leaf switches connected to the server, multiple Spine switches, and Border switches. Leaf switches and Spine switches are fully interconnected, and Spine switches and Border switches are fully interconnected. Routing is advertised to all devices.
[0003] The switch is configured with protocols (such as OSPF / OSPFv3, BGP / IPv6 BGP, and IS-IS / IPv6 IS-IS) to configure the Layer 3 forwarding exit as an equal-cost multipath, so that the traffic is evenly distributed across the paths.
[0004] When there is a fault in the interconnect port on the switch, or when the connection is replaced, the traffic needs to switch to the normal path, which will cause packet loss. Summary of the Invention
[0005] This application provides a fault handling method, apparatus, electronic device, and storage medium.
[0006] In a first aspect, this application provides a fault handling method applied to a network device, wherein the network device is configured with a primary equal-cost routing group and a backup equal-cost routing group for each destination address; after receiving first traffic whose destination address is the target address, the network device forwards the first traffic based on the equal-cost routes included in the primary equal-cost routing group corresponding to the target address; the method includes:
[0007] Monitor the availability status of each equal-cost route in the primary equal-cost route group corresponding to the target address;
[0008] If the target equivalent route is detected to be unavailable, it is determined that the second traffic needs to be forwarded using the target equivalent route.
[0009] The second traffic is forwarded using each of the equivalent-cost routes included in the backup equivalent-cost route group corresponding to the target address.
[0010] Optionally, the network device is a Leaf device in a Spine-Leaf network, and the primary equal-cost route group configured on the Leaf device for each destination address includes the same equal-cost route as the backup equal-cost route group corresponding to that destination address.
[0011] If the target equivalent route is detected to be unavailable, the steps to determine the second traffic that needs to be forwarded using the target equivalent route include:
[0012] If the target equivalent route is detected to be unavailable, then after the first hashing process, the second traffic is hashed to the target equivalent route for forwarding.
[0013] Optionally, the step of forwarding the second traffic using each of the equivalent-cost routes included in the backup equivalent-cost route group corresponding to the target address includes:
[0014] The second traffic is subjected to a second hashing process, and the load of the second traffic is distributed to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
[0015] Optionally, a logical equal-cost routing group is formed based on the available equal-cost routes included in the primary equal-cost routing group and the backup equal-cost routing group corresponding to the target address. The method further includes:
[0016] Based on the second hashing process, the third traffic in the second traffic that needs to be forwarded using the target equal-cost route included in the backup equal-cost route group is determined;
[0017] The third traffic is subjected to a third hashing process, and the load of the third traffic is distributed to each of the equivalent routes included in the logical equivalent route group corresponding to the target address for forwarding.
[0018] Optionally, the network device is a Spine device in a Spine-Leaf network, and the primary equal-cost route group configured on the Spine device for each destination address includes equal-cost routes of first priority, and the backup equal-cost route group corresponding to the destination address includes equal-cost routes of second priority; the method includes:
[0019] If the primary equal-cost route group corresponding to the target address is found to be unavailable, then after performing the first hashing process on the first traffic, it is determined to hash the first traffic to the backup equal-cost route for forwarding.
[0020] The first traffic is subjected to a second hashing process, and the load of the first traffic is distributed to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
[0021] Optionally, the network device monitors the availability status of each directly connected link, and when it determines that any link is unavailable, it determines that the corresponding equivalent route is unavailable; the method further includes:
[0022] At the software level, the primary and backup equivalent routing groups corresponding to the target address are recalculated based on the faulty links.
[0023] The first traffic is forwarded based on the recalculated primary and backup equivalent routing groups.
[0024] Secondly, embodiments of this application provide a fault handling apparatus applied to a network device, wherein the network device is configured with a primary equal-cost routing group and a backup equal-cost routing group for each destination address; after receiving first traffic whose destination address is a target address, the network device forwards the first traffic based on the equal-cost routes included in the primary equal-cost routing group corresponding to the target address; the apparatus includes:
[0025] The monitoring unit is used to monitor the availability status of each equivalent route included in the primary equivalent route group corresponding to the target address;
[0026] If the monitoring unit detects that the target equivalent route is unavailable, the determining unit is used to determine the second traffic that needs to be forwarded using the target equivalent route;
[0027] The forwarding unit is used to forward the second traffic using each of the equivalent routes included in the backup equivalent route group corresponding to the target address.
[0028] Optionally, the network device is a Leaf device in a Spine-Leaf network, and the primary equal-cost route group configured on the Leaf device for each destination address includes the same equal-cost route as the backup equal-cost route group corresponding to that destination address.
[0029] If the monitoring unit detects that the target equivalent route is unavailable, the determining unit is specifically used to determine the second traffic that is hashed to the target equivalent route after the first hashing process.
[0030] Optionally, when forwarding the second traffic using the equivalent-cost routes included in the backup equivalent-cost route group corresponding to the target address, the forwarding unit is specifically used for:
[0031] The second traffic is subjected to a second hashing process, and the load of the second traffic is distributed to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
[0032] Optionally, based on the available equal-cost routes included in the primary equal-cost route group and the backup equal-cost route group corresponding to the target address, a logical equal-cost route group is formed, and the device forwarding unit is further configured to:
[0033] Based on the second hashing process, the third traffic in the second traffic that needs to be forwarded using the target equal-cost route included in the backup equal-cost route group is determined;
[0034] The third traffic is subjected to a third hashing process, and the load of the third traffic is distributed to each of the equivalent routes included in the logical equivalent route group corresponding to the target address for forwarding.
[0035] Optionally, the network device is a Spine device in a Spine-Leaf network, and the primary equal-cost route group configured on the Spine device for each destination address includes equal-cost routes of the first priority, and the backup equal-cost route group corresponding to the destination address includes equal-cost routes of the second priority.
[0036] If the monitoring unit detects that the primary equivalent route group corresponding to the target address is unavailable, then after performing the first hash processing on the first traffic, the determining unit is used to determine to hash the first traffic to the backup equivalent route for forwarding.
[0037] The forwarding unit is used to perform a second hashing process on the first traffic, and to distribute the load of the first traffic to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
[0038] Optionally, the network device monitors the availability status of each directly connected link, and when it determines that any link is unavailable, it determines that the corresponding equivalent route is unavailable; the device further includes a computing unit:
[0039] The computing unit is used at the software level to recalculate the primary equal-cost routing group and the backup equal-cost routing group corresponding to the target address based on the faulty link.
[0040] The forwarding unit is also used to forward the first traffic based on the recalculated primary equal-cost routing group and backup equal-cost routing group.
[0041] Thirdly, embodiments of this application provide an electronic device, which includes:
[0042] Memory, used to store program instructions;
[0043] A processor is configured to invoke program instructions stored in the memory and execute the steps of the method as described in any one of the first aspects above, according to the obtained program instructions.
[0044] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the steps of the method as described in any of the first aspects above.
[0045] In summary, the fault handling method provided in this application is applied to a network device, which is configured with a primary equal-cost routing group and a backup equal-cost routing group for each destination address. After receiving first traffic with the destination address as the target address, the network device forwards the first traffic based on the equal-cost routes included in the primary equal-cost routing group corresponding to the target address. The method includes: monitoring the availability status of the equal-cost routes included in the primary equal-cost routing group corresponding to the target address; if the target equal-cost route is detected to be unavailable, determining that a second traffic needs to be forwarded using the target equal-cost route; and forwarding the second traffic using the equal-cost routes included in the backup equal-cost routing group corresponding to the target address.
[0046] By adopting the fault handling method provided in the embodiments of this application, the chip forwarding logic is adjusted to form mutual backups between equal-priority equal-cost routes, or the low-priority equal-cost route group is used as a backup route group for the high-priority equal-cost route group. When the forwarding chip determines that any equal-cost route group is faulty, it directly hashes the faulty equal-cost route to the backup equal-cost route group for forwarding, avoiding traffic packet loss during the route recalculation process at the software level and improving service stability and reliability. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings of the embodiments of this application.
[0048] Figure 1 A detailed flowchart of a fault handling method provided in an embodiment of this application;
[0049] Figure 2 This application provides a schematic diagram of traffic forwarding in a three-layer network.
[0050] Figure 3 This is a schematic diagram of a hardware equivalent routing group created on a Leaf according to an embodiment of this application;
[0051] Figure 4 This is a schematic diagram of the updated hardware equivalent routing group on the Leaf provided in an embodiment of this application;
[0052] Figure 5 This is another schematic diagram of traffic forwarding in a three-layer network provided in an embodiment of this application;
[0053] Figure 6 This is a schematic diagram of a hardware equivalent routing group created on Spine, provided in an embodiment of this application.
[0054] Figure 7 This is a schematic diagram of the updated hardware equivalent routing group on Spine provided in an embodiment of this application;
[0055] Figure 8 This is a schematic diagram of the structure of a fault handling device provided in an embodiment of this application;
[0056] Figure 9 This is a schematic diagram of the hardware architecture of a network device provided in an embodiment of this application. Detailed Implementation
[0057] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” as used in this application and claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to any and all possible combinations comprising one or more of the associated listed items.
[0058] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination."
[0059] Currently, in a Spine-Leaf network, traffic forwarded from Server2 to Server1 is evenly distributed across three paths on the Leaf2 device, then forwarded through three Spine nodes to Leaf1, and finally to Server1. When the port P21 on Leaf2 that connects to Spine1 fails, or the connection is disconnected, traffic hashed to this port and forwarded will be affected. The relevant technical handling process is as follows:
[0060] A port failure is detected; the switching chip is interrupted or detected by a scan; the driver notifies the platform; after the platform receives the port DOWN event, it announces the route and deletes the ADJ, and simultaneously announces the route cancellation to the remote end; then it recalculates the route and creates a new VN; it notifies the driver to switch the entry to the new VN; the packet is forwarded from the remaining two normal paths.
[0061] Furthermore, if port P12, which connects Spine1 and Leaf2, fails or the connection is disconnected, traffic hashed to this port and forwarded will be affected. The handling process in the relevant technology is as follows:
[0062] A port failure is detected; the switching chip is interrupted or detected by scanning; the driver notifies the platform; after the platform receives the port DOWN event, it announces the route and deletes the ADJ, and at the same time announces the route cancellation to the remote end. If it finds that the route has no exit, it issues a DUMMY entry; then it recalculates the route and creates a new VN; it notifies the driver to switch the entry to the new VN; the packet is forwarded from the original four low-priority equal-cost paths.
[0063] However, during the period between port failure and the software switching traffic to the normal path, packets will be continuously dropped, and the longer the switchover time, the longer the packet loss will be. The switchover time is affected by the CPU, software-level processing flow, and the processing performance of the switching chip. The minimum is in the tens of milliseconds. In other words, the existing packet forwarding model and processing flow will result in a large amount of packet loss in the event of a port failure.
[0064] In this embodiment, by utilizing the inherent function of the switching chip and a novel processing method, a minimal amount of packet loss is achieved in the event of port failure or disconnection related to the forwarding path.
[0065] For example, see Figure 1 The diagram shown is a detailed flowchart of a fault diagnosis method provided in an embodiment of this application. This method is applied to a network device, which is configured with a primary equal-cost routing group and a backup equal-cost routing group for each destination address. Upon receiving first traffic whose destination address is the target address, the network device forwards the first traffic based on the equal-cost routes included in the primary equal-cost routing group corresponding to the target address. The method includes the following steps:
[0066] Step 100: Monitor the availability status of each equal-cost route in the primary equal-cost route group corresponding to the target address.
[0067] In this embodiment, a three-layer network consisting of multiple Leaf switches, multiple Spine switches, and Border switches connected to a server is used as an example for illustration. For example, see [link to relevant documentation]. Figure 2 The diagram shown is a three-layer network diagram provided in an embodiment of this application; Leaf and Spine are fully connected, Spine and Border are fully connected, Leaf1 is connected to Server1, Leaf2 is connected to Server2, Leaf3 is connected to Server3, and Leaf4 is connected to Server4.
[0068] For example, see Figure 2As shown, taking the traffic from Server2 to Server1 as an example, Server2 sends traffic to Leaf2. Leaf2 has three paths for traffic destined for Server1: forwarding to Leaf1 via Spine1, forwarding to Leaf1 via Spine2, or forwarding to Leaf1 via Spine3. That is, the three equivalent paths are: NH_21 from Leaf1 to Spine1, NH_22 from Leaf1 to Spine2, and NH_23 from Leaf1 to Spine3.
[0069] In this embodiment of the application, the network device is a Leaf device in a Spine-Leaf network. The primary equal-cost route group configured on the Leaf device for each destination address includes the same equal-cost route as the backup equal-cost route group corresponding to that destination address.
[0070] In other words, if the network device executing this method is a Leaf device (e.g., Leaf2), then on Leaf2, for traffic from Server2 to Server1, there are three equal-cost paths (three equal-cost routes). At this point, a hardware equal-cost multi-path routing (ECMP) group can be created on the forwarding chip of Leaf2. For an example, see [link to documentation]. Figure 3 As shown, the created hardware equal-cost routing group can include a primary ECMP (e.g., ECMP_m) and a backup ECMP (e.g., ECMP_s). ECMP_m includes equal-cost routes NH_21 (corresponding to port P21), NH_22 (corresponding to port P22), and NH_23 (corresponding to port P23); ECMP_s also includes equal-cost routes NH_21, NH_22, and NH_23.
[0071] After receiving traffic destined for Server1's IP address, Leaf2's forwarding chip performs hash forwarding using the equivalent route group corresponding to Server1's IP address. Specifically, it performs the first hashing process on the traffic, distributing the traffic load across the three equivalent paths included in ECMP_m.
[0072] Meanwhile, Leaf2's forwarding chip can also monitor the availability status of each equal-cost path. Specifically, if Leaf2's forwarding chip determines that the port status of each equal-cost path's corresponding port is normal, it determines that the equal-cost path (equal-cost route) is available and executes the corresponding forwarding logic. If it detects that the port status of any equal-cost path's corresponding port is abnormal (e.g., port failure, abnormal connection between the port and the peer), it determines that the equal-cost path (equal-cost route) corresponding to that port is unavailable and executes the corresponding forwarding logic.
[0073] Step 110: If the target equal-cost route is detected to be unavailable, then determine the second traffic that needs to be forwarded using the target equal-cost route.
[0074] Taking the Leaf device as an example of the network device executing this method, if the target equivalent route is detected to be unavailable, and it is determined that the second traffic needs to be forwarded using the target equivalent route, a preferred implementation is as follows:
[0075] If the target equivalent route is detected to be unavailable, then after the first hashing process, the second traffic is hashed to the target equivalent route for forwarding.
[0076] In other words, assuming NH_21 is unavailable, the Leaf2 forwarding chip will perform the first hashing process on the first traffic, hashing the first traffic to NH_21, NH_22, and NH_23. At this time, the first traffic with the hash value NH_21 is the determined second traffic.
[0077] Step 120: Forward the second traffic using the equivalent routes included in the backup equivalent route group corresponding to the target address.
[0078] Taking the Leaf device as an example of the network device executing this method, when forwarding the second traffic using the equivalent-cost routes included in the backup equivalent-cost route group corresponding to the target address, a preferred implementation is as follows:
[0079] The second traffic is subjected to a second hashing process, and the load of the second traffic is distributed to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
[0080] In other words, when Leaf2's forwarding chip determines that NH_21 is unavailable, it hashes the determined second traffic to ECMP_s and forwards it through ECMP_s. Specifically, it performs a second hashing process on the second traffic and distributes the second traffic load to NH_21, NH_22, and NH_23 included in ECMP_s for forwarding.
[0081] In practical applications, NH_21, which is included in ECMP_s, is also unavailable. Furthermore, to avoid traffic loss, in this embodiment of the application, a logical equal-cost routing group is formed based on the available equal-cost routes included in the primary equal-cost routing group and the backup equal-cost routing group corresponding to the target address. The method further includes:
[0082] Based on the second hashing process, a third traffic in the second traffic is determined that needs to be forwarded using the target equivalent-cost route included in the backup equivalent-cost route group; the third traffic is then subjected to a third hashing process, and the load of the third traffic is distributed to each equivalent-cost route included in the logical equivalent-cost route group corresponding to the target address for forwarding.
[0083] In practical applications, a logical ECMP is constructed based on the currently available equal-cost routes (NH_22 and NH_23) included in ECMP_m and ECMP_s. The second traffic, hashed to NH_21 included in ECMP_s, is determined as the third traffic, and the third traffic is forwarded using the logical ECMP constructed above. Specifically, the third traffic is subjected to a third hashing process, and the load of the third traffic is distributed to each equal-cost route included in the logical ECMP for forwarding. Since each equal-cost route included in the logical ECMP is an available equal-cost route, traffic loss is avoided.
[0084] Furthermore, in this embodiment of the application, the network device monitors the availability status of each directly connected link, and when it determines that any link is unavailable, it determines that the equivalent-cost route corresponding to that link is unavailable; the above fault handling method may also include the following steps:
[0085] At the software level, the primary and backup equivalent-cost routing groups corresponding to the target address are recalculated based on the faulty link; the first traffic is forwarded based on the recalculated primary and backup equivalent-cost routing groups.
[0086] Specifically, port failures are detected at the software level as forwarding path failures, the forwarding path is recalculated, and finally, the remaining NH_22 and NH_23 are obtained. For an example, see [link to documentation]. Figure 4 As shown, NH_22 and NH_23 create new equal-cost routing groups (primary equal-cost routing group (ECMP_m) and backup equal-cost routing group (ECMP_s)). Subsequently, when Leaf2 forwards traffic from Server2 to Server1, it performs hash forwarding based on the new equal-cost routing groups.
[0087] The following explanation uses traffic forwarded from Server1 to Server2 as an example. For an example, please refer to [link / reference]. Figure 4 As shown, the load is evenly distributed across three paths on the Leaf1 device, then forwarded to Leaf2 via three Spine paths, and finally transferred to Server2.
[0088] In this embodiment of the application, if the network device is a Spine device in a Spine-Leaf network, the primary equal-cost route group configured on the Spine device for each destination address includes the equal-cost route as a first priority route, and the backup equal-cost route group corresponding to the destination address includes the equal-cost route as a second priority route.
[0089] In other words, if the network device executing this method is a Spine device (e.g., Spine1), then, for example, see [link to relevant documentation]. Figure 5 As shown, on Spine1, for traffic from Server2 to Server1, there is one high-priority path NH_12 (the path from Spine1 to Leaf2), and four secondary paths NH_11 (the path from Spine1 to Leaf1), NH_13 (the path from Spine1 to Leaf3), NH_14 (the path from Spine1 to Leaf4), and NH_1b (the path from Spine1 to Border).
[0090] In this embodiment of the application, hardware ECMP is created on the forwarding chip of Spine1. For example, see [link to relevant documentation]. Figure 6 As shown, the created ECMP includes a primary ECMP (ECMP_m) and a backup ECMP (ECMP_s). ECMP_m includes the high-priority path NH_12, and ECMP_s includes the low-priority paths NH_11, NH_13, NH_14, and NH_1b. Figure 6 The path indicated by the dashed arrow.
[0091] In this embodiment of the application, if the primary equal-cost routing group corresponding to the target address is found to be unavailable, after performing the first hash processing on the first traffic, it is determined to hash the first traffic to the backup equal-cost route for forwarding; after performing the second hash processing on the first traffic, the load of the first traffic is distributed to each equal-cost route included in the backup equal-cost routing group corresponding to the target address for forwarding.
[0092] In other words, when port P12, which connects Spine1 and Leaf2, fails or the connection is disconnected (i.e., port P12 goes down), the hardware logic is triggered to re-hash traffic that was previously hashed to NH_12 through the normal exit points NH_11, NH_13, NH_14, and NH_1b of ECMP_s. This prevents traffic from being forwarded to the faulty path.
[0093] A port failure is detected as a forwarding path failure at the software level. Since all currently calculated paths are faulty, the exit point at the routing layer is DUMMY, but this is not updated in the switching chip, which continues to use the original ECMP logic. Once the routing layer recalculates the forwarding paths and finally obtains NH_11NH_13NH_14 and NH_1b, the switching chip is updated to use only primary ECMP and HASH forwarding.
[0094] For example, see Figure 8The diagram shown is a structural schematic of a fault handling device provided in an embodiment of this application. This device is applied to a network device, which is configured with a primary equal-cost routing group and a backup equal-cost routing group for each destination address. After receiving first traffic whose destination address is the target address, the network device forwards the first traffic based on the equal-cost routes included in the primary equal-cost routing group corresponding to the target address. The device includes:
[0095] The monitoring unit 80 is used to monitor the availability status of each equivalent route included in the primary equivalent route group corresponding to the target address;
[0096] If the monitoring unit 80 detects that the target equivalent route is unavailable, the determining unit 81 is used to determine the second traffic that needs to be forwarded using the target equivalent route.
[0097] Forwarding unit 82 is used to forward the second traffic using each of the equivalent routes included in the backup equivalent route group corresponding to the target address.
[0098] Optionally, the network device is a Leaf device in a Spine-Leaf network, and the primary equal-cost route group configured on the Leaf device for each destination address includes the same equal-cost route as the backup equal-cost route group corresponding to that destination address.
[0099] If the monitoring unit 80 detects that the target equivalent route is unavailable, the determining unit 81 is specifically used to determine the second traffic that is hashed to the target equivalent route after the first hashing process.
[0100] Optionally, when forwarding the second traffic using the equivalent-cost routes included in the backup equivalent-cost route group corresponding to the target address, the forwarding unit 82 is specifically used for:
[0101] The second traffic is subjected to a second hashing process, and the load of the second traffic is distributed to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
[0102] Optionally, based on the available equal-cost routes included in the primary equal-cost route group and the backup equal-cost route group corresponding to the target address, a logical equal-cost route group is formed, and the device forwarding unit 82 is further configured to:
[0103] Based on the second hashing process, the third traffic in the second traffic that needs to be forwarded using the target equal-cost route included in the backup equal-cost route group is determined;
[0104] The third traffic is subjected to a third hashing process, and the load of the third traffic is distributed to each of the equivalent routes included in the logical equivalent route group corresponding to the target address for forwarding.
[0105] Optionally, the network device is a Spine device in a Spine-Leaf network, and the primary equal-cost route group configured on the Spine device for each destination address includes equal-cost routes of the first priority, and the backup equal-cost route group corresponding to the destination address includes equal-cost routes of the second priority.
[0106] If the monitoring unit 80 detects that the primary equivalent route group corresponding to the target address is unavailable, then after performing the first hash processing on the first traffic, the determining unit 81 is used to determine to hash the first traffic to the backup equivalent route for forwarding.
[0107] The forwarding unit 82 is used to perform a second hashing process on the first traffic, and to distribute the load of the first traffic to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
[0108] Optionally, the network device monitors the availability status of each directly connected link, and when it determines that any link is unavailable, it determines that the corresponding equivalent route is unavailable; the device further includes a computing unit:
[0109] The computing unit is used at the software level to recalculate the primary equal-cost routing group and the backup equal-cost routing group corresponding to the target address based on the faulty link.
[0110] The forwarding unit 82 is further configured to forward the first traffic based on the recalculated primary equivalent route group and backup equivalent route group.
[0111] These units can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when one of these units is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these units can be integrated together to form a system-on-a-chip (SOC).
[0112] Furthermore, regarding the network device provided in this application embodiment, from a hardware perspective, the hardware architecture diagram of the network device can be found in [reference needed]. Figure 9 As shown, the network device may include: a memory 90 and a processor 91.
[0113] The memory 90 is used to store program instructions; the processor 91 calls the program instructions stored in the memory 90 and executes the above method embodiment according to the obtained program instructions. The specific implementation method and technical effect are similar, and will not be described again here.
[0114] Optionally, this application also provides a network device including at least one processing element (or chip) for performing the above method embodiments.
[0115] Optionally, this application also provides a program product, such as a computer-readable storage medium storing computer-executable instructions for causing the computer to perform the above-described method embodiments.
[0116] Here, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, a machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0117] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0118] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0119] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0121] Furthermore, these computer program instructions can also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0122] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0123] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A fault handling method, characterized in that, The method is applied to a network device, wherein a primary equal-cost routing group and a backup equal-cost routing group are configured for each destination address; after receiving first traffic whose destination address is the target address, the network device forwards the first traffic based on the equal-cost routes included in the primary equal-cost routing group corresponding to the target address; the method includes: Monitor the availability status of each equal-cost route in the primary equal-cost route group corresponding to the target address; If the target equivalent route is detected to be unavailable, then after the first hashing process, the second traffic is hashed to the target equivalent route for forwarding. The second traffic is subjected to a second hashing process, and the load of the second traffic is distributed to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding; The method further includes: constructing a logical equal-cost route group based on the available equal-cost routes included in the primary equal-cost route group and the backup equal-cost route group corresponding to the target address; Based on the second hashing process, the third traffic in the second traffic that needs to be forwarded using the target equal-cost route included in the backup equal-cost route group is determined; The third traffic is subjected to a third hashing process, and the load of the third traffic is distributed to each of the equivalent routes included in the logical equivalent route group corresponding to the target address for forwarding.
2. The method as described in claim 1, characterized in that, The network device is a Leaf device in a Spine-Leaf network. The primary equal-cost route group configured on the Leaf device for each destination address includes the same equal-cost routes as the backup equal-cost route group corresponding to that destination address.
3. The method as described in claim 1, characterized in that, The network device is a Spine device in a Spine-Leaf network. The primary equal-cost route group configured on the Spine device for each destination address includes equal-cost routes of first priority, and the backup equal-cost route group corresponding to that destination address includes equal-cost routes of second priority. The method includes: If the primary equal-cost route group corresponding to the target address is found to be unavailable, then after performing the first hashing process on the first traffic, it is determined to hash the first traffic to the backup equal-cost route for forwarding. The first traffic is subjected to a second hashing process, and the load of the first traffic is distributed to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
4. The method according to any one of claims 1-3, characterized in that, The network device monitors the availability status of each directly connected link, and when it determines that any link is unavailable, it determines that the corresponding equivalent route is unavailable. The method further includes: At the software level, the primary and backup equivalent routing groups corresponding to the target address are recalculated based on the faulty links. The first traffic is forwarded based on the recalculated primary and backup equivalent routing groups.
5. A fault handling device, characterized in that, An apparatus is applied to a network device, wherein the network device is configured with a primary equal-cost routing group and a backup equal-cost routing group for each destination address; after receiving first traffic whose destination address is the target address, the network device forwards the first traffic based on the equal-cost routes included in the primary equal-cost routing group corresponding to the target address; the apparatus includes: The monitoring unit is used to monitor the availability status of each equivalent route included in the primary equivalent route group corresponding to the target address; If the monitoring unit detects that the target equivalent route is unavailable, the determining unit is used to determine the second traffic that is hashed to the target equivalent route after the first hashing process. The forwarding unit is used to perform a second hashing process on the second traffic and distribute the load of the second traffic to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding; Based on the available equal-cost routes included in the primary equal-cost route group and the backup equal-cost route group corresponding to the target address, a logical equal-cost route group is formed. The forwarding unit is further configured to: Based on the second hashing process, the third traffic in the second traffic that needs to be forwarded using the target equal-cost route included in the backup equal-cost route group is determined; The third traffic is subjected to a third hashing process, and the load of the third traffic is distributed to each of the equivalent routes included in the logical equivalent route group corresponding to the target address for forwarding.
6. The apparatus as claimed in claim 5, characterized in that, The network device is a Leaf device in a Spine-Leaf network. The primary equal-cost route group configured on the Leaf device for each destination address includes the same equal-cost routes as the backup equal-cost route group corresponding to that destination address.
7. The apparatus as claimed in claim 5, characterized in that, The network device is a Spine device in a Spine-Leaf network. The primary equal-cost route group configured on the Spine device for each destination address includes the first priority route, and the backup equal-cost route group corresponding to the destination address includes the second priority route. If the monitoring unit detects that the primary equivalent route group corresponding to the target address is unavailable, then after performing the first hash processing on the first traffic, the determining unit is used to determine to hash the first traffic to the backup equivalent route for forwarding. The forwarding unit is used to perform a second hashing process on the first traffic, and to distribute the load of the first traffic to each of the equivalent routes included in the backup equivalent route group corresponding to the target address for forwarding.
8. The apparatus according to any one of claims 5-7, characterized in that, The network device monitors the availability status of each directly connected link, and when it determines that any link is unavailable, it determines that the corresponding equivalent route is unavailable; the device also includes a computing unit: The computing unit is used at the software level to recalculate the primary equal-cost routing group and the backup equal-cost routing group corresponding to the target address based on the faulty link. The forwarding unit is also used to forward the first traffic based on the recalculated primary equal-cost routing group and backup equal-cost routing group.
9. An electronic device, characterized in that, The electronic device includes: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method as described in any one of claims 1-4 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing the computer to perform the steps of the method as described in any one of claims 1-4.