Method for forwarding packet on SR network, device, and system
Patent Information
- Authority / Receiving Office
- MY · MY
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-01-22
- Publication Date
- 2026-07-06
AI Technical Summary
In the SR network, the length of the segment identifier list is too long, which reduces network transmission efficiency and processing efficiency. Especially in the SRv6 environment, the 128-bit length of the SID list increases the length of the message, takes up a lot of network resources, and the node reads it all at once. The length of the message window is limited, which reduces the message processing efficiency.
The compressed segment identifier (Compressed SID, C-SID) is used instead of the 128-bit SID, and new pointers (CL pointer and SL pointer) are set in the message header to indicate the position of the C-SID in the SID list, thereby Reduce message length and improve processing efficiency.
By using C-SID, the length of the SID list is significantly reduced, network transmission efficiency and processing efficiency are improved, and the difficulty of packet processing and resource occupation are reduced.
Abstract
Description
Method, device and system for forwarding a packet in an SR network
[0001] The present application claims priority from the Chinese patent application No. 201910925974.3, filed on September 27, 2019, and entitled "Method, device and system for forwarding a packet in an SR network", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the field of communication, and in particular to a method, a network device and a system for forwarding a packet in an SR network. BACKGROUND
[0003] Segment Routing (SR) is a protocol for forwarding data packets on a network, which is designed based on the concept of source routing and supports explicitly specifying a data packet forwarding path at a source node. When SR is deployed on a data plane of the sixth version of Internet Protocol (IPv6), it is referred to as IPv6 Segment Routing (SRv6). SRv6 extends a Segment Routing Header (SRH) on the basis of IPv6.
[0004] The SRH includes a segment identification list (SID list), which includes a plurality of segment identifications (SIDs) arranged in sequence, each of which represents a segment, i.e., an instruction or a set of instructions for processing a packet. The SRH is encapsulated in a packet and carries a processing procedure of the packet in an SR network through the segment identification list. The length of each SID in an SRv6 network is 128 bits, so that the length of the SRH and the length of the packet will increase by 128 bits for each additional SID in the SID list. On the one hand, the increase in the length of the packet will result in a large amount of network resources, such as bandwidth, being occupied in the forwarding process. For example, when the processing procedure of the packet includes 100 segments, the SRH needs to include 100 SIDs, and the length of the SID list is as high as 1600 bytes. The SID list is too long, which reduces the efficiency of packet transmission in the SR network. On the other hand, the SRH is too long, which will increase the difficulty of packet processing. For example, the length of a packet window read by a node at a time is limited, for example, 128 bytes, while the length of the SRH is 1600 bytes, which is much longer than the length of the packet window read at a time. The reading process of the entire SRH needs to be completed through multiple reading operations, which reduces the efficiency of packet processing.
[0005] SUMMARY
[0006] The application provides a message forwarding method, device and system, and aims at solving the technical problem of low network transmission efficiency and low processing efficiency caused by long segment identification list length.
[0007] In a first aspect, the application provides a message processing method. The method is applied to a segment routing (SR) network, and includes the following steps: receiving a message, wherein a message header of the message includes a destination address field, a first pointer, a second pointer and a list used for processing the message, the list includes a plurality of identifications arranged in sequence, the plurality of identifications are one-to-one mapped to a plurality of segments in the SR network, and the value of the first pointer and the value of the second pointer jointly indicate the position of a first identification in the list; determining the first identification according to the value of the first pointer and the value of the second pointer; and copying the first identification into the destination address field.
[0008] The method sets a newly-added first pointer in the message header, and the first pointer and a segment left (SL) pointer, i.e., a second pointer, jointly constitute a two-dimensional pointer, which indicates the position of a compressed segment identification (C-SID) in a SID list. Therefore, the length of the message is reduced, and the transmission efficiency and the processing efficiency of the network are improved.
[0009] With reference to the first aspect, in a first possible implementation manner of the first aspect, the list includes a plurality of identifications arranged in sequence, and specifically, the list includes at least one element arranged in sequence, the at least one element includes a first element, the first element includes at least two identifications in the plurality of identifications, the at least two identifications are arranged in sequence, and the first identification is one of the at least two identifications; the value of the first pointer and the value of the second pointer jointly indicate the position of the first identification in the list, and specifically, the value of the second pointer is used to determine the position of the first element in the list, and the value of the first pointer is used to determine the position of the first identification in the first element.
[0010] When the SID list is generated, the method uses a C-SID to replace a SID with a length of 128 bits to represent a segment. Therefore, for the same number of segments, the length of the SID list composed of C-SIDs is much smaller than the length of the SID list composed of SIDs. Therefore, the length of the message is reduced, and the transmission efficiency and the processing efficiency of the network are improved.
[0011] With reference to the first aspect, or any of the possible implementation manners of the first aspect, in a second possible implementation manner of the first aspect, the first pointer is included in a first identification in the at least two identifications.
[0012] With reference to the first aspect or any possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the value of the first pointer is used to determine the position of the first identifier in the first element, and specifically, the value of the first pointer indicates the position of a second identifier in the first element, the second identifier being a previous identifier of the first identifier in the plurality of identifiers; and the determining the first identifier according to the value of the first pointer and the value of the second pointer comprises: modifying the value of the first pointer in a packet header of the packet, so that the modified value of the first pointer indicates the position of the first identifier in the first element; and determining the first identifier according to the modified value of the first pointer and the value of the second pointer.
[0013] With reference to the first aspect or any possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the value of the first pointer is used to determine the position of the first identifier in the first element, and specifically, the value of the first pointer indicates the position of the first identifier in the first element; and after the copying the first identifier into the destination address field, the method further comprises: modifying the value of the first pointer in a packet header of the packet, so that the modified value of the first pointer indicates the position of a second identifier in the first element, the second identifier being a subsequent identifier of the first identifier in the at least two identifiers.
[0014] With reference to the first aspect or any possible implementation of the first aspect, in a fifth possible implementation of the first aspect, the value of the second pointer is used to determine the position of the first element in the list, and specifically, the value of the second pointer indicates the position of a second element in the list, the second element being a previous element of the first element in the at least one element; the value of the first pointer is used to determine the position of the first identifier in the first element, and specifically, the value of the first pointer indicates the position of a second identifier in the second element, the second identifier being a previous identifier of the first identifier in the plurality of identifiers, the second element including at least one identifier of the plurality of identifiers, the at least one identifier being arranged in sequence, the second identifier being one of the at least one identifier, and the destination address field including the second identifier; and the determining the first identifier according to the value of the first pointer and the value of the second pointer includes: determining that the second identifier is a last identifier of the at least one identifier; modifying the value of the second pointer in the packet header of the packet, so that the modified value of the second pointer indicates the position of the first element in the list; modifying the value of the first pointer in the packet header of the packet, so that the modified value of the first pointer indicates the position of the first identifier in the first element; and determining the first identifier according to the modified value of the first pointer and the modified value of the second pointer.
[0015] With reference to the first aspect or any possible implementation of the first aspect, in a sixth possible implementation of the first aspect, the value of the second pointer is used to determine the position of the first element in the list, and specifically, the value of the second pointer indicates the position of the first element in the list; the value of the first pointer is used to determine the position of the first identifier in the first element, and specifically, the value of the first pointer indicates the position of the first identifier in the first element; and after the copying the first identifier into the destination address field, the method further includes: determining that the first identifier is a last identifier of the at least two identifiers; modifying the value of the second pointer in the packet header of the packet, so that the modified value of the second pointer indicates the position of a second element in the list, the second element being a next element of the first element in the at least one element; and modifying the value of the first pointer in the packet header of the packet, so that the modified value of the first pointer indicates the position of a second identifier in the second element, the second identifier being a next identifier of the first identifier in the plurality of identifiers, the second element including the second identifier.
[0016] With reference to the first aspect, or any possible implementation of the first aspect, in a seventh possible implementation of the first aspect, the plurality of segments are one-to-one mapped to a plurality of segment identifiers, the plurality of identifiers are one-to-one mapped to the plurality of segment identifiers, each of the plurality of segment identifiers comprises a first part and a second part, the first part precedes the second part, the first part of all of the plurality of segment identifiers are the same, and each of the plurality of identifiers comprises the second part of the segment identifier to which the each of the plurality of identifiers is mapped.
[0017] With reference to the first aspect, or any possible implementation of the first aspect, in an eighth possible implementation of the first aspect, the first part is included in the destination address field.
[0018] With reference to the first aspect, or any possible implementation of the first aspect, in a ninth possible implementation of the first aspect, the length of the element is 128 bits, 64 bits, or 32 bits.
[0019] With reference to the first aspect, or any possible implementation of the first aspect, the plurality of segments are one-to-one mapped to a plurality of segment identifiers, the plurality of identifiers are one-to-one mapped to the plurality of segment identifiers, each of the plurality of segment identifiers comprises a first part, a second part, and a third part arranged in sequence, the first part of all of the plurality of segment identifiers are the same, the third part of all of the plurality of segment identifiers are the same, and each of the plurality of identifiers comprises the second part of the segment identifier to which the each of the plurality of identifiers is mapped.
[0020] With reference to the first aspect, or any possible implementation of the first aspect, a total length of the first part, the second part, and the third part is 128 bits.
[0021] With reference to the first aspect, or any possible implementation of the first aspect, the method further comprises: receiving structure information of the destination address field, the structure information indicating an adding position of the first identifier in the destination address field; and the copying the first identifier into the destination address field comprises copying the first identifier into the destination address field according to the structure information, at the adding position of the first identifier in the destination address field.
[0022] With reference to the first aspect, or any possible implementation of the first aspect, the receiving the structure information of the destination address field comprises receiving a control packet, the control packet comprising the structure information, the control packet being an intermediate system to intermediate system (IS-IS) protocol packet, an open shortest path first (OSPF) protocol packet, or a border gateway protocol (BGP) protocol packet.
[0023] With reference to the first aspect, or any possible implementation of the first aspect, each of the plurality of identifiers has a length of 32 bits or 16 bits.
[0024] With reference to the second aspect, or any possible implementation of the second aspect, the generating the packet header comprises: generating the list by taking the second part of the segment identifier to which each of the plurality of segments is mapped as the identifier to which the each of the plurality of segments is mapped; and generating the packet header according to the list.
[0025] The method sets the newly added first pointer in the packet header, and the first pointer and the SL pointer, i.e., the second pointer, jointly constitute a two-dimensional pointer to indicate the position of the C-SID in the SID list. Thus, the length of the packet is reduced, and the transmission efficiency and processing efficiency of the network are improved.
[0026] With reference to the second aspect, or any possible implementation of the second aspect, the generating the packet header comprises: generating the list by taking the second part of the segment identifier to which each of the plurality of segments is mapped as the identifier to which the each of the plurality of segments is mapped; and generating the packet header according to the list.
[0027] The method uses compressed segment identifiers to replace SIDs with a length of 128 bits to represent segments when generating a segment identifier list, so that the element with a length of 128 bits pointed to by the SL pointer in the segment identifier list can accommodate a plurality of compressed segment identifiers corresponding to a plurality of segments. Thus, the length of the packet is reduced, and the transmission efficiency and processing efficiency of the network are improved.
[0028] With reference to the second aspect, or any possible implementation of the second aspect, the generating the packet header comprises: generating the list by taking the second part of the segment identifier to which each of the plurality of segments is mapped as the identifier to which the each of the plurality of segments is mapped; and generating the packet header according to the list.
[0029] With reference to the second aspect, or any possible implementation of the second aspect, in a third possible implementation of the second aspect, the generating the packet header comprises: receiving the list, each of the plurality of identifiers in the list comprising the second part of the segment identifier to which the segment to which the each of the plurality of segments is mapped is mapped.
[0030] In a fourth possible implementation form of the second aspect, or any possible implementation form of the second aspect, the first part has a length of X bits, X being an integer, X being greater than or equal to 1 and less than 128, each of the plurality of identifiers has a length of 128-X bits.
[0031] In a fifth possible implementation form of the second aspect, or any possible implementation form of the second aspect, the list does not include the first part.
[0032] In a sixth possible implementation form of the second aspect, or any possible implementation form of the second aspect, the packet header further comprises a destination address field, and the generating the packet header and encapsulating the packet header to the packet further comprises: adding the first part to the destination address field; copying a first identifier of the plurality of identifiers to the destination address field.
[0033] In a seventh possible implementation form of the second aspect, or any possible implementation form of the second aspect, the list comprises a plurality of identifiers arranged in sequence, and specifically: the list comprises at least one element arranged in sequence, a first element of the at least one element comprises at least two identifiers of the plurality of identifiers, the at least two identifiers are arranged in sequence, the first identifier is one of the at least two identifiers; the value of the first pointer and the value of the second pointer jointly indicate a position of a first identifier of the plurality of identifiers in the list, and specifically: the value of the second pointer indicates a position of the first element in the list, and the value of the first pointer indicates a position of the first identifier in the first element.
[0034] In an eighth possible implementation form of the second aspect, or any possible implementation form of the second aspect, the first pointer is comprised in a first identifier of the at least two identifiers.
[0035] In a ninth possible implementation form of the second aspect, or any possible implementation form of the second aspect, the list comprises a first segment identifier, the first segment identifier is before a first identifier of the plurality of identifiers, the first segment identifier is mapped to a segment in the SR network, and the first segment identifier has a length of 128 bits.
[0036] With reference to the second aspect or any possible implementation of the second aspect, in a tenth possible implementation of the second aspect, the first segment identifier is adjacent to a first identifier of the plurality of identifiers, and the first segment identifier includes a start flag, the start flag indicating that a next identifier of the list is the first identifier of the plurality of identifiers.
[0037] With reference to the second aspect or any possible implementation of the second aspect, in an eleventh possible implementation of the second aspect, the first segment identifier includes a function field and a parameter field, the function field including the start flag, and the parameter field including the first pointer and a quantity flag, the quantity flag indicating a quantity of the plurality of identifiers.
[0038] With reference to the second aspect or any possible implementation of the second aspect, in a twelfth possible implementation of the second aspect, the list includes a second segment identifier, the second segment identifier being after a last identifier of the plurality of identifiers, the first segment identifier mapping to a segment in the SR network, and the first segment identifier having a length of 128 bits.
[0039] With reference to the second aspect or any possible implementation of the second aspect, in a thirteenth possible implementation of the second aspect, the second segment identifier is adjacent to a last identifier of the plurality of identifiers, and the second segment identifier includes an end flag, the end flag indicating that a previous identifier of the list is the last identifier of the plurality of identifiers.
[0040] With reference to the second aspect or any possible implementation of the second aspect, the plurality of segments one-to-one map to a plurality of segment identifiers, the plurality of identifiers one-to-one map to the plurality of segment identifiers, each segment identifier of the plurality of segment identifiers includes a first part, a second part, and a third part arranged in sequence, the first part of all segment identifiers of the plurality of segment identifiers is the same, the third part of all segment identifiers of the plurality of segment identifiers is the same, and each identifier of the plurality of identifiers includes the second part of the segment identifier to which the each identifier maps.
[0041] With reference to the second aspect or any possible implementation of the second aspect, a total length of the first part, the second part, and the third part is 128 bits.
[0042] With reference to the second aspect or any possible implementation of the second aspect, the packet header further includes a destination address field, and the generating the packet header and encapsulating the packet header to the packet further includes: adding the first part and the third part to the destination address field; and copying a first identifier of the plurality of identifiers into the destination address field.
[0043] With reference to the second aspect or any possible implementation of the second aspect, the method further includes: sending structure information to the intermediate network device, the structure information indicating a position of adding the first identifier in the destination address field.
[0044] With reference to the second aspect or any possible implementation of the second aspect, each identifier of the plurality of identifiers has a length of 32 bits or 16 bits.
[0045] In a third aspect, the present application provides a network device, which executes the method in the first aspect or any possible implementation of the first aspect. Specifically, the network device includes units for executing the method in the first aspect or any possible implementation of the first aspect.
[0046] In a fourth aspect, the present application provides a network device, which executes the method in the second aspect or any possible implementation of the second aspect. Specifically, the network device includes units for executing the method in the second aspect or any possible implementation of the second aspect.
[0047] In a fifth aspect, the present application provides a network device, which includes a processor, a network interface and a memory. The network interface can be a transceiver. The memory can be used to store program code, and the processor is configured to invoke the program code in the memory to enable the network device to execute the first aspect or any possible implementation of the first aspect, which will not be repeated here.
[0048] In a sixth aspect, the present application provides a network device, which includes a processor, a network interface and a memory. The network interface can be a transceiver. The memory can be used to store program code, and the processor is configured to invoke the program code in the memory to enable the network device to execute the second aspect or any possible implementation of the second aspect, which will not be repeated here.
[0049] In a seventh aspect, the present application provides a network system, which includes the network device provided in the third aspect and the network device provided in the fourth aspect, or the network system includes the network device provided in the fifth aspect and the network device provided in the sixth aspect.
[0050] In an eighth aspect, the present application provides a computer readable storage medium, which stores instructions, when the instructions are executed on a computer, cause the computer to perform the method in the above aspects.
[0051] In a ninth aspect, the present application provides a computer program product comprising computer program instructions, when the computer program product is executed on a network device, cause the network device to perform the method provided in the first aspect, the second aspect, any possible implementation of the first aspect, or any possible implementation of the second aspect.
[0052] In a ninth aspect, the present application provides a chip comprising a memory and a processor, the memory is used to store a computer program, and the processor is used to call and execute the computer program from the memory, so that the chip performs the method in the above first aspect and any possible implementation of the first aspect; or the processor is used to call and execute the computer program from the memory, so that the chip performs the method in the above second aspect or any possible implementation of the second aspect.
[0053] Optionally, the above chip only comprises a processor, and the processor is used to read and execute a computer program stored in the memory, when the computer program is executed, the chip performs the method in the above first aspect or any possible implementation of the first aspect, or the chip performs the method in the above second aspect or any possible implementation of the second aspect. BRIEF DESCRIPTION OF DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the present application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings below are only some of the drawings of the present application, and those skilled in the art can also obtain other technical solutions and drawings that can achieve the present application without creative labor on the basis of these drawings.
[0055] FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0056] FIG. 2A is a schematic diagram of the format of a segment identifier provided by an embodiment of the present application;
[0057] FIG. 2B is a schematic diagram of the format of a packet provided by an embodiment of the present application;
[0058] FIG. 3 is a schematic diagram of the method flow of packet processing provided by an embodiment of the present application;
[0059] FIG. 4A is a schematic diagram of the format of a compressed segment identifier provided by an embodiment of the present application;
[0060] FIG. 4B is a schematic diagram of the format of a packet provided by an embodiment of the present application;
[0061] FIG. 4C is a format diagram of a compressed segment identifier according to an embodiment of the present application;
[0062] FIG. 4D is a format diagram of a compressed segment identifier according to an embodiment of the present application;
[0063] FIG. 5A is a format diagram of a packet according to an embodiment of the present application;
[0064] FIG. 5B is a format diagram of a compressed segment identifier according to an embodiment of the present application;
[0065] FIG. 5C is a format diagram of a packet according to an embodiment of the present application;
[0066] FIG. 5D is a format diagram of a compressed segment identifier according to an embodiment of the present application;
[0067] FIG. 6 is a structure diagram of a network device according to an embodiment of the present application;
[0068] FIG. 7 is a structure diagram of a network device according to an embodiment of the present application;
[0069] FIG. 8 is a structure diagram of a network device according to an embodiment of the present application;
[0070] FIG. 9 is a structure diagram of a network device according to an embodiment of the present application;
[0071] FIG. 10 is a structure diagram of a network system according to an embodiment of the present application. DETAILED DESCRIPTION
[0072] Embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0073] FIG. 1 shows a possible application scenario of an embodiment of the present application. The scenario includes an SR network, which includes network device S, network device 1, network device 2, network device 3, network device 4, network device 5, network device 6, and network device 7. These network devices can be switches, routers, or forwarders. These network devices can also be virtual machines. Network device S can be an ingress device of the network. The network can also include a controller, which is not shown in FIG. 1. The controller can generate a SID list corresponding to a forwarding path of a packet and send the SID list to the network ingress device. The controller can send a control packet containing network configuration information to other network devices in the network.
[0074] The processing procedure of a packet in an SR network is composed of multiple segments, each of which is an instruction or a set of instructions for processing the packet. Each segment has a corresponding segment identifier, i.e., SID. The segment identifier includes two types, i.e., node SID and adjacent SID. FIG. 2A shows the format of a SID in an SRv6 network. As shown in FIG. 2A, each SID can include a Locator field and a Function field.
[0075] The Locator field in the SID is used to locate a specific network device that executes the instruction or the set of instructions included in the segment. The Locator field includes a Prefix part and a Node ID part. Within one SRv6 network domain, the Prefix part of the SID of all network devices is the same. Within one SRv6 network domain, the Node ID part of the SID of each network device is different, and each Node ID part is used to uniquely determine one network device within the domain. For a specific SID, the network device uniquely determined by the Node ID part of the SID is the network device that executes the segment represented by the SID.
[0076] The Function field in the SID is used to represent the specific content of the instruction or the set of instructions included in the segment, i.e., the Function in the SRv6 network. The Function in the SRv6 network can also involve a parameter, which is represented by an Argument field in the SID (not shown in FIG. 2). When the Function does not involve the parameter, the Argument field can not be included in the SID.
[0077] Generally, the total length of the SID in the SRv6 network is 128 bits. The Locator field and the Function field are of specific lengths, respectively, and these specific lengths can be changed through network settings. For example, the Locator field is 48 bits, and the Function field is 80 bits, or the Locator field is 64 bits, and the Function field is 64 bits, or the Locator field is 48 bits, and the Function field is 64 bits, and the Argument field is 16 bits.
[0078] The plurality of SIDs constitute a SID list. FIG. 2B shows the format of a packet in an SRv6 network. As shown in FIG. 2B, the packet header of the packet includes an IPv6 packet header and an SRH, the IPv6 packet header includes a destination address (DA) field, and the SRH includes a SID list, the SID list includes a plurality of SIDs arranged in sequence. The SRH also includes a segments left (SL) pointer, which is used to indicate the number of segments remaining to be processed. Specifically, each value of the SL pointer corresponds to a specific number of segments remaining to be processed. For example, if the value of the SL pointer is 3, it means that the number of segments remaining to be processed is 4, or it can also be understood that the SL pointer points to the current SID to be processed, which is the fourth last SID. If the value of the SL pointer is 0, it means that the number of segments remaining to be processed is 1, or it can also be understood that the SL pointer points to the current SID to be processed, which is the last SID. After the network device determines the current SID to be processed according to the SL pointer, the network device copies the SID to the DA field in the IPv6 packet header, processes the packet according to the content in the DA field, for example, forwards the packet. During the processing of the packet, the value of the SL pointer is updated once for each segment executed. After each update of the SL pointer, the position pointed to in the SID list is offset by the length of one SID, that is, 128 bits. With the sequential execution of the plurality of segments represented by the plurality of SIDs in the SID list, the value of the SL pointer is constantly updated to ensure that the SL pointer always points to the current SID to be processed.
[0079] With reference to the application scenario shown in FIG. 1, when the packet can be forwarded through the SR network shown in FIG. 1, the forwarding path of the packet is from the network device S to the network device 1, and then sequentially through the network device 2, the network device 3, the network device 4, the network device 5, the network device 6, and finally to the network device 7. In addition to the head node network device S, the forwarding path also includes the network devices 1 to 7, a total of 7 network devices. The packet is processed at each network device, for example, the forwarding processing behavior at each network device corresponds to a segment, respectively, and then the SID list of the entire packet forwarding process includes 7 SIDs. The length of each SID is 128 bits, and the length of the SID list is 112 bytes, which increases the length of the packet and reduces the transmission efficiency and processing efficiency of the network.
[0080] Embodiments of the present application provide methods for processing packets, as well as devices and systems based on the methods. These methods, devices and systems are based on the same inventive concept. The principles of the methods, devices and systems for solving problems are similar, therefore, the embodiments of the methods, devices and systems can be mutually referred to, and the same or similar parts will not be described again.
[0081] Embodiments of the present application provide a method for processing a packet. The method is applied to an SR network, and involves a network device 301 and a network device 302. The network device 301 can be a network entry device, configured to encapsulate a SID list in a packet, for example, the network device S shown in FIG. 1. The network device 302 can be a forwarding device in the network, configured to process the packet according to the SID list, for example, the network device 1, the network device 2, the network device 3, the network device 4, the network device 5, the network device 6 or the network device 7 shown in FIG. 1. In the method, when generating the SID list, a compressed segment identifier (C-SID) is used to replace a 128-bit SID to represent a segment, and a CL pointer is set in a packet header, which together with a SL pointer forms a two-dimensional pointer to indicate the position of the C-SID in the SID list. Therefore, for the same number of segments, the length of the SID list composed of C-SIDs is much smaller than the length of the SID list composed of SIDs. Thus, the length of the packet is reduced, and the transmission efficiency and processing efficiency of the network are improved. FIG. 3 shows the flow of the method, which includes the following steps:
[0082] S310, the network device 301 receives a packet.
[0083] As a network entry device, the network device 301 can receive a packet sent by a host, which can be a service packet. The host can be a terminal device such as a personal computer, a mobile phone or a tablet computer.
[0084] S315, the network device 301 generates a packet header and encapsulates the packet header into the packet, the packet header including a first pointer, a second pointer and a list for processing the packet, the list including a plurality of identifiers arranged in sequence, the plurality of identifiers one-to-one mapping to a plurality of segments in an SR network, the value of the first pointer and the value of the second pointer together indicating the position of a first identifier in the list.
[0085] In an SRv6 network, the packet header includes an IPv6 packet header and an SRH, and the list is a SID list in the SRH. For the received packet, the network device 301 generates a packet header including a SID list and encapsulates the packet header into the received packet, so as to process the packet.
[0086] In the SR network, each segment for processing a packet has a specific segment identifier, i.e., SID, that is, the multiple segments for processing the packet are mapped to multiple SIDs one by one. In combination with the above description, each SID can include a location field and a function field, the location field including a prefix part and a serial number part. The sum of the lengths of the location field and the function field can be 128 bits. In an SRv6 network domain, the prefix part of the SID of all network devices is the same, while the serial number part of the SID of each network device is different, each serial number part being used to uniquely determine a network device in the domain. That is, each SID can be divided into two parts, the first part including the prefix part, and the second part including the serial number part and the function field. The first part of all SIDs is the same, while the second part of each SID is different. The sum of the lengths of the first part and the second part is 128 bits. Thus, in order to reduce the length of the SID list, the first part, i.e., the prefix part of the location field of the SID, can be omitted, and the second part, i.e., the serial number part and the function field, is taken as a compressed segment identifier, i.e., C-SID, as shown in FIG. 4A. Thus, the SID list includes multiple C-SIDs arranged in sequence, each C-SID being mapped to a segment in the SR network.
[0087] In combination with the application scenario shown in FIG. 1, the SID of the network device 1 can be A1::0001:1111, the length of the SID being 128 bits, and "::" representing a full 0 byte. Among them, A1::0001 is the location field, the length being 112 bits, A1 / 96 is the prefix part, " / 96" representing a 96-bit mask, 0001 is the serial number part, the length being 16 bits. 1111 is the function field, the length being 16 bits. The first part of the SID is A1, and the second part is 0001:1111. The second part is taken as the C-SID, i.e., the C-SID is 0001:1111, the length being 32 bits.
[0088] Similarly, the SIDs of the network device 2, the network device 3, the network device 4, the network device 5, the network device 6, or the network device 7 can be A1::0002:2222, A1::0003:3333, A1::0004:4444, A1::0005:5555, A1::0006:6666, and A1::0007:7777, respectively. The C-SIDs of these network devices can be 0002:2222, 0003:3333, 0004:4444, 0005:5555, 0006:6666, and 0007:7777, each having a length of 32 bits.
[0089] In combination with the above description, the C-SID includes the sequence number part and the function field of the SID, and the length of the C-SID is determined by the sum of the lengths of the sequence number part and the function field of the SID. Specifically, the length of the C-SID is the same as the sum of the lengths of the sequence number part and the function field of the SID. For example, the length of the C-SID can be 32 bits, or the length of the C-SID can be 16 bits.
[0090] Alternatively, in the network planning process, each SID can also be divided into three parts, wherein the first part includes the prefix part, the second part includes the sequence number part and the function field, and the third part is padding. The third part of all SIDs is the same, and is filled with the same content, for example, all 0s. The sum of the lengths of the first part, the second part and the third part is 128 bits, and the sum of the lengths of the first part and the second part is less than 128 bits. When generating the C-SID from the SID, the first part and the third part are omitted, and the second part is still taken as the C-SID, as shown in FIG. 4D. In combination with the application scenario shown in FIG. 1, the SID of the network device 1 can be A1::0001:1111::, and the length of the SID is 128 bits, and "::" represents a full 0 byte. Among them, A1::0001 is the location field, and the length is 64 bits, A1 / 48 is the prefix part, " / 48" represents a 48-bit mask, 0001 is the sequence number part, and the length is 16 bits. 1111 is the function field, and the length is 16 bits. That is, the first part of the SID includes A1 with a length of 48 bits, the second part includes 0001:1111 with a length of 32 bits, and the third part includes a full 0 part with a length of 48 bits. The second part is taken as the C-SID, that is, the C-SID is 0001:1111, and the length is 32 bits. In actual network application, some devices can not be able to process 128-bit data at a time, for example, some ASIC chips can only process 80-bit data at a time. At this time, in the network planning process, each SID is set to include the padding in the third part described above, and in the network processing process, the third part in the DA field can not be processed, and only the first part and the second part are processed, so that the length of the data to be processed is expanded, and the adaptation range of the network device is expanded.
[0091] Figure 4B shows a structure of a packet encapsulating a packet header, wherein the packet header includes an IPv6 packet header and an SRH, and the SRH includes a SID list. In combination with the application scenario shown in Figure 1, when the forwarding path of the packet is from network device S to network device 1, and sequentially passes through network device 2, network device 3, network device 4, network device 5, network device 6, and reaches network device 7, the SID list corresponding to the forwarding path can be as shown in Figure 4B, including 7 C-SIDs. The length of each C-SID is 32 bits, the length of the 7 C-SIDs is 224 bits, and the length of the SID list is greatly reduced, improving the transmission efficiency and processing efficiency of the network.
[0092] The C-SID of each network device can be published through an extended control plane protocol. The prefix part of the SID in the SRv6 network domain can also be published through an extended control plane protocol. The control plane protocol that can be used includes, for example, an Interior Gateway Protocol (IGP), a Border Gateway Protocol (BGP), a Border Gateway Protocol link state (BGP-LS), or a Path Computation Element Communication Protocol (PCEP), etc.
[0093] The SID list including the C-SID can be generated by a controller or by a network entry device. For example, the controller calculates the forwarding path of the packet, generates a SID list corresponding to the forwarding path, the SID list including the C-SID, and the controller sends the SID list to the network entry device. Alternatively, the network entry device calculates the forwarding path of the packet and generates a SID list corresponding to the forwarding path, the SID list including the C-SID. Alternatively, the controller calculates the forwarding path of the packet, generates a SID list corresponding to the forwarding path, the SID list including the SID but not including the C-SID, the controller sends the SID list to the network entry device, and the network entry device generates a new SID list according to the received SID list, the new SID list including the C-SID.
[0094] The control plane protocol sending the SID list can be, for example, a Border Gateway Protocol (BGP) or a Path Computation Element Communication Protocol (PCEP), etc. The control plane protocol can be extended to send a SID list including C-SIDs. The control plane protocol can also be extended with a new attribute to identify that a SID list including SIDs can be converted to a SID list including C-SIDs or that a SID list including SIDs shall be converted to a SID list including C-SIDs. For example, when a controller computes a forwarding path for a packet, generates a SID list corresponding to the forwarding path, the SID list includes SIDs but not C-SIDs, the controller sends the SID list to a network ingress device and identifies that the SID list like like like like like like like like can be converted to a SID list including C-SIDs with the new attribute extended by the control plane protocol. The network ingress device generates a new SID list including C-SIDs from the received SID list according to the attribute.
[0095] Optionally, the network device 301 can advertise its capability attribute to other network devices through a control plane protocol, the capability attribute is used to identify that the network device 301 has the capability of compatible C-SID, for example, publishing C-SID mapped to segment, generating SID list including C-SID, encapsulating SID list including C-SID into packet, processing packet according to C-SID, etc. The control plane protocol can be, for example, Interior Gateway Protocol (IGP), Border Gateway Protocol (BGP), Path Computation Element Communication Protocol (PCEP), etc. In one example, the network device 301 adds the first part of the omitted SID into the DA field. In combination with the above analysis, the multiple C-SIDs in the SID list are one-to-one mapped to the multiple segments, further, the multiple segments are one-to-one mapped to the multiple SIDs, in order to reduce the length of the SID list, the first part of the SID, i.e. the prefix part of the position field of the SID, is omitted, and only the second part of the SID, i.e. the serial number part and the function field, is stored in the SID list as C-SID. Optionally, the SID list can only include C-SID, without including the prefix part corresponding to the C-SID. The network device 301 adds the first part of the SID, i.e. the prefix part of the position field, in the destination address field, and the network device 301 copies the current to-be-processed C-SID in the multiple C-SIDs in the SID list into the DA field. The first part in the DA field and the current to-be-processed C-SID constitute the current to-be-processed SID, so that the network device can still process the packet according to the content of the DA field. For example, referring to FIG. 4B, the network device 301 copies the first C-SID, i.e. C-SID1, in the multiple C-SIDs into the DA field, the prefix part in the DA field and C-SID1 constitute the first SID in the multiple SIDs, and the network device 301 processes the packet according to the first SID, for example, forwards the packet.
[0096] When the SID in the network includes the third part with padding, the network device 301 also adds the third part in the omitted SID to the DA field. And the first part, the second part and the third part are arranged in the DA field according to their positions in the SID. Therefore, the network device 301 adds the first part at the front of the DA field, the first bit of the first part is aligned with the first bit of the DA field; the network device 301 adds the third part at the end of the DA field, the last bit of the third part is aligned with the last bit of the DA field. The first part, the current processing C-SID and the third part in the DA field constitute the current processing SID, so that the subsequent network device on the packet forwarding path can still process the packet according to the content of the DA field when receiving the packet. Optionally, when the SID in the network includes the third part with padding, the network device 301 or a controller in the network can notify the structure information of the DA field to other network devices through a control plane protocol, so that other network devices can correctly parse the content of the DA field. The structure information indicates the adding position of the C-SID in the DA field, i.e. the adding position of the second part in the SID in the DA field. In combination with the above description, the first part, the second part and the third part are arranged in the DA field according to their positions in the SID, and the structure information indicates the position of the second part in the SID. For example, the structure information can include the length of the first part and the length of the second part, i.e. the length of the prefix part and the length of the C-SID are notified. The structure information can also include the length of the first part and the length of the third part, or the structure information can also include the length of the first part, the length of the second part and the length of the third part, etc. The control plane protocol for notifying the structure information can be an Intermediate system to intermediate system (IS-IS) protocol, an Open Shortest Path First (OSPF) protocol or a Border Gateway Protocol (BGP) protocol, etc. The specific process of other network devices parsing the content of the DA field is described below.
[0097] In combination with the above description, the SL pointer is included in the SRH, and is used to indicate the number of remaining segments to be processed. After each update of the SL, the position pointed to in the SID list is offset by the length of one SID, i.e., 128 bits. When the C-SID is used, since the length of the C-SID is less than the length of the SID, the space originally used to store one SID can be used to store multiple C-SIDs. Thus, after each update of the SL, the position pointed to in the SID list is offset by the length of multiple C-SIDs, and it is impossible to accurately locate each C-SID.
[0098] In an embodiment of the present application, the space in the SID list is divided into multiple elements, and the SL points to different elements after each update. Then, a new pointer can be set to determine the C-SID to be processed in each element. The new pointer can be referred to as a CL pointer, and the SL pointer and the CL pointer constitute a two-dimensional pointer. The value of the SL pointer is used to determine the position of the element to be processed in the SID list, and the value of the CL pointer is used to determine the position of the C-SID to be processed in the element. Thus, according to the value of the SL pointer and the value of the CL pointer, the position of the C-SID to be processed in the SID list can be determined, i.e., the value of the SL pointer and the value of the CL pointer jointly indicate the position of the C-SID in the SID list.
[0099] In one example, the space occupied by each SID can be divided into one element, i.e., the length of each element is 128 bits, and the position pointed to in the SID list by the SL pointer is still offset by 128 bits after each update of the SL. Referring to the SID list in the packet header of the packet shown in FIG. 4B, the first element in the SID list includes four C-SIDs, and the second element includes three C-SIDs. Thus, the seven C-SIDs occupy two elements in the SID list.
[0100] Along with the behavior of the network device copying the C-SID in the SID list to the DA field, the value of the CL pointer also needs to be updated to ensure that the value of the CL pointer is always used to determine the position of the C-SID to be processed in the element.
[0101] The updating manner of the CL pointer is associated with the initial value of the CL pointer. Referring to FIG. 4B, when the first element in the SID list includes four C-SIDs, the initial value of the CL pointer can be 0, indicating the first C-SID in the element. In each updating, the value of the CL pointer is increased by 1, i.e., the value of the CL pointer is updated to 1, 2 and 3 in turn, which are used to indicate the second, third and fourth C-SIDs in the element in turn. Similarly, if the initial value of the CL pointer is 3, indicating the first C-SID in the element, in each updating, the value of the CL pointer is decreased by 1, i.e., the value of the CL pointer is updated to 2, 1 and 0 in turn, which are used to indicate the second, third and fourth C-SIDs in the element in turn.
[0102] There are two execution sequences between the two actions of updating the value of the CL pointer and copying the C-SID to the DA field, i.e., first updating the value of the CL pointer and then copying the C-SID, or first copying the C-SID and then updating the value of the CL pointer. The above two execution sequences can be selected by network setting. After selecting a certain execution sequence, all network devices in the network perform the above two actions according to the execution sequence, so as to ensure that the value of the CL pointer is always used to determine the position of the current C-SID to be processed in the element.
[0103] The CL pointer has a specific position in the packet header. In an example, the CL pointer can be included in the C-SID. FIG. 4C shows a structure of the C-SID. Referring to FIG. 4C, the last part of the C-SID can be divided as an optional field of the CL pointer. The optional field can be set to a specific length, e.g., 3 bits. The value of the optional field can be set to a specific initial value, e.g., all 0. When multiple C-SIDs in the SID list are arranged in turn, an optional field in a specific C-SID in each element in the SID list can be selected as the CL pointer, and the value of the optional field in the specific C-SID is used to determine the position of the current C-SID to be processed in the element. The optional fields of other C-SIDs in the element remain the initial value. Preferably, the specific C-SID is the C-SID at the edge of each element. For example, the specific C-SID can be the first C-SID in the element, e.g., C-SID1 shown in FIG. 4B, in which the CL pointer is included, and the inclined font indicates an optional implementation. The optional field of the first C-SID is used as the CL pointer, and the value of the CL pointer is modified according to the position of the current C-SID to be processed in the element. The values of the optional fields of other C-SIDs in the element remain the initial value, e.g., all 0. For example, the specific C-SID can also be the last C-SID in the element.
[0104] In one example, the CL pointer can be a field divided from the SRH, which is not shown in FIG. 4B. For example, a part of the Flags field, the Last Entry field or the Tag field. The CL pointer can be set to a specific length, for example, 3 bits.
[0105] In one example, the CL pointer can be a part of the DA field in the IPv6 packet header, specifically, the CL pointer is located in the last part of the DA field, that is, the last part of the C-SID in the DA field, as shown in FIG. 4B, the italic font indicates that this is an optional implementation. The CL pointer can be set to a specific length, for example, 3 bits. The value of the CL pointer in the DA field is modified according to the position of the C-SID to be processed in the element. At this time, the format of the C-SID still includes the above-mentioned alternative field, and the length of the alternative field is the same as the length of the CL pointer, but the alternative field of all C-SIDs in the SID list remains the initial value unchanged.
[0106] In combination with the above description, the network device 301 can announce to other network devices that it has the capability of processing C-SIDs. In the network, there can also be network devices that do not have the capability of compatible C-SIDs. When the network device that does not have the capability of compatible C-SIDs is located in the forwarding path of the packet, the network device will also process the packet according to the segment. The network device does not have the capability of compatible C-SIDs, does not publish C-SIDs mapped to the segment, but only publishes SIDs mapped to the segment, so the SID list corresponding to the forwarding path will include the SIDs mapped to the segment. When the forwarding path also passes through the network device compatible with C-SIDs, the SID list corresponding to the forwarding path will include both C-SIDs and SIDs.
[0107] Figure 5A shows a structure of a packet encapsulating a packet header, wherein the packet header includes an IPv6 packet header and an SRH, and the SRH includes a SID list, and the SID list includes a C-SID and a SID. Specifically, the SID list can include a SID before the C-SID, or a SID after the C-SID, or both a SID before the C-SID and a SID after the C-SID. The C-SID can refer to multiple C-SIDs, and the SID before the C-SID or the SID after the C-SID can refer to multiple SIDs. Correspondingly, the actual network situation is that the forwarding path of the packet can first pass through a network domain incompatible with the C-SID before passing through a network domain compatible with the C-SID, or can first pass through a network domain compatible with the C-SID before passing through a network domain incompatible with the C-SID, or can first pass through a network domain incompatible with the C-SID before passing through a network domain compatible with the C-SID, and then pass through a network domain incompatible with the C-SID. The network domain compatible with the C-SID can include multiple network devices, and the network domain incompatible with the C-SID can also include multiple network devices.
[0108] In combination with the application scenario shown in Figure 1, in addition to the network devices 1 to 7, the forwarding path of the packet can also pass through other network devices without the ability to be compatible with the C-SID, which can be located between the network device S and the network device 1, and after the network device 7, which are not shown in Figure 1.
[0109] When the SID list includes both the C-SID and the SID, the SID list can still be sent through the extended control plane protocol described above.
[0110] When the SID list includes both the C-SID and the SID, a start flag can be set in the packet header to indicate the start of the C-SID.
[0111] In one example, all segments performed by network devices with the ability to be compatible with the C-SID are represented by C-SIDs in the SID list, and the start flag can be included in the last SID before the first C-SID. For example, the start flag can be a specific function in SRv6, which is stored in the function field of the last SID.
[0112] In one example, among the segments performed by all network devices with compatible C-SID capability, the first segment still uses a SID with a length of 128 bits in the SID list, and the remaining segments all use C-SID representation. The start flag can be included in the SID mapped by the first segment, which can also be referred to as a special SID. FIG. 5B shows the format of the special SID. The SID includes a location field, a function field, and a parameter field, i.e., Locator, Function, and Argument. Among them, the location field includes a prefix part and a serial number part, i.e., Prefix-1 and NodeID. And the Prefix-1 is different from the Prefix in the SID to which the C-SID is mapped. The parameter field includes a quantity flag and a CL pointer, and the quantity flag is represented by L. FIG. 5C shows a packet including the special SID in the SID list, where the SPECIAL SID is the special SID.
[0113] When the special SID is used, the space occupied by the C-SID can be divided into one element, and the length of the element can be greater than 128 bits. The space occupied by each of the remaining SIDs is divided into one element, and the length of the element is 128 bits. Thus, the lengths of all spaces are not necessarily the same, and the lengths of the positions pointed to by the SL pointer after each update are not necessarily the same. Referring to the SID list in the packet header of the packet shown in FIG. 5A, the element including the C-SIDs in the SID list includes 7 C-SIDs, and the length is greater than 128 bits.
[0114] The CL pointer in the special SID is used to determine the current C-SID to be processed in the element including the C-SIDs. With the behavior of the network device copying the C-SIDs in the SID list to the DA field, the value of the CL pointer is updated to ensure that the value of the CL pointer is always used to determine the position of the current C-SID to be processed in the element. In combination with the packet shown in FIG. 5C, the value of the CL pointer in the special SID can be 7 different values, such as 0-6.
[0115] The value of the quantity flag is used to represent the number of C-SIDs. The value of the quantity flag is used to determine the position of the SL pointer when the SL pointer is updated. In combination with the packet shown in FIG. 5C, when the multiple C-SIDs end, the position of the SL pointer can be 224 bits, thereby pointing to the first SID after the multiple C-SIDs.
[0116] In one example, the value of the function field in the special SID is used to represent a specific function in the SRv6 network, and the number flag and the CL pointer are used as parameters of the specific function. The specific function is used to copy the prefix part of the C-SID mapped SID, i.e., the above-mentioned Prefix, into the DA field, and copy the first C-SID in the multiple C-SIDs into the DA field when the value of the CL pointer is an initial value, i.e., the beginning of the multiple C-SIDs in the SID list.
[0117] In one example, the network device 301 can obtain the SIDs and C-SIDs about the same segment, including the above-mentioned special SID. These SIDs and C-SIDs can be published by the network device performing the segment. When generating the SID list, the first segment in the multiple segments that can be represented by the C-SID should use the above-mentioned special SID, instead of the C-SID.
[0118] When the C-SID and the SID are included in the SID list at the same time, an end flag can also be set in the packet header, used to indicate the end of the C-SID. The network device can determine the last C-SID in the multiple C-SIDs according to the end flag, and copy the 128 bits after the last C-SID into the DA field, i.e., copy the SID after the last C-SID into the DA field.
[0119] In one example, an end flag is set after the multiple C-SIDs in the SID list, used to indicate the end of the multiple C-SIDs. The end flag can be a type field with the same length as the C-SID, and the value of the end flag is a specific value, e.g., all 0. As shown in FIG. 5A, the end flag can be represented by EOC, and the slanted font indicates that this is an optional implementation.
[0120] In one example, an end flag is set in the last C-SID in the multiple C-SIDs in the SID list, used to indicate the end of the multiple C-SIDs. As shown in FIG. 5A, the end flag can be included in C-SID 7.
[0121] Optionally, the end flag can be a specific function in SRv6, stored in the function field of the last C-SID.
[0122] Optionally, the end marker can be a specific field in the C-SID. In combination with the above description, the last part of the fields in the C-SID can be divided as the alternative field of the CL pointer. On this basis, the part of the fields before the alternative field of the CL pointer can be divided as the alternative field of the end marker. FIG. 5D shows the format of the C-SID including the alternative field of the end marker and the alternative field of the CL pointer. The alternative field of the end marker is denoted as S. The alternative field of the end marker can be set to a specific length, for example, 1 bit. The value of the alternative field of the end marker can be set to a specific initial value, for example, set to 0. The value of the alternative field of the end marker in the last C-SID in the SID list is set to 1, indicating the end of the C-SID. The value of the alternative field of the end marker in the rest of the C-SIDs remains the initial value. The updating manner of the CL pointer is the same as the previously introduced manner, which is not described here again.
[0123] In one example, the network device 301 can obtain the C-SIDs of different formats about the same segment, including the format of the C-SID including the alternative field of the end marker and the alternative field of the CL pointer described above. These C-SIDs of different formats can be published by the network device performing the segment. The last C-SID in each element in the SID list can select the format of the C-SID including the alternative field of the end marker and the alternative field of the CL pointer described above. The alternative field of the CL pointer therein can be used as the CL pointer for determining the C-SID currently to be processed in the element, and the end marker therein can be used to indicate the end of the C-SID when the last C-SID in the element is also the last C-SID in all C-SIDs.
[0124] S320, the network device 301 sends the packet encapsulating the packet header.
[0125] In combination with the above description, the network device 301 copies the first C-SID in the SID list to the DA field, and the first part of the SID in the DA field and the first C-SID reconstitute the SID. The network device 301 sends the packet encapsulating the packet header. Optionally, the network device 301 processes the packet according to the SRv6 network function represented by the function field in the SID, and the processing process is determined by the specific instructions in the SRv6 network function. Optionally, the processing process can include sending the packet out, for example, the network device 301 sends the packet to the network device 302.
[0126] S325, the network device 302 receives the packet. The packet header of the packet includes a destination address field, a first pointer, a second pointer, and a list for processing the packet, the list including a plurality of identifiers arranged in sequence, the plurality of identifiers one-to-one mapping to a plurality of segments in the SR network, the value of the first pointer and the value of the second pointer together indicating the position of a first identifier in the plurality of identifiers in the list.
[0127] S330, the network device 302 determines the first identifier according to the value of the first pointer and the value of the second pointer.
[0128] S335, the network device 302 copies the first identifier into the destination address field.
[0129] The network device 302 receives a SID list including a C-SID, determines the current C-SID to be processed according to the SL pointer and the CL pointer, and copies the C-SID into the DA field. The C-SID can overwrite the original C-SID in the DA field, and combine with the prefix part in the DA field to form a SID. Subsequent network devices on the packet forwarding path can process the packet according to the SID.
[0130] When the SID in the network includes the third part with padding content as described above, the network device 302 learns the specific position of the second part in the DA field according to the structure information of the SID announced from the network device 301 or a controller in the network. Thus, the network device 302 can copy the current C-SID to be processed into the corresponding position of the second part in the DA field according to the specific position of the second part in the DA field, so that the C-SID overwrites the original C-SID in the DA field. That is, the network device 302 updates the second part in the DA field, but does not update the first part and the third part in the DA field. The updated second part combines with the first part and the third part to form a SID. Subsequent network devices on the packet forwarding path can process the packet according to the SID. In combination with the above description, there are two execution sequences between the two actions of updating the value of the CL pointer and copying the C-SID into the DA field. In association with this, there are two execution ways of determining the current C-SID to be processed according to the SL pointer and the CL pointer at the network device 302. In addition, the space including the C-SID in the SID list can be divided into multiple elements, or can be divided into one element. In association with this, there are different execution ways of determining the current C-SID to be processed according to the SL pointer and the CL pointer at the network device 302.
[0131] When the execution sequence is to update the value of the CL pointer first and then copy the C-SID, and the space of the C-SID included in the SID list can be divided into multiple elements, an example is given in combination with the application scenario shown in FIG. 1. The network device 302 can be the network device 1 in FIG. 1, which receives a packet sent by the network device S, and the packet header is as shown in FIG. 4, which includes a DA field, an SL pointer, a CL pointer and a SID list, and the SID list includes multiple C-SIDs. At this time, the DA field includes a prefix part and a C-SID 1, wherein the prefix part is A1, the C-SID 1 is 0001:1111, and the combination of the prefix part and the C-SID 1 is A1:0001:1111, which is the SID of the network device 1. At this time, the value of the SL pointer in the packet header is 1, indicating the position of the first element in the SID list, referring to FIG. 4, the first element includes four C-SIDs, which are C-SID 1, C-SID 2, C-SID 3 and C-SID 4. The value of the CL pointer in the packet header is 1, indicating the position of the first C-SID in the row in the element, which is C-SID 1. The network device 1 updates the value of the CL pointer first, for example, modifies the value of the CL pointer to 2, indicating the position of the second C-SID in the row in the element. The network device 1 obtains the second C-SID in the first element, that is, C-SID 2, according to the indication of the SL pointer and the CL pointer, and copies the C-SID 2 to the DA field in the packet header, replacing the original C-SID 1 in the DA field. At this time, the DA field includes the combination of the prefix part and the C-SID 2, that is, A1:0002:2222, which is the SID of the network device 2. The network device 1 queries the forwarding table item according to the SID of the network device 2 in the DA field, and sends the packet to the network device 2 according to the query result.
[0132] The network device 302 can also be the network device 2 in FIG. 1, which receives the packet sent by the network device 1. At this time, the DA field in the packet header of the packet includes the prefix part and the C-SID 2, i.e., A1:0002:2222, which is the SID of the network device 2. The value of the SL pointer in the packet header is 1, and the value of the CL pointer is 2, indicating the position of the second C-SID in the first element, i.e., the C-SID 2. The network device 2 updates the value of the CL pointer, for example, modifies the value of the CL pointer to 3, indicating the position of the third C-SID in the element. According to the indication of the SL pointer and the CL pointer, the network device 2 obtains the third C-SID in the first element, i.e., the C-SID 3, and copies the C-SID 3 to the DA field in the packet header, replacing the original C-SID 2 in the DA field. At this time, the DA field includes the combination of the prefix part and the C-SID 3, i.e., A1:0003:3333, which is the SID of the network device 3. The network device 2 queries the forwarding table item according to the SID of the network device 3 in the DA field, and sends the packet to the network device 3 according to the query result.
[0133] The network device 302 can also be the network device 3 in FIG. 1, and the process of processing the packet by the network device 3 is similar to the above description, which will not be described herein.
[0134] When the execution sequence is to copy the C-SID first and then update the value of the CL pointer, and the space including the C-SID in the SID list can be divided into multiple elements, the value of the CL pointer in the packet received by the network device 1 is 2, indicating the position of the second C-SID in the element. According to the indication of the SL pointer and the CL pointer, the network device 1 obtains the second C-SID in the first element, i.e., the C-SID 2, and copies the C-SID 2 to the DA field in the packet header, replacing the original C-SID 1 in the DA field. Then, the network device 1 updates the value of the CL pointer, for example, modifies the value of the CL pointer to 3, indicating the position of the third C-SID in the element. At this time, the DA field includes the combination of the prefix part and the C-SID 2, i.e., A1:0002:2222, which is the SID of the network device 2. The network device 1 queries the forwarding table item according to the SID of the network device 2 in the DA field, and sends the packet to the network device 2 according to the query result. Other execution processes can be derived by analogy according to the above description, which will not be described herein.
[0135] In one example, the network device 302 judges whether the C-SID in the current DA field is the last C-SID in the elements of the SID list. If the C-SID in the current DA field is the last C-SID in the elements of the SID list, the network device 302 needs to update the value of the SL pointer and the value of the CL pointer. The multiple network devices on the packet forwarding path process the multiple C-SIDs in the SID list in turn. When the C-SID in one element of the SID list is processed, the C-SID in the next element is processed. At this time, the value of the CL pointer and the value of the SL pointer need to be modified to ensure that the current C-SID to be processed can still be determined according to the value of the CL pointer and the value of the SL pointer.
[0136] In combination with the application scenario shown in FIG. 1 and the SID list in the packet shown in FIG. 4B, still taking the example of updating the value of the SL pointer and the value of the CL pointer in sequence and then copying the C-SID as the execution sequence for example. The network device 302 can be the network device 4 in FIG. 1. The network device 4 receives the packet sent by the network device 3. At this time, the DA field in the packet header of the packet includes the prefix part and the C-SID 4, that is, A1:0004:4444, which is the SID of the network device 4. The value of the SL pointer in the packet header is 1, and the value of the CL pointer is 4, indicating the position of the fourth C-SID in the first element, that is, C-SID 4. The network device 4 determines that the C-SID 4 in the current DA field is the last C-SID in the elements of the SID list, and then the network device 4 needs to update the value of the SL pointer and the value of the CL pointer. Specifically, the network device 4 updates the value of the SL pointer first, for example, modifies the value of the SL pointer to 0, indicating the second element in the SID list, and the second element includes three C-SIDs, C-SID 5, C-SID 6, and C-SID 7. The network device 4 then updates the value of the CL pointer, for example, modifies the value of the CL pointer to 1, indicating the position of the first C-SID in the element, that is, the position of C-SID 5 in the element. The network device 4 obtains the first C-SID in the second element, that is, C-SID 5, according to the indication of the SL pointer and the CL pointer, and copies C-SID 5 to the DA field in the packet header to replace the original C-SID 4 in the DA field. At this time, the DA field includes the combination of the prefix part and C-SID 5, that is, A1:0005:5555, which is the SID of the network device 5. The network device 4 queries the forwarding table item according to the SID of the network device 5 in the DA field, and sends the packet to the network device 5 according to the query result.
[0137] When the execution sequence is to copy the value of the C-SID and update the value of the SL pointer and the value of the CL pointer, the execution process can be analogized according to the above description, and details are not described herein.
[0138] In addition, the network device 302 can also be the network device 5, the network device 6 or the network device 7 in FIG. 1, and the process of processing the packet is similar to the above description, and details are not described herein.
[0139] When the space including the C-SID in the SID list is divided into one element, the execution process can be analogized according to the above description, and details are not described herein.
[0140] Although, in the above example of the application scenario shown in FIG. 1, the packet is processed once at each network device, and each processing behavior corresponds to a segment, so that the SID list representing the entire packet forwarding process includes 7 SIDs. However, it is easy for those skilled in the art to expect that in the process of processing the packet, the packet can be processed multiple times at some network devices, and the processing includes forwarding processing and non-forwarding processing, and each processing behavior corresponds to a segment, so that in the application scenario shown in FIG. 1, the SID list representing the entire packet forwarding process can include more than 7 SIDs, for example, 10 SIDs.
[0141] FIG. 6 shows a possible structure diagram of the network device involved in the above embodiment. The network device 600 can implement the function of the network device 301 in the embodiment shown in FIG. 3. Referring to FIG. 6, the network device 600 includes a receiving unit 601 and a processing unit 602. These units can perform the corresponding functions of the network device in the above method. For example,
[0142] The receiving unit 601 is configured to receive the packet.
[0143] The processing unit 602 is configured to generate a packet header and encapsulate the packet header to the packet. The packet header includes a first pointer, a second pointer and a list for processing the packet. The list includes a plurality of identifiers arranged in sequence. The plurality of identifiers are one-to-one mapped to a plurality of segments in the SR network. The value of the first pointer and the value of the second pointer together indicate the position of a first identifier in the list. The packet encapsulating the packet header is processed according to the list.
[0144] FIG. 7 shows another possible structure diagram of the network device 301 involved in the above embodiment. The network device 700 includes a processor 702, a network interface 703 and a memory 701. Wherein,
[0145] The memory 701 is configured to store instructions. In the case of implementing the embodiment shown in FIG. 6, and in the case of implementing the units described in the embodiment shown in FIG. 6 by software, the software or program code required for executing the functions of the processing unit 602 in the embodiment shown in FIG. 6 is stored in the memory 701.
[0146] The processor 702 is configured to execute the instructions in the memory 701, and execute the method for processing a packet applied to the embodiment shown in FIG. 3.
[0147] The network interface 703 is configured to communicate with other network devices.
[0148] The network interface 703, the processor 702, and the memory 701 are connected to each other. For example, the network interface 703, the processor 702, and the memory 701 are connected to each other through a bus. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, and a control bus, etc. For the convenience of representation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or only one type of bus.
[0149] In specific embodiments, the processor 702 is configured to receive a packet through the network interface 703, generate a packet header, and encapsulate the packet header into the packet. The packet header includes a first pointer, a second pointer, and a list for processing the packet. The list includes a plurality of identifiers arranged in sequence. The plurality of identifiers are one-to-one mapped to a plurality of segments in the SR network. The value of the first pointer and the value of the second pointer together indicate the position of a first identifier in the list. The packet encapsulated with the packet header is processed according to the list. For the detailed processing process of the processor 702, please refer to the detailed description of the processes S310, S315, and S320 in the embodiment shown in FIG. 3, which will not be repeated here.
[0150] The network interface 703 is configured to receive and send packets by the network system through the network device 700. For the specific process, please refer to the detailed description of S310 in the embodiment shown in FIG. 3, which will not be repeated here.
[0151] FIG. 8 shows a possible structure of the network device involved in the above-mentioned embodiments. The network device 800 can implement the functions of the network device 302 in the embodiment shown in FIG. 3. Referring to FIG. 8, the network device 800 includes a receiving unit 801 and a processing unit 802. The units can perform the corresponding functions of the network device in the above-mentioned method. For example,
[0152] The receiving unit 801 is configured to receive a packet, wherein a packet header of the packet comprises a destination address field, a first pointer, a second pointer, and a list used for processing the packet, the list comprises a plurality of identifiers arranged in sequence, the plurality of identifiers are one-to-one mapped to a plurality of segments in the SR network, and the value of the first pointer and the value of the second pointer jointly indicate a position of a first identifier in the list.
[0153] The processing unit 802 is configured to determine the first identifier according to the value of the first pointer and the value of the second pointer, and copy the first identifier into the destination address field.
[0154] FIG. 9 shows a possible structural diagram of a network device involved in the above embodiments, the network device 900 comprising a processor 902, a network interface 903, and a memory 901. Wherein,
[0155] The memory 901 is configured to store instructions; in the case of implementing the embodiment shown in FIG. 8, and in the case of each unit described in the embodiment of FIG. 8 being implemented by software, the software or program code required for executing the function of the sending unit 801 in FIG. 8 is stored in the memory 901.
[0156] The processor 902 is configured to execute the instructions in the memory 901, and execute the above method applied to processing the packet in the embodiment shown in FIG. 3.
[0157] The network interface 903 is configured to communicate with other network devices.
[0158] The network interface 903, the processor 902, and the memory 901 are connected to each other. For example, the network interface 903, the processor 902, and the memory 901 are connected to each other through a bus; the bus can be a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is shown in FIG. 9, but it does not mean that there is only one bus or only one type of bus.
[0159] In specific embodiments, the processor 902 is configured to receive a packet through the network interface 903, wherein a packet header of the packet comprises a destination address field, a first pointer, a second pointer, and a list used for processing the packet, the list comprises a plurality of identifiers arranged in sequence, the plurality of identifiers are one-to-one mapped to a plurality of segments in the SR network, the value of the first pointer and the value of the second pointer jointly indicate a position of a first identifier in the list, the first identifier is determined according to the value of the first pointer and the value of the second pointer, and the first identifier is copied into the destination address field. The detailed processing process of the processor 902 is described in detail in the above process S325, S330, and S335 of the embodiment shown in FIG. 3, which will not be repeated here.
[0160] The network interface 903 is configured to receive and send messages of the network device 900 through the network system. For details, refer to the description of S325 in the embodiment of FIG. 3. Here, the details are not repeated.
[0161] The memory 701 and the memory 901 can be random-access memory (RAM), flash, read only memory (ROM), erasable programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), register, hard disk, mobile hard disk, CD-ROM, or any other form of storage medium known to those skilled in the art.
[0162] The processor 702 and the processor 902 can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), a field programmable gate array (FPGA) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The processor can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the disclosure. The processor can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, and the like.
[0163] The network interface 703 and the network interface 903 can be an interface card or the like, and can be an ethernet interface or an asynchronous transfer mode (ATM) interface. The network interface 703 and the network interface 903 can be a wired interface or a wireless interface.
[0164] The processor 702 and the processor 902 can be, for example, an application-specific integrated circuit (ASIC). At this time, the processor 702 and the processor 902 execute the method for processing a packet applied to the embodiment shown in FIG. 3 according to the circuit itself. That is, at this time, the memory 701 and the memory 901 do not need to store the instructions executed by the processor 702 and the processor 902, and the processor 702 and the processor 902 no longer execute the instructions in the memory 701 and the memory 901. Optionally, at this time, the network device can not include the memory 701 or the memory 901.
[0165] Referring to FIG. 10, FIG. 10 shows a possible structure of a network system according to an embodiment of the present application. The network system 1000 includes a first network device 1001 and a second network device 1002. The first network device 1001 in the network system can execute the processing steps of the network device 301 in the embodiment shown in FIG. 3, and the second network device 1002 in the network system can execute the processing steps of the network device 302 in the embodiment shown in FIG. 3. Correspondingly, the first network device 1001 in the network system can be the network device 600 in the embodiment shown in FIG. 6, and the second network device 1002 can be the network device 800 in the embodiment shown in FIG. 8, or correspondingly, the first network device 1001 in the network system can be the network device 700 in the embodiment shown in FIG. 7, and the second network device 1002 can be the network device 900 in the embodiment shown in FIG. 9.
[0166] Specifically, the first network device is configured to receive a packet, generate a packet header, and encapsulate the packet header into the packet, the packet header including a first pointer, a second pointer, and a list for processing the packet, the list including a plurality of identifiers arranged in sequence, the plurality of identifiers one-to-one mapping to a plurality of segments in the SR network, the value of the first pointer and the value of the second pointer together indicating the position of a first identifier in the list, and the packet encapsulating the packet header is processed according to the list.
[0167] The second network device is configured to receive a packet, the packet header of the packet including a destination address field, a first pointer, a second pointer, and a list for processing the packet, the list including a plurality of identifiers arranged in sequence, the plurality of identifiers one-to-one mapping to a plurality of segments in the SR network, the value of the first pointer and the value of the second pointer together indicating the position of a first identifier in the list, determining the first identifier according to the value of the first pointer and the value of the second pointer, and copying the first identifier into the destination address field.
[0168] The embodiments of the present application also provide a non-transitory storage medium for storing software instructions used in the foregoing embodiments, which comprises a program for executing the method shown in the foregoing embodiments, which, when executed on a computer or network device, causes the computer or network device to perform the method in the foregoing method embodiments.
[0169] The embodiments of the present application also provide a computer program product comprising computer program instructions, which, when the computer program product is run on a computer, causes a network node to perform the method in the foregoing method embodiments.
[0170] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application, if any, of the foregoing drawings (if any) are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so construed herein is merely for convenience and brevity and that one of skill in the art will appreciate that steps in the described embodiments can be carried out in other sequences, except where this is inherently necessary. In addition, the terms "comprise", "comprising", "have", "having", "include", "including", "contain", "containing", "provide", "provided", "provide for", "provided for" and any variations thereof in the description and in the claims of the present application, if any, are to be construed as specifying the presence of what is stated in the corresponding statement, but not to preclude the presence of one or more additional statements.
[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0172] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical division, and in actual implementation, additional division can be made, for example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0173] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0174] In addition, each service unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software service unit.
[0175] If the integrated unit is realized in the form of a software service unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application or the entire or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0176] Those skilled in the art should realize that, in the one or more examples described above, the services described in the present application can be realized by hardware, software, firmware, or any combination thereof. When realized by software, these services can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium, wherein the communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0177] The above detailed description further explains the purpose, technical solutions, and beneficial effects of the present application. It should be understood that the above is only a specific embodiment of the present application.
[0178] The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing messages, the method being applied to a segmented routing (SR) network, characterized in that, The method includes: A message is received, the message header of which includes a destination address field, a first pointer, a second pointer, and a list for processing the message. The list includes multiple identifiers arranged in sequence, each of which is mapped to a segment in the SR network. The values of the first pointer and the second pointer together indicate the position of the first identifier in the list. The first identifier is determined based on the values of the first pointer and the second pointer; Copy the first identifier to the destination address field.
2. The method according to claim 1, characterized in that, The list includes multiple identifiers arranged in sequence, specifically: The list includes at least one element arranged in sequence, the at least one element including a first element, the first element including at least two identifiers from the plurality of identifiers, the at least two identifiers being arranged in sequence, and the first identifier being one of the at least two identifiers; The values of the first pointer and the second pointer together indicate the position of the first identifier among the plurality of identifiers in the list, specifically: The value of the second pointer is used to determine the position of the first element in the list, and the value of the first pointer is used to determine the position of the first identifier within the first element.
3. The method according to claim 2, characterized in that, The first pointer is included in the first of the at least two identifiers.
4. The method according to claim 2 or 3, characterized in that, The value of the first pointer is used to determine the position of the first identifier in the first element, specifically: The value of the first pointer indicates the position of the second identifier in the first element, wherein the second identifier is the preceding identifier among the plurality of identifiers; Determining the first identifier based on the value of the first pointer and the value of the second pointer includes: Modify the value of the first pointer in the message header so that the modified value of the first pointer indicates the position of the first identifier in the first element; The first identifier is determined based on the modified values of the first pointer and the second pointer.
5. The method according to claim 2 or 3, characterized in that, The value of the first pointer is used to determine the position of the first identifier in the first element, specifically: The value of the first pointer indicates the position of the first identifier within the first element; After copying the first identifier into the destination address field, the method further includes: Modify the value of the first pointer in the message header so that the modified value of the first pointer indicates the position of the second identifier in the first element, the second identifier being the latter of the first identifier among the at least two identifiers.
6. The method according to claim 2 or 3, characterized in that, The value of the second pointer is used to determine the position of the first element in the list, specifically: The value of the second pointer indicates the position of the second element in the list of the at least one element, wherein the second element is the element preceding the first element in the at least one element; The value of the first pointer is used to determine the position of the first identifier in the first element, specifically: The value of the first pointer indicates the position of the second identifier in the second element, the second identifier is the preceding identifier of the first identifier among the plurality of identifiers, the second element includes at least one identifier among the plurality of identifiers, the at least one identifier is arranged sequentially, the second identifier is one of the at least one identifier, and the destination address field includes the second identifier; Determining the first identifier based on the value of the first pointer and the value of the second pointer includes: The second identifier is determined to be the last identifier among the at least one identifier; Modify the value of the second pointer in the message header so that the modified value of the second pointer indicates the position of the first element in the list; Modify the value of the first pointer in the message header so that the modified value of the first pointer indicates the position of the first identifier in the first element; The first identifier is determined based on the modified values of the first pointer and the modified values of the second pointer.
7. The method according to claim 2 or 3, characterized in that, The value of the second pointer is used to determine the position of the first element in the list, specifically: The value of the second pointer indicates the position of the first element in the list; The value of the first pointer is used to determine the position of the first identifier in the first element, specifically: The value of the first pointer indicates the position of the first identifier within the first element; After copying the first identifier into the destination address field, the method further includes: The first identifier is determined to be the last of the at least two identifiers; Modify the value of the second pointer in the message header so that the modified value of the second pointer indicates the position of the second element in the list, the second element being the element following the first element in the at least one element; The value of the first pointer in the message header is modified such that the modified value of the first pointer indicates the position of the second identifier in the second element, the second identifier being the next identifier among the plurality of identifiers, and the second element including the second identifier.
8. The method according to any one of claims 1-7, characterized in that, The plurality of segments are mapped one-to-one to a plurality of segment identifiers, and the plurality of identifiers are mapped one-to-one to the plurality of segment identifiers. Each segment identifier in the plurality of segment identifiers includes a first part and a second part, wherein the first part precedes the second part. The first parts of all segment identifiers in the plurality of segment identifiers are the same, and each identifier in the plurality of identifiers includes the second part of the segment identifier to which each identifier is mapped.
9. The method according to claim 8, characterized in that, The destination address field includes the first part.
10. The method according to any one of claims 1-9, characterized in that, The length of the element is (N*32) bits, where N is an integer greater than or equal to 1.
11. The method according to any one of claims 1-7, characterized in that, The plurality of segments are mapped one-to-one to a plurality of segment identifiers, and the plurality of identifiers are mapped one-to-one to the plurality of segment identifiers. Each segment identifier includes a first part, a second part, and a third part arranged in sequence. The first part of all segment identifiers in the plurality of segment identifiers is the same, the third part of all segment identifiers in the plurality of segment identifiers is the same, and each identifier includes the second part of the segment identifier to which each identifier is mapped.
12. The method according to claim 11, characterized in that, The total length of the first part, the second part, and the third part is 128 bits.
13. The method according to claim 1 or 11, characterized in that, The method further includes: Receive the structure information of the destination address field, the structure information indicating the insertion position of the first identifier in the destination address field; The step of copying the first identifier to the destination address field includes: Based on the structural information, the first identifier is copied to the addition position of the first identifier in the destination address field.
14. The method according to claim 13, characterized in that, The structural information of receiving the destination address field includes: Receive control messages, the control messages including the structure information, and the control messages are intermediate system to intermediate system IS-IS protocol messages, open shortest path first OSPF protocol messages, or border gateway protocol BGP protocol messages.
15. The method according to any one of claims 1 to 14, characterized in that, Each of the plurality of identifiers has a length of 32 bits or 16 bits.
16. A method for forwarding messages, said method being applied to a segmented routing (SR) network, characterized in that, The method includes: Receive message; A message header is generated and encapsulated into the message. The message header includes a first pointer, a second pointer, and a list for processing the message. The list includes multiple identifiers arranged in sequence. Each of the multiple identifiers is mapped to a multiple segment in the SR network. The values of the first pointer and the second pointer together indicate the position of the first identifier among the multiple identifiers in the list. Send the message encapsulated with the aforementioned message header.
17. The method according to claim 16, characterized in that, The plurality of segments are mapped one-to-one to a plurality of segment identifiers, and the plurality of identifiers are mapped one-to-one to the plurality of segment identifiers. Each segment identifier in the plurality of segment identifiers includes a first part and a second part, wherein the first part precedes the second part. The first parts of all segment identifiers in the plurality of segment identifiers are the same, and each identifier in the plurality of identifiers includes the second part of the segment identifier to which each identifier is mapped.
18. The method according to claim 17, characterized in that, The generation of the message header includes: The list is generated by using the second part of the segment identifier to which each of the plurality of segments is mapped as the identifier to which each segment is mapped; The message header is generated based on the list.
19. The method according to claim 17, characterized in that, The generation of the message header includes: Receive the list, wherein each of the plurality of identifiers in the list includes a second part of the segment identifier to which the segment ...
20. The method according to claim 17, characterized in that, The length of the first part is X bits, where X is an integer, greater than or equal to 1 and less than 128, and the length of each of the plurality of identifiers is 128-X bits.
21. The method according to claim 17, characterized in that, The list does not include the first part.
22. The method according to any one of claims 17-21, characterized in that, The message header also includes a destination address field, and generating the message header and encapsulating the message header into the message further includes: Add the first part to the destination address field; Copy the first of the plurality of identifiers to the destination address field.
23. The method according to claim 16 or 17, characterized in that, The list includes multiple identifiers arranged in sequence, specifically: The list includes at least one element arranged in sequence, the first element of the at least one element including at least two of the plurality of identifiers, the at least two identifiers being arranged in sequence, and the first identifier being one of the at least two identifiers; The values of the first pointer and the second pointer together indicate the position of the first identifier among the plurality of identifiers in the list, specifically: The value of the second pointer indicates the position of the first element in the list, and the value of the first pointer indicates the position of the first identifier within the first element.
24. The method according to claim 23, characterized in that, The first pointer is included in the first of the at least two identifiers.
25. The method according to claim 16 or 17, characterized in that, The list includes a first segment identifier that precedes the first identifier among the plurality of identifiers, the first segment identifier being mapped to a segment in the SR network, and the first segment identifier having a length of 128 bits.
26. The method according to claim 25, characterized in that, The first segment identifier is adjacent to the first identifier among the plurality of identifiers. The first segment identifier includes a start mark, which is used to indicate that the next identifier in the list of the first segment identifier is the first identifier among the plurality of identifiers.
27. The method according to claim 26, characterized in that, The first segment identifier includes a function field and a parameter field. The function field includes the start flag, and the parameter field includes the first pointer and a quantity flag, the quantity flag being used to indicate the quantity of the plurality of identifiers.
28. The method according to claim 16 or 17, characterized in that, The list includes a second segment identifier, which follows the last identifier among the plurality of identifiers, and the first segment identifier maps to a segment in the SR network, the first segment identifier having a length of 128 bits.
29. The method according to claim 28, characterized in that, The second segment identifier is adjacent to the last identifier among the plurality of identifiers, and the second segment identifier includes an end marker, which is used to indicate that the identifier preceding the second segment identifier in the list is the last identifier among the plurality of identifiers.
30. The method according to claim 16, characterized in that, The plurality of segments are mapped one-to-one to a plurality of segment identifiers, and the plurality of identifiers are mapped one-to-one to the plurality of segment identifiers. Each segment identifier includes a first part, a second part, and a third part arranged in sequence. The first part of all segment identifiers in the plurality of segment identifiers is the same, the third part of all segment identifiers in the plurality of segment identifiers is the same, and each identifier includes the second part of the segment identifier to which each identifier is mapped.
31. The method according to claim 30, characterized in that, The total length of the first part, the second part, and the third part is 128 bits.
32. The method according to claim 30 or 31, characterized in that, The message header also includes a destination address field, and generating the message header and encapsulating the message header into the message further includes: Add the first part and the third part to the destination address field; Copy the first of the plurality of identifiers to the destination address field.
33. The method according to any one of claims 30-32, characterized in that, The method further includes: The structure information is sent to the intermediate network device, the structure information indicating the position where the first identifier is added in the destination address field.
34. The method according to any one of claims 16-33, characterized in that, Each of the plurality of identifiers has a length of 32 bits or 16 bits.
35. A network device located in a segmented routing (SR) network, characterized in that, The network device includes: A receiving unit is used to receive a message. The message header includes a destination address field, a first pointer, a second pointer, and a list for processing the message. The list includes multiple identifiers arranged in sequence. Each of the multiple identifiers is mapped to a multiple segment in the SR network. The values of the first pointer and the second pointer together indicate the position of the first identifier among the multiple identifiers in the list. The processing unit is configured to determine the first identifier based on the value of the first pointer and the value of the second pointer, and copy the first identifier to the destination address field.
36. The network device according to claim 35, characterized in that, The list includes multiple identifiers arranged in sequence, specifically: The list includes at least one element arranged in sequence, the at least one element including a first element, the first element including at least two identifiers from the plurality of identifiers, the at least two identifiers being arranged in sequence, and the first identifier being one of the at least two identifiers; The values of the first pointer and the second pointer together indicate the position of the first identifier among the plurality of identifiers in the list, specifically: The value of the second pointer is used to determine the position of the first element in the list, and the value of the first pointer is used to determine the position of the first identifier within the first element.
37. The network device according to claim 36, characterized in that, The first pointer is included in the first of the at least two identifiers.
38. The network device according to claim 36 or 37, characterized in that, The value of the first pointer is used to determine the position of the first identifier in the first element, specifically: The value of the first pointer indicates the position of the second identifier in the first element, wherein the second identifier is the preceding identifier among the plurality of identifiers; The processing unit is further configured to modify the value of the first pointer in the message header of the message, so that the modified value of the first pointer indicates the position of the first identifier in the first element, and determine the first identifier based on the modified value of the first pointer and the value of the second pointer.
39. The network device according to claim 36 or 37, characterized in that, The value of the first pointer is used to determine the position of the first identifier in the first element, specifically: The value of the first pointer indicates the position of the first identifier within the first element; The processing unit is further configured to modify the value of the first pointer in the message header of the message, such that the modified value of the first pointer indicates the position of the second identifier in the first element, wherein the second identifier is the latter of the first identifier among the at least two identifiers.
40. The network device according to claim 36 or 37, characterized in that, The value of the second pointer is used to determine the position of the first element in the list, specifically: The value of the second pointer indicates the position of the second element in the list of the at least one element, wherein the second element is the element preceding the first element in the at least one element; The value of the first pointer is used to determine the position of the first identifier in the first element, specifically: The value of the first pointer indicates the position of the second identifier in the second element, the second identifier is the preceding identifier of the first identifier among the plurality of identifiers, the second element includes at least one identifier among the plurality of identifiers, the at least one identifier is arranged sequentially, the second identifier is one of the at least one identifier, and the destination address field includes the second identifier; The processing unit is further configured to determine that the second identifier is the last identifier among the at least one identifier, modify the value of the second pointer in the header of the message so that the modified value of the second pointer indicates the position of the first element in the list, modify the value of the first pointer in the header of the message so that the modified value of the first pointer indicates the position of the first identifier in the first element, and determine the first identifier based on the modified value of the first pointer and the modified value of the second pointer.
41. The network device according to claim 36 or 37, characterized in that, The value of the second pointer is used to determine the position of the first element in the list, specifically: The value of the second pointer indicates the position of the first element in the list; The value of the first pointer is used to determine the position of the first identifier in the first element, specifically: The value of the first pointer indicates the position of the first identifier within the first element; The processing unit is further configured to determine that the first identifier is the last identifier among the at least two identifiers, modify the value of the second pointer in the header of the message such that the modified value of the second pointer indicates the position of the second element in the list, the second element being the element following the first element among the at least two elements, modify the value of the first pointer in the header of the message such that the modified value of the first pointer indicates the position of the second identifier in the second element, the second identifier being the element following the first identifier among the plurality of identifiers, and the second element including the second identifier.
42. The network device according to any one of claims 35-41, characterized in that, The plurality of segments are mapped one-to-one to a plurality of segment identifiers, and the plurality of identifiers are mapped one-to-one to the plurality of segment identifiers. Each segment identifier in the plurality of segment identifiers includes a first part and a second part, wherein the first part precedes the second part. The first parts of all segment identifiers in the plurality of segment identifiers are the same, and each identifier in the plurality of identifiers includes the second part of the segment identifier to which each identifier is mapped.
43. The network device according to claim 42, characterized in that, The destination address field includes the first part.
44. The method according to any one of claims 35-43, characterized in that, The length of the element is (N*32) bits, where N is an integer greater than or equal to 1.
45. The network device according to any one of claims 35-41, characterized in that, The plurality of segments are mapped one-to-one to a plurality of segment identifiers, and the plurality of identifiers are mapped one-to-one to the plurality of segment identifiers. Each segment identifier includes a first part, a second part, and a third part arranged in sequence. The first part of all segment identifiers in the plurality of segment identifiers is the same, the third part of all segment identifiers in the plurality of segment identifiers is the same, and each identifier includes the second part of the segment identifier to which each identifier is mapped.
46. The network device according to claim 45, characterized in that, The total length of the first part, the second part, and the third part is 128 bits.
47. The network device according to claim 35 or 45, characterized in that, The processing unit is further configured to receive structural information of the destination address field, the structural information indicating the insertion position of the first identifier in the destination address field; and copy the first identifier to the insertion position of the first identifier in the destination address field according to the structural information.
48. The network device according to claim 47, characterized in that, The processing unit is further configured to receive control messages, the control messages including the structure information, and the control messages being intermediate system to intermediate system IS-IS protocol messages, open shortest path first (OSPF) protocol messages, or border gateway protocol (BGP) protocol messages.
49. The network device according to any one of claims 35-48, characterized in that, Each of the plurality of identifiers has a length of 32 bits or 16 bits.
50. A network device located in a segmented routing (SR) network, characterized in that, The network device includes: The receiving unit is used to receive messages; A processing unit is configured to generate a message header and encapsulate the message header into the message. The message header includes a first pointer, a second pointer, and a list for processing the message. The list includes a plurality of identifiers arranged in sequence. The plurality of identifiers are mapped one-to-one to a plurality of segments in the SR network. The values of the first pointer and the second pointer together indicate the position of the first identifier among the plurality of identifiers in the list. The processing unit sends the message encapsulated with the message header.
51. The network device according to claim 50, characterized in that, The plurality of segments are mapped one-to-one to a plurality of segment identifiers, and the plurality of identifiers are mapped one-to-one to the plurality of segment identifiers. Each segment identifier in the plurality of segment identifiers includes a first part and a second part, wherein the first part precedes the second part. The first parts of all segment identifiers in the plurality of segment identifiers are the same, and each identifier in the plurality of identifiers includes the second part of the segment identifier to which each identifier is mapped.
52. The network device according to claim 51, characterized in that, The processing unit is further configured to use the second part of the segment identifier mapped to each of the plurality of segments as the identifier mapped to each segment to generate the list, and generate the message header according to the list.
53. The network device according to claim 51, characterized in that, The processing unit is further configured to receive the list, wherein each of the plurality of identifiers in the list includes a second part of the segment identifier to which the segment ...
54. The network device according to claim 51, characterized in that, The length of the first part is X bits, where X is an integer, greater than or equal to 1 and less than 128, and the length of each of the plurality of identifiers is 128-X bits.
55. The network device according to claim 51, characterized in that, The list does not include the first part.
56. The network device according to any one of claims 51-55, characterized in that, The message header also includes a destination address field. The processing unit is further configured to add the first part to the destination address field and copy the first identifier among the plurality of identifiers to the destination address field.
57. The network device according to claim 50 or 51, characterized in that, The list includes multiple identifiers arranged in sequence, specifically: The list includes at least one element arranged in sequence, the first element of the at least one element including at least two of the plurality of identifiers, the at least two identifiers being arranged in sequence, and the first identifier being one of the at least two identifiers; The values of the first pointer and the second pointer together indicate the position of the first identifier among the plurality of identifiers in the list, specifically: The value of the second pointer indicates the position of the first element in the list, and the value of the first pointer indicates the position of the first identifier within the first element.
58. The network device according to claim 57, characterized in that, The first pointer is included in the first of the at least two identifiers.
59. The network device according to claim 50 or 51, characterized in that, The list includes a first segment identifier that precedes the first identifier among the plurality of identifiers, the first segment identifier being mapped to a segment in the SR network, and the first segment identifier having a length of 128 bits.
60. The network device according to claim 59, characterized in that, The first segment identifier is adjacent to the first identifier among the plurality of identifiers. The first segment identifier includes a start mark, which is used to indicate that the next identifier in the list of the first segment identifier is the first identifier among the plurality of identifiers.
61. The network device according to claim 60, characterized in that, The first segment identifier includes a function field and a parameter field. The function field includes the start flag, and the parameter field includes the first pointer and a quantity flag, the quantity flag being used to indicate the quantity of the plurality of identifiers.
62. The network device according to claim 50 or 51, characterized in that, The list includes a second segment identifier, which follows the last identifier among the plurality of identifiers, and the first segment identifier maps to a segment in the SR network. The length of the first segment identifier is 128 bits.
63. The network device according to claim 62, characterized in that, The second segment identifier is adjacent to the last identifier among the plurality of identifiers, and the second segment identifier includes an end marker, which is used to indicate that the identifier preceding the second segment identifier in the list is the last identifier among the plurality of identifiers.
64. The network device according to claim 50, characterized in that, The plurality of segments are mapped one-to-one to a plurality of segment identifiers, and the plurality of identifiers are mapped one-to-one to the plurality of segment identifiers. Each segment identifier includes a first part, a second part, and a third part arranged in sequence, with the first part preceding the second part. The first parts of all segment identifiers in the plurality of segment identifiers are the same, and the third parts of all segment identifiers in the plurality of segment identifiers are the same. Each identifier in the plurality of identifiers includes the second part of the segment identifier to which each identifier is mapped.
65. The network device according to claim 64, characterized in that, The total length of the first part, the second part, and the third part is 128 bits.
66. The network device according to claim 64 or 65, characterized in that, The message header also includes a destination address field. The processing unit is further configured to add the first part and the third part to the destination address field, and copy the first identifier among the plurality of identifiers to the destination address field.
67. The network device according to any one of claims 64-66, characterized in that, The processing unit is further configured to send structural information to an intermediate network device, the structural information indicating the position where the first identifier is added in the destination address field.
68. The network device according to any one of claims 19 to 23, characterized in that, Each of the plurality of identifiers has a length of 32 bits or 16 bits.
69. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed on a processor, implements the method described in any one of claims 1-34.
70. A computer program product, characterized in that, The computer program product is stored in a memory, and when the computer program product is run on a processor, it implements the method described in any one of claims 1-34.
71. A network system, characterized in that, It includes a first network device and a second network device, wherein the first network device includes the network device according to any one of claims 35-49, and the second network device includes the network device according to any one of claims 50-68.