Link fault handling method and apparatus, and electronic device and medium

By receiving messages in the forwarding chip of the network device and updating the forwarding entry status, the problem of untimely routing switching caused by link failures between network devices is solved, faster routing switching is achieved, and the efficiency of large-scale neural network model training is improved.

WO2025137935A1PCT designated stage expired Publication Date: 2025-07-03NEW H3C TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/142380
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

During the training of large-scale neural network models, link failures between network devices lead to untimely routing switching, affecting training efficiency.

Method used

By receiving messages in the forwarding chip of the network device and timely updating the status of the forwarding entry according to the status information, the fault link is disabled, and fast routing switching is achieved.

Benefits of technology

The network quality during large-scale neural network model training is improved, the failure convergence time is reduced, and the training efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023142380_03072025_PF_FP_ABST
    Figure CN2023142380_03072025_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the field of communications. Provided are a link fault handling method and apparatus, and an electronic device and a medium. The technical solution in the embodiments of the present application comprises: a forwarding chip of a first network device receiving a first message sent by a second network device, wherein the first message comprises a device identifier of a third network device and state information; if the state information indicates that the third network device is unreachable from the second network device, the forwarding chip of the first network device looking up a first forwarding entry where the egress interface is a first interface and the device identifier is the device identifier of the third network device; and setting the state of the first forwarding entry to be an invalid state. Therefore, when a fault occurs in a link between network devices, route switching can be carried out in a more timely manner.
Need to check novelty before this filing date? Find Prior Art

Description

Link failure processing method, device, electronic equipment and medium Technical Field

[0001] The present application relates to the field of communications, and in particular to a link failure processing method, device, electronic device, and medium. Background Art

[0002] When training large-scale neural network models, multiple graphics processing units (GPUs) of multiple hosts are required, and frequent interaction is required between the GPUs during the training process. For example, the left figure in Figure 1 is a communication flow diagram between GPUs when training a traditional data center (DC) traffic model, and the right figure is a communication flow diagram between GPUs when training a large-scale artificial intelligence (AI) traffic model. The horizontal axis of the two traffic diagrams in Figure 1 is time, and the vertical axis is bandwidth. It can be seen that the training of the traditional DC traffic model involves a large number of flows and the total training time is short, that is, there are many communication links between GPUs, and the communication time of each communication link is short, so the communication quality of the communication link has little effect on the convergence of the DC traffic model. When training the AI ​​traffic model, the number of flows involved is small, but it has the characteristics of high network utilization and high bandwidth, and the total training time is long, for example, the training time is usually 10 to 90 days. During the training process, the network needs to maintain high performance. If a communication link fails during training, the time required for a round of training will be extended, and it may even cause errors in the training process, requiring the training process to be restarted. Therefore, in the process of training AI traffic models, network quality has a significant impact on training efficiency.

[0003] During training, hosts communicate with each other via network devices such as switches and routers. Currently, when a link failure occurs between network devices, the network device must detect the failure and notify other network devices of the failure via a routing update. After receiving the routing update, the control plane of the network device recalculates the route and modifies the forwarding table entries in the forwarding chip to prevent further communication through the failed link. However, the time required for fault notification and route recalculation in this process is long, resulting in delayed convergence of the failure, which in turn affects the training efficiency of the AI ​​traffic model.

[0004] Summary of the Invention

[0005] The purpose of the embodiments of the present application is to provide a link failure handling method, apparatus, electronic device, and medium to enable more timely routing switching when a link failure occurs between network devices. The specific technical solution is as follows:

[0006] In a first aspect, an embodiment of the present application provides a link failure processing method, which is applied to a forwarding chip of a first network device, wherein the first network device includes a first interface and is connected to a second network device through the first interface, the second network device is connected to a third network device, and the first network device includes multiple forwarding table entries, wherein the forwarding table entries include a destination address, an outgoing interface, and a device identifier, wherein the device identifier is an identifier of a network device to which a host to which the destination address belongs is accessed; the method comprising:

[0007] receiving a first message sent by the second network device, where the first message includes a device identifier and status information of the third network device, where the status information is used to indicate whether the second network device is reachable from the third network device;

[0008] If the state information indicates that the second network device and the third network device are unreachable, searching for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device;

[0009] The state of the first forwarding entry is set to an invalid state.

[0010] Optionally, before receiving the first message sent by the second network device, the method further includes:

[0011] receiving, through the first interface, a routing update message forwarded by the second network device, the routing update message including the first IP address of the host to which the third network device is connected and a device identifier of the third network device;

[0012] The first forwarding entry is generated based on the first interface, the first IP address, and the device identification of the third network device.

[0013] Optionally, the second network device includes a second interface and is connected to the first network device through the second interface; before receiving the first message sent by the second network device, the method further includes:

[0014] Sending a second message to the second network device, where the second message includes the device identifier of the first network device, so that the second network device records a first correspondence between the second interface and the device identifier of the first network device;

[0015] A third message sent by the second network device is received, where the third message includes the device identification of the second network device, and a second corresponding relationship between the first interface and the device identification of the second network device is recorded.

[0016] Optionally, setting the state of the first forwarding entry to an invalid state includes:

[0017] The state flag bit of the first forwarding table entry is modified to a first value, where the first value is used to indicate an invalid state.

[0018] Optionally, after receiving the first message sent by the second network device, the method further includes:

[0019] If the state information indicates that the second network device and the third network device are reachable, searching for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device;

[0020] The state of the first forwarding entry is set to a valid state.

[0021] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or,

[0022] The first message is a first IP multicast message, and the payload portion of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

[0023] Optionally, the second message is a second link layer broadcast message, and the payload portion of the second link layer broadcast message includes the device identifier of the first network device; or, the second message is a second IP multicast message, and the payload portion of the second IP multicast message includes the device identifier of the first network device;

[0024] The third message is a third link layer broadcast message, and the payload part of the third link layer broadcast message includes the device identifier of the second network device; or, the third message is a third IP multicast message, and the payload part of the third IP multicast message includes the device identifier of the second network device.

[0025] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0026] In a second aspect, an embodiment of the present application provides a link failure processing method, which is applied to a forwarding chip of a second network device, wherein the second network device is connected to a third network device, and the second network device is connected to a first interface of a first network device, wherein the first network device includes multiple forwarding table entries, wherein the forwarding table entries include a destination address, an outgoing interface, and a device identifier, wherein the device identifier is an identifier of a network device to which the host to which the destination address belongs is accessed; the method comprising:

[0027] Acquire status information, where the status information is used to indicate whether the second network device and the third network device are reachable;

[0028] A first message is sent to the first network device, where the first message includes the device identifier of the third network device and the status information, so that when the status information indicates that the second network device and the third network device are unreachable, the first network device searches for a first forwarding table entry whose output interface is the first interface and whose device identifier is the device identifier of the third network device, and sets the status of the first forwarding table entry to an invalid state.

[0029] Optionally, before obtaining the status information, the method further includes:

[0030] receiving a routing update message sent by the third network device, wherein the routing update message includes a first IP address of a host connected to the third network device and a device identifier of the third network device;

[0031] The routing update message is forwarded to the first network device, so that the first network device generates the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

[0032] Optionally, the second network device includes a third interface and is connected to the third network device through the third interface, and the third network device includes a fourth interface and is connected to the second network device through the fourth interface; before obtaining the status information, the method further includes:

[0033] Sending a fourth message to the third network device, where the fourth message includes the device identifier of the second network device, so that the third network device records a third correspondence between the fourth interface and the device identifier of the second network device;

[0034] A fifth message sent by the third network device is received, where the fifth message includes the device identification of the third network device, and a fourth corresponding relationship between the third interface and the device identification of the third network device is recorded.

[0035] Optionally, before sending the first message to the first network device, the method further includes:

[0036] The device identifier of the third network device corresponding to the third interface is obtained from the fourth corresponding relationship.

[0037] Optionally, there are multiple links between the second network device and the third network device; and obtaining the status information includes:

[0038] If all of the multiple links fail, it is determined that the status information indicates that the second network device and the third network device are unreachable; or, if any one of the multiple links is not failed, it is determined that the status information indicates that the second network device and the third network device are reachable.

[0039] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or,

[0040] The first message is a first IP multicast message, and the payload portion of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

[0041] Optionally, the fourth message is a fourth link layer broadcast message, and the payload portion of the fourth link layer broadcast message includes the device identifier of the second network device; or, the fourth message is a fourth IP multicast message, and the payload portion of the fourth IP multicast message includes the device identifier of the second network device;

[0042] The fifth message is a fifth link layer broadcast message, and the payload part of the fifth link layer broadcast message includes the device identifier of the third network device; or, the fifth message is a fifth IP multicast message, and the payload part of the fifth IP multicast message includes the device identifier of the third network device.

[0043] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0044] In a third aspect, an embodiment of the present application provides a link failure processing device, which is applied to a forwarding chip of a first network device, wherein the first network device includes a first interface and is connected to a second network device through the first interface, and the second network device is connected to a third network device, wherein the first network device includes multiple forwarding table entries, wherein the forwarding table entries include a destination address, an outgoing interface, and a device identifier, wherein the device identifier is an identifier of a network device to which a host to which the destination address belongs is accessed; the device includes:

[0045] a receiving module, configured to receive a first message sent by the second network device, wherein the first message includes a device identification and status information of the third network device, wherein the status information is used to indicate whether the second network device is reachable from the third network device;

[0046] a search module configured to search for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device if the status information indicates that the second network device and the third network device are unreachable;

[0047] A setting module is configured to set the state of the first forwarding entry to an invalid state.

[0048] Optionally, the device further comprises:

[0049] The receiving module is further configured to, before receiving the first message sent by the second network device, receive, through the first interface, a routing update message forwarded by the second network device, wherein the routing update message includes the first IP address of the host connected to the third network device and the device identifier of the third network device;

[0050] A generating module is configured to generate the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

[0051] Optionally, the second network device includes a second interface and is connected to the first network device via the second interface; the apparatus further includes:

[0052] a sending module, configured to, before receiving the first message sent by the second network device, send a second message to the second network device, where the second message includes the device identifier of the first network device, so that the second network device records a first correspondence between the second interface and the device identifier of the first network device;

[0053] The receiving module is further configured to receive a third message sent by the second network device, where the third message includes the device identification of the second network device, and record a second corresponding relationship between the first interface and the device identification of the second network device.

[0054] Optionally, the setting module is specifically configured to:

[0055] The state flag bit of the first forwarding table entry is modified to a first value, where the first value is used to indicate an invalid state.

[0056] Optionally, the search module is further configured to, after receiving the first message sent by the second network device, search for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device if the status information indicates that the second network device and the third network device are reachable;

[0057] The setting module is further configured to set the state of the first forwarding entry to a valid state.

[0058] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or,

[0059] The first message is a first IP multicast message, and the payload portion of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

[0060] Optionally, the second message is a second link layer broadcast message, and the payload portion of the second link layer broadcast message includes the device identifier of the first network device; or, the second message is a second IP multicast message, and the payload portion of the second IP multicast message includes the device identifier of the first network device;

[0061] The third message is a third link layer broadcast message, and the payload part of the third link layer broadcast message includes the device identifier of the second network device; or, the third message is a third IP multicast message, and the payload part of the third IP multicast message includes the device identifier of the second network device.

[0062] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0063] In a fourth aspect, an embodiment of the present application provides a link failure processing device, which is applied to a forwarding chip of a second network device, wherein the second network device is connected to a third network device, and the second network device is connected to a first interface of a first network device, wherein the first network device includes multiple forwarding table entries, wherein the forwarding table entries include a destination address, an outgoing interface, and a device identifier, wherein the device identifier is an identifier of a network device to which a host to which the destination address belongs is accessed; the device includes:

[0064] an acquisition module, configured to acquire status information, wherein the status information is used to indicate whether the second network device and the third network device are reachable;

[0065] A sending module is used to send a first message to the first network device, where the first message includes the device identifier of the third network device and the status information, so that when the status information indicates that the second network device and the third network device are unreachable, the first network device searches for a first forwarding table entry whose output interface is the first interface and whose device identifier is the device identifier of the third network device, and sets the status of the first forwarding table entry to an invalid state.

[0066] Optionally, the device further comprises:

[0067] a receiving module, configured to receive, before acquiring the status information, a routing update message sent by the third network device, wherein the routing update message includes a first IP address of a host connected to the third network device and a device identifier of the third network device;

[0068] The sending module is further configured to forward the routing update message to the first network device, so that the first network device generates the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

[0069] Optionally, the second network device includes a third interface and is connected to the third network device via the third interface; the third network device includes a fourth interface and is connected to the second network device via the fourth interface; the apparatus further includes:

[0070] The sending module is further configured to, before acquiring the status information, send a fourth message to the third network device, where the fourth message includes the device identifier of the second network device, so that the third network device records a third correspondence between the fourth interface and the device identifier of the second network device;

[0071] The receiving module is configured to receive a fifth message sent by the third network device, wherein the fifth message includes the device identification of the third network device, and record a fourth corresponding relationship between the third interface and the device identification of the third network device.

[0072] Optionally, the acquisition module is further configured to acquire, from the fourth corresponding relationship, a device identifier of the third network device corresponding to the third interface before sending the first message to the first network device.

[0073] Optionally, there are multiple links between the second network device and the third network device; the acquiring module is specifically configured to:

[0074] If all of the multiple links fail, it is determined that the status information indicates that the second network device and the third network device are unreachable; or, if any one of the multiple links is not failed, it is determined that the status information indicates that the second network device and the third network device are reachable.

[0075] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or,

[0076] The first message is a first IP multicast message, and the payload portion of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

[0077] Optionally, the fourth message is a fourth link layer broadcast message, and the payload portion of the fourth link layer broadcast message includes the device identifier of the second network device; or, the fourth message is a fourth IP multicast message, and the payload portion of the fourth IP multicast message includes the device identifier of the second network device;

[0078] The fifth message is a fifth link layer broadcast message, and the payload part of the fifth link layer broadcast message includes the device identifier of the third network device; or, the fifth message is a fifth IP multicast message, and the payload part of the fifth IP multicast message includes the device identifier of the third network device.

[0079] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0080] In a fifth aspect, an embodiment of the present application provides a first network device, wherein the first network device includes a first interface and is connected to a second network device through the first interface, the second network device is connected to a third network device, the first network device includes multiple forwarding table entries, the forwarding table entries include a destination address, an outgoing interface, and a device identifier, the device identifier being an identifier of a network device to which a host to which the destination address belongs is connected; the first network device includes: a processor; a transceiver; a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions prompting the processor to perform the following steps:

[0081] receiving a first message sent by the second network device, where the first message includes a device identifier and status information of the third network device, where the status information is used to indicate whether the second network device is reachable from the third network device;

[0082] If the state information indicates that the second network device and the third network device are unreachable, searching for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device;

[0083] The state of the first forwarding entry is set to an invalid state.

[0084] Optionally, the machine executable instructions further cause the processor to perform the following steps:

[0085] Before receiving the first message sent by the second network device, receiving a routing update message forwarded by the second network device through the first interface, the routing update message including the first IP address of the host connected to the third network device and the device identifier of the third network device;

[0086] The first forwarding entry is generated based on the first interface, the first IP address, and the device identification of the third network device.

[0087] Optionally, the second network device includes a second interface and is connected to the first network device through the second interface; the machine-executable instructions further cause the processor to perform the following steps:

[0088] Before receiving the first message sent by the second network device, sending a second message to the second network device, where the second message includes the device identifier of the first network device, so that the second network device records a first correspondence between the second interface and the device identifier of the first network device;

[0089] A third message sent by the second network device is received, where the third message includes the device identification of the second network device, and a second corresponding relationship between the first interface and the device identification of the second network device is recorded.

[0090] Optionally, the machine executable instructions further cause the processor to perform the following steps:

[0091] The state flag bit of the first forwarding table entry is modified to a first value, where the first value is used to indicate an invalid state.

[0092] Optionally, the machine executable instructions further cause the processor to perform the following steps:

[0093] After receiving the first message sent by the second network device, if the state information indicates that the second network device and the third network device are reachable, searching for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device;

[0094] The state of the first forwarding entry is set to a valid state.

[0095] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or,

[0096] The first message is a first IP multicast message, and the payload portion of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

[0097] Optionally, the second message is a second link layer broadcast message, and the payload portion of the second link layer broadcast message includes the device identifier of the first network device; or, the second message is a second IP multicast message, and the payload portion of the second IP multicast message includes the device identifier of the first network device;

[0098] The third message is a third link layer broadcast message, and the payload part of the third link layer broadcast message includes the device identifier of the second network device; or, the third message is a third IP multicast message, and the payload part of the third IP multicast message includes the device identifier of the second network device.

[0099] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0100] In a sixth aspect, an embodiment of the present application provides a second network device, wherein the second network device is connected to a third network device, the second network device is connected to a first interface of a first network device, the first network device includes multiple forwarding table entries, the forwarding table entries include a destination address, an outgoing interface, and a device identifier, the device identifier being an identifier of a network device to which a host to which the destination address belongs is connected; the second network device includes: a processor; a transceiver; a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions prompting the processor to perform the following steps:

[0101] Acquire status information, where the status information is used to indicate whether the second network device and the third network device are reachable;

[0102] A first message is sent to the first network device, where the first message includes the device identifier of the third network device and the status information, so that when the status information indicates that the second network device and the third network device are unreachable, the first network device searches for a first forwarding table entry whose output interface is the first interface and whose device identifier is the device identifier of the third network device, and sets the status of the first forwarding table entry to an invalid state.

[0103] Optionally, the machine executable instructions further cause the processor to perform the following steps:

[0104] Before acquiring the status information, receiving a routing update message sent by the third network device, the routing update message including the first IP address of the host connected to the third network device and the device identifier of the third network device;

[0105] The routing update message is forwarded to the first network device, so that the first network device generates the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

[0106] Optionally, the second network device includes a third interface and is connected to the third network device through the third interface; the third network device includes a fourth interface and is connected to the second network device through the fourth interface; the machine-executable instructions further cause the processor to perform the following steps:

[0107] Before acquiring the status information, sending a fourth message to the third network device, where the fourth message includes the device identifier of the second network device, so that the third network device records a third correspondence between the fourth interface and the device identifier of the second network device;

[0108] A fifth message sent by the third network device is received, where the fifth message includes the device identification of the third network device, and a fourth corresponding relationship between the third interface and the device identification of the third network device is recorded.

[0109] Optionally, the machine executable instructions further cause the processor to perform the following steps:

[0110] Before sending the first message to the first network device, a device identifier of the third network device corresponding to the third interface is obtained from the fourth corresponding relationship.

[0111] Optionally, there are multiple links between the second network device and the third network device; the machine executable instructions further cause the processor to perform the following steps:

[0112] If all of the multiple links fail, it is determined that the status information indicates that the second network device and the third network device are unreachable; or, if any one of the multiple links is not failed, it is determined that the status information indicates that the second network device and the third network device are reachable.

[0113] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or,

[0114] The first message is a first IP multicast message, and the payload portion of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

[0115] Optionally, the fourth message is a fourth link layer broadcast message, and the payload portion of the fourth link layer broadcast message includes the device identifier of the second network device; or, the fourth message is a fourth IP multicast message, and the payload portion of the fourth IP multicast message includes the device identifier of the second network device;

[0116] The fifth message is a fifth link layer broadcast message, and the payload part of the fifth link layer broadcast message includes the device identifier of the third network device; or, the fifth message is a fifth IP multicast message, and the payload part of the fifth IP multicast message includes the device identifier of the third network device.

[0117] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0118] In a seventh aspect, an embodiment of the present application provides a machine-readable storage medium storing machine-executable instructions. When called and executed by a processor, the machine-executable instructions prompt the processor to implement the method described in the first aspect or the second aspect.

[0119] In an eighth aspect, an embodiment of the present application provides a computer program product, which prompts the processor to implement the method described in the first aspect or the second aspect.

[0120] Beneficial effects of the embodiments of the present application: The link failure processing method, device, electronic device and medium provided by the embodiments of the present application, the forwarding chip of the first network device can obtain whether the second network device and the third network device are reachable through the first message sent by the second network device, thereby timely perceiving the connection status between the second network device and the third network device. Moreover, the forwarding chip of the first network device can also promptly set the first forwarding table entry with the next hop address being the source address of the first message and the device identifier being the device identifier of the third network device to an invalid state when the second network device and the third network device are unreachable, that is, disable the forwarding path including the link between the second network device and the third network device, so that other forwarding table entries can be selected to forward messages to the host connected to the third network device in the future. That is, the embodiment of the present application can promptly notify other network devices when a link failure exists between two network devices, and the network device can also directly set the state of the forwarding table entry involved in the faulty link to an invalid state through the forwarding chip, without involving the control surface's processing of the received message, so it is faster and can perform route switching more timely, thereby improving the training efficiency of the AI ​​traffic model. BRIEF DESCRIPTION OF THE DRAWINGS

[0121] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.

[0122] FIG1 is a network traffic comparison diagram provided by an embodiment of the present application;

[0123] FIG2 is a schematic diagram of a communication system structure provided in an embodiment of the present application;

[0124] FIG3 is a flow chart of a link failure processing method provided by an embodiment of the present application;

[0125] FIG4 is a schematic diagram of the format of an extended community attribute provided in an embodiment of the present application;

[0126] FIG5 is an exemplary schematic diagram of a message format of a first link layer broadcast message provided in an embodiment of the present application;

[0127] FIG6 is an exemplary schematic diagram of a message format of a first IP multicast message provided in an embodiment of the present application;

[0128] FIG7 is a schematic diagram of the format of a payload portion included in a first message provided in an embodiment of the present application;

[0129] FIG8 is a schematic diagram of the format of a payload portion included in a topology discovery message provided in an embodiment of the present application;

[0130] FIG9 is a flowchart of another link failure processing method provided in an embodiment of the present application;

[0131] FIG10 is an exemplary schematic diagram of another communication system provided in an embodiment of the present application;

[0132] FIG11 is a schematic structural diagram of a link failure processing device provided in an embodiment of the present application;

[0133] FIG12 is a schematic structural diagram of another link failure processing device provided in an embodiment of the present application;

[0134] FIG13 is a schematic structural diagram of a first network device provided in an embodiment of the present application;

[0135] FIG14 is a schematic structural diagram of a second network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0136] To make the objectives, technical solutions, and advantages of the present invention more clearly understood, the present invention is further described below with reference to the accompanying drawings and examples. It should be understood that the described examples are only some examples of the present invention, not all examples. All other examples derived by persons of ordinary skill in the art based on the examples of the present invention fall within the scope of protection of the present invention.

[0137] The training scale of a neural network model is categorized by the number of GPUs used during training: single-scale, small-scale, medium-scale, large-scale, and extra-large-scale. Single-scale training uses a single GPU, small-scale uses at least eight GPUs, medium-scale uses at least 100 GPUs, large-scale uses at least 1,000 GPUs, and extra-large-scale uses at least 10,000 GPUs.

[0138] As the scale of neural network models continues to expand, a single GPU can no longer meet the demand for computing and storage resources when training neural network models. For example, the training scale of AI traffic models is generally large-scale or extra-large-scale. Therefore, the current method of jointly training neural network models with multiple GPUs is usually adopted to speed up the training of the model. For example, each training data can be split into multiple parts, and each training data can be assigned to a different GPU, so that each GPU can use the AI ​​traffic model to process different training data, and then calculate the loss value by combining the processing results of each GPU, and use the loss value to adjust the network parameters of the AI ​​traffic model. For another example, different GPUs can use the AI ​​traffic model to process data of different dimensions in each training data, and then calculate the loss value by combining the processing results of each GPU, and use the loss value to adjust the network parameters of the AI ​​traffic model. This joint training method usually involves a large number of GPUs, so frequent interaction is required between the GPUs.

[0139] Hosts to which GPUs belong can communicate based on network devices. When a link failure occurs between network devices, routing switching is required. The current routing switching process is briefly described below with reference to Figure 2. The communication system shown in Figure 2 includes: host H1, host H2, network device R11, network device R12, network device R21, and network device R22. When a link failure occurs between network device R11 and network device R22, network device R11 detects the link failure with network device R22 through bidirectional forwarding detection (BFD) or connectivity fault management (CFM). Network device R11 then switches its stored routes through equal-cost multi-path routing (ECMP) or fast reroute (FRR). Network device R11 then sends a notification message to network device R21 via Internet Gateway Protocol (IGP) Link State propagation or Border Gateway Protocol (BGP) route updates. After receiving the notification message, network device R21 recalculates routes through its control plane and deletes the forwarding entries associated with the failed link in its forwarding chip. It then determines equivalent routes for the deleted forwarding entries through the BGP Programmable Interrupt Controller (PIC) or IGP route calculation convergence, allowing network device R21 to subsequently send messages to host H2 using the links from network device R21 to network device R12 and then to network device R22.

[0140] The convergence time for BFD and CFM is from a few milliseconds to a few seconds. The convergence time for ECMP and FRR is from a few milliseconds, and this is affected by the fault detection time. The convergence time for IGP LinkState propagation and BGP route updates is from a few milliseconds to a few seconds, and this is affected by the scale of network equipment in the communication system and the number of communication routes. The convergence time for BGP PIC and IGP route calculation convergence is from a few hundred milliseconds to a few seconds, and this is affected by the fault notification time and the scale of network equipment in the communication system. The long time required for fault notification and route recalculation can result in delayed fault convergence, which in turn affects the training efficiency of the AI ​​traffic model.

[0141] In order to perform route switching more promptly when a connection between network devices fails, an embodiment of the present application provides a link failure handling method, which is applied to a first network device, wherein the first network device includes a first interface and is connected to a second network device via the first interface, and the second network device is connected to a third network device. The first network device includes multiple forwarding table entries, each of which includes a destination address, an outgoing interface, and a device identifier. The first network device, the second network device, and the third network device can all be devices with message forwarding capabilities, such as a switch or a router. The embodiment of the present application can be applied to a spine-leaf network architecture.

[0142] As shown in FIG3 , the link failure handling method provided in the embodiment of the present application includes the following steps:

[0143] S301: Receive a first message sent by a second network device.

[0144] The first message includes the device identification (ID) and status information of the third network device. The status information is used to indicate whether the second network device and the third network device are reachable, that is, whether a link between the second network device and the third network device is faulty.

[0145] Optionally, the first message may further include a device identifier of the second network device.

[0146] S302: If the status information indicates that the second network device and the third network device are unreachable, search for a first forwarding entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device.

[0147] The first network device includes multiple forwarding table entries, and each forwarding table entry includes a destination address, an outgoing interface, and a device identifier, wherein the device identifier is an identifier of the network device to which the host to which the destination address belongs is connected. Optionally, the host can be a device capable of sending and receiving messages, such as a laptop, desktop computer, or server.

[0148] The forwarding table entry further includes a next hop address. For example, the next hop address of the first forwarding table entry is an Internet Protocol (IP) address of the second network device.

[0149] S303: Set the state of the first forwarding entry to an invalid state.

[0150] Since the forwarding path represented by the first forwarding table entry needs to pass through the link between the second network device and the third network device, and the second network device and the third network device are unreachable, that is, the link between the second network device and the third network device is faulty, the forwarding path is currently unusable, so the status of the first forwarding table entry can be set to invalid.

[0151] It is understandable that when the first network device subsequently forwards a service message, if it determines that the destination address of the service message is the same as the destination address of the first forwarding table entry, it will not use the first forwarding table entry to forward the message. Instead, it will directly search for another forwarding table entry that matches the destination address of the service message and use the searched forwarding table entry to forward the service message. This is equivalent to completing the routing switch of the first network device after the state of the first forwarding table entry is set to invalid.

[0152] The link failure processing method provided by the embodiment of the present application is that the forwarding chip of the first network device can obtain whether the second network device and the third network device are reachable through the first message sent by the second network device, thereby timely sensing the connection status between the second network device and the third network device. Moreover, the forwarding chip of the first network device can also timely set the first forwarding table item with the next hop address as the source address of the first message and the device identifier as the device identifier of the third network device to an invalid state when the second network device and the third network device are unreachable, that is, disable the forwarding path including the link between the second network device and the third network device, so that other forwarding table items can be selected to forward messages to the host connected to the third network device in the future. That is, the embodiment of the present application can promptly notify other network devices when a link failure occurs between two network devices, and the network device can also directly set the status of the forwarding table item involved in the faulty link to an invalid state through the forwarding chip, without involving the control surface's processing of the received message, so it is faster and can perform route switching more timely, thereby improving the training efficiency of the AI ​​traffic model.

[0153] In the embodiment of the present application, before the first network device receives the first message sent by the second network device in S301, the first network device may further generate a first forwarding table entry. The generation method includes the following steps:

[0154] Step 1: A first network device receives a route update message forwarded by a second network device through a first interface.

[0155] The routing update message includes a first Internet Protocol (IP) address of a host connected to the third network device and a device identifier of the third network device.

[0156] As an example, the route update message can specifically be a BGP route update message. After the third network device learns the IP address of the host to which it is connected, it can send a BGP route update message carrying the IP address. In the embodiment of the present application, the device identifier of the third network device is added to the BGP route update message, which is equivalent to the BGP route update message carrying the device identifier of the original network device that sent the BGP route update message. This allows other network devices to know the original source device of the BGP route update message after receiving the BGP route update message.

[0157] Step 2: The first network device generates a first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

[0158] The first IP address can be used as the destination address, the first interface as the outgoing interface, and combined with the device identification of the third network device to generate a first forwarding table entry. It is understandable that the first forwarding table entry also includes a next hop address, which is the IP address of the second network device.

[0159] In the embodiment of the present application, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0160] The format of the extended community attribute is shown in FIG4 . The extended community attribute includes: type (Type), subtype (Sub-Type), reserved bit (Reserved, Res) and device identifier (Device ID).

[0161] Through the above method, the embodiment of the present application can carry the device identification of the third network device in the routing update message sent by the second network device to the first network device, so that the first network device can know the device identification of the network device to which the host accesses the first IP address included in the routing update message, and record it in the forwarding table item, that is, the network device can dynamically learn the device identification of the remote network device, so that when it is subsequently determined that the link between the second network device and the third network device has a fault, it can more quickly find the first forwarding table item corresponding to the faulty link, thereby performing routing switching more quickly and improving fault convergence efficiency.

[0162] Moreover, the device identifier of the third network device can be carried in the extended community attribute of the routing update message, and there is no need to add an additional message for carrying the device identifier, which is more convenient to implement.

[0163] In an embodiment of the present application, the second network device includes a second interface and is connected to the first network device via the second interface. Before the first network device receives the first message sent by the second network device in step S301, the first network device may also send a second message to the second network device. The second message includes the device identifier of the first network device, so that the second network device records the first correspondence between the second interface and the device identifier of the first network device. Optionally, the first network device may send the second message to the second network device when the connection between the first network device and the second network device is established.

[0164] Accordingly, the first network device may also receive a third message sent by the second network device, wherein the third message includes the device identifier of the second network device. The first network device may then record the second correspondence between the first interface and the device identifier of the second network device. Optionally, the second network device may send the third message to the first network device when the connection between the second network device and the first network device is established. That is, the first network device may receive the third message sent by the second network device when the connection between the first network device and the second network device is established.

[0165] When a connection is established between the first network device and the second network device, the first network device sets the interface state of the first interface to the up state and sends a second message to the second network device. When a connection is established between the first network device and the second network device, the second network device sets the interface state of the second interface to the up state and sends a third message to the first network device.

[0166] Through the above method, a first network device can learn the device identifier of the network device connected to its first interface, and a second network device can learn the device identifier of the network device connected to its second interface. This means that the network devices can dynamically learn the device identifiers of their peer network devices and maintain the logical topology relationship between network devices. This allows the second network device to carry the device identifier of the first network device when subsequently notifying other network devices via messages about its reachability with the first network device, thus enabling rapid fault notification.

[0167] When establishing a connection between any two other network devices, they may also send messages carrying their own device identifications in the above manner and record the corresponding relationship.

[0168] Alternatively, the device identifier of the opposite network device to which each interface of the network device is connected may be pre-configured in each network device in a static configuration manner.

[0169] Optionally, the third message may further include a sequence number used to distinguish between old and new messages. That is, each time the second network device sends the third message to the first network device via the second interface, the sequence number carried in the third message is incremented by 1. Based on this, the method for the first network device to record the second correspondence between the first interface and the device identifier of the second network device can be implemented by recording the second correspondence between the device identifiers of the first interface and the second network device and the sequence number.

[0170] In an embodiment of the present application, the first message received by the first network device in the above S301 can be a first link layer broadcast message, wherein the payload part of the first link layer broadcast message includes the device identification of the second network device, the device identification and status information of the third network device.

[0171] Referring to Figure 5, the first link layer broadcast message includes: a first Ethernet header (Eth), a payload, and a cyclic redundancy check (CRC) code. The first Eth includes: a destination media access control address (DMAC), a source media access control address (SMAC), and a Type. SMAC is the MAC address of the network device that sends the first link layer broadcast message, and DMAC is the preset multicast MAC address. In the first link layer broadcast message, DMAC occupies 6 bytes, SMAC occupies 6 bytes, Type occupies 2 bytes, payload occupies 46 to 1500 bytes, and the CRC code occupies 4 bytes. In the embodiment of the present application, the value of the Type field in the first Eth is improved, so that the first link layer broadcast message is defined as a message for fault notification by the value of the Type field. The value of the Type field can be set according to actual conditions, and the embodiment of the present application does not limit this.

[0172] Alternatively, the first message is a first IP multicast message, and the payload portion of the first IP multicast message includes the device identifier of the second network device, the device identifier and status information of the third network device.

[0173] As shown in Figure 6, the first IP multicast message includes a second Ethernet, a payload, and a frame check sequence (FCS). The second Ethernet includes the destination address, source address, 802.1Q tag, and length / type. The 802.1Q tag includes the type, priority (PRI), canonical format indicator (CFI), and virtual local area network (VLAN) ID (VID). The FCS can be obtained using the CRC-32 algorithm. In the first IP multicast message, the destination address occupies 6 bytes; the source address occupies 6 bytes; the 802.1Q tag occupies 4 bytes, of which the type occupies 2 bytes, the PRI occupies 3 bits, the CFI occupies 1 bit, and the VID occupies 12 bits; the length / type occupies 2 bytes; the payload occupies 45 to 1500 bytes; and the FCS occupies 4 bytes. In this embodiment of the present application, the value of the Type field in the second Eth is improved, thereby defining the first IP multicast message as a message for fault notification through the value of the Type field. The value of the Type field can be set according to actual conditions and is not limited in this embodiment of the present application.

[0174] Optionally, the payload portion of the first message may further include a sequence number, and the sequence number is used to distinguish between new and old messages.

[0175] The message format of the payload portion of the first message is shown in Figure 7. The payload portion includes: version (version), Type, message length (packet-Length), source device identifier (SRC Device ID), destination device identifier (Dest Device ID), serial number (Serial Number), destination port identifier (DPortID) and status (Status). Among them, SRC Device ID is the device identifier of the second network device, Dest Device ID is the device identifier of the third network device, DportID is the third interface identifier in the second network device for connecting to the third network device, or the virtual interface identifier, and the virtual interface represents each interface in the second network device connected to the third network device. Status indicates whether the second network device and the third network device are reachable, and is specifically used to indicate the interface status of the interface represented by DportID.

[0176] When a link exists between the second network device and the third network device, the second network device is connected to the third network device via a third interface. In this case, DportID is the identifier of the third interface. When Status = 0, it indicates that the interface status of the third interface is faulty, i.e., the link between the second network device and the third network device is faulty. When Status = 1, it indicates that the third interface is in a normal state, i.e., the link between the second network device and the third network device is not faulty.

[0177] If multiple links exist between the second network device and the third network device, the second network device is connected to the third network device via multiple interfaces, each of which corresponds to a link. In this case, DportID is the virtual interface identifier of the second network device. When Status = 0, it indicates that the virtual interface is in a faulty state, meaning that both links between the second and third network devices are faulty. When Status = 1, it indicates that the virtual interface is in a normal state, meaning that a normal link exists between the second and third network devices.

[0178] The first message may be a message generated through BGP or IGP.

[0179] In an embodiment of the present application, the second message is a second link layer broadcast message, wherein the payload portion of the second link layer broadcast message includes the device identifier of the first network device; or, the second message is a second IP multicast message, wherein the payload portion of the second IP multicast message includes the device identifier of the first network device.

[0180] Similarly, the third message is a third link layer broadcast message, wherein the payload portion of the third link layer broadcast message includes the device identifier of the second network device; or, the third message is a third IP multicast message, wherein the payload portion of the third IP multicast message includes the device identifier of the second network device.

[0181] The headers of the second message and the third message are the same as the header of the first message, and reference can be made to the above description.

[0182] The payload portion of the second and third messages has the same format, as shown in FIG8 . The payload portion includes: version, type, packet-length, SRC Device ID, and source interface identifier (Src Port ID). Optionally, referring to FIG8 , the payload portion of the second and third messages may also include a serial number. The SRC Device ID is the device identifier of the source network device sending the message, and the Src Port ID indicates the identifier of the interface used by the source network device when sending the message.

[0183] In the embodiment of the present disclosure, the first message can be called a fast notification message, and the second and third messages can be called topology discovery messages. The fast notification message and the topology discovery message are both new messages in the embodiment of the present application, and the headers of the two messages can be the same. The network device can distinguish the two messages by the Type included in the payload part of the message. For example, referring to Figure 7, the payload part of the fast notification message includes Type = 2, and referring to Figure 8, the payload part of the topology discovery message includes Type = 1.

[0184] In an embodiment of the present application, the first network device includes at least one equal-cost multi-path routing (ECMP) group, the ECMP group includes at least two forwarding table entries, and the destination addresses of the forwarding table entries included in the ECMP group are the same.

[0185] In the embodiment of the present application, the above-mentioned S303 of the first network device setting the state of the first forwarding table entry to an invalid state can be implemented by modifying the state flag of the first forwarding table entry to a first value, wherein the first value is used to indicate an invalid state, for example, the first value is 0.

[0186] In the embodiment of the present application, the first network device can directly manage the forwarding table entries through the forwarding chip, thereby improving the speed of route switching.

[0187] In an embodiment of the present application, after the first network device receives the first message sent by the second network device in the above-mentioned S301, if the status information indicates that the second network device and the third network device are reachable, the first network device can find the first forwarding table entry whose output interface is the first interface and whose device identifier is the device identifier of the third network device, and set the status of the first forwarding table entry to a valid state.

[0188] The manner in which the first network device searches for the first forwarding entry may refer to the specific implementation manner in the above S302 and will not be described in detail here.

[0189] The first network device may modify the state flag of the first forwarding table entry to a second value, where the second value is used to indicate a valid state, for example, the second value is 1.

[0190] Through the above method, the network device can timely update the status of the forwarding entries stored in itself according to the received first message, so as to perform route switching in a timely manner.

[0191] Based on the same concept, an embodiment of the present application also provides a link failure handling method, which is applied to a second network device, the second network device being connected to a third network device, the second network device being connected to a first interface of a first network device, the first network device including multiple forwarding table entries, each of which includes a destination address, an outgoing interface, and a device identifier, where the device identifier is the identifier of the network device to which the host to which the destination address belongs is connected. As shown in FIG9 , the method includes the following steps:

[0192] S901: Acquire status information, where the status information indicates whether the second network device and the third network device are reachable.

[0193] S902. Send a first message to the first network device, where the first message includes the device identifier and status information of the third network device, so that when the status information indicates that the second network device and the third network device are unreachable, the first network device searches for a first forwarding table entry whose output interface is the first interface and whose device identifier is the device identifier of the third network device, and sets the status of the first forwarding table entry to an invalid state.

[0194] It should be noted that the first network device is: a network device connected to the second network device, the link between which and the second network device has not failed. There can be one or more first network devices, and the embodiment of the application is described as one first network device.

[0195] The second network device sends the first message to the first network device via multicast or broadcast. Optionally, the second network device may periodically send the first message. Alternatively, the second network device may send the first message once every preset duration when the connection status of the link between the second network device and the network device to which it is connected changes, and continuously send the first message a preset number of times. For example, the preset duration is 10 milliseconds and the preset number of times is 10.

[0196] The specific manner in which the first network device searches for the first forwarding table entry and sets the state of the first forwarding table entry to an invalid state can be referred to the above description and will not be repeated here.

[0197] The link failure processing method provided by the embodiment of the present application is that the forwarding chip of the first network device can obtain whether the second network device and the third network device are reachable through the first message sent by the second network device, thereby timely sensing the connection status between the second network device and the third network device. Moreover, the forwarding chip of the first network device can also timely set the first forwarding table item with the next hop address as the source address of the first message and the device identifier as the device identifier of the third network device to an invalid state when the second network device and the third network device are unreachable, that is, disable the forwarding path including the link between the second network device and the third network device, so that other forwarding table items can be selected to forward messages to the host connected to the third network device in the future. That is, the embodiment of the present application can promptly notify other network devices when a link failure occurs between two network devices, and the network device can also directly set the status of the forwarding table item involved in the faulty link to an invalid state through the forwarding chip, without involving the control surface's processing of the received message, so it is faster and can perform route switching more timely, thereby improving the training efficiency of the AI ​​traffic model.

[0198] In an embodiment of the present application, before the second network device obtains the status information in S901, the second network device may further: receive a routing update message sent by the third network device, and forward the routing update message to the first network device, so that the first network device generates a first forwarding table entry based on the first interface, the first IP address, and the device identifier of the third network device. The routing update message includes the first IP address of the host to which the third network device is connected and the device identifier of the third network device.

[0199] The routing update message includes an extended community attribute, and the extended community attribute includes the device identifier of the third network device. The format of the routing update message can refer to the above description.

[0200] The specific manner in which the first network device generates the first forwarding table entry can be referred to the above description and will not be repeated here.

[0201] In an embodiment of the present application, the second network device includes a third interface and is connected to the third network device via the third interface. The third network device includes a fourth interface and is connected to the second network device via the fourth interface. Before the second network device obtains status information in step S901, the second network device may send a fourth message to the third network device, so that the third network device records a third correspondence between the fourth interface and the device identifier of the second network device. The fourth message includes the device identifier of the second network device. Optionally, the second network device may send the fourth message to the third network device when the connection between the second network device and the third network device is established.

[0202] Before the second network device obtains the status information in S901 above, the second network device may also receive a fifth message sent by the third network device to record a fourth correspondence between the third interface and the device identifier of the third network device. The fifth message includes the device identifier of the third network device. Optionally, the third network device may send the fifth message to the second network device when the connection between the third network device and the second network device is established; that is, the second network device may receive the fifth message sent by the third network device when the connection between the second network device and the third network device is established.

[0203] The fourth message and the fifth message may be referred to as topology discovery messages. The format of the topology discovery message may refer to the above description.

[0204] In the embodiment of the present application, when there are multiple links between the second network device and the third network device, the manner in which the second network device obtains the status information in S901 includes the following two situations:

[0205] Case 1: If multiple links between the second network device and the third network device are faulty, it is determined that the status information indicates that the second network device and the third network device are unreachable.

[0206] Case 2: If any one of the multiple links between the second network device and the third network device is not faulty, it is determined that the state information indicates that the second network device and the third network device are reachable.

[0207] The second network device may detect whether each link is faulty by using BFD or CFM, or may detect by other methods, which is not specifically limited in the embodiment of the present application.

[0208] Before the second network device sends the first message to the first network device in S902, the second network device may further obtain the device identifier of the third network device corresponding to the third interface from the fourth corresponding relationship.

[0209] In the embodiment of the present application, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier and status information of the third network device; or,

[0210] The first message is a first IP multicast message, and the payload of the first IP multicast message includes the device identifier of the second network device, the device identifier and status information of the third network device.

[0211] In an embodiment of the present application, the fourth message is a fourth link layer broadcast message, and the payload part of the fourth link layer broadcast message includes the device identifier of the second network device; or, the fourth message is a fourth IP multicast message, and the payload part of the fourth IP multicast message includes the device identifier of the second network device.

[0212] The fifth message is a fifth link layer broadcast message, and the payload portion of the fifth link layer broadcast message includes the device identifier of the third network device; or, the fifth message is a fifth IP multicast message, and the payload portion of the fifth IP multicast message includes the device identifier of the third network device.

[0213] The fourth message and the fifth message may both be referred to as topology discovery messages, and the format of the topology discovery message may refer to the above description.

[0214] Referring to FIG10 , the complete process of link failure handling provided by an embodiment of the present application is described below:

[0215] The communication system shown in Figure 10 includes Host-1, Host-2, Host-3, Host-4, Leaf-1, Leaf-2, Leaf-3, Leaf-4, Spine-1, and Spine-2. Leaf-1's device ID is 11, Leaf-2's device ID is 12, Leaf-3's device ID is 13, and Leaf-4's device ID is 14. Spine-1's device ID is 21, and Spine-2's device ID is 22. Leaf-1 is connected to Host-1, Leaf-2 is connected to Host-2, Leaf-3 is connected to Host-3, and Leaf-4 is connected to Host-4. Spine-1 and Spine-2 are connected to Leaf-1 through Leaf-4, respectively. Spine-1 and leaf nodes communicate with each other based on BGP. Each leaf node connects to Spine-1 and Spine-2 through its own interfaces. For example, the interface connecting Leaf-1 to Spine-1 is leaf-1-interface-1, and the interface connecting Leaf-1 to Spine-2 is leaf-1-interface-2. Each leaf node stores forwarding entries for all hosts except the one it is connected to.

[0216] For example, the forwarding table entries stored in Leaf-1 are as follows:

[0217] ECMP 1, whose destination address is Host-2, includes the following forwarding entries:

[0218] Next hop 1 points to Spine-1. That is, next hop address 1 is the address of Spine-1, the outbound interface is leaf-1-interface-1, and the device ID is 12.

[0219] Next hop 2 points to Spine-2, the outbound interface is leaf-1-interface-2, and the device ID is 12.

[0220] ECMP 2, whose destination address is Host-3, includes the following forwarding entries:

[0221] Next hop 1 points to Spine-1, the outbound interface is leaf-1-interface-1, and the device ID is 13.

[0222] Next hop 2 points to Spine-2, the outbound interface is leaf-1-interface-2, and the device ID is 13.

[0223] ECMP 3, whose destination address is Host-4, includes the following forwarding entries:

[0224] Next hop 1 points to Spine-1, the outbound interface is leaf-1-interface-1, and the device ID is 14.

[0225] Next hop 2 points to Spine-2, the outbound interface is leaf-1-interface-2, and the device ID is 14.

[0226] Assume that the first network device is Leaf-1, the second network device is Spine-1, and the third network device is Leaf-4. That is, assume that the link between Spine-1 and Leaf-4 fails. Spine-1 can send a first message to Leaf-1. The first message includes: device ID 21, device ID 14, and Status = 0.

[0227] After receiving the first packet, Leaf-1 searches the forwarding table for the device ID 14 and the outgoing interface leaf-1-interface-1. This is the first forwarding entry in ECMP3, and sets the forwarding entry to invalid. When Leaf-1 subsequently forwards packets to Host-4, it forwards based on the other forwarding entries in ECMP3, namely, "next hop 2 points to Spine-2, the outgoing interface is leaf-1-interface-2, and the device ID is 14."

[0228] Through the above method, the embodiment of the present application can quickly notify other network devices when a link failure occurs between two network devices, that is, when the two network devices are unreachable, so that other network devices can quickly find the forwarding table entry corresponding to the faulty link based on the output interface identifier and the device identifier, thereby realizing rapid routing switching, improving fault convergence efficiency, and thus improving the training efficiency of the AI ​​traffic model.

[0229] Based on the same concept, an embodiment of the present application also provides a link failure processing device, which is applied to a forwarding chip of a first network device, wherein the first network device includes a first interface and is connected to a second network device through the first interface, and the second network device is connected to a third network device. The first network device includes multiple forwarding table entries, each of which includes a destination address, an outgoing interface, and a device identifier, where the device identifier is an identifier of a network device to which a host to which the destination address belongs is connected. As shown in FIG11 , the device includes: a receiving module 1101, a search module 1102, and a setting module 1103;

[0230] A receiving module 1101 is configured to receive a first message sent by a second network device, where the first message includes a device identifier and status information of a third network device, where the status information indicates whether the second network device and the third network device are reachable.

[0231] A search module 1102 is configured to search for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device if the status information indicates that the second network device and the third network device are unreachable;

[0232] The setting module 1103 is configured to set the state of the first forwarding entry to an invalid state.

[0233] Optionally, the device further comprises:

[0234] The receiving module 1101 is further configured to receive, through the first interface, a routing update message forwarded by the second network device before receiving the first message sent by the second network device, the routing update message including the first IP address of the host connected to the third network device and the device identifier of the third network device;

[0235] A generating module is configured to generate a first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

[0236] Optionally, the second network device includes a second interface and is connected to the first network device via the second interface; the apparatus further includes:

[0237] The sending module is further configured to send a second message to the second network device before receiving the first message sent by the second network device, where the second message includes the device identifier of the first network device, so that the second network device records the first correspondence between the second interface and the device identifier of the first network device;

[0238] The receiving module 1101 is further configured to receive a third message sent by the second network device, where the third message includes the device identification of the second network device, and record a second corresponding relationship between the first interface and the device identification of the second network device.

[0239] Optionally, the setting module 1103 is specifically configured to:

[0240] The state flag bit of the first forwarding table entry is modified to a first value, where the first value is used to indicate an invalid state.

[0241] Optionally, the search module 1102 is further configured to, after receiving the first message sent by the second network device, search for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device if the status information indicates that the second network device and the third network device are reachable;

[0242] The setting module 1103 is further configured to set the state of the first forwarding entry to a valid state.

[0243] Optionally, the first message is a first link layer broadcast message, and the payload part of the first link layer broadcast message includes the device identifier of the second network device, the device identifier and status information of the third network device; or, the first message is a first IP multicast message, and the payload part of the first IP multicast message includes the device identifier of the second network device, the device identifier and status information of the third network device.

[0244] Optionally, the second message is a second link layer broadcast message, and the payload portion of the second link layer broadcast message includes the device identifier of the first network device; or the second message is a second IP multicast message, and the payload portion of the second IP multicast message includes the device identifier of the first network device;

[0245] The third message is a third link layer broadcast message, and the payload portion of the third link layer broadcast message includes the device identifier of the second network device; or, the third message is a third IP multicast message, and the payload portion of the third IP multicast message includes the device identifier of the second network device.

[0246] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0247] Based on the same concept, an embodiment of the present application also provides a link failure processing device, which is applied to a forwarding chip of a second network device, the second network device is connected to a third network device, and the second network device is connected to a first interface of a first network device. The first network device includes multiple forwarding table entries, each of which includes a destination address, an outgoing interface, and a device identifier. The device identifier is an identifier of the network device to which the host to which the destination address belongs is connected. As shown in Figure 12, the device includes: an acquisition module 1201 and a sending module 1202;

[0248] An acquisition module 1201 is configured to acquire status information, where the status information indicates whether the second network device and the third network device are reachable.

[0249] The sending module 1202 is used to send a first message to the first network device, where the first message includes the device identification and status information of the third network device, so that when the status information indicates that the second network device and the third network device are unreachable, the first network device searches for a first forwarding table entry whose output interface is the first interface and whose device identification is the device identification of the third network device, and sets the status of the first forwarding table entry to an invalid state.

[0250] Optionally, the device further comprises:

[0251] a receiving module, configured to receive, before acquiring the status information, a routing update message sent by the third network device, the routing update message including the first IP address of the host connected to the third network device and a device identifier of the third network device;

[0252] The sending module 1202 is further configured to forward the routing update message to the first network device, so that the first network device generates a first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

[0253] Optionally, the second network device includes a third interface and is connected to the third network device via the third interface; the third network device includes a fourth interface and is connected to the second network device via the fourth interface; and the apparatus further includes:

[0254] The sending module 1202 is further configured to, before acquiring the status information, send a fourth message to the third network device, where the fourth message includes the device identifier of the second network device, so that the third network device records a third correspondence between the fourth interface and the device identifier of the second network device;

[0255] The receiving module is configured to receive a fifth message sent by the third network device, the fifth message including the device identification of the third network device, and record a fourth corresponding relationship between the third interface and the device identification of the third network device.

[0256] Optionally, the obtaining module 1201 is further configured to obtain a device identifier of the third network device corresponding to the third interface from the fourth corresponding relationship before sending the first message to the first network device.

[0257] Optionally, there are multiple links between the second network device and the third network device; the obtaining module 1201 is specifically configured to:

[0258] If multiple links fail, determining that the status information indicates that the second network device and the third network device are unreachable; or,

[0259] If any one of the multiple links is not faulty, it is determined that the state information indicates that the second network device and the third network device are reachable.

[0260] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier and status information of the third network device; or,

[0261] The first message is a first IP multicast message, and the payload of the first IP multicast message includes the device identifier of the second network device, the device identifier and status information of the third network device.

[0262] Optionally, the fourth message is a fourth link layer broadcast message, and the payload portion of the fourth link layer broadcast message includes the device identifier of the second network device; or, the fourth message is a fourth IP multicast message, and the payload portion of the fourth IP multicast message includes the device identifier of the second network device;

[0263] The fifth message is a fifth link layer broadcast message, and the payload portion of the fifth link layer broadcast message includes the device identifier of the third network device; or, the fifth message is a fifth IP multicast message, and the payload portion of the fifth IP multicast message includes the device identifier of the third network device.

[0264] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0265] Based on the same concept, an embodiment of the present application provides a first network device, the first network device including a first interface and connected to a second network device through the first interface, the second network device being connected to a third network device, the first network device including multiple forwarding table entries, the forwarding table entries including a destination address, an outgoing interface, and a device identifier, where the device identifier is an identifier of the network device to which the host to which the destination address belongs is accessed; as shown in FIG13 , the first network device includes: a processor 1301; a transceiver 1304; and a machine-readable storage medium 1302, the machine-readable storage medium 1302 storing machine-executable instructions that can be executed by the processor 1301; the machine-executable instructions causing the processor 1301 to perform the following steps:

[0266] receiving a first message sent by the second network device, where the first message includes a device identifier and status information of the third network device, where the status information is used to indicate whether the second network device and the third network device are reachable;

[0267] If the status information indicates that the second network device and the third network device are unreachable, searching for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device;

[0268] The state of the first forwarding table entry is set to an invalid state.

[0269] Optionally, the machine executable instructions further cause the processor 1301 to perform the following steps:

[0270] Before receiving the first message sent by the second network device, receiving a routing update message forwarded by the second network device through the first interface, the routing update message including the first IP address of the host connected to the third network device and the device identifier of the third network device;

[0271] A first forwarding entry is generated based on the first interface, the first IP address, and the device identifier of the third network device.

[0272] Optionally, the second network device includes a second interface and is connected to the first network device through the second interface; the machine executable instructions further cause the processor 1301 to perform the following steps:

[0273] Before receiving the first message sent by the second network device, sending a second message to the second network device, where the second message includes the device identifier of the first network device, so that the second network device records the first correspondence between the second interface and the device identifier of the first network device;

[0274] A third message sent by the second network device is received, where the third message includes the device identification of the second network device, and a second corresponding relationship between the first interface and the device identification of the second network device is recorded.

[0275] Optionally, the machine executable instructions further cause the processor 1301 to perform the following steps:

[0276] The state flag bit of the first forwarding table entry is modified to a first value, where the first value is used to indicate an invalid state.

[0277] Optionally, the machine executable instructions further cause the processor 1301 to perform the following steps:

[0278] After receiving the first message sent by the second network device, if the state information indicates that the second network device and the third network device are reachable, searching for a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device;

[0279] The state of the first forwarding table entry is set to valid.

[0280] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier and status information of the third network device; or,

[0281] The first message is a first IP multicast message, and the payload of the first IP multicast message includes the device identifier of the second network device, the device identifier and status information of the third network device.

[0282] Optionally, the second message is a second link layer broadcast message, and the payload portion of the second link layer broadcast message includes the device identifier of the first network device; or the second message is a second IP multicast message, and the payload portion of the second IP multicast message includes the device identifier of the first network device;

[0283] The third message is a third link layer broadcast message, and the payload portion of the third link layer broadcast message includes the device identifier of the second network device; or, the third message is a third IP multicast message, and the payload portion of the third IP multicast message includes the device identifier of the second network device.

[0284] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0285] FIG13 also includes a communication bus 1303. Processor 1301, machine-readable storage medium 1302, and transceiver 1304 communicate with each other via communication bus 1303. Communication bus 1303 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, and the like. Transceiver 1304 can be a wireless communication module that, under the control of processor 1301, exchanges data with other devices.

[0286] The machine-readable storage medium 1302 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the machine-readable storage medium may be at least one storage device located remotely from the processor.

[0287] Processor 1301 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.

[0288] Based on the same concept, an embodiment of the present application provides a second network device, the second network device is connected to a third network device, the second network device is connected to the first interface of the first network device, the first network device includes multiple forwarding table entries, the forwarding table entries include a destination address, an outgoing interface, and a device identifier, the device identifier is an identifier of the network device to which the host to which the destination address belongs is accessed; as shown in Figure 14, the second network device includes: a processor 1401; a transceiver 1404; a machine-readable storage medium 1402, the machine-readable storage medium 1402 storing machine-executable instructions that can be executed by the processor 1401; the machine-executable instructions prompt the processor 1401 to perform the following steps:

[0289] Acquire status information, where the status information indicates whether the second network device and the third network device are reachable.

[0290] A first message is sent to the first network device, where the first message includes a device identifier and status information of the third network device, so that when the status information indicates that the second network device and the third network device are unreachable, the first network device searches for a first forwarding table entry whose output interface is the first interface and whose device identifier is the device identifier of the third network device, and sets the status of the first forwarding table entry to an invalid state.

[0291] Optionally, the machine executable instructions further cause the processor 1401 to perform the following steps:

[0292] Before acquiring the status information, receiving a routing update message sent by the third network device, the routing update message including the first IP address of the host connected to the third network device and the device identifier of the third network device;

[0293] The routing update message is forwarded to the first network device, so that the first network device generates a first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

[0294] Optionally, the second network device includes a third interface and is connected to the third network device through the third interface; the third network device includes a fourth interface and is connected to the second network device through the fourth interface; the machine-executable instructions further cause the processor 1401 to perform the following steps:

[0295] Before acquiring the status information, sending a fourth message to the third network device, where the fourth message includes the device identifier of the second network device, so that the third network device records a third correspondence between the fourth interface and the device identifier of the second network device;

[0296] A fifth message sent by the third network device is received, where the fifth message includes the device identification of the third network device, and a fourth corresponding relationship between the third interface and the device identification of the third network device is recorded.

[0297] Optionally, the machine executable instructions further cause the processor 1401 to perform the following steps: before sending the first message to the first network device, obtain a device identifier of the third network device corresponding to the third interface from the fourth corresponding relationship.

[0298] Optionally, there are multiple links between the second network device and the third network device; the machine executable instructions further cause the processor 1401 to perform the following steps:

[0299] If multiple links fail, determining that the status information indicates that the second network device and the third network device are unreachable; or,

[0300] If any one of the multiple links is not faulty, it is determined that the state information indicates that the second network device and the third network device are reachable.

[0301] Optionally, the first message is a first link layer broadcast message, and the payload portion of the first link layer broadcast message includes the device identifier of the second network device, the device identifier and status information of the third network device; or,

[0302] The first message is a first IP multicast message, and the payload of the first IP multicast message includes the device identifier of the second network device, the device identifier and status information of the third network device.

[0303] Optionally, the fourth message is a fourth link layer broadcast message, and the payload portion of the fourth link layer broadcast message includes the device identifier of the second network device; or, the fourth message is a fourth IP multicast message, and the payload portion of the fourth IP multicast message includes the device identifier of the second network device;

[0304] The fifth message is a fifth link layer broadcast message, and the payload portion of the fifth link layer broadcast message includes the device identifier of the third network device; or, the fifth message is a fifth IP multicast message, and the payload portion of the fifth IP multicast message includes the device identifier of the third network device.

[0305] Optionally, the routing update message includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

[0306] FIG14 also includes a communication bus 1403. Processor 1401, machine-readable storage medium 1402, and transceiver 1404 communicate with each other via communication bus 1403. Communication bus 1403 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. This communication bus can be divided into an address bus, a data bus, a control bus, and the like. Transceiver 1404 can be a wireless communication module that, under the control of processor 1401, exchanges data with other devices.

[0307] The machine-readable storage medium 1402 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the machine-readable storage medium may be at least one storage device located remotely from the processor.

[0308] Processor 1401 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.

[0309] Based on the same concept, according to the link failure handling method provided in the above embodiments of the present application, the present application also provides a machine-readable storage medium, which stores machine-executable instructions that can be executed by a processor. The processor is prompted by the machine-executable instructions to implement the steps of any of the above link failure handling methods.

[0310] In another embodiment provided by the present application, a computer program product including instructions is further provided, which, when executed on a computer, enables the computer to execute the steps of any link failure handling method in the above embodiments.

[0311] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0312] Each embodiment in this specification is described in a related manner. Similar portions between the embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so their description is relatively simple. For related portions, refer to the description of the method embodiments.

[0313] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A link fault handling method, characterized in that, A forwarding chip applied to a first network device, the first network device includes a first interface and is connected to a second network device through the first interface, the second network device is connected to a third network device, the first network device includes multiple forwarding entries, and the forwarding entry includes a destination address, an output interface, and a device identifier, where the device identifier is the identifier of the network device accessed by the host to which the destination address belongs; the method includes: Receiving a first packet sent by the second network device, where the first packet includes the device identifier of the third network device and status information, and the status information is used to indicate whether the second network device and the third network device are reachable; If the status information indicates that the second network device and the third network device are not reachable, then find a first forwarding entry whose output interface is the first interface and the device identifier is the device identifier of the third network device; Set the status of the first forwarding entry to an invalid status.

2. The method according to claim 1, wherein Before receiving the first packet sent by the second network device, the method further includes: Receiving a routing update packet forwarded by the second network device through the first interface, where the routing update packet includes a first IP address of a host connected to the third network device and the device identifier of the third network device; Generating the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

3. The method according to claim 1, characterized in that, The second network device includes a second interface and is connected to the first network device through the second interface; before receiving the first packet sent by the second network device, the method further includes: Sending a second packet to the second network device, where the second packet includes the device identifier of the first network device, so that the second network device records a first correspondence between the second interface and the device identifier of the first network device; Receiving a third packet sent by the second network device, where the third packet includes the device identifier of the second network device, and recording a second correspondence between the first interface and the device identifier of the second network device.

4. The method according to any one of claims 1 to 3, characterized in that, The setting the status of the first forwarding entry to an invalid status includes: Modifying the status flag bit of the first forwarding entry to a first value, where the first value is used to indicate an invalid status.

5. The method according to claim 1, wherein After receiving the first packet sent by the second network device, the method further includes: If the status information indicates that the second network device and the third network device are reachable, then find a first forwarding entry whose output interface is the first interface and the device identifier is the device identifier of the third network device; Set the status of the first forwarding entry to a valid status.

6. The method according to claim 1, wherein The first packet is a first link-layer broadcast packet, and the payload part of the first link-layer broadcast packet includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or, The first message is a first IP multicast message, and the payload part of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

7. The method according to claim 3, wherein The second message is a second link-layer broadcast message, and the payload part of the second link-layer broadcast message includes the device identifier of the first network device; or, the second message is a second IP multicast message, and the payload part of the second IP multicast message includes the device identifier of the first network device; The third message is a third link-layer broadcast message, and the payload part of the third link-layer broadcast message includes the second network device 's device identifier; or, the third message is a third IP multicast message, and the payload part of the third IP multicast message includes the device identifier of the second network device.

8. The method according to claim 2, wherein The route update message includes an extended community attribute, and the extended community attribute includes the device identifier of the third network device.

9. A link fault handling method, characterized in that, Applied to the forwarding chip of the second network device, the second network device is connected to the third network device, the second network device connects to the first interface of the first network device, the first network device includes multiple forwarding entries, the forwarding entries include a destination address, an output interface, and a device identifier, and the device identifier is the identifier of the network device accessed by the host to which the destination address belongs; The method includes: Obtain status information, where the status information is used to indicate whether the second network device and the third network device are reachable; Send a first message to the first network device, where the first message includes the device identifier of the third network device and the status information, so that when the status information indicates that the second network device and the third network device are not reachable, the first network device finds the first forwarding entry with the output interface being the first interface and the device identifier being the device identifier of the third network device, and sets the status of the first forwarding entry to an invalid status.

10. The method according to claim 9, wherein Before the obtaining the status information, the method further includes: Receive a route update message sent by the third network device, where the route update message includes the first IP address of the host connected to the third network device and the device identifier of the third network device; Forward the route update message to the first network device, so that the first network device generates the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

11. The method according to claim 9, wherein The second network device includes a third interface and is connected to the third network device through the third interface, the third network device includes a fourth interface and is connected to the second network device through the fourth interface; before the obtaining the status information, the method further includes: Send a fourth message to the third network device, where the fourth message includes the device identifier of the second network device, so that the third network device records the third correspondence relationship between the fourth interface and the device identifier of the second network device; Receive a fifth packet sent by the third network device, where the fifth packet includes the device identifier of the third network device, and record a fourth correspondence between the third interface and the device identifier of the third network device.

12. The method according to claim 11, wherein Before sending a first packet to the first network device, the method further includes: Obtain the device identifier of the third network device corresponding to the third interface from the fourth correspondence.

13. The method according to claim 9, wherein There are multiple links between the second network device and the third network device; the obtaining of the status information includes: If all of the multiple links are faulty, determine that the status information indicates that the second network device and the third network device are unreachable; or, If any one of the multiple links is not faulty, determine that the status information indicates that the second network device and the third network device are reachable.

14. The method according to claim 9, wherein The first packet is a first link-layer broadcast packet, and the payload part of the first link-layer broadcast packet includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or, The first packet is a first IP multicast packet, and the payload part of the first IP multicast packet includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

15. The method according to claim 11, wherein The fourth packet is a fourth link-layer broadcast packet, and the payload part of the fourth link-layer broadcast packet includes the device identifier of the second network device; or the fourth packet is a fourth IP multicast packet, and the payload part of the fourth IP multicast packet includes the device identifier of the second network device; The fifth packet is a fifth link-layer broadcast packet, and the payload part of the fifth link-layer broadcast packet includes the device identifier of the third network device; or the fifth packet is a fifth IP multicast packet, and the payload part of the fifth IP multicast packet includes the device identifier of the third network device.

16. The method according to claim 10, wherein The routing update packet includes an extended community attribute, and the extended community attribute includes the device identifier of the third network device.

17. A link fault handling device, characterized in that, Applied to a forwarding chip of a first network device, the first network device includes a first interface and is connected to a second network device through the first interface, the second network device is connected to a third network device, the first network device includes multiple forwarding entries, and the forwarding entries include a destination address, an outgoing interface, and a device identifier, where the device identifier is the identifier of the network device accessed by the host to which the destination address belongs; the apparatus includes: A receiving module, configured to receive a first packet sent by the second network device, where the first packet includes the device identifier of the third network device and status information, and the status information is used to indicate whether the second network device and the third network device are reachable; A searching module, configured to, if the status information indicates that the second network device and the third network device are unreachable, search for a first forwarding entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device; A setting module, configured to set the status of the first forwarding entry to an invalid status.

18. The device according to claim 17, characterized in that, The apparatus further includes: The receiving module is further configured to, before receiving the first packet sent by the second network device, receive, through the first interface, a routing update packet forwarded by the second network device, where the routing update packet includes a first IP address of a host connected to the third network device and a device identifier of the third network device; The generating module is configured to generate the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

19. The method according to claim 17, characterized in that, The second network device includes a second interface and is connected to the first network device through the second interface; the apparatus further includes: The sending module is configured to, before receiving the first packet sent by the second network device, send a second packet to the second network device, where the second packet includes a device identifier of the first network device, so that the second network device records a first correspondence between the second interface and the device identifier of the first network device; The receiving module is further configured to receive a third packet sent by the second network device, where the third packet includes a device identifier of the second network device, and record a second correspondence between the first interface and the device identifier of the second network device.

20. The device according to any one of claims 17-19, characterized in that, The setting module is specifically configured to: Modify a status flag bit of the first forwarding entry to a first value, where the first value is used to indicate an invalid status.

21. The apparatus according to claim 17, wherein The lookup module is further configured to, after receiving the first packet sent by the second network device, if the status information indicates that the second network device and the third network device are reachable, look up a first forwarding entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device; The setting module is further configured to set the status of the first forwarding entry to an effective status.

22. The device according to claim 17, wherein The first packet is a first link-layer broadcast packet, and a payload part of the first link-layer broadcast packet includes a device identifier of the second network device, a device identifier of the third network device, and the status information; or The first packet is a first IP multicast packet, and a payload part of the first IP multicast packet includes a device identifier of the second network device, a device identifier of the third network device, and the status information.

23. The device according to claim 19, characterized in that, The second packet is a second link-layer broadcast packet, and a payload part of the second link-layer broadcast packet includes a device identifier of the first network device; or the second packet is a second IP multicast packet, and a payload part of the second IP multicast packet includes a device identifier of the first network device; The third packet is a third link-layer broadcast packet, and a payload part of the third link-layer broadcast packet includes a device identifier of the second network device; or the third packet is a third IP multicast packet, and a payload part of the third IP multicast packet includes a device identifier of the second network device.

24. The device according to claim 18, characterized in that, The routing update packet includes an extended community attribute, and the extended community attribute includes a device identifier of the third network device.

25. A link fault handling device, characterized in that, A forwarding chip applied to a second network device, where the second network device is connected to a third network device, the second network device is connected to a first interface of a first network device, the first network device includes multiple forwarding entries, the forwarding entries include a destination address, an output interface, and a device identifier, and the device identifier is an identifier of a network device to which a host corresponding to the destination address is connected; the apparatus includes: An obtaining module, configured to obtain status information, where the status information is used to indicate whether the second network device and the third network device are reachable; A sending module, configured to send a first message to the first network device, where the first message includes the device identifier of the third network device and the status information, so that when the status information indicates that the second network device and the third network device are unreachable, the first network device finds a first forwarding entry whose output interface is the first interface and whose device identifier is the device identifier of the third network device, and sets the status of the first forwarding entry to an invalid status.

26. The device according to claim 25, characterized in that The apparatus further includes: A receiving module, configured to receive a routing update message sent by the third network device before obtaining the status information, where the routing update message includes a first IP address of a host connected to the third network device and the device identifier of the third network device; The sending module is further configured to forward the routing update message to the first network device, so that the first network device generates the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

27. The device according to claim 25, characterized in that, The second network device includes a third interface and is connected to the third network device through the third interface, the third network device includes a fourth interface and is connected to the second network device through the fourth interface; the apparatus further includes: The sending module is further configured to send a fourth message to the third network device before obtaining the status information, where the fourth message includes the device identifier of the second network device, so that the third network device records a third correspondence relationship between the fourth interface and the device identifier of the second network device; The receiving module is configured to receive a fifth message sent by the third network device, where the fifth message includes the device identifier of the third network device, and record a fourth correspondence relationship between the third interface and the device identifier of the third network device.

28. The apparatus according to claim 27, wherein the obtaining module is further configured to, before sending the first message to the first network device, obtain the device identifier of the third network device corresponding to the third interface from the fourth correspondence relationship.

29. The device according to claim 25, wherein There are multiple links between the second network device and the third network device; specifically, the obtaining module is configured to: if all the multiple links are faulty, determine that the status information indicates that the second network device and the third network device are unreachable; or if any one of the multiple links is not faulty, determine that the status information indicates that the second network device and the third network device are reachable.

30. The device according to claim 25, characterized in that, The first message is a first link layer broadcast message, and the payload part of the first link layer broadcast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or, The first message is a first IP multicast message, and the payload part of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

31. The device according to claim 27, characterized in that, The fourth message is a fourth link layer broadcast message, and the payload part of the fourth link layer broadcast message includes the device identifier of the second network device; or the fourth message is a fourth IP multicast message, and the payload part of the fourth IP multicast message includes the device identifier of the second network device; The fifth message is a fifth link layer broadcast message, and the payload part of the fifth link layer broadcast message includes the device identifier of the third network device; or the fifth message is a fifth IP multicast message, and the payload part of the fifth IP multicast message includes the device identifier of the third network device.

32. The device according to claim 26, characterized in that, The routing update message includes an extended community attribute, and the extended community attribute includes the device identifier of the third network device.

33. A first network device, characterized in that, The first network device includes a first interface and is connected to the second network device through the first interface. The second network device is connected to the third network device. The first network device includes multiple forwarding table entries. The forwarding table entry includes a destination address, an outgoing interface, and a device identifier. The device identifier is the identifier of the network device accessed by the host to which the destination address belongs; The first network device includes: A processor; A transceiver; A machine-readable storage medium storing machine-executable instructions executable by the processor; The machine-executable instructions cause the processor to perform the following steps: Receive a first message sent by the second network device. The first message includes the device identifier of the third network device and status information, and the status information is used to indicate whether the second network device and the third network device are reachable; If the status information indicates that the second network device and the third network device are not reachable, find a first forwarding table entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device; Set the status of the first forwarding table entry to an invalid status.

34. The first network device according to claim 33, wherein The machine-executable instructions further cause the processor to perform the following steps: Before receiving the first message sent by the second network device, receive a routing update message forwarded by the second network device through the first interface. The routing update message includes the first IP address of the host connected to the third network device and the device identifier of the third network device; Generate the first forwarding table entry based on the first interface, the first IP address, and the device identifier of the third network device.

35. The first network device according to claim 33, wherein The second network device includes a second interface and is connected to the first network device through the second interface; The machine-executable instructions further cause the processor to perform the following steps: Before receiving the first packet sent by the second network device, send a second packet to the second network device, where the second packet includes the device identifier of the first network device, so that the second network device records a first correspondence between the second interface and the device identifier of the first network device; Receive a third packet sent by the second network device, where the third packet includes the device identifier of the second network device, and record a second correspondence between the first interface and the device identifier of the second network device.

36. The first network device according to any one of claims 33-35, characterized in that, The machine-executable instructions further cause the processor to perform the following steps: Modify the status flag bit of the first forwarding entry to a first value, where the first value is used to indicate an invalid status.

37. The first network device according to claim 33, characterized in that, The machine-executable instructions further cause the processor to perform the following steps: After receiving the first packet sent by the second network device, if the status information indicates that the second network device and the third network device are reachable, find a first forwarding entry whose outgoing interface is the first interface and whose device identifier is the device identifier of the third network device; Set the status of the first forwarding entry to an effective status.

38. The first network device according to claim 33, wherein The first packet is a first link-layer broadcast packet, and the payload part of the first link-layer broadcast packet includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or, The first packet is a first IP multicast packet, and the payload part of the first IP multicast packet includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

39. The first network device according to claim 35, characterized in that, The second packet is a second link-layer broadcast packet, and the payload part of the second link-layer broadcast packet includes the device identifier of the first network device; or, the second packet is a second IP multicast packet, and the payload part of the second IP multicast packet includes the device identifier of the first network device; The third packet is a third link-layer broadcast packet, and the payload part of the third link-layer broadcast packet includes the device identifier of the second network device; or, the third packet is a third IP multicast packet, and the payload part of the third IP multicast packet includes the device identifier of the second network device.

40. The first network device according to claim 34, characterized in that, The routing update packet includes an extended community attribute, and the extended community attribute includes the device identifier of the third network device.

41. A second network device, characterized in that, The second network device is connected to a third network device, the second network device is connected to a first interface of the first network device, the first network device includes multiple forwarding entries, the forwarding entry includes a destination address, an outgoing interface, and a device identifier, and the device identifier is the identifier of the network device accessed by the host to which the destination address belongs; the second network device includes: A processor; A transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions cause the processor to perform the following steps: Obtain status information, where the status information is used to indicate whether the second network device and the third network device are reachable; Send a first message to the first network device, where the first message includes the device identifier of the third network device and the status information, so that when the status information indicates that the second network device and the third network device are unreachable, the first network device finds a first forwarding entry with the interface being the first interface and the device identifier being the device identifier of the third network device, and sets the status of the first forwarding entry to an invalid status.

42. The second network device according to claim 41, wherein The machine-executable instructions further cause the processor to perform the following steps: Before obtaining the status information, receive a routing update message sent by the third network device, where the routing update message includes a first IP address of a host connected to the third network device and the device identifier of the third network device; Forward the routing update message to the first network device, so that the first network device generates the first forwarding entry based on the first interface, the first IP address, and the device identifier of the third network device.

43. The second network device according to claim 41, characterized in that, The second network device includes a third interface and is connected to the third network device through the third interface. The third network device includes a fourth interface and is connected to the second network device through the fourth interface. The machine-executable instructions further cause the processor to perform the following steps: Before obtaining the status information, send a fourth message to the third network device, where the fourth message includes the device identifier of the second network device, so that the third network device records a third correspondence between the fourth interface and the device identifier of the second network device; Receive a fifth message sent by the third network device, where the fifth message includes the device identifier of the third network device, and record a fourth correspondence between the third interface and the device identifier of the third network device.

44. The second network device according to claim 43, wherein The machine-executable instructions further cause the processor to perform the following steps: Before sending the first message to the first network device, obtain the device identifier of the third network device corresponding to the third interface from the fourth correspondence.

45. The second network device according to claim 41, wherein There are multiple links between the second network device and the third network device; the machine-executable instructions further cause the processor to perform the following steps: If all of the multiple links are faulty, determine that the status information indicates that the second network device and the third network device are unreachable; or, If any one of the multiple links is not faulty, determine that the status information indicates that the second network device and the third network device are reachable.

46. The second network device according to claim 41, characterized in that, The first message is a first link-layer broadcast message, and the payload part of the first link-layer broadcast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information; or, The first message is a first IP multicast message, and the payload part of the first IP multicast message includes the device identifier of the second network device, the device identifier of the third network device, and the status information.

47. The second network device according to claim 43, wherein The fourth message is a fourth link layer broadcast message, and the payload part of the fourth link layer broadcast message includes the device identifier of the second network device; or, the fourth message is a fourth IP multicast message, and the payload part of the fourth IP multicast message includes the device identifier of the second network device; The fifth message is a fifth link layer broadcast message, and the payload part of the fifth link layer broadcast message includes the third network device 's device identifier; or, the fifth message is a fifth IP multicast message, and the payload part of the fifth IP multicast message includes the device identifier of the third network device.

48. The second network device according to claim 42, wherein The route update message includes an extended community attribute, and the extended community attribute includes the device identifier of the third network device.

49. A machine-readable storage medium, characterized in that, Stored with machine-executable instructions, when called and executed by a processor, the machine-executable instructions cause the processor to: implement the method according to any one of claims 1-8 or 9-16.

50. A computer program product, characterized in that, The computer program product causes the processor to: implement the method according to any one of claims 1-8 or 9-16.

Citation Information

Patent Citations

  • Method of link linkage and communication equipment thereof

    CN101001205A

  • Multicast data message forwarding method and device

    CN108600074A

  • Path forwarding table updating method, network transmission path switching method and device

    CN112787939A

  • System, device, and method for bypassing network changes in a routed communication network

    US20020004843A1