Packet forwarding method, device and system

By using planning information in the SRv6 network node to determine the second segment identifier, the problem that the node on the previous hop of the faulty node cannot be forwarded on behalf of the compressed SID scenario is solved, and forwarding of the message is realized by bypassing the faulty node, ensuring SRv6 endpoint fault protection. .

WO2024174967A1PCT designated stage expired Publication Date: 2024-08-29HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/077622
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-12
Filing Date
2024-02-19
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

In the SRv6 technology that supports compressed SIDs, the previous hop node of the faulty node cannot determine the active SID in the segment list based on the SL pointer, and therefore cannot perform the proxy forwarding operation, resulting in the failure of the packet to bypass the faulty node.

Method used

By using planning information in the network node to determine the second segment identification, including block field length, node identification field length, compression function field length, non-compression function field length, parameter field length and other information, it replaces the purpose of the failed node update message address to achieve proxy forwarding.

Benefits of technology

In the compressed SID scenario, the previous hop node of the faulty node can determine and update the next SID in the message, ensuring that the message can be forwarded bypassing the faulty node, and realizing SRv6 endpoint fault protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024077622_29082024_PF_FP_ABST
    Figure CN2024077622_29082024_PF_FP_ABST
Patent Text Reader

Abstract

A packet forwarding method, device and system, relating to the technical field of networks. A destination address field of a first packet received by a first network node comprises a compression segment identifier, the compression segment identifier corresponding to a first egress interface or a next-hop node of the first network node; on the basis that the first egress interface fails or the next-hop node fails, the first network node determines a second segment identifier according to segment identifier planning information of a node corresponding to the compression segment identifier and forwards the first packet according to the second segment identifier, the second segment identifier being a segment identifier in a segment list of the first packet or a segment identifier in the destination address field. In the present application, when an egress interface or a next-hop node of a network node fails, the network node determines a next-segment identifier according to segment identifier planning information of the network node or segment identifier planning information of the next-hop node, so that a packet is forwarded bypassing a failed interface or a failed node.
Need to check novelty before this filing date? Find Prior Art

Description

Message forwarding method, device and system

[0001] This application claims priority to a Chinese patent application filed on February 25, 2023, with application number 202310206316.5 and title “A Method for Implementing SRv6 Extension Header Compression”, and claims priority to a Chinese patent application filed on June 12, 2023, with application number 202310696717.3 and title “Message Forwarding Method, Apparatus and System”. The entire contents of these two patent applications are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of network technology, and in particular to a message forwarding method, device and system. Background Art

[0003] Segment routing internet protocol version 6 (SRv6) messages include a segment list and a segment left (SL) pointer. In traditional SRv6 technology, the segment list includes multiple segment identifiers (SIDs), each of which is 128 bits long. The SL pointer is used to indicate the active SID in the segment list (referred to as the active SID). When forwarding the SRv6 message, the network node determines the active SID in the segment list based on the SL pointer, uses the active SID to update the destination address (DA) of the SRv6 message, and forwards the SRv6 message based on the updated DA.

[0004] SRv6 endpoint fault protection is a fault handling technology. When a network node equipped with SRv6 endpoint fault protection detects a failure in its next-hop node while forwarding an SRv6 message, it processes the SRv6 message on behalf of the next-hop node. For example, the network node determines the active SID in the segment list of the SRv6 message based on the SL pointer in the SRv6 message, updates the DA of the SRv6 message with the active SID, and forwards the SRv6 message based on the updated DA, thereby allowing the SRv6 message to bypass the failed node.

[0005] To reduce redundant information in SRv6 messages, the industry has proposed the concept of compressed SIDs. A compressed SID is less than 128 bits long. In contrast, a conventional 128-bit SID is called an uncompressed SID. In SRv6 technologies that support compressed SIDs, segment lists support mixed encoding of compressed and uncompressed SIDs. The 128-bit space in the segment list of an SRv6 message can be defined as a SID container. Thus, the segment list of an SRv6 message includes multiple SID containers, each of which carries one uncompressed SID or multiple compressed SIDs. The SL pointer in the SRv6 message indicates the active SID container in the segment list. However, a SID container may carry multiple compressed SIDs. This means that if a network node's next-hop node fails, the network node cannot determine the active SID in the segment list based on the SL pointer on behalf of the next-hop node, thus failing to perform proxy forwarding operations.

[0006] Summary of the Invention

[0007] This application provides a message forwarding method, device, and system that can solve the problem in a compressed segment identification scenario where the previous hop node of a faulty node cannot perform proxy forwarding operations on behalf of the faulty node. The technical solution of this application is as follows:

[0008] In a first aspect, a message forwarding method is provided, the method comprising: a first network node receives a first message, the destination address field of the first message includes a first segment identifier, the first segment identifier is a compressed segment identifier, the first segment identifier corresponds to a first output interface of the first network node or corresponds to a second network node, and the second network node is a next-hop node of the first network node; based on a failure of the first output interface or a failure of the second network node, the first network node determines a second segment identifier according to planning information, the second segment identifier is a segment identifier in a segment list of the first message or the second segment identifier is a segment identifier in the destination address field, and the planning information is segment identifier planning information of the node corresponding to the first segment identifier; the first network node forwards the first message according to the second segment identifier.

[0009] The technical solution provided by the present application is that the destination address field of the first message received by the first network node includes a first segment identifier, and the first segment identifier is a compressed segment identifier. When the first segment identifier corresponds to the first output interface of the first network node and the first output interface fails, or when the first segment identifier corresponds to the next hop node of the first network node and the next hop node fails, the first network node determines the second segment identifier based on the segment identifier planning information of the node corresponding to the first segment identifier, and forwards the first message based on the second segment identifier, so that the first message is forwarded bypassing the faulty interface or faulty node. Therefore, the present application can implement endpoint fault protection in the compressed segment identifier scenario, such as implementing SRv6 endpoint fault protection.

[0010] Optionally, the planning information includes at least one of the following: the length of the block field, the length of the node identification field, the length of the compression function field, the length of the non-compression function field, the length of the parameter field, and the node identification range. Thus, in the present application, the first network node can determine the second segment identifier based on the at least one information in the planning information.

[0011] Optionally, the second segment identifier is a compressed segment identifier or a standard segment identifier, the compressed segment identifier is less than 128 bits long, and the standard segment identifier is 128 bits long. For example, the compressed segment identifier is 32 bits long or 16 bits long.

[0012] Optionally, the first segment identifier and the second segment identifier are arranged in sequence in the segment list of the first message, or the first segment identifier and the second segment identifier are arranged in sequence in the destination address field of the first message. The second segment identifier is located after the first segment identifier.

[0013] Optionally, the second segment identifier corresponds to an outbound interface or a network node, for example, the second segment identifier is an END.X SID used to characterize an interface, or the second segment identifier is an END SID used to characterize a network node. The outbound interface or network node corresponding to the second segment identifier is located downstream of the first network node.

[0014] Optionally, when the first segment identifier corresponds to the first outbound interface of the first network node, the node corresponding to the first segment identifier is the first network node; when the first segment identifier corresponds to the second network node, the node corresponding to the first segment identifier is the second network node.

[0015] That is, when the first segment identifier corresponds to the first outbound interface of the first network node and the first outbound interface fails, the first network node determines the second segment identifier based on the segment identifier planning information of the first network node; when the first segment identifier corresponds to the next hop node of the first network node and the next hop node fails, the first network node determines the second segment identifier based on the segment identifier planning information of the next hop node.

[0016] Optionally, the first network node determines the second segment identifier according to the planning information, including: the first network node determines the first segment identifier as a compressed segment identifier according to the planning information, that is, determines the type of the first segment identifier as a compressed segment identifier.

[0017] Optionally, the first network node determines the first segment identifier as a compressed segment identifier based on the planning information, including: the first network node determines the compression function field in the destination address field of the first message based on the planning information; the first network node determines the first segment identifier as a compressed segment identifier based on the value in the compression function field.

[0018] Optionally, the first network node determines that the first segment identifier is a compressed segment identifier based on the value in the compression function field, including: based on the value in the compression function field being a non-null value, the first network node determines that the first segment identifier is a compressed segment identifier. The non-null value may be 0. In the present application, the value in the compression function field of the compressed segment identifier is a non-null value, and the value in the compression function field of the non-compressed segment identifier is a null value. Therefore, the present application can determine the type of the segment identifier based on the value of the compression function field.

[0019] Optionally, the first network node determines the second segment identifier based on the planning information, including: the first network node updates the value of the remaining segment (segment left, SL) field in the first message, and the first network node determines the second segment identifier based on the updated value of the SL field; or, the first network node updates the value of the remaining compression (compression left, CL) field in the first message, and the first network node determines the second segment identifier based on the updated value of the CL field; or, the first network node traverses the destination address field of the first message to determine the second segment identifier; or, the first network node updates the value of the target field in the first message to determine the second segment identifier, the target field is included in the destination address field of the first message, and the target field is located after the block field in the destination address field.

[0020] Optionally, the planning information includes a node identifier range, and the first network node determines the second segment identifier based on the planning information, including: the first network node determines that the node identifier included in the second segment identifier is within the node identifier range based on the node identifier range. By knowing the node identifier range, the first network node can find the segment identifier that falls within the node identifier range in the segment list or DA field, that is, it can skip the adjacent segment identifier in the segment list or DA field and find the node segment identifier, thereby achieving the effect of performing a proxy forwarding operation on behalf of the failed node. In one example, the segment list of the first message includes a target container, the second segment identifier is in the target container, the SL field in the first message indicates that the target container is an active container, the first network node continuously updates the value of the CL field in the first message to traverse the content in the target container one by one with a first length (e.g., 16 bits), until it is determined that the content of the first length in the target container is within the node identifier range, the first network node determines the segment identifier in the target container that includes the content of the determined first length as the second segment identifier, and the content of the first length in the second segment identifier is the node identifier included in the second segment identifier. In another example, the second segment identifier is in the destination address field of the first message. The first network node traverses the content in the destination address field one by one according to the first length until it is determined in the destination address field that the content of the first length is within the node identifier range. The first network node determines the segment identifier in the destination address field including the determined content of the first length as the second segment identifier, and the content of the first length in the second segment identifier is the node identifier included in the second segment identifier.

[0021] Optionally, the destination address field of the first message is located in an Internet Protocol version 6 (IPv6) header of the first message.

[0022] Optionally, the method further includes: the first network node receiving first routing information, where the first routing information includes planning information.

[0023] The technical solution provided by the present application is that the first network node receives first routing information including planning information, which can facilitate the first network node to obtain the planning information, and thus determine the second segment identifier according to the planning information after receiving the first message.

[0024] Optionally, the method further includes: the first network node generating a first routing table entry according to the first routing information, where the first routing table entry includes the planning information.

[0025] The technical solution provided by the present application is that the first network node generates a first routing table entry including planning information, which can facilitate the first network node to determine the planning information according to the first routing table entry after receiving the first message, and thus determine the second segment identifier according to the planning information.

[0026] Optionally, the method further includes: based on the failure of the second network node, the first network node deleting the first routing table entry after a preset time period. The behavior of the first network node deleting the first routing table entry after the preset time period is also called slow deletion behavior.

[0027] The technical solution provided by the present application is that after the first network node determines that the second network node has failed, the first network node needs to perform a proxy forwarding operation to process the first message on behalf of the second network node. In the process of performing the proxy forwarding operation, the first network node needs to determine the second segment identifier based on the planning information in the first routing table item. If the first network node immediately deletes the first routing table item after determining that the second network node has failed, the first network node will be unable to determine the second segment identifier. Therefore, in the present application, the first network node does not immediately delete the first routing table item after determining that the second network node has failed, but deletes the first routing table item after a preset period of time. This allows the first network node to use the planning information in the first routing table item to determine the second segment identifier and perform the proxy forwarding operation after the second network node has failed and before the routing converges.

[0028] Optionally, the first routing information is location routing information or block routing information.

[0029] Optionally, the first routing information is carried in a target type-length-value (TLV) field. The target TLV field includes a first sub-TLV field and a second sub-TLV field. The first sub-TLV field is used to carry planning information, and the second sub-TLV field is used to carry a segment identifier. The first sub-TLV field and the second sub-TLV field can be located at the same level.

[0030] In a second aspect, a message forwarding method is provided, characterized in that the method includes: a second network node publishes first routing information, the first routing information includes planning information, and the planning information is segment identification planning information of the second network node.

[0031] The technical solution provided by the present application is that the second network node publishes the first routing information, which can facilitate the first network node to obtain the planning information included in the first routing information, and thus determine the second segment identifier according to the planning information after receiving the first message.

[0032] Optionally, the planning information includes a node identification range.

[0033] Optionally, the planning information includes the length of the compression function field.

[0034] Optionally, the planning information includes the length of the compressed function field and the length of the non-compressed function field.

[0035] Optionally, the planning information also includes at least one of the following: the length of the block field, the length of the node identification field, and the length of the parameter field.

[0036] Optionally, the first routing information is locator routing information or block routing information.

[0037] Optionally, the first routing information is carried in a target TLV field, which includes a first sub-TLV field and a second sub-TLV field. The first sub-TLV field is used to carry planning information, and the second sub-TLV field is used to carry a segment identifier.

[0038] In a third aspect, a message forwarding device is provided, comprising at least one module configured to execute the method provided in the first aspect or any optional embodiment of the first aspect, or the method provided in the second aspect or any optional embodiment of the second aspect. The at least one module may be implemented based on software, hardware, or a combination of software and hardware, and the at least one module may be arbitrarily combined or divided based on the specific implementation.

[0039] In a fourth aspect, a message forwarding device is provided, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory so that the message forwarding device performs the method provided in the first aspect or any optional manner of the first aspect, or the message forwarding device performs the method provided in the second aspect or any optional manner of the second aspect.

[0040] In the fifth aspect, a message forwarding device is provided, including a main control board and an interface board, wherein the main control board and the interface board are used to implement the method provided in the above-mentioned first aspect or any optional method of the first aspect, or the main control board and the interface board are used to implement the method provided in the above-mentioned second aspect or any optional method of the second aspect.

[0041] In a sixth aspect, a message forwarding system is provided, comprising a first network node and a second network node, wherein at least one of the first network node and the second network node comprises the message forwarding device provided in the third to fifth aspects above.

[0042] In the seventh aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed, it implements the method provided by the first aspect or any optional method of the first aspect, or implements the method provided by the second aspect or any optional method of the second aspect.

[0043] In the eighth aspect, a computer program product is provided, which includes a program or code, and when the program or code is executed, it implements the method provided by the first aspect or any optional manner of the first aspect, or implements the method provided by the second aspect or any optional manner of the second aspect.

[0044] In the ninth aspect, a chip is provided, which, when running, implements the method provided in the first aspect or any optional manner of the first aspect, or implements the method provided in the second aspect or any optional manner of the second aspect.

[0045] Optionally, the chip includes programmable logic circuits and / or program instructions.

[0046] The technical effects of the third to ninth aspects mentioned above can refer to the technical effects of the first to second aspects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] FIG1 is a schematic diagram of an SRv6 message;

[0048] Figure 2 is a diagram of the format of an SRv6 SID;

[0049] FIG3 is a schematic diagram of GSRv6 compression;

[0050] FIG4 is a schematic diagram of another GSRv6 compression;

[0051] FIG5 is a schematic diagram of yet another GSRv6 compression;

[0052] FIG6 is a schematic diagram of a GSID container;

[0053] FIG7 is a schematic diagram of another GSID container;

[0054] FIG8 is a schematic diagram of a GSRH;

[0055] FIG9 is a schematic diagram of a destination address field;

[0056] FIG10 is a schematic diagram of a GSRv6 message;

[0057] FIG11 is a schematic diagram of another GSRv6 message;

[0058] FIG12 is a schematic diagram of GSRv6 forwarding;

[0059] FIG13 is a schematic diagram of another GSRv6 forwarding;

[0060] FIG14 is a schematic diagram of another GSRv6 forwarding;

[0061] FIG15 is a schematic diagram of a SID container;

[0062] FIG16 is a schematic diagram of a SID container;

[0063] FIG17 is a schematic diagram of a USID message;

[0064] FIG18 is a schematic diagram of another USID message;

[0065] FIG19 is a schematic diagram of USID forwarding;

[0066] FIG20 is a schematic diagram of another USID forwarding;

[0067] FIG21 is a schematic diagram of TI-LFA forwarding;

[0068] FIG22 is a schematic diagram of SRv6 endpoint failure protection;

[0069] FIG23 is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0070] FIG24 is a diagram showing the format of an SRv6 SID in a compression scenario provided by an embodiment of the present application;

[0071] FIG25 is a diagram showing the format of an SRv6 SID in another compression scenario provided by an embodiment of the present application;

[0072] FIG26 is a flowchart of a message forwarding method provided in an embodiment of the present application;

[0073] FIG27 is a schematic diagram of a first message provided in an embodiment of the present application;

[0074] FIG28 is a schematic diagram of another first message provided in an embodiment of the present application;

[0075] FIG29 is a schematic diagram of another first message provided in an embodiment of the present application;

[0076] FIG30 is a schematic diagram of another first message provided in an embodiment of the present application;

[0077] FIG31 is a schematic diagram of another first message provided in an embodiment of the present application;

[0078] FIG32 is a schematic diagram of another first message provided in an embodiment of the present application;

[0079] FIG33 is a flowchart of another message forwarding method provided in an embodiment of the present application;

[0080] FIG34 is a schematic diagram of a message forwarding method provided in an embodiment of the present application;

[0081] FIG35 is a schematic diagram of another message forwarding method provided in an embodiment of the present application;

[0082] FIG36 is a schematic diagram of another message forwarding method provided in an embodiment of the present application;

[0083] FIG37 is a schematic diagram of another message forwarding method provided in an embodiment of the present application;

[0084] FIG38 is a schematic diagram of a message forwarding device provided in an embodiment of the present application;

[0085] FIG39 is a schematic diagram of another message forwarding device provided in an embodiment of the present application;

[0086] FIG40 is a schematic diagram of another message forwarding device provided in an embodiment of the present application;

[0087] Figure 41 is a schematic diagram of another message forwarding device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0088] The embodiments of the present application will be further described below with reference to the accompanying drawings.

[0089] The technical solution of this application involves SRv6 technology, generalized SRv6 (GSRv6) technology, USID-related technology, topology independent-loop free alternate (TI-LFA) technology, and SRv6 endpoint fault protection technology. Before introducing the technical solution of this application, SRv6 technology, GSRv6 technology, USID-related technology, TI-LFA technology, and SRv6 endpoint fault protection technology are first introduced.

[0090] 1.SRv6 technology.

[0091] The data plane message in SRv6 technology is an SRv6 message, which includes a segment routing header (SRH) and an Internet Protocol version 6 (IPv6) header. The SRH includes a segment list and a segment left (SL) pointer. The segment list includes multiple segment identifiers (SIDs). In traditional SRv6 technology, the length of each SID is 128 bits, and the SL pointer is used to indicate the active SID in the segment list. The IPv6 header includes a destination address (DA) field, which is used to carry the destination address of the SRv6 message. In the process of forwarding the SRv6 message, the network node determines the active SID in the segment list based on the SL pointer, uses the active SID to update the destination address of the SRv6 message, and forwards the SRv6 message based on the updated destination address. For example, after a network node receives an SRv6 message, if the destination address of the SRv6 message hits the local SID table (my local SID table) of the network node, the network device executes SL-- (decreases the value of the SL field by 1) to perform an SL pointer offset. The network node updates the active SID indicated by the offset SL pointer to the destination address of the SRv6 message and forwards the SRv6 message according to the updated destination address.

[0092] For example, Figure 1 is a schematic diagram of a traditional SRv6 message, which includes a payload, an SRH, and an IPv6 header. The SRH includes the following fields: next header (NH), header extension length (Hdr Ext Len), routing type (RT), segment left (SL), last entry, flags, tag, segment list, and optional type-length value (TLV). The segment list includes n SIDs (n is a positive integer), each SID is 128 bits long, and the SL field is used to carry an SL pointer, which is used to indicate the active SID in the segment list. The IPv6 header includes the following fields: version, traffic class (TC), flow label, payload length, next header, hop limit (hop limit), source address (SA), and destination address (DA). The source address is used to carry the source address of the SRv6 message, and the destination address field is used to carry the destination address of the SRv6 message. For the meaning of each field in the IPv6 header, please refer to the relevant documents of the IPv6 header. For the meaning of each field in the SRH, please refer to the relevant documents of the SRH (such as request for comments (RFC) 8754). They will not be repeated here. In the relevant documents of SRH, each SID in Figure 1 may be described as a segment list. For example, SID[0] is described as segment list[0], SID[1] is described as segment list[1], and SID[n-1] is described as segment list[n-1]. The segment lists in Figure 1 can be expressed as <segment list[1], segment list[2]...segment list[n]>. Each segment list in segment list[1], segment list[2]...segment list[n] is a SID with a length of 128 bits. This embodiment of the present application does not limit this.

[0093] 2.GSRv6 technology.

[0094] GSRv6 technology is developed based on traditional SRv6 technology. Its core concept is to eliminate redundancy. GSRv6 reduces redundant information in segment lists by compressing the SIDs (128-bit SIDs) used in traditional SRv6 technology. It is understood that SIDs in traditional SRv6 technology are uncompressed. For ease of description, SIDs in traditional SRv6 technology are referred to as traditional SIDs, traditional SRv6 SIDs, standard SIDs, or standard SRv6 SIDs. Therefore, the terms "traditional SID," "traditional SRv6 SID," "standard SID," or "standard SRv6 SID" below all refer to SIDs in traditional SRv6 technology.

[0095] GSRv6 technology involves three aspects: the standard SRv6 SID format, standard SRv6 SID compression, and GSRv6 forwarding. The following describes GSRv6 technology from these three perspectives.

[0096] 1) Standard SRv6 SID format.

[0097] A standard SRv6 SID is a 128-bit IPv6 address. Figure 2 illustrates the format of a standard SRv6 SID. As shown in Figure 2, a standard SRv6 SID consists of a block field, a node ID field, a function field, an arguments field, and a padding field. The block field carries the common prefix of the standard SRv6 SID. This common prefix is ​​the address block (also known as the address space) used to allocate the standard SRv6 SID. The node ID field carries the identifier of the network node that publishes the standard SRv6 SID, thereby identifying the network node. The node ID is unique within the SRv6 domain. The block field and the node ID field form the locator field. The common prefix carried in the block field and the node ID carried in the node ID field form a routable locator, which directs packets to the network node that publishes the standard SRv6 SID. The function field is used to carry the local function identifier of the network node that publishes the standard SRv6 SID. The function identifier is used to map to the local segment endpoint behavior of the network node to indicate the local forwarding behavior of the network node. The function identifier is unique locally on the network node. The parameter field is used to carry parameters related to the function field. Currently, in most cases, the parameter field is unused and can be set to 0. The padding field is used to pad the standard SRv6 SID to make the length of the standard SRv6 SID 128 bits to avoid byte processing errors in the network node. Generally, when the sum of the lengths of the block field, node identification field, function field, and parameter field does not reach 128 bits, the padding field is set to pad the standard SRv6 SID. In one example, the length of the block field is 48 bits, the length of the node identification field is 16 bits, and the length of the function field is 16 bits.

[0098] Generally speaking, within an SRv6 domain, all standard SRv6 SIDs are allocated from the same address block and therefore contain the same address prefix. Standard SRv6 SIDs for different behaviors may have different parameters. However, for END SIDs representing nodes and END.X SIDs representing links or interfaces, the parameter field is typically set to 0 by default, as is the padding field, due to their single meaning. Therefore, the only differences between standard SRv6 SIDs are the node identification field and the function field. When an SRv6 message's segment list carries multiple standard SRv6 SIDs, the segment list carries multiple copies of the same address prefix, as well as multiple copies of the unused parameter and padding fields. This results in redundant information, and therefore, the segment list of a traditional SRv6 message carries redundant information.

[0099] 2) Compression of standard SRv6 SIDs.

[0100] GSRv6 technology achieves compression of standard SRv6 SIDs by removing this redundant information from the segment list, leaving it with only the node identification field and / or function field that differ. During GSRv6 forwarding, network nodes do not need to update the entire standard SRv6 SID into the destination address field as required by traditional SRv6 technology. Instead, they only need to update the node identification field and / or function field to the corresponding portion of the destination address field to form a new destination address. This is the fundamental principle of GSRv6 compression.

[0101] For example, Figures 3 to 5 illustrate three GSRv6 compression concepts (Figures 3 to 5 each illustrate one compression concept). As shown in Figures 3 to 5, the SID before compression (i.e., the standard SRv6 SID) includes a block field, a node identification field, a function field, a parameter field, and a padding field (the presence of the padding field depends on whether the sum of the lengths of the block field, node identification field, function identification field, and parameter field reaches 128 bits). The length of the standard SRv6 SID is 128 bits. As shown in Figure 3, during the compression process, the block field, parameter field, and padding field in the standard SRv6 SID are deleted to obtain a compressed SID (CSID). This compressed SID includes a node identification field and a function field. As shown in Figure 4, during the compression process, the block field, node identification field, parameter field, and padding field in the standard SRv6 SID are deleted to obtain a compressed SID. This compressed SID includes a function field. As shown in Figure 5, during the compression process, the block field, function field, parameter field, and padding field in the standard SRv6 SID are deleted to obtain a compressed SID, which includes a node identification field. In one example, the block field is 48 bits long, the node identification field is 16 bits long, and the function field is 16 bits long. The compressed SID shown in Figure 3 is 32 bits long, and the compressed SIDs shown in Figures 4 and 5 are both 16 bits long. Compared to the standard SRv6 SID, the compressed SID shown in Figure 3 is 128-32=96 bits shorter, and the compressed SIDs shown in Figures 4 and 5 are 128-16=112 bits shorter.

[0102] In order to ensure the compatibility of compressed SIDs with standard SRv6 SIDs, GSRv6 technology introduces the concepts of GSID and GSID container. A GSID can be a compressed SID with a length of 32 bits, a compressed SID with a length of 16 bits, or a standard SRv6 SID (that is, a non-compressed SID). A GSID container is a space with a length of 128 bits. A GSID container is used to carry at least one GSID, which can be a standard SRv6 SID or one or more compressed SIDs. When a GSID container carries multiple GSIDs, the multiple GSIDs are all compressed SIDs. The multiple GSIDs are arranged in reverse order from low to high in the GSID container. If the multiple GSIDs cannot fill the GSID container, the high bits in the GSID container are padded to make up 128 bits. In one example, FIG6 is a schematic diagram of a GSID container. The GSID container is 128 bits long and carries four GSIDs, each of which is a compressed SID of 32 bits. The four GSIDs are arranged in reverse order from low to high bits, with GSID[3] being the first GSID, GSID[2] being the second GSID, GSID[1] being the third GSID, and GSID[0] being the fourth GSID. In another example, FIG7 is a schematic diagram of another GSID container. The GSID container is 128 bits long and carries eight GSIDs, each of which is a compressed SID of 16 bits. The eight GSIDs are arranged in reverse order from low to high bits, with GSID[7] being the first GSID, GSID[6] being the second GSID, and so on. GSID[1] is the seventh GSID, and GSID[0] is the eighth GSID.

[0103] 3). GSRv6 forwarding.

[0104] After the introduction of the concept of GSID, multiple types of SIDs (such as uncompressed SIDs with a length of 128 bits, compressed SIDs with a length of 32 bits, compressed SIDs with a length of 16 bits, etc.) can be encoded into SRH, so GSRv6 technology also introduces the concept of GSRH. The format of GSRH is the same as that of traditional SRH, the difference is that the segment list in GSRH supports mixed encoding of compressed SIDs and uncompressed SIDs. For example, the segment list in GSRH includes at least one GSID container, each GSID container is used to carry a standard SRv6 SID (SID with a length of 128 bits) or carry multiple compressed SIDs, realizing mixed encoding of compressed SIDs and uncompressed SIDs. For example, FIG8 is a schematic diagram of a GSRH, in which the segment list includes n GSID containers, each GSID container is 128 bits long, and the n GSID containers are arranged in reverse order in the segment list. The order of the n GSID containers is GSID container [n-1], GSID container [n-2]...GSID container [1], GSID container [0]. That is, GSID container [n-1] is the first GSID container, GSID container [n-2] is the second GSID container, and so on. GSID container [1] is the n-1th GSID container, and GSID container [0] is the nth GSID container. As shown in FIG8 , the GSRH also includes an SL field, which is used to carry an SL pointer. The SL pointer is used to indicate the active GSID container in the segment list. When SL=n-1, the SL pointer is used to indicate the first GSID container (i.e., GSID container [n-1]) among the n GSID containers. When SL=n-2, the SL pointer is used to indicate the second GSID container among the n GSID containers (i.e., GSID container [n-2]). Similarly, when SL=1, the SL pointer is used to indicate the n-1th GSID container among the n GSID containers (i.e., GSID container [1]). When SL=0, the SL pointer is used to indicate the nth GSID container among the n GSID containers (i.e., GSID container [0]).

[0105] In GSRv6 technology, a path segment can include compressed and / or uncompressed subpaths. Uncompressed subpaths are represented by encoding multiple 128-bit GSIDs (i.e., standard SRv6 SIDs). Compressed subpaths are represented by encoding multiple GSIDs that support compression. The first of these multiple GSIDs is a 128-bit, compressible SRv6 SID. This first GSID includes a complete 128-bit information, such as a common prefix, and is used to construct a fully routable standard SRv6 SID. The remaining GSIDs in this multiple GSIDs are compressed SIDs with a length of less than 128 bits (for example, the remaining GSIDs are all 32-bit compressed SIDs, or the remaining GSIDs are all 16-bit compressed SIDs, or the remaining GSIDs include both 32-bit compressed SIDs and 16-bit compressed SIDs). In the segment list included in the GSRH, GSIDs are arranged in 128-bit increments. If a GSID does not fully fit in a GSID container, the container is padded to make up the 128-bit space.

[0106] The SIDs encoded in the segment list of a traditional SRv6 message are all standard 128-bit SRv6 SIDs. The SL pointer in the SRv6 message indicates the active SID in the segment list. When a network node forwards the SRv6 message, it updates the active SID indicated by the SL pointer to the destination address field of the SRv6 message. However, the GSIDs encoded in the segment list of a GSRv6 message (for ease of description, the data plane messages in GSRv6 technology are referred to as GSRv6 messages) are not necessarily all 128 bits long. The GSID that a network node updates to the destination address field of the GSRv6 message is not necessarily a standard 128-bit SRv6 SID; it may be a compressed SID of less than 128 bits (for example, a compressed SID of 32 bits or 16 bits). Therefore, GSRv6 technology also needs to define update actions corresponding to compressed SIDs.

[0107] In order to instruct network nodes to process compressed SIDs, the GSRv6 technology defines a continuation of compression (COC) flavor, and GSIDs that support compression carry the COC flavor. In the segment list of a GSRv6 message, a GSID carrying the COC flavor is used to indicate that the next GSID of the GSID is a compressed SID. The first GSID and the intermediate GSIDs of the compression path both carry the COC flavor, and the last GSID of the compression path does not carry the COC flavor. In the process of a network node forwarding a GSRv6 message, when the network node processes a GSID carrying the COC flavor, the network device updates the next compressed SID after the GSID in the segment list of the GSRv6 message to the destination address field of the SRv6 message according to the instruction of the GSID. For ease of distinction, two COC features can be defined, such as a first COC feature and a second COC feature. The first COC feature is used to define the update action corresponding to a compressed SID with a length of 32 bits, and the second COC feature is used to define the update action corresponding to a compressed SID with a length of 32 bits. In the process of a network node forwarding a GSRv6 message, when the network node processes a GSID carrying the first COC feature, the network device updates the next 32-bit compressed SID (that is, the next 32-bit content) after the GSID in the segment list of the GSRv6 message to the destination address field of the SRv6 message; when the network node processes a GSID carrying the second COC feature, the network device updates the next 16-bit compressed SID (that is, the next 16-bit content) after the GSID in the segment list of the GSRv6 message to the destination address field of the SRv6 message.

[0108] A GSID container may carry multiple compressed SIDs. To locate the next compressed SID in the GSID container, the GSRv6 technology introduces a compression left (CL) pointer. The CL pointer is used to indicate the active compressed SID in the active GSID container (the active compressed SID is a GSID). The CL pointer is meaningful only when the GSID in the destination address field of the GSRv6 message is a compressed SID. In this case, the SL pointer in the GSRv6 message is used to indicate the active GSID container in the segment list of the GSRv6 message, and the CL pointer is used to indicate the active compressed SID in the active GSID container. The network node determines the active GSID container in the segment list of the GSRv6 message based on the SL pointer, and the network node determines the active compressed SID in the active GSID container based on the CL pointer, and then the network node updates the active compressed SID to the destination address field of the GSRv6 message. Among them, the CL pointer is also called the SID index (SI) pointer. The GSRv6 message also includes a CL field, which includes the lowest at least two bits of the parameter field in the destination address field of the GSRv6 message. For example, the CL field is the lowest two bits or the lowest three bits in the parameter field, and the CL pointer is carried in the CL field. To facilitate hardware implementation and future expansion, the destination address field uses a 128-bit SRv6 SID and does not include a padding field. The lowest at least two bits in the parameter field are also the lowest at least two bits in the destination address field. For example, the CL field is the lowest two bits or the lowest three bits in the destination address field. For example, Figure 9 is a schematic diagram of a destination address field, which includes a block field, a GSID field, a parameter field, and a CL field. The CL field is located at the lowest bit of the destination address field. During the forwarding process of the GSRv6 message, after the network device that processes the GSID carrying the COC feature and executes SL-- offsets the SL pointer, the network node initializes the value of the CL field to m-1, and the network node downstream of the network node determines the active compressed GID in the active GSID container by executing CL-- until the SL pointer is offset again (for example, the CL is reduced to 0, causing the SL pointer to be offset or the active compressed SID located by the CL pointer is the last GSID in the active GSID container, causing the SL pointer to be offset). Wherein, m is the number of compressed SIDs that a GSID container can carry. For example, if a GSID container can carry 4 GSIDs with a length of 32 bits, then m is 4. For another example, if a GSID container can carry 8 GSIDs with a length of 16 bits, then m is 8.That is, the value of the CL field is initialized to 3 in a scheme using a 32-bit GSID, and the value of the CL field is initialized to 7 in a scheme using a 16-bit GSID. In addition, in a scheme using a mixed encoding of 16-bit and 32-bit GSIDs, a 32-bit GSID can be considered as two 16-bit GSIDs, so the value of the CL field is also initialized to 7.

[0109] Among the multiple GSID containers included in the segment list of a GSRv6 message, a GSID container may carry multiple compressed SIDs, which are arranged in reverse order from low to high. For example, a GSID container carries m compressed SIDs, namely GSID[0], GSID[1]...GSID[m-2], GSID[m-1]. These m compressed SIDs are arranged in reverse order from low to high, and the order of these m compressed SIDs is GSID[m-1], GSID[m-2]...GSID[1], GSID[0]. That is, GSID[m-1] is the first compressed SID among the m compressed SIDs and is arranged at the lowest bit of the GSID container; GSID[m-2] is the second compressed SID among the m compressed SIDs and is arranged after GSID[m-1] and adjacent to GSID[m-1]; and so on, GSID[1] is the m-1th compressed SID among the m compressed SIDs and is arranged after GSID[2] and adjacent to GSID[2]; GSID[0] is the mth compressed SID among the m compressed SIDs and is arranged after GSID[1] and adjacent to GSID[1]. Assuming that the GSID container is an active GSID container, the CL pointer is used to indicate the active compressed SID among the m compressed SIDs. When CL=m-1, the CL pointer is used to indicate the first compressed SID among the m compressed SIDs (i.e., GSID[m-1]), and the network node locates GSID[m-1] according to the CL pointer; when CL=m-2, the CL pointer is used to indicate the second compressed SID among the m compressed SIDs (i.e., GSID[m-2]), and the network node locates GSID[m-2] according to the CL pointer; and so on, when CL=1, the CL pointer is used to indicate the m-1th compressed SID among the m compressed SIDs (i.e., GSID[1]), and the network node locates GSID[1] according to the CL pointer; when CL=0, the CL pointer is used to indicate the mth compressed SID among the m compressed SIDs (i.e., GSID[0]), and the network node locates GSID[0] according to the CL pointer.

[0110] For example, Figure 10 is a schematic diagram of a GSRv6 message. The GSRv6 message includes a payload, a GSRH and an IPv6 header. The GSRH includes an SL field and a segment list, and the segment list includes n GSID containers, where n is a positive integer. The length of each GSID container is 128 bits, and the SL field is used to carry an SL pointer, which is used to indicate the active GSID container in the segment list. The n GSID containers are arranged in reverse order in the segment list, GSID container [n-1] is the first GSID container among the n GSID containers, GSID container [n-2] is the second GSID container among the n GSID containers, and so on, GSID container [0] is the nth GSID container among the n GSID containers. GSID container [0], GSID container [1]...GSID container [n-2], GSID container [n-1] correspond to compression paths. GSID container [n-1] carries the first GSID of the compression path. The first GSID is a compressible SID with a length of 128 bits. The first GSID includes a block field and a compressed GSID [n-1]. The first GSID carries a COC feature to indicate that the next GSID of the first GSID is a compressed SID. Each GSID container in GSID container [1], GSID container [2]...GSID container [n-2] carries m compressed SIDs, namely GSID[0], GSID[1]...GSID[m-2], GSID[m-1], and GSID[0], GSID[1]...GSID[m-2], and GSID[m-1] are arranged in reverse order from low to high in the GSID container. GSID[0], GSID[1]...GSID[m-2], and GSID[m-1] are the intermediate GSIDs of the compression path, and each GSID in GSID[0], GSID[1]...GSID[m-2], and GSID[m-1] carries a COC feature to indicate that the next GSID of each GSID is a compressed SID.GSID container [0] carries m-1 compressed SIDs, namely GSID[0], GSID[1]...GSID[m-3], GSID[m-2]. GSID[0], GSID[1]...GSID[m-3], GSID[m-2] are arranged in reverse order from low to high in GSID container [0]. The remaining space in GSID container [0] except the m-1 compressed SIDs is filled with 0. GSID[1]...GSID[m-3], GSID[m-2] in the m-1 compressed SIDs are the intermediate GSIDs of the compression path. Each GSID in GSID[1]...GSID[m-3], GSID[m-2] carries the COC feature to indicate that the next GSID of each GSID is a compressed SID. GSID[0] in the m-1 compressed SIDs is the last GSID of the compression path, and GSID[0] does not carry the COC feature. As shown in FIG10 , the IPv6 header includes a destination address field, which carries the first GSID of the compression path (i.e., the GSID in GSID container [n-1]). The lowest bit of the destination address field includes a CL field, and the CL pointer carried by the CL field is used to indicate the active compression SID in the active GSID container. For example, at a certain moment, the SL pointer points to GSID container [1], and the CL pointer points to GSID [1] in GSID container [1]. At this time, GSID container [1] is the active GSID container, and GSID [1] in GSID container [1] is the active compression SID. The network node uses GSID [1] to replace the GSID in the destination address field, so as to update GSID [1] in GSID container [1] to the destination address field. The meanings of the other fields in the GSRH and the other fields in the IPv6 header are the same as the meanings of the corresponding fields in the traditional SRv6 message shown in FIG1 .

[0111] Figure 10 illustrates the example of a segment list in a GSRH carrying the first GSID of a compressed path. Since the destination address field of the GSRv6 message also includes this first GSID, in some embodiments, the segment list may not carry this first GSID, thereby further reducing redundant information in the segment list. Furthermore, Figure 10 illustrates the example of a GSRv6 message carrying path information for a compressed path. In GSRv6 technology, a path can include both compressed and non-compressed sub-paths, and a GSRv6 message can carry both compressed and non-compressed sub-path path information. For example, Figure 11 is a schematic diagram of another GSRv6 message. The structure of the GSRv6 message is the same as that of the GSRv6 message shown in FIG10 , except that: in the GSRv6 message shown in FIG11 , the GSID container [0], GSID container [1] ... GSID container [k] in the segment list correspond to non-compressed sub-paths, and GSID container [0], GSID container [1] ... GSID container [k] each carry a GSID of 128 bits in length (i.e., standard SRv6 SID); GSID container [k+1], GSID container [k+2]...GSID container [n-2], GSID container [n-1] correspond to compressed sub-paths, GSID container [n-1] carries the first GSID of the compressed sub-path, GSID container [n-2], GSID container [n-3]...GSID container [k+2] each GSID container carries m compressed SIDs, and the m compressed SIDs are all intermediate GSIDs of the compressed sub-path, GSID container [k+1] carries m-1 compressed SIDs, among which GSID[0] is the last GSID of the compressed sub-path, and GSID[1], GSID[2]...GSID[m-3], GSID[m-2] are the intermediate GSIDs of the compressed sub-path.

[0112] In the GSRv6 messages shown in Figures 10 and 11 , the compressed SID is 32 bits or 16 bits long (i.e., the segment list is encoded using a compressed SID of 32 bits or 16 bits), or the segment list of the GSRv6 message includes a compressed SID of 32 bits and a compressed SID of 16 bits (i.e., the segment list is encoded using a mixture of compressed SIDs of 32 bits and 16 bits). In the example where the segment list is encoded using a compressed SID of 32 bits, m is equal to 4; in the example where the segment list is encoded using a compressed SID of 16 bits or a mixture of compressed SIDs of 32 bits and 16 bits, m is equal to 8. In the GSRv6 message shown in Figure 11 , k is a positive integer less than n.

[0113] The following describes the GSRv6 forwarding process using a 32-bit compressed SID for path encoding as an example.

[0114] For example, Figures 12 to 14 show schematic diagrams of GSRv6 forwarding. As shown in Figures 12 to 14, a certain SRv6 domain includes network nodes 101 to 107, and the SIDs of network nodes 102 to 107 are GSID2 to GSID7, respectively. The forwarding path P is: network node 101->network node 102->...->network node 107. Network node 101 is the head node (also called the ingress node) of the forwarding path P. As shown in Figure 12, network node 101 generates a GSRv6 message. The GSRv6 message includes a payload, a GSRH, and an IPv6 header. The segment list in the GSRH includes GSID container [0], GSID container [1], and GSID container [2]. The segment list carries the path information GSID2 to GSID7 of the forwarding path P. The forwarding path P is a compressed path. GSID2 is the first GSID of the forwarding path P. GSID2 is carried in GSID container [2] and carries the COC feature (the first GSID is a standard SRv6 SID with a length of 128 bits. For ease of description, the GSID2 drawn in Figures 12 to 14 only occupies part of the space of GSID container [2]. In fact, all the contents carried by GSID container [2] belong to the first GSID). GSID3 to GSID6 are all intermediate GSIDs of the forwarding path P. GSID3 to GSID6 are carried in GSID container [1]. The lengths of GSID3 to GSID6 are 32 bits respectively, and GSID3 to GSID6 carry the COC feature respectively. GSID7 is the last GSID of the forwarding path P. GSID7 is carried in GSID container [0]. The length of GSID7 is 32 bits and GSID7 does not carry the COC feature. When network node 101 generates the GSRv6 message, it initializes SL to 2, copies the contents of GSID container [2] in the segment list to the destination address field of the GSRv6 message, and initializes the value of the CL field in the destination address field to 0. After network node 101 generates the GSRv6 message, it uses the longest mask match to search its routing table based on the destination address of the GSRv6 message (in this case, the destination address includes block + GSID2). Network node 101 then forwards the GSRv6 message to network node 102 based on the search result.12 and 13 , after the network node 102 receives the GSRv6 message, the network node 102 uses the longest mask match to search the local SID table (my local SID table) of the network node 102 according to the destination address of the GSRv6 message (the destination address includes block+GSID2 at this time), and matches the block+GSID2 in the destination address (that is, the block+GSID2 in the destination address hits the local SID table), and the network node 102 executes the corresponding forwarding action for GSID2. Specifically, as shown in Figure 13, the network node 102 executes SL--to offset the SL pointer to the GSID container [1], and the network node 102 initializes CL to 3 (because the COC feature carried by GSID2 indicates that the next GSID is a 32-bit GSID, and a GSID container carries a maximum of 4 32-bit GSIDs, so the network node 102 executes SL--and then initializes CL to 4-1=3) so that the CL pointer indicates GSID3 in the GSID container [1]. The network node 102 updates the active compressed SID (i.e., GSID3) indicated by the CL pointer to the GSID field in the destination address field of the GSRv6 message. The network node 102 uses the longest mask match to search the routing table of the network node 102 according to the updated destination address (the updated destination address includes block+GSID3). The network node 102 forwards the GSRv6 message to the network node 103 according to the search result. 13 and 14 , after network node 103 receives the GSRv6 message, it uses the longest mask match to search its local SID table based on the destination address of the GSRv6 message (in this case, the destination address includes block+GSID3). If a match is found between block+GSID3 in the destination address (i.e., block+GSID3 in the destination address hits the local SID table), network node 103 executes the corresponding forwarding action for GSID3. Specifically, as shown in FIG14 , network node 103 executes CL--, shifting the CL pointer to GSID4. Network node 103 updates the GSID field in the destination address field of the GSRv6 message with the active compressed SID indicated by the CL pointer (i.e., GSID4). Network node 103 uses the longest mask match to search its routing table based on the updated destination address (in this case, the updated destination address includes block+GSID4). Based on the search result, network node 103 forwards the GSRv6 message to network node 104. The process of forwarding the GSRv6 message by the network nodes 104 to 106 is the same as the process of forwarding the GSRv6 message by the network node 103 , and will not be described in detail here.After network node 107 receives the GSRv6 message forwarded by network node 106 (the destination address of the GSRv6 message includes block+GSID7, SL=0, and CL=3), network node 107 uses the longest mask match based on the destination address of the GSRv6 message to search its local SID table. It finds a match between block+GSID7 in the destination address (that is, block+GSID7 in the destination address hits the local SID table), and network node 107 performs the forwarding action for GSID7. Because GSID7 does not carry the COC feature, network node 107 treats the destination address of the GSRv6 message as a traditional SRv6 SID and forwards the GSRv6 message using the traditional SRv6 forwarding method.

[0115] As described above, in GSRv6 technology, the beginning of a compressed path is indicated by a 128-bit GSID with the COC feature. This GSID is the first GSID in the compressed path and carries complete SID information, including the common prefix. Intermediate GSIDs in the compressed path are compressed SIDs with the COC feature, indicating that the next GSID after this GSID is a compressed SID. The last GSID in the compressed path is a compressed SID without the COC feature. The common prefix in the first GSID of the compressed path is combined with the intermediate or final GSIDs of the compressed path to restore the complete GSID (i.e., a 128-bit GSID). The complete GSID (i.e., a 128-bit GSID) consisting of the last GSID of the compressed path and the rest of the destination address field is processed by network nodes as a traditional SRv6 SID (i.e., a standard SRv6 SID), thereby achieving the conversion from compressed SID to traditional SRv6 SID and connecting the compressed and non-compressed paths. The idea of ​​updating the destination address field of GSRv6 technology is to update the next compressed SID after the GSID in the segment list included in the GSRH to the destination address field for forwarding through the GSID indication carrying the COC feature. The compression processing flow of GSRv6 is triggered by the COC feature, and the operation is also limited to the GSID carrying the COC feature, and has no effect on the processing of existing SRv6 SIDs and SRHs. In addition, according to the above description, the multiple compressed SIDs carried by the GSID container can form a sub-segment list. The encoding rules of the sub-segment list are the same as the encoding rules of the segment list including multiple GSID containers. The CL pointer can be a pointer to the sub-segment list, which is used to indicate the active compressed SID in the sub-segment list. The embodiment of the present application does not limit this.

[0116] The above only introduces some aspects of GSRv6 technology. For more information about GSRv6, please refer to the relevant technical documents. In these documents, GSRv6 may be written as G-SRv6, GSID may be written as G-SID, and GSRH may be written as G-SRH. It is understood that "GSRv6" and "G-SRv6" have the same meaning, "GSID" and "G-SID" have the same meaning, and "GSRH" and "G-SRH" have the same meaning.

[0117] 3.USID-related technologies.

[0118] USID is a compressed SID obtained by compressing the standard SRv6 SID. USID is also called micro segment identifier, SRv6 micro segment identifier or SRv6USID.

[0119] USID-related technologies also involve three compression concepts, which are the same as the three compression concepts of GSRv6 technology (as shown in Figures 3 to 5). The difference is that the compressed SID in USID-related technologies is called USID. It can be understood that the length of the USID can be 32 bits or 16 bits. The 32-bit USID includes a node identification field and a function field (or the 32-bit USID consists of the node identification field and the function field), and the 16-bit USID includes either the node identification field or the function field (or the 16-bit USID includes only the node identification field or the function field).

[0120] To ensure USID compatibility with standard SRv6 SIDs, USID-related technologies can introduce the concept of SID containers. A SID container is a 128-bit space used to carry a standard SRv6 SID or a block of information and at least one USID. When a SID container carries a block of information and at least one USID, the block is located in the highest bit of the SID container, and the at least one USID is located after and adjacent to the block of information. The at least one USID is arranged in descending order. If the block of information and the at least one USID do not fill the SID container, the lower bits of the SID container are padded to make up 128 bits. In one example, Figure 15 is a schematic diagram of a SID container, which is 128 bits long and carries a block of information and two USIDs. The block of information is 48 bits long, and each USID is 32 bits long. The block of information is located in the highest bit of the SID container, and the two USIDs are arranged in descending order within the SID container. The lowest 16 bits of the SID container are padded with 0s to make up 128 bits. In another example, Figure 16 is a schematic diagram of another SID container, which is 128 bits long and carries a GSID container, which carries a block of information and five USIDs. Each USID is 16 bits long. The block of information is located in the highest bit of the SID container, and the five USIDs are arranged in descending order within the SID container.

[0121] After the concept of USID is introduced, various types of SIDs (such as an uncompressed SID with a length of 128 bits, a USID with a length of 32 bits, a USID with a length of 16 bits, etc.) can be encoded into the SRH. For the sake of convenience of description, the SRH encoded with the USID is called the USRH. The format of the USRH is the same as that of the traditional SRH, except that the segment list in the USRH supports mixed encoding of USID and uncompressed SID. For example, the segment list in the USRH includes at least one SID container, each SID container is used to carry a standard SRv6 SID (SID with a length of 128 bits) or multiple USIDs, realizing mixed encoding of USID and uncompressed SID. In the USID-related technology, a path may include compressed sub-paths and / or uncompressed sub-paths. The uncompressed sub-path is embodied by multiple standard SRv6 SID codes with a length of 128 bits. The compression sub-path is embodied by multiple USID codes, where the lengths of the multiple USIDs are all 32 bits, or the lengths of the multiple USIDs are all 16 bits, or the multiple USIDs include USIDs with a length of 32 bits and USIDs with a length of 16 bits. The multiple USIDs can be encoded in one or more SID containers, and each SID container further encodes block information, where the block information is located at the highest bit of the SID container, and the USIDs are located after the block information and are arranged in order from the highest bit to the lowest bit, and the first USID after the block information is adjacent to the block information.

[0122] For ease of description, the SRv6 message encoded with the USID is referred to as a USID message. Figures 17 and 18 show schematic diagrams of two USID messages. As shown in Figures 17 and 18, the USID message includes a payload, a USRH, and an IPv6 header. The USRH includes an SL field and a segment list. The segment list includes n SID containers, each of which is 128 bits long. The SL field is used to carry an SL pointer, which is used to indicate the active SID container in the segment list. The n SID containers are arranged in reverse order in the segment list. The order of the n GSID containers is GSID container [n-1], GSID container [n-2]...GSID container [1], GSID container [0]. That is, GSID container [n-1] is the first GSID container, GSID container [n-2] is the second GSID container, and so on. GSID container [1] is the n-1th GSID container, and GSID container [0] is the nth GSID container. As shown in Figure 17, each of the n SID containers carries one block of information and five USIDs. Each USID is 16 bits long and located in the highest bit of the SID container. The five USIDs are arranged in descending order. As shown in Figure 18, each of the n SID containers carries one block of information and two USIDs. Each USID is 32 bits long and located in the highest bit of the SID container. The two USIDs are arranged in descending order. The lowest 16 bits in each SID container are padded with 0s. The meanings of other fields in the USID message refer to the meanings of the relevant fields in the traditional SRv6 message and are not detailed here. FIG17 illustrates a segment list using a 16-bit USID encoding as an example, and FIG18 illustrates a segment list using a 32-bit USID encoding as an example. The segment list may also employ a mixed encoding of a 16-bit USID and a 32-bit USID. In this embodiment, the maximum number of USIDs that each SID container can carry is greater than 2 and less than 5. Furthermore, FIG17 and FIG18 illustrate an example in which a USID message carries compressed path information. A USID message may also carry both compressed and non-compressed path information, but this embodiment of the present application does not limit this.

[0123] The following describes the USID forwarding process by taking a 16-bit USID for path encoding as an example.

[0124] For example, Figures 19 and 20 illustrate USID forwarding. As shown in Figures 19 and 20, an SRv6 domain includes network nodes 101 to 113. The SIDs of network nodes 102 to 113 are USID2 to USID10, SRv6 SIDs (also known as standard SRv6 SIDs), and USID12 to USID13, respectively. The forwarding path S is: network node 101 -> network node 102 -> ... -> network node 113. Network node 101 is the head node (also called the ingress node) of forwarding path S. As shown in FIG19 , network node 101 generates a USID message. The USID message includes a payload, a USRH, and an IPv6 header. The USRH includes an SL field and a segment list. The segment list includes SID container [0], SID container [1], SID container [2], and SID container [3]. Each SID container in SID container [0], SID container [1], SID container [2], and SID container [3] is 128 bits long. The SL field is used to carry an SL pointer, which is used to indicate the active SID container in the segment list. In this embodiment, the segment list carries path information of forwarding path S: USID2 to USID10, SRv6 SID, and USID12 to USID13. Each USID in USID2 to USID10 and USID12 to USID13 is 16 bits long, and the SRv6 SID is 128 bits long. USID2 to USID6 are arranged in SID container [3] in descending order, USID7 to USID10 are encoded in SID container [2] in descending order, the SRv6 SID is encoded in SID container [1], USID12 to USID13 are arranged in descending order in SID container [0], and the highest bit of each SID container in SID container [0], SID container [2], and SID container [3] carries 48-bit block information, the lowest 16 bits of SID container [2] are padded with 0, and the lowest 48 bits of SID container [0] are padded with 0. When network node 101 generates the USID message, it initializes SL to 3 and copies the content of SID container [3] to the destination address field of the USID message. Network node 101 searches its routing table based on the destination address of the USID message (the destination address is block+USID2+USID3+USID4+USID5+USID6) using the longest mask match, and forwards the USID message to network node 102 based on the search result.19 and 20 , after the network node 102 receives the USID message, the network node 102 uses the longest mask match to search the local SID table of the network node 102 according to the destination address of the USID message (the destination address is block+USID2+USID3+USID4+USID5+USID6 at this time), and matches the block+USID2 in the destination address (that is, the block+USID2 in the destination address hits the local SID table), and the network node 102 executes the corresponding forwarding action for USID2. Specifically, as shown in FIG20 , network node 102 shifts the content after the block field in the destination address field to the left by 16 bits (the length of USID2) and fills the lowest 16 bits of the destination address field with 0s. Network node 102 then searches its routing table using the longest mask match based on the updated destination address (the updated destination address is block+USID3+USID4+USID5+USID6). Based on the search result, network node 102 forwards the USID message to network node 103. The subsequent process of network node 103, network node 104, and network node 105 forwarding the USID message is the same as the process of network node 102 forwarding the USID message. After network node 106 receives the USID message, it uses the longest mask match to search the local SID table of network node 106 based on the destination address of the USID message (the destination address is block+USID6 at this time), matches the block+USID6 in the destination address (that is, the block+USID6 in the destination address hits the local SID table), and network node 106 performs the corresponding forwarding action for USID6. Specifically, since USID6 is the last USID in the destination address field of the USID message at this time, network node 106 executes SL--offsets the SL pointer to SID container [2]. Network node 106 copies the content in SID container [2] to the destination address field of the USID message. Network node 106 uses the longest mask match to search the routing table of network node 106 based on the updated destination address (the updated destination address is block+USID7+USID8+USID9+USID10). Network node 106 forwards the USID message to network node 107 based on the search result. The process of network nodes 107 to 112 forwarding the USID message can refer to the process of network nodes 101 to 106 forwarding the USID message. This cycle continues until the USID message is forwarded to network node 113, which decapsulates the USID message and removes the USRH and IPv6 headers.

[0125] Figures 19 and 20 illustrate the example of the segment list in the USRH including the SID container [3] (i.e., the fourth SID container, such as the nth SID container). Since the destination address of the USID message sent by the network node 101 includes the content in the SID container [3], it is also possible to set the segment list to not include the SID container [3]. This can reduce the length of the segment list and further reduce the redundant information of the segment list. In addition, for a shorter forwarding path (e.g., a forwarding path with less than 5 hops), the destination address field of the USID message may be able to carry the complete path information of the forwarding path. In this way, the USID message can be set to not include the segment list, thereby improving the compression efficiency, encapsulation efficiency, and forwarding efficiency of the USID message.

[0126] The above only introduces some of the content related to USID. For other content related to USID, please refer to the technical documents related to USID (such as the document "draft-filsfils-spring-net-pgm-extension-srv6-usid-14"). In the relevant technical documents, USID may be written as uSID. "USID" and "uSID" have the same meaning. In addition, for the convenience of description, the concept of SID container is introduced in the USID-related technology. In the technical documents related to USID, the above SID container may be called segment list. For example, SID container [0] is called segment list [0], SID container [1] is called segment list [1], and so on.

[0127] 4.TI-LFA technology.

[0128] TI-LFA technology, also known as TI-LFA fast reroute (FRR) technology, means that when a node or link on the main forwarding path of a message fails, the backup forwarding path is immediately enabled to forward the message, so as to quickly implement route backup and thus minimize traffic loss. In traffic engineering (TE) scenarios, it is often necessary to specify in the message the nodes or links that the message will pass through. For example, the SID of the node or link is carried in the message to specify that the message will pass through the node or link. However, in TI-LFA technology, when a node or link specified in the message fails, and the node or link is on both the main forwarding path and the backup forwarding path of the message (that is, both the main forwarding path and the backup forwarding path pass through a node or link specified in the message), the protection effect cannot be achieved based on TI-LFA technology.

[0129] For example, Figure 21 is a TI-LFA forwarding diagram. As shown in Figure 21, a certain SRv6 domain includes network nodes 201 to 206. The cost of the link between network node 202 and network node 203, the cost of the link between network node 203 and network node 204, and the cost of the link between network node 202 and network node 206 are all 10, and the cost of the link between network node 206 and network node 204 is 1000. The SID of network node 203 is SID3, and the SID of network node 205 is SID5. SID3 and SID5 are both standard SRv6 SIDs. Network node 201 wants to send message A to network node 205, and encodes the segment list in the SRH of message A.<SID5,SID3> Message A is designated to pass through network node 203. If network node 203 is not faulty, both network node 201 and network node 202 look up the route based on the destination address "SID3" of message A and forward message A. Network node 202 forwards message A to network node 203. Network node 203 replaces the destination address of message A with "SID5" and forwards message A to network node 204 based on the replaced destination address "SID5". Network node 204 looks up the route based on the destination address "SID5" of message A and forwards message A to network node 205. Message A is forwarded to network node 205 along the forwarding path indicated by the solid arrow in FIG21 (network node 201 -> network node 202 -> network node 203 -> network node 204 -> network node 205). The forwarding path indicated by the solid arrow is the primary forwarding path for message A. If network node 203 fails, both network nodes 201 and 202 look up routes based on the destination address "SID3" of message A and forward message A. Network node 202 forwards message A to network node 206. Network nodes 206 and 204 also look up routes based on the destination address "SID3" of message A and forward message A. Network node 204 forwards message A to network node 203. Message A is forwarded to network node 203 along the forwarding path indicated by the dashed arrow in Figure 21 (network node 201 -> network node 202 -> network node 206 -> network node 204 -> network node 203). This forwarding path is the backup forwarding path for message A, also known as the TI-LFA path or FRR path. As can be seen, since both the primary and backup forwarding paths pass through network node 203, which message A specifies, if network node 203 fails, message A cannot bypass network node 203, resulting in the failure of TI-LFA protection.

[0130] 5.SRv6 endpoint fault protection technology.

[0131] In traditional SRv6 technology, the destination address of an SRv6 message is a standard SRv6 SID. When a network node forwards the SRv6 message, the forwarding operations it needs to perform include SL-- (also known as the SL pointer offset) and updating the active SID indicated by the offset SL pointer to the destination address of the SRv6 message. However, a faulty network node cannot perform this forwarding operation, so the industry has proposed SRv6 endpoint fault protection technology. When a network node equipped with SRv6 endpoint fault protection technology is forwarding an SRv6 message, if the network node detects that its next-hop node has failed, the network node performs a proxy forwarding operation to process the SRv6 message on behalf of the next-hop node. For example, if the network node detects that the next-hop node has failed, and the network node determines that the destination address of the SRv6 message is the SID of the next-hop node, and the SL in the SRv6 message is greater than 0, the network node processes the SRv6 message on behalf of the next-hop node. Specifically, the network node performs SL-- on behalf of the next-hop node to perform an SL pointer offset, and the network node updates the active SID indicated by the offset SL pointer to the destination address of the SRv6 message on behalf of the next-hop node. A network node that performs a proxy forwarding operation can be referred to as a proxy node, a proxy forwarding node, or a proxy network node. After performing the proxy forwarding operation, the proxy network node forwards the SRv6 message according to the updated destination address of the SRv6 message, thereby enabling the SRv6 message to bypass the failed network node, thereby providing protection against SRv6 endpoint failures.

[0132] For example, Figure 22 is a schematic diagram of SRv6 endpoint fault protection. As shown in Figure 22, a certain SRv6 domain includes network nodes 201 to 206. The cost of the link between network node 202 and network node 203, the cost of the link between network node 203 and network node 204, and the cost of the link between network node 202 and network node 206 are all 10, and the cost of the link between network node 206 and network node 204 is 1000. The SID of network node 203 is SID3, and the SID of network node 205 is SID5. SID3 and SID5 are both standard SRv6 SIDs. The SID of the interface in network node 206 connected to network node 204 is SID2061. Network node 201 wants to send message A to network node 205, and encodes the segment list in the SRH of message A.<SID5,SID3> Message A is designated to pass through network node 203. If network node 203 is not faulty, message A is forwarded to network node 205 along the forwarding path indicated by the solid arrow in FIG22 . The forwarding path indicated by the solid arrow is the primary forwarding path for message A. If network node 203 is faulty, network node 201 searches for a route based on message A's destination address "SID3" and forwards message A to network node 202. Network node 202 searches for a route based on message A's destination address "SID3" and determines that its next hop node is network node 203. However, because network node 202 detects a fault in network node 203, determines that message A's destination address "SID3" is the SID of network node 203 (or determines that network node 202 is the previous hop node for message A's destination address "SID3"), and the SL in message A is greater than 0, network node 202 performs a proxy forwarding operation to process message A on behalf of network node 203. The proxy forwarding operation performed by network node 202 includes: network node 202 executing SL-- on behalf of network node 203 to perform SL pointer offset (the active SID indicated by the offset SL pointer is "SID5" in the segment list), and network node 202 updating the active SID indicated by the offset SL pointer to the destination address field of message A on behalf of network node 203 (the destination address of message A is "SID5" at this time).After network node 202 performs the proxy forwarding operation, network node 202 checks the route based on the updated destination address "SID5" to determine that the next hop node of network node 202 is still network node 203. At this time, although network node 202 senses that network node 203 has failed, since network node 202 determines that the destination address "SID5" of message A is not the SID of network node 203 (or network node 202 determines that network node 202 is not the previous hop node of the destination address "SID5" of message A) and the SL in message A is equal to 0, network node 202 does not perform the proxy forwarding operation. Network node 202 switches message A to the backup forwarding path according to the normal forwarding process. In this embodiment, the repair list of the backup forwarding path is<SID5,SID2061> Therefore, network node 202 replaces the segment list in message A with the repair list of the backup forwarding path and initializes the SL in message A to 1 based on the repair list. Network node 202 then copies "SID2061" from the repair list to the destination address of message A based on the SL pointer. Network node 202 then searches for a route based on message A's destination address "SID2061" and forwards message A to network node 204. Network node 204 then performs SRv6 forwarding to update message A's destination address to "SID5." It then searches for a route based on the updated destination address "SID5" and forwards message A to network node 205. Therefore, if network node 203 fails, message A is forwarded to network node 205 along the forwarding path indicated by the dashed arrow in FIG22 (network node 201 -> network node 202 -> network node 206 -> network node 204 -> network node 205). This forwarding path is the backup forwarding path for message A, also known as the FRR path. It can be seen that in the SRv6 endpoint fault protection technology, since the previous hop node of the faulty node performs a proxy forwarding operation, the backup forwarding path of the message can bypass the faulty node.

[0133] Based on the above introduction to TI-LFA technology and SRv6 endpoint fault protection technology, the difference between TI-LFA technology and SRv6 endpoint fault protection technology is that: in TI-LFA technology, the previous hop node of the faulty node does not perform proxy forwarding operations and does not update the destination address of the message on behalf of the faulty node. The previous hop node forwards the message based on the original destination address of the message (the SID of the faulty node), resulting in the message being unable to bypass the faulty node. In SRv6 endpoint fault protection technology, the previous hop node of the faulty node performs proxy forwarding operations to update the destination address of the message. The previous hop node can offset the SID of the faulty node and forward the message based on the updated destination address, allowing the message to bypass the faulty node and reach the destination node.

[0134] As explained above, in SRv6 endpoint fault protection, the previous hop of a failed node performs SL on behalf of the failed node, locating the next SID after the failed node's SID in the SRv6 message's segment list. However, in SRv6 technology that supports compressed SIDs, the segment list includes at least one SID container, each of which carries one uncompressed SID or multiple compressed SIDs. The SL pointer indicates the active SID container in the segment list, rather than a specific SID. This prevents the previous hop of the failed node from performing SL, locating the next SID after the failed node's SID in the SRv6 message's segment list, and thus from performing proxy forwarding.

[0135] The present application provides a message forwarding solution that can be applied to compressed SID scenarios. It solves the problem that the previous hop node of a faulty node cannot locate the next SID after the SID of the faulty node in the compressed SID scenario. The previous hop node can locate the next SID after the SID of the faulty node and forward the segment routing message (for example, SRv6 message) according to the next SID, so that the segment routing message is forwarded around the faulty node, thereby realizing endpoint fault protection in the compressed SID scenario.

[0136] The application scenarios of this application are introduced below.

[0137] The application scenario of an embodiment of the present application provides a communication system, which includes a segment routing network and an end-side device accessing the segment routing network. The segment routing network is used to forward messages between different end-side devices accessing the segment routing network to achieve communication between the different end-side devices. The segment routing network can be a metropolitan area network, a wide area network, a campus network, a data center network (DCN) or a data center interconnection (DCI) network consisting of at least two data centers (DC). The segment routing network can be a segment routing (SR) network, an SRv6 network, a segment routing multi-protocol label switching (SR-MPLS) network or other segment routing network. The segment routing network is also referred to as a segment routing domain or a segment routing network domain. For example, an SRv6 network is referred to as an SRv6 domain or an SRv6 network domain.

[0138] The segment routing network includes multiple network nodes for forwarding messages. The network nodes can be physical switches, physical routers, virtual switches created in physical devices, virtual routers created in physical devices, and other nodes for forwarding messages, or they can be terminal devices. The types of the multiple network nodes can be the same or different. For example, the multiple network nodes are switches or routers, or some of the multiple network nodes are switches and other network nodes are routers. According to the deployment location, the multiple network nodes include edge network nodes and core network nodes. The edge network node is located at the edge of the segment routing network and is used for end-side devices to access the segment routing network. The core network node is located at the core position of the segment routing network and is used to forward messages between different edge network nodes. For example, the edge network node is a provider edge (PE) node, and the core network node is a provider (P) node. The edge network node can include an ingress node and an egress node. The ingress node is located at the entrance of the segment routing network and is used to introduce traffic into the segment routing network. The exit node is located at the exit of the routing network segment and is used to direct traffic out of the routing network segment.

[0139] Optionally, the end-side device is connected to the edge network node in the segment routing network through an access node or an access network to access the segment routing network, that is, an access node or an access network is connected between the end-side device and the edge network node in the segment routing network. The access node can be a physical switch, a physical router, a virtual switch or a virtual router, etc., which are nodes used for message forwarding. For example, the access node is a customer edge (CE) node. The access network is composed of multiple access nodes that are communicatively connected. The end-side device can be a host, a user terminal, a home gateway, an Internet of Things (IoT) device, an industrial device, a server or a virtual machine (VM) created in a server. The user terminal can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, a television, a car terminal, a personal digital assistant (PDA), etc. The end-side device accessing the segment routing network includes a sending end device and a receiving end device. The sending end device is connected to the entry node in the segment routing network, and the receiving end device is connected to the exit node in the segment routing network.

[0140] In an embodiment of the present application, when the entry node of the segment routing network introduces a message into the segment routing network, the entry node encapsulates the segment identifier of the specified node or specified link in the segment routing network in the message to specify that the message needs to pass through the specified node or the specified link. For example, the segment routing network includes a forwarding path for forwarding the message, and the entry node encapsulates a segment list for indicating the forwarding path in the message to guide the message to be forwarded along the forwarding path. The forwarding path includes an entry node, an exit node, and at least one intermediate node (transit node) between the entry node and the exit node. The number of intermediate nodes is different depending on the length of the forwarding path. The entry node of the forwarding path and the entry node of the segment routing network can be the same network node, and the exit node of the forwarding path and the exit node of the segment routing network can be the same network node, which is not limited in the embodiment of the present application.

[0141] The terms "network node, entry node, intermediate node, exit node, forwarding path, etc." in the embodiments of the present application are merely exemplary. A network node may also be referred to as a network device, a forwarding node, a forwarding device, a gateway node, a gateway device, a routing node, a routing device, etc. An entry node may also be referred to as an entry device, and the entry node of a forwarding path may also be referred to as a head node, a head node device, a first node, a first node device, etc. An intermediate node may also be referred to as an intermediate device, a transit node, a transit device, etc. An exit node may also be referred to as an exit device, and the exit node of a forwarding path may also be referred to as an end node, an end node device, etc. A forwarding path may also be referred to as a transmission path, a communication path, a communication tunnel, etc. Optionally, the forwarding path in the present application is a segment routing traffic engineering (SR-TE) tunnel, a resource reservation protocol-traffic engineering (RSVP-TE) tunnel based on traffic engineering extensions, an SR tunnel, or an SRv6 tunnel. For example, the forwarding path is an SRv6TE policy tunnel.

[0142] In an embodiment of the present application, the network nodes in the segment routing network can enable the segment identifier compression function and the endpoint fault protection function, and the network nodes in the segment routing network support forwarding messages based on compressed segment identifiers. In addition, the network nodes in the segment routing network can store the segment identifier planning information of the network node, and when the network nodes in the segment routing network publish routing information to the segment routing network, the network nodes carry the segment identifier planning information of the network node in the routing information. After receiving the routing information published by other network nodes, each network node in the segment routing network can store the segment identifier planning information of the other network nodes. In the process of forwarding messages, if the network node in the segment routing network perceives that the output interface of the network node has failed, the network node determines the next segment identifier in the segment list or destination address field of the message according to the segment identifier planning information of the network node, and forwards the message according to the next segment identifier. If the network node detects that the next hop node of the network node is faulty, the network node determines the next segment identifier in the segment list or destination address field of the message based on the segment identifier planning information of the next hop node, and forwards the message based on the next segment identifier (that is, the network node performs a proxy forwarding operation). This allows the message to be forwarded around the faulty interface or faulty node, achieving endpoint fault protection.

[0143] The segment identifier varies depending on the type of segment routing network. For example, the segment identifier can be a SID in SR, a SID in SRv6, or a label in SR-MPLS. The following describes the application scenario of this application using an SRv6 segment routing network as an example.

[0144] Please refer to Figure 23, which shows a schematic diagram of an application scenario provided by an embodiment of the present application. The communication system provided by this application scenario includes an SRv6 network 1 and end-side devices 301 to 304. The end-side devices 301 to 304 access the SRv6 network 1 through the three access nodes CE1 to CE3. The SRv6 network 1 includes eight network nodes, namely PE1 to PE4 and P1 to P4. PE1 to PE4 are edge network nodes in the SRv6 network 1, and P1 to P4 are core network devices in the SRv6 network 1. The end-side device 301 is connected to PE1 and PE2 respectively through CE1 to access the SRv6 network 1. The end-side device 302 is connected to PE3 through CE2 to access the SRv6 network 1. The end-side devices 303 to 204 are connected to PE4 through CE3 to access the SRv6 network 1. Optionally, PE1 and PE2 are ingress nodes of SRv6 network 1, PE2 and PE3 are egress nodes of SRv6 network 1, end-side device 301 is a sending end device, and at least one of end-side devices 302 to 205 (for example, end-side device 302) is a receiving end device.

[0145] In this example, PE1 to PE4 and P1 to P4 all enable the SRv6 SID compression function and the SRv6 endpoint fault protection function. When each network node among PE1 to PE4 and P1 to P4 publishes routing information to SRv6 network 1, it carries the segment identifier planning information of the network node. After receiving the routing information published by other network nodes among PE1 to PE4 and P1 to P4, each network node among PE1 to PE4 and P1 to P4 stores the segment identifier planning information carried in the routing information (that is, the segment identifier planning information of the other network nodes). Each network node among PE1 to PE4 and P1 to P4 stores the segment identifier planning information of the network node.

[0146] In one example, after PE1 receives message 1 from end-side device 301 to end-side device 302, PE1 performs SRv6 encapsulation on message 1 to obtain SRv6 message 1. This SRv6 message 1 carries P3's compressed SID, indicating that it must pass through P3. For example, the segment list of SRv6 message 1 includes P3's compressed SID and PE3's SID, and the destination address of SRv6 message 1 includes P3's compressed SID. PE1 forwards SRv6 message 1 to P1 based on the destination address of SRv6 message 1. After receiving SRv6 message 1, P1 performs a route lookup based on the destination address of SRv6 message 1 and determines that the next hop node is P3. If P3 does not fail, P1 forwards the SRv6 packet 1 to P3. After P3 receives the SRv6 packet 1 from P1, P3 modifies the destination address of the SRv6 packet 1 to the SID of PE3 and forwards the SRv6 packet 1 to PE3 according to the modified destination address. If P3 fails, P1 processes the SRv6 message 1 instead of P3. Specifically, P1 determines the next segment identifier in the SRv6 message 1 based on the segment identifier planning information of P3 (in this example, the next segment identifier is the SID of PE3), P1 modifies the destination address of the SRv6 message 1 to the next segment identifier, and P1 forwards the SRv6 message 1 to P2 based on the modified destination address; after P2 receives the SRv6 message 1 from P1, P2 forwards the SRv6 message 1 to P4 based on the destination address of the SRv6 message 1; after P4 receives the SRv6 message 1 from P2, P4 forwards the SRv6 message 1 to PE4 based on the destination address of the SRv6 message 1; after PE4 receives the SRv6 message 1 from P4, PE4 forwards the SRv6 message 1 to PE3 based on the destination address of the SRv6 message 1. After receiving SRv6 packet 1, PE3 decapsulates it to obtain packet 1, and then forwards packet 1 to end-side device 302. As can be seen, if P3 is not faulty, SRv6 packet 1 is forwarded along forwarding path S1 in SRv6 network 1; if P3 fails, SRv6 packet 1 is forwarded along forwarding path S2 in SRv6 network 1.

[0147] In another example, after PE1 receives message 1 sent from end-side device 301 to end-side device 302, PE1 performs SRv6 encapsulation on message 1 to obtain SRv6 message 1. The SRv6 message 1 carries the compressed SID of P1's first outbound interface (the first outbound interface corresponds to P3) to indicate that the SRv6 message 1 needs to pass through P1's first outbound interface. For example, the segment list of the SRv6 message 1 includes the compressed SID of P1's first outbound interface and the SID of PE3, and the destination address of the SRv6 message 1 includes the compressed SID of P1's first outbound interface. PE1 forwards the SRv6 message 1 to P1 based on the destination address of the SRv6 message 1. After receiving the SRv6 message 1, P1 searches the local SID table based on the destination address of the SRv6 message 1 to determine whether the destination address hits the local SID table. If P1's first outbound interface is not faulty, P1 executes the forwarding behavior corresponding to the destination address of the SRv6 message 1 (that is, the compressed SID of P1's first outbound interface). After P1 modifies the destination address of the SRv6 message 1 to PE3's SID, it forwards the SRv6 message 1 to P3 through P1's first outbound interface. After P3 receives the SRv6 message 1 from P1, P3 forwards the SRv6 message 1 to PE3 according to the destination address of the SRv6 message 1. If the first outbound interface of P1 fails, P1 determines the next segment identifier in the SRv6 message 1 based on P1's segment identifier planning information (in this example, the next segment identifier is PE3's SID), P1 modifies the destination address of the SRv6 message 1 to the next segment identifier, and P1 forwards the SRv6 message 1 to P2 based on the modified destination address; after P2 receives the SRv6 message 1 from P1, P2 forwards the SRv6 message 1 to P4 based on the destination address of the SRv6 message 1; after P4 receives the SRv6 message 1 from P2, P4 forwards the SRv6 message 1 to PE4 based on the destination address of the SRv6 message 1; after PE4 receives the SRv6 message 1 from P4, PE4 forwards the SRv6 message 1 to PE3 based on the destination address of the SRv6 message 1. After receiving the SRv6 message 1, PE3 performs SRv6 decapsulation on the SRv6 message 1 to obtain message 1, and PE3 forwards message 1 to the end-side device 302. It can be seen that when the first outbound interface of P1 is not faulty, SRv6 packet 1 is forwarded along forwarding path S1 in SRv6 network 1; when the first outbound interface of P1 fails, SRv6 packet 1 is forwarded along forwarding path S2 in SRv6 network 1.

[0148] In the two examples above, forwarding path S1 is the primary forwarding path for SRv6 packet 1, and forwarding path S2 is the backup forwarding path for SRv6 packet 1, also known as an FRR path. PE1 is the ingress node of SRv6 network 1 and the ingress node for both forwarding paths S1 and S2. PE3 is the egress node of SRv6 network 1 and the egress node for both forwarding paths S1 and S2. Forwarding path S1 also includes intermediate nodes P1 and P3, while forwarding path S2 also includes intermediate nodes P1, P2, P4, and PE4.

[0149] The above introduction to the application scenarios of the present application is for example only and is not intended to limit the technical solutions of the embodiments of the present application. During the implementation process, the number of network nodes, the number of access nodes, the number of end-side devices, and the relationship between these nodes and devices in the application scenario can be configured as needed. In other embodiments, the application scenario also includes a network management device, which is connected to at least one network node, access node, end-side node, etc. to manage and control these nodes and devices. For example, the network management device controls the network nodes in the routing network to forward messages. The network management device integrates functions such as network management, service control, and network analysis. The network management device can be a server, or a server cluster consisting of several servers, or a cloud computing service center. The network management device is also called a network management device, a network control device, a network controller, a control device, etc., and the embodiments of the present application do not limit this.

[0150] The above is an introduction to the application scenario of this application. The following is an introduction to the technical solution of this application.

[0151] The technical solution of this application is applied to the compressed SID scenario. To facilitate understanding of the technical solution of this application, the format of the standard SRv6 SID in the compressed scenario is introduced below using the SRv6 scenario as an example.

[0152] Please refer to Figure 24, which shows the format of a standard SRv6 SID in a compression scenario. The standard SRv6 SID includes a block field, a node ID field, a compression function field, an uncompressed function field, and an arguments field. The block field is used to carry the common prefix of the standard SRv6 SID. The common prefix is ​​the address block used to allocate the standard SRv6 SID. The node ID field is used to carry the identifier of the network node that publishes the standard SRv6 SID. The node ID is unique within the SRv6 domain. The block field and the node ID field constitute the locator field. The common prefix carried by the block field and the node ID carried by the node ID field constitute a routable locator, which guides the forwarding of the message to the network node that publishes the standard SRv6 SID. The compression function field and the non-compression function field are both used to carry the local function identifier of the network node that publishes the standard SRv6 SID (for ease of description, the function identifier carried by the compression function field is referred to as the compression function identifier, and the function identifier carried by the non-compression function field is referred to as the non-compression function identifier). The function identifier is used to map to the local segment endpoint behavior of the network node to indicate the local forwarding behavior of the network node. The function identifier is unique locally on the network node. The parameter field is used to carry parameters related to the function field (e.g., the non-compression function field).

[0153] For standard SRv6 SIDs that do not support compression (i.e., 128-bit SRv6 SIDs that cannot be compressed), the value in the compression function field is 0. For standard SRv6 SIDs that support compression (i.e., 128-bit SRv6 SIDs that can be compressed), the value in the uncompressed function field is 0. In one example, the block field is 48 bits long, the node identifier field is 16 bits long, the compression function field is 16 bits long, the uncompressed function field is 24 bits long, and the parameter field is 24 bits long. The compressed SID obtained by compressing a standard SRv6 SID that supports compression is either 32 bits or 16 bits long. A 32-bit compressed SID includes both the node identifier field and the compression function field, while a 16-bit compressed SID includes only the node identifier field or the compression function field (see Figures 2 to 5 for the compression concept). A 16-bit compressed SID that includes the node identifier field is called an END SID. These SIDs are allocated from the global ID block (GIB), which is equivalent to the node identifier space. A compressed SID with a length of 16 bits and including a compressed function field is called an END.X SID or END.DT4 SID. These SIDs are allocated from the local ID block (LIB), which is equivalent to the function identifier space. Both the GIB and LIB range from 0 to 65535 and do not overlap. Both the GIB and LIB ranges can be adjusted using the command line. The ratio of the GIB range to the LIB range is 1:1.

[0154] For example, please refer to Figure 25, which shows a format diagram of a standard SRv6 SID that supports compression to 16 bits in a compression scenario. The format of the SRv6 SID is the same as the format of the SRv6 SID shown in Figure 24, except that: the value range of the node identifier (referred to as the node identifier range) in the SRv6 SID shown in Figure 24 can overlap with the value range of the compression function identifier (referred to as the compression function identifier range), and the SRv6 SID can be compressed to 32 bits; in the SRv6 SID shown in Figure 25, the node identifier starts with 1000, the compression function identifier starts with 0000, the node identifier range and the compression function identifier range do not overlap, the node identifier range is a GIB or a subset of a GIB, and the compression function identifier range is a LIB or a subset of a LIB.

[0155] The above is an introduction to the application scenarios of this application. The following introduces an embodiment of the message forwarding method of this application.

[0156] Please refer to Figure 26, which shows a flowchart of a message forwarding method provided in an embodiment of the present application. The message forwarding method is applied to a first network node in a segment routing network, where the first network node is an intermediate node on the first forwarding path in the segment routing network, and the first forwarding path is a forwarding path for the first message (for example, a main forwarding path). The segment routing network can be an SR network, an SRv6 network, an SR-MPLS network, or other segment routing networks. The embodiment of the present application takes the segment routing network as an example where the segment routing network is an SRv6 network. For example, the segment routing network is SRv6 network 1 in Figure 23, the first forwarding path is forwarding path S1, and the first network node is P1. As shown in Figure 26, the method includes the following steps S601 to S603.

[0157] S601. The first network node receives a first message, the destination address field of the first message includes a first segment identifier, the first segment identifier is a compressed segment identifier, the first segment identifier corresponds to the first outbound interface of the first network node or the first segment identifier corresponds to the second network node, and the second network node is the next hop node of the first network node.

[0158] A first network node receives a first message from a previous-hop node of the first network node. The previous-hop node is an intermediate node or an ingress node on a first forwarding path. The first forwarding path is the forwarding path of the first message. As shown in FIG23 , the first forwarding path is forwarding path S1, the first network node is P1, the previous-hop node is PE1, and P1 receives the first message from PE1.

[0159] In an embodiment of the present application, the destination address field of the first message includes a first segment identifier. The first segment identifier corresponds to the first outbound interface of the first network node, or the first segment identifier corresponds to the second network node, where the second network node is the next-hop node of the first network node. If the first segment identifier corresponds to the first outbound interface, the first segment identifier may be an END.X SID representing the first outbound interface. If the first segment identifier corresponds to the second network node, the first segment identifier may be an END SID representing the second network node. The first segment identifier is a compressed segment identifier, which is obtained by compressing a standard segment identifier. The standard segment identifier is 128 bits long, while the compressed segment identifier is less than 128 bits long. For example, the standard segment identifier is a standard SRv6 SID, and the compressed segment identifier is 32 bits or 16 bits long. The 32-bit compressed segment identifier includes a node identifier and a compression function identifier. The 16-bit compressed segment identifier is a node identifier or a compression function identifier. For example, the first segment identifier is a 32-bit GSID, a 16-bit GSID, a 32-bit USID, or a 16-bit USID.

[0160] In an optional embodiment, the destination address field of the first message includes a block field and a target field, the target field is located after the block field, the block field is used to carry block information, and the first segment identifier is located in the target field. In one embodiment, the highest 48 bits in the destination address field are the block field, the target field is located after the block field and adjacent to the block field, and the length of the target field is 32 bits or 16 bits. The target field with a length of 32 bits includes a node identification field and a compression function field, and the target field with a length of 16 bits is a node identification field or a compression function field. Optionally, the first message includes an IPv6 header, and the destination address field is located in the IPv6 header.

[0161] In an optional embodiment, the first message further includes a segment list and an SL field. For example, the first message includes an SRH, which includes the segment list and the SL field. The segment list includes at least one container, each of which is a 128-bit space. If the segment list includes multiple containers, the multiple containers are arranged in reverse order within the segment list. The SL field is used to carry an SL pointer, which indicates the active container in the segment list. Each container in the segment list carries a standard segment identifier or at least one compressed segment identifier. If the segment list carries multiple compressed segment identifiers, the multiple compressed segment identifiers can be of equal or unequal lengths. In one example, the compressed segment identifiers in the segment list are all 32 bits long, and the segment list is encoded using 32-bit compressed segment identifiers, or the segment list is encoded using a mixture of standard segment identifiers and 32-bit compressed segment identifiers. In another example, the compressed segment identifiers in the segment list are all 16 bits long, and the segment list is encoded using 16-bit compressed segment identifiers, or the segment list is encoded using a mixture of standard segment identifiers and 16-bit compressed segment identifiers. In another example, the compressed segment identifier in the segment list includes a compressed segment identifier with a length of 32 bits and a compressed segment identifier with a length of 16 bits, and the segment list uses a mixed encoding of a compressed segment identifier with a length of 32 bits and a compressed segment identifier with a length of 16 bits, or the segment list uses a mixed encoding of a standard segment identifier, a compressed segment identifier with a length of 32 bits and a compressed segment identifier with a length of 16 bits.

[0162] In one embodiment, the segment list of the first message is encoded using GSIDs. Each container in the segment list carries a standard segment identifier or at least one compressed segment identifier. For any container in the segment list, if the container carries at least one compressed segment identifier, the at least one compressed segment identifier is arranged in ascending order within the container. The at least one compressed segment identifier is either 32 bits or 16 bits long. Alternatively, the at least one compressed segment identifier includes a 32-bit compressed segment identifier and a 16-bit compressed segment identifier. The first message also includes a CL field, which carries a CL pointer that indicates the active compressed segment identifier in the active container. The CL field is located in the destination address field of the first message and includes at least the two lowest bits of the destination address field, for example, the two lowest bits or the three lowest bits of the destination address field. In this embodiment, the first message can be referred to as a GSRv6 message, the SRH can be referred to as a GSRH, both the standard segment identifier and the compressed segment identifier are GSIDs, and the containers in the segment list can be referred to as GSID containers. In an example, the first message is shown in Figure 27. The first message includes a payload, a GSRH, and an IPv6 header. The GSRH includes an SL field and a segment list. The segment list includes n GSID containers, where n is a positive integer. The n GSID containers are arranged in reverse order in the segment list, and the length of each GSID container is 128 bits. GSID container [n-1] carries the first GSID of the compression path. Each GSID container from GSID container [1] to GSID container [n-2] carries m GSIDs, which are all intermediate GSIDs of the compression path. The m GSIDs in each GSID container from GSID container [1] to GSID container [n-2] are arranged in reverse order from low to high in the GSID container. GSID container [0] carries m-1 GSIDs, which are arranged in reverse order from the lowest bit to the highest bit in GSID container [0]. GSID [0] is the last GSID of the compression path, and the other GSIDs are intermediate GSIDs of the compression path. The value in the SL field is n-2, so the SL pointer carried in the SL field is used to indicate GSID container [n-2] (that is, GSID container [n-2] is the currently active container).The IPv6 header includes a destination address field, which includes a block field, a target field, and a parameter field. The block field is located in the most significant bit of the destination address field (e.g., the most significant 48 bits are the block field), the target field is located after the block field and adjacent to the block field, the parameter field is located in the least significant bit of the destination address field (e.g., the least significant 24 bits are the parameter field), and the least significant bit of the parameter field (e.g., at least the two least significant bits) is the CL field. The target field carries GSID [m-2], which is the first segment identifier. The value in the CL field is m-2, so the CL pointer carried by the CL field indicates GSID [m-2] in GSID container [n-2] (i.e., GSID [m-2] in GSID container [n-2] is the currently active GSID). GSID [m-2] in the destination address field is the same GSID as GSID [m-2] in GSID container [n-2]. The length of the GSID in the first message shown in Figure 27 can be 16 bits or 32 bits. The meanings of other fields in the first message shown in Figure 27 are the same as those of the corresponding fields in the GSRv6 message shown in Figure 10, and are not repeated here.

[0163] In another embodiment, the segment list of the first message is encoded using USID. Each container in the segment list is used to carry a standard segment identifier or a block information and at least one compressed segment identifier. For any container in the segment list, if the container carries block information and at least one compressed segment identifier, the block information is located in the highest bit of the container (for example, the highest 48 bits of the container are the block field, and the block information is located in the block field). The at least one compressed segment identifier is arranged in the container from the highest bit to the lowest bit. The length of the at least one compressed segment identifier is 32 bits or 16 bits; alternatively, the at least one compressed segment identifier includes a compressed segment identifier with a length of 32 bits and a compressed segment identifier with a length of 16 bits. In this embodiment, the first message can be called a USID message, the SRH can be called a USRH, the compressed segment identifier is a USID, and the containers in the segment list are also called SID containers. In one example, the first message is shown in Figure 28. The first message includes a payload, a USRH, and an IPv6 header. The USRH includes an SL field and a segment list. The segment list includes n SID containers, where n is a positive integer. The n SID containers are arranged in reverse order in the segment list, with each SID container being 128 bits long. Each SID container carries one block of information and five USIDs, each 16 bits long. The block of information is located in the most significant bit of the SID container (e.g., the most significant 48 bits), and the five USIDs are arranged in descending order. The value in the SL field is n-1, and the SL pointer carried in the SL field indicates SID container [n-1] (i.e., SID container [n-1] is the currently active container). The IPv6 header includes a destination address field, which includes a block field and a target field. The block field is located in the most significant bit of the destination address field (for example, the most significant 48 bits are the block field). The target field is located after the block field and adjacent to the block field. The destination address field carries USID(n-1)3, USID(n-1)4, and USID(n-1)5. USID(n-1)3 is located in the target field. USID(n-1)3 is the first segment identifier. USID(n-1)4 and USID(n-1)5 are both located in the field after the target field. The block information in the destination address field (carried in the block field), USID(n-1)3, USID(n-1)4, and USID(n-1)5 are respectively the block information in the SID container [n-1] indicated by the SL pointer, USID(n-1)3, USID(n-1)4, and USID(n-1)5. In another example, a first message is shown in Figure 29. The first message includes a payload, a USRH, and an IPv6 header. The USRH includes an SL field and a segment list. The segment list includes n SID containers, where n is a positive integer.The n SID containers are arranged in reverse order in the segment list, and each SID container is 128 bits long. Each SID container carries one block of information and two USIDs, each 32 bits long. The block of information is located in the most significant bits of the SID container (e.g., the most significant 48 bits). The two USIDs are arranged in descending order, and the least significant 16 bits of the SID container are padded with 0s. The value in the SL field is n-2, so the SL pointer carried in the SL field indicates SID container [n-2] (i.e., SID container [n-2] is the currently active container). The IPv6 header includes a destination address field, which includes a block field and a target field. The block field is located in the most significant bit of the destination address field (for example, the most significant 48 bits are the block field). The target field is located after the block field and adjacent to the block field. The destination address field carries USID (n-2) 1 and USID (n-2) 2. USID (n-2) 1 is located in the target field and is the first segment identifier. USID (n-2) 2 is located in the field after the target field. The content of the destination address field is the same as the content of the SID container [n-2] indicated by the SL pointer. The meanings of the other fields in the first message shown in Figures 28 and 29 are the same as those of the corresponding fields in the USID message shown in Figure 18 and are not further described here. Figures 28 and 29 take the first message including the segment list as an example to illustrate that for the case where the number of nodes and links specified by the USID message is small, for example, the number of hops in the forwarding path is small, the number of USIDs carried by the USID message is small, and the destination address field of the USID message can carry all USIDs. The USID message may not include a segment list, for example, the USID message does not include USRH, which can improve the encapsulation efficiency and forwarding efficiency of the USID message.

[0164] In an embodiment of the present application, the first message is generated by the entry node of the first forwarding path. For example, the entry node performs segment routing encapsulation on the original message from the sending end device to obtain the first message. Optionally, the entry node encapsulates the SRH and IPv6 header outside the original message, so that the destination address field in the IPv6 header includes the first segment identifier, to obtain the first message. In one example, the entry node encapsulates the GSRH and IPv6 header in the original message to obtain the first message, the structure of which is shown in Figure 10. The network node between the entry node and the first network node processes the first message in the process of forwarding the first message, for example, executing SL--, executing CL--, updating the destination address of the first message, etc., so that the first message forwarded to the first network node is as shown in Figure 27. In another example, the entry node encapsulates USRH and IPv6 header in the original message to obtain a first message. The structure of the first message is shown in Figure 17 or Figure 18. The network node between the entry node and the first network node processes the first message in the process of forwarding the first message, such as executing SL--, updating the destination address of the first message, etc., so that the first message forwarded to the first network node is as shown in Figure 28 or Figure 29.

[0165] S602. Based on the failure of the first output interface of the first network node or the failure of the second network node, the first network node determines the second segment identifier according to the planning information Y, the second segment identifier is the segment identifier in the segment list of the first message or the second segment identifier is the segment identifier in the destination address field of the first message, and the planning information Y is the segment identifier planning information of the node corresponding to the first segment identifier.

[0166] The first network node determines the first outbound interface and / or second network node of the first network node by looking up a table based on the destination address of the first message received by the first network node. The first network node determines whether the first outbound interface and / or the second network node has failed based on various fault sensing technologies. After the first network node determines that the first outbound interface or the second network node has failed, the first network node determines a second segment identifier based on planning information Y, based on the failure of the first outbound interface or the failure of the second network node. The second segment identifier is a segment identifier in the segment list of the first message or a segment identifier in the destination address field of the first message. The second segment identifier is located after the first segment identifier, for example, the second segment identifier is the segment identifier next to the first segment identifier.

[0167] In one embodiment, the first segment identifier corresponds to the first outbound interface of the first network node, and the first network node determines the first outbound interface of the first network node and / or the second network node based on the destination address of the first message by looking up a table, including: the first network node searches the local segment identifier table (my local SID table) of the first network node based on the destination address of the first message, and determines that the first segment identifier in the destination address field of the first message hits the local segment identifier table (for example, the information composed of the block information and the first segment identifier in the destination address field hits the local segment identifier table); the first network node determines that the first segment identifier is used to indicate the first outbound interface of the first network node based on the segment endpoint behavior indicated by the first segment identifier. For example, the first network node determines that the first segment identifier is the END.X SID used to indicate the first outbound interface of the first network node.

[0168] In another embodiment, the first segment identifier corresponds to the second network node, and the first network node determines the first outbound interface of the first network node and / or the second network node based on the destination address of the first message by looking up the table, including: the first network node uses the longest mask match to look up the routing table of the first network node based on the destination address of the first message, the first network node determines that the first segment identifier in the destination address field of the first message hits the first routing table entry in the routing table (that is, the destination address of the first message hits the first routing table entry), and the first network node determines the first outbound interface of the first network node and / or the second network node based on the first routing table entry. The first routing table entry may include a correspondence between the standard segment identifier corresponding to the first segment identifier, the indication information of the first outbound interface, and the indication information of the second network node. The first routing table entry is generated by the first network node based on the first routing information published by the second network node and the interface (that is, the first outbound interface) through which the first network node receives the first routing information. The first routing information is locator routing information or block routing information. Accordingly, the first routing table entry is a locator routing table entry or a block routing table entry. Among them, the first segment identifier in the destination address field of the first message hits the first routing table entry, including any one of the following: when the first segment identifier is a compressed segment identifier with a length of 32 bits, the locator information composed of the block information in the destination address field and the node identifier in the first segment identifier hits the first routing table entry; or, when the first segment identifier is a compressed segment identifier with a length of 16 bits and the first segment identifier is a node identifier, the locator information composed of the block information in the destination address field and the first segment identifier hits the first routing table entry; or, when the first segment identifier is a compressed segment identifier with a length of 16 bits and the first segment identifier is a compression function identifier, the information composed of the block information in the destination address field and the first segment identifier hits the first routing table entry.

[0169] In an embodiment of the present application, planning information Y is segment identifier planning information for the node corresponding to the first segment identifier, and planning information Y is planning information for a standard segment identifier in a compression scenario. When the first segment identifier corresponds to the first outbound interface of a first network node, the node corresponding to the first segment identifier is the first network node, and planning information Y is segment identifier planning information for the first network node. When the first segment identifier corresponds to a second network node, the node corresponding to the first segment identifier is the second network node, and planning information Y is segment identifier planning information for the second network node. Optionally, planning information Y includes at least one of the following: the length of the block field, the length of the node identifier field, the length of the compression function field, the length of the uncompression function field, the length of the parameter field, and the node identifier range. For example, the length of the block field is 48 bits, the length of the node identifier field is 16 bits, the length of the compression function field is 16 bits, the length of the uncompression function field is 24 bits, and the length of the parameter field is 24 bits. The node identifier range is a GIB or a subset of a GIB. If planning information Y includes a node identifier range and the second segment identifier includes a node identifier, the node identifier included in the second segment identifier may be within the node identifier range.

[0170] In an embodiment of the present application, the second segment identifier is a compressed segment identifier or a standard segment identifier, the length of the standard segment identifier is 128 bits, and the length of the compressed segment identifier is less than 128 bits. In one embodiment, the second segment identifier is a standard segment identifier, the second segment identifier is a segment identifier in the segment list of the first message, the segment list also includes the first segment identifier, the first segment identifier and the second segment identifier are arranged in sequence in the segment list, and the second segment identifier is arranged after the first segment identifier. In another embodiment, the second segment identifier is a compressed segment identifier, the second segment identifier is a segment identifier in the segment list of the first message or the second segment identifier is a segment identifier in the destination address field of the first message; in the case where the second segment identifier is a segment identifier in the segment list of the first message, the segment list may also include the first segment identifier, the first segment identifier and the second segment identifier are arranged in sequence in the segment list, and the second segment identifier is arranged after the first segment identifier; in the case where the second segment identifier is a segment identifier in the destination address field of the first message, the first segment identifier and the second segment identifier are arranged in sequence in the destination address field, and the second segment identifier is arranged after the first segment identifier.

[0171] In an embodiment of the present application, the second segment identifier corresponds to an outgoing interface or a network node. For example, the second segment identifier is an END.X SID used to characterize an interface or an END SID used to characterize a node. When the second segment identifier corresponds to an outgoing interface, the outgoing interface corresponding to the second segment identifier is located downstream of the first network node. When the second segment identifier corresponds to a network node, the network node corresponding to the second segment identifier is located downstream of the first network node. In one embodiment, the first segment identifier corresponds to the first outgoing interface of the first network node, and the second segment identifier corresponds to any one of the following: the second network node, the outgoing interface of the second network node, the next hop node of the second network node, the outgoing interface of the next hop node of the second network node, a network node downstream of the next hop node of the second network node, or the outgoing interface of a network node downstream of the next hop node of the second network node. In another embodiment, the first segment identifier corresponds to the second network node, and the second segment identifier corresponds to any one of the following: the next hop node of the second network node, the outgoing interface of the next hop node of the second network node, a network node downstream of the next hop node of the second network node, or the outgoing interface of a network node downstream of the next hop node of the second network node.

[0172] In an optional embodiment, based on a failure of the first outbound interface of the first network node or a failure of the second network node, the first network node determines that the first segment identifier in the destination address field of the first message is a compressed segment identifier (that is, the first network node determines that the type of the first segment identifier is a compressed segment identifier). Based on the first segment identifier being a compressed segment identifier, the first network node determines the second segment identifier based on planning information Y. Depending on the object corresponding to the first segment identifier (the first outbound interface of the first network node or the second network node), the implementation method for the first network node to determine that the first segment identifier is a compressed segment identifier is different. The following describes the implementation method for the first network node to determine that the first segment identifier is a compressed segment identifier in two embodiments.

[0173] First embodiment: The first segment identifier corresponds to the first outbound interface of the first network node, and the first segment identifier is the segment identifier issued by the first network node. In one embodiment, the compressed segment identifier and the uncompressed segment identifier issued by the first network node carry different characteristics (flavors). After the first network node determines that the first segment identifier in the destination address field of the first message hits the local segment identifier table of the first network node, the first network node determines that the first segment identifier is a compressed segment identifier based on the flavor carried by the first segment identifier. In another embodiment, the standard segment identifier supporting compression and the standard segment identifier not supporting compression issued by the first network node carry different flavors. The first segment identifier in the destination address field of the first message is obtained by compressing the first standard segment identifier supporting compression issued by the first network node by the head node. The first segment identifier and the first standard segment identifier carry the same flavor. After the first network node determines that the first segment identifier in the destination address field of the first message hits the local segment identifier table of the first network node, the first network node determines that the first segment identifier is a compressed segment identifier based on the flavor carried by the first segment identifier. Optionally, the first network node determines whether the first segment identifier carries the COC flavor, and based on the fact that the first segment identifier carries the COC flavor, the first network node determines that the first segment identifier is a compressed segment identifier.

[0174] Second embodiment: the first segment identifier corresponds to the second network node, the planning information Y is the segment identifier planning information of the second network node, and the first network node determines that the first segment identifier in the destination address field of the first message is a compressed segment identifier based on the planning information Y.

[0175] Optionally, the first routing information published by the second network node includes planning information Y, and the first routing table entry generated by the first network node based on the first routing information includes planning information Y. After the first network node determines that the first segment identifier in the destination address field of the first message hits the first routing table entry, the first network node determines the planning information Y based on the first routing table entry, and then the first network node determines that the first segment identifier is a compressed segment identifier based on the planning information Y (that is, the first network node determines that the type of the first segment identifier is a compressed segment identifier). For example, the first routing table entry includes a correspondence between a standard segment identifier corresponding to the first segment identifier and the planning information Y, and the first network node determines the planning information Y based on the correspondence.

[0176] Optionally, the first network node determines the compression function field in the destination address field of the first message based on the planning information Y, and the first network node determines that the first segment identifier is a compression segment identifier based on the value in the compression function field. For example, the first network node determines that the value in the compression function field is a non-null value, and based on the value in the compression function field being a non-null value, the first network node determines that the first segment identifier is a compression segment identifier. The embodiment of the present application takes the value in the compression function field being a non-null value as an example for explanation. In other embodiments, the first segment identifier is a standard segment identifier (i.e., a non-compressed segment identifier), the value in the compression function field is a null value, and based on the value in the compression function field being a null value, the first network node determines that the first segment identifier is a non-compressed segment identifier. Among them, the null value can be 0, and the non-null value can be non-0.

[0177] Optionally, the planning information Y includes the length of the block field, the length of the node identification field, and the length of the compression function field. In the standard segment identifier that supports compression, the block field, the node identification field, and the compression function field are adjacent in sequence. The destination address field of the first message includes a block field, and the first segment identifier in the destination address field may include a node identification field. The block field and the node identification field in the destination address field constitute a locator field. The first network node uses the longest mask match to search the routing table of the first network node according to the destination address of the first message, and determines that the locator information carried by the locator field in the destination address field of the first message matches the first routing table entry in the routing table. The first network node determines the compression function field in the destination address field based on the length and position of the locator field and the length of the compression function field. The length of the locator field is equal to the sum of the length of the block field and the length of the node identification field. For example, the locator field is 64 bits long, and planning information Y indicates that the compression function field is 16 bits long. The first network node determines the 16 bits following the 64 bits (i.e., the locator field) in the destination address field of the first message that match the first routing table entry of the first network node as the compression function field. The first network node determines that the value in the compression function field is non-zero, thereby determining that the first segment identifier is a compressed segment identifier. In this embodiment, the length of the first segment identifier can be 32 bits, and the segment list of the first message is encoded using a compressed segment identifier with a length of 32 bits, or the segment list of the first message is encoded using a mixed encoding of a compressed segment identifier with a length of 32 bits and a standard segment identifier with a length of 128 bits. In one example, the first segment identifier is a 32-bit GSID, and the segment list of the first message is encoded using a 32-bit GSID (the corresponding first message can be shown in Figure 27), or the segment list of the first message is encoded using a mixed encoding of a 32-bit GSID and a 128-bit GSID. In another example, the first segment identifier is a USID with a length of 32 bits, and the segment list of the first message is encoded using a USID with a length of 32 bits (the corresponding first message can be shown in Figure 29), or the segment list of the first message is encoded using a mixed encoding of a USID with a length of 32 bits and a standard SID with a length of 128 bits.

[0178] In an embodiment of the present application, the first message includes an SL field, and the value in the SL field is an SL pointer. In the case where the segment list of the first message is encoded using GSID, the first message also includes a CL field, and the value in the CL field is a CL pointer. The first network node can determine the second segment identifier by updating the value of the SL field in the first message, or the first network node can determine the second segment identifier by updating the value of the CL field in the first message. Alternatively, the first network node can determine the second segment identifier by traversing the destination address field of the first message. Alternatively, the first network node can determine the second segment identifier by updating the value of the target field in the first message, and the target field is located in the destination address field of the first message, and the target field is located after the block field in the destination address field, and the target field can be adjacent to the block field. Therefore, the first network node determines the second segment identifier according to the planning information Y, including any one of the following four situations.

[0179] Case 1: The first network node updates the value of the SL field in the first message, and the first network node determines the second segment identifier according to the updated value of the SL field.

[0180] The segment list of the first message includes multiple containers, each container is used to carry a standard segment identifier or at least one compressed segment identifier. The value in the SL field in the first message is an SL pointer, which is used to indicate the active container in the segment list. The multiple containers include a first container, which carries a first segment identifier. The active container currently indicated by the SL pointer is the first container. The first network node determines whether the first segment identifier is the last segment identifier in the first container based on planning information Y. If the first segment identifier is the last segment identifier in the first container, the first network node updates the value of the SL field (e.g., executes SL--) to offset the SL pointer. The first network node determines the second segment identifier based on the updated value of the SL field.

[0181] In one embodiment, the segment list of the first message is encoded using a GSID, and the first segment identifier carries a first COC feature to indicate that the next segment identifier of the first segment identifier is a compressed segment identifier with a length of 32 bits. The first network node updates the value of the SL field in the first message to offset the SL pointer to the next container of the first container (for example, the next container of the first container is referred to as the second container). The first network node initializes the value of the CL field in the first message to 3. Based on the CL pointer carried by the CL field, the first network node determines a 32-bit compressed segment identifier in the least significant bit in the second container as the second segment identifier. The first network node updates the second segment identifier to the target field in the destination address field of the first message. For example, the first network node replaces the first segment identifier in the target field with the second segment identifier. The target field is located in the destination address field of the first message, and the target field is located after the block field in the destination address field, for example, the target field is adjacent to the block field. In this embodiment, the target field is 32 bits long.

[0182] In another embodiment, the segment list of the first message is encoded using a GSID, and the first segment identifier carries a second COC feature to indicate that the next segment identifier of the first segment identifier is a compressed segment identifier with a length of 16 bits. The first network node updates the value of the SL field in the first message to offset the SL pointer to the next container of the first container (e.g., the second container), and the first network node performs a first traversal operation on the second container to determine the second segment identifier in the second container. The first network node performs a first traversal operation on the second container, including: initializing the value of the CL field in the first message to 7, and continuously updating the value of the CL field (e.g., continuously executing CL--) to traverse the contents of the second container 16 bits at a time; upon traversing each 16-bit content, the first network node determines whether the 16-bit content is within the node identifier range included in the planning information Y; if the 16-bit content is within the node identifier range, the first network node stops traversing and determines the 16-bit content as the second segment identifier; if the 16-bit content is not within the node identifier range, the first network node continues traversing until a 16-bit content is determined in the second container to be within the node identifier range, and the first network node determines the 16-bit content as the second segment identifier. If the first network node does not determine a 16-bit content within the node identifier range in the second container, the first network node again updates the value of the SL field to shift the SL pointer to the next container of the second container (e.g., the next container of the second container is referred to as the third container), and the first network node performs the first traversal operation on the third container to determine the second segment identifier in the third container. If the first network node does not determine the 16-bit content within the node identifier range in the third container, the first network node continues to update the value of the SL field to offset the SL pointer to the next container after the third container (for example, the next container after the third container is called the fourth container). The first network node then performs the first traversal operation on the fourth container to determine the second segment identifier in the fourth container. This process is repeated until the first network node determines that a certain 16-bit content is within the node identifier range, or until the first network node has traversed all containers following the first container in the segment list of the first message. After the first network node determines the second segment identifier, the first network node updates the second segment identifier to the target field in the destination address field of the first message. For example, the first network node replaces the first segment identifier in the target field with the second segment identifier. The target field is located after the block field in the destination address field, for example, the target field is adjacent to the block field. In this embodiment, the target field is 16 bits long.It should be noted that during the process of the first network node traversing the contents of the second container 16 bits at a time, the 16 bits traversed in any two consecutive times are adjacent and non-overlapping. For example, during the first traversal, the first network node traverses the first 16 bits of the contents of the second container, and during the second traversal, the first network node traverses the second 16 bits of the contents of the second container. The second 16 bits are adjacent to and do not overlap with the first 16 bits. The process of the first network node performing the first traversal operation on the third container, the fourth container, and other containers located after the second container can be referred to the process of the first network node performing the first traversal operation on the second container, and will not be repeated here.

[0183] In another embodiment, the segment list of the first message is encoded using GSID, and the first segment identifier does not carry the COC feature. Based on the fact that the first segment identifier does not carry the COC feature, the first network node determines that the next segment identifier of the first segment identifier is a standard segment identifier. The first network node updates the value of the SL field in the first message to offset the SL pointer to the next container of the first container (for example, the next container of the first container is called the second container). The first network node determines the content in the second container as a whole as the second segment identifier. The first network node updates the content in the second container as a whole to the destination address field of the first message. For example, the first network node uses the content in the second container to replace the content in the destination address field as a whole.

[0184] In another embodiment, the segment list of the first message is encoded using a 32-bit USID, or a mixed encoding of a 32-bit USID and a standard segment identifier. The first network node updates the value of the SL field in the first message to offset the SL pointer to the next container of the first container (for example, the next container of the first container is called the second container). The first network node updates the entire content of the second container to the destination address field of the first message. For example, the first network node replaces the entire content of the destination address field with the content of the second container. In the case where the second container carries a standard segment identifier, the standard segment identifier is the second segment identifier. In the case where the second container includes a block field and at least one 32-bit USID, the first 32-bit USID after the block field is the second segment identifier.

[0185] In another embodiment, the segment list of the first message is encoded using a 16-bit USID, or a mixed encoding of a 16-bit USID and a 32-bit USID. The first network node updates the value of the SL field in the first message to offset the SL pointer to the next container of the first container (e.g., the second container), and the first network node performs a second traversal operation on the second container to determine the second segment identifier in the second container. The first network node performs the second traversal operation on the second container, including: starting from the end position of the block field in the second container, the first network node traverses the contents of the second container 16 bits at a time; upon traversing each 16-bit content, the first network node determines whether the 16-bit content is within the node identifier range included in the planning information Y; if the 16-bit content is within the node identifier range, the first network node stops traversing and determines the 16-bit content as the second segment identifier; if the 16-bit content is not within the node identifier range, the first network node continues traversing until it is determined in the second container that a certain 16-bit content is within the node identifier range, and the first network node determines the 16-bit content as the second segment identifier. If the first network node does not determine the 16-bit content within the node identifier range in the second container, the first network node again updates the value of the SL field to offset the SL pointer to the next container of the second container (e.g., the third container). The first network node then performs the second traversal operation on the third container to determine the second segment identifier in the third container. If the first network node does not determine the 16-bit content within the node identifier range in the third container, the first network node continues to update the value of the SL field to offset the SL pointer to the next container of the third container (e.g., the fourth container). The first network node then performs the second traversal operation on the fourth container to determine the second segment identifier in the fourth container. This process is repeated until the first network node determines that a certain 16-bit content is within the node identifier range, or until the first network node has traversed all containers following the first container in the segment list of the first message. After the first network node determines the second segment identifier, it updates the entire contents of the container containing the second segment identifier into the destination address field of the first message. The first network node offsets the contents between the block field and the second segment identifier in the updated destination address field, and then offsets the second segment identifier into a target field within the destination address field. The target field is located after the block field in the destination address field. For example, the target field is adjacent to the block field. In this embodiment, the target field is 16 bits long. It should be noted that when the first network node traverses the contents of the second container 16 bits at a time, the 16 bits traversed at any two times are adjacent and do not overlap.The process of the first network node performing the second traversal operation on the third container, the fourth container, and other containers located after the second container can refer to the process of the first network node performing the second traversal operation on the second container, which is not repeated here.

[0186] In an optional embodiment, the first segment identifier in the destination address field of the first message is located in a target field in the destination address field, the first network node determines the field in the destination address field that follows the target field based on planning information Y, and the first network node determines whether the first segment identifier is the last segment identifier in the first container based on the value in the field in the destination address field that follows the target field. In one embodiment, the first segment identifier is a GSID, and at least the two lowest bits in the destination address field of the first message are a CL field. The first network node determines whether the first segment identifier is the last segment identifier in the first container based on whether the value in the CL field is null; if the value in the CL field is null, the first network node determines that the first segment identifier is the last segment identifier in the first container; if the value in the CL field is not null, the first network node determines that the first segment identifier is not the last segment identifier in the first container. In another embodiment, the first segment identifier is a GSID or a USID, and the first network node determines whether the first segment identifier is the last segment identifier in the first container based on whether the values ​​in all fields after the first segment identifier in the destination address field of the first message are null values; if the values ​​in all fields after the first segment identifier in the destination address field are null values, the first network node determines that the first segment identifier is the last segment identifier in the first container; if the value in the field after the first segment identifier in the destination address field is not null, the first network node determines that the first segment identifier is not the last segment identifier in the first container.

[0187] In an optional embodiment, the first network node determines, based on planning information Y, a field following the compression function field in the destination address field of the first message, and determines, based on a value in a field following the compression function field in the destination address field, whether the first segment identifier is the last segment identifier in the first container. For example, if the values ​​in all fields following the compression function field in the destination address field are null, the first network node determines that the first segment identifier is the last segment identifier in the first container; if the value in the field following the compression function field in the destination address field is not null, the first network node determines that the first segment identifier is not the last segment identifier in the first container.

[0188] Second situation: the first network node updates the value of the CL field in the first message, and the first network node determines the second segment identifier according to the updated value of the CL field.

[0189] The first message includes a segment list, an SL field, and a CL field. The segment list includes multiple containers, each container is used to carry a standard segment identifier or at least one compressed segment identifier. The value in the SL field is an SL pointer, which is used to indicate the active container in the segment list. The value in the CL field is a CL pointer, which is used to indicate the active compressed segment identifier in the active container. The multiple containers include a first container, which carries a first segment identifier. The active container currently indicated by the SL pointer is the first container, and the active compressed segment identifier currently indicated by the CL pointer is the first segment identifier in the first container. The first network node determines whether the first segment identifier is the last segment identifier in the first container based on planning information Y. If the first segment identifier is the last segment identifier in the first container, the first network node updates the value of the CL field to offset the CL pointer. The first network node determines the second segment identifier based on the updated value of the CL field.

[0190] In one embodiment, the segment list of the first message is encoded using GSID, and the first segment identifier carries a first COC feature to indicate that the next segment identifier of the first segment identifier is a compressed segment identifier with a length of 32 bits. The first network node updates the value of the CL field in the first message (for example, executing CL--) to offset the CL pointer to the next segment identifier of the first segment identifier in the first container. The first network node determines the next segment identifier as the second segment identifier. The first network node updates the second segment identifier to the target field in the destination address field of the first message. For example, the first network node replaces the first segment identifier in the target field with the second segment identifier. The target field is located after the block field in the destination address field. For example, the target field is adjacent to the block field. In this embodiment, the length of the next segment identifier is 32 bits, and the length of the target field is 32 bits.

[0191] In another embodiment, the segment list of the first message is encoded using GSID, and the first segment identifier carries a second COC feature to indicate that the next segment identifier of the first segment identifier is a compressed segment identifier with a length of 16 bits. The first network node continuously updates the value of the CL field in the first message (for example, continuously executes CL--) to traverse the content following the first segment identifier in the first container 16 bits at a time; each time a 16-bit content is traversed, the first network node determines whether the 16-bit content is within the node identifier range included in the planning information Y; if the 16-bit content is within the node identifier range, the first network node stops traversing and determines the 16-bit content as the second segment identifier; if the 16-bit content is not within the node identifier range, the first network node continues traversing until it is determined in the first container that a certain 16-bit content is within the node identifier range, and the first network node determines the 16-bit content as the second segment identifier. If the first network node does not determine within the first container the 16-bit content within the node identifier range, the first network node updates the value of the SL field in the first message (e.g., executes SL--) to offset the SL pointer to the next container after the first container (e.g., the second container). The first network node then performs a first traversal operation on the second container to determine the second segment identifier in the second container. If the first network node does not determine within the second container the 16-bit content within the node identifier range, the first network node again updates the value of the SL field to offset the SL pointer to the next container after the second container (e.g., the third container). The first network node then performs the first traversal operation on the third container to determine the second segment identifier in the third container. This process repeats until the first network node determines that a 16-bit content falls within the node identifier range, or until the first network node has traversed all containers following the first container in the segment list of the first message. After determining the second segment identifier, the first network node updates the second segment identifier to the target field in the destination address field of the first message. For example, the first network node replaces the first segment identifier in the target field with the second segment identifier. The target field is located after the block field in the destination address field. For example, the target field is adjacent to the block field. In this embodiment, the target field is 16 bits long. In this embodiment, the process of the first network node performing the first traversal operation on the second container, the third container, etc. can refer to the process of the first network node performing the first traversal operation on the second container in the first case above, and is not further described here.

[0192] The third situation: the first network node traverses the destination address field of the first message to determine the second segment identifier.

[0193] The destination address field of the first message may include multiple segment identifiers, including a compressed segment identifier with a length of 16 bits. For example, the multiple segment identifiers are all 16-bit USIDs, or the multiple segment identifiers include a 16-bit USID and a 32-bit USID. The multiple segment identifiers include a first segment identifier, which is located in a target field of the destination address field. The target field is located after a block field in the destination address field, and the target field may be adjacent to the block field. The first network node can traverse the content after the first segment identifier in the destination address field 16 bits at a time; each time a 16-bit content is traversed, the first network node determines whether the 16-bit content is within the node identifier range included in the planning information Y; if the 16-bit content is within the node identifier range, the first network node stops traversing and determines the 16-bit content as the second segment identifier; if the 16-bit content is not within the node identifier range, the first network node continues traversing until it determines that a certain 16-bit content in the destination address field is within the node identifier range, and the first network node determines the 16-bit content as the second segment identifier. If the first network node determines the second segment identifier in the destination address field, the first network node offsets the content between the block field and the second segment identifier in the destination address field, and offsets the second segment identifier to the target field in the destination address field. Optionally, the first message includes a segment list and an SL field, the segment list includes multiple containers, each container is used to carry a standard segment identifier or carry at least one compressed segment identifier, the value in the SL field is an SL pointer, the SL pointer is used to indicate an active container in the segment list, the multiple containers include a first container, the first container carries a first segment identifier, the active container currently indicated by the SL pointer is the first container, and the content in the destination address field of the current first message is the content in the first container. If the first network node traverses the destination address field and fails to determine the 16-bit content within the node identifier range (that is, the second segment identifier is not determined), the first network node updates the value of the SL field (for example, executes SL--) to offset the SL pointer to the next container of the first container (for example, the second container), and the first network node performs a second traversal operation on the second container to determine the second segment identifier in the second container. If the first network node does not determine in the second container that a 16-bit content is within the node identifier range, the first network node again updates the value of the SL field to shift the SL pointer to the next container after the second container (e.g., the third container). The first network node then performs the second traversal operation on the third container to determine the second segment identifier in the third container. This process is repeated until the first network node determines that a 16-bit content is within the node identifier range, or until the first network node has traversed all containers following the first container in the segment list of the first message.After the first network node determines the second segment identifier in a container subsequent to the first container, the first network node updates the entire contents of the container containing the second segment identifier into the destination address field of the first message. The first network node then offsets the contents between the block field and the second segment identifier in the updated destination address field, and then offsets the second segment identifier into the destination field of the destination address field. In this embodiment, the destination field may be 16 bits long.

[0194] A fourth situation: the first network node updates the value of the destination field in the first message to determine the second segment identifier, the destination field is included in the destination address field, and the destination field is located after the block field in the destination address field.

[0195] The destination address field of the first message may include multiple segment identifiers, each of which is a 32-bit USID. The multiple segment identifiers include a first segment identifier, which is located in a target field within the destination address field. The target field is located after the block field within the destination address field and may be adjacent to the block field. The first network node shifts the content of the destination address field after the block field to the left by 32 bits. The content of the target field after the shift is the second segment identifier. In this embodiment, the target field may be 32 bits long.

[0196] S603. The first network node forwards the first message according to the second segment identifier.

[0197] In S602, the first network node may update the destination address of the first message, and the destination address field of the updated first message includes a second segment identifier, and the second segment identifier may be located after the block field in the destination address field. The first message in S603 is the first message after the destination address is updated, and the destination address field of the first message includes the second segment identifier. Optionally, the first network node uses the longest mask match to search the routing table of the first network node according to the destination address of the first message, and the first network node determines that the destination address hits the second routing table item in the routing table. The first network node determines the second outbound interface of the first network node and the third network node according to the second routing table item, and the first network node forwards the first message to the third network node through the second outbound interface. The second routing table item includes a correspondence between the second segment identifier in the destination address, the indication information of the second outbound interface (e.g., the interface number), and the indication information of the third network node.

[0198] In one example, the first message received by the first network node is shown in FIG27 , and the first message after the first network node updates the destination address is shown in FIG30 . After the destination address is updated, the destination address field of the first message includes a block field, a target field, and a parameter field. The block field is located at the highest bit in the destination address field, the target field is located after the block field and is adjacent to the block field, and the parameter field is located at the lowest bit in the destination address field. The lowest bit of the parameter field is the CL field. The GSID [m-3] is located in the target field, and the GSID [m-3] is the second segment identifier. The value in the SL field in the first message is n-2, and the value in the CL field is m-3. The CL pointer carried by the CL field is used to indicate the GSID [m-3] in the GSID container [n-2] (that is, the GSID [m-3] in the GSID container [n-2] is the currently active GSID). The first network node uses the longest mask match to search the routing table of the first network node according to the destination address of the first message (the destination address includes block+GSID[m-3] at this time) to determine that the destination address hits the second routing table item in the routing table (for example, block+GSID[m-3] hits the second routing table item). The first network node determines the second output interface of the first network node and the third network node according to the second routing table item, and the first network node sends the first message shown in Figure 30 to the third network node through the second output interface.

[0199] In another example, the first message received by the first network node is shown in FIG28 , and the first message after the first network node updates the destination address is shown in FIG31 . After the destination address is updated, the destination address field of the first message includes a block field and a target field. The block field is located at the highest bit in the destination address field, and the target field is located after and adjacent to the block field. The destination address field carries block information, USID (n-1) 4, and USID (n-1) 5. USID (n-1) 4 is located in the target field. USID (n-1) 4 is the second segment identifier. The block information in the block field, USID (n-1) 4, and USID (n-1) 5 are the block information, USID (n-1) 4, and USID (n-1) 5 in the SID container [n-1] indicated by the SL pointer in the first message, respectively. The first network node uses the longest mask match to search the routing table of the first network node according to the destination address of the first message (at this time the destination address includes block+USID(n-1)4+USID(n-1)5) to determine that the destination address hits the second routing table item in the routing table (for example, block+USID(n-1)4 hits the second routing table item). The first network node determines the second output interface of the first network node and the third network node according to the second routing table item, and the first network node sends the first message shown in Figure 31 to the third network node through the second output interface.

[0200] In another example, the first message received by the first network node is shown in Figure 29, and the first message after the first network node updates the destination address is shown in Figure 32. After the destination address is updated, the destination address field of the first message includes a block field and a target field. The block field is located at the highest bit in the destination address field, and the target field is located after the block field and adjacent to the block field. The destination address field carries block information and USID (n-2) 2. The USID (n-2) 2 is located in the target field. The USID (n-2) 2 is the second segment identifier. The block information in the block field and the USID (n-2) 2 are the block information and USID (n-2) 2 in the SID container [n-2] indicated by the SL pointer in the first message, respectively. The first network node uses the longest mask match to search the routing table of the first network node according to the destination address of the first message (the destination address includes block+USID(n-2)2 at this time) to determine that the destination address hits the second routing table item in the routing table (for example, block+USID(n-2)2 hits the second routing table item). The first network node determines the second output interface of the first network node and the third network node according to the second routing table item, and the first network node sends the first message shown in Figure 32 to the third network node through the second output interface.

[0201] To summarize, in the message forwarding method provided in the embodiment of the present application, the destination address field of the first message received by the first network node includes a first segment identifier, the first segment identifier is a compressed segment identifier, the first segment identifier corresponds to the first output interface of the first network node or corresponds to the next hop node of the first network node, and in the event of a failure of the first output interface or the next hop node, the first network node determines the second segment identifier in the segment list of the first message or determines the second segment identifier in the destination address field of the first message based on the segment identifier planning information of the node corresponding to the first segment identifier (for example, the first network node determines the next segment identifier of the first segment identifier based on the segment identifier planning information of the node corresponding to the first segment identifier), and the first network node forwards the first message based on the second segment identifier. Therefore, an embodiment of the present application provides a message forwarding solution applied to a compressed segment identifier scenario, in which, when the first segment identifier in the destination address field of the first message corresponds to the first output interface of the first network node and the first output interface fails, the first network node determines the next segment identifier based on the segment identifier planning information of the first network node, and forwards the first message based on the next segment identifier, so that the first message is forwarded around the failed interface; when the first segment identifier in the destination address field of the first message corresponds to the next hop node of the first network node and the next hop node fails, the first network node determines the next segment identifier based on the segment identifier planning information of the next hop node, and forwards the first message based on the next segment identifier, so that the first message is forwarded around the failed node. The message forwarding method provided by the embodiment of the present application can implement endpoint fault protection in a compressed segment identifier scenario, such as implementing SRv6 endpoint fault protection.

[0202] In the embodiment of the present application, the first segment identifier can be the segment identifier corresponding to the first outbound interface of the first network node, or can be the segment identifier corresponding to the second network node. The following uses the example of the first segment identifier being the segment identifier corresponding to the second network node as an example to describe the message forwarding method provided in the embodiment of the present application in conjunction with the interaction process between the first network node and the second network node.

[0203] Please refer to Figure 33, which shows a flowchart of another message forwarding method provided by an embodiment of the present application. The message forwarding method is applied to a message forwarding system including a first network node and a second network node. The first network node and the second network node are both network nodes on the first forwarding path in the segment routing network, and the second network node is the next hop node of the first network node on the first forwarding path, and the first forwarding path is the forwarding path of the first message (for example, the main forwarding path). The segment routing network is an SR network, an SRv6 network, an SR-MPLS network or other segment routing network. For example, the segment routing network is the SRv6 network 1 in Figure 23, the first forwarding path is the forwarding path S1, the first network node is P1, and the second network node is P3. As shown in Figure 33, the method includes the following steps S701 to S707.

[0204] S701. The second network node publishes first routing information, where the first routing information includes planning information Y, and the planning information Y is the segment identification planning information of the second network node.

[0205] In this embodiment, planning information Y is planning information for the standard segment identifier of the second network node in a compression scenario. Planning information Y includes at least one of the following: the length of the block field, the length of the node identification field, the length of the compression function field, the length of the non-compression function field, the length of the parameter field, and the node identification range. In one example, planning information Y includes the node identification range. In another example, planning information Y includes the length of the compression function field. In yet another example, planning information Y includes the length of the compression function field and the length of the non-compression function field. Optionally, planning information Y further includes at least one of the following: the length of the block field, the length of the node identification field, and the length of the parameter field. For example, the length of the block field is 48 bits, the length of the node identification field is 16 bits, the length of the compression function field is 16 bits, the length of the non-compression function field is 24 bits, the length of the parameter field is 24 bits, and the node identification range is a GIB or a subset of a GIB.

[0206] Optionally, the first routing information includes planning information Y and a segment identifier (for example, a standard segment identifier corresponding to the first segment identifier). The first routing information is carried in the target TLV field. The target TLV field includes a first sub-TLV field and a second sub-TLV field. The first sub-TLV field and the second sub-TLV field can be sub-TLV fields at the same level of the target TLV. The first sub-TLV field is used to carry planning information Y, and the second sub-TLV field is used to carry the segment identifier. The first routing information can be locator routing information or block routing information. The locator routing information includes block information and a node identifier, and the block routing information includes block information but does not include a node identifier. The embodiment of the present application takes the example of the first routing information being locator routing information or block routing information. In other embodiments, the first routing information can be other routing information, and the present application does not limit this.

[0207] In an embodiment of the present application, the second network node may publish the first routing information based on various possible routing protocols, including but not limited to an interior gateway protocol (IGP), an intermediate system to intermediate system (ISIS) protocol, an open shortest path first (OSPF) protocol, etc. For example, the second network node publishes a control plane message, where the control plane message is an IGP message, an ISIS message, or an OSPF message, and the control plane message includes the above-mentioned target TLV field.

[0208] S702. The first network node receives first routing information published by the second network node.

[0209] The first network node may receive, through a first outbound interface, first routing information published by the second network node. For example, the first network node may receive, through the first outbound interface, a control plane message published by the second network node. The control plane message may be an IGP message, an ISIS message, or an OSPF message. The control plane message may include a target TLV, and the first routing information may be carried in the target TLV.

[0210] S703. The first network node generates a first routing table entry according to the first routing information, where the first routing table entry includes planning information Y.

[0211] Optionally, the first routing information carries the standard segment identifier and planning information Y corresponding to the first segment identifier, and the first routing table entry includes a correspondence between the standard segment identifier and planning information Y corresponding to the first segment identifier.

[0212] Optionally, the first network node generates a first routing table entry based on the interface through which the first network node receives the first routing information (i.e., the first output interface) and the first routing information. The first routing table entry also includes the correspondence between the standard segment identifier corresponding to the first segment identifier, the indication information of the first output interface (e.g., the interface number), and the indication information of the second network node.

[0213] S704. The first network node receives a first message, the destination address field of the first message includes a first segment identifier, the first segment identifier is a compressed segment identifier, the first segment identifier corresponds to a second network node, and the second network node is the next hop node of the first network node.

[0214] The implementation process of S704 can refer to the implementation process of S601, and will not be described in detail here.

[0215] S705. Based on the failure of the second network node, the first network node determines a second segment identifier according to the planning information Y, where the second segment identifier is the segment identifier in the segment list of the first message or the second segment identifier is the segment identifier in the destination address field of the first message.

[0216] In an optional embodiment, the first network node uses a longest mask match to search the routing table of the first network node based on the destination address of the first message. The first network node determines that the first segment identifier in the destination address field of the first message hits the first routing table entry in the routing table (that is, the destination address of the first message hits the first routing table entry). The first network node determines the second network node based on the first routing table entry. The first routing table entry is generated by the first network node based on the first routing information published by the second network node. The first routing information is locator routing information or block routing information. Accordingly, the first routing table entry is a locator routing table entry or a block routing table entry. The first segment identifier in the destination address field of the first message hits the first routing table entry, including any one of the following: when the first segment identifier is a compressed segment identifier with a length of 32 bits, the locator information composed of the block information in the destination address field and the node identifier in the first segment identifier hits the first routing table entry; or, when the first segment identifier is a compressed segment identifier with a length of 16 bits and the first segment identifier is a node identifier, the locator information composed of the block information in the destination address field and the first segment identifier hits the first routing table entry; or, when the first segment identifier is a compressed segment identifier with a length of 16 bits and the first segment identifier is a compression function identifier, the information composed of the block information in the destination address field and the first segment identifier hits the first routing table entry.

[0217] The first network node can determine whether the second network node has a fault based on various fault perception technologies, and the first network node performs a proxy forwarding operation after determining that the second network node has a fault. Optionally, the process of the first network node performing the proxy forwarding operation includes: the first network node determines the planning information Y based on the first routing table item, the first network node determines that the first segment identifier is a compressed segment identifier based on the planning information Y, and based on the first segment identifier being a compressed segment identifier, the first network node determines the second segment identifier based on the planning information Y. The implementation process of the first network node determining that the first segment identifier is a compressed segment identifier based on the planning information Y can refer to the second embodiment in S602, and the implementation process of the first network node determining the second segment identifier based on the planning information Y can refer to the four situations in S602. For other detailed descriptions in S705, please refer to the relevant description of the first segment identifier corresponding to the second network node in S602, which will not be repeated here.

[0218] S706. The first network node forwards the first message according to the second segment identifier.

[0219] The implementation process of S706 can refer to the implementation process of S603, and will not be described in detail here.

[0220] S707 . Based on the failure of the second network node, the first network node deletes the first routing table entry after a preset time period.

[0221] The first network node deletes the first routing table entry after a preset time period after determining that the second network node has failed. The preset time period can be set based on actual circumstances. The first network node deleting the first routing table entry after the preset time period can be referred to as slow deletion, i.e., the first network node slowly deletes the first routing table entry based on the failure of the second network node.

[0222] In an embodiment of the present application, after the first network node determines that the second network node has failed, the first network node needs to perform a proxy forwarding operation. During the process of performing the proxy forwarding operation, the first network node needs to determine the second segment identifier based on the planning information Y in the first routing table item. If the first network node immediately deletes the first routing table item after determining that the second network node has failed, the first network node will be unable to determine the second segment identifier and thus will be unable to perform the proxy forwarding operation. Therefore, in an embodiment of the present application, the first network node does not immediately delete the first routing table item after determining that the second network node has failed, but deletes the first routing table item after a preset time period. This allows the first network node to use the planning information Y in the first routing table item to determine the second segment identifier and thus perform the proxy forwarding operation after the second network node has failed and before routing convergence.

[0223] In summary, the message forwarding method provided by the embodiment of the present application is that the destination address field of the first message received by the first network node includes a first segment identifier, the first segment identifier is a compressed segment identifier, the first segment identifier corresponds to the next hop node of the first network node, and in the event of a failure of the next hop node, the first network node determines the second segment identifier in the segment list of the first message or determines the second segment identifier in the destination address field of the first message according to the segment identifier planning information of the node corresponding to the first segment identifier (for example, the first network node determines the next segment identifier of the first segment identifier according to the segment identifier planning information of the node corresponding to the first segment identifier), and the first network node forwards the first message according to the second segment identifier. Therefore, the embodiment of the present application provides a message forwarding scheme applied to a compressed segment identifier scenario, in which the first segment identifier in the destination address field of the first message corresponds to the next hop node of the first network node and the next hop node fails, the first network node determines the next segment identifier according to the segment identifier planning information of the next hop node, and forwards the first message according to the next segment identifier, so that the first message is forwarded around the failed node, and endpoint fault protection is implemented in the compressed segment identifier scenario, for example, SRv6 endpoint fault protection is implemented.

[0224] The above embodiment uses the example of a compressed segment identifier as the first segment identifier. In other embodiments, the first segment identifier is a standard segment identifier (i.e., a non-compressed segment identifier). The first network node determines the first compressed segment identifier as a standard segment identifier based on the value of the compression function field in the destination address field of the first message. The first network node updates the value of the SL field in the first message, and the first network node determines the second segment identifier based on the updated value of the SL field. In this embodiment, the implementation process of the first network node determining the second segment identifier can refer to the first case in S602 above and is not further described here.

[0225] The following introduces the message forwarding method provided in the embodiment of the present application using four examples in combination with the application scenario shown in FIG23 .

[0226] For the first example, please refer to Figure 34, which shows a schematic diagram of a message forwarding method provided by an embodiment of the present application. Figure 34 uses a segment list with a 32-bit GSID encoding as an example. As shown in Figure 34, the standard segment identifier of P3 is A0:1::100, and the compressed segment identifier corresponding to the standard segment identifier "A0:1::100" is 32 bits long, 1::100; the standard segment identifier of PE3 is A0:2::200, and the compressed segment identifier corresponding to the standard segment identifier "A0:2::200" is 32 bits long, 2::200.

[0227] When each network node in SRv6 network 1 publishes routing information to the SRv6 network 1, the routing information carries the segment identification planning information of the network node. Each network node in the SRv6 network 1 generates a routing table entry that is reachable to the other network node based on the routing information published by the other network nodes in the SRv6 network 1, and stores the segment identification planning information of the other network node in the routing table entry. For example, when P3 publishes routing information X1, the routing information X1 carries P3's segment identification planning information Y1. After receiving the routing information X1, P1 generates a routing table entry Z1 based on the routing information X1. The routing table entry Z1 includes the planning information Y1. The planning information Y1 includes at least one of the following: the length of the block field, the length of the node identification field, the length of the compression function field, the length of the non-compression function field, the length of the parameter field, and the node identification range.

[0228] As shown in Figure 34, PE1 wants to send packet B to PE3. PE1 specifies that packet B must pass through P3. Packet B generated by PE1 includes a payload, an SRH, and an IPv6 header. The segment list in the SRH includes a first container, which carries P3's compressed segment identifier "1::100" and PE3's compressed segment identifier "2::200." The compressed segment identifiers "1::100" and "2::200" are arranged in ascending order within the first container, with the lowest 64 bits of the first container filled with 0s. The IPv6 header includes a destination address field, which carries the destination address of packet B. The destination address of packet B generated by PE1 is "A0:1::100." Among them, the destination address field includes a block field, a target field and a parameter field. The block field is the highest 48 bits in the destination address field, the target field is the 32 bits located after the block field and adjacent to the block field, the parameter field is the lowest 24 bits in the destination address field, and the lowest 2 bits in the parameter field are the CL field. The block field carries block information "A0", the target field carries the compressed segment identifier "1::100", the value in the CL field is 3, and the CL pointer carried by the CL field is used to indicate the first compressed segment identifier "1::100" in the first container. The other bits in the destination address field are all 0.

[0229] After PE1 generates packet B, it uses the longest mask match to search its routing table based on packet B's destination address, "A0:1::100." Based on the result, PE1 forwards packet B to P1. After P1 receives packet B, it uses the longest mask match to search its routing table based on packet B's destination address, "A0:1::100." The result is that P1 finds that packet B's destination address, "A0:1::100," matches entry Z1 in P1's routing table. Based on entry Z1, P1 determines that P3 is the next hop. P1 detects a P3 failure, and since packet B's destination address, "A0:1::100," is P3's segment identifier (P1 is the previous hop for packet B's destination address, "A0:1::100"), and the value in the CL field in packet B is greater than 0, P1 performs proxy forwarding to process packet B on behalf of P3. Specifically, P1 determines P3's segment identifier planning information Y1 based on the routing table entry Z1. P1 determines that "1::100" in the destination address "A0:1::100" of message B is a compressed segment identifier based on the planning information Y1, and determines that the compressed segment identifier "1::100" is not the last segment identifier in the first container. Therefore, P1 executes CL--offsets the CL pointer to the next segment identifier "2::200" of the compressed segment identifier "1::100" in the first container. P1 updates the compressed segment identifier "2::200" to the target field in the destination address field of message B to obtain message B'. P1 uses the longest mask match to search P1's routing table based on the destination address "A0:2::200" of message B' to determine that P1's next hop node is P2, and P1 forwards message B' to P2. After receiving packet B', P2 uses the longest mask match to search P2's routing table based on B's destination address "A0:2::200" and determines that P2's next hop is P4. P2 then forwards packet B' to P4. After receiving packet B', P4 uses the longest mask match to search P4's routing table based on B's destination address "A0:2::200" and determines that P4's next hop is PE4. P4 then forwards packet B' to PE4. After receiving packet B', PE4 uses the longest mask match to search PE4's routing table based on B's destination address "A0:2::200" and determines that PE4's next hop is PE3. PE4 then forwards packet B' to PE3. Ultimately, packet B (including packet B') bypasses the faulty P3 and is forwarded to PE3 along forwarding path S2.

[0230] The process of P1 determining that "1::100" in the destination address "A0:1::100" of message B is a compressed segment identifier according to planning information Y1 includes: when P1 searches P1's routing table using the longest mask match based on the destination address "A0:1::100" of message B, it determines that "A0:1:: / 64" ("A0:1:: / 64" represents the highest 64 bits in "A0:1::100") in the destination address "A0:1::100" of message B hits P1's routing table entry Z1; P1 determines that "A0:1:: / 64" ("A0:1:: / 64" represents the highest 64 bits in "A0:1::100") in the destination address "A0:1::100" of message B hits P1's routing table entry Z1 according to planning information in routing table entry Z1. Y1 determines that the length of the compression function field in P3's segment identifier plan is 16 bits. P1 determines that the 16 bits in the destination address "A0:1::100" of message B, which are located after "A0:1:: / 64" and adjacent to "A0:1:: / 64", are the compression function field in the destination address field of message B. P1 determines whether the value in the compression function field is 0. If the value in the compression function field is not 0, P1 determines that the destination address of message B is a compressed segment identifier. If the value in the compression function field is 0, P1 determines that the destination address of message B is a standard segment identifier. In this embodiment, if the value in the compression function field is not 0, P1 determines that "1::100" in the destination address of message B is a compressed segment identifier.

[0231] The process by which P1 determines, based on planning information Y1, that the compressed segment identifier "1::100" is not the last segment identifier in the first container includes: P1 determining whether the value in the CL field in the destination address field of packet B is 0; if the value in the CL field is 0, P1 determines that the compressed segment identifier "1::100" is the last segment identifier in the first container; if the value in the CL field is not 0, P1 determines that the compressed segment identifier "1::100" is not the last segment identifier in the first container. In this embodiment, the value in the CL field is not 0, so P1 determines that the compressed segment identifier "1::100" is not the last segment identifier in the first container.

[0232] This embodiment uses the example where "1::100" in the destination address "A0:1::100" of message B is a compressed segment identifier, and the compressed segment identifier "1::100" is not the last segment identifier in the first container. In some embodiments, the destination address of message B is a standard segment identifier, the segment list of message B includes multiple containers, and P1 executes SL-- to shift the SL pointer to the next container of the first container. P1 updates the destination address of message B based on the next container and then forwards message B. In other embodiments, "1::100" in the destination address "A0:1::100" of message B is a compressed segment identifier, the compressed segment identifier "1::100" is the last segment identifier in the first container, and the segment list of message B includes multiple containers. P1 executes SL-- to shift the SL pointer to the next container of the first container. P1 updates the destination address of message B based on the next container and then forwards message B.

[0233] For the second example, please refer to Figure 35, which shows a schematic diagram of another message forwarding method provided by an embodiment of the present application. Figure 35 uses the mixed encoding of a 16-bit GSID and a 32-bit GSID in the segment list as an example. As shown in Figure 35, the first outbound interface of P1 corresponds to P3, and the standard segment identifier of the first outbound interface of P1 is A0:3::300. The length of the compressed segment identifier "A0:3::300" corresponding to the standard segment identifier "A0:3::300" is 16 bits. The standard segment identifier of P3 is A0:1::100, and the length of the compressed segment identifier "A0:1::100" corresponding to the standard segment identifier is 100. The standard segment identifier of PE3 is A0:2::200, and the length of the compressed segment identifier "A0:2::200" corresponding to the standard segment identifier is 2::200. The local segment identifier table of each network node in the SRv6 network 1 stores the segment identifier planning information of the network node. For example, the local segment identification table of P1 stores the segment identification planning information Y2 of P1, and the planning information Y2 includes at least one of the following: the length of the block field, the length of the node identification field, the length of the compression function field, the length of the non-compression function field, the length of the parameter field, and the node identification range.

[0234] As shown in Figure 35, PE1 wants to send packet B to PE3. PE1 specifies that packet B must pass through P1's first outbound interface and P3. Packet B generated by PE1 includes a payload, an SRH, and an IPv6 header. The segment list in the SRH includes a first container, which carries the compressed segment identifier "300" of P1's first outbound interface, the compressed segment identifier "100" of P3, and the compressed segment identifier "2::200" of PE3. The compressed segment identifiers "300," "100," and "2::200" are arranged in ascending order within the first container, with the lowest 64 bits of the first container filled with 0s. The IPv6 header includes a destination address field, which carries the destination address of packet B. The destination address of packet B generated by PE1 is "A0:300." Among them, the destination address field includes a block field, a target field and a parameter field. The block field is the highest 48 bits in the destination address field, the target field is the 16 bits located after the block field and adjacent to the block field, the parameter field is the lowest 24 bits in the destination address field, and the lowest 3 bits in the parameter field are the CL field. The block field carries block information "A0", the target field carries the compressed segment identifier "300", the value in the CL field is 7, and the CL pointer carried by the CL field is used to indicate the first compressed segment identifier "300" in the first container. The other bits in the destination address field are all 0.

[0235] After PE1 generates packet B, it uses the longest mask match to search its routing table based on packet B's destination address "A0:300." Based on the search result, PE1 forwards packet B to P1. After P1 receives packet B, it searches its local segment identifier table based on packet B's destination address "A0:300." P1 determines that the destination address "A0:300" matches the local segment identifier table (for example, "A0:300 / 64" in the destination address "A0:300" matches the local segment identifier table, where "A0:300 / 64" is the most significant 64 bits of "A0:300"). Based on the local segment identifier table, P1 determines that the destination address "A0:300" indicates P1's first outbound interface. P1 detects a failure on this first outbound interface and determines the next segment identifier based on the planning information Y2 stored in P1's local segment identifier table. Specifically, P1 determines that the "300" in the destination address "A0:300" is a compressed segment identifier based on the flavor carried by the destination address "A0:300", and P1 continues to execute CL-- to traverse the content after the compressed segment identifier "300" in the first container 16 bits at a time; each time a 16-bit content is traversed, P1 determines whether the 16-bit content is within the node identifier range included in the planning information Y2; if the 16-bit content is within the node identifier range, P1 stops traversing, P1 determines that the 16-bit content is the next segment identifier, and P1 updates the 16-bit content to the target field in the destination address field of message B; if the 16-bit content is not within the node identifier range, P1 continues traversing until it is determined in the first container that a 16-bit content is within the node identifier range, and P1 updates the 16-bit content to the target field in the destination address field of message B. In the embodiment of the present application, the 16-bit content "2" in the first container is within the node identification range as an example. P1 updates the 16-bit content "2" to the target field in the destination address field of message B to obtain message B'. P1 uses the longest mask match to search P1's routing table based on the destination address "A0:2" of message B' to determine that P1's next hop node is P2, and P1 forwards message B' to P2. After receiving message B', P2 uses the longest mask match to search P2's routing table based on the destination address "A0:2" of message B' to determine that P2's next hop node is P4, and P2 forwards message B' to P4. After receiving message B', P4 uses the longest mask match to search P4's routing table based on the destination address "A0:2" of message B' to determine that P4's next hop node is PE4, and P4 forwards message B' to PE4. After receiving packet B', PE4 uses the longest mask match to search PE4's routing table based on the destination address "A0:2" of packet B' and determines that PE4's next hop node is PE3. PE4 then forwards packet B' to PE3.Finally, packet B (including packet B') bypasses the faulty interface of P1 and is forwarded to PE3 along forwarding path S2.

[0236] This embodiment uses the example of P1 determining that 16 bits of content are within the node identifier range in the first container. In some embodiments, the segment list of message B includes multiple containers. If P1 does not determine that 16 bits of content are within the node identifier range in the first container, P1 executes SL-- to shift the SL pointer to the next container of the first container (e.g., the second container), and P1 initializes CL to 7. P1 then continues to execute CL-- to traverse the content of the second container 16 bits at a time to determine 16 bits of content within the node identifier range in the second container. If P1 does not determine that 16 bits of content are within the node identifier range in the second container, P1 executes SL-- to shift the SL pointer to the next container of the second container (e.g., the third container), and P1 initializes CL to 7. P1 then continues to execute CL-- to traverse the content of the third container 16 bits at a time to determine 16 bits of content within the node identifier range in the third container. This process is repeated until P1 determines that a certain 16 bits of content are within the node identifier range, or until P1 has traversed all containers in the segment list.

[0237] For the third example, please refer to Figure 36, which shows a schematic diagram of another message forwarding method provided by an embodiment of the present application. Figure 36 uses a 32-bit USID code as an example. As shown in Figure 36, P3's standard segment identifier is A0:1::100, and the length of the compressed segment identifier "A0:1::100" corresponding to the standard segment identifier "A0:1::100" is 32 bits. The standard segment identifier of PE3 is A0:2::200, and the length of the compressed segment identifier "A0:2::200" corresponding to the standard segment identifier "A0:2::200" is 32 bits. When P3 publishes routing information X1, the routing information X1 carries P3's segment identifier planning information Y1. P1 generates a routing table entry Z1 based on the routing information X1. The routing table entry Z1 includes planning information Y1. The planning information Y1 includes at least one of the following: the length of the block field, the length of the node identification field, the length of the compression function field, the length of the non-compression function field, the length of the parameter field, and the node identification range.

[0238] As shown in Figure 36, PE1 wants to send packet B to PE3. PE1 specifies that packet B must pass through P3. Packet B generated by PE1 includes a payload and an IPv6 header. The IPv6 header includes a destination address field, which carries the destination address of packet B. The destination address generated by PE1 includes "A0:1::100." The destination address field includes a block field and a destination field. The block field is the highest-order 48 bits of the destination address field, while the destination field is the 32 bits following and adjacent to the block field. The block field carries the block information "A0," the destination field carries the compressed segment identifier "1::100," and the 32 bits following the destination field carry the compressed segment identifier "2::200." All other bits are 0.

[0239] After PE1 generates packet B, it uses the longest mask match to search its routing table based on packet B's destination address. PE1 then forwards packet B to P1 based on the result. After P1 receives packet B, it uses the longest mask match to search its routing table based on packet B's destination address. It determines that packet B's destination address matches routing entry Z1 in P1's routing table (for example, "A0:1:: / 64" in the destination address matches routing entry Z1 in P1's routing table. "A0:1:: / 64" represents the most significant 64 bits of the destination address). Based on routing entry Z1, P1 determines that P3 is the next hop. P1 detects a P3 failure, and since packet B's destination address is P3's segment identifier, P1 performs proxy forwarding to process packet B on P3's behalf. Specifically, P1 determines P3's segment identifier planning information Y1 based on routing table entry Z1. Based on planning information Y1, P1 determines that "1::100" in the destination address field of message B is a compressed segment identifier, and determines that the compressed segment identifier "1::100" is not the last segment identifier in the destination address field. Therefore, P1 shifts the content after block information "A0" in the destination address field to the left by 32 bits to obtain message B'. P1 uses the longest mask match to search P1's routing table based on message B's destination address "A0:2::200" and determines that P1's next hop node is P2. P1 forwards message B' to P2. After P2 receives message B', P2 uses the longest mask match to search P2's routing table based on message B's destination address "A0:2::200" and determines that P2's next hop node is P4. P2 forwards message B' to P4. After receiving packet B', P4 uses the longest mask match against B's destination address "A0:2::200" to search its routing table and determine that P4's next hop is PE4. P4 then forwards packet B' to PE4. After receiving packet B', PE4 uses the longest mask match against B's destination address "A0:2::200" to search its routing table and determine that PE4's next hop is PE3. PE4 then forwards packet B' to PE3. Ultimately, packet B (including packet B') bypasses the faulty P3 and is forwarded along forwarding path S2 to PE3.

[0240] In this embodiment, the implementation process of P1 determining that "1::100" in the destination address of message B is a compressed segment identifier based on planning information Y1 can refer to the implementation process of P1 determining that "1::100" in the destination address of message B is a compressed segment identifier based on planning information Y1 in the first example above. In this embodiment, the process of P1 determining that the compressed segment identifier "1::100" is not the last segment identifier in the destination address of message B based on planning information Y1 includes: P1 determining whether the value in the field following "1::100" in the destination address field of message B is 0; if the value in the field following "1::100" in the destination address field is 0, P1 determines that the compressed segment identifier "1::100" is the last segment identifier in the destination address field of message B; if the value in the field following "1::100" in the destination address field is not 0, P1 determines that the compressed segment identifier "1::100" is not the last segment identifier in the destination address field of message B. In this embodiment, the value of the field after the compressed segment identifier "1::100" in the destination address field of message B is not 0, so P1 determines that the compressed segment identifier "1::100" is not the last segment identifier in the destination address field of message B.

[0241] For the fourth example, please refer to Figure 37, which shows a schematic diagram of another message forwarding method provided by an embodiment of the present application. Figure 37 uses the mixed encoding of a USID with a length of 16 bits and a USID with a length of 32 bits in the segment list as an example. As shown in Figure 37, the first outbound interface of P1 corresponds to P3, and the standard segment identifier of the first outbound interface of P1 is A0:3::300. The length of the compressed segment identifier "A0:3::300" corresponding to the standard segment identifier "A0:3::300" is 16 bits. The standard segment identifier of P3 is A0:1::100, and the length of the compressed segment identifier "A0:1::100" corresponding to the standard segment identifier "A0:1::100" is 16 bits. The standard segment identifier of PE3 is A0:2::200, and the length of the compressed segment identifier "A0:2::200" corresponding to the standard segment identifier "A0:2::200" is 32 bits. The local segment identifier table of each network node in the SRv6 network 1 stores the segment identifier planning information of the network node. For example, the local segment identification table of P1 stores the segment identification planning information Y2 of P1, and the planning information Y2 includes at least one of the following: the length of the block field, the length of the node identification field, the length of the compression function field, the length of the non-compression function field, the length of the parameter field, and the node identification range.

[0242] As shown in Figure 37, PE1 wants to send packet B to PE3. PE1 specifies that packet B must pass through P1's first outbound interface and P3. Packet B generated by PE1 includes a payload and an IPv6 header. The IPv6 header includes a destination address field, which carries the destination address of packet B. The destination address generated by PE1 includes "A0:300." The destination address field includes a block field and a target field. The block field is the highest-order 48 bits of the destination address field, and the target field is the 16 bits located after and adjacent to the block field. The block field carries the block information "A0," and the target field carries the compressed segment identifier "300." The fields following the target field carry, in sequence, the 16-bit compressed segment identifier "100" and the 32-bit compressed segment identifier "2::200."

[0243] After PE1 generates packet B, it uses the longest mask match to search its routing table based on the destination address of packet B. Based on the search result, PE1 forwards packet B to P1. After P1 receives packet B, it searches its local segment identifier table based on the destination address of packet B. P1 determines that the destination address matches the local segment identifier table (for example, "A0:300 / 64" in the destination address matches the local segment identifier table, and "A0:300 / 64" is the highest 64 bits in the destination address). Based on the local segment identifier table, P1 determines that "A0:300 / 64" in the destination address indicates P1's first outbound interface. P1 detects a failure in this first outbound interface and determines the next segment identifier based on the planning information Y2 stored in P1's local segment identifier table. Specifically, P1 determines that the "300" in the destination address is a compressed segment identifier based on the flavor carried by "A0:300 / 64" in the destination address, and traverses the content after "A0:300 / 64" in the destination address field of message B 16 bits at a time from the end position of "A0:300 / 64" in the destination address; each time a 16-bit content is traversed, P1 determines whether the 16-bit content is within the node identifier range included in the planning information Y2; if the 16-bit content is within the node identifier range, P1 stops traversing, and P1 Determine that the 16-bit content is the next segment identifier, and P1 shifts the content after the block field in the destination address field of message B to the left to offset the 16-bit content to the target field in the destination address field; if the 16-bit content is not within the node identifier range, P1 continues to traverse until it is determined that a certain 16-bit content in the destination address field of message B is within the node identifier range, and P1 shifts the content after the block field in the destination address field of message B to the left to offset the 16-bit content to the target field in the destination address field. In this embodiment of the present application, the 16-bit content "2" in the destination address field of message B is within the node identification range. P1 shifts the content after the block field in the destination address field of message B to the left to shift the 16-bit content "2" into the target field of the destination address field to obtain message B'. P1 uses the longest mask match to search P1's routing table based on message B's destination address "A0:2::200" to determine that P1's next hop node is P2. P1 then forwards message B' to P2. After receiving message B', P2 uses the longest mask match to search P2's routing table based on message B's destination address "A0:2::200" to determine that P2's next hop node is P4. P2 then forwards message B' to P4. After receiving message B', P4 uses the longest mask match to search P4's routing table based on message B's destination address "A0:2::200" to determine that P4's next hop node is PE4. P4 then forwards message B' to PE4.After receiving packet B', PE4 uses the longest mask match against B's destination address, A0:2::200, to search its routing table and determine that PE3 is the next hop. PE4 then forwards B' to PE3. Ultimately, packet B (including B') bypasses P1's faulty interface and is forwarded along path S2 to PE3.

[0244] This embodiment uses the example of P1 determining that 16 bits of content in the destination address field of message B are within the node identifier range. In some embodiments, message B includes an SRH, and the segment list in the SRH includes multiple containers, including a first container. The content in the destination address field of the current message B is the content in the first container. If P1 does not determine that 16 bits of content in the destination address field of message B are within the node identifier range, P1 executes SL-- to shift the SL pointer to the next container of the first container (e.g., the second container). P1 traverses the content of the second container 16 bits at a time, starting from the end position of the block field in the second container, to determine 16 bits of content in the second container within the node identifier range. If P1 does not determine that 16 bits of content in the second container are within the node identifier range, P1 executes SL-- to shift the SL pointer to the next container of the second container (e.g., the third container). P1 traverses the content of the third container 16 bits at a time, starting from the end position of the block field in the third container, to determine 16 bits of content in the third container within the node identifier range. This process repeats until P1 determines that a 16-bit content is within the node identifier range, or until P1 has traversed all containers in the segment list. After P1 determines that the 16-bit content is within the node identifier range, P1 updates the entire content of the container containing the 16-bit content to the destination address field of message B. It also offsets the content between the block field and the 16-bit content in the updated destination address field, and shifts the 16-bit content to the target field of the destination address field.

[0245] It should be noted that the "updating destination address field" involved in the description of the above embodiment refers to updating the value in the destination address field. Since the value in the destination address field is the destination address, "updating the destination address field" also means updating the destination address. The "updating destination address" involved in the description of the above embodiment has the same meaning as "updating the destination address field".

[0246] The above is an introduction to the method embodiments of the present application. The following describes the device embodiments of the present application. The device of the present application can be used to perform the method of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments.

[0247] Please refer to Figure 38, which shows a schematic diagram of a message forwarding device 3800 provided in an embodiment of the present application. Message forwarding device 3800 is applied to a first network node. For example, message forwarding device 3800 is the first network node or a functional component within the first network node. Message forwarding device 3800 can implement the message forwarding method provided in the embodiment shown in Figure 26, or implement the steps performed by the first network node in message forwarding provided in the embodiment shown in Figure 33. As shown in Figure 38, message forwarding device 3800 includes: a receiving module 3810, a processing module 3820, and a forwarding module 3830.

[0248] Receiving module 3810 is configured to receive a first message. The destination address field of the first message includes a first segment identifier, where the first segment identifier is a compressed segment identifier. The first segment identifier corresponds to a first outbound interface of the first network node, or the first segment identifier corresponds to a second network node, where the second network node is a next-hop node for the first network node. For the functional implementation of receiving module 3810, please refer to the relevant descriptions in S601 and S704 above.

[0249] Processing module 3820 is configured to determine a second segment identifier based on planning information, based on the failure of the first outbound interface or the failure of the second network node. The second segment identifier is a segment identifier in the segment list of the first message or a segment identifier in the destination address field. The planning information is segment identifier planning information for the node corresponding to the first segment identifier. For the implementation of the functions of processing module 3820, please refer to the relevant descriptions in S602 and S705 above.

[0250] The forwarding module 3830 is configured to forward the first message according to the second segment identifier. For the implementation of the functions of the forwarding module 3830, please refer to the relevant descriptions in S603 and S706 above.

[0251] Optionally, the planning information includes at least one of the following: the length of the block field, the length of the node identification field, the length of the compression function field, the length of the non-compression function field, the length of the parameter field, and the node identification range.

[0252] Optionally, the second segment identifier is a compressed segment identifier or a standard segment identifier, the length of the compressed segment identifier is less than 128 bits, and the length of the standard segment identifier is 128 bits.

[0253] Optionally, the first segment identifier and the second segment identifier are arranged in sequence in the segment list, or the first segment identifier and the second segment identifier are arranged in sequence in the destination address field.

[0254] Optionally, the outbound interface or network node corresponding to the second segment identifier is located downstream of the first network node.

[0255] Optionally, when the first segment identifier corresponds to the first outbound interface of the first network node, the node corresponding to the first segment identifier is the first network node; when the first segment identifier corresponds to the second network node, the node corresponding to the first segment identifier is the second network node.

[0256] Optionally, the processing module 3820 is configured to determine, based on the planning information, that the first segment identifier is a compressed segment identifier.

[0257] Optionally, the processing module 3820 is used to: determine the compression function field in the destination address field according to the planning information; and determine that the first segment identifier is a compression segment identifier according to the value in the compression function field.

[0258] Optionally, the processing module 3820 is configured to determine that the first segment identifier is a compression segment identifier based on the value in the compression function field being a non-null value.

[0259] Optionally, the processing module 3820 is used to: update the value of the remaining segment SL field in the first message, and determine the second segment identifier based on the value of the updated SL field; or, update the value of the remaining compressed CL field in the first message, and determine the second segment identifier based on the value of the updated CL field; or, traverse the destination address field to determine the second segment identifier; or, update the value of the target field in the first message to determine the second segment identifier, the target field being included in the destination address field, and the target field being located after the block field in the destination address field.

[0260] Optionally, the planning information includes a node identifier range, and the processing module 3820 is configured to determine, based on the planning information, whether the node identifier included in the second segment identifier is within the node identifier range.

[0261] Optionally, the destination address field is located in the IPv6 header of the first message.

[0262] Optionally, the receiving module 3810 is further configured to receive first routing information, where the first routing information includes the planning information. For the implementation of the functions of the receiving module 3810, please refer to the relevant description in S702 above.

[0263] Optionally, the processing module 3820 is further configured to generate a first routing table entry according to the first routing information, wherein the first routing table entry includes the planning information. For the implementation of the functions of the processing module 3820, please refer to the relevant description in S703 above.

[0264] Optionally, the processing module 3820 is further configured to delete the first routing table entry after a preset time period based on the failure of the second network node. For the implementation of the functions of the processing module 3820, please refer to the relevant description in S707 above.

[0265] Optionally, the first routing information is locator routing information or block routing information.

[0266] Optionally, the first routing information is carried in a target TLV field, and the target TLV field includes a first sub-TLV field and a second sub-TLV field. The first sub-TLV field is used to carry planning information, and the second sub-TLV field is used to carry a segment identifier.

[0267] To sum up, the technical solution provided by the embodiment of the present application is that the destination address field of the first message received by the first network node includes a first segment identifier, the first segment identifier is a compressed segment identifier, the first segment identifier corresponds to the first output interface of the first network node or corresponds to the next hop node of the first network node. In the event that the first output interface fails or the next hop node fails, the first network node determines the second segment identifier in the segment list of the first message or determines the second segment identifier in the destination address field of the first message (for example, the next segment identifier of the first segment identifier) ​​based on the segment identifier planning information of the node corresponding to the first segment identifier, and the first network node forwards the first message based on the second segment identifier. Therefore, an embodiment of the present application provides a message forwarding solution applied to a compressed segment identifier scenario, in which, when the first segment identifier in the destination address field of the first message corresponds to the first output interface of the first network node and the first output interface fails, the first network node determines the next segment identifier based on the segment identifier planning information of the first network node, and forwards the first message based on the next segment identifier, so that the first message is forwarded around the failed interface; when the first segment identifier in the destination address field of the first message corresponds to the next hop node of the first network node and the next hop node fails, the first network node determines the next segment identifier based on the segment identifier planning information of the next hop node, and forwards the first message based on the next segment identifier, so that the first message is forwarded around the failed node. The message forwarding method provided by the embodiment of the present application can implement endpoint fault protection in a compressed segment identifier scenario, such as implementing SRv6 endpoint fault protection.

[0268] Please refer to Figure 39, which shows a schematic diagram of another message forwarding device 3900 provided in an embodiment of the present application. Message forwarding device 3900 is applied to a second network node. For example, message forwarding device 3900 is the second network node or a functional component within the second network node. Message forwarding device 3900 can implement the steps performed by the second network node in message forwarding, as provided in the embodiment shown in Figure 33. As shown in Figure 39, message forwarding device 3900 includes a publishing module 3910.

[0269] The publishing module 3910 is configured to publish first routing information, where the first routing information includes planning information, and the planning information is segment identification planning information of the second network node.

[0270] Optionally, the planning information includes a node identification range.

[0271] Optionally, the planning information includes the length of the compression function field.

[0272] Optionally, the planning information includes the length of the compressed function field and the length of the non-compressed function field.

[0273] Optionally, the planning information also includes at least one of the following: the length of the block field, the length of the node identification field, and the length of the parameter field.

[0274] Optionally, the first routing information is locator routing information or block routing information.

[0275] Optionally, the first routing information is carried in a target TLV field, and the target TLV field includes a first sub-TLV field and a second sub-TLV field. The first sub-TLV field is used to carry planning information, and the second sub-TLV field is used to carry a segment identifier.

[0276] The message forwarding device provided in the embodiments of the present application can also be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The method provided in the above method embodiment can also be implemented by software. When the method provided in the above method embodiment is implemented by software, each module in the message forwarding device can also be a software module.

[0277] An embodiment of the present application provides a message forwarding device, including a main control board and an interface board, wherein the main control board and the interface board are used to implement all or part of the steps of the message forwarding method provided in the above embodiment.

[0278] Please refer to Figure 40, which shows a schematic diagram of another message forwarding device 4000 provided in an embodiment of the present application. The message forwarding device 4000 is a network node or a functional component in a network node. The message forwarding device 4000 is used to execute the message forwarding method provided in the embodiment shown in Figure 26 or Figure 33. As shown in Figure 40, the message forwarding device 4000 includes: a main control board 4010, an interface board 4030 and an interface board 4040. In the case of multiple interface boards, a switching network board (not shown in Figure 40) is also included, and the switching network board is used to complete data exchange between interface boards (interface boards are also called line cards or service boards).

[0279] The main control board 4010 performs functions such as system management, node maintenance, and protocol processing. The interface boards 4030 and 4040 provide various service interfaces (e.g., POS, GE, and ATM) and implement message forwarding. The main control board 4010 primarily houses three functional units: a system management and control unit, a system clock unit, and a system maintenance unit. The main control board 4010, interface boards 4030, and interface boards 4040 are interconnected via a system bus and the system backplane. The interface board 4030 includes one or more processors 4031. Processors 4031 control and manage the interface board 4030 and communicate with processor 4012 on the main control board 4010. The memory 4032 on the interface board 4030 stores segment identification planning information, routing table entries, and other information. The interface board 4030 includes one or more network interfaces 4033 for receiving and sending messages. The detailed implementation process will not be detailed here. As shown in FIG40 , the main control board 4010 further includes a memory 4014 , which is used to store system management information, protocols, etc., which is not limited in this application.

[0280] As shown in Figure 40 , this embodiment includes multiple interface boards and employs a distributed forwarding mechanism. Under this mechanism, operations on interface board 4040 are substantially similar to those on interface board 4030. For example, interface board 4040 includes one or more network interfaces 4043 for receiving and sending messages, a memory 4042 for storing segment identifier planning information, routing table entries, etc., and a processor 4041 for controlling and managing interface board 4040 and communicating with processor 4012 on main control board 4010. For the sake of brevity, detailed description of interface board 4040 is omitted here.

[0281] In FIG40 , the processor 4031 in the interface board 4030 and / or the processor 4041 in the interface board 4040 can be dedicated hardware or chips, such as a network processor or an application-specific integrated circuit, to implement the aforementioned functions. This implementation is commonly referred to as employing dedicated hardware or chips for processing on the forwarding plane. In other embodiments, the processor 4031 in the interface board 4030 and / or the processor 4041 in the interface board 4040 can also be a general-purpose processor, such as a central processing unit (CPU).

[0282] It should also be noted that there may be one or more main control boards, including a primary and backup main control board. There may also be one or more interface boards. The higher the data processing capabilities of a network node, the more interface boards are provided. With multiple interface boards, they can communicate with each other through one or more switching fabric boards, and when there are multiple boards, they can collectively implement load balancing and redundant backup. In a centralized forwarding architecture, network nodes may not require switching fabric boards; the interface boards handle service data processing for the entire system. In a distributed forwarding architecture, network nodes include multiple interface boards, which can exchange data between them through switching fabric boards, providing high-capacity data exchange and processing capabilities. Therefore, network nodes with distributed architectures have greater data access and processing capabilities than those with centralized architectures. The specific architecture to adopt depends on the network deployment scenario and is not limited here.

[0283] In an optional embodiment, the memory 4032 and / or the memory 4042 is a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 4032 can exist independently and be connected to the processor 4031 via a communication bus, or it can be integrated with the processor 4031. The memory 4042 can exist independently and be connected to the processor 4041 via a communication bus, or it can be integrated with the processor 4041.

[0284] The memory 4032 is used to store program code and is controlled by the processor 4031 to execute part or all of the steps of the method provided in the above embodiment. The processor 4031 is used to execute the program code stored in the memory 4032. The program code may include one or more software modules. These one or more software modules may be functional modules provided in the embodiment shown in Figure 38 or Figure 39. The memory 4042 may also be used to store program code and is controlled by the processor 4041 to execute part or all of the steps of the method provided in the above embodiment. Similarly, the memory 4014 may also be used to store program code and is controlled by the processor 4012 to execute part or all of the steps of the method provided in the above embodiment.

[0285] In an optional implementation, network interface 4033 and network interface 4043 may be devices using any transceiver type for communicating with other nodes or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.

[0286] An embodiment of the present application provides a message forwarding device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory so that the message forwarding device performs all or part of the steps of the message forwarding method provided in the above embodiment.

[0287] Please refer to Figure 41, which shows a schematic diagram of another message forwarding device 4100 provided in an embodiment of the present application. The message forwarding device 4100 can be a network node or a functional component in a network node. The message forwarding device 4100 can implement the message forwarding method provided in the embodiment shown in Figure 26 or Figure 33. Referring to Figure 41, the message forwarding device 4100 includes a processor 4102, a memory 4104, a communication interface 4106 and a bus 4108, and the processor 4102, the memory 4104 and the communication interface 4106 are communicatively connected via the bus 4108. The processor 4102, the memory 4104 and the communication interface 4106 can also be connected using a connection method other than a bus. The embodiment of the present application does not limit the connection method of the processor 4102, the memory 4104 and the communication interface 4106.

[0288] Memory 4104 is used to store computer program 41042, which includes instructions and data. Memory 4104 can be any type of storage medium, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, and registers.

[0289] The processor 4102 may be a general-purpose processor. A general-purpose processor is a processor that performs specific steps and / or operations by reading and executing a computer program stored in a memory (e.g., memory 4104). The general-purpose processor may use data stored in the memory (e.g., memory 4104) in the process of performing the above steps and / or operations. The stored computer program is executed, for example, to implement the relevant functions of the aforementioned processing module 3820, etc. The general-purpose processor may be a central processing unit (CPU). The processor 4102 may also be a dedicated processor. A dedicated processor is a processor specially designed to perform specific steps and / or operations. The dedicated processor may be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a network processor (NP), etc. The processor 4102 may also be a combination of multiple processors, such as a multi-core processor. The processor 4102 includes at least one circuit to perform all or part of the steps of the message forwarding method provided in the above embodiment.

[0290] Communication interface 4106 includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect components within message forwarding device 4100, as well as interfaces for interconnecting message forwarding device 4100 with other devices (e.g., network nodes, end-side devices). A physical interface can be a gigabit Ethernet (GE) interface, which is used to interconnect message forwarding device 4100 with other devices. A logical interface is an interface within message forwarding device 4100, which is used to interconnect components within message forwarding device 4100. It is easy to understand that communication interface 4106 is used for communication between message forwarding device 4100 and other devices. For example, communication interface 4106 is used to send and receive information and messages between message forwarding device 4100 and other devices. Communication interface 4106 can implement the related functions of the aforementioned receiving module, forwarding module, publishing module, etc. In some embodiments, the message forwarding device 4100 includes a transceiver, which can also be used to send and receive information, messages, etc. between the message forwarding device 4100 and other devices. The communication interface 4106 can realize the relevant functions of the aforementioned receiving module, forwarding module, publishing module, etc.

[0291] The bus 4108 is any type of communication bus for interconnecting the processor 4102 , the memory 4104 , and the communication interface 4106 , such as a system bus.

[0292] The above-mentioned devices can be provided on separate chips, or at least partially or entirely on the same chip. Whether to provide each device independently on different chips or to integrate them on one or more chips often depends on the product design requirements. The embodiments of this application do not limit the specific implementation of the above-mentioned devices.

[0293] The message forwarding device 4100 shown in FIG41 is merely exemplary. During implementation, the message forwarding device 4100 may also include other components, which are not listed here. The message forwarding device 4100 shown in FIG41 performs operations related to message forwarding by executing all or part of the steps of the message forwarding method provided in the above method embodiment.

[0294] An embodiment of the present application provides a message forwarding system, comprising a first network node and a second network node. The first network node comprises a message forwarding device 3800 as shown in FIG. 38 , and the second network node comprises a message forwarding device 3900 as shown in FIG. 39 . Alternatively, at least one of the first network node and the second network node comprises a message forwarding device as shown in FIG. 40 or FIG. 41 For example, the message forwarding system is shown in FIG. 23 .

[0295] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed (for example, by a network node, one or more processors, etc.), it implements all or part of the steps of the method provided in the above method embodiment.

[0296] An embodiment of the present application provides a computer program product, which includes a program or code. When the program or code is executed (for example, by a network node, one or more processors, etc.), it implements all or part of the steps of the method provided in the above method embodiment.

[0297] An embodiment of the present application provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip is running, it is used to implement all or part of the steps of the method provided in the above method embodiment.

[0298] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium, or a semiconductor medium (e.g., a solid-state hard disk).

[0299] It should be understood that the term "at least one" in this application refers to one or more, and "a plurality of" refers to two or more. The term "and / or" in this application is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, for the sake of clarity of description, in this application, words such as "first", "second", and "third" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first", "second", and "third" do not limit the quantity and execution order.

[0300] The different types of embodiments, such as the method embodiments and device embodiments provided in the embodiments of this application, can refer to each other, and the embodiments of this application are not limited thereto. The order of the operations of the method embodiments provided in the embodiments of this application can be appropriately adjusted, and the operations can be increased or decreased in response to the circumstances. Any person skilled in the art who can easily think of a method of variation within the technical scope disclosed in this application should be included in the scope of protection of this application, and therefore will not be described in detail.

[0301] In the corresponding embodiments provided in this application, it should be understood that the disclosed devices, etc. can be implemented through other configurations. For example, the device embodiments described above are merely illustrative. For example, the module division is merely a logical function division. In actual implementation, other division methods may be used, such as combining or integrating multiple modules or components into another system, or ignoring or not implementing certain features.

[0302] Modules described as separate components may or may not be physically separate, and components described as modules may or may not be physical modules. They may be located in one place or distributed across multiple devices. Some or all of these modules may be selected to achieve the purpose of this embodiment based on actual needs.

[0303] The above description is merely an exemplary embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A message forwarding method, characterized in that: The method comprises: A first network node receives a first message, where a destination address field of the first message includes a first segment identifier, where the first segment identifier is a compressed segment identifier, where the first segment identifier corresponds to a first outbound interface of the first network node or the first segment identifier corresponds to a second network node, and where the second network node is a next hop node of the first network node; Based on the failure of the first outbound interface or the failure of the second network node, the first network node determines a second segment identifier according to planning information, where the second segment identifier is a segment identifier in a segment list of the first message or the second segment identifier is a segment identifier in the destination address field, and the planning information is segment identifier planning information of a node corresponding to the first segment identifier; The first network node forwards the first message according to the second segment identifier.

2. The method according to claim 1, characterized in that: The planning information includes at least one of the following: The length of the block field, the length of the node identification field, the length of the compression function field, the length of the non-compression function field, Length of parameter field, range of node identifier.

3. The method according to claim 1 or 2, characterized in that: The second segment identifier is a compressed segment identifier or a standard segment identifier, the length of the compressed segment identifier is less than 128 bits, and the length of the standard segment identifier is 128 bits.

4. The method according to any one of claims 1 to 3, characterized in that: The first segment identifier and the second segment identifier are arranged in sequence in the segment list, or, The first segment identifier and the second segment identifier are arranged in sequence in the destination address field.

5. The method according to any one of claims 1 to 4, characterized in that: The outbound interface or network node corresponding to the second segment identifier is located downstream of the first network node.

6. The method according to any one of claims 1 to 5, characterized in that: When the first segment identifier corresponds to the first outbound interface of the first network node, the node corresponding to the first segment identifier is the first network node; when the first segment identifier corresponds to the second network node, the node corresponding to the first segment identifier is the second network node.

7. The method according to any one of claims 1 to 6, characterized in that: The first network node determines the second segment identifier according to the planning information, including: The first network node determines, according to the planning information, that the first segment identifier is a compressed segment identifier.

8. The method according to claim 7, characterized in that The first network node determines, according to the planning information, that the first segment identifier is a compressed segment identifier, including: The first network node determines a compression function field in the destination address field according to the planning information; The first network node determines, according to the value in the compression function field, that the first segment identifier is a compressed segment identifier.

9. The method according to claim 8, characterized in that The first network node determines that the first segment identifier is a compressed segment identifier according to the value in the compression function field, including: based on the value in the compression function field being a non-null value, the first network node determines that the first segment identifier is a compressed segment identifier.

10. The method according to any one of claims 1 to 9, characterized in that: The first network node determines the second segment identifier according to the planning information, including: The first network node updates a value of a remaining segment SL field in the first message, and the first network node determines the second segment identifier according to the updated value of the SL field; or, The first network node updates the value of the remaining compressed CL field in the first message, and the first network node receives the value of the remaining compressed CL field according to the updated value. The value of the CL field determines the second segment identifier; or, The first network node traverses the destination address field to determine the second segment identifier; or, The first network node updates a value of a target field in the first message to determine the second segment identifier, the target field is included in the destination address field, and the target field is located after a block field in the destination address field.

11. The method according to any one of claims 1 to 10, characterized in that: The planning information includes a node identification range, and the first network node determines the second segment identification according to the planning information, including: The first network node determines, according to the node identifier range, that the node identifier included in the second segment identifier is within the node identifier range.

12. The method according to any one of claims 1 to 11, characterized in that: The destination address field is located in the Internet Protocol version 6 IPv6 header of the first message.

13. The method according to any one of claims 1 to 12, characterized in that: The method further comprises: The first network node receives first routing information, where the first routing information includes the planning information.

14. The method according to claim 13, characterized in that The method further includes: the first network node generating a first routing table entry according to the first routing information, wherein the first routing table entry includes the planning information.

15. The method according to claim 14, characterized in that The method further comprises: Based on the failure of the second network node, the first network node deletes the first routing table entry after a preset time period.

16. The method according to any one of claims 13 to 15, characterized in that The first routing information is location routing information or block routing information.

17. The method according to any one of claims 13 to 16, characterized in that The first routing information is carried in a target type length value TLV field, and the target TLV field includes a first sub-TLV field and a second sub-TLV field. The first sub-TLV field is used to carry the planning information, and the second sub-TLV field is used to carry a segment identifier.

18. A message forwarding method, characterized in that: The method comprises: The second network node publishes first routing information, where the first routing information includes planning information, and the planning information is segment identification planning information of the second network node.

19. The method according to claim 18, characterized in that The planning information includes a node identification range.

20. The method according to claim 18, characterized in that The planning information includes the length of the compression function field.

21. The method according to claim 18, characterized in that The planning information includes the length of the compressed function field and the length of the non-compressed function field.

22. The method according to any one of claims 19 to 21, characterized in that The planning information also includes at least one of the following: the length of the block field, the length of the node identification field, and the length of the parameter field.

23. The method according to any one of claims 18 to 22, characterized in that The first routing information is location routing information or block routing information.

24. The method according to any one of claims 18 to 23, characterized in that The first routing information is carried in a target type length value TLV field, and the target TLV field includes a first sub-TLV field and a second sub-TLV field. The first sub-TLV field is used to carry the planning information, and the second sub-TLV field is used to carry a segment identifier.

25. A message forwarding device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the message forwarding device executes the method according to any one of claims 1 to 17.

26. A message forwarding device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the message forwarding device performs the method according to any one of claims 18 to 24.

27. A message forwarding system, characterized in that: comprising a first network node and a second network node; The first network node comprises the message forwarding device according to claim 25; The second network node includes the message forwarding device as claimed in claim 26.

28. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 24 is implemented.

29. A computer program product, characterized in that The computer program product comprises a program or a code, and when the program or the code is executed, the method according to any one of claims 1 to 24 is implemented.

30. A chip, characterized in that: The chip implements the method according to any one of claims 1 to 24 when running.

Citation Information

Patent Citations

  • Message forwarding method, device and system

    CN118555238A

  • Method for forwarding message in network, network node and network system

    CN111682996A

  • Data transmission method, related equipment and computer storage medium

    CN115701054A

  • EVPN signaling using Segment Routing

    US20210352007A1

  • Service Chain Fault Protection Method, Apparatus, Device and System, and Storage Medium

    US20220337514A1