PACKAGE DELIVERY METHOD, DEVICE AND SYSTEM

MX433955BActive Publication Date: 2026-05-19HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
MX · MX
Patent Type
Patents
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2022-08-19
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Network congestion and resource wastage occur due to packet forwarding loops when backup paths are used in network scenarios, particularly at network devices connected to access and backbone networks, leading to inefficient use of network resources.

Method used

A packet forwarding method that includes adding an indication identifier to packets to prevent the use of backup paths, ensuring packets are only forwarded via primary paths when reachable, thereby avoiding loops and reducing congestion.

Benefits of technology

This approach effectively prevents packet forwarding loops, minimizing network resource waste and congestion by ensuring packets are sent only through available primary paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure MX433955B0
    Figure MX433955B0
Patent Text Reader

Abstract

The modalities of this request reveal a packet forwarding method, device, and system, such that a specified network device does not use a backup forwarding path to forward a packet, thereby reducing, to some extent, a technical problem such as network resource waste or network congestion caused by a loop problem.The method includes: A first network device obtains a first packet destined for a destination device; the first network device adds a first indication identifier to the first packet to generate a second packet, where the first indication identifier is used to instruct a second network device to avoid using a backup forwarding path from the second network device to the destination device to send the second packet to the destination device; and the first network device sends the second packet to the second network device using a first forwarding path.
Need to check novelty before this filing date? Find Prior Art

Description

This application claims priority to Chinese Patent Application No. 202010106211.9, filed with the National Intellectual Property Administration of China on February 21, 2020, entitled ENTRY GENERATING METHOD, NETWORK NODE AND SYSTEM, Chinese Patent Application No. 202010295809.7, filed with the National Intellectual Property Administration of China on April 15, 2020, entitled PACKET FORWARDING METHOD, NETWORK NODE AND SYSTEM, Chinese Patent Application No. 202010478986.9, filed with the National Intellectual Property Administration of China on May 29, 2020, entitled PARCEL FORWARDING METHOD, DEVICE, AND SYSTEM, and Chinese patent application ηθ202010711897.4, filed with the National Intellectual Property Administration of China on July 22, 2020, entitled FORWARDING ENTRY GENERATION METHOD, PACKET FORWARDING METHOD, NETWORK DEVICE AND SYSTEM, which are incorporated herein by reference in their entirety. FIELD OF INVENTION This application relates to the field of communications and, in particular, to a packet sending method, a device and a system. BACKGROUND OF THE INVENTION To improve network transmission reliability, in some network scenarios, a network device forwards a packet using a primary forwarding path and a backup forwarding path. If the primary forwarding path is normal, the packet is forwarded using the primary forwarding path. If the primary forwarding path is faulty, the packet is forwarded using the backup forwarding path. However, in some scenarios, forwarding a packet using the backup forwarding path causes a waste of network resources or network congestion. For example, in some network scenarios, forwarding a packet using the backup forwarding path may cause a packet forwarding loop problem, resulting in network congestion or a waste of network bandwidth resources. For example, see FIGURE 1. A primary forwarding path between a network device 101 and a network device 102 is a direct link between the network device 101 and the network device 102, and a backup forwarding path between the network device 101 and the network device 102 passes through a network device 103, i.e., the backup forwarding path is network device 101->network device 103->network device 102. When the primary forwarding path from the network device 101 to the network device 102 is faulty, a loop problem may occur when the network device 101 is faulty. ML / ZO IOZ network device 101 forwards a packet to network device 102 via network device 103 on the backup forwarding path. The loopback problem means that after network device 103 receives the packet from network device 101, network device 103 returns the packet to network device 101 for some reasons instead of sending the packet to network device 102. A loopback problem is more likely to occur when some network devices at special locations in a network, for example, network devices connected to an access network and a backbone network, use the backup forwarding path to forward a packet. Therefore, how to avoid network resource waste or network congestion caused by the loop problem is a technical problem that currently needs to be solved. BRIEF DESCRIPTION OF THE INVENTION The embodiments of this application provide a method of forwarding packets such that a specified network device does not use a backup forwarding path to forward a packet, thereby reducing, to a certain extent, a technical problem such as waste of network resources or network congestion caused by a loop problem. According to a first aspect, a packet forwarding method is provided. The method may be applied to a first network device, and specifically includes the following steps: obtaining a first packet to a destination device, adding a first indication identifier to the first packet to generate a second packet, and sending the second packet to a second network device using a first forwarding path. The first indication identifier is used to instruct the second network device to avoid using a backup forwarding path from the second network device to the destination device in order to send the second packet to the destination device. That is, if the second network device determines that the second packet cannot be sent using a primary forwarding path to the destination device, the second packet may be discarded.In this way, after the second network device receives the second packet, when the primary forwarding path from the second network device to the destination device is unreachable, the second network device, based on the first indication identifier, avoids using the backup forwarding path to the destination device to send the second packet to the destination device. This reduces the waste of network resources and network congestion caused by a loop problem. In a possible design, the first forwarding path is a backup forwarding path from the first network device to the destination device, and before the first network device sends the second packet to the second network device using a first forwarding path, the method further includes: The first network device ML / ZO IOZ determines that a second forwarding path to the destination device is unreachable. The second forwarding path is a primary forwarding path from the first network device to the destination device. That is, when the primary forwarding path from the first network device to the destination device is unreachable, the backup forwarding path is used to forward the second packet, and the first indication identifier is added to the first packet, so that a flexible manner of packet forwarding can be implemented. That is, when a first network node has forwarded a packet using the backup forwarding path from the first network device to the destination network device, it is necessary to prevent the second network device from using the backup forwarding path from the second network device to the destination network device to forward the packet.Indeed, the first forwarding path may alternatively be the primary forwarding path from the first network device to the destination device. In one possible design scenario, in some scenarios such as segment routing (SR) over Internet Protocol version 6 (IPv6) (SRv6 for short below), the first packet includes an Internet Protocol (IP) address of the destination device, and the IP address of the destination device can be thought of as an identifier of the destination device. The first forwarding path is a forwarding path corresponding to a summary route from the first network device to the destination device, and the second forwarding path is a forwarding path corresponding to a specific route from the first network device to the destination device.There are the following two possible implementations in which the first network device determines that the second forwarding path to the destination device is unreachable: The first network device does not obtain, by matching based on the IP address of the destination device, the specific route to the destination device; or the first network device obtains, by matching based on the IP address of the destination device, the specific route to the destination device, and determines that the forwarding path corresponding to the specific route is unreachable. In a possible design, the first forwarding path is a backup path of the specific route to the destination device, and the first network device determining that a second forwarding path to the destination device is unreachable includes: The first network device obtaining, through matching based on the IP address of the destination device, the specific path to the destination device, and determining that a primary forwarding path of the specific route is unreachable. In a possible design, the first forwarding path is a forwarding path ML / ZO IOZ primary of the summary route to the destination device, and the first network device determines that a second forwarding path to the destination device is unreachable includes: The first network device obtains, through matching based on the IP address of the destination device, the summary route to the destination device, and determines that a primary forwarding path of the summary route is unreachable. The three possible implementations above do not constitute a limitation of the technical solutions of this application, and experts in the field can design the technical solutions based on a real case. In one possible design, the first network device adds a first indication identifier to the first packet to generate a second packet. The first network device adds a segment router header (SRH) to the first packet to generate the second packet. The first indication identifier is carried in the SRH. In one possible design, the first indication identifier is carried in a Flags field, a TAG field, or a type length value (TLV) of the SRH. Optionally, the SRH includes a list of segment identifiers, and the list of segment identifiers includes the first indication identifier. The list of segment identifiers includes a segment identifier of the second network device, and the segment identifier of the second network device includes the first indication identifier. Specifically, a locator portion of the segment identifier of the second network device includes the first indication identifier, or a function portion of the segment identifier of the second network device includes the first indication identifier. The locator portion including the first indication identifier may specifically be all or some bytes of the locator portion being the first indication identifier.Optionally, the first indication identifier is the segment identifier of the second network device, that is, the segment identifier of the second network device has an indication function indicated by the first indication identifier. In some other scenarios (e.g., an SR-MPLS scenario), the first packet includes a label of the destination device, and the label of the destination device can be considered as an identifier of the destination device. The first forwarding path is a forwarding path corresponding to the backup forwarding information in a label forwarding entry corresponding to the label of the destination device, that is, the first forwarding path is the backup forwarding path from the first network device to the destination device. Let the first network device determine ML / ZO IOZ that a second forwarding path to the destination device is unreachable includes: The first network device obtains the label forwarding entry through matching based on the label of the destination device, and determines that a forwarding path corresponding to the primary forwarding information in the label forwarding entry is unreachable. The forwarding path corresponding to the primary forwarding information can be regarded as the primary forwarding path from the first network device to the destination device. That is, if the forwarding path corresponding to the primary forwarding information from the first network device to the destination device is unreachable, the second packet may be forwarded using the backup forwarding path from the first network device to the destination device, to ensure the reliability of the transmission of the second packet. In one possible design, the forwarding entry may further include the first indication identifier and / or a second indication identifier. In one possible design, the first network device adds a first indication identifier to the first packet to generate a second packet, including: The first network device adds a label stack to the first packet to generate the second packet. The label stack includes the first indication identifier. There may be two possible implementations: In one possible implementation, the label stack includes a label of the second network device, a special label, and the label of the destination device, the label of the second network device being adjacent to the special label, and the special label including the first indication identifier, i.e., the special label may have an indication function of the first indication identifier. In another possible implementation, the label stack includes a label of the second network device and the label of the destination device, and the label of the second network device is the first indication identifier, i.e., the label of the second network device has the indication function of the first indication identifier. Certainly, the two possible implementations above do not constitute a limitation of the technical solutions of this application, and experts in the field can design the technical solutions based on a real case. In one possible design, before the first network device sends the second packet to the second network device using a first forwarding path, the method further includes: The first network device receives a third packet from the second network device. The third packet includes the identifier of the second network device and the second indication identifier, and the second indication identifier is used to identify that the second network device supports a capability to avoid using a backup path to forward a packet. Upon receiving the third packet, the first network device ML / ZO IOZ may add the first indication identifier to the first packet based on the second indication identifier to obtain the second packet. This reduces waste of network resources and network congestion. Before receiving the first packet, the first network device further generates, based on the identifier of the second network device and the second indication identifier, a forwarding entry corresponding to the first forwarding path. The forwarding entry corresponding to the first forwarding path includes the identifier of the destination device and forwarding information corresponding to the first forwarding path.In this way, after receiving the first packet, the first network device may look up the forwarding entry based on the destination device identifier included in the first packet, to obtain the forwarding information of the first forwarding path, and send the second packet to the second network device using the first forwarding path, to forward the second packet. In some scenarios (e.g., the SRv6 scenario), the forwarding information includes a segment identifier list, the segment identifier list includes the identifier of the second network device, the identifier of the second network device includes the segment identifier of the second network device, and the destination device identifier includes the IP address of the destination device.In some other scenarios (e.g., the SR-MPLS scenario), the forwarding information includes the label of the second network device, and the destination device identifier includes the label of the destination device. In one possible design, the second indication identifier may alternatively be the identifier of the second network device or the label of the second network device. In this case, the identifier of the second network device or the label of the second network device serves as an indication of the second indication identifier. In one possible design, the third packet includes an Endpoint Segment Identifier (End SID) TLV field, and the Endpoint SID TLV includes the second indication identifier. For example, the third packet might be an IPv6 Intermediate System-to-Intermediate System (ISIS) packet or an Open Shortest Path First (OSPF) version 3 (v3) packet. When the second network device identifier does not serve as the indication of the second indication identifier, the Endpoint SID TLV also includes the second network device identifier. In one possible design, the third packet includes a prefix segment identifier (prefix SID) length value TLV field, and the prefix SID TLV field includes the second indication identifier. The third packet could be, for example, an ISIS packet or an OSPF packet. When the label of the second network device does not ML / ZO IOZ has the function of indicating the second indication identifier, the endpoint SID TLV also includes the label of the second network device. In one possible design, the backup forwarding path passes through the first network device. This can avoid resource waste caused by a loopback problem. In one possible design, the first packet originates from a third network device, the third network device belongs to a first network domain, and the destination device belongs to a second network domain. In other words, the method can be applied to a cross-domain scenario. In one possible design, the first network domain is an area of ​​a backbone network, the second network domain is an area of ​​an access network, the first network device is a network device connected to the access network and the backbone network, and the first forwarding path is a forwarding path in the backbone network. According to a second aspect, a packet forwarding method is provided. The method is applied to a second network device, and specifically includes the following steps: receiving a first packet destined for a destination device. The first packet is from a first network device, and the first packet includes a first indication identifier. The second network device determines that a primary forwarding path from the second network device to the destination device is unreachable. In response to determining that the primary forwarding path is unreachable, the second network device, based on an indication of the first indication identifier, avoids using a backup forwarding path to send the first packet to the destination device, to reduce a waste of resources or a network congestion problem caused by forwarding using a backup path.That the second network device avoids using the backup forwarding path to send a packet can be understood as the second network device not using the backup forwarding path to send a packet. In one possible design, in some scenarios (for example, the SRv6 scenario), the second network device may determine, in the following three possible implementations, that the primary forwarding path from the second network device to the destination device is unreachable. In one possible implementation, the first packet includes an IP address of the destination device, the primary forwarding path is a primary forwarding path of a summary route from the second network device to the destination device, and the backup forwarding path is a backup forwarding path of the summary route. The second network device determines that a primary forwarding path ML / ZO IOZ from the second network device to the destination device is unreachable includes: The second network device obtains the summary route through matching based on the IP address of the destination device, and determines that the primary forwarding path of the summary route is unreachable. In another possible implementation, the first packet includes an IP address of the destination device. The primary forwarding path is a forwarding path corresponding to a specific route from the second network device to the destination device. The backup forwarding path is a forwarding path corresponding to the summary route from the second network device to the destination device.The second network device determining that a primary forwarding path from the second network device to the destination device is unreachable includes: The second network device fails to obtain the specific route through matching based on the IP address of the destination device; or the second network device obtains the specific route through matching based on the IP address of the destination device and determines that the forwarding path corresponding to the specific route is unreachable. The two possible implementations above do not constitute a limitation of the technical solutions of this application, and experts in the field can design the technical solutions based on a real case. In one possible design, the first packet is an SRv6 packet, and an SRH of the SRv6 packet includes the first indication identifier. The first indication identifier may be carried in an indicator field, a TAG field, or a TLV field of the SRH. Alternatively, the SRH may include a list of segment identifiers, and the list of segment identifiers includes the first indication identifier. When the first packet is the SRv6 packet, in a possible design, before the second network device determines that a primary forwarding path to the destination device is unreachable, the method further includes: The second network device determining that a destination address of the SRv6 packet is an IP address of the second network device; the second network device obtaining an identifier of the destination device from the segment identifier list of the SRv6 packet; and the second network device modifying the destination address of the SRv6 packet with the identifier of the destination device. Correspondingly, the second network device determining that a primary forwarding path to the destination device is unreachable includes: The second network device determining, based on the destination address of the SRv6 packet, i.e., the identifier of the destination device, that the primary forwarding path to the destination device is unreachable. ΜΛ / ZO IOZ target device is unreachable. Alternatively, the first packet may be a Multi-Protocol Label Switching (MPLS) packet. Consequently, a label stack in the first packet includes the first indication identifier. When the first packet is an MPLS packet, the first packet includes a label of the destination device, the label stack includes a label of the second network device, a special label, and the label of the destination device, and the special label includes the first indication identifier, that is, the special label has a function of the first indication identifier. Alternatively, the label stack includes a label of the second network device and a label of the destination device, and the label of the second network device includes the first indication identifier, that is, the label of the second network device has a function of the first indication identifier. When the first packet includes the label stack, in a possible design, the second network device determining that a primary forwarding path from the second network device to the destination device is unreachable includes: The second network device determining that a top label of the label stack is the label of the second network device; and in response to determining that the top label of the label stack is the label of the second network device, obtaining, through matching based on the label of the destination device, a label forwarding table to the destination device, and determining that the primary forwarding path corresponding to the primary forwarding information in the label forwarding table is unreachable. When the first packet includes the label stack, in a possible design, the second network device avoids, based on an indication of the first indication identifier, using a backup forwarding path to send the first packet to the destination device includes: The second network device determines that a next-layer label of the label of the second network device in the label stack is the special label; and in response to determining that the next-layer label of the label of the second network device in the label stack is the special label, avoids using the backup forwarding path corresponding to the backup forwarding information in the label forwarding table to send the first packet to the destination device.Indeed, in some embodiments, the special label may alternatively be located at the top of the label stack, and the second network device label may be located on a subsequent layer of the special label. In one possible design, the backup forwarding path passes through the first network device. Using the above method, a loop can be avoided. ML / ZO IOZ when the first packet is forwarded to the first network device, and resource waste and network congestion caused by a loop problem can be reduced. In one possible embodiment, the method further includes: the second network device sending a second packet to the first network device. The second packet includes an identifier of the second network device and a second indication identifier, the second indication identifier being used to indicate that the second network device supports a capability to avoid using a backup path to forward a packet, and the identifier of the second network device includes an IP address of the second network device or a label of the second network device. The second network device sends the second packet to the first network device such that the first network device knows that the second network device has the capability to avoid using the backup path to forward a packet.Thus, when sending the first packet to the second network device, the first network device may add the first indication identifier to the first packet, to indicate to the second network device to avoid using the backup path to forward the first packet. In one possible embodiment, after the second network device avoids, based on an indication of the first indication identifier, using a backup forwarding path to send the first packet to the destination device, the method further includes: The second network device discards the first packet. The first packet is discarded to avoid using the backup forwarding path to send the first packet to the destination device. According to a third aspect, a method for generating forwarding entries is provided. The method may be applied to a first network device, and specifically includes the following steps: The first network device receives an advertisement packet from a second network device, where the advertisement packet includes a first indication identifier; and the first network device determines, based on the first indication identifier, that the second network device has the ability to avoid using a backup path to forward a packet. In response to determining that the second network device has the ability to avoid using a backup path to forward a packet, the first network device generates backup forwarding information used to forward a packet to a destination device.A forwarding path corresponding to the backup forwarding information passes through the second network device. The replacement forwarding information includes a label stack or a segment identifier list, and the label stack or segment identifier list includes an identifier of the second network device. Based on a forwarding entry, when the first network device receives a first. ML / ZO IOZ packet to the destination device, the first network device may determine, based on the forwarding entry, whether a forwarding path corresponding to the primary forwarding information is reachable. If the forwarding path is reachable, the first network device forwards the first packet to the destination device using the forwarding path corresponding to the primary forwarding information. If the forwarding path is unreachable, the first network device adds a second indication identifier to the first packet to generate a second packet. The second indication identifier is used to instruct the second network device to avoid using a backup forwarding path from the second network device to the destination device to send the second packet to the destination device.In this way, after the second network device receives the second packet, if a primary forwarding path from the second network device to the destination network device is unreachable, the backup forwarding path is prevented from being used to send the second packet to the destination device. This can reduce the problem of resource waste or network congestion caused by forwarding using the backup path. In one possible design, the first indication identifier is included in the forwarding entry, so that the first network device can add the second indication identifier to the first packet. In one possible design, the second packet further includes the label stack or segment identifier list, and the label stack or segment identifier list may include a label or a segment identifier of the second network device, such that the first network device may send a packet to the second network device based on the label or segment identifier of the second network device. According to a fourth aspect, a method for generating forwarding entries is provided. The method may be applied to a second network device, and the method specifically includes the following steps: generating an advertisement packet. The packet includes a first indication identifier, and the first indication identifier is used to indicate that the second network device has the ability to avoid using a backup forwarding path to forward a packet. The second network device sends the advertisement packet to a first network device to generate a forwarding entry. A forwarding path corresponding to the forwarding entry passes through the second network device. In other words, the first network device may send a packet to the second network device based on the forwarding entry.By forwarding the packet, the second network device does not use the backup forwarding path to forward the packet. This reduces resource waste and network congestion. Ml / Zo Ioz According to a fifth aspect, a packet forwarding method is provided. The method is applied to a first network device, and the method includes: The first network device receives an advertisement packet sent by a second network device. The advertisement packet includes an identifier of the second network device. The first network device generates a forwarding entry used to forward a packet to a destination device. The forwarding entry includes primary forwarding information and backup forwarding information, a forwarding path corresponding to the primary forwarding information is in a first network domain, and a forwarding path corresponding to the backup forwarding information passes through the second network device.A path from the first network device to the second network device on the forwarding path corresponding to the backup forwarding information is in a second network domain. The first network domain is different from the second network domain, and the replacement forwarding information includes the identifier of the second network device. That is, the forwarding path corresponding to the primary forwarding information and the forwarding path corresponding to the backup forwarding information to the destination device pass through different network domains. This can reduce the occupation of network resources of the first network domain in which the forwarding path corresponding to the primary forwarding information is located. In some scenarios (for example, an SRv6 scenario), the backup forwarding information includes a segment identifier list, the segment identifier list includes the identifier of the second network device, and the identifier of the second network device includes a segment identifier of the second network device. In some other scenarios (for example, an SR-MPLS scenario), the backup forwarding information includes a label stack, the label stack or segment identifier list includes the identifier of the second network device, and the identifier of the second network device includes a label of the second network device. In one possible design, the advertisement packet further includes a second indication identifier, and the second indication identifier indicates that the second network device has the ability to avoid using a backup path to forward a packet. In a possible design, the method further includes: the first network device obtaining a first packet toward the destination device; the first network device determining that the forwarding path corresponding to the primary forwarding information is unreachable; and in response to determining that the forwarding path corresponding to the primary forwarding information is unreachable, the first network device adding a first indication identifier to the first packet to generate a second packet, and forwarding the first packet. ML / t / ZUZZ / UZO IOZ second packet using the backup forwarding information. The first indication identifier is used to instruct the second network device to avoid using a backup forwarding path from the second network device to the destination device in order to send the second packet to the destination device. According to a sixth aspect, a first network device is provided, and is configured to perform the method according to any of the first aspects and possible designs of the first aspect. Specifically, the first network device includes units configured to perform the method according to any of the first aspects and possible designs of the first aspect; or the first network device includes units configured to perform the method according to any of the third aspects and possible designs of the third aspect. The first network device includes units configured to perform the method according to any of the fifth aspect and possible designs of the fifth aspect. According to a seventh aspect, a second network device is provided, and is configured to perform the method according to any of the second aspects and possible designs of the second aspect. Specifically, the second network device includes units configured to perform the method according to any of the second aspects and possible designs of the second aspect; or the second network device includes units configured to perform the method according to any of the fourth aspects and possible designs of the fourth aspect. According to an eighth aspect, a network device is provided that is applicable to a network system including a plurality of network devices. The plurality of network devices includes a first network device and a second network device, the network device being the first network device, and the first network device including a processor and a network interface. The network interface is configured to receive and send a packet. The processor is configured to perform the method according to any of the aspects of the first aspect and the possible designs of the first aspect; or the processor is configured to perform the method according to any of the aspects of the third aspect and the possible designs of the third aspect; or the processor is configured to perform the method according to any of the aspects of the fifth aspect and the possible designs of the fifth aspect. In one possible design, the first network device further includes a memory, and the memory may be configured to store instructions or program code. The processor is configured to invoke the instructions or program code in the memory to perform the method according to any of the first aspects and possible designs of the first aspect; or the processor is configured to invoke the instructions or program code in the memory to perform the method according to any of the first aspects and possible designs of the first aspect. ML / ZO IOZ instructions or program code in memory for performing the method according to any of the third aspects and possible designs of the third aspect; or the processor is configured to invoke the instructions or program code in memory for performing the method according to any of the fifth aspects and possible designs of the fifth aspect. According to a ninth aspect, a network device is provided that is applicable to a network system including a plurality of network devices. The plurality of network devices includes a first network device and a second network device, the network device being the second network device, and the second network device including a processor and a network interface. The network interface is configured to receive and send a packet. The processor is configured to perform the method according to any of the second aspects and possible designs of the second aspect; or the processor is configured to perform the method according to any of the fourth aspects and possible designs of the fourth aspect. In one possible embodiment, the second network device further includes a memory, and the memory may be configured to store instructions or program code. The processor is configured to invoke the instructions or program code in the memory to perform the method according to any of the second aspects and possible embodiments of the second aspect; or the processor is configured to invoke the instructions or program code in the memory to perform the method according to any of the fourth aspects and possible embodiments of the fourth aspect. According to a tenth aspect, a packet processing system is provided. The system includes the first network device and the second network device according to the preceding aspects. According to an eleventh aspect, a computer-readable storage medium is provided that includes instructions, a program, or code. When the instructions, program, or code are executed on a computer, the computer is enabled to perform the methods in accordance with the preceding aspects. According to a twelfth aspect, a computer program product is provided that includes computer instructions. When the computer program product is executed on a network device, the network device is enabled to perform the method according to any of the first aspect, the second aspect, the third aspect, the fourth aspect, the fifth aspect, and possible implementations of the preceding five aspects. According to a thirteenth aspect, there is provided a chip including a memory and a processor. The memory is configured to store instructions or Ml / ZO IOZ program code. The processor is configured to invoke the instructions or program code from memory and execute the instructions or program code, to perform the method according to any of the first aspects and possible designs of the first aspect; or the processor performs the method according to any of the second aspects and possible designs of the second aspect; or the processor executes the method according to any of the aspects of the third aspect and possible designs of the third aspect; or the processor performs the method according to any of the aspects of the fourth aspect and possible designs of the fourth aspect; or the processor performs the method according to any of the aspects of the fifth aspect and possible designs of the fifth aspect. In one possible design, the chip includes only a processor. The processor is configured to read and execute instructions or program code stored in memory. When the instructions or program code are executed, the processor performs the method according to any of the first aspects and possible designs of the first aspect; or the processor performs the method according to any of the second aspects and possible designs of the second aspect; or the processor performs the method according to any of the third aspects and possible designs of the third aspect; or the processor performs the method according to any of the fourth aspects and possible designs of the fourth aspect; or the processor performs the method according to any of the fifth aspects and possible designs of the fifth aspect. BRIEF DESCRIPTION OF THE DRAWINGS FIGURE 1 is a schematic diagram of a network architecture in conventional technology. FIGURE 2 is a schematic diagram of a network architecture applied to an SRv6 scenario in accordance with one embodiment of this application. FIGURE 3 is a schematic diagram of a network architecture applied to an SR-MPLS application scenario in accordance with an embodiment of this application. FIGURE 4 is a schematic diagram of a structure of a network architecture 500 according to an embodiment of this application. FIGURE 5 is a flow diagram of a packet forwarding method according to one embodiment of this application. FIGURE 6 is a schematic diagram of a format of an endpoint SID TLV field in an ISIS IPv6 packet according to an embodiment of this application. FIGURE 7 is a schematic diagram of a format of an Endpoint SID TLV field in an OSPFv3 packet according to an embodiment of this request. FIGURE 8 is a schematic diagram of a SID TLV field format. ΜΛ / ZO IOZ prefix included in an ISIS package according to a modality of this application. FIGURE 9 is a schematic diagram of a format of a Prefix SID TLV field included in an OSPF packet according to an embodiment of this request. FIGURE 10 is a schematic diagram of a format of an SRH of an SRv6 packet according to an embodiment of this application. FIGURE 11 is a schematic diagram of a format of an implementation (a) of a derivation SID in an SRv6 scenario according to an embodiment of this application. FIGURE 12 is a schematic diagram of a format of an implementation (c) of a derivation SID in an SRv6 scenario according to an embodiment of this application. FIGURE 13 is a schematic diagram of a format of a newly added TLV field of an M3 SRH packet in an SRv6 scenario according to an embodiment of this application. FIGURE 14(a) is a schematic diagram of a tag stack according to one embodiment of this application. FIGURE 14(b) is a schematic diagram of another tag stack according to an embodiment of this application. FIGURE 15A, FIGURE 15B, and FIGURE 15C are a flow diagram of a packet forwarding method in a network architecture shown in FIGURE 16(a) and FIGURE 16(b) in accordance with an embodiment of this application. FIGURE 16(a) is a schematic diagram of the network architecture in an SRv6 scenario according to one embodiment of this application. FIGURE 16(b) is a schematic diagram of the network architecture in another SRv6 scenario according to an embodiment of this application. FIGURE 17A and FIGURE 17B are a flow diagram of a packet forwarding method in a network architecture shown in FIGURE 18 in accordance with an embodiment of this application. FIGURE 18 is a schematic diagram of the network architecture in an SR-MPLS scenario according to an embodiment of this application. FIGURE 19 is a schematic diagram of a cross-domain network architecture in accordance with one embodiment of this application. FIGURE 20A and FIGURE 20B are a flow diagram of a packet forwarding method in the network architecture shown in FIGURE 19 according to an embodiment of this application. FIGURE 21 is a schematic diagram of a network device structure. Ml / Zo Ioz 2100 in accordance with a modality of this request. FIGURE 22 is a schematic diagram of a structure of a network device 2200 according to an embodiment of this application. FIGURE 23 is a schematic diagram of a structure of a packet forwarding system 2300 according to an embodiment of this application. FIGURE 24 is a schematic diagram of the structure of a device 2400 according to an embodiment of this application; and FIGURE 25 is a schematic diagram of the structure of a device 2500 according to an embodiment of this application. DETAILED DESCRIPTION OF THE INVENTION Before describing the specific technical solutions, the key terms of the modalities of this request are first described. A specific route is a route that identifies an IP address of a network device or an address of a network segment to which that network device belongs. Specifically, the specific route includes the IP address and a mask of the network device or the address and a mask of the network segment to which the IP address belongs. For example, if an IP address of a network device is A2:2::2 / 128, a specific route corresponding to this IP address can be a route corresponding to A2:2::2 / 128 or a route corresponding to A2:2:: / 96. The address A2:2:: / 96 is an address of a network segment to which the address A2:2::2 / 128 belongs. A summary route is a route obtained by summarizing a plurality of specific routes that can be aggregated. For example, a network device stores a route A1:8:: / 96 to a network device whose destination address is A1:8:: / 96 and a route A1:9:: / 96 to a network device whose destination address is A1:9:: / 96, and the network device can aggregate the two routes to obtain an aggregate route A1:: / 84. The network device can then advertise only the summarized route to other network devices, thereby saving storage resources of the other network devices. The modalities of this application are described below with reference to the accompanying drawings. Traditionally, packet forwarding can cause a technical problem of network resource waste or network congestion. The technical problem is described in detail below, referring to several possible scenarios using an example in which a loop occurs during packet forwarding, causing network resource waste or network congestion. Scenario 1 Ml / Zo Ioz In a medium- to large-sized network, a network device requires a large amount of memory resources to store a large routing table, and transmitting and processing a large amount of routing information consumes a large amount of network resources. To solve this problem, an Interior Gateway Protocol (IGP) and a Border Gateway Protocol (BGP) provide route summarization functionality. Route summarization is also known as route aggregation, which indicates that a network device summarizes multiple different subnetwork routes belonging to the same network segment into a summary route. The network device advertises the summary route to a neighboring network device of the network device, and does not advertise the multiple different subnetwork routes corresponding to the summary route. This reduces the number of forwarding entries in a routing table of the neighboring network device and the occupation of system resources. Additionally, if a subnetwork route among the summarized subnetwork routes in the network segment is frequently deleted and added, the network device does not need to notify the neighboring network device of the subnetwork route. This is because the subnetwork route is notified to the neighboring network device in the form of a summary route, thereby avoiding route flapping in a network and improving network stability to a certain extent. Although using a summary route can reduce the number of forwarding entries stored on a network device, a loop problem exists in some link failure scenarios. FIGURE 2 is a schematic diagram of a network architecture using SRv6 technology. In FIGURE 2, the network architecture includes an access device, an aggregation device, and a regional core device. The access device may be an access node (ACC), the aggregation device may be an aggregate node (AGG), and the regional core device may be a regional core node (RC). The access device includes an ACC 201, an ACC 202, and an ACC 203, the aggregation device includes an AGG 204 and an AGG 205, and the regional core device includes an RC 206 and an RC 207. Their connection relationships are: ACC 201 is connected to ACC 202 and AGG 204, ACC 202 is further connected to AGG 205, ACC 203 is connected to AGG 205, AGG 204 is connected to AGG 205 and RC 206, AGG 205 is further connected to RC 207, and RC 206 is further connected to RC 207. The addresses of the above devices in the network architecture can be IPv6 addresses or they can be Internet Protocol version 4 (IPv4) addresses. For ease of description, an IPv6 address is used as an example below. ML / ZO IOZ description. In the network architecture of FIGURE 2, an IP address (specifically, an IPv6 address) of ACC 201 is A1:8:: / 96, an IP address of ACC 202 is A1:9:: / 96, and an IP address of ACC 203 is A1:A:: / 96. ACC 201, ACC 202, AGG 204 and AGG 205 belong to an access ring 1 in an access network, ACC 203, AGG 204 and AGG 205 belong to an access ring 2 in the access network, and AGG 204, AGG 205, RC 206 and RC 207 belong to an aggregation ring in a backbone network. The AGG 204 summarizes a specific route A1:8:: / 96 from ACC 201 and a specific route A1:9:: / 96 from ACC 202 on access ring 1 into a summary route A1:: / 84, and advertises the summary route to a network device on the aggregation ring. Simultaneously, the AGG 204 generates the specific route corresponding to the IP address A1:8:: / 96 of ACC 201 and the specific route corresponding to the IP address A1:9:: / 96 of ACC 202. The AGG 205 also summarizes the specific route A1:8:: / 96 of ACC 201 and the specific route A1:9:: / 96 of ACC 202 on access ring 1 into a summary route A1:: / 84, and advertises the summary route to a network device on the aggregation ring. The AGG 205 generates the specific route corresponding to the IP address A1:8:: / 96 of ACC 201 and the specific route corresponding to the IP address A1:9:: / 96 of ACC 202. The AGG 204 generates a forwarding table. The forwarding table includes a forwarding entry 1 and a forwarding entry 2 shown in Table 1. Forwarding entry 1 is the specific route corresponding to the IP address A1:8:: / 96, and forwarding entry 2 is the specific route corresponding to the IP address A1:9:: / 96. Forwarding entry 1 includes the IP address A1:8:: / 96 of the ACC 201 and an exit interface (specifically indicating an identifier of this interface, which is similar to below). The output interface is an interface of AGG 204 on a forwarding path from AGG 204 to ACC 201. Forwarding entry 2 includes the IP address A1:9:: / 96 of ACC 202 and an output interface, and the output interface is an interface of AGG 204 on a forwarding path from AGG 204 to ACC 202.Specifically, the output interface at the forwarding entry 1 is an output interface corresponding to a shortest path from the AGG 204 to the ACC 201, and the output interface of the forwarding entry 2 is an output interface corresponding to a shortest path from the AGG 204 to the ACC 202. The output interface may be an interface corresponding to a forward link between the AGG 204 and the ACC 201. Ml / Zo Ioz Table 1 Identifier of a forwarding entry Destination address Output interface 1 A1:8:: / 96 Output interface of a direct link to ACC 201 2 A1:9:: / 96 Output interface of a direct link to ACC 201 Ml / Zo Ioz Additionally, AGG 204 separately receives the summary routes A1:: / 84 from AGG 205 and RC 206 respectively and advertised by AGG 205, and generates a corresponding forwarding entry 3 and forwarding entry 4. See Table 2. Forwarding entry 3 includes a summary route A1:: / 84 and an exit interface, and the exit interface is an exit interface of AGG 204 on a forward link between AGG 204 and AGG 205. Forwarding entry 4 includes a summary route A1:: / 84 and an exit interface, and the exit interface is an exit interface of AGG 204 on a forward link between AGG 204 and RC 206. The costs of the forward link from AGG 204 to AGG 205 are lower than those of an AGG 204->RC 206->RC 207->AGG 205 link. Therefore, a priority of a route corresponding to the forward link from AGG 204 to AGG 205 is higher than a priority of a route corresponding to the AGG 204->RC 206 link. 206->RC 207->AGG 205.An AGG 204->RC 206->RC 207->AGG 205 forwarding path can serve as a topology-independent loop-free alternate (TI-LFA) path. Table 2 Identifier of a forwarding entry Destination address Output interface 3 A1 :: / 84 Output interface of a direct link to the AGG 205 4 A1 :: / 84 Output interface of a direct link to the RC 206 See Table 3. The table is a forwarding entry generated by the AGG 205, and Table 3 includes a forwarding entry 5 and a forwarding entry 6. The forwarding entry 5 includes the IP address A1:9:: / 96 of the ACC 202 and an egress interface, and the egress interface is an interface of the AGG 205 on a forward link between the AGG 205 and the ACC 202. The forwarding entry 6 includes the IP address A1:A:: / 96 of the ACC 203 and an egress interface, and the egress interface is an interface of the AGG 205 on a forward link between the AGG 205 and the ACC 203. Ml / Zo Ioz Table 3 Identifier of a forwarding entry Destination address Output interface 5 A1:9:: / 96 Output interface of a direct link to ACC 202 6 A1 :A:: / 96 Output interface of a direct link to ACC 203 Additionally, the AGG 205 separately receives the summary routes A1:: / 84 originating from the AGG 204 and the RC 207 respectively and advertised by the AGG 204, and generates a corresponding forwarding entry 7 and a forwarding entry 8. See Table 4. Forwarding entry 7 includes a summary route A1:: / 84, and an egress interface of the summary route is an egress interface of AGG 205 on a forward link to AGG 204. Forwarding entry 8 includes a summary route A1:: / 84, and an egress interface of the summary route is an egress interface of AGG 205 on a forward link to RC 207. The costs of the forward link between AGG 205 and AGG 204 are lower than those of an AGG 205->RC 207->RC 206->AGG 204 link. Therefore, a priority of a route corresponding to the forward link from AGG 205 to AGG 204 is higher than a priority of a route corresponding to the AGG 205->RC 207->RC 206->AGG 204 link. Table 4 Identifier of a forwarding entry Destination address Outgoing interface of a next-hop network device 7 A1 :: / 84 Outgoing interface of a direct link to the AGG 204 8 A1 :: / 84 Outgoing interface of a direct link to the RC 207 When an AGG 204->ACC 201->ACC 202 link is normal, the RC 206 sends a packet to the ACC 202. When the packet arrives at the AGG 204, the AGG 204 looks up in Table 1 a routing entry 2 of the specific route corresponding to the IP address A1:9:: / 96 of the ACC 202, and then sends the packet to the ACC 201 through the exit interface which is determined based on the routing entry 2 and which is on the direct link with the ACC 201. The ACC 201 then forwards the packet to the ACC 202. When the direct link between the AGG 204 and the ACC 201 is faulty, the AGG 204 deletes the specific route to the ACC 201 and the specific route to the ACC 202, i.e., the AGG 204 deletes forwarding entry 1 and forwarding entry 2. When the forward link between the AGG 204 and the AGG 205 is normal, after the AGG 204 receives a packet from the RC 206, the AGG 204 does not obtain, through matching based on a destination address of the packet, namely, the IP address of the ACC 202, the forwarding entry 2 corresponding to the specific route to the ACC 202, but obtains the forwarding entry corresponding to the summary route A1:: / 84 through matching. Specifically, a priority of a route corresponding to forwarding entry 3 is higher than a priority of a route corresponding to forwarding entry 4. Therefore, the AGG 204 may forward the packet to the AGG 205 via the output interface that is determined based on forwarding entry 3 and that is on the forward link with the AGG 205.After receiving the packet, the AGG 205 obtains the forwarding entry 5 through matching based on an IP address of the packet, and forwards the packet to the ACC 202 through the output interface that is determined based on the forwarding entry 5 and that is on the direct link with the ACC 202. If a link between the AGG 205 and the ACC 202 is faulty, the AGG 205 deletes forwarding entry 5. Therefore, after receiving the packet from the AGG 204, the AGG 205 does not obtain forwarding entry 5 through the match, i.e., it does not obtain the specific route toward the ACC 202 through the match, but obtains forwarding entry 7 through the match, i.e., it obtains the summary route A1:: / 84 toward the AGG 204 through the match. Therefore, the AGG 205 returns the packet to the AGG 204, which causes a loop, waste of resources, and even network congestion. Furthermore, if the direct link between the AGG 204 and the AGG 205 is alternatively faulty, the AGG 204 deletes the forwarding entry 3. Therefore, upon receiving a packet from the RC 206, the AGG 204 fails to obtain, by matching based on a destination address of the packet, namely the IP address of the ACC 202, the forwarding entry 2 corresponding to the specific route to the ACC 202, fails to obtain the forwarding entry 3 corresponding to the summary route by matching, but obtains the forwarding entry 4 corresponding to the summary route A1:: / 84 by matching. The output interface, in forwarding entry 4, corresponding to summary route A1:: / 84 is the output interface of the forward link to RC 206. Therefore, AGG 204 sends the packet to RC 206 via the output interface of the forward link between AGG 204 and RC 206, and RC 206 sends the packet to AGG 205 via RC 207.When the link between the AGG 205 and the ACC 202 is faulty, the AGG 205 cannot obtain, by matching based on the IP address of the ACC 202, the forwarding entry 5 corresponding to the specific route to the ACC 202, but can obtain a forwarding entry corresponding to the summary route A1:: / 84 by matching. A priority. ML / ZO IOZ of a route corresponding to the forwarding entry 7 corresponding to the summary route A1:: / 84 is greater than a priority of a route corresponding to the forwarding entry 8 corresponding to the summary route A1:: / 84. Therefore, if the forward link between the AGG 204 and the AGG 205 is normal, the AGG 205 obtains, through matching based on the IP address of the ACO 202, the forwarding entry 7 corresponding to the summary route A1:: / 84, and then returns the packet to the AGG 204 through the egress interface of the forward link with the AGG 204, resulting in a loop.Furthermore, if the forward link between the AGG 204 and the AGG 205 is alternatively faulty, the AGG 205 fails to obtain, by matching based on the IP address of the ACO 202, the forwarding entry 5 corresponding to the specific route to the ACC 202, fails to obtain the forwarding entry 7 corresponding to the summary route A1:: / 84 by matching, but obtains the forwarding entry 8 corresponding to the summary route A1:: / 84 by matching. Therefore, the AGG 205 returns the packet to the AGG 204 through the RC 207 based on the egress interface of the forward link between the RC 207, which causes a loop, waste of resources, and even network congestion. Similar to the link failure between AGG 204 and AGG 205, when there is no physical link between AGG 204 and AGG 205, the above loop problem also exists. Scenario 2 FIGURE 3 is a schematic diagram of a network architecture using Multi-Protocol Label Switching (MPLS) technology. In FIGURE 3, the network architecture includes an access device, an aggregation device, and a regional core device. The access device may be an ACC, the aggregation device may be an AGG, and the regional core device may be an RC. Specifically, the network architecture includes an ACC 301, an ACC 302, an ACC 303, an AGG 304, an AGG 305, an RC 306, and an RC 307. The ACC 301, ACC 302, and ACC 303 are connected to the AGG 304 and AGG 305, and the AGG 304 and AGG 305 are connected to the RC 306 and RC 307. ACC 301, ACC 302, ACC 303, AGG 304, and AGG 305 belong to IGP domain 1, and AGG 304, AGG 305, RC 306, and RC 307 belong to IGP domain 2. An ACC 301 label is 16001, an ACC 302 label is 16002, an ACC 303 label is 16003, an AGG 304 label is 16101, and an AGG 305 label is 16102. ACC 301, ACC 302, ACC 303, AGG 304, and AGG 305 advertise their respective labels in IGP domain 1, and AGG 304 and AGG 305 advertise their respective labels in IGP domain 2. Ml / Zo Ioz The AGG 304 determines a primary forwarding path to the ACC 301, i.e., a forward link from the AGG 304 to the ACC 301, based on the label 16001 received from the ACC 301, and generates a corresponding forwarding entry 9. See Table 5. In this table, the forwarding entry 9 includes the label 16001 of the ACC 301 and an output interface, and the output interface is an output interface of the AGG 304 on the forward link to the ACC 301. Ml / Zo Ioz Table 5 Identifier of a forwarding entry Label Output interface 9 16001 Output interface of a direct link to ACC 301 The AGG 304 may generate a backup forwarding path to the ACC 301. The backup forwarding path is AGG 304->AGG 305->ACC 301, and a corresponding forwarding entry 10 is generated based on the backup forwarding path. See Table 6. In this table, the forwarding entry 10 includes the label 16001 of the ACC 301 and an output interface, and the output interface is an interface of the AGG 304 on a direct link with the AGG 305. Table 6 Identifier of a forwarding entry Label Output interface 10 16001 Output interface of a direct link to the AGG 305 Additionally, the AGG 305 generates a forwarding entry 11 based on the label 16001 received from the ACC 301. See Table 7. The forwarding entry 11 includes the label 16001 of the ACC 301 and an output interface, and the output interface is an interface of the AGG 305 on a direct link with the ACC 301. Table 7 Identifier of a forwarding entry Label Output interface 11 16001 Output interface of a direct link to ACC 301 The AGG 305 may also generate a backup forwarding path to the ACC 301. The backup forwarding path is AGG 305->AGG 304->ACC 301, and a corresponding forwarding entry 12 is generated based on the backup forwarding path. See Table 8. In this table, the forwarding entry 12 includes the label 16001 of ACC 301 and an output interface, and the output interface is an interface of AGG 305 on a direct link with AGG 304. Ml / Zo Ioz Table 8 Identifier of a forwarding entry Label Output interface 12 16101 Output interface of a direct link to the AGG 304 The AGG 304 receives a packet from the RC 306. The packet carries the label 16001 of the ACC 301, identifying that a destination node of the packet is the ACC 301. When the AGG 304 determines that the forward link between the AGG 304 and the ACC 301 is faulty, the AGG 304 obtains the forwarding entry 10 through matching based on the label 16001 of the ACC 301, and obtains, through matching, the output interface corresponding to the label 16001 of the ACC 301, that is, the output interface of the forward link between the AGG 304 and the AGG 305. Additionally, the label 16102 of the AGG 305 is pushed into the packet, and then the packet is sent to the AGG 305.After the AGG 305 receives the packet, if it is determined that the forward link with the ACC 301 is normal, the AGG 305 forwards the packet to the ACC 301; or if it is determined that the forward link with the ACC 301 is faulty, the forwarding entry 12 is obtained through matching based on the label 16001 of the ACC 301, and the output interface corresponding to the label 16001 of the ACC 301 is obtained through matching, that is, the output interface of the forward link with the AGG 304 is obtained through matching. Additionally, the label 16101 of the AGG 304 is pushed into the packet, and then the packet is sent to the AGG 304, resulting in a loop, waste of network resources, and even network congestion. From the examples of the previous two scenarios, it is clear that if a loop problem occurs, a packet cannot be transmitted to a destination node and normal network communication is affected. To overcome this technical problem, one embodiment of this application provides a packet forwarding method to reduce a technical problem of resource waste or network congestion in a network communication process. Before describing the packet forwarding method, a network architecture to which the method can be applied is first described. FIGURE 4 is a schematic diagram of the structure of a network architecture 500 in accordance with one modality of this request. In FIGURE 4, network architecture 500 includes a network device 401, a network device 402, a network device 403, a network device 404, and a network device 405. Network device 401 is connected to network device 402, network device 403, and network device 404. Network device 404 is connected to network device 403 and network device 405. In this embodiment of this application, the network device 401, the network device 402, the network device 403, the network device 404, and the network device 405 may be a router, a switch, or the like. This is not particularly limited to this embodiment of this application.

[0007] Next, the method of forwarding packets according to this embodiment of this application is described with reference to FIG. In the method, the network device 404 sends an advertisement packet to the network device 401, and the advertisement packet includes an identifier of the network device 404 and an indication identifier A, the indication identifier A being used to indicate that the network device 404 supports a capability of avoiding the use of a backup path to forward a packet. Upon receiving the advertisement packet, the network device 401 obtains a forwarding path from the network device 403. The forwarding path passes through the network device 404, and a forwarding entry corresponding to the forwarding path is generated. The forwarding entry includes at least an identifier of the network device 403 and an output interface.After the network device 401 receives a first packet whose destination is the network device 403, the network device 401 searches for the forwarding entry based on the identifier of the network device 403, to obtain the identifier of the network device 404 and an output interface. The network device 401 adds the indication identifier A to the first packet to obtain a second packet, and forwards the second packet to the network device 404 through the output interface. The indication identifier A is used to instruct the network device 404 to avoid using a backup forwarding path from the network device 404 to the network device 403 to send the second packet to the network device 403.When the network device 404 determines that a primary forwarding path from the network device 404 to the network device 403 is unreachable, the network device 404 no longer uses the backup forwarding path based on an indication of the indication identifier A to send the second packet to the network device 403, but directly discards the second packet. The method mainly relates to a first network device and a second network device. The first network device may be the network device 401 of FIG. 4 , and the second network device may be the network device 404 of FIG. Ml / Zo Ioz 4. The packet forwarding method can be applied to a scenario such as SR-MPLS, SRv6, MPLS, Internet Protocol version 6 (IPv6), or Internet Protocol version 4 (IPv4). The SRv6 and SR-MPLS scenarios are used below as examples to describe this method. FIGURE 5 is a flowchart of a packet forwarding method according to one embodiment of this application. The packet forwarding method includes the following steps. S501: A second network device sends an M1 packet to a first network device, where the M1 packet includes an identifier of the second network device and an indication identifier A. When the method is applied to an SRv6 scenario, the identifier of the second network device may be a segment identifier (SID) of the second network device, and the segment identifier may be an IPv6 address of the second network device. When the method is applied to an SR-MPLS scenario, the identifier of the second network device may be a label of the second network device. Indeed, the identifier of the second network device may alternatively be identified in another way, for example, a router identifier (router ID). This is not specifically limited to this embodiment of this application. The identifier of the second network device may be obtained through configuration. The indication identifier A is used to identify that the second network device has the ability to avoid using a backup forwarding path to forward a packet. That the second network device has the ability to avoid using a backup forwarding path to forward a packet is specifically: When the second network device forwards the packet to a destination device, if a primary forwarding path and the backup forwarding path exist to forward the packet to the destination device, when the primary forwarding path is unreachable, the backup forwarding path is no longer used to forward the packet to the destination device. In this way, the problem of a packet forwarding loop caused by using the backup forwarding path to forward a packet is avoided, and thus the waste of resources or network congestion is avoided.In this embodiment of this application, the indication identifier A and the identifier of the second network device may be two independent pieces of information, or they may be combined as a whole. When the indication identifier A and the identifier of the second network device are two independent pieces of information, the indication identifier A may be obtained by the second network device in a configured manner. When the indication identifier A and the identifier of the second network device are combined as a whole, the identifier of the. ML / ZO IOZ second network device can not only identify the second network device, but can also be used to identify that the second network device has the ability to support avoiding using a backup forwarding path to forward a packet. After the second network device obtains the identifier of the second network device and the indication identifier A, the second network device may flood send the M1 packet carrying the identifier of the second network device and the indication identifier A to the first network device. The M1 packet may be an advertisement packet, for example, an Intermediate System to Intermediate System (ISIS) packet or an Open Shortest Path First (OSPF) packet. When this request variant is applied to the SRv6 scenario, if the M1 packet is an ISIS IPv6 packet or an OSPF version 3 (v3) packet, the M1 packet may include an Endpoint Segment Identifier (END SID) Type Length Value (TLV) field. The Endpoint SID TLV field may include the second network device identifier and the A indication identifier. FIGURE 6 is a schematic diagram of a format of an endpoint SID TLV field in an IPv6 ISIS packet. In the figure, the endpoint SID TLV field includes a type field, a length field, a flags field, an SRv6 endpoint function field, a SID field, a sub-sub-tlv-len field, a sub-sub-TLVs field, and the like. A value in the Type field identifies the type of the Endpoint SID TLV. The Length field indicates the length of the sTLV. The Flag field occupies 8 bits. A value in the SRv6 Endpoint Function field is a legal function value from the Endpoint SID TLV. The Endpoint SID TLV can include one or more SID fields, and each SID field is 128 bits. A value in a SID field can include the SID of the second network device. Specifically, the SID of the second network device includes a locator portion and a function portion. The SID of the second network device is an IPv6 address of the second network device, and the SID of the second network device can be considered the identifier of the second network device. A value in the Sub-sub-tlv-len field is a length corresponding to the Sub-sub-tlv field. The Sub-sub-tlv field is optional. FIGURE 7 is a schematic diagram of the format of an Endpoint SID TLV field in an OSPFv3 packet. In the figure, the Endpoint SID TLV field includes a Type field, a Length field, a Flags field, a Reserved field, an Endpoint Behavior field, a SID field, ΜΛ / ZO IOZ a field of sub-TLVs, and the like. The value of the type field is used to indicate the type of the endpoint SID TLV. The value of the length field is the length of the endpoint SID TLV. The flags field occupies 8 bits. A value of the endpoint behavior field is determined based on a specific situation, and the details are not described further here. The endpoint SID TLV field may include one or more SID fields, and each SID field has 128 bits. A value of a SID field may include the SID of the second network device, or may be considered as the identifier of the second network device. Specifically, the SID field includes a locator part and a function part, and a value of the SID field is an IP address of the second network device. The subTLVs field is optional. For the above ISIS IPv6 packet or OSPFv3 packet, the A indication identifier can be carried in several ways: In a first possible implementation, a value of a type field in the Endpoint SID TLV field is used to indicate that the Endpoint SID TLV field is a specific type of Endpoint SID TLV, and this Endpoint SID TLV type indicates that the second network device has the capability to support avoiding the use of a backup forwarding path to forward a packet. That is, the type field in the Endpoint SID TLV field carries the indication identifier A. In a second possible implementation, a value of the flags field in the endpoint SID TLV field is used to indicate that the second network device has an indication identifier A function, i.e., the flags field carries the indication identifier A. For example, one or more bits in the flags field are used to carry the indication identifier A. For example, a value of an eighth bit in the flags field is 1, identifying the indication identifier A. When the first network device receives the packet M1 and determines that the value of the eighth bit in the flags field is 1, the first network device determines that the second network device has the capability to support avoiding using a backup forwarding path to forward a packet.In this embodiment of this application, the bit carrying the indication identifier A in the flags field may be referred to as the Bypass flag, and the bit may be marked as B, i.e., an abbreviation for Bypass Flags. In a third possible implementation, the SID field of the second network device in the Endpoint SID TLV field carries the indication identifier A, and the SID of the second network device may also be referred to as the Bypass SID. In the third possible implementation, there are still three possible implementations: Implementation (a): Part of the function of the derivation SID includes the ΜΛ / ZO IOZ indication identifier A. Implementation (b): The derivation SID is used to identify the second network device, and also has the function of the indication identifier A. Implementation (c): Some bits of a derivation SID locator have an indication identifier A function. When this embodiment of this request is applied to the SR-MPLS scenario, if the M1 packet is an ISIS packet or an OSPF packet, the M1 packet may include a prefix segment identifier (prefix SID) TLV field, and the prefix SID TLV field may include the second network device identifier and the A indication identifier. FIGURE 8 is a schematic diagram of a format for a Prefix SID TLV field included in an ISIS packet. The Prefix SID TLV field includes a type field, a length field, a flag field, an algorithm field, and one of three fields: a SID field, an Index field, and a Label field. The value of the type field indicates the type of the prefix SID TLV. The value of the length field is the length of the prefix SID TLV field. A value of the flags field may include a value flag (V-Flag) bit, a local flag (L-Flag) bit, or the like. A value of the algorithm field indicates an algorithm (e.g., a shortest path method) used by a router to calculate reachability to other network devices or an algorithm used to calculate the prefixes of those other network devices. A value of the SID / index / label field includes the label of the second network device, and the label of the second network device may be considered the identifier of the second network device. FIGURE 9 is a schematic diagram of the format of a Prefix SID TLV field included in an OSPF packet. The Prefix SID TLV field includes a type field, a length field, a flag field, a reserved field, a multi-topology (MT) ID field, an algorithm field, and one of three fields: a SID field, an index field, or a label field. The value of the Type field indicates the type of the Prefix SID TLV. The value of the Length field is the length of the Prefix SID TLV field. A value of the Flag field may include a Value Flag (V-Flag) bit, a Local Flag (L-Flag) bit, or the like. A value of the SID / Index / Label field includes the label of the second network device, and the label of the second network device may be considered the identifier of the second network device. For the above ISIS or OSPF packet, the A indication identifier can be carried in several ways: ML / t / ZUZZ / UZO IOZ In a first possible implementation, a value of a type field in the Prefix SID TLV field is used to indicate that the Prefix SID TLV is a special Prefix SID TLV, and this TLV type is used to indicate that the second network device supports a capability to avoid using a backup forwarding path to forward a packet. That is, the type field in the Prefix SID TLV field carries the indication identifier A. In a second possible implementation, a value of the flags field in the Prefix SID TLV field is used to indicate that the second network device has an indication identifier A function, i.e., the flags field carries the indication identifier A. For example, one or more bits in the flags field are used to carry the indication identifier A. For example, a value of an eighth bit in the flags field is 1, identifying the indication identifier A. When the first network device receives the packet M1 and determines that the value of the eighth bit in the flags field is 1, the first network device determines that the second network device has the capability to support avoiding using a backup forwarding path to forward a packet.In this embodiment of this application, the bit carrying the indication identifier A in the flags field may be referred to as the Bypass flag, and the bit may be marked as B, i.e., an abbreviation for Bypass Flags. In a third possible implementation, a value of the SID / index / label field is the label of the second network device, and the label of the second network device has a function of the identifier of the second network device and also has a function of indicating the indication identifier A. S502: The first network device receives the M1 packet, and generates a forwarding entry based on an identifier of the destination device. In this embodiment of this application, the destination device is a network device that communicates with the first network device. The destination device may be a router, a switch, a terminal device, a server, or the like. This is not particularly limited to this embodiment of this application. For example, when the first network device is network device 401 of FIG. 4, the destination device may be network device 403 of FIG. When the method is applied to the SRv6 scenario, the destination device identifier may be an IP address of the destination device. When the method is applied to the SR-MPLS scenario, the destination device identifier may be a label of the destination device. Indeed, the destination device identifier may alternatively be identified in another way, for example, a router ID. This is not specifically limited to this embodiment of this application. Ml / Zo Ioz In this embodiment of this request, the destination device may send the destination device identifier to the first network device in advance in a flooded manner, so that the first network device may obtain the destination device identifier. After receiving the M1 packet, the first network device generates the forwarding entry based on the destination device identifier and the second network device identifier in the M1 packet. A first forwarding path corresponding to the forwarding entry is a forwarding path from the first network device to the destination device. The forwarding entry includes the destination device identifier and forwarding information of the first forwarding path. When the forwarding information is applied to the SRv6 scenario, the forwarding information may include a segment identifier list, the segment identifier list includes the segment identifier of the second network device, and the segment identifier of the second network device is the IP address of the second network device.When the method is applied to the SR-MPLS scenario, the forwarding information includes a label stack, and the label stack includes the label of the second network device. In addition to the segment identifier of the second network device or the label of the second network device, the forwarding information may also include an identifier of an output interface. The output interface is an interface located on the first forwarding path and directed to a next-hop network device. In one possible implementation, the first forwarding path from the first network device to the second network device may be a tunnel. Upon receiving the M1 packet, the first network device generates, based on the identifier of the second network device, the tunnel that reaches the second network device. The identifier of the output interface corresponding to the next-hop network device and located on the first forwarding path is a tunnel interface. In this embodiment of this application, the first forwarding path may be regarded as a backup forwarding path from the first network device to the destination device. The backup forwarding path is relative to the primary forwarding path. In some embodiments, when the primary forwarding path from the first network device to the destination device is normal, the first network device sends a data packet (e.g., an M2 packet in the following) to the destination device using the primary forwarding path. If the primary forwarding path is faulty, the first network device may send the data packet to the second network device using the first forwarding path, and the second network device sends the data packet to the destination device. In this embodiment of this application, the ML / ZO IOZ primary forwarding path from the first network device to the destination device may be referred to as the second forwarding path. When an application scenario of this modality is the SRv6 scenario, there are the following three possible cases for the first forwarding path and the second forwarding path: Case 1: The second forwarding path is a forwarding path of a specific route corresponding to an IP address of a destination device, and correspondingly, the first forwarding path is a forwarding path of a summary route corresponding to the IP address of the destination device. Case 2: The second forwarding path is a primary forwarding path of a summary route corresponding to an IP address of a destination device, and correspondingly, the first forwarding path is a backup forwarding path of the summary route corresponding to the IP address of the destination device. Case 3: The second forwarding path is a primary forwarding path of a specific route corresponding to an IP address of a destination device, and correspondingly, the first forwarding path is a backup forwarding path of the specific route corresponding to the IP address of the destination device. When the application scenario of this embodiment is the SR-MPLS scenario, the second forwarding path is a forwarding path corresponding to the primary forwarding information in a label forwarding entry corresponding to the label of the destination device. Accordingly, the first forwarding path is a forwarding path corresponding to the backup forwarding information in the label forwarding entry corresponding to the label of the destination device. The primary forwarding information may include the label of the destination device and an output interface. The backup forwarding information may include the label of the destination device, a label stack, and an output interface, and the label stack includes the label of the second network device. When the M2 packet is subsequently forwarded, the label stack may be inserted into the M2 packet, to obtain an M3 packet. Additionally, the forwarding entry corresponding to the first forwarding path may include special indication information. Alternatively, the forwarding entry is set to a special forwarding entry, to indicate that the forwarding entry is a forwarding entry that the first network device may search for when the second forwarding path is unreachable. Optionally, the forwarding entry corresponding to the first forwarding path may further include indication identifier A. In some embodiments, the first forwarding path may alternatively be ML / ZO IOZ the main forwarding path from the first network device to the destination device. S503: The first network device receives the M2 packet destined for the destination device. In this embodiment of this request, the M2 packet may be a data packet, i.e., a packet carrying service data. The M2 packet includes the destination device identifier, i.e., the M2 packet needs to reach the destination device. Packet M2 may be from a third network device, and the third network device may be, for example, network device 402 in the embodiment shown in FIG. 4. In some embodiments, the third network device belongs to a first network domain, and the destination device belongs to a second network domain. In this case, the first network device and the second network device may belong to both the first network domain and the second network domain, and the first network device and the second network device may be provider edge (PE) nodes. For example, the first network domain is an area of ​​a backbone network, the second network domain is an area of ​​an access network, the first network device is a network device connected to the access network and the backbone network, and the first forwarding path is a forwarding path in the backbone network. In another example, both the first and second network domains are IGP domains, but the IGP domain numbers of the first and second network domains are different. The first network device is a network device connected to both IGP domains. In another example, both the first and second network domains are BGP domains, but the BGP domain numbers of the first and second network domains are different. The first network device is a network device connected to both BGP domains. S504: The first network device determines the first forwarding path based on the destination device identifier. In this embodiment of this request, the first network device searches, based on the destination device identifier in the M2 packet, the forwarding entry that includes the destination device identifier, and determines, based on the forwarding entry, the corresponding first forwarding path, that is, a backup forwarding path from the first network device to the second network device. When the request scenario is the SRv6 scenario, with reference to the above three cases of the first forwarding path and the second forwarding path, S504 specifically includes the following three possible implementations. (1) The first forwarding path is the forwarding path of the summary route corresponding to the IP address of the destination device, and the second forwarding path is the forwarding path of the summary route corresponding to the IP address of the destination device. ML / ZO IOZ forwarding is the forwarding path of the specific route corresponding to the IP address of the destination device. Step S504 is specifically: When the first network device fails to obtain, by matching based on the IP address of the destination device, the specific route corresponding to the IP address of the destination device, or when the first network device obtains, by matching based on the IP address of the destination device, the specific route corresponding to the IP address of the destination device and determines that the forwarding path corresponding to the specific route is unreachable, the first network device determines that the forwarding path corresponding to the summary route to the IP address of the destination device is the first forwarding path. (2) The first forwarding path is the backup forwarding path of the summary route corresponding to the IP address of the destination device, and the second forwarding path is the primary forwarding path of the summary route corresponding to the IP address of the destination device. Step S504 is specifically: When the first network device obtains, through matching based on the IP address of the destination device, the summary route corresponding to the IP address of the destination device and determines that the primary forwarding path of the summary route is unreachable, the first network device determines that the backup forwarding path of the summary route is the first forwarding path. (3) The first forwarding path is the backup forwarding path of the specific route corresponding to the IP address of the destination device, and the second forwarding path is the primary forwarding path of the specific route corresponding to the IP address of the destination device. Step S504 is specifically: When the first network device obtains, through matching based on the IP address of the destination device, the specific route corresponding to the IP address of the destination device and determines that the primary forwarding path of the specific route is unreachable, the first network device determines that the backup forwarding path of the specific route is the first forwarding path. In some other embodiments, when the request scenario is the SRMPLS scenario, the label forwarding entry corresponding to the label of the destination device and stored in the first network device may include the primary forwarding information and the backup forwarding information. The primary forwarding information corresponds to the primary forwarding path from the first network device to the destination device, i.e., the second forwarding path; and the backup forwarding information corresponds to the backup forwarding path from the first network device to the destination device, i.e., the first forwarding path. When the ML / ZO IOZ the first network device obtains the label forwarding entry through matching based on the label of the destination device, and determines that the second forwarding path is unreachable, the first network device may determine the first forwarding path based on the label of the destination device, and forward the M2 packet using the first forwarding path. S505: The first network device adds an indication identifier B to the packet M2 to generate the packet M3. In this embodiment of this application, the indication identifier B is used to indicate a network device on the first forwarding path to avoid using a backup path to send the M3 packet to the destination device. The network device on the first forwarding path may include only the second network device, or may include another network device on the first forwarding path other than the second network device. In the SRv6 scenario, the B indication identifier may be carried in a segment router header (SRH) of the M3 packet. In a first possible implementation, the indication identifier B may be carried in an indicator field of the SRH of the M3 packet. For example, see FIGURE 10 which is a schematic diagram of an SRv6 packet SRH format. In this figure, the SRv6 packet SRH includes a basic header field (Next Header), an SRH Length field (Hdr Ext Len), a Routing Type, a Segments Left field, a Last Entry field, a Flags field, a Tag, a Segment List field, and an Optional Type Length Value objects field. A value in the Next Header field is 43, indicating that a Next Header is a Routing Extension Header. The value in the Hdr Ext Len field is the length of the SRH. The value in the Routing Type field is 4, indicating that the SRH is carried. The value in the Left Segments field is the number of a Next SID, a Start value is n-1, and n indicates the number of SIDs. The value in the Last Entry field is the number of the last SID in a packet forwarding path. The value in the Label field is used to mark a group of packets as having the same characteristics. A value in the Segment List field is a SID list. In this embodiment of this request, one or more bits in the Flags field are used to carry the B indication identifier. For example, an eighth-bit value in the Flags field is 1, identifying the B indication identifier.When the second network device receives the M3 packet and determines the value of the eighth bit in the flag field. ML / ZO IOZ is 1, the second network device determines that the second network device avoids using a backup path to send the M3 packet to the destination device. In this embodiment of this request, the bit carrying the indication identifier B in the flags field may be referred to as the Bypass flag, and the bit may be marked as B, i.e., an abbreviation for Bypass Flags. In a second possible implementation, the B indication identifier may be carried in a SID list field of the SRH of the M3 packet. In this case, the SID list includes the SID of the second network device, the SID of the second network device includes the B indication identifier, and the SID of the second network device that includes the B indication identifier may also be referred to as a derivation SID. In the SRv6 scenario, the SID of the second network device includes a location part and a function part, and the SID of the second network device includes the IP address of the second network device. In this scenario, there are three possible implementations: Implementation (a): See FIGURE 11. The derivation SID may be a special IPv6 address, which may identify the second network device, and may also have an indication function of Indication Identifier B. A value of the function part may be End.X, indicating that after receiving the M3 packet, a network device that receives the M3 packet decrements the value of Remaining Segments by 1, replaces a value of a destination address field in an IPv6 packet header with a value of a SID in a list of indicated SIDs after the decrement by 1, and forwards the M3 packet to a next-hop network device. Implementation (b): Some bytes of the derivation SID locator also have a function of the B indication identifier. The function part is the same as in implementation (a). Implementation (c): See FIGURE 12. Part of the derivation SID function includes the indication identifier B. In a third possible implementation, see FIGURE 13. The B indication identifier may be carried in a newly added TLV field of the SRH of the M3 packet. The new TLV field includes a type field, a length field, and a value field. One value of the type field is a type of the newly added TLV field, one value of the length field is a length of the TLV field, and one value of the value field is the B indication identifier. The possible implementations above do not constitute a limitation of the technical solutions of this application, and experts in the field can design the technical solutions based on a real case. In the SR-MPLS scenario, the M3 packet includes a label stack, and the ML / ZO IOZ indication identifier B may be carried in the label stack of the M3 package. In a first possible implementation, the label stack of packet M3 may include the label of the destination device, the label of the second network device, and a special label. The special label has an indication identifier B function, and the label of the second network device is adjacent to the special label; that is, the special label may be at a higher layer than the label of the second network device, or it may be at a lower layer than the label of the second network device. See FIG. 14(a). The label of the second network device is at the top of the label stack, and the special label is a next-layer label adjacent to the label of the second network device. See FIG. 14(b). The special label is at the top of the label stack, and the label of the second network device is a next-layer label adjacent to the special label. In a second possible implementation, the label stack of packet M3 includes the label of the destination device and the label of the second network device. In addition to identifying the second network device, the label of the second network device also has the meaning of the indication identifier B. The above possible implementations do not constitute a limitation of the technical solutions of this application, and those skilled in the art may design the technical solutions based on an actual case. Additionally, in the SRv6 scenario, in some embodiments, the M3 packet may not include the segment identifier of the second network device. Alternatively, in the SRv6 scenario, in some embodiments, a SID list of the M3 packet may further include a SID of a previous hop network device of the second network device in the first forwarding path, a part of the function of the SID includes End.X, and End.X is an operation defined in SRv6 Programming, indicating that the previous hop network device forwards the M3 packet to a Layer 3 (L3) output interface corresponding to the SID. S506: The first network device sends packet M3 to the second network device using the first forwarding path. As mentioned above, when the first forwarding path is a tunnel, a network device (except the second network device) traversing the tunnel only forwards the M3 packet, and does not perform corresponding processing based on the B indication identifier of the M3 packet. When the first forwarding path is not a tunnel, optionally, the network device on the first forwarding path avoids using the backup forwarding path to send the M3 packet to the destination device based on the B indication identifier, to avoid a loop problem. Additionally, it is assumed that the network device on the first path of ML / ZO IOZ forwarding includes a fourth network device, for example, the fourth network device is network device 405 in FIG. 4, that is, in FIG. 4, network device 405 and network device 402 are two independent network devices. In another embodiment, the fourth network device and the third network device may be the same network device. When the destination device belongs to the second network domain, the fourth network device may belong to the first network domain, that is, the first forwarding path does not pass through the second network domain. This is intended to save network resources of the second network domain, and is applicable to a case where the network resources of a network device in the first network domain are greater than the network resources of a network device in the second network domain. S507: The second network device receives the M3 packet destined for the destination device. S508: The second network device determines that the primary forwarding path from the second network device to the destination device is unreachable. S509: In response to determining that the primary forwarding path is unreachable, the second network device, based on an indication from the indication identifier B, avoids using the backup forwarding path to send the M3 packet to the destination device. Since the M3 packet includes the destination device identifier, the second network device may determine, based on the destination device identifier, whether the primary forwarding path to the destination device is reachable. The primary forwarding path is relative to the backup forwarding path, and both the primary forwarding path and the backup forwarding path are forwarding paths from the second network device to the destination device. In this embodiment of this application, when the primary forwarding path is unreachable, the second network device, based on an indication of the indication identifier B, does not use the backup forwarding path to send the M3 packet to the destination device, to reduce resource waste or network congestion.When the backup forwarding path passes through the first network device, a loop problem generated between the second network device and the first network device can be avoided by using the method. The second network device can discard the M3 packet after avoiding using the backup forwarding path to send the M3 packet to the destination device. In some SRv6 scenarios, the destination device identifier is the IP address of the destination device. In the SRv6 scenario, there are three possible cases for the primary forwarding path and the backup forwarding path from the second device: ML / ZO IOZ network device to the destination device. S508 and S509 are described separately in detail below, referring to the three possible cases. Case 1: The primary forwarding path from the second network device to the destination device is a forwarding path corresponding to a specific route to the destination device, and the backup forwarding path from the second network device to the destination device is a forwarding path corresponding to a summary route to the destination device. In this case, when the second network device fails to obtain a corresponding specific route through matching based on the IP address of the destination device, it indicates that the primary forwarding path from the second network device to the destination device is unreachable. Therefore, even if a summary route corresponding to the IP address of the destination device exists, packet M3 is not sent using the backup forwarding path corresponding to the summary route.Alternatively, although the second network device obtains the specific route through matching based on the IP address of the destination device, the forwarding path corresponding to the specific route is unreachable, so that although the summary route corresponding to the IP address of the destination device exists, the second network device does not send, based on the indication of the indication identifier B, the M3 packet using the backup forwarding path corresponding to the summary route. Case 2: The primary forwarding path from the second network device to the destination device is a primary forwarding path of a summary route to the destination device, and the backup forwarding path is a backup forwarding path of the summary route to the destination device. When the second network device obtains the summary route through matching based on the IP address of the destination device and determines that the primary forwarding path of the summary route is unreachable, the second network device, based on the indication of the indication identifier B, does not use the backup forwarding path of the summary route to send the M3 packet to the destination device. Case 3: The primary forwarding path from the second network device to the destination device is a primary forwarding path of a specific route to the destination device, and the backup forwarding path is a backup forwarding path of the specific route to the destination device. When the second network device obtains the specific route through matching based on the IP address of the destination device, but the primary forwarding path of the specific route is unreachable, the second network device does not use the backup forwarding path of the specific route to match based on the indication identifier B. ΜΛ / ZO IOZ send package M3. For the above three cases, for the specific implementation of indication identifier B, please refer to the related descriptions of S505. Details are not described again here. Additionally, the determination that the primary forwarding path is unreachable is specifically: The second network device first determines that a destination address of the M3 packet is the IP address of the second network device, and obtains the identifier of the destination device from a list of segment identifiers of the SRv6 packet; and then the second network device modifies the destination address of the M3 packet to the identifier of the destination device. In this case, the second network device determines, based on the destination address of the M3 packet, that the primary forwarding path to the destination device is unreachable. In the SR-MPLS scenario, the destination device identifier is a label of the destination device. The label forwarding entry corresponding to the destination device label and stored on the second network device includes the primary forwarding information and the backup forwarding information. The primary forwarding information corresponds to the primary forwarding path from the second network device to the destination device, and the backup forwarding information corresponds to the backup forwarding path from the second network device to the destination device.When the second network device obtains a label forwarding table of the destination device through matching based on the label of the destination device and determines that the primary forwarding path corresponding to the primary forwarding information in the label forwarding table is unreachable, even if the second network device can send the M3 packet using the backup forwarding information corresponding to the label of the destination device, the second network device does not use, based on an indication of the indication identifier B, the backup forwarding path corresponding to the backup forwarding information to send the M3 packet to the destination device. Specifically, when the indication identifier B is a special label and is adjacent to the label of the second network device, the second network device may pop the special label and the label of the second network device, to obtain the special label, and not use, based on an indication of the special label, the backup forwarding path to the destination device to send the packet M3. After the special label and the label of the second network device are popped, if a next-hop network device is the destination device, a label higher in the label stack is the label of the destination device. Ml / Zo Ioz In conclusion, since the packet M3 sent by the first network device to the second network device carries the indication identifier B, the second network device can avoid, based on the indication identifier B, using the backup forwarding path to forward the packet M3. This avoids a packet forwarding loop problem that may be caused when the packet M3 is transmitted using the backup forwarding path, thereby avoiding network congestion or waste of network bandwidth resources. Several application scenarios are used below as examples to describe in detail a method of sending packets according to an embodiment of this application. Scenario 1 See FIGURE 15A, FIGURE 15B, FIGURE 15C, FIGURE 16(a) and FIGURE 16(b). FIGURE 15A, FIGURE 15B and FIGURE 15C are a flowchart of a packet forwarding method in a network architecture shown in FIGURE 16(a) and FIGURE 16(b), and the network architecture shown in FIGURE 16(a) and FIGURE 16(b) is the same as the network architecture shown in FIGURE 2. The package shipping method includes the following steps. S601: An AGG 204 generates a forwarding entry 13 of a specific route corresponding to an IP address A1:8:: / 96 of an ACC 201, and generates a forwarding entry 14 of the specific route corresponding to an IP address A1:9:: / 96 of an ACC 202. The AGG 204 summarizes the specific route A1:8:: / 96 of the ACC 201 and the specific route A1:9:: / 96 of the ACC 202 on an access ring 1 into a summary route A1:: / 84, and advertises the summary route A1:: / 84 to a network device on an aggregation ring. In this embodiment of this application, the AGG 204 can be considered as the first network device above. See Table 5. The table includes forwarding entries generated by the AGG 204, and the forwarding entries include a forwarding entry 13 and a forwarding entry 14. The forwarding entry 13 includes the IP address A1:8:: / 96 of the ACC 201 and an output interface (specifically indicating an identifier of this interface, which is similar to below). The output interface is an interface of AGG 204 on a forwarding path from AGG 204 to ACC 201. The forwarding entry 14 includes the IP address A1:9:: / 96 of ACC 202 and an output interface, and the output interface is an interface of AGG 204 on a forwarding path from AGG 204 to ACC 202.The output interfaces at both the forwarding input 13 and the forwarding input 14 are each shortest path interfaces between the AGG 204 and the ACC 201, and the shortest path interface may be an output interface of the AGG 204 on a direct link to the ACC 201. Ml / Zo Ioz Table 5 Identifier of a forwarding entry Destination address Output interface 13 A1:8:: / 96 Output interface of a direct link to ACC 201 14 A1:9:: / 96 Output interface of a direct link to ACC 201 Ml / Zo Ioz S602: An AGG 205 generates a specific route forwarding entry 15 corresponding to IP address A1:9:: / 96 of ACC 202 and a specific route forwarding entry 16 corresponding to IP address A1:A:: / 96 of ACC 203. The AGG 205 summarizes the specific route A1:9:: / 96 of ACC 202 on access ring 1 and the specific route A1:A:: / 96 of ACC 203 on access ring 2 into a summary route A1:: / 84, and advertises the summary route A1:: / 84 to the aggregation ring. In this embodiment of this application, the AGG 205 can be considered as the second network device above. See Table 6. In the table, there are forwarding entry 15 and forwarding entry 16 generated by AGG 205. Forwarding entry 15 includes IP address A1:9:: / 96 of ACC 202 and an output interface, and the output interface is an output interface of AGG 205 on a forward link with ACC 202. Forwarding entry 16 includes IP address A1:A:: / 96 of ACC 203 and an output interface, and the output interface is an output interface of AGG 205 on a forward link with ACC 203. Table 6 Identifier of a forwarding entry Destination address Output interface 15 A1:9:: / 96 Output interface of a direct link to ACC 202 16 A1 :A:: / 96 Output interface of a direct link to ACC 203 S603: The AGG 204 receives the summary route A1:: / 84 from the AGG 205 and generates the corresponding forwarding entry 17. See Table 7. Forwarding entry 17 includes summary route A1:: / 84 and an exit interface, and the exit interface may be null 0 or may be an exit interface of AGG 204 on a direct link to AGG 205. Table 7 Forwarding Entry Identifier Destination Address Outgoing Interface 17 A1:: / 84 Null 0; or Outgoing interface of a direct link to the AGG 205 Ml / Zo Ioz S604: The AGG 205 receives the summary route A1:: / 84 from the AGG 204 and generates the corresponding forwarding entry 18. See Table 8. Forwarding entry 18 includes summary route A1:: / 84, and an output interface of the summary route is configured as null 0 or is an output interface of AGG 205 on a direct link to AGG 204. null 0 indicates that the output interface is unavailable. Table 8 Forwarding Entry Identifier IP Address Outgoing Interface 18 A1:: / 84 Null 0; or Outgoing interface of a direct link to the AGG 204 S605: The AGG 205 sends an M1 packet to a network device on the aggregation ring. The M1 packet includes an AGG 205 SID and an indication identifier A, and the AGG 205 SID may be A2:2::2 / 128. In this embodiment of this request, the SID A2:2::2 / 128 (i.e., the IP address of the AGG 205) of the AGG 205 has a function of identifying the AGG 205. The indication identifier A is used to indicate a network device on a forwarding path to the AGG 205 to avoid using a backup forwarding path to send an M3 packet to a destination device. In this embodiment of this application, a type of the AGG 205 SID may be a Penultimate Segment Pop of the SRH (PSP). S606: The AGG 204 receives the M1 packet, and obtains the SID A2:2::2 / 128 from the AGG 205 and the indication identifier A from the M1 packet. S607: AGG 204 generates a tunnel to AGG 205 based on SID A2:2::2 / 128 of AGG 205. In this embodiment of the request, the tunnel to AGG 205 sequentially passes through AGG 204, RC 206, RC 207, and AGG 205, and the tunnel can be considered as the first forwarding path in the above description. S608: The AGG 204 generates a replacement forwarding entry of the summary route A1:: / 84, for example, a forwarding entry 19, where the forwarding entry 19 is a backup forwarding entry of the forwarding entry 17. See Table 9. A destination address of forwarding entry 19 is A1:: / 84, and forwarding entry 19 further includes replacement forwarding information and an exit interface of a tunnel. The backup forwarding information includes a repair list, and the repair list includes the SID of the AGG 205. Optionally, the repair list may further include SIDs of other network devices than the SID of the AGG 205 in the tunnel, for example, an RC SID 206 and an RC SID 207. Ml / Zo Ioz Table 9 Identifier of a forwarding entry Destination address Repair list Outgoing interface 19 A1 :: / 84 A2:2::2 / 128 Interface corresponding to a tunnel S609: The AGG 204 determines that the primary forwarding path to the ACC 202 is unreachable, and the AGG 204 deletes the forwarding entry 14. The primary forwarding path from the AGG 204 to the ACC 202 is AGG 204->ACC 201->ACC 202, and the primary forwarding path may be regarded as the second forwarding path in the above description. When the primary forwarding path is faulty, the AGG 204 may delete the forwarding entry 14. S610: The AGG 204 receives an M2 packet from the RC 206, where the M2 packet includes the IP address A1:9:: / 96 of the ACC 202. In this embodiment of this application, ACC 202 can be considered as the previous destination device. Specifically, the M2 packet includes an IPv6 packet header and a payload, the IPv6 packet header includes a destination address, and the destination address is the IP address A1:9:: / 96 of ACC 202. S611: Since the forwarding entry 14 has been deleted, based on the IP address A1:9:: / 96 of the ACC 202, the AGG 204 cannot obtain a specific route through the match, but can obtain the summary route A1:: / 84 through the match, that is, it can obtain the forwarding entry 17 and the forwarding entry 19 through the match. S612: When the AGG 204 determines that the output interface at the forwarding entry 17 is null 0, or when the AGG 204 determines that the output interface at the forwarding entry 17 is the output interface of the forward link between the AGG 204 and the AGG 205, but the forward link between the AGG 204 and the AGG 205 is faulty, the AGG 204 uses the forwarding entry 19 to forward the M2 packet. S613: The AGG 204 adds the SID A1:9:: / 96 of the ACC 202 and the SID A2:2::2 / 128 of the AGG 205 to the SID list in an SRH of the M2 packet, adds an indication identifier B to a flags field of the SRH of the M2 packet, and modifies a value of a destination address field of the IPv6 packet header of the M2 packet to the IP address of the AGG 205, to obtain an M3 packet. That is, see FIGURE 16(a), and a SID list of packet M3 includes both the SID of AGG 205 and the SID of ACC 202. The SID of ACC 202 is stored in a segment list location [0] in the SRH header, and the SID of AGG 205 is stored in a segment list location [1] in the SRH header. The remaining segments are set to 1. S614: The AGG 204 sends the M3 packet to the AGG 205 based on the interface corresponding to the tunnel. S615: The AGG 205 receives the M3 packet and determines, based on the A1:9:: / 96 IP address of the ACC 202 in the M3 packet, whether the primary forwarding path to the ACC 202 is reachable. If the primary forwarding path to the ACC 202 is reachable, the AGG 205 sends the M3 packet to the ACC 202 using the primary forwarding path. If the primary forwarding path to the ACC 202 is unreachable, the AGG 205, based on the B indication, avoids using the backup path to forward the M3 packet. Specifically, after receiving the M3 packet, the AGG 205 determines that a destination address is the address of the AGG 205; then, a value of remaining segments in the M3 packet is decremented by 1 to be 0; and the segment list[0], i.e., the IP address A1:9:: / 96 of the ACC 202, is substituted as the destination address in the IPv6 packet header. The AGG 205 determines, based on the IP address A1:9:: / 96 of the ACC 202 in the destination address, whether the forwarding entry 15 can be mapped, and if the forwarding entry 15 can be mapped, sends the M3 packet to the ACC 202 through the output interface of the forward link between the AGG 205 and the ACC 202. Additionally, because the SID of the ACC 202 is a PSP type endpoint SID, the SRH header of the M3 packet is skipped before the M3 packet is sent.Before forwarding the packet, the ACC 202 modifies the destination address in the IPv6 packet header to the IP address of the ACC 202. If the match fails, or if the match succeeds but the forward link between the AGG 205 and the ACC 202 is determined to be unreachable, the AGG 205 obtains forwarding entry 18 by matching based on the IP address of the ACC 202, regardless of the outgoing interface. M3 / ZO IOZ included in forwarding entry 18 is null 0 or the output interface of the forward link between AGG 205 and AGG 204, AGG 205 no longer uses entry 18 to forward the packet, but directly discards packet M3. Alternatively, when AGG 205 obtains, through matching based on the IP address of ACO 202, the output interface nuil 0 corresponding to summary route A1:: / 84, it indicates that the primary forwarding path corresponding to summary route A1:: / 84 is unreachable. Therefore, even if the backup forwarding path corresponding to the summary route A1:: / 84 exists, for example, AGG 205->RC 207->RC 206->AGG 204, AGG 205 does not use the backup forwarding path to forward the packet, thus avoiding the formation of a loop between AGG 205 and AGG 204. In some embodiments, when the SID type of the AGG 205 is of the Ultimate Segment Pop of the SRH (UPS) type, the AGG 205 does not need to perform SRH popping before sending the M3 packet. Since the M3 packet carries the indication identity B, the AGG 205 cannot return the M3 packet to the AGG 204 when the primary forwarding path to the ACC 202 is unreachable, thus avoiding a resource waste or network congestion problem. In some embodiments, a case where there is no direct link between the AGG 204 and the AGG 205 is similar to a case where the direct link between the AGG 204 and the AGG 205 is faulty. The details are not described again here. In some embodiments, as shown in FIG. 16(b), the M3 packet may not include the SID of the AGG 205, so that the length of the SRH is reduced and the network resources occupied during packet forwarding may be reduced. Scenario 2 See FIGURE 17A, FIGURE 17B, and FIGURE 18. FIGURE 17A and FIGURE 17B are a flowchart of a packet forwarding method in a network architecture shown in FIGURE 18. The network architecture shown in FIGURE 18 is the same as the network architecture shown in FIGURE 3. The package shipping method includes the following steps. S701: An AGG 304 receives a label 16001 sent by an ACC 301 in a flooded manner in an IGP domain 1, determines a primary forwarding path towards the ACC 301 based on the label 16001 of the ACC 301, and generates a forwarding entry 20. In this embodiment of this application, the AGG 304 can be considered as the first prior network device. See Table 10. Forwarding entry 20 includes label 16001 of ACC 301 and an output interface, and the output interface is an output interface of AGG 304 on a direct link to ACC 301. Ml / Zo Ioz Table 10 Identifier of a forwarding entry Label Output interface 20 16001 Output interface of a direct link to the ACC 301 Ml / Zo Ioz S702: An AGG 305 receives label 16001 flooded from ACC 301 in IGP domain 1, determines a primary forwarding path to ACC 301 based on label 16001 from ACC 301, and generates a forwarding entry 21. In this embodiment of this application, the AGG 305 can be considered the second network device above. See Table 11. The forwarding entry 21 includes the label 16001 of the ACC 301 and an output interface, and the output interface is an output interface of the AGG 305 on a direct link with the ACC 301. Table 11 Identifier of a forwarding entry Label Output interface 21 16001 Output interface of a direct link to ACC 301 S703: The AGG 305 advertises an M1 packet to an IGP domain 2, where the M1 packet includes a 16202 label from the AGG 305. S704: AGG 304 receives packet M1, and obtains label 16202 from AGG 305 of packet M1. In this embodiment of this application, the label 16202 is not only used to identify the AGG 305, but also has a function of indicating the indication identifier A in the embodiment shown in FIGURE 5, that is, the label 16202 may indicate that the AGG 305 has the ability to avoid using a backup forwarding path to send a packet. S705: AGG 304 generates, based on tag 16202 of AGG 305, a tunnel to AGG 305. Since the bandwidth of a link between an access device and an aggregation device is much smaller than the bandwidth of a link between the aggregation device and a regional core device, the aggregation device may generate a backup forwarding path to the access device, and the backup forwarding path passes through the regional core device. In this embodiment of this application, a tunnel between AGG 304 and AGG 305 may pass through an RC 306, or it may pass through an RC 307. In other words, the tunnel may be tunnel 1: AGG 304->RC 306->AGG 305, or it may be tunnel 2: AGG 304->RC 307->AGG 305. S706: The AGG 304 generates a forwarding entry 22 based on a tunnel exit interface. See Table 12. Forwarding entry 22 includes label 16001 of ACC 301, label 16202 of AGG 305, and an output interface, and the output interface is a tunnel output interface. Ml / Zo Ioz Table 12 Identifier of a forwarding entry Incoming label Outgoing label Exit interface 22 16001 16202 Exit interface of a tunnel S707: The AGG 304 receives an M2 packet from the RC 306, where the M2 packet includes the 16001 tag from the ACC 301. That is, packet M2 has to reach ACC 301. In other words, in this embodiment of this request, ACC 301 can be considered as the previous destination device. S708: If the AGG 304 determines, based on the label 16001 of the ACC 301, that the primary forwarding path from the AGG 304 to the ACC 301 is unreachable, the AGG 304 encapsulates the label 16202 of the AGG 305 into the M2 packet, to obtain an M3 packet. Specifically, although the AGG 304 obtains the forwarding entry 20 through matching based on the label 16001 of the ACC 301, when the AGG 304 determines that the primary forwarding path to the ACC 301 (i.e., the forward link to the ACC 301, where the forward link may be regarded as the second forwarding path in the above description) is faulty, the AGG 304 sends the packet M2 using a backup forwarding path. The backup forwarding path is a forwarding path from the AGG 304 to the AGG 305, and may be regarded as the first forwarding path above. Specifically, the AGG 304 obtains a forwarding entry 22 through matching based on the label 16001 of the ACC 301, and obtains the tunnel output interface and label 16202 from the AGG 305. Furthermore, the AGG 304 encapsulates the label 16202 of the AGG 305 into the M2 packet, to obtain the M3 packet.The AGG 305 tag 16202 may be encapsulated on top of a stack of tags in the M3 package. Optionally, in this embodiment of this application, after taking out the label 16001 from the package M2, the AGG 304 may press the label 16001 and the label 16202 to obtain the package M3. S709: The AGG 304 sends the M3 packet to the AGG 305 through the tunnel output interface. S710: The AGG 305 receives the packet M3, extracts the label 16202 from the AGG 305, obtains a forwarding entry 21 through matching based on the label 16001 of the ACC 301 in the packet M3, and determines whether the primary forwarding path to the ACC 301 is faulty. If the primary forwarding path to the ACC 301 is not faulty, the AGG 305 sends the packet M3 to the ACC 301. If the primary forwarding path to the ACC 301 is determined to be faulty, the AGG 305 discards the packet M3 based on an indication function of the label 16202 of the AGG 305, namely, a meaning of preventing the use of the backup forwarding path to forward the packet M3. Optionally, the backup forwarding path from AGG 305 to ACC 301 is AGG 305->AGG 304->ACC 301. In this embodiment of this request, the primary forwarding path from the AGG 305 to the ACC 301 is the direct link between the AGG 305 and the ACC 301. When the primary forwarding path is faulty, regardless of whether the AGG 305 has a backup forwarding path forwarding entry corresponding to the label 16001 of the ACC 301, the AGG 305 discards the M3 packet, to avoid a resource waste or network congestion problem. Scenario 3 FIGURE 19 is a schematic diagram of a cross-domain network architecture. In this figure, the network architecture includes an ACC 501, an ACC 502, an AGG 503, an AGG 504, an RC 505, and an RC 506 that are in an IGP domain, and an Autonomous System Boundary Router (ASBR) 507, an ASBR 508, a Provider (P) device 509, a P device 510, an ASBR 511, and an ASBR 512 that are in an External Border Gateway Protocol (EBGP) domain. ACC 501, ACC 502, AGG 503, and AGG 504 belong to IGP domain 1. AGG 503, AGG 504, RC 505, and RC 506 belong to IGP domain 2. ASBR 507, ASBR 508, AGG 509, and AGG 510 belong to EBGP domain 1. P device 509, P device 510, ASBR 511, and ASBR 512 belong to EBGP domain 2. The AGG 503 is connected to the RC 505 and RC 506, the RC 506 is connected to the ASBR 507, the RC 506 is further connected to the ASBR 508, and the ASBR 508 is further connected to the ASBR 507. RC 505 receives ASBR 511 routing information from ASBR 507, and determines that a next-hop network device of a primary forwarding path from RC 505 to ASBR 511 is ASBR 507, and an exit interface is an interface of a ML / ZO IOZ direct link between RC 505 and ASBR 507. Additionally, RC 505 may receive ASBR 511 routing information from RC 506, and determine that a next hop network device of a backup forwarding path from RC 505 to ASBR 511 is AGG 503, and an egress interface is an egress interface of a direct link between RC 505 and AGG 503. After RC 505 receives a packet whose destination device is ASBR 511 from AGG 503, if the primary forwarding path to ASBR 511 is faulty or ASBR 507 is faulty, RC 505 may forward the packet to AGG 503, and AGG 503 forwards the packet to RC 506, so that RC 506 may forward the packet to the destination device ASBR 511 using ASBR 508. However, if conventionally, in case of failure between RC 506 and ASBR 508, RC 506 returns the packet to RC 505, thus forming a loop, resulting in resource waste and network congestion. The network architecture shown in FIGURE 19 is used as an example. FIGURE 20A and FIGURE 20B are a flow diagram of a packet forwarding method in the network architecture. The package shipping method includes the following steps. S901: The RC 505 obtains an A3:: / 48 IP address from the ASBR 511, and generates, based on the A3:: / 48 IP address of the ASBR 511, a forwarding entry 23 of a primary forwarding path to the ASBR 511. In this embodiment of this application, the RC 505 can be considered the first network device above. A next-hop network device on the primary forwarding path from RC 505 to ASBR 511 is ASBR 507. See Table 13. Forwarding entry 23 includes the IP address A3:: / 48 of ASBR 511 and an exit interface, and the exit interface is an exit interface of a forward link to ASBR 507. Ml / Zo Ioz Table 13 Identifier of a forwarding entry Destination address Output interface 23 A3 :: / 48 Output interface of a direct link to the ASBR 507 902: The RC 506 obtains the A3:: / 48 IP address of the ASBR 511, and generates, based on the A3:: / 48 IP address of the ASBR 511, a forwarding entry 24 of a primary forwarding path to the ASBR 511. In this embodiment of this application, the RC 506 can be considered as the second network device above. A next-hop network device on the primary forwarding path from RC 506 to ASBR 511 is ASBR 508. See Table 14. Forwarding entry 24 includes the IP address A3:: / 48 of ASBR 511 and an exit interface, and the exit interface is an exit interface of a forward link to ASBR 508. ML / t / ZUZZ / UZO IOZ Table 14 Identifier of a forwarding entry Destination address Output interface 24 A3 :: / 48 Output interface of a direct link to the ASBR 508 S903: RC 506 sends an M1 packet to RC 505, where the M1 packet includes a SID of RC 506, and the SID may be an IP address A1::1002:0:999. The SID A1::1002:0:999 is not only used as an IP address of the RC 506 to identify the RC 506, but may also be used as the indication identifier B in the embodiment shown in FIGURE 5 to have an indication function indicating that the RC 506 has the capability to support avoiding the use of a backup forwarding path to forward a packet. S904: RC 505 receives the M1 packet, and generates, based on the IP address of RC 505, a tunnel to RC 506, to obtain an exit interface of the tunnel. The network devices the tunnel passes through can be RC 505, AGG 503, and RC 506, and the tunnel can be considered as the first forwarding path above. S905: RC 505 generates a forwarding entry 25. See Table 15. Forwarding entry 25 includes the IP address of ASBR 511, the IP address of RC 506, and an exit interface. Table 15 Identifier of a forwarding entry Destination address Repair list Exit interface 25 A3 :: / 48 A1 ::1002:0:999 Exit interface of a tunnel S906: RC 505 receives an M2 packet from AGG 503, where the M2 packet includes the IP address of ASBR 511. In this embodiment of this application, the ASBR 511 may be considered as the prior target device. S907: The RC 505 determines, based on the IP address of the ASBR 511, that the primary forwarding path (i.e., the forward link egress interface to the ASBR 507) to the ASBR 511 is faulty (e.g., forwarding entry 23 is not matched), and then the RC 505 matches forwarding entry 25 based on the IP address of the ASBR 511 to obtain the IP address A1::1002:0:999 of the RC 506 and an identifier of the tunnel egress interface. If the primary forwarding path to ASBR 511 is not faulty, RC 505 may send packet M2 to ASBR 507, such that ASBR 507 sends packet M2 to ASBR 511 via P device 509. S908: RC 505 adds an indication identifier B to packet M2, to obtain a packet M3, where the indication identifier B is A1::1002:0:999. In this embodiment of this request, a value of the indication identifier B is the same as a value of the indication identifier A. Additionally, the indication identity B is not only used to identify the IP address of the RC 506, but is also used to instruct the RC 506 to avoid using the backup path to send the M3 packet to the ASBR 511. The M3 packet includes an IPv6 packet header and an SRH. The IPv6 packet header includes a destination address, namely the IP address A1::1002:0:999 of RC 506. The SRH includes an IP address A3:: / 48 of ASBR 511 and a SID A1::1002:0:999 of RC 506. S909: RC 505 sends packet M3 to RC 506. S910: RC 506 receives packet M3, and obtains forwarding entry 24 through matching based on the IP address A3:: / 48 of ASBR 511 in packet M3, where forwarding entry 24 corresponds to the primary forwarding path to ASBR 511. If the match is successful, packet M3 is sent using the primary forwarding path. If the match fails, even though RC 506 has a backup forwarding path to ASBR 511, packet M3 is discarded. Specifically, after receiving the M3 packet, the RC 506 replaces the destination address in a header of the M3 packet with the IP address A3:: / 48 of the ASBR 511, and obtains the forwarding entry 24 through matching based on the IP address A3:: / 48 of the ASBR 511. The primary forwarding path from RC 506 to ASBR 511 is RC 506->ASBR 508->ASBR 510->P device 509->ASBR 511. The backup forwarding path from RC 506 to ASBR 511 may be, for example, RC 506->RC 505->ASBR 507->P device 509->ASBR 511. It should be noted that the descriptions of Indication Identifier A and Indication Identifier B in the above three application scenarios do not constitute a limitation. ML / ZO IOZ of the technical solutions of this application, and those skilled in the art can make a design based on the descriptions of the embodiment shown in FIGURE 5. FIGURE 21 is a schematic diagram of a possible structure of the network device in the above embodiments. The network device 2100 may implement functions of the first network device in the embodiment shown in FIGURE 5. Alternatively, the network device 2100 may implement functions of the AGG 204 in the embodiment shown in FIGURE 15A, FIGURE 15B, and FIGURE 15C, the AGG 304 in the embodiment shown in FIGURE 17A and FIGURE 17B, or the RC 505 in the embodiment shown in FIGURE 20A and FIGURE 20B. See FIGURE 21. The network device 2100 includes a processing unit 2101 and a sending unit 2102. These units may perform the corresponding functions of the first network device in the above method examples. The processing unit 2101 is configured to support the network device 2100 in performing S503 to S505 in FIGURE 5.The sending unit 2102 is configured to support the network device 2100 in performing S506 in FIG. 5 , and / or other processing performed by the first network device in the technology described in this disclosure. For example, the processing unit 2101 is configured to perform various processing operations performed by the first network device in the above method embodiments; and the sending unit 2102 is configured to perform a packet sending operation performed by the first network device in the above method embodiments. For example, the processing unit 2101 is configured to obtain a first packet destined for a destination device, and add a first indication identifier to the first packet to generate a second packet.The first indication identifier is used to instruct a second network device to avoid using a backup forwarding path from the second network device to the destination device to send the second packet to the destination device. The sending unit 2102 is configured to send the second packet to the second network device using a first forwarding path. For a specific execution process, see the detailed descriptions of the corresponding steps in the embodiment shown in FIGURE 5, FIGURE 15A to FIGURE 15C, FIGURE 17A and FIGURE 17B, or FIGURE 20A and FIGURE 20B. The details are not described again herein. It should be noted that, in this embodiment of this application, the division into units is an example, and is simply a logical division of function. In actual implementation, another form of division may be used. The functional units in the embodiments of this application may be integrated into a processing unit, or each of the units may exist alone physically, or two or more units are integrated into a single unit. For example, in the embodiment, the processing unit and the sending unit ML / ZO IOZ can be the same unit or different units. The integrated unit can be implemented in hardware, or it can be implemented as a functional software unit. FIGURE 22 is a schematic diagram of a possible structure of the network device in the above embodiments. The network device 2200 may implement functions of the second network device in the embodiment shown in FIGURE 5. Alternatively, the network device 2200 may implement functions of the AGG 205 in the embodiment shown in FIGURE 15A, FIGURE 15B, and FIGURE 15C, the AGG 305 in the embodiment shown in FIGURE 17A and FIGURE 17B, or the RC 506 in the embodiment shown in FIGURE 20A and FIGURE 20B. See FIGURE 22. The network device 2200 includes a receiving unit 2201 and a processing unit 2202. These units may perform corresponding functions of the second network device in the above method examples. The receiving unit 2201 is configured to assist the network device 2200 in performing S507 in FIGURE 5.The processing unit 2202 is configured to assist the network device 2200 in performing S508 and S509 in FIG. 5. For example, the receiving unit 2201 is configured to perform a packet receiving step performed by the second network device in the above method embodiments, and the processing unit 2203 is configured to perform various packet processing steps performed by the second network device in the above method embodiments. For example, the receiving unit 2201 is configured to receive a first packet destined for a destination device. The first packet is from a first network device, and the first packet includes a first indication identifier.The processing unit 2202 is configured to: determine that a primary forwarding path from the second network device to the destination device is unreachable; and in response to the determination that the primary forwarding path is unreachable, avoid, based on an indication of the first indication identifier, using a backup forwarding path to send the first packet to the destination device. The backup forwarding path is a path from the second network device to the destination device. For a specific execution process, see detailed descriptions of corresponding steps in the embodiment shown in FIG. 5 , FIG. 15A to FIG. 15C , FIG. 17A and FIG. 17B , or FIG. 20A and FIG. 20B . The details are not described again herein. See FIGURE 23. An embodiment of the present invention provides a packet processing system 2300. The system 2300 is configured to implement the packet processing method in the above embodiments. The system 2300 includes a network device 2301 and a network device 2302. The network device 2303 is configured to transmit packets to a network server 2304. The packet processing system 230 ... ML / ZO IOZ network 2301 may implement functions of the first network device in the embodiment shown in FIGURE 5 or functions of network device 2100 in FIGURE 21. Network device 2302 may implement functions of the second network device in the embodiment shown in FIGURE 5 or functions of network device 2200 in FIGURE 22. Network device 2301 may further implement functions of AGG 204 in the embodiment shown in FIGURE 15A, FIGURE 15B, and FIGURE 15C, AGG 304 in the embodiment shown in FIGURE 17A and FIGURE 17B, or RC 505 in the embodiment shown in FIGURE 20A and FIGURE 20B. The network device 2301 may further implement functions of the AGG 205 in the embodiment shown in FIGURE 15A, FIGURE 15B, and FIGURE 15C, the AGG 305 in the embodiment shown in FIGURE 17A and FIGURE 17B, or the RC 506 in the embodiment shown in FIGURE 20A and FIGURE 20B.For a specific execution process, refer to the detailed descriptions of the corresponding steps in the embodiment shown in FIGURE 5, FIGURE 15A to FIGURE 15C, FIGURE 17A and FIGURE 17B, or FIGURE 20A and FIGURE 20B. The details are not described again herein. FIGURE 24 is a schematic diagram of the structure of a device 2400 in accordance with an embodiment of this application. The network device 2100 of FIGURE 21 and the network device 2200 of FIGURE 22 may be implemented using the device shown in FIGURE 24. See FIGURE 24. The device 2400 includes at least one processor 2401, a communications bus 2402, and at least one network interface 2404. Optionally, the device 2400 may further include a memory 2403. The processor 2401 may be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits (ICs) for controlling program execution of the solutions of this application. The processor may be configured to process a packet, to implement the packet forwarding method provided in the embodiments of this application. For example, when the first network device of FIG. 5 is implemented using the device shown in FIG. 24 , the processor may be configured to obtain a first packet destined for a destination device, and add a first indication identifier to the first packet to generate a second packet. The first indication identifier is used to indicate a second network device to avoid using a backup forwarding path from the second network device to the destination device to send the second packet to the destination device. For implementation of specific functions, see a processing portion corresponding to the first network device in method embodiments. For another example, when the second network device of FIG. 5 is implemented using the device In the embodiment of the second network device IOZ shown in FIG. 24, the processor may be configured to determine that a primary forwarding path from the second network device to a destination device is unreachable. In response to the determination that the primary forwarding path is unreachable, the processor, based on an indication of a first indication identifier, avoids using a backup forwarding path to send a first packet to the destination device. The backup forwarding path is a path from the second network device to the destination device. For implementation of specific functions, refer to the second network device processing portion in the method embodiments. The communications bus 2402 is configured to transmit information between the processor 2401, the network interface 2404, and the memory 2403. The memory 2403 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions. The memory 2403 may alternatively be a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or it may be a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, and the like), a disk storage medium or other magnetic storage device, or any other medium that can be configured to carry or store program code intended in the form of an instruction or data structure and that is accessible by a computer.However, memory 2403 is not limited to these. Memory 2403 may exist independently and be connected to processor 2401 using communications bus 2402. Alternatively, memory 2403 may be integrated with processor 2401. Optionally, memory 2403 is configured to store program code or instructions for executing the solutions of this application, and processor 2401 controls the execution. Processor 2401 is configured to execute the program code or instructions stored in memory 2403. The program code may include one or more software modules. Optionally, processor 2401 may alternatively store program code or instructions for executing the solutions of this application. In this case, processor 2401 does not need to read the program code or instructions from memory 2403. The network interface 2404 may be a device such as a transceiver, and is configured to communicate with another device or with a communications network. The communications network may be an Ethernet, a radio access network (RAN), a landline area network (LAN), or a wireless network. ML / ZO IOZ wireless local area network (WLAN), or the like. In this embodiment of this application, the network interface 2404 may be configured to receive a packet sent by another node in a segment routing network, or may forward a packet to another node in a segment routing network. The network interface 2404 may be an Ethernet interface (Ethernet), a fast Ethernet interface (FE), a gigabit Ethernet interface (GE), or the like. In a specific implementation, in one embodiment, the device 2400 may include a plurality of processors such as the processor 2401 and a processor 405 in FIG. 24. Each of the processors may be a single-core processor (single-CPU), or may be a multi-core processor (multi-CPU). The processor herein may be one or more processing devices, circuits, and / or cores configured to process data (e.g., computer program instructions). FIGURE 25 is a schematic diagram of the structure of a device 2500 in accordance with an embodiment of this application. The first network device and the second network device of FIGURE 5 may be implemented using the device shown in FIGURE 25. See the schematic diagram of the device structure shown in FIGURE 25. The device 2500 includes a main control card and one or more interface cards. The main control card communicates with the interface card. The main control card is also referred to as the main processing unit (MPU) or route processor card. The main control card includes a CPU and memory, and is responsible for controlling and managing each component of the device 2500, including route calculation and device management and maintenance functions.The interface card is also referred to as a line processing unit (LPU) or line card, and is configured to receive and send a packet. In some embodiments, the main control card communicates with the interface card via a bus, or the interface cards communicate with each other via a bus. In some embodiments, the interface cards communicate with each other via a switch card. In this case, the device 2500 also includes a switch card. The switch card is communicatively connected to the main control board and the interface cards, and is configured to send data between the interface cards. The switch card may also be referred to as a switch fabric unit (SFU). The interface card includes a CPU, memory, a forwarding engine, and an interface card (IC).The interface card may include one or more network interfaces. The network interface may be an Ethernet interface, a FE interface, a GE interface, or the like. The CPU is communicatively connected to the memory, the forwarding engine, and the interface card. The memory is configured to store a forwarding information table. The forwarding engine is configured to forward a received packet based on the forwarding information table stored in the memory. If a destination address of the received packet is an IP address of the device 2500, the forwarding engine sends the packet to the CPU of the main control card or the CPU of the interface board for processing. If a destination address of the received packet is not an IP address of the device 2500, the forwarding engine searches the forwarding information table based on the destination address. If a next hop and an output interface corresponding to the destination address are found in the forwarding information table, the forwarding engine forwards the packet to the output interface corresponding to the destination address. The forwarding engine may be a network processor (NP).The interface card, also referred to as a subcard, may be installed on the interface board. The interface card is responsible for converting an optical / electrical signal into a data frame, checking the validity of the data frame, and forwarding the data frame to the forwarding engine for processing or to the CPU of the interface card. In some embodiments, the CPU may also perform a forwarding engine function, for example, by implementing software forwarding based on a general-purpose CPU, such that a forwarding engine is not required on the interface board. In some embodiments, the forwarding engine may be implemented using an ASIC or a field programmable gate array (FPGA). In some embodiments, the memory storing the forwarding information table may alternatively be integrated into the forwarding engine and used as part of the forwarding engine. An embodiment of this application further provides a system-on-chip, including a processor. The processor is coupled to a memory, and the memory is configured to store a program or instructions. When the program or instructions are executed by the processor, the system-on-chip is enabled to implement the method of the first network device or the second network device in the embodiment shown in FIG. Optionally, there may be one or more processors on the system chip. The processor may be implemented using hardware, or it may be implemented using software. When the processor is implemented using hardware, the processor may be a logic circuit, an integrated circuit, or the like. When the processor is implemented using software, the processor may be a general-purpose processor, and is implemented by reading software code stored in memory. Optionally, there may also be one or more memories on the system chip. The memory may be integrated with the processor, or it may be separate from the processor. This is not ML / ZO IOZ limited in this application. For example, the memory may be a non-transitory processor, e.g., a read-only ROM. The memory and processor may be integrated on a single chip, or they may be arranged separately on different chips. The type of memory and the arrangement of the memory and processor are not specifically limited in this application. For example, the system on chip may be an FPGA, an ASIC, a system on chip (SoC), a CPU, a NP, a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or another integrated chip. It should be understood that the steps of the above method embodiments may be implemented using a hardware integrated logic circuit in the processor, or using software instructions. The steps of the method disclosed in the embodiments of this application may be performed directly by a hardware processor, or they may be performed using a combination of hardware in the processor and a software module. An embodiment of this application further provides a computer-readable storage medium, including instructions. When the instructions are executed on a computer, the computer is enabled to perform the methods in the embodiments of this application. In the description, claims, and drawings accompanying this application, the terms "first, second, third, fourth, and the like" are intended to distinguish similar objects, but need not be used to describe a specific order or sequence. It should be understood that data designated as such are interchangeable under appropriate circumstances, such that the embodiments described herein may be implemented in orders other than those illustrated or described herein. Additionally, the terms "include" and "have" and any other variants refer to non-exclusive inclusion. For example, a process, method, system, product, or device that includes a list of steps or units is not necessarily limited to the steps or units expressly listed, but may include other steps or units not expressly listed or inherent to said process, method, product, or device. In this application, at least one means one or more, and a plurality of means two or more. At least one of the following pieces or a similar expression thereof refers to any combination of these pieces, including any combination of singular pieces or plural pieces. For example, at least one piece of a, b, or c may represent: a, b, c, ayb, ayc, byc, or a, b, yc, where a, b, and c may be singular or plural. In this application, A and / or Ml / Zo Ioz B includes only A, only B, and A and B. Those skilled in the art can clearly understand that, for the purpose of a convenient and concise description, a detailed working process of the above system, apparatus, and unit is referred to a corresponding process in the previous embodiments. The details are not described again herein. In the various embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the apparatus embodiments described are merely examples. For example, the division into units is merely the logical division of modules. In actual application, there may be other forms of division. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not realized. Additionally, the mutual couplings shown or discussed, or direct couplings or communication connections, may be implemented using some interfaces. Indirect couplings or communication connections between apparatus or units may be implemented electrically, mechanically, or otherwise. The units described as separate parts may or may not be physically separate, and the parts shown as units may or may not be physical units, may be located in one location, or may be distributed across a plurality of network units. Some or all of the units may be obtained depending on the actual requirement for implementing the objectives of the solutions in the embodiments. Additionally, the module units in the embodiments of this application may be integrated into a processing unit. Alternatively, each of the units may exist physically alone, or at least two units may be integrated into a single unit. The integrated unit may be implemented in hardware or as a software module unit. When the integrated unit is implemented in the form of a software module unit and is sold or used as a stand-alone product, the integrated unit may be stored on a computer-readable storage medium. Based on this understanding, the technical solutions of this application, essentially, or the portion contributing to conventional technology, or all or some of the technical solutions, may be implemented in the form of a software product. The computer software product is stored on a storage medium and includes several instructions for instructing a computing device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the methods in the embodiments of this application. The storage medium includes any medium capable of storing program code, such as a USB flash drive, a removable hard drive, ΜΛ / ZO IOZ a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk. Those skilled in the art should be aware that, in the foregoing examples, the functions described in the present invention may be implemented by hardware, software, firmware, or any combination thereof. When the functions are implemented by software, the foregoing functions may be stored on a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that allows a computer program to be transmitted from one location to another. The storage medium may be any medium available and accessible to a general-purpose or special-purpose computer. The objectives, technical solutions, and beneficial effects of the present invention are described in more detail in the specific embodiments above. It should be understood that the above descriptions are merely specific implementations of the present invention. In conclusion, the foregoing embodiments are intended only to describe the technical solutions of this application, but do not limit this application. Although this application is described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent substitutions for certain technical features thereof, without departing from the scope of the technical solutions of the embodiments of this application.

Claims

1. A packet forwarding method, characterized in that it comprises: obtaining, by a first network device, a first packet destined for a destination device; adding, by means of the first network device, a first indication identifier to the first packet to generate a second packet, wherein the first indication identifier is used to instruct a second network device to avoid using a backup forwarding path from the second network device to the destination device to send the second packet to the destination device; and sending, by means of the first network device, the second packet to the second network device using a first forwarding path.

2. The method according to claim 1, characterized in that the first forwarding path is a backup forwarding path from the first network device to the destination device, and before sending, by the first network device, the second packet to the second network device using a first forwarding path, the method further comprises: determining, by means of the first network device, that a second forwarding path to the destination device is unreachable, wherein the second forwarding path is a primary forwarding path from the first network device to the destination device.

3. The method according to claim 2, characterized in that the first packet comprises an Internet protocol (IP) address of the destination device, the first forwarding path is a forwarding path corresponding to a summary route from the first network device to the destination device, the second forwarding path is a forwarding path corresponding to a specific route from the first network device to the destination device, and the determination, by the first network device, that a second forwarding path to the destination device is unreachable comprises: the first network device not obtaining the specific route to the destination device through matching based on the IP address of the destination device;or obtain, through the first network device, the specific route to the destination device by matching based on the IP address of the destination device, and determining that the forwarding path corresponding to the specific route is unreachable.

4. The method according to any of claims 1 to 3, characterized in that the addition, by the first network device, of a first indication identifier to the first packet to generate a second packet comprises: adding, by means of the first network device, a segment routing header (SRH) to the first packet to generate the second packet, wherein the first indication identifier is carried in the SRH.

5. The method according to claim 4, characterized in that the first indication identifier is carried in an indicator field (Flags), a label field (TAG) or a type length value (TLV) of the SRH.

6. The method according to claim 4, characterized in that the SRH comprises a list of segment identifiers, and the list of segment identifiers comprises the first indication identifier.

7. The method according to claim 6, characterized in that the segment identifier list comprises a segment identifier of the second network device; and a portion of the locator of the segment identifier of the second network device comprises the first indication identifier, or a functional portion of the segment identifier of the second network device comprises the first indication identifier.

8. The method according to claim 2, characterized in that the first packet comprises a label of the destination device, the first forwarding path is a forwarding path corresponding to the backup forwarding information in a label forwarding entry corresponding to the label of the destination device, and the determination, by the first network device, that a second forwarding path to the destination device is unreachable comprises: obtaining, by means of the first network device, the label forwarding entry through matching based on the label of the destination device, and determining that a forwarding path corresponding to the primary forwarding information in the label forwarding entry is unreachable.

9. The method according to claim 1, 2 or 8, characterized in that the addition, by the first network device, of a first indication identifier to the first packet to generate a second packet comprises: adding, by means of the first network device, a stack of labels to the first packet to generate the second packet, wherein the stack of labels comprises the first indication identifier.

10. The method according to claim 9, characterized in that the ML / ZO IOZ label stack comprises a second network device label, a special label and the target device label, the second network device label being adjacent to the special label, and the special label comprising the first indication identifier; or the label stack comprises a second network device label and the target device label, and the second network device label comprising the first indication identifier.

11. The method according to any one of claims 1 to 10, characterized in that prior to the sending, by the first network device, of the second packet to the second network device using a first forwarding path, the method further comprises: receiving, by means of the first network device, a third packet from the second network device, wherein the third packet comprises an identifier of the second network device and a second indication identifier, and the second indication identifier is used to identify that the second network device supports a capability to avoid the use of a backup path to forward a packet;and generating, by means of the first network device based on the second indication identifier, a forwarding entry corresponding to the first forwarding path, wherein the forwarding entry corresponding to the first forwarding path comprises a destination device identifier and forwarding information corresponding to the first forwarding path, the forwarding information comprising a stack of labels or a list of segment identifiers, the stack of labels or the list of segment identifiers comprising the identifier of the second network device, and the identifier of the second network device comprising the segment identifier of the second network device or the label of the second network device.

12. The method according to claim 11, characterized in that the third packet comprises an endpoint segment identifier type length value field (End SID TLV), and the endpoint SID TLV comprises the second indication identifier.

13. The method according to claim 11, characterized in that the third packet comprises a prefix segment identifier type length value field (prefix SID TLV), and the prefix SID TLV field comprises the second indication identifier.

14. The method according to any of claims 1 to 13, characterized in that the backup forwarding path passes through the first network device. ML / ZO IOZ 15. The method according to any of claims 1 to 14, characterized in that the first packet originates from a third network device, the third network device belongs to a first network domain, and the destination device belongs to a second network domain.

16. The method according to any of claims 1 to 15, characterized in that the first network domain is a zone of a backbone network, the second network domain is a zone of an access network, the first network device is a network device connected to the access network and the backbone network, and the first forwarding path is a forwarding path in the backbone network.

17. A packet forwarding method, characterized in that it comprises: receiving, by means of a second network device, a first packet destined for a destination device, wherein the first packet is from a first network device, and the first packet comprises a first indication identifier; determining, by means of the second network device, that a primary forwarding path from the second network device to the destination device is unreachable; and in response to the determination that the primary forwarding path is unreachable, avoiding, on the part of the second network device based on an indication from the first indication identifier, the use of a backup forwarding path to send the first packet to the destination device, wherein the backup forwarding path is a path from the second network device to the destination device.

18. The method according to claim 17, characterized in that the first packet comprises an Internet protocol (IP) address of the destination device, the primary forwarding path is a primary forwarding path corresponding to a summary route from the second network device to the destination device, the backup forwarding path is a backup forwarding path of the summary route, and the determination, by the second network device, that a primary forwarding path from the second network device to the destination device is unreachable comprises: obtaining, by means of the second network device, the summary route through matching based on the IP address of the destination device, and determining that the primary forwarding path of the summary route is unreachable.

19. The method according to claim 17, characterized in that the first packet comprises an IP address of the destination device, the primary forwarding path is a forwarding path corresponding to a specific route from the second network device to the destination device, the backup forwarding path is a forwarding path corresponding to a summary route from the second network device to the destination device, and the determination, by the second network device, that a primary forwarding path from the second network device to the destination device is unreachable comprises: the second network device not obtaining the specific route through matching based on the IP address of the destination device;or obtain, through the second network device, the specific route through matching based on the IP address of the destination device, and determine that the forwarding path corresponding to the specific route is unreachable.

20. The method according to any of claims 17 to 19, characterized in that the first packet is an Internet version 6 (SRv6) Segment Routing Packet, and an SRH Segment Routing Header of the SRv6 packet comprises the first indication identifier.

21. The method according to claim 20, characterized in that the SRH comprises a list of segment identifiers, and the list of segment identifiers comprises the first indication identifier.

22. The method according to claim 20 or 21, characterized in that prior to the determination by the second network device that a primary forwarding path to the destination device is unreachable, the method further comprises: determining, by means of the second network device, that a destination address of the SRv6 packet is an IP address of the second network device, and obtaining, by means of the second network device, an identifier of the destination device from the list of segment identifiers of the SRv6 packet; and modifying, by the second network device, the destination address of the SRv6 packet to the identifier of the destination device;and the determination, by the second network device, that a primary forwarding path to the destination device is unreachable comprises: determining, by the second network device based on the destination address of the SRv6 packet, that the primary forwarding path to the destination device is unreachable.

23. The method according to claim 17, characterized in that the first packet is a multiprotocol label-switching MPLS packet, and a label stack of the first packet comprises the first indication identifier.

24. The method according to claim 23, characterized in that the first packet comprises a destination device label, the label stack comprises a second network device label, a special label and the destination device label, and the special label comprises the first indication identifier; or the label stack comprises a second network device label and the destination device label, and the second network device label comprises the first indication identifier.

25. The method according to claim 23 or 24, characterized in that the determination, by the second network device, that a primary forwarding path from the second network device to the destination device is unreachable comprises: determining, by the second network device, that a top label in the label stack is the label of the second network device; and in response to the determination that the top label in the label stack is the label of the second network device, obtaining, by matching based on the label of the destination device, a label forwarding table to the destination device, and determining that the primary forwarding path corresponding to the primary forwarding information in the label forwarding table is unreachable.

26. The method according to claim 24, characterized in that the second network device, based on an indication from the first indication identifier, avoids using a backup forwarding path to send the first packet to the destination device, comprises: determining, by the second network device, that a next-layer label of the second network device's label in the label stack is the special label; and in response to the determination that the next-layer label of the second network device's label in the label stack is the special label, avoids using the backup forwarding path corresponding to the backup forwarding information in a label forwarding table to send the first packet to the destination device.

27. The method according to any of claims 17 to 26, characterized in that the backup forwarding path passes through the first network device.

28. The method according to any of claims 17 to 27, characterized in that the method further comprises: sending, by means of the second network device, a second packet to the first network device, wherein the second packet comprises an identifier of the second network device and a second indication identifier, the second indication identifier being used to indicate that the second network device supports a capability to avoid the use of a backup path to forward a packet, and the identifier of the second network device comprises the IP address of the second network device or the ML / ZO IOZ label of the second network device.

29. The method according to any of claims 17 to 28, characterized in that after preventing, by means of the second network device based on an indication of the first indication identifier, the use of a backup forwarding path to send the first packet to the destination device, the method further comprises: discarding, by the second network device, the first packet.

30. A network device, applied to a network system comprising a plurality of network devices, characterized in that the plurality of network devices comprises a first network device and a second network device, the network device being the first network device, and the network device comprising: a processing unit, configured to obtain a first packet intended for a destination device, and add a first indication identifier to the first packet to generate a second packet, wherein the first indication identifier is used to instruct the second network device to avoid using a backup forwarding path from the second network device to the destination device to send the second packet to the destination device; and a sending unit, configured to send the second packet to the second network device using a first forwarding path.

31. A network device, applied to a network system comprising a plurality of network devices, characterized in that the plurality of network devices comprises a first network device and a second network device, the network device being the second network device, and the network device comprising: a receiving unit, configured to receive a first packet destined for a destination device, characterized in that the first packet is from the first network device, and the first packet comprises a first indication identifier; and a processing unit, configured to: determine that a primary forwarding path from the second network device to the destination device is unreachable;and in response to the determination that the primary forwarding path is unreachable, avoid, based on an indication from the first indication identifier, the use of a backup forwarding path to send the first packet to the destination device, wherein the backup forwarding path is a path from the second network device to the destination device.

32. A network system, characterized in that the network system comprises the first network device according to claim 30 and the second network device according to claim 31. ML / ZO IOZ 33. A computer-readable storage medium, characterized in that it comprises instructions, a program, or code, wherein when the instructions, program, or code are executed on a computer, the computer is enabled to perform the method according to any one of claims 1 to 29.

34. A chip, characterized in that it comprises a memory and a processor, wherein the memory is configured to store instructions or program code, and the processor is configured to invoke the instructions or program code from the memory and execute the instructions or program code to carry out the method according to any one of claims 1 to 29.