Message processing method, device and equipment, and storage medium
Patent Information
- Application Number
- CN202210743425.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-18
- Filing Date
- 2022-06-27
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2042-06-27
AI Technical Summary
然而,定长SID的方案中,SID在报文中占用的空间较大,导致报文开销较大
Smart Images

Figure CN116800662B_ABST
Abstract
Description
[0001] This application claims priority to Chinese Patent Application No. 202210270908.9, filed on March 18, 2022, entitled "A Method and Apparatus for Message Processing", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of network technology, and in particular to a message processing method, apparatus, device and storage medium. Background Technology
[0003] Segment routing (SR) is a technique for forwarding data packets based on source routing. The basic principle of segment routing is that the ingress node inserts a segment list into the data packet. The segment list includes a series of segment identifiers (segment IDs, SIDs), which explicitly indicates the nodes or links traversed by the forwarding path.
[0004] Currently, SIDs in messages are usually fixed-length, meaning the length of the SID is a constant. However, in fixed-length SID schemes, the SID occupies a large amount of space in the message, resulting in higher message overhead. Summary of the Invention
[0005] This application provides a message processing method, apparatus, device, and storage medium that can save message overhead. The technical solution is as follows.
[0006] Firstly, a message processing method is provided, the method comprising:
[0007] The forwarding device receives a first message. The destination address of the first message includes a first SID. The first message includes a first remaining segment, a first identifier, and a segment list. The first remaining segment is used to indicate the offset of the first SID in the segment list. The first SID includes a first parameter. The first identifier is used to identify that the SIDs in the segment list have different lengths.
[0008] The forwarding device obtains a second message based on the first message. The second message includes a second remaining segment determined based on the first remaining segment and the first parameter. The destination address of the second message includes a second SID, which is an SID determined based on the second remaining segment from the segment list included in the second message.
[0009] The forwarding device sends the second message based on the second SID.
[0010] Compared to the fixed-length SID method, the first method shortens the SID length instead of making it fixed, thus compressing the SID and consequently the segment list, thereby saving message overhead.
[0011] In some implementations, the first message further includes a segment length, the first parameter being used to indicate the multiple of the next SID of the first SID relative to the segment length.
[0012] The above implementation method allows for defining the length of the SID according to compression requirements, thereby supporting flexible compression schemes. Furthermore, it eliminates the need for control plane extension; the length of the SID can be obtained simply by reading the packet header from the data plane.
[0013] In some implementations, both the first message and the second message are unicast messages.
[0014] In some implementations, the first message further includes a segment routing header (SRH), which includes the first remaining segment, the first identifier, and the segment list.
[0015] In some implementations, the first message further includes a segment length, and the first SID further includes a second parameter, the first parameter indicating a multiple of the next SID of the first SID relative to the segment length, the second parameter indicating an offset of the next SID of the first SID relative to the first SID, and the second SID being an SID determined in the segment list based on the second remaining segment and the second parameter.
[0016] The above implementation method helps to locate a set of downstream nodes to which the replicated message needs to be forwarded, thereby supporting path programming in multicast scenarios.
[0017] In some implementations, both the first message and the second message are multicast messages.
[0018] In some implementations, the first message includes a multicast segment routing header (MRH), which includes the first remaining segment, the segment list, and the first identifier.
[0019] In some implementations, the segment length is less than 128 bits.
[0020] In some embodiments, before the forwarding device receives the first message, the method further includes:
[0021] The forwarding device receives a third message sent by the next-hop device. The third message includes the second SID and the flavor of the second SID, wherein the flavor identifies the compression method of the second SID.
[0022] Secondly, a message processing method is provided, the method comprising:
[0023] The forwarding device receives a first message. The destination address of the first message includes a first SID. The first message includes a segment length, a first remaining segment, a first identifier, and a segment list. The first remaining segment is used to indicate the offset of the first SID in the segment list. The first identifier is used to indicate that the SIDs in the segment list have the same length.
[0024] The forwarding device obtains a second message based on the first message. The second message includes the segment length, the second remaining segment, and the segment list. The second remaining segment is an offset determined based on the first remaining segment. The destination address of the second message includes a second SID, which is an SID determined based on the second remaining segment and the segment length from the segment list included in the second message.
[0025] The forwarding device sends the second message based on the second SID.
[0026] In the second approach, the segment length is shortened instead of being fixed at 128 bits, thus supporting a flexible compression scheme that helps reduce message overhead.
[0027] In some implementations, the segment length is less than 128 bits.
[0028] In some implementations, both the first message and the second message are unicast messages.
[0029] In some implementations, the first message further includes a segment routing header (SRH), the SRH including the segment length, the first remaining segment, a first identifier, and the segment list.
[0030] In some implementations, the first SID includes a first parameter indicating the offset of the next SID relative to the first SID, and the second SID is an SID determined in the segment list based on the second remaining segment, the first parameter, and the segment length.
[0031] In some implementations, both the first message and the second message are multicast messages.
[0032] In some implementations, the first message includes a multicast segment routing header (MRH), the MRH including the segment length, the first remaining segments, the segment list, and the first identifier.
[0033] Thirdly, a message processing apparatus is provided, which is disposed on a forwarding device according to the first aspect or any optional embodiment of the first aspect. The message processing apparatus includes at least one unit for implementing the method provided by the first aspect or any optional embodiment of the first aspect. In some embodiments, the unit in the message processing apparatus provided by the third aspect is implemented in software, and the unit in the message processing apparatus is a program module. In other embodiments, the unit in the message processing apparatus provided by the third aspect is implemented in hardware or firmware. Specific details of the message processing apparatus provided by the third aspect can be found in the first aspect or any optional embodiment of the first aspect described above, and will not be repeated here.
[0034] Fourthly, a message processing apparatus is provided, which is disposed on a forwarding device according to the second aspect or any optional embodiment of the second aspect. The message processing apparatus includes at least one unit for implementing the method provided by the second aspect or any optional embodiment of the second aspect. In some embodiments, the unit in the message processing apparatus provided by the fourth aspect is implemented in software, and the unit in the message processing apparatus is a program module. In other embodiments, the unit in the message processing apparatus provided by the fourth aspect is implemented in hardware or firmware. Specific details of the message processing apparatus provided by the fourth aspect can be found in the second aspect or any optional embodiment of the second aspect described above, and will not be repeated here.
[0035] Fifthly, a forwarding device is provided, comprising a processor coupled to a memory storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by the processor to enable the forwarding device to implement the method provided by the first aspect or any optional embodiment of the first aspect. Specific details of the forwarding device provided in the fifth aspect can be found in the first aspect or any optional embodiment of the first aspect, and will not be repeated here.
[0036] Sixthly, a forwarding device is provided, comprising a processor coupled to a memory storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by the processor to enable the forwarding device to implement the method provided in the second aspect or any alternative embodiment of the second aspect. Specific details of the forwarding device provided in the sixth aspect can be found in the second aspect or any alternative embodiment of the second aspect, and will not be repeated here.
[0037] In a seventh aspect, a forwarding device is provided, comprising: a main control board and an interface board, and further, a switching network board. The forwarding device is used to execute the methods of the first aspect or any possible implementation thereof. Specifically, the forwarding device includes units for executing the methods of the first aspect or any possible implementation thereof. In one possible implementation, an IPC channel is established between the main control board and the interface board, and the main control board and the interface board communicate with each other through the IPC channel.
[0038] Eighthly, a forwarding device is provided, comprising: a main control board and an interface board, and further, a switching network board. The forwarding device is used to execute the methods of the second aspect or any possible implementation thereof. Specifically, the forwarding device includes units for executing the methods of the second aspect or any possible implementation thereof. In one possible implementation, an IPC channel is established between the main control board and the interface board, and the main control board and the interface board communicate with each other through the IPC channel.
[0039] A ninth aspect provides a computer-readable storage medium storing at least one instruction that, when executed on a computer, causes the computer to perform the method provided in the first aspect or any alternative method of the first aspect.
[0040] In a tenth aspect, a computer-readable storage medium is provided, the storage medium storing at least one instruction that, when executed on a computer, causes the computer to perform the method provided in the second aspect or any alternative method of the second aspect.
[0041] Eleventhly, a computer program product is provided, the computer program product including one or more computer program instructions, which, when loaded and run by a computer, cause the computer to perform the method provided by the first aspect or any alternative method of the first aspect.
[0042] In a twelfth aspect, a computer program product is provided, the computer program product comprising one or more computer program instructions that, when loaded and run by a computer, cause the computer to perform the method provided in the second aspect or any alternative method of the second aspect.
[0043] In a thirteenth aspect, a chip is provided, including a memory and a processor, the memory for storing computer instructions, and the processor for calling and executing the computer instructions from the memory to perform the methods described in the first aspect and any possible implementation thereof.
[0044] In a fourteenth aspect, a chip is provided, including a memory and a processor, the memory for storing computer instructions and the processor for calling and executing the computer instructions from the memory to perform the method provided in the second aspect or any alternative method of the second aspect described above. Attached Figure Description
[0045] Figure 1 This is a schematic diagram of a unicast scenario provided in an embodiment of this application;
[0046] Figure 2 This is a schematic diagram of a multicast scenario provided in an embodiment of this application;
[0047] Figure 3 This is a flowchart of a message processing method provided in an embodiment of this application;
[0048] Figure 4 This is a schematic diagram of a SID structure provided in an embodiment of this application;
[0049] Figure 5 This is a schematic diagram of a message format provided in an embodiment of this application;
[0050] Figure 6 This is a flowchart of a SID notification method provided in an embodiment of this application;
[0051] Figure 7 This is a schematic diagram of a message format provided in an embodiment of this application;
[0052] Figure 8 This is a schematic diagram of a message format provided in an embodiment of this application;
[0053] Figure 9 This is a schematic diagram of a message format provided in an embodiment of this application;
[0054] Figure 10 This is a schematic diagram of the structure of a message processing device provided in an embodiment of this application;
[0055] Figure 11 This is a schematic diagram of the structure of a forwarding device provided in an embodiment of this application;
[0056] Figure 12 This is a schematic diagram of the structure of a forwarding device provided in an embodiment of this application. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0058] Unless otherwise stated, the terms "node" and "device" in this specification refer to the same concept. The device in this specification may optionally be a forwarding device. A forwarding device is a device whose primary function is to forward packets to other devices, such as a router or switch. Alternatively, the device in this specification may be a host or server.
[0059] The following are examples illustrating the application scenarios of embodiments of this application.
[0060] From the perspective of network communication methods, the application scenarios of this application include unicast and multicast scenarios; from the perspective of SID arrangement methods, the application scenarios of this application include mixed and non-mixed scenarios. Examples of unicast and multicast scenarios are given below in conjunction with (1) and (2), and examples of mixed and non-mixed scenarios are given in conjunction with (A) and (B).
[0061] (1) Unicast scenario
[0062] Figure 1 This is a schematic diagram of a unicast scenario provided in an embodiment of this application. Figure 1 The scenario shown includes an ingress node, intermediate nodes, and an egress node. The ingress node is equivalent to the entry point of the SR domain; it's used to add a Segment Routing Header (SRH) to the datagram. The ingress node is also called the entry node, header node, or start node. Intermediate nodes are the nodes that need to be traversed as indicated by the segment list in the SRH. Intermediate nodes are used to locate the next SID from the segment list and forward the packet to the next-hop node based on the next SID. The egress node is equivalent to the exit point of the SR domain; it's used to decapsulate the SRH and forward the datagram according to its destination address.
[0063] (2) Multicast scenario
[0064] Multicast, also known as point-to-multipoint (P2MP) communication, is used to forward data packets from one node to a group of nodes. Figure 2 This is a schematic diagram of a multicast scenario provided in an embodiment of this application. Figure 2The scenario shown includes an ingress node, intermediate node 1, intermediate node 2, exit node 3, exit node 4, exit node 5, and exit node 6. The ingress node is equivalent to the entry point of the multicast domain, or the root node of the multicast tree. The ingress node is used to add a Multicast Routing Header (MRH) to data packets, replicate the packet containing the MRH to obtain two packets, forward one copy to intermediate node 1, and forward the other copy to intermediate node 2.
[0065] Intermediate nodes are the nodes that need to be traversed as indicated by the segment list in the MRH. Intermediate node 1 receives packets sent by the ingress node and locates the SIDs of exit nodes 3 and 4 from the packet's segment list. Intermediate node 1 replicates the packet to obtain two copies. Based on the SID of exit node 3, intermediate node 1 forwards one copy of the packet to exit node 3; based on the SID of exit node 4, intermediate node 1 forwards the other copy of the packet to exit node 4. Intermediate node 2 receives packets sent by the ingress node and locates the SIDs of exit nodes 5 and 6 from the packet's segment list. Intermediate node 1 replicates the packet to obtain two copies. Based on the SID of exit node 5, intermediate node 1 forwards one copy of the packet to exit node 5; based on the SID of exit node 6, intermediate node 1 forwards the other copy of the packet to exit node 6. Egress nodes 3, 4, 5, and 6 are equivalent to the exit points of the multicast domain, or the leaf nodes of the multicast tree. Egress nodes are used to decapsulate MRHs and forward data packets according to their destination address.
[0066] In multicast scenarios, when a message is replicated and forwarded from one upstream node to multiple downstream nodes, it can be understood that a parent-child relationship has been established between the upstream node and the multiple downstream nodes. To distinguish the roles of the nodes, the term "parent node" will be used to describe the node that replicates the message, and "child node" will be used to describe the node that receives the replicated message. For example, combining... Figure 2 In the scenario shown, the entry node has a parent-child relationship with intermediate nodes 1 and 2. Among these three nodes, the entry node is the parent of both intermediate nodes 1 and 2, and both intermediate nodes 1 and 2 are children of the entry node. Similarly, intermediate node 1 has a parent-child relationship with exit nodes 3 and 4. In this scenario, intermediate node 1 is the parent of both exit nodes 3 and 4, and both exit nodes 3 and 4 are children of intermediate node 1. A child node of a parent node can also be considered the next-hop node of that parent node.
[0067] (A) Mixed Scene
[0068] Mixed encoding refers to a segment list containing SIDs of various lengths. A typical mixed encoding scenario is a segment list containing compressed and uncompressed SIDs, such as a segment list containing 32-bit SIDs and 128-bit SIDs. For example, combining... Figure 1 In the scenario shown, a mixed-format scenario could be where the SID length of an intermediate node in a segment list differs from the SID length of an exit node. For example, combining... Figure 2 As shown in the scenario, a mixed-format scenario could be where the length of the SID of intermediate node 1 in the segment list is different from the length of the SID of intermediate node 2. Another example is that the length of the SID of intermediate node 1 in the segment list is different from the length of the SID of exit node 3 and the length of the SID of exit node 4.
[0069] (B) Non-mixed programming scenarios
[0070] Non-mixed encoding means that each SID in a segment list has the same length. For example, combining... Figure 1 In the scenario shown, a non-mixed programming scenario can be one where the length of the SID of the entry node, the length of the SID of the intermediate node, and the length of the SID of the exit node are all the same in the segment list.
[0071] The technical solutions of the embodiments of this application are illustrated below based on the above network scenario, including two main parts: data plane solution and control plane solution.
[0072] Figure 3 This is a flowchart of a message processing method provided in an embodiment of this application. Figure 3 The method shown is an example illustrating a data plane scheme. Figure 3 The method shown includes the following steps S301 to S309. Figure 3 The interactive entities of the method shown include an entry node, an intermediate node, and an exit node, all of which can be forwarding devices.
[0073] For example, Figure 3 The method shown is used in unicast scenarios, for example, Figure 3 The network scenario on which the method shown is based is as described above. Figure 1 As shown. For example, combined with Figure 1 Let's take a look. Figure 3 The entry node in the method shown is Figure 1 The entry node in Figure 3The intermediate node in the method shown is Figure 1 The middle node in Figure 3 The exit node in the method shown is Figure 1 The exit node in the process. Or Figure 3 The method shown is used in multicast scenarios, for example, Figure 3 The network scenario on which the method shown is based is as described above. Figure 2 As shown. For example, combined with Figure 2 Let's take a look. Figure 3 The entry node in the method shown is Figure 2 The entry node in the middle, when Figure 3 The intermediate node in the method shown is Figure 2 The middle node 1 in the middle, then Figure 3 The exit node in the method shown is Figure 2 The exit node 3 or exit node 4 in the process. When Figure 3 The intermediate node in the method shown is Figure 2 The middle node 2 in the middle, then Figure 3 The exit node in the method shown is Figure 2 The exit node is either 5 or 6.
[0074] Step S301: The entry node receives the data packet.
[0075] The data packets mentioned in the embodiments of this application are also called service packets. For example, in Figure 1 In the scenario shown, the data packets received by the ingress node are unicast packets. Figure 2 In the scenario shown, the data packets received by the ingress node are multicast packets. For example, in this embodiment of the application, the data packets are Internet Protocol version 4 (IPv4) packets or Internet Protocol version 6 (IPv6) packets.
[0076] Step S302: The entry node obtains the first message based on the data message.
[0077] The payload of the first message includes a data packet, and the destination address (DA) of the first message includes the first SID. The first message includes information added by the ingress node. The information added by the ingress node is explained below, see (1) to (4) below.
[0078] (1) First identifier
[0079] For example, the first flag is used to indicate whether the SIDs in the segment list have the same length; that is, the first flag is used to indicate whether the code is mixed. For example, the first flag can take the values of a first value and a second value. When the first flag is the first value, it indicates that the SIDs in the segment list have different lengths, meaning the segment list uses a mixed code mode. When the first flag is the second value, it indicates that the SIDs in the segment list have the same length, meaning the segment list uses a non-mixed code mode. Optionally, the first flag can be specifically represented by a 1-bit flag. When the flag bit is 1, that is, the flag bit is set, it indicates that the SIDs in the segment list have different lengths; when the flag bit is 0, that is, the flag bit is not set (set to 0), it indicates that the SIDs in the segment list have the same length. Here, 1 is an example of the first value, and 0 is an example of the second value.
[0080] For example, the way the first identifier is carried in the first message includes the following possible implementations. In some implementations, the segment routing header of the first message includes the first identifier. Optionally, the flag field of the segment routing header includes the first identifier. Alternatively, the type length value (TLV) field of the segment routing header includes the first identifier, or other idle fields include the first identifier. This embodiment does not limit the carrying position of the first identifier. For example, in a unicast scenario, the SRH of the first message includes the first identifier; in a multicast scenario, the MRH of the first message includes the first identifier.
[0081] (2) Segment length
[0082] For example, segment length is used to indicate the unit length of compression. The value of segment length includes several possibilities. In some implementations, segment length is less than 128 bits. Optionally, segment length is an integer multiple of 8 bits. For example, segment length can be 8 bits, 16 bits, 32 bits, or 64 bits. Designing it as an integer multiple of 8 bits facilitates byte alignment and provides better scalability. For example, a segment length of 32 bits is consistent with the length of an MPLS label or IPv4 address, thus being more hardware-friendly; alternatively, segment length can be 20 bits or 10 bits. In other implementations, segment length is greater than 128 bits; in still other implementations, segment length is equal to 128 bits. The value of segment length can be defined as needed; this embodiment does not limit the value of segment length.
[0083] The length of the SID in the segment list is related to the segment length mentioned above. For example, the length of the SID in the segment list is the same as the segment length, or the length of the SID in the segment list is n times the segment length, where n is an integer greater than or equal to 1. For example, if the segment length is 16 bits, then the length of the SID in the segment list can be any of 16 bits, 32 bits, 48 bits, 64 bits, 80 bits...128 bits. By designing the length of the SID in the segment list to be an integer multiple of the segment length, each offset is a fixed amount (i.e., an integer multiple of the segment length), avoiding the implementation difficulties caused by fully variable-length compression. Here, fully variable-length compression means that the amount of each offset can be any integer.
[0084] The relationship between the length of different SIDs in the segment list and the multiple of the aforementioned segment length can vary. For example, in a non-mixed encoding scenario, the length of each SID in the segment list is the same as a multiple of the segment length. For instance, the segment length is 16 bits, and each SID in the segment list is 16 bits long; or the segment length is 16 bits, and each SID in the segment list is 32 bits long (twice the segment length). However, in a mixed encoding scenario, the length of each SID in the segment list is not entirely the same as a multiple of the aforementioned segment length. For instance, the segment length is 16 bits, and one SID in the segment list is 16 bits long (twice the segment length), while another SID in the segment list is 32 bits long (twice the segment length).
[0085] Defining the segment length in a message allows for the definition of the SID length based on compression requirements, thus supporting flexible, variable-length compression schemes. Furthermore, it eliminates the need for control plane extensions; the SID length can be obtained simply by reading the message header from the data plane. This flexibility manifests in two ways. First, the SID length in different messages, or different segment lists, can be specified using different segment lengths, supporting different messages with different SID lengths, or different segment lists using different compression methods. In an exemplary scenario, when the payload data volume in the forwarded message is large (e.g., forwarding video traffic), the header overhead requirement is usually low, allowing for a relatively long segment length (SID). Conversely, when the payload data volume in the forwarded message is small (e.g., forwarding industrial control messages), the header overhead requirement is usually high, allowing for a relatively short segment length (SID). Industrial control messages refer to messages transmitted between instruments, controllers, servo motors, and other devices in an industrial field network during communication. In summary, the segment length in packets for different services can be flexibly defined according to their compression requirements. Secondly, it supports different SID lengths within the same segment list. In one exemplary scenario, a segment list includes a series of compressed SIDs and one uncompressed SID. For example, the last SID in the segment list might be a 128-bit Virtual Private Network (VPN) SID, and each SID before the last one in the segment list is a compressed SID. In another exemplary scenario, a forwarding path traverses networks that support SID compression while others do not. Considering this scenario, the segment list includes both compressed and uncompressed SIDs. Based on the method of this embodiment, the multiples of different SIDs relative to the segment length in the segment list can be different. The length of each SID in the segment list can be indicated by the segment length and the multiple of the SID relative to the segment length (optionally determined by parameters in the SID), thus supporting different SID lengths within the same segment list.
[0086] In some implementations, the segment length can be determined through control plane configuration or protocol interaction before being carried in data plane packets. For example, by extending the control plane, when flooding SIDs between forwarding devices via the IGP protocol, the IGP packet not only carries the SID but also adds a field indicating the segment length corresponding to the SID. Another example is when the controller issues an SR policy via the Border Gateway Protocol (BGP) SR policy, the segment length is carried in the SR policy. As an alternative, the segment length can be statically configured on the forwarding device; this embodiment does not limit how the device obtains the segment length.
[0087] The placement of the segment length in the first packet can be implemented in various ways. In some implementations, the segment routing header of the first packet includes the segment length. For example, in a unicast scenario, the SRH of the first packet includes the segment length; in a multicast scenario, the MRH of the first packet includes the segment length.
[0088] (3) Remaining segment (segment left, SL)
[0089] For example, `segment left` acts as a pointer to determine the next SID in the segment list. In other words, `segment left` indicates the position of the next SID in the segment list so that it can be used as the destination address. If the IPv6 protocol is used, the next SID can be used as the destination address in the IPv6 header.
[0090] For example, in a unicast scenario, the packet forwarding path is: ingress node → first intermediate node → second intermediate node → third intermediate node → egress node. Here, the first intermediate node is the next-hop node of the ingress node, the second intermediate node is the next-hop node of the first intermediate node, the third intermediate node is the next-hop node of the second intermediate node, and the egress node is the next-hop node of the third intermediate node. In this scenario, the operation process for each node regarding the segment left is as follows: The ingress node sends a packet in which the segment left points to the SID of the first intermediate node on the forwarding path, and the destination address of the packet includes the SID of the first intermediate node. After receiving the packet, the first intermediate node updates the segment left, making the updated segment left point to the SID of the second intermediate node on the forwarding path. The first intermediate node then locates the SID of the second intermediate node based on the updated segment left, updates the destination address of the packet based on the SID of the second intermediate node, and forwards the packet. After receiving the packet, the second intermediate node updates the segment left, which points to the SID of the third intermediate node on the forwarding path. The second intermediate node locates the SID of the third intermediate node based on the updated segment left, updates the destination address of the packet based on the SID of the third intermediate node, and forwards the packet. This process continues. After receiving the packet, the third intermediate node updates the segment left, which points to the SID of the egress node. The third intermediate node obtains the SID of the egress node based on the updated segment left, updates the destination address of the packet based on the SID of the egress node, and forwards the packet. When the egress node receives the packet, it updates the segment left. The updated segment left is usually 0, which means that the packet has passed through all the nodes and links indicated by the segment list and has reached the end of the forwarding path.
[0091] In some implementations, the counting unit (or offset bit unit) of segment left is the segment length mentioned above. For example, the value of segment left represents the multiple of the total length of the remaining SIDs in the segment list relative to the segment length. For example, the total length of the remaining SIDs in the segment list is the product of the value of segment left and the segment length. For example, if a node decrements segment left by one, it means that it needs to offset segment length bits in the segment list to locate the next SID; if a node decrements segment left by k, it means that it needs to offset k * segment length bits in the segment list to locate the next SID, where k is a positive integer. For example, if the value of segment left in the received packet is x, and the length of the next SID of the current SID is k times the segment length, then the node updates the value of segment left to xk, and starts from the current SID in the segment list, offsets k * segment length bits, and updates the destination address field with the found next SID.
[0092] The `segment left` is used to locate SIDs using a one-dimensional array, reducing the complexity of SID location. Specifically, in Generalized SRv6 (G-SRv6) technology, a SID is located using a two-dimensional array (segment left and SID index), and the control plane is required to announce the length of the compressed SID. During forwarding, a 128-bit segment is first located in the segment list based on the `segment left`, and then a compressed SID within that 128-bit segment is located based on the SID index and the length of the compressed SID, resulting in high complexity in locating compressed SIDs. This embodiment, by providing the aforementioned `segment left`, eliminates the need for the SID index compared to G-SRv6 technology; the location of the SID can be indicated solely by the `segment left`, thus reducing complexity.
[0093] (4) segment list
[0094] The segment list is used to indicate forwarding paths. The segment list includes at least one SID. Each SID in the segment list identifies a node or link on the forwarding path. The SIDs in the segment list can be of several types. Optionally, the SIDs in the segment list can be compressed SIDs. Alternatively, the SIDs in the segment list can be full SIDs.
[0095] A complete SID refers to a SID with a length of 128 bits. The data structure of a complete SID is as follows: Figure 4 As shown in (a), a complete SID typically includes a locator, a function, and at least one argument. The locator identifies a node in the network (usually the node that publishes the SID) to guide data packet forwarding to that node. The locator can be further divided into B:N. B identifies the SID Block, generally assigned to a subnet by the operator; B is also the common prefix of the SID. N represents the node ID, which is an identifier used to distinguish nodes within a subnet. The function indicates the forwarding action to be performed by the node. The arguments are optional parts of the SID.
[0096] A compressed SID refers to a SID with a shortened length, i.e., a SID shorter than 128 bits. A compressed SID is typically the portion remaining after removing common parts from a complete SID. For example, considering that different SIDs in a segment list may contain common parts (i.e., identical content between different SIDs, such as a common prefix), these common parts are redundant. These common parts can be extracted, retaining only the parts that differ from other SIDs, and this is used as the compressed SID. In this way, redundant information in the segment list is removed, achieving segment list compression. Since the segment list is usually the longest part of the packet header, compressing the segment list also compresses the packet header, reducing packet overhead.
[0097] Optionally, the data structure of the compressed SID is as follows: Figure 4As shown in (b), the compressed SID consists of three parts: node ID, function, and arguments. Compared to compression schemes that extract arguments as a common part, this approach preserves the arguments within the compressed SID, making it suitable for situations where the arguments in each SID change. For example, in multicast scenarios, the SID typically needs to carry the replication number and pointer parameters to indicate the multicast path; therefore, by leaving the arguments uncompressed, multicast programming can be supported.
[0098] In some implementations, the SID arguments include a length argument. The length argument indicates the length of the next SID. For example, the length argument indicates a multiple of the next SID's length relative to the segment length. For instance, a segment list includes a first SID and a second SID, where the second SID is the next SID after the first SID. The first SID includes a first parameter, which is a length argument indicating a multiple of the second SID's length relative to the segment length. For example, if the length argument of the first SID is n, it means the length of the second SID is n times the segment length, where n is a positive integer. By designing a length argument, this approach is suitable for mixed-code scenarios, allowing the device to accurately determine the exact number of bits in the next SID's length, thus reducing complexity by eliminating the need to announce the SID's length through control plane extension.
[0099] Optionally, in a multicast scenario, a SID includes a set of length arguments, which indicate the length of each SID in the next set of SIDs. For example, the next set of SIDs for the first SID includes the second SID and the third SID. The length arguments for the first SID include a first length argument and a second length argument. The first length argument indicates that the length of the second SID is a first multiple of the segment length, and the second length argument indicates that the length of the third SID is a second multiple of the segment length. The next-hop nodes of the node corresponding to the first SID include the nodes corresponding to the second SID and the nodes corresponding to the third SID.
[0100] The encoding of SIDs carrying length arguments in the segment list can be implemented in several ways. Optionally, each SID in the segment list carries a length argument. For example, in a mixed-encoding scenario, each SID in the segment list may optionally carry a length argument, and the value of the length argument may differ for different SIDs. For instance, the length argument value of the first SID in the segment list might be n1, the length argument value of the second SID might be n2, the length argument value of the third SID might be n3, thus indicating that the length of the second SID is n1 times the segment length, the length of the third SID is n2 times the segment length, the length of the fourth SID is n3 times the segment length, and so on. Alternatively, the length arguments can be carried by the first SID to the second-to-last SID in the segment list, while the last SID in the segment list does not need to carry a length argument. In addition, in non-mixed programming scenarios, SIDs may optionally not carry a length argument; or, in non-mixed programming scenarios, each SID in the segment list carries a length argument, and the length argument in each SID has the same value.
[0101] The method described above, which involves carrying a length argument in the SID to indicate the length of the next SID, is one option for determining the SID length. In other implementations, the length of the next SID is indicated by extending the control plane. For example, when the controller issues an SR policy via a BGP SR policy, the SR policy carries a segment list, along with the length of each SID in the segment list.
[0102] In some implementations, the arguments section of the SID (e.g.) Figure 4The `arguments` field in the multicast configuration includes a replication number and a pointer to support message replication and forwarding in multicast scenarios. The replication number indicates the number of copies of a message, i.e., how many times the parent node should copy the message. For example, if the replication number in a SID is `r`, it means there are `r` child nodes. This indicates that when the node corresponding to that SID (i.e., the parent node) receives a multicast message, it should copy the message `r-1` times to obtain `r` copies, and then forward these `r` copies to the `r` child nodes. The pointer indicates the position of the SID of the first child node in the segment list. For example, the first SID includes a second parameter, which is a pointer. This second parameter indicates the offset of the next SID relative to the first SID. Typically, in a multicast tree, the SIDs of a group of child nodes of the same parent node are arranged consecutively in the segment list. Therefore, based on the pointer and replication number, the position of the SID of each child node in a group of child nodes can be located. For example, if the replication number in the SID of the destination address indicates that it needs to be replicated r-1 times to obtain r copies of the packet, and the pointer value of the SID in the destination address is p, then the node updates the destination address of the first replicated packet based on the SID located in segment list [p], and forwards the first replicated packet according to the SID located in segment list [p]. The node updates the destination address of the second replicated packet based on the SID located in segment list [p-1], and forwards the second replicated packet according to the SID located in segment list [p-1]. This operation is repeated until all r replicated packets have been forwarded. Here, p is a positive integer, and the maximum value of p is the ratio of the length of the segment list to the segmentlength.
[0103] The pointer and segment length mentioned above can be used in combination. In one possible implementation, the parent node determines the positional offset between the SIDs of adjacent child nodes in a group of child nodes based on the segment length. For example, the positional offset between the SIDs of adjacent child nodes in a group of child nodes of the same parent node is the segment length. For example, the parent node first determines the position of the SID of the first child node based on the product of the pointer and the segment length. Then, the parent node starts from the SID of the first child node and offsets by segment length bits to determine the position of the SID of the second child node; then, the parent node starts from the SID of the second child node and offsets by segment length bits to determine the position of the SID of the third child node, and so on. Through the above implementation method, in a multicast scenario, on the one hand, it can accurately locate the receiving end of a group of replicated packets (i.e., the group of child nodes mentioned above), so that the segment list accurately represents the multicast tree; on the other hand, it supports flexible variable length of SIDs, improving the flexibility of the SID length used by nodes in the multicast tree.
[0104] The pointer and length argument mentioned above can be used together. The length argument, for example, is carried in the arguments field of the SID. In one possible implementation, the parent node determines the position of the SID of the next child node based on the segment length and the length argument in the SID of a child node. For example, in a group of child nodes of the same parent node, the positional offset between the SID of the next child node and the SID of the previous child node is the product of the length argument in the SID of the previous child node and the segment length. For example, a parent node may have a set of child nodes including a first child node, a second child node, and a third child node. The length argument in the SID of the first child node indicates that the length of the SID of the second child node is m times the segment length, and the length argument in the SID of the second child node indicates that the length of the SID of the second child node is q times the segment length. After locating the SID of the first child node, the parent node offsets from the SID of the first child node by segment length * m bits to determine the location of the SID of the second child node. Then, the parent node offsets from the SID of the second child node by segment length * q bits to determine the location of the SID of the third child node, and so on. This implementation supports multicast mixed-editing scenarios, allowing different nodes in a multicast tree to use SIDs of different lengths, such as the parent node using a different SID length than the child nodes, or different child nodes using different SID lengths.
[0105] In some implementations, a new flavor is added to the SID to support compression methods. For example, the SID flavor includes a compression method flavor, which identifies the compression method of the SID. Alternatively, the SID flavor includes a mixed flavor and a non-mixed flavor. The mixed flavor SID indicates that the SIDs in the segment list have different lengths, meaning the segment list uses a mixed format. The non-mixed flavor SID indicates that the SIDs in the segment list have the same length, meaning the segment list uses a non-mixed format.
[0106] For example, the ingress node encapsulates a segment routing header on the outer layer of the datagram to obtain a first packet including the datagram and the segment routing header. In some implementations, the ingress node also encapsulates an IPv6 basic header on the outer layer of the segment routing header to obtain a first packet including the datagram, the segment routing header, and the IPv6 basic header. The segment routing header includes segmentlength, first segment left, first identifier, and segment list. The destination address in the IPv6 basic header includes a first SID. In unicast scenarios, the segment routing header is, for example, an SRH. In multicast scenarios, the segment routing header is, for example, an MRH.
[0107] Step S303: The entry node sends the first message based on the first SID.
[0108] Step S304: The intermediate node receives the first message.
[0109] Step S305: The intermediate node obtains the second message based on the first message.
[0110] This embodiment relates to the process of intermediate nodes updating the segment left and the SID in the destination address. For clarity, "first segment left" describes the segment left in a packet received by an intermediate node, and "second segment left" describes the segment left in a packet sent by the same intermediate node. Similarly, "first SID" describes the SID included in the destination address of a packet received by an intermediate node, and "second SID" describes the SID included in the destination address of a packet sent by the same intermediate node. The first SID identifies an intermediate node. The second SID is the next SID after the first SID. The second SID identifies the next-hop node of the intermediate node.
[0111] In some implementations, the basic process for intermediate nodes to forward packets is as follows: After receiving a packet, if the first SID included in the packet's destination address is the node's own SID, the intermediate node locates the next SID from the segment list, updates the packet's destination address using the next SID, and then looks up the IPv6 forwarding table based on the updated destination address to forward the packet. In multicast scenarios, intermediate nodes may duplicate the packet multiple times and forward each duplicate packet in a similar manner.
[0112] There are multiple ways to locate the next SID in an intermediate node. The following examples illustrate four scenarios for implementing this method. See Scenario 1 through Scenario 4 below.
[0113] Scenario 1: Unicast Non-Mixed
[0114] Scenario 1 includes the following scenarios (1-1) and (1-2).
[0115] Scenario (1-1) is unicast, and the length of each SID in the segment list is the segment length.
[0116] In scenario (1-1), the intermediate node determines the next SID by subtracting one from segment left. In pseudocode, subtracting one from segment left can be represented as segment left--. Subtracting one from segment left is equivalent to shifting the segment left pointer by one bit so that it points to the next SID. For example, the second segment left is one bit less than the first segment left. Here, subtracting one from segment left means that the number of bits shifted is segment length. For example, starting from the position pointed to by the first segment left (the position of the first SID), shifting by segment length bits, the second SID is found.
[0117] Scenario (1-2) is unicast, and the length of each SID in the segment list is n times the segment length, and the length of each SID in the segment list is the same multiple of the segment length.
[0118] In scenario (1-2), the intermediate node determines the next SID based on segment left minus n. For example, the second segment left is n less than the first segment left. Here, segment left minus n means that the number of bits offset is the product of segment length and n. For example, starting from the position pointed to by the first segment left (the position of the first SID), the second SID is found by offsetting segment length * n bits. The length of the SID in the segment list relative to the segment length, i.e., the value of n, can be determined by the length argument in the SID, or by static configuration, or by a pre-issued SR policy. This embodiment does not limit this.
[0119] Scenario 2: Multicast Non-Mixed Editing
[0120] Scenario 2 includes the following scenarios (2-1) and (2-2).
[0121] Scenario (2-1) Multicast, and the length of each SID in the segment list is the segment length.
[0122] In scenario (2-1), the intermediate node determines the position of the SID of its first child node based on the pointer value in the first SID. It then determines the position of the SID of its second child node by subtracting one from the pointer value in the first SID, and so on, subtracting two from the pointer value in the first SID. Here, subtracting one from the pointer value represents the number of bits offset, which is equal to the segment length.
[0123] Scenario (2-2) multicast, where the length of each SID in the segment list is n times the segment length, and the length of each SID in the segment list is the same multiple of the segment length.
[0124] Taking a scenario where a node replicates a packet twice, resulting in three packets, and then forwards them to three other nodes as an example, the intermediate node determines the position of the SID of its first child node based on the pointer in the first SID. It then determines the position of the SID of its second child node by subtracting 'n' from the pointer in the first SID, and finally determines the position of the SID of its third child node by subtracting 2n from the pointer in the first SID. Here, subtracting 'n' from the pointer indicates that the offset in bits is n times the segment length.
[0125] Scenario 3: Unicast Mixed Programming
[0126] For example, the segment list includes a first SID, a second SID, and a third SID. The first SID identifies the first intermediate node, the second SID identifies the second intermediate node, and the third SID identifies the third intermediate node. The second intermediate node is the next-hop node of the first intermediate node, and the third intermediate node is the next-hop node of the second intermediate node. The length argument value of the first SID is n1, and the length argument value of the second SID is n2. The first intermediate node, based on the first SID, subtracts n1 from the left side of the first segment to obtain the left side of the second segment. The first intermediate node determines the second SID based on the left side of the second segment so that the packet can be forwarded to the second intermediate node based on the second SID. The second intermediate node, based on the second SID, subtracts n2 from the left side of the second segment to obtain the left side of the third segment. The second intermediate node determines the third SID based on the left side of the third segment so that the packet can be forwarded to the third intermediate node based on the third SID. Here, subtracting n1 from the left side of the segment means that the offset in bits is n1 times the segment length, and subtracting n2 from the left side of the segment means that the offset in bits is n2 times the segment length.
[0127] Scenario 4: Multicast Mixing
[0128] Let's illustrate this with an example where a node replicates a packet twice to obtain three copies, which are then forwarded to three other nodes. For instance, the segment list includes a first SID, a second SID, a third SID, and a fourth SID. The first SID identifies the first intermediate node, the second SID identifies the second intermediate node, the third SID identifies the third intermediate node, and the fourth SID identifies the fourth intermediate node. The first intermediate node is the parent node, responsible for replicating the packet twice to obtain three copies, which are then forwarded to the second, third, and fourth intermediate nodes respectively. The second, third, and fourth intermediate nodes are all child nodes of the first intermediate node, receiving the replicated packets sent by the first intermediate node. For example, the first SID might include a pointer, and the length argument value within the first SID might include n1, n2, and n3, indicating that the length of the second SID is n1 times the segment length, the length of the third SID is n2 times the segment length, and the length of the fourth SID is n3 times the segment length. The first intermediate node determines the second SID by subtracting n1 from the pointer in the first SID, so that the first replicated packet can be forwarded to the second intermediate node based on the second SID. The first intermediate node determines the third SID by subtracting (n1+n2) from the pointer in the first SID, so that the second replicated packet can be forwarded to the third intermediate node based on the third SID. The first intermediate node determines the fourth SID by subtracting (n1+n2+n3) from the pointer in the first SID, so that the third replicated packet can be forwarded to the fourth intermediate node based on the fourth SID.
[0129] In a unicast scenario, when the next-hop node of an intermediate node is an egress node, the intermediate node reads the first identifier from the first packet. If the lengths of the SIDs in the first identifier segment list of the first packet are not the same, the intermediate node subtracts the first parameter (length argument) from the first SID to obtain the second segmentleft. Based on the second segmentleft, the intermediate node determines the egress node's SID from the segment list of the first packet and updates the destination address accordingly. If the lengths of the SIDs in the first identifier segment list of the first packet are the same, the intermediate node subtracts 1 from the first segmentleft to obtain the second segmentleft. Based on the second segmentleft, the intermediate node determines the egress node's SID from the segment list of the first packet and updates the destination address accordingly.
[0130] In a multicast scenario, when the next-hop node of an intermediate node is an egress node, the intermediate node reads the first identifier from the first packet. If the lengths of the SIDs in the first identifier segment list of the first packet are not the same, the intermediate node updates the first segment left with the difference between the second parameter (pointer) and the first parameter (length argument) in the first SID to obtain the second segment left. Based on the second segment left, the intermediate node determines the SID of the egress node from the segment list of the first packet and updates the destination address accordingly. If the lengths of the SIDs in the first identifier segment list of the first packet are the same, the intermediate node updates the first segment left with the second parameter (pointer) in the first SID to obtain the second segment left. Based on the second segment left, the intermediate node determines the SID of the egress node from the segment list of the first packet and updates the destination address accordingly.
[0131] There are several implementation methods for intermediate nodes to determine whether a scenario is mixed or non-mixed. In some implementations, the intermediate node determines whether it is a mixed or non-mixed scenario based on the value of a first identifier. For example, the intermediate node reads the first identifier from the first packet; when the first identifier has a first value, it is determined to be a mixed scenario, i.e., the SIDs in the segment list of the first packet have different lengths; when the first identifier has a second value, it is determined to be a non-mixed scenario, i.e., the SIDs in the segment list of the first packet have the same length. In other implementations, the intermediate node determines whether it is a mixed or non-mixed scenario based on the flavor of the SID. For example, the intermediate node determines the flavor of the first SID; when the flavor of the first SID is a mixed flavor, the intermediate node determines that it is a mixed scenario; when the flavor of the first SID is a non-mixed flavor, it determines that it is a non-mixed scenario.
[0132] There are various implementation methods for intermediate nodes to determine whether a scenario is unicast or multicast. In some implementations, the intermediate node determines whether it is a unicast or multicast scenario based on the type of the segment routing header. For example, the intermediate node determines whether the segment routing header type is SRH or MRH based on the Next Header field in the previous header. If the Next Header field in the previous header indicates that the segment routing header type is SRH, then it is determined to be a unicast scenario; if the Next Header field in the previous header indicates that the segment routing header type is MRH, then it is determined to be a multicast scenario.
[0133] Step S306: The intermediate node sends a second message based on the second SID.
[0134] Step S307: The exit node receives the second message.
[0135] Step S308: The exit node obtains the data packet based on the second message.
[0136] The egress node reads the destination address of the second packet to obtain the second SID. The egress node determines that the second SID is its own SID. In a multicast scenario, the egress node reads the pointer in the second SID. If the egress node determines that the pointer it reads is 0 or a default value, it determines that it is the last-hop node and then removes the MRH from the second packet to obtain the data packet. In a unicast scenario, the egress node reads the segment left in the second packet, decrements the segment left value by one, and if the egress node determines that the decremented segment left value is 0, it determines that it is the last-hop node and then removes the SRH from the second packet to obtain the data packet.
[0137] Step S309: The exit node sends a data packet.
[0138] The method provided in this embodiment, compared to the fixed-length SID scheme, shortens the length of the SID, thus achieving SID compression and consequently segment list compression, thereby saving message overhead.
[0139] The following provides examples of the message formats provided in the embodiments of this application.
[0140] Figure 5 This is a schematic diagram of the message format provided in the embodiments of this application, such as... Figure 5 As shown, a new type of routing header (RH) is defined, which includes a new segment length field and a segment left field with new meaning.
[0141] Specifically, a `segment length` field is defined in the routing header, indicating the length of the SID. In mixed-format scenarios, the length of the SID in the segment list is equal to the segment length, or a multiple of the segment length. The value of `segments left` originally meant the number of remaining segments; in this embodiment, `segments left` means the "length of the remaining segment list," which is represented by a multiple of the "segment length." Each time `segment left` is offset, the offset is equal to the segment length. This embodiment defines a new type of compressed SID, collectively referred to as a specified compressed SID (S-SID). Each S-SID contains three parts: node ID, function, and arguments. Arguments are not extracted as a common part. S-SIDs have two types: non-mixed flavor S-SIDs, used for segments in the segment list with the same length; and mixed flavor S-SIDs, used for segments in the segment list with different lengths. A length argument is included to specify the length of the next segment. A mixing flag is defined in the flag field. A mixing flag value of 0 indicates that segments in the segment list have the same length, while a mixing flag value of 1 indicates that segments in the segment list have different lengths. Figure 5 The message format shown is illustrated, and the message processing flow of the intermediate nodes is as follows.
[0142] If the intermediate node reads the DA field in the IPv6 header and the DA field matches the local data, then it executes any one of the following methods (1) to (3).
[0143] Method (1) When the mixing flag is 0 and it is unicast, and the mixing flag in RH is 0 (not set), the intermediate node performs the following operations: update segment left to segment left--; the unit offset of segment left is segment length; replace the last segment length bit in DA with segment list[SL]; forward according to the replaced DA.
[0144] Method (2) When the mixing flag is 0 and it is multicast, and the mixing flag in RH is 0 (not set), the intermediate node performs the following operations: update segment left to the pointer value in the current SID; the unit offset of segment left is segment length; replace the last segment length bit in DA with segment list[segment left]; forward according to the replaced DA.
[0145] Method (3) When the mixed-up flag is 1, the intermediate node performs the following operations: update segment left to (segment left - length argument); replace the last segment length * length argument in the DA with the SID at the position of (segment left - length argument) * segment length; and forward according to the replaced DA.
[0146] Figure 6 This is a flowchart of a SID notification method provided in an embodiment of this application. Figure 6 The method shown is an example illustrating the control surface scheme. Figure 6 The method shown includes the following steps S401 to S403.
[0147] Step S401: The intermediate node generates an announcement message.
[0148] The announcement message is used to publish the SID of intermediate nodes. The announcement message includes the SID and its flavor. In some implementations, the SID flavor indicates whether the SID has a mixed flavor or a non-mixed flavor. In other implementations, the SID flavor indicates the compression method of the SID. Optionally, the announcement message is an IGP message. For example, the announcement message is an IS-IS message or an OSPF message. For instance, the announcement message includes an SRv6 SID sub TLV, which includes an endpoint behavior field and a SID field. The endpoint behavior field carries the SID flavor, and the SID field carries the SID value.
[0149] Step S402: The intermediate node sends an announcement message to the entry node.
[0150] Step S403: The entry node receives the notification message.
[0151] Step S404: The entry node obtains the SID and its flavor based on the announcement message.
[0152] The method provided in this embodiment publishes the SID itself and its flavor to other devices during the SID announcement process, thereby enabling devices to collect SIDs and their flavors and determine whether the SID has a mixed flavor or a non-mixed flavor.
[0153] The following four examples illustrate how to base... Figure 5 The message format shown is implemented Figure 3 The method shown is illustrated with examples. In the following examples, the mixed flag is... Figure 3 The method shown illustrates the first identifier. In the following examples, S-SID refers to... Figure 6 An example of SID is shown in the method.
[0154] Example 1 (Multicast without mixing)
[0155] Figure 2 This is a schematic diagram of the network scenario on which Example 1 is based. Figure 7 This is a schematic diagram of the encapsulation format of the multicast message sent by the ingress node in Example 1. In the multicast message sent by the ingress node, the segment length indicates the SID length as 32 bits, the mixing flag is 0, and segments left is 7. Based on Figure 7 The message format shown is illustrated, and the message processing flow for each node in Example 1 is as follows.
[0156] Ingress: The ingress determines that the destination address of the packet is the ingress's own SID (S-SID1), and the ingress determines that the mixing flag is 0, and the function of S-SID1 is End.RL; The first parameter value in S-SID1 is 2, which represents the replication number, i.e., the number of packets to be replicated. Therefore, the ingress replicates the packet to obtain two packets, namely Replicated Packet 1 and Replicated Packet 2; The second parameter value in S-SID1 is 6, which represents the pointer, i.e., the SL value of the first packet. Based on the pointer being 6, the ingress determines that the SID of intermediate node 1 is segment list[6], and determines that the SID of intermediate node 2 is segment list[5]. Therefore, the SL value of Replicated Packet 1 is 6, and the 32 bits after DA of Replicated Packet 1 are replaced with the S-SID2 of segment list[6]; The SL value of Replicated Packet 2 is (6-1) = 5, and the 32 bits after DA of Replicated Packet 2 are replaced with the S-SID3 of segment list[5]. Here, each offset of segment left corresponds to an offset of segment length, which is 32 bits.
[0157] Intermediate Node 1: Determines the destination address of the message as the SID of Intermediate Node 1, i.e., S-SID2, and Intermediate Node 1 determines the mixing flag to be 0; The function of S-SID2 is End.RL, the first parameter value of S-SID2 is 2, which represents the replication number, i.e. the number of message copies. Therefore, Intermediate Node 1 copies the message to obtain two messages, namely message copy one and message copy two; The second parameter value of S-SID2 is 4, which represents the pointer, i.e. the SL value of the first message. Intermediate Node 1 determines that the SID of the exit node 3 is segment list[4] based on the pointer being 4, and determines that the SID of the exit node 4 is segment list[3]. Therefore, the SL value of message copy one is 4, and the last 32 bits of the DA of message copy one are replaced with the S-SID4 of segment list[4]; The SL value of message copy two is (4-1)=3, and the last 32 bits of the DA of message copy two are replaced with segment The S-SID5 of list[3]. Here, each time segment left is offset, the segment length is offset by 32 bits.
[0158] Intermediate Node 2: Determines the destination address of the message as the SID of Intermediate Node 2, namely S-SID3, and Intermediate Node 2 determines the mixing flag to be 0, and the function of S-SID3 is End.RL; The first parameter value in S-SID3 is 2, which represents the replication number, i.e. the number of message copies. Therefore, Intermediate Node 2 copies the message to obtain two messages; The second parameter value in S-SID3 is 2, which represents the pointer, i.e. the SL value of the first message. Based on the pointer being 2, Intermediate Node 2 determines that the SID of the exit node 5 is segment list[2], and determines that the SID of the exit node 6 is segment list[1]. Therefore, the SL value of the copied message 1 is 2, and the last 32 bits of the DA of the copied message 1 are replaced with the S-SID6 of segment list[2]; The SL value of the copied message 2 is (2-1)=1, and the last 32 bits of the DA of the copied message 2 are replaced with the S-SID7 of segment list[1].
[0159] Egress nodes (nodes 3-6): Determine the destination address of the packet as its own SID, set the SID function to End.RL and set the mixing flag to 0; both parameters in S-SID are 0; determine it as the last hop and do not copy.
[0160] The method in Example 1 can support RH compression in multicast scenarios, reducing message overhead.
[0161] Example 2 (Unicast, Non-mixed)
[0162] Figure 8 This is a schematic diagram illustrating the encapsulation format of the unicast message sent out by the entry node in Example 1. For example... Figure 8 As shown, in the unicast message sent by the ingress node, segment length is used to indicate that the length of the SID is 32 bits, the mixing flag is 0, and segments left is 4.
[0163] based on Figure 8 The message format shown in Example 2 and the message processing flow for each node are as follows.
[0164] ingress: ingress determines the destination address of the packet as the SID of ingress, i.e., S-SID1, the function of S-SID1 is End, and the mixing flag is determined to be 0; segments left--=3, the last 32 bits of DA are replaced with segmentlist[3] as S-SID2; forwarding is performed according to the updated DA. Here, each time segment left is offset, the length of segmentlength is offset, i.e., 32 bits.
[0165] Intermediate Node 1: The destination address of the message is the SID of Intermediate Node 1, namely S-SID2. The function of S-SID2 is End, and the mixed encoding flag is determined to be 0; segments left--=2, the last 32 bits of DA are replaced with segment list[2] as S-SID3; forward according to the updated DA;
[0166] Here, each offset of segment left corresponds to an offset of segment length, which is 32 bits.
[0167] Intermediate Node 2: The destination address of the message is the SID of Intermediate Node 2, namely S-SID4, and the mixing flag is set to 0, and the function of S-SID4 is End; segments left--=1, and the last 32 bits of DA are replaced with segment list[1] as S-SID4; forwarding is performed according to the updated DA. Among them, Intermediate Node 2 is the next hop node of Intermediate Node 1.
[0168] Here, each offset of segment left corresponds to an offset of segment length, which is 32 bits.
[0169] Egress node: segments left == 1, indicating that the egress node has been reached.
[0170] The method provided in Example 2 allows for flexible definition of compression length without relying on the control plane.
[0171] Example 3 (Unicast Mixed Programming)
[0172] Figure 9 This is a schematic diagram illustrating the encapsulation format of the multicast message sent out by the ingress node in Example 1. For example... Figure 9 As shown, in the unicast message sent by the ingress node, segment length is used to indicate that the length of the SID is 32 bits, the mixing flag is 1, and segments left is 7.
[0173] based on Figure 9 The message format shown is illustrated, and the message processing flow for each node in Example 3 is as follows.
[0174] ingress: ingress determines the destination address of the packet as the SID of ingress, i.e. S-SID1, and determines the mixing flag as 1, and the function of S-SID1 as End; segments left-1=6, the last 32 bits of DA are replaced with segment list[6] as S-SID2; forward according to the updated DA; here, each time segment left is offset, the length of segment length is offset by 32 bits.
[0175] Intermediate Node 1: The destination address of the message is the SID of Intermediate Node 1, namely S-SID2, and the mixed encoding flag is determined to be 1, and the function of S-SID2 is End; segments left-1=5, the last 32 bits of DA are replaced with segment list[5] as S-SID3; forward according to the updated DA; here, each time segment left is offset, the length of segment length is offset by 32 bits.
[0176] Intermediate Node 2: The destination address of the message is the SID of Intermediate Node 2, i.e., S-SID3, and the mixing flag is set to 1. The function of S-SID3 is End; segments left-4=1, and the last 32 bits of DA are replaced with segment list[4-1] as VPN SID; forward according to the updated DA; here, each time segment left is offset, the segment length is offset by 32 bits.
[0177] egress: segments left == 1, reaching the egress node.
[0178] Example 4 (Multicast Mixing)
[0179] The processing flow and encapsulation format of Example 4 are similar to those of Example 1 (multicast without mixed encoding). The main difference between Example 4 and Example 1 is that each SID carries an additional parameter indicating that the length of the next SID is a multiple of the segment length, that is, the length of the next SID is N*segment length, which is used to indicate mixed encoding.
[0180] The method provided in Example 4 supports uncompressed arguments and enables multicast programming.
[0181] In summary, the methods provided in the above examples can define the compression length in the message directly according to the compression requirements without going through the control plane configuration. In addition, it supports flexible variable-length message compression; in addition, it does not require control plane extension; in addition, the message content can be parsed; and in addition, the arguments in the SID can be compressed.
[0182] Figure 10 This is a schematic diagram of the structure of a message processing apparatus 700 provided in an embodiment of this application. The message processing apparatus 700 includes a receiving unit 701, an obtaining unit 702, and a sending unit 703. Optionally, in conjunction with the attached diagram... Figure 1 or Figure 2 From the network environment shown, Figure 10 The message processing device 700 shown is located in Figure 1 or Figure 2 The entry node, intermediate node, or tail node in the table. Optionally, it can be combined with the appendix. Figure 3 From the method flow shown, in some implementations, Figure 10 The message processing device 700 shown is located in Figure 3 In the intermediate node, receiving unit 701 is used to execute S304, obtaining unit 702 is used to execute S305, and sending unit 703 is used to execute S306. In other embodiments, Figure 10 The message processing device 700 shown is located in Figure 3 In the entry node, receiving unit 701 is used to execute S301, obtaining unit 702 is used to execute S302, and sending unit 703 is used to execute S303. In other embodiments, Figure 10 The message processing device 700 shown is located in Figure 3 In the exit node, receiving unit 701 is used to execute S307, obtaining unit 702 is used to execute S308, and sending unit 703 is used to execute S309.
[0183] Figure 10 The described device embodiments are merely illustrative. For example, the division of the units described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The functional units in the various embodiments of this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0184] Each unit in the message processing device 700 is implemented, in whole or in part, through software, hardware, firmware, or any combination thereof.
[0185] The following section, in conjunction with the forwarding device 800 described later, describes some possible implementation methods of the various functional units in the message processing device 700 using hardware or software.
[0186] In the case of software implementation, for example, the aforementioned obtaining unit 702 is... Figure 11 The software functional unit generated by at least one processor 801 reads the program code stored in memory 802 and implements it.
[0187] In the case of hardware implementation, for example, Figure 10 The aforementioned units are implemented by different hardware components in the forwarding device. For example, the acquisition unit 702 is implemented by... Figure 11 At least a portion of the processing resources of at least one processor 801 (e.g., one or two cores of a multi-core processor) are used, or are implemented by... Figure 11 The remaining processing resources in at least one processor 801 (e.g., other cores in a multi-core processor), or programmable devices such as field-programmable gate arrays (FPGAs) or coprocessors, are used to complete the process. The receiving unit 701 and the transmitting unit 703 are... Figure 11 The network interface is implemented in 803.
[0188] Figure 11 This is a schematic diagram of the structure of a forwarding device 800 provided in an embodiment of this application. The forwarding device 800 includes at least one processor 801, a memory 802, and at least one network interface 803.
[0189] Optionally, in conjunction with the appendix Figure 1 or Figure 2 From the network environment shown, Figure 11 The relay device 800 shown is Figure 1 or Figure 2 The entry node, intermediate node, or tail node in the process.
[0190] Optionally, in conjunction with the appendix Figure 3 From the method flow shown, in some implementations, Figure 11 The relay device 800 shown is Figure 3 In the intermediate node, network interface 803 is used to execute S304, processor 801 is used to execute S305, and network interface 803 is used to execute S306. In other embodiments, Figure 11 The relay device 800 shown is Figure 3 In the entry node, network interface 803 is used to execute S301, processor 801 is used to execute S302, and network interface 803 is used to execute S303. In other embodiments, Figure 11 The relay device 800 shown is Figure 3 In the exit node, network interface 803 is used to execute S307, processor 801 is used to execute S308, and network interface 803 is used to execute S309. Combined Figure 4 From the method flow shown, processor 801 is used to execute S401 or S404, and network interface 803 is used to execute S402 or S403.
[0191] Processor 801 is, for example, a general-purpose central processing unit (CPU), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the embodiments of this application. For example, processor 801 includes application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. A PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0192] Memory 802 may be, for example, read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital universal discs, Blu-ray discs, etc.); magnetic disk storage media or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Optionally, memory 802 exists independently and is connected to processor 801 via internal connection 804. Alternatively, memory 802 and processor 801 may be integrated together.
[0193] Network interface 803 uses any transceiver-like device for communicating with other devices or communication networks. Network interface 803 includes, for example, at least one of a wired network interface or a wireless network interface. The wired network interface is, for example, an Ethernet interface. The Ethernet interface is, for example, an optical interface, an electrical interface, or a combination thereof. The wireless network interface is, for example, a wireless local area network (WLAN) interface, a cellular network interface, or a combination thereof.
[0194] In some embodiments, processor 801 includes one or more CPUs, such as Figure 11 CPU0 and CPU1 are shown in the diagram.
[0195] In some embodiments, the forwarding device 800 may optionally include multiple processors, such as Figure 11 The processors 801 and 805 shown are illustrated. Each of these processors is, for example, a single-core processor (CPU) or a multi-core processor (CPU). A processor here may optionally refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).
[0196] In some embodiments, the forwarding device 800 further includes an internal connection 804. The processor 801, memory 802, and at least one network interface 803 are connected via the internal connection 804. The internal connection 804 includes pathways for transmitting information between the aforementioned components. Optionally, the internal connection 804 is a single board or a bus. Optionally, the internal connection 804 may be divided into an address bus, a data bus, a control bus, etc.
[0197] In some embodiments, the forwarding device 800 further includes an input / output interface 806. The input / output interface 806 is connected to the internal connection 804.
[0198] Optionally, the processor 801 implements the method in the above embodiments by reading the program code 810 stored in the memory 802, or the processor 801 implements the method in the above embodiments by internally stored program code. When the processor 801 implements the method in the above embodiments by reading the program code 810 stored in the memory 802, the memory 802 stores program code that implements the method provided in the embodiments of this application.
[0199] For more details on how processor 801 implements the above functions, please refer to the descriptions in the previous method embodiments, which will not be repeated here.
[0200] See Figure 12 , Figure 12 This is a schematic diagram of a forwarding device provided in an embodiment of this application. The forwarding device 900 includes: a main control board 910 and an interface board 930.
[0201] Optionally, in conjunction with the appendix Figure 1 or Figure 2 From the network environment shown, Figure 11 The relay device 800 shown is Figure 1 or Figure 2 The entry node, intermediate node, or tail node in the process.
[0202] Optionally, in conjunction with the appendix Figure 3 From the method flow shown, in some implementations, Figure 11 The relay device 800 shown is Figure 3 The intermediate node in the process, interface board 930, is used to execute S304, S305, and S306. In other embodiments, Figure 11 The relay device 800 shown is Figure 3 The entry node, interface board 930, is used to execute S301, S302, and S303. In other embodiments, Figure 11 The relay device 800 shown is Figure 3 The export node, interface board 930, is used to execute S307, S308, and S309. Combined with... Figure 4According to the method flow shown, the main control board 910 is used to execute S401 or S404, and the interface board 930 is used to execute S402 or S403.
[0203] The main control board, also known as the main processing unit (MPU) or route processor card, is used to control and manage the various components in the forwarding device 900, including route calculation, device management, device maintenance, and protocol processing functions. The main control board 910 includes a central processing unit 911 and a memory 912.
[0204] Interface board 930, also known as line processing unit (LPU), linecard, or service board, provides various service interfaces and enables packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces, POS (packet over SONET / SDH) interfaces, and, for example, flexible Ethernet clients (FlexE clients). Interface board 930 includes: a central processing unit 931, a network processor 932, a forwarding table entry memory 934, and a physical interface card (PIC) 933.
[0205] The central processing unit 931 on the interface board 930 is used to control and manage the interface board 930 and communicate with the central processing unit 911 on the main control board 910.
[0206] The network processor 932 is used to implement packet forwarding processing. The network processor 932 may be in the form of a forwarding chip. Specifically, the network processor 932 forwards received packets based on the forwarding table stored in the forwarding table entry memory 934. If the destination address of the packet is the address of the forwarding device 900, the packet is sent to the CPU (such as the central processing unit 911) for processing; if the destination address of the packet is not the address of the forwarding device 900, the next hop and outgoing interface corresponding to the destination address are looked up in the forwarding table according to the destination address, and the packet is forwarded to the outgoing interface corresponding to the destination address. Uplink packet processing includes: packet ingress interface processing, forwarding table lookup; downlink packet processing includes forwarding table lookup, etc.
[0207] The physical interface card 933 is used to implement physical layer interfacing functions. Raw traffic enters the interface board 930 through this card, and processed packets are sent out from the physical interface card 933. The physical interface card 933, also called a daughter card, can be installed on the interface board 930. It is responsible for converting photoelectric signals into packets, performing validity checks on the packets, and forwarding them to the network processor 932 for processing. In some embodiments, the central processing unit can also perform the functions of the network processor 932, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for the network processor 932 in the physical interface card 933.
[0208] Optionally, the forwarding device 900 includes multiple interface boards. For example, the forwarding device 900 also includes an interface board 940, which includes a central processing unit 941, a network processor 942, a forwarding table entry memory 944, and a physical interface card 943.
[0209] Optionally, the forwarding device 900 also includes a switching fabric board 920. The switching fabric board 920 is also referred to, for example, as a switch fabric unit (SFU). In cases where the network device has multiple interface boards 930, the switching fabric board 920 is used to perform data exchange between the interface boards. For example, interface boards 930 and 940 communicate, for instance, through the switching fabric board 920.
[0210] The main control board 910 and the interface board 930 are coupled. For example, the main control board 910, interface boards 930 and 940, and the switching network board 920 communicate with each other via a system bus connected to the system backplane. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 910 and the interface board 930, and the main control board 910 and the interface board 930 communicate with each other through the IPC channel.
[0211] Logically, the forwarding device 900 includes a control plane and a forwarding plane. The control plane includes a main control board 910 and a central processing unit 931, while the forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 934, a physical interface card 933, and a network processor 932. The control plane performs functions such as router operation, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining the device's status. The control plane distributes the generated forwarding tables to the forwarding plane. In the forwarding plane, the network processor 932 looks up and forwards messages received by the physical interface card 933 based on the forwarding tables distributed by the control plane. The forwarding tables distributed by the control plane are stored, for example, in the forwarding table entry memory 934. In some embodiments, the control plane and the forwarding plane are completely separate and not on the same device.
[0212] The operation on interface board 940 is the same as that on interface board 930, and will not be described again for simplicity. It should be understood that the forwarding device 900 in this embodiment can correspond to the entry node, intermediate node or tail node in the above-described method embodiments. The main control board 910, interface board 930 and / or 940 in the forwarding device 900, for example, implement the functions and / or various steps implemented by the entry node, intermediate node or tail node in the above-described method embodiments, and will not be described again for simplicity.
[0213] A network device may have one or more main control boards, including primary and backup boards. It may also have one or more interface boards; the more powerful the network device's data processing capabilities, the more interface boards it provides. Each interface board may also have one or more physical interface cards. A switching board may or may not exist; multiple boards can share the load and provide redundancy. In a centralized forwarding architecture, the network device may not need a switching board, as the interface boards handle the entire system's business data processing. In a distributed forwarding architecture, the network device can have at least one switching board, enabling data exchange between multiple interface boards and providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a distributed architecture network device are greater than those of a centralized architecture device. Alternatively, the network device can also be a single board, without a switching board. The functions of the interface board and the main control board are integrated on this one board. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU to perform the combined functions. This type of device has lower data exchange and processing capabilities (e.g., low-end switches or routers). The specific architecture used depends on the specific network deployment scenario, and no restrictions are imposed here.
[0214] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0215] A references B, which means that A is the same as B or A is a simple variation of B.
[0216] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects, and should not be construed as indicating or implying relative importance. For example, "first SID" and "second SID" are used to distinguish different SIDs, not to describe a specific order of SIDs, and should not be construed as meaning that the first SID is more important than the second SID.
[0217] The information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0218] In this application, unless otherwise stated, "at least one" means one or more, and "multiple" means two or more. For example, multiple SIDs refer to two or more SIDs.
[0219] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0220] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A message processing method, characterized in that, The method includes: The forwarding device receives a first message. The destination address of the first message includes a first SID. The first message includes a segment length, a first remaining segment, a first identifier, and a segment list. The segment length is used to indicate the unit length of compression. The first remaining segment is used to indicate the offset of the first SID in the segment list. The first SID includes a first parameter. The first parameter is used to indicate the multiple of the next SID of the first SID relative to the segment length. The first identifier is used to identify whether the SIDs in the segment list have the same length. The forwarding device obtains a second message based on the first message. The second message includes a second remaining segment. The destination address of the second message includes a second SID. The second SID is an SID determined based on the second remaining segment in the segment list included in the second message. When the value of the first identifier is a first value, the first identifier is used to identify that the lengths of the SIDs in the segment list are different. The second remaining segment is determined based on the first remaining segment and the first parameter. The forwarding device sends the second message based on the second SID.
2. The method according to claim 1, characterized in that, Both the first message and the second message are unicast messages.
3. The method according to claim 1 or 2, characterized in that, The first message also includes a segment routing header (SRH), which includes the first remaining segment, the first identifier, and the segment list.
4. The method according to claim 1, characterized in that, The first SID further includes a second parameter, wherein the first parameter indicates the multiple of the next SID of the first SID relative to the segment length, and the second parameter indicates the offset of the next SID of the first SID relative to the first SID, and the second SID is an SID determined in the segment list based on the second remaining segment and the second parameter.
5. The method according to claim 4, characterized in that, Both the first message and the second message are multicast messages.
6. The method according to claim 4 or 5, characterized in that, The first message includes a multicast segment routing header (MRH), which includes the first remaining segment, the segment list, and the first identifier.
7. The method according to claim 1, 2, 4 or 5, characterized in that, The segment length is less than 128 bits.
8. The method according to claim 1, 2, 4 or 5, characterized in that, Before the forwarding device receives the first message, the method further includes: The forwarding device receives a third message sent by the next-hop device. The third message includes the second SID and the flavor of the second SID, wherein the flavor identifies the compression method of the second SID.
9. A message processing method, characterized in that, The method includes: The forwarding device receives a first message. The destination address of the first message includes a first SID. The first message includes a segment length, a first remaining segment, a first identifier, and a segment list. The segment length is used to indicate the unit length of compression. The first remaining segment is used to indicate the offset of the first SID in the segment list. The first SID includes a first parameter. The first parameter is used to indicate the multiple of the next SID of the first SID relative to the segment length. The first identifier is used to identify whether the SIDs in the segment list have the same length. The forwarding device obtains a second message based on the first message. The second message includes the segment length, the second remaining segment, and the segment list. The destination address of the second message includes a second SID, which is an SID determined based on the second remaining segment, the first parameter, and the segment length in the segment list included in the second message. When the value of the first identifier is the second value, the first identifier is used to identify that the SIDs in the segment list have the same length, and the second remaining segment is an offset determined based on the first remaining segment. The forwarding device sends the second message based on the second SID.
10. The method according to claim 9, characterized in that, The segment length is less than 128 bits.
11. The method according to claim 9 or 10, characterized in that, Both the first message and the second message are unicast messages.
12. The method according to claim 9 or 10, characterized in that, The first message also includes a segment routing header (SRH), which includes the segment length, the first remaining segment, the first identifier, and the segment list.
13. The method according to claim 9, characterized in that, Both the first message and the second message are multicast messages.
14. The method according to claim 9 or 13, characterized in that, The first message includes a multicast segment routing header (MRH), which includes the segment length, the first remaining segments, the segment list, and the first identifier.
15. A message processing apparatus, characterized in that, The device includes: A receiving unit is configured to receive a first message, the destination address of which includes a first SID, the first message including a segment length, a first remaining segment, a first identifier, and a segment list, wherein the segment length is used to indicate the unit length of compression, the first remaining segment is used to indicate the offset of the first SID in the segment list, the first SID includes a first parameter, the first parameter being used to indicate the multiple of the next SID of the first SID relative to the segment length, and the first identifier being used to identify whether the SIDs in the segment list have the same length. The obtaining unit is configured to obtain a second message based on the first message, the second message including a second remaining segment, the destination address of the second message including a second SID, the second SID being an SID determined based on the second remaining segment in the segment list included in the second message; when the value of the first identifier is a first value, the first identifier is used to identify that the lengths of the SIDs in the segment list are different, and the second remaining segment is determined based on the first remaining segment and the first parameter; The sending unit is used to send the second message based on the second SID.
16. The apparatus according to claim 15, characterized in that, Both the first message and the second message are unicast messages.
17. The apparatus according to claim 15 or 16, characterized in that, The first message also includes a segment routing header (SRH), which includes the first remaining segment, the first identifier, and the segment list.
18. The apparatus according to claim 15, characterized in that, The first SID further includes a second parameter, wherein the first parameter indicates the multiple of the next SID of the first SID relative to the segment length, and the second parameter indicates the offset of the next SID of the first SID relative to the first SID, and the second SID is an SID determined in the segment list based on the second remaining segment and the second parameter.
19. The apparatus according to claim 18, characterized in that, Both the first message and the second message are multicast messages.
20. The apparatus according to claim 18 or 19, characterized in that, The first message includes a multicast segment routing header (MRH), which includes the first remaining segment, the segment list, and the first identifier.
21. The apparatus according to claim 15, 16, 18 or 19, characterized in that, The segment length is less than 128 bits.
22. The apparatus according to claim 15, 16, 18 or 19, characterized in that, The device further includes: The receiving unit is configured to receive a third message sent by the next-hop device, the third message including the second SID and the flavor of the second SID, the flavor identifying the compression method of the second SID.
23. A message processing apparatus, characterized in that, The device includes: A receiving unit is configured to receive a first message, the destination address of which includes a first SID, the first message including a segment length, a first remaining segment, a first identifier, and a segment list, wherein the segment length is used to indicate the unit length of compression, the first remaining segment is used to indicate the offset of the first SID in the segment list, the first SID includes a first parameter, the first parameter being used to indicate the multiple of the next SID of the first SID relative to the segment length, and the first identifier being used to identify whether the SIDs in the segment list have the same length. The obtaining unit is configured to obtain a second message based on the first message, the second message including the segment length, the second remaining segment, and the segment list, the destination address of the second message including a second SID, the second SID being an SID determined based on the second remaining segment, the first parameter, and the segment length in the segment list included in the second message; when the value of the first identifier is a second value, the first identifier is used to identify that the SIDs in the segment list have the same length, and the second remaining segment is an offset determined based on the first remaining segment; The sending unit is used to send the second message based on the second SID.
24. The apparatus according to claim 23, characterized in that, The segment length is less than 128 bits.
25. The apparatus according to claim 23 or 24, characterized in that, Both the first message and the second message are unicast messages.
26. The apparatus according to claim 23 or 24, characterized in that, The first message also includes a segment routing header (SRH), which includes the segment length, the first remaining segment, the first identifier, and the segment list.
27. The apparatus according to claim 23, characterized in that, Both the first message and the second message are multicast messages.
28. The apparatus according to claim 23 or 27, characterized in that, The first message includes a multicast segment routing header (MRH), which includes the segment length, the first remaining segments, the segment list, and the first identifier.
29. A relay device, characterized in that, The forwarding device includes a processor coupled to a memory, the memory storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by the processor to enable the forwarding device to implement the method of any one of claims 1-14.
30. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction that, when executed on a computer, causes the computer to perform the method as described in any one of claims 1 to 14.
Citation Information
Patent Citations
Method, device and system for forwarding message
CN113824638A