A method, device and system for forwarding a message
By mixing and orchestrating compressed segment identifiers of different lengths in the segment list, the efficiency reduction problem caused by excessive length of the segment identifier list is solved, and more efficient network transmission and processing is achieved.
Patent Information
- Application Number
- CN202010923722.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-06-18
- Filing Date
- 2020-09-04
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2040-09-04
AI Technical Summary
The length of the segment identification list leads to reduced network transmission efficiency and processing efficiency.
The compressed segment identifiers of different lengths are arranged using mixed arrangements, and the length of the segment list is shortened by generating a segment list containing the first type and the second type of compressed segment identification.
It improves network transmission efficiency and processing efficiency, is compatible with the forwarding mechanism of SRv6 network, and simplifies network deployment.
Smart Images

Figure CN113824638B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a method, device and system for forwarding messages in a segment routing (SR) network. Background Art
[0002] SR is a protocol designed based on the concept of source routing to forward packets on the network. It supports explicit specification of the packet forwarding path at the source node. When SR is deployed on the Internet Protocol Version 6 (IPv6) data plane, it is called IPv6 segment routing (SRv6). SRv6 extends the segment routing header (SRH) based on IPv6.
[0003] SRH includes a segment list, also called a segment identifier list (SID list). The SID list includes multiple segment identifiers (SIDs) arranged in sequence, each representing multiple segments, and each segment is an instruction or instruction set for processing a message. SRH is encapsulated in a message, and the segment identifier list therein carries the SR network's processing of the message. The length of each SID in the SRv6 network is 128 bits (bits). For each additional SID in the SID list, the length of the SRH will increase by 128 bits, and the length of the message will also increase by 128 bits. On the one hand, the increase in message length will cause a large amount of network resources, such as bandwidth, to be occupied during the forwarding process. For example, when the message processing process includes 100 segments, the SRH needs to include 100 SIDs, and the length of the SID list is as long as 1600 bytes. The length of the SID list is too long, which reduces the efficiency of message transmission in the SR network. On the other hand, the excessive length of the SRH will increase the difficulty of message processing. For example, the length of the message window that a network device reads at one time is limited, such as 128 bytes. If the length of the SRH is 1600 bytes, it will far exceed the length of the message window that can be read at one time. The entire SRH reading process requires multiple reading operations to complete, increasing the difficulty of message processing. Summary of the invention
[0004] A method, device and system for forwarding a message are provided to solve the technical problem that the network transmission efficiency and processing efficiency are reduced due to the excessive length of the segment identification list.
[0005] In a first aspect, a method for forwarding a message is provided. The method comprises: a first network device generates a message, the message comprises a segment list corresponding to a forwarding path of the message, the segment list comprises a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers comprises a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; the first network device sends the message according to the segment list.
[0006] The execution subject of the method may be an ingress device of a message forwarding path. In the segment list corresponding to the forwarding path, a compressed segment identifier with a first length may be referred to as a first type of compressed segment identifier, and a compressed segment identifier with a second length may be referred to as a second type of compressed segment identifier, and the first length is smaller than the second length. Through this method, the segment list may be mixed with compressed segment identifiers of different lengths, which may further shorten the length of the segment list and improve network efficiency.
[0007] In a possible implementation, the first length is X times the unit length, and the second length is Y times the unit length, where X and Y are both integers. That is, the first length and the second length are both integer multiples of the unit length.
[0008] In a possible implementation, the unit length is equal to the first length. That is, the second length is an integer multiple of the first length.
[0009] In a possible implementation, the unit length is 2 to the Nth power bits, where N is an integer greater than or equal to 3 and less than 7. For example, the unit length may be 8 bits, 16 bits, or 32 bits.
[0010] In a possible implementation, the first length is 16 bits, and the second length is 32 bits.
[0011] When the first length and the second length satisfy the above relationship, they can be more compatible with the forwarding mechanism of the SRv6 network and simplify network deployment.
[0012] In one possible implementation, the second type of compressed segment identifier includes a global link compressed segment identifier, and the global link compressed segment identifier indicates that a specific network device on the forwarding path forwards the message through a specific link. The second type of compressed segment identifier with a longer length can be used for the global END.X, that is, the global link compressed segment identifier, so that when planning the network, the global link compressed segment identifier can be planned separately, for example, the length of the global link compressed segment identifier is planned to be 32 bits, and the length of the global node compressed segment identifier is planned to be 16 bits, thereby further shortening the length of the global node compressed segment identifier, and then shortening the length of the entire segment list.
[0013] In a possible implementation, the global link compression segment identifier includes a node part and a link part, the node part is used to identify a node, the link part is used to identify a link, the length of the node part is the same as the first length, and the length of the link part is the same as the first length. The node part may be a global node compression segment identifier, and the link part may be a local link compression segment identifier, that is, the global link compression segment identifier is composed of a global node compression segment identifier and a local link compression segment identifier. Thus, the logical association between identifiers is increased, which facilitates network planning.
[0014] In a possible implementation, the compression segment identifier further includes a third type of compression segment identifier, the length of the third type of compression segment identifier is a third length, the third length is greater than the first length, and the third length is less than the second length. That is, the length types of the compression segment identifier can be two or more.
[0015] In a possible implementation, the segment list includes an element with a length of 128 bits, and the element includes the first type of compressed segment identifier and the second type of compressed segment identifier. That is, the first type of compressed segment identifier and the second type of compressed segment identifier can be included in the same element.
[0016] In a possible implementation, the segment list further includes at least one of the following identifiers: an Internet Protocol version 6 segment routing SRv6 segment identifier with a length of 128 bits, a multi-protocol label switching MPLS label, and an Internet Protocol version 4 IPv4 address. The method is also applicable to a SRv6 network with a mixed path, for example, the segment list may also include a 128-bit SID, an MPLS label, or an IPv4 address.
[0017] In a possible implementation, the compressed segment identifier includes a first compressed segment identifier, and the first compressed segment identifier is used to indicate whether the next identifier after the first compressed segment identifier in the segment list is the compressed segment identifier; wherein the first compressed segment identifier belongs to the first type of compressed segment identifier, or the first compressed segment identifier belongs to the second type of compressed segment identifier. The compressed segment identifier may carry compression continuation information, and the compression continuation information is used to indicate that the next identifier after the current compressed segment identifier in the segment list is still the compressed segment identifier.
[0018] In a possible implementation, the function field of the first compressed segment identifier is used to indicate whether the latter identifier is the compressed segment identifier, or one or more bits in the first compressed segment identifier are used to indicate whether the latter identifier is the compressed segment identifier. Optionally, compression continuation information can be carried in the function field of the compressed segment identifier. For example, when the function field of the compressed segment identifier corresponds to a specific type of flavor, it indicates that the compressed segment identifier carries compression continuation information. Optionally, one or more bits can also be divided in the compressed segment identifier to carry compression continuation information.
[0019] In a possible implementation, the message header of the message includes a first pointer and a second pointer, the value of the first pointer is used to indicate the position of a compressed segment identifier among the multiple compressed segment identifiers in an element with a length of 128 bits, and the value of the second pointer is used to indicate the position of the element in the segment list; or, the message header of the message includes a first pointer, and the value of the first pointer is used to indicate the position of a compressed segment identifier among the multiple compressed segment identifiers in the segment list. The segment list including the compressed segment identifier can use a two-dimensional pointer or a one-dimensional pointer.
[0020] In a possible implementation, the value of the first pointer is M, where M is a value obtained by dividing 128 bits by the unit length, or M is a value obtained by dividing the sum of the lengths of all elements in the segment list by the unit length, where the length of the element is 128 bits. At an ingress device of a forwarding path, the value of the first pointer is set to an initial value. When the segment list adopts a two-dimensional pointer, the initial value of the first pointer is a value obtained by dividing 128 bits by the unit length, and when the segment list adopts a one-dimensional pointer, the initial value of the first pointer is a value obtained by dividing the sum of the lengths of all elements in the segment list by the unit length.
[0021] In a possible implementation manner, the method further includes: the first network device determining the forwarding path; and the first network device generating the segment list corresponding to the forwarding path.
[0022] In a possible implementation manner, the method further includes: the first network device receiving the segment list from a controller in the network.
[0023] The forwarding path may be generated by an ingress device of the forwarding path, or may be generated by a controller in the network.
[0024] In a possible implementation, a prefix of a segment identifier corresponding to the first type of compressed segment identifier is the same as a prefix of a segment identifier corresponding to the second type of compressed segment identifier. The first type of compressed segment identifier and the second type of compressed segment identifier are located in the same SRv6 compression subpath.
[0025] In the second aspect, a method for forwarding a message is provided. The method includes: a first network device receives a first message, the first message includes a segment list corresponding to a forwarding path of the first message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; the first network device determines that the content of the destination address field of the message header of the first message matches the local segment identifier; in response to determining that the content of the destination address field matches the local segment identifier, the first network device determines the content to be copied in the segment list according to the indication of the local segment identifier; the first network device copies the content to be copied to the destination address field to generate a second message; the first network device sends the second message.
[0026] The execution subject of the method may be other network devices except the ingress device on the message forwarding path. In the segment list corresponding to the forwarding path, the compressed segment identifier with a first length may be called a first type of compressed segment identifier, and the compressed segment identifier with a second length may be called a second type of compressed segment identifier, and the first length is smaller than the second length. In the method, the network device determines the content to be copied in the segment list according to the indication of the local segment identifier, so as to adapt to the compressed segment identifiers of different lengths mixed and arranged in the segment list.
[0027] In a possible implementation, the first network device determines the content to be copied in the segment list according to the indication of the local segment identifier, including: the first network device determines the position of the content to be copied in the segment list according to the length indicated by the local segment identifier; the first network device determines the content to be copied according to the position of the content to be copied in the segment list. The network device determines the position of the content to be copied in the segment list according to the length indicated by the local segment identifier, so that when compressed segment identifiers of different lengths are mixed and arranged in the segment list, the position of the content to be copied in the segment list can still be determined.
[0028] In a possible implementation, the message header of the first message includes a first pointer and a second pointer; the first network device determines the position of the to-be-copied content in the segment list according to the length indicated by the local segment identifier, including: the first network device determines the value of the first pointer according to the length indicated by the local segment identifier; the first network device determines the position of the to-be-copied content in an element with a length of 128 bits according to the value of the first pointer, and the element is included in the segment list; the first network device determines the position of the element in the segment list according to the value of the second pointer. When the segment list adopts a two-dimensional pointer, the first network device determines the value of the first pointer according to the length indicated by the local segment identifier.
[0029] In a possible implementation, the header of the first message includes a first pointer; the first network device determines the position of the to-be-copied content in the segment list according to the length indicated by the local segment identifier, including: the first network device determines the value of the first pointer according to the length indicated by the local segment identifier; the first network device determines the position of the to-be-copied content in the segment list according to the value of the first pointer. When the segment list adopts a one-dimensional pointer, the first network device determines the value of the first pointer according to the length indicated by the local segment identifier.
[0030] In a possible implementation, the length indicated by the local segment identifier is an integer multiple of the length of the first type of compressed segment identifier, and the first network device determines the value of the first pointer according to the length indicated by the local segment identifier, including: the first network device reads the original value of the first pointer in the message header of the first message; the first network device subtracts the update value from the original value of the first pointer to obtain the value of the first pointer, wherein the update value is equal to the multiple value obtained by dividing the length indicated by the local segment identifier by the length of the first type of compressed segment identifier. For example, the length indicated by the local segment identifier may be the length of the first type of compressed segment identifier, and the update value is 1; or, the length indicated by the local segment identifier may be the length of the second type of compressed segment identifier, and the update value is 2.
[0031] In a possible implementation, the length indicated by the local segment identifier is the length of the first compressed segment identifier, the first compressed segment identifier is included in the destination address field of the message header of the first message, and the first compressed segment identifier is the compressed segment identifier corresponding to the local segment identifier. In other words, the length indicated by the local segment identifier is the length of the compressed segment identifier in the segment list corresponding to the local segment identifier.
[0032] In a possible implementation manner, the message header of the second message includes the value of the first pointer.
[0033] In a possible implementation, the local segment identifier is used to indicate whether the content to be copied includes the compressed segment identifier. When the content to be copied includes the compressed segment identifier, the first network device copies the content to be copied to the destination address field to generate a second message, including: after the first network device copies the content to be copied to the field containing the prefix in the destination address field, the length of the content to be copied is the same as the length of the second type of compressed segment identifier; when the content to be copied does not include the compressed segment identifier, the first network device copies the content to be copied to the destination address field to generate a second message, including: the first network device copies the content to be copied to the destination address field, and the length of the content to be copied is 128 bits. The local segment identifier can carry compression continuity information, which is used to indicate that the identifier corresponding to the local segment identifier in the segment list is still the compressed segment identifier after the identifier in the segment list, that is, whether the content to be copied includes the compressed segment identifier. When the content to be copied includes the compressed segment identifier, the length of the content to be copied is determined according to the length of the compressed segment identifier with a longer length, that is, the length of the content to be copied is the same as the length of the compressed segment identifier of the second type; when the content to be copied does not include the compressed segment identifier, that is, the content to be copied is a SID with a length of 128 bits, then the length of the content to be copied is 128 bits.
[0034] In a possible implementation, before the first network device copies the content to be copied to the destination address field to generate the second message, the method further includes: the first network device determines whether the content to be copied includes the compressed segment identifier; when the first network device determines that the content to be copied includes the compressed segment identifier, the first network device copies the content to be copied to the destination address field to generate the second message, including: after the first network device copies the content to be copied to the field containing the prefix in the destination address field, the length of the content to be copied is the same as the length of the compressed segment identifier of the second type; when the first network device determines that the content to be copied does not include the compressed segment identifier, the first network device copies the content to be copied to the destination address field to generate the second message, including: the first network device copies the content to be copied to the destination address field, and the length of the content to be copied is 128 bits. When the current identifier is the last sub-element in the element, the first network device parses part of the content of the next element in the segment list, that is, the first network device parses the content to be copied. When the content to be copied includes the compressed segment identifier, the length of the content to be copied is determined according to the length of the compressed segment identifier with a longer length, that is, the length of the content to be copied is the same as the length of the compressed segment identifier of the second type; when the content to be copied does not include the compressed segment identifier, that is, the content to be copied is a SID with a length of 128 bits, then the length of the content to be copied is 128 bits.
[0035] In a possible implementation, the content to be copied includes a first identifier, and the length of the content to be copied is greater than or equal to the length of the first identifier; wherein the first identifier corresponds to the next-hop network device of the first network device on the forwarding path, or the first identifier corresponds to the link of the next-hop network device. That is, the first identifier is the identifier in the segment list that follows the identifier in the segment list corresponding to the local segment identifier. The length of the content to be copied may be the same as the length of the second type of compressed segment identifier, then the length of the content to be copied is greater than or equal to the length of the first identifier. For example, when the first identifier belongs to the first type of compressed segment identifier, the length of the content to be copied is greater than the length of the first identifier.
[0036] In a third aspect, a method for sending a segment list is provided. The method includes: a first network device determines a forwarding path of a message; the first network device generates the first segment list corresponding to the forwarding path, the first segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length.
[0037] The execution subject of the method may be an ingress device of a message forwarding path or a controller in a network. In the segment list corresponding to the forwarding path, a compressed segment identifier with a first length may be referred to as a first type of compressed segment identifier, and a compressed segment identifier with a second length may be referred to as a second type of compressed segment identifier, and the first length is smaller than the second length. Through this method, the segment list may be mixed with compressed segment identifiers of different lengths, which may further shorten the length of the segment list and improve network efficiency.
[0038] In one possible implementation, the first network device generates a first segment list corresponding to the forwarding path, including: the first network device obtains a second segment list corresponding to the forwarding path, the second segment list includes multiple segment identifiers arranged in sequence, and the length of each segment identifier in the multiple segment identifiers is 128 bits; the first network device generates the first segment list based on the second segment list.
[0039] In one possible implementation, the prefix in each of the multiple segment identifiers is the same, and the first network device generates the first segment list based on the second list, including: the first network device deletes the prefix of each of the multiple segment identifiers respectively to generate each compressed segment identifier in a plurality of compressed segment identifiers, each of the multiple compressed segment identifiers respectively includes the node identifier of each segment identifier in the multiple segment identifiers, and the multiple compressed segment identifiers include the compressed segment identifier of the first type and the compressed segment identifier of the second type.
[0040] In one possible implementation, the first network device generates the first segment list corresponding to the forwarding path, including: the first network device obtains the multiple compressed segment identifiers based on the multiple segment identifiers, and the length of each segment identifier in the multiple segment identifiers is 128 bits; the first network device generates the first segment list based on the multiple compressed segment identifiers.
[0041] In one possible implementation, the prefix in each of the multiple segment identifiers is the same, and the first network device obtains the multiple compressed segment identifiers based on the multiple segment identifiers, including: the first network device deletes the prefix of each of the multiple segment identifiers respectively to generate each of the multiple compressed segment identifiers, each of the multiple compressed segment identifiers respectively includes the node identifier of each of the multiple segment identifiers, and the multiple compressed segment identifiers include the compressed segment identifier of the first type and the compressed segment identifier of the second type.
[0042] In a possible implementation, the prefix is used to indicate the subnet to which the network device or link corresponding to each segment identifier belongs, and the node identifier is used to indicate the network device or link corresponding to each segment identifier in the subnet.
[0043] As described above, in order to obtain the segment list including the compressed segment identifier, you can first obtain the segment list including the segment identifier, then compress the segment identifier in the segment list including the segment identifier, replace the segment identifier with the corresponding compressed segment identifier, and obtain the segment list including the compressed segment identifier; or, you can first compress the segment identifier to obtain the corresponding compressed segment identifier, and then obtain the segment list including the compressed segment identifier based on the compressed segment identifier.
[0044] In a possible implementation manner, the first network device is a controller in a network, and the method further includes: the first network device sends the first segment list to an ingress device of the forwarding path.
[0045] In a possible implementation, the first network device is an ingress device of the forwarding path, and the method further includes: the first network device generates a message including the first segment list, and the first network device sends a message including the first segment list.
[0046] In a fourth aspect, the present application provides a network device that executes the method in the first aspect or any possible implementation of the first aspect. Specifically, the network device includes a unit for executing the method in the first aspect or any possible implementation of the first aspect.
[0047] In a fifth aspect, the present application provides a network device that executes the method in the second aspect or any possible implementation of the second aspect. Specifically, the network device includes a unit for executing the method in the second aspect or any possible implementation of the second aspect.
[0048] In a sixth aspect, the present application provides a network device that executes the method in the third aspect or any possible implementation of the third aspect. Specifically, the network device includes a unit for executing the method in the third aspect or any possible implementation of the third aspect.
[0049] In a seventh aspect, the present application provides a network device, the network device comprising: a processor, a communication interface and a memory. The communication interface may be a transceiver. The memory may be used to store program code, and the processor is used to call the program code in the memory so that the network device executes the method in the aforementioned first aspect or any possible implementation of the first aspect, which will not be repeated here.
[0050] In an eighth aspect, the present application provides a network device, the network device comprising: a processor, a communication interface and a memory. The communication interface may be a transceiver. The memory may be used to store program code, and the processor is used to call the program code in the memory so that the network device executes the method in the aforementioned second aspect or any possible implementation of the second aspect, which will not be repeated here.
[0051] In a ninth aspect, the present application provides a network device, the network device comprising: a processor, a communication interface and a memory. The communication interface may be a transceiver. The memory may be used to store program code, and the processor is used to call the program code in the memory so that the network device executes the method in the aforementioned third aspect or any possible implementation of the third aspect, which will not be repeated here.
[0052] In a tenth aspect, the present application provides a network device, the network device comprising: a main control board and an interface board. The main control board comprises: a first processor and a first memory. The interface board comprises: a second processor, a second memory and an interface card. The main control board and the interface board are coupled.
[0053] The first memory can be used to store program code, and the first processor is used to call the program code in the first memory to perform the following operations: generate a first message, the first message includes a segment list corresponding to a forwarding path of the first message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length.
[0054] The second memory may be used to store program codes, and the second processor is used to call the program codes in the second memory to trigger the interface card to perform the following operations: sending the first message according to the segment list.
[0055] In a possible implementation, an inter-process communication (IPC) channel is established between the main control board and the interface board, and the main control board and the interface board communicate through the IPC channel.
[0056] In an eleventh aspect, the present application provides a network device, the network device comprising: a main control board and an interface board. The main control board comprises: a first processor and a first memory. The interface board comprises: a second processor, a second memory and an interface card. The main control board and the interface board are coupled.
[0057] The first memory can be used to store program code, and the first processor is used to call the program code in the first memory to perform the following operations: determine that the content of the destination address field of the message header of the first message matches the local segment identifier; in response to determining that the content of the destination address field matches the local segment identifier, determine the content to be copied in the segment list according to the indication of the local segment identifier; copy the content to be copied to the destination address field to generate a second message.
[0058] The second memory can be used to store program code, and the second processor is used to call the program code in the second memory to trigger the interface card to perform the following operations: receive a first message, the first message includes a segment list corresponding to the forwarding path of the first message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; send the second message.
[0059] In a possible implementation, an inter-process communication (IPC) channel is established between the main control board and the interface board, and the main control board and the interface board communicate through the IPC channel.
[0060] In a twelfth aspect, the present application provides a network device, the network device comprising: a main control board and an interface board. The main control board comprises: a first processor and a first memory. The interface board comprises: a second processor, a second memory and an interface card. The main control board and the interface board are coupled.
[0061] The first memory can be used to store program code, and the first processor is used to call the program code in the first memory to perform the following operations: determine the forwarding path of the message; generate the segment list corresponding to the forwarding path, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length.
[0062] The second memory may be used to store program codes, and the second processor is used to call the program codes in the second memory to trigger the interface card to perform operations.
[0063] In a possible implementation, an inter-process communication (IPC) channel is established between the main control board and the interface board, and the main control board and the interface board communicate through the IPC channel.
[0064] In the thirteenth aspect, the present application provides a network system, which includes the network devices provided by the fourth, fifth and sixth aspects, or the network system includes the network devices provided by the seventh, eighth and ninth aspects, or the network system includes the network devices provided by the tenth, eleventh and twelfth aspects.
[0065] In a fourteenth aspect, the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the methods described in the above aspects.
[0066] In a fifteenth aspect, a computer program is provided, the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a network device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the network device executes the methods provided in the above aspects.
[0067] In a sixteenth aspect, the present application provides a chip including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory to execute the methods in the above aspects.
[0068] Optionally, the above chip only includes a processor, and the processor is used to read and execute a computer program stored in the memory. When the computer program is executed, the processor executes the methods in various aspects.
[0069] It should be understood that the beneficial effects achieved by the technical solutions of the fourth to sixteenth aspects of the embodiments of the present application and the corresponding possible implementation methods can be referred to the technical effects of the first to third aspects and their corresponding possible implementation methods mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings used in the embodiments. Obviously, the following drawings are only drawings of some embodiments of the present application. For ordinary technicians in this field, other technical solutions and drawings that can also implement the present application can be obtained based on these drawings without creative labor.
[0071] Figure 1 A schematic diagram of a segment identification provided by an embodiment of the present invention.
[0072] Figure 2 A schematic diagram of a network scenario provided by an embodiment of the present invention.
[0073] Figure 3 A schematic diagram of a message provided by an embodiment of the present invention.
[0074] Figure 4 A schematic diagram of a location field of a segment identifier provided in an embodiment of the present invention.
[0075] Figure 5 A schematic diagram of a compression segment identifier provided by an embodiment of the present invention.
[0076] Figure 6 A schematic diagram of a segment list provided in an embodiment of the present invention.
[0077] Figure 7 A schematic diagram of a message provided by an embodiment of the present invention.
[0078] Figure 8 A schematic flow chart of a method for forwarding a message provided in an embodiment of the present invention.
[0079] Fig. 9 A schematic diagram of a message provided by an embodiment of the present invention.
[0080] Fig.10 A schematic diagram of a message provided by an embodiment of the present invention.
[0081] Fig.11 A schematic diagram of a message provided by an embodiment of the present invention.
[0082] Fig.12 A schematic diagram of a message provided by an embodiment of the present invention.
[0083] Fig.13 A schematic diagram of a message provided by an embodiment of the present invention.
[0084] Fig.14 A schematic diagram of a message provided by an embodiment of the present invention.
[0085] Fig.15 A schematic diagram of a message provided by an embodiment of the present invention.
[0086] Fig.16 A schematic diagram of a message provided by an embodiment of the present invention.
[0087] Fig.17 A schematic diagram of a message provided by an embodiment of the present invention.
[0088] Fig.18 A schematic diagram of a message provided by an embodiment of the present invention.
[0089] Fig.19 A schematic flow chart of a method for forwarding a message provided in an embodiment of the present invention.
[0090] Fig. 20 A schematic diagram of a network device provided by an embodiment of the present invention.
[0091] Fig.21 A schematic diagram of a network device provided by an embodiment of the present invention.
[0092] Fig. 22 A schematic diagram of a network device provided by an embodiment of the present invention.
[0093] Fig.23 A schematic diagram of a network device provided by an embodiment of the present invention.
[0094] Fig.24 A schematic diagram of a network device provided by an embodiment of the present invention.
[0095] Fig.25 A schematic diagram of a network system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0096] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0097] In an SRv6 network, the message processing process can be divided into several segments, each of which is a specific processing behavior performed by a specific network device. Several segments are executed separately by network devices on the message forwarding path, forming the entire message processing process.
[0098] Each segment has a corresponding segment identifier, namely SID. SID adopts the IPv6 address format of 128 bits in length. That is, the length of each SID is 128 bits. Figure 1 The format of SID in SRv6 network is shown as Figure 1 As shown, each SID may include a location (locator) field and a function (function) field.
[0099] The content of the locator field can also be referred to as locator for short, which is an identifier assigned to a network node or a link of a network node in the network topology, and is used to identify the network node or link in the network topology. In addition, according to the locator in the SID being used to identify the network node or link, the SID can be divided into two types: node segment identifier (node SID) and adjacent segment identifier (adjacent SID).
[0100] The locator in the SID is used to indicate the network device that executes the segment corresponding to the SID. For a node segment identifier, the network device that executes the segment corresponding to the SID is the network node identified by the SID. For an adjacent segment identifier, the network device that executes the segment corresponding to the SID is the network node to which the link identified by the SID belongs.
[0101] In the embodiments of the present application, network nodes and network devices have the same meaning, and both refer to switches, routers, virtual routing devices, virtual forwarding devices or other forwarding devices. The network node publishes the routing information corresponding to the locator to the network through the network protocol, so that other network nodes in the network forward data packets to the network node.
[0102] The length of the locator is variable, and the length of the locator is related to the network scale. For example, when the network scale is larger, the number of network nodes included in the network topology is more, and in order to identify more network nodes, the length of the locator is longer. Conversely, when the network scale is smaller, the length of the locator is also shorter.
[0103] The content of the function field can also be referred to as function, which is used to represent the instruction or instruction set for processing the message, which is equivalent to the operation code of the computer instruction. When the instruction or instruction set represented by the function is executed on the network node, the network node will perform the corresponding forwarding behavior. For example, forwarding the data packet to the specified link, or forwarding by looking up the table in the specified table, etc.
[0104] Optionally, some SIDs may further include an argument field and / or a padding field after the function field.
[0105] The content of the argument field, which can also be referred to as argument for short, is the parameter involved in the execution of the instruction or instruction set represented by function, such as flow information, service information or other related information.
[0106] When the sum of the lengths of the locator, function, and optional argument in the SID is still less than 128 bits, a padding field needs to be set at the end of the SID.
[0107] It can be seen that the SID is used to represent the corresponding segment. Specifically, the SID can indicate the network device that executes the segment, and the SID can indicate the message processing behavior corresponding to the segment. Optionally, the SID can also indicate the parameters involved in executing the above message processing behavior.
[0108] When several SIDs corresponding to the above-mentioned several segments are arranged in sequence to form a SID list, the SID list can indicate the processing process of the message. Among them, the arrangement order of several SIDs in the SID list is the execution order of several segments in the processing process of the message. The SRH including the SID list is encapsulated in the message, so that the processing process of the SR network on the message can be carried in the message and transmitted to the network equipment on the message forwarding path. The network equipment on the message forwarding path executes its own related message processing behaviors in turn.
[0109] See also Figure 2 The application scenario shown includes an SRv6 network, which includes a network device S and network devices 1 to 10. Each network device has a corresponding locator, that is, an identifier assigned to the network device in the network topology, which is used to identify the network device in the network topology. For example, the identifier of network device 1 is locator1, and similarly, the identifiers of network devices 2 to 10 are locator 2 to locator 10, respectively.
[0110] Figure 2The dotted line in shows a message forwarding path, the head node of which is network device S, and then passes through network devices 1 to 10 in sequence. The head node on the forwarding path can also be the ingress node of the SRv6 network, also known as the ingress device or ingress network device. For example, the message processing process corresponding to the forwarding path includes 10 segments, which are the message processing behaviors performed by network devices 1 to 10. The function corresponding to the message processing behavior on network device 1 is function 1. Similarly, the functions corresponding to the message processing behaviors on network devices 2 to 10 are function 2 to function 10, respectively. For network device 1, locator 1 and function 1 form SID 1, that is, SID 1 is used to indicate the segment executed by network device 1 during the message processing process. Similarly, SID 2 to SID 10 are used to indicate the segments executed by network devices 2 to 10, respectively. SID 1 to SID 10 are arranged in sequence to form a SIDlist corresponding to the above message processing process. The order in which the 10 SIDs are arranged in the SID list is the execution order of the corresponding 10 segments during message processing, that is, the order is SID 1 to SID 10.
[0111] Figure 3 Figure 1 shows a message in an SRv6 network encapsulated with a SID list. Figure 2As shown, the message header of the message includes an IPv6 message header and an SRH. Among them, the IPv6 message header includes a version field, a traffic type field, a flow label field, a payload length field, a next message header field, a hop limit field, a source address field, and a destination address (DA) field. The meaning of each field can refer to the explanation in the request for comments (RFC) 8200. SRH includes a next message header field, a header extension length (HdrExt Len) field, a routing type field, a segment left field, a last index field, a flag field, a tag field, and a SID list. The meaning of each field can refer to the explanation in RFC8754. Among them, the SL field is also called the SL pointer. During the message forwarding process, the SL pointer points to each element in the SID list in sequence. That is, as the SL value is different, segment[SL] is used to represent each element in the SID list.
[0112] The SID list consists of multiple elements segment list[0] to segment list[n] arranged in sequence, each element is a SID, and the length of each element is 128 bits. In addition, the SIDs in the SID list can be arranged from back to front, segment list[0] corresponds to the last executed segment, segment list[2] corresponds to the second to last executed segment, and so on. Figure 2 In the application scenario shown, the SID list includes 10 SIDs, segment list[n] is SID 1, and segment list[0] is SID 10.
[0113] In an SRv6 network, an SRH including a SID list can be encapsulated in a message by the head node on the forwarding path, and subsequent network devices on the message forwarding path can process the message according to the SID list. Specifically, the head node encapsulates an SRH including a SID list inside the IPv6 message header of the received IPv6 data message to form an SRv6 data message. In addition, the head node on the forwarding path can also set the value of the DA field in the IPv6 message header of the message to the SID corresponding to the first executed segment in the SID list. In addition, the head node can also set the value of the SL field to N-1, where N is the number of SIDs included in the SID list, that is, segment[SL] is the first SID in the SID list, corresponding to the first executed segment. Then, the head node on the forwarding path sends the message along the forwarding path. Combined with Figure 2 In the application scenario shown, the SID list is encapsulated in the message by network device S, and network devices 1 to 10 process the message according to the SID list in the message. Network device S copies SID 1 corresponding to the first executed segment to the DA field in the IPv6 message header. Network device S sets the value of the SL field to 9. Network device S searches the local forwarding table based on the content of the DA field, that is, SID 1, and sends the message to network device 1 based on the table lookup result.
[0114] In an SRv6 network, for a specific message, the network devices on the forwarding path can be divided into transit nodes and endpoint nodes. For a transit node, the SID in the DA field of the IPv6 message header of the message is not a local SID, that is, the SID in the DA field is not locally configured to indicate a segment. For an endpoint node, the SID in the DA field of the IPv6 message header of the message is a local SID, that is, the SID in the DA field is locally configured to indicate a segment.
[0115] Therefore, when the network device receives a message, it will determine whether the SID in the DA field is a local SID. When it is determined that the SID in the DA field is not a local SID, the network device is a transit node on the message forwarding path. The transit node does not need to parse the content in the SRH. It only needs to search the local IPv6 routing table according to the content of the DA field and forward the message. In addition, the transit node may also be a network device that does not support SRv6. When it is determined that the SID in the DA field is a local SID, the network device is an endpoint node on the message forwarding path. The endpoint node searches the forwarding information base (FIB) according to the SID in the DA field, matches the locally instantiated SRv6 SID, and executes the message processing behavior corresponding to the local implementation SRv6 SID. In addition, the endpoint node subtracts 1 from the value of the SL field in the message SRH, and copies the segment list [SL] to the DA field of the IPv6 message header, that is, updates the content of the DA field. And, continue to forward the message according to the updated DA field.
[0116] Combination Figure 2 In the application scenario shown, network device 1 receives a message, determines that SID 1 in the DA field is a local SID, executes the message processing behavior corresponding to SID 1, reduces the value of the SL field by 1, that is, the value of the SL field is 8, copies segment list [8], that is, SID 2 to the DA field, and sends the message to network device 2 according to SID 2.
[0117] After that, the execution steps of network device 2 to network device 10 are similar to those of network device 1, forming a complete message processing process. It can be seen that the SID in the SRv6 network has a routable attribute. When used in the SID list, it can simplify the creation of inter-domain paths and quickly establish end-to-end paths in the network. At the same time, the function in the SID supports programmability, which can flexibly meet the needs of various services and network functions and adapt to the needs of business and network development. However, as mentioned above, the 128-bit SID will also bring about the problems of low network link bandwidth utilization and high difficulty in message processing.
[0118] An embodiment of the present application provides a method for forwarding a message, which adopts a compressed segment identifier (compressed SID, C-SID) with a length less than 128 bits. Under the premise of being compatible with SRH, the length of the SID list is reduced, thereby improving network efficiency and reducing the difficulty of message processing.
[0119] The locator field in the SID can further include two parts: a prefix and a node ID, such as Figure 4 As shown. The prefix is usually assigned by the network operator to the subnet where the network device is located to identify the entire subnet. The subnet can also be called a network segment. The prefix of all SIDs in the entire subnet is the same. It can be considered that all SIDs in the entire subnet form a SID block, so the prefix is also used to identify the SID block, so the prefix can also be called a block. The node ID is used to distinguish nodes in the subnet. The node IDs in the SIDs of different nodes in the subnet are different.
[0120] In the message forwarding path, multiple adjacent network devices are located in the same subnet, so the SIDs corresponding to the multiple network devices in the SID list all carry the same prefix, resulting in duplication and redundancy. Optimizing this redundant content can achieve the technical effect of reducing the length of the SID list.
[0121] The present application embodiment provides a format of C-SID, such as Figure 5 As shown. The prefix of the locator field in the SID and the possible argument field and / or padding field are omitted, and the node ID and function field of the locator field form a C-SID. Therefore, the length of the C-SID composed of the node ID and the function field can be less than 128 bits. The SIDlist can only include the C-SID, thereby achieving the technical effect of reducing the length of the SID list.
[0122] Among them, the omitted prefix has the same content in each SID, so the same prefix can be carried only once in the message, and the same prefix and different C-SIDs can be used to restore different SIDs at each network device on the forwarding path. For example, the head node on the message forwarding path can place the prefix in the DA field of the IPv6 message header of the message, and the endpoint node on the message forwarding path can update different C-SIDs to the prefix content in the DA field, and the later updated C-SID covers the earlier updated C-SID. Therefore, different C-SIDs can be combined with the prefix to restore the corresponding SID. In other words, although the SID list only includes C-SID, the corresponding SID is still presented in the DA field. Therefore, when the network device on the forwarding path processes the message according to the content of the DA field in the message, the content of the DA field is still the SID, which is compatible with the standard SRv6 message processing mechanism.
[0123] The information carried by the omitted argument field may be transmitted in other ways, for example, carried in the TLV field of the SRH in the message, or statically configured at the network device.
[0124] Typically, in the same subnet, all SIDs have the same prefix and the same length of node IDs. Optionally, all SIDs have the same length of function fields. Thus, optionally, all C-SIDs in the same subnet have the same length.
[0125] Optionally, the length of the C-SID may be aligned to 8 bits, that is, the length of the C-SID is an integer multiple of 8 bits. Preferably, the length of the C-SID may be 32 bits or 16 bits.
[0126] In order to obtain a better compression effect, during the network planning process, an SRv6 SID that is conducive to compression can be planned. For example, in an SRv6 SID that is conducive to compression, a shorter function field can be used, or a shorter nodeID can be used. Preferably, in an SRv6 SID that is conducive to compression, the prefix is 64 bits, the node ID is 16 bits, and the function field is 16 bits, so that the corresponding C-SID is 32 bits. Preferably, in an SRv6 SID that is conducive to compression, the prefix is 64 bits, the node ID is 8 bits, the function field is 8 bits, and the remaining part is the padding field, so that the corresponding C-SID is 16 bits.
[0127] When the message processing process includes 10 segments, if a 128-bit SID is used, the total length of the 10 SIDs is 160 bytes. When a C-SID is used, taking the C-SID length of 32 bits as an example, the total length of the 10 C-SIDs is 40 bytes, and the compression effect is obvious.
[0128] In order to obtain a SID list including the C-SID, a SID list including the SID may be first obtained, and then the SID in the SID list including the segment identifier may be compressed, and the SID therein may be replaced with the corresponding C-SID to obtain a SID list including the C-SID; or, the SID may be first compressed to obtain the corresponding C-SID, and then the SID list including the C-SID may be obtained according to the C-SID.
[0129] When C-SID is arranged in the SID list in SRH, in order to be compatible with the standard SRH mechanism and accurately locate the C-SID, the C-SID needs to be arranged in a 128-bit aligned manner. Specifically, each 128-bit element in the SID list can be defined as a container, and each container can contain an integer number of C-SIDs. Optionally, the number of C-SIDs contained in the container can be 128 / L C-SID The integer part, L C-SID The length of the C-SID. For example, when the length of the C-SID is 32 bits, each container can contain a maximum of 4 C-SIDs.
[0130] Optionally, after an integer number of C-SIDs are contained in a container, the remaining space less than the length of one C-SID is used as padding. For example, when the length of a C-SID is 48 bits, each container can contain at most 2 C-SIDs, and the remaining 24 bits are used as padding.
[0131] Optionally, when the number of C-SIDs is insufficient, the remaining space in the container is used as padding. For example, when the container includes only three C-SIDs of 32 bits in length, the remaining 32 bits are used as padding.
[0132] When the SID list includes multiple C-SIDs, these C-SIDs are sequentially arranged in at least one container according to the order in the SID list.
[0133] In addition, C-SID can also be mixed with SID in the SID list. For example, when only some network devices in the forwarding path support the C-SID function, the SID corresponding to the network devices that do not support the C-SID function still uses the 128-bit format. For another example, when the forwarding path involves a virtual private network (VPN), the corresponding VPNSID still uses the 128-bit format. In this case, the SID can be contained in a container.
[0134] An SRH that includes both a 128-bit SID and a C-SID of less than 128 bits can be called a generalized SRH (G-SRH), and the corresponding SRv6 technology that supports G-SRH can be called a generalized SRv6 (G-SRv6) technology. In addition to the 128-bit SID and the C-SID of less than 128 bits, the SID list of G-SRH can also include other types of identifiers, such as MPLS labels and Internet Protocol Version 6 (IPv4) addresses. All identifiers included in the SID list of G-SRH, such as SID, C-SID, MPLS label, and IPv4 address, can be collectively referred to as G-SID. For more description of G-SRH and G-SRv6, see draft-lc-6man-generalized-srh-00, entitled “Generalized Segment Routing Header”, dated February 2020, draft-cl-spring-generalized-srv6-np-01, entitled “Generalized SRv6 Network Programming”, dated March 2020, and draft-cl-spring-generalized-srv6-for-cmpr-01, entitled “Generalized SRv6 Network Programming for SRv6 Compression”, dated May 2020, the entire contents of which are incorporated herein by reference as if fully set forth.
[0135] The message forwarding path corresponding to the SID list in which the C-SID and the SID are mixed can be called a G-SRv6 path. The G-SRv6 path can include an SRv6 sub-path and an SRv6 compression sub-path. Figure 6 A schematic structure of the SID list corresponding to the G-SRv6 path is shown. The G-SRv6 path includes two SRv6 sub-paths and two SRv6 compressed sub-paths, namely SRv6 sub-path 1 and SRv6 sub-path 2, SRv6 compressed sub-path 1 and SRv6 compressed sub-path 2. Correspondingly, Figure 6 The SID list corresponding to the G-SRv6 path shown (referred to as G-SRv6 path in the figure) also includes parts corresponding to two SRv6 sub-paths (referred to as SRv6 sub-path 1 and SRv6 sub-path 2 in the figure) and parts corresponding to two SRv6 compression sub-paths (referred to as SRv6 compression sub-path 1 and SRv6 compression sub-path 2 in the figure).
[0136] In the SID list, the part corresponding to SRv6 subpath 1 is similar in structure to the part corresponding to SRv6 subpath 1, and both can include at least one SID. The part corresponding to SRv6 compression subpath 1 is similar in structure to the part corresponding to SRv6 compression subpath 2, and both can include at least one C-SID.
[0137] Take the part corresponding to SRv6 compression subpath 1 as an example, which includes at least one container. Optionally, the first SID in this part can be stored in the SID list in the form of a complete SID or in the form of a C-SID. Figure 6 As shown, the first SID in this part can be stored in the SID list in the form of a complete SID, that is, the first container can include a 128-bit SID to simplify the message processing process. The processing process for the first container will be described in detail below. Starting from the second container, each container includes C-SIDs arranged in sequence. For example, Figure 6 As shown in the figure, the SID included in the first container can be divided into three parts: prefix1, C-SID 1, and the optional argument field or padding field. The second container includes four C-SIDs from C-SID2 to C-SID5. The subsequent containers are similar.
[0138] Optionally, in the SID list of mixed C-SID and SID, multiple SRv6 compressed sub-paths can be included. Optionally, the multiple SRv6 compressed sub-paths are located in different subnets, that is, the SIDs corresponding to the nodes in the multiple SRv6 compressed sub-paths have different prefixes. Figure 6 As shown, the G-SRv6 path also includes SRv6 compression sub-path 2. In the SID list, the portion corresponding to SRv6 compression sub-path 1 is similar in structure to the portion corresponding to SRv6 compression sub-path 2, but in the portion corresponding to SRv6 compression sub-path 2, the prefix portion included in the SID included in the first container is prefix 2, which is different from the above prefix 1. In other words, different SRv6 compression sub-paths are distinguished by whether the SID includes the same prefix, that is, by whether the C-SID corresponds to the same prefix. Therefore, each node in the same SRv6 compression sub-path belongs to the same subnet.
[0139] Combination Figure 2In the application scenario shown, the forwarding path passes through network device 1 to network device 10 in sequence. The segments executed by network device 1 to network device 9 can be represented by C-SID 1 to C-SID 9, respectively, and the length of each C-SID is 32 bits. The segment executed by network device 10 is represented by a VPN SID of 128 bits. The message format including the SIDlist corresponding to the forwarding path is as follows: Figure 7 As shown in the figure, the SID list includes 4 containers, of which the first container includes C-SID 1 to C-SID 4, the second container includes C-SID 5 to C-SID 8, the third container includes C-SID 9, and the rest is padding, and the fourth container includes SID 10. The total length of the SID list is 64 bytes. Compared with the SID list that includes 10 SIDs and has a length of 160 bytes, the length of the SID list is greatly shortened, thereby improving network efficiency.
[0140] As described above, the SRH includes an SL field. When the SRH is encapsulated in a message, the head node of the forwarding path sets the value of the SL field to N-1, where N is the number of SIDs included in the SID list. During the forwarding process of the message, the network device corresponding to each SID in the SIDlist of the SRH, that is, the endpoint node on the forwarding path, subtracts 1 from the value of the SL field in the SRH of the message in turn, that is, updates the value of the SL field, and copies the segment list [SL] to the DA field of the IPv6 header of the message, that is, updates the content of the DA field. Therefore, the content of the SL field can also be called an SL pointer, which points to each element in the SID list in turn. The network device on the forwarding path can locate each element in the SID list according to the SL pointer, thereby finding the next SID to be processed and updating the DA field.
[0141] When using a G-SRH including a C-SID, since the length of the C-SID is shorter, each element in the SID list, that is, each container, may contain multiple C-SIDs. Or it can be considered that the elements in the SID list can be further divided into multiple sub-elements. Therefore, for the original SL pointer, the SL pointer points to each element in the SID list in turn, and each element further includes multiple sub-elements, and it is impossible to accurately locate each of the sub-elements by relying solely on the SL pointer. If these sub-elements include C-SIDs, it is impossible to accurately locate each of the C-SIDs.
[0142] At this time, in order to accurately locate all G-SIDs in the SID list, the existing SL pointer needs to be extended. Specifically, two methods can be adopted: one-dimensional pointer and two-dimensional pointer.
[0143] In the two-dimensional pointer method, in addition to the existing SL pointer, a new pointer can be added to the message. The new pointer can be called SI, or compressed segment identifier left (C-SID left, CL) pointer. At this time, the first-dimensional pointer, that is, the SL pointer, is still used to indicate a specific element in the SID list, while the second-dimensional pointer, that is, the SI, is used to further indicate a G-SID within the element. The C-SIDs can be arranged from front to back in the element. For example, when the element includes m C-SIDs, the SI value corresponding to the first executed C-SID is m-1, the SI value corresponding to the last executed C-SID is 0, and so on. If the value of the SI pointer is reduced by 1, the SI will shift to the next C-SID. Therefore, through the combination of the SL pointer and the SI, not only can all elements in the SID list be accurately located, but also all sub-elements in the SID list can be accurately located. Segment list[SL][SI] can be used to represent all G-SIDs in the SID list. Figure 7 Taking the message shown in the figure as an example, segment list[3][3] can be used to represent C-SID 1, and segment list[2][3] can be used to represent C-SID 5.
[0144] Regarding the updating method of the two-dimensional pointer, when SI is offset inside an element, during the process of updating the pointer, SI can be reduced by 1, while the SL pointer remains unchanged, that is, the SL pointer still points to the same element, and SI points to the next subelement in the element; and when SI currently points to the last subelement of the element, that is, SI needs to move to the next element, during the process of updating the pointer, the SL pointer can be reduced by 1, and SI is set to m-1, that is, the SL pointer points to the next element, and SI points to the first subelement of the next element.
[0145] The newly added second dimension pointer, i.e., SI, can be located in the SRH in the message or in the DA field. For example, SI can be located in the lowest two bits in the DA field or the lowest three bits in the DA field. For example, the lowest byte of the DA field can also be used to place SI, which is convenient for hardware implementation and conducive to the expansion of future solutions.
[0146] In the one-dimensional pointer method, the offset step of the existing SL pointer can be adjusted to form a new pointer, which can be called a generalized SID index (SI) or still called an SL pointer. The one-dimensional pointer, namely SI, is used to indicate a G-SID in the SID list. The offset step of the existing SL pointer is the length of the element in the SID list, namely 128 bits, and the SL pointer points to the next element in the SID list after each offset. The offset step of SI is the length of the sub-element in the SID list, such as 32 bits or 16 bits, and the SI points to the next sub-element in the SID list after each offset. Therefore, through different values of SI, all elements and all sub-elements in the SID list can be accurately located, and segment list[SI] can be used to represent all G-SIDs in the SID list. Figure 7 Taking the message shown as an example, segment list
[15] can be used to represent C-SID 1, and segment list
[11] can be used to represent C-SID 5. It should be noted that, since the offset step of SI is reduced, when it is necessary to point to the next element in the SID list, for example, when two SIDs in the SID list are adjacent, in order to point to the next SID, SI needs to be offset by multiple steps to achieve the length of an offset element.
[0147] The new one-dimensional pointer, i.e., SI, can be located in the SRH in the message or in the DA field. For example, SI is still located in the SL field. For another example, SI can be located in the lowest two bits in the DA field or the lowest three bits in the DA field. For example, the lowest byte of the DA field can also be used to place SI, which is convenient for hardware implementation and conducive to the expansion of future solutions.
[0148] For convenience, the extended one-dimensional pointer and the extended two-dimensional pointer may be collectively referred to as an extended pointer.
[0149] For traditional SRv6 networks, the SID list consists only of SIDs. During the message forwarding process, the network device reduces the value of the SL field in the message SRH by 1 and copies the segment list [SL] to the DA field in the IPv6 header, that is, updates the content of the DA field. When the SID list also includes C-SID, in order to be compatible with the message forwarding process in the above SRv6 network, the network device will change the way it updates the DA field.
[0150] Optionally, when the SID list also includes C-SID, the C-SID or SID may carry compression continuation (COC) information to indicate whether the C-SID in the SID list continues to be arranged. The network device learns the special update method for the DA field according to the compression continuation information carried in the C-SID or SID.
[0151] Optionally, the compressed persistence information may be included in the SID or C-SID. Optionally, the compressed persistence information may be carried in one or more bits in the SID or C-SID, for example, the compressed persistence information may be carried in one bit between the node ID and the function in the SID or C-SID. Preferably, the compressed persistence information may be carried in the function field in the SID or C-SID, corresponding to a specific behavior.
[0152] Optionally, the specific behavior that carries the compressed persistence information may be a flavor in SRv6 technology. Flavors are variants of conventional behaviors in SRv6 technology, such as End, End.X, or End.T. For more description of flavors, see draft-ietf-spring-srv6-network-programming-15, entitled "SRv6 Network Programming", dated March 2020, the entire contents of which are incorporated herein by reference as if fully set forth.
[0153] The flavor that carries compressed persistence information can be called COC flavor. The content of COC flavor can be to update the content of a specific length in the SID list to the DA field, and the specific length is the length of the C-SID. For example, the specific length can be 32 bits or 16 bits. Moreover, the content of the specific length only covers the content of the same length after the prefix in the DA field. In other words, the network device copies the next C-SID to be processed to the prefix in the DA field, and the next C-SID to be processed and the prefix restore the next SID. The subsequent processing method is the same as the message processing method of the standard SRv6 network.
[0154] Specifically, when the SID in the DA field includes COC flavor, for the two-dimensional pointer method, the network device updates the value of the SI and / or SL pointer, and copies the segment list [SL] [SI] of a specific length to the DA field of the IPv6 header; for the one-dimensional pointer method, the network device updates the value of SI, and copies the segment list [SI] of a specific length to the DA field of the IPv6 header. When the SID in the DA field does not include COC flavor, the standard SRv6 processing method is still used, that is, the 128-bit segment list [SL] is copied to the DA field of the IPv6 header.
[0155] Combination Figure 2 The application scenarios shown and Figure 7 In the message format shown, C-SID 1 to C-SID 8 all include COC flavor, and the corresponding network devices 1 to 8 copy 32-bit C-SID 2 to C-SID 9 to the DA field of the IPv6 header respectively, while C-SID 9 does not include COC flavor, and the corresponding network device 9 copies 128-bit SID 10 to the DA field of the IPv6 header.
[0156] For example, the pseudo code corresponding to the COC flavor included in C-SID 1 to C-SID 8 is as follows:
[0157]
[0158]
[0159] Combined with the above description, the prefix in the SID is used to identify the subnet where the network device or link is located, and the prefix of all SIDs in the subnet is the same. When the forwarding path passes through different subnets, the prefixes of each SID in the SID list corresponding to the forwarding path may be different. When the compressed C-SID can be used in the SID list, the omitted prefix may be saved only at the starting position of the SRv6 compressed subpath. For example, Figure 6As shown, the first SID in SRv6 compression sub-path 1 is in the form of a complete SID, including prefix 1; similarly, the first SID in SRv6 compression sub-path 2 is in the form of a complete SID, for example, including prefix 2. Moreover, since all SIDs in SRv6 sub-path 1 and SRv6 sub-path 2 are in the form of complete SIDs, the first SIDs in SRv6 sub-path 1 and SRv6 sub-path 2 must also be in the form of complete SIDs. It can be seen that in some network scenarios, the first SID on each segment sub-path in the forwarding path is in the form of a complete SID, that is, the first SID on each segment sub-path includes a prefix. Therefore, the prefix content can be used to determine whether a segment of SRv6 compression sub-path ends.
[0160] Optionally, when the SID list also includes C-SID, the network device can determine whether C-SID continues to be arranged in the SID list by parsing part of the content of the next element, and then learn the special update method for the DA field.
[0161] Optionally, the partial content of the next element may include at least a part of the prefix. Optionally, the partial content of the next element is the starting part of the next element, and the length of the partial content of the next element is the length of the common part of the prefix in each segment sub-path. Figure 6 In the application scenario shown, for example, the prefix of SRv6 compression subpath 1 is prefix 1, the prefix of SRv6 compression subpath 2 is prefix 2, and the prefixes of SRv6 subpath 1 and SRv6 subpath 2 are prefix 3 and prefix 4, respectively. The lengths of prefix 1 to prefix 4 are all 32 bits, and the first 20 bits of prefix 1 to prefix 4 are the same. Then the partial content of the next element is the first 20 bits of the next element.
[0162] Optionally, when the network device is currently identified as the last sub-element in the element, it parses part of the content of the next element. If the part of the content of the next element is not the common part of the prefix in each segment sub-path, it determines that the C-SID in the SID list continues to be arranged, that is, the current SRv6 compression sub-path has not ended, and the next C-SID to be processed is copied to the prefix in the DA field; if the part of the content of the next element is the common part of the prefix in each segment sub-path, it determines that the C-SID in the SID list no longer continues to be arranged, that is, the current SRv6 compression sub-path ends, and the next 128-bit element is copied to the DA field of the IPv6 header. Combined with Figure 6 In the application scenario shown, on the network device corresponding to C-SID 5 in SRv6 compression sub-path 1, since C-SID 5 is the last sub-element in the element, the network device parses the first 20 bits of the next element, that is, the first 20 bits in the next container, for example, the first 20 bits in C-SID 6. The first 20 bits in C-SID 6 are different from the common part of the prefix in each segment sub-path. It is determined that the C-SIDs in the SID list continue to be arranged, that is, the current SRv6 compression sub-path 1 is not ended, and C-SID 6 is copied to after the prefix in the DA field. On the network device corresponding to the last C-SID in SRv6 compression sub-path 1, that is, C-SID N, since C-SID N is the last sub-element in the element, the network device parses the first 20 bits of the next element, that is, the first 20 bits of the first container in SRv6 compression sub-path 2. The first container includes the prefix, that is, the first 20 bits of the first container are the same as the common part of the prefix in each segment sub-path, then it is determined that the C-SID in the SID list is no longer arranged, that is, the current SRv6 compression sub-path 1 ends, and the next element of 128 bits is copied to the DA field of the IPv6 header.
[0163] In the above description, all C-SIDs in the same SRv6 compression sub-path have the same length. However, in actual network application scenarios, if C-SIDs of different lengths are mixed in the same SRv6 compression sub-path, the length of the SID list can be further shortened, improving network efficiency.
[0164] The embodiment of the present application proposes a method for forwarding a message, and the method involves a network device on a message forwarding path. In the method, C-SIDs of different lengths are mixed and arranged in the same SRv6 compression sub-path. After the network device receives the message, it reads the content of the DA field of the message IPv6 message header. The content of the DA field includes the current identifier corresponding to the network device. The network device determines the length of the current identifier, adjusts the pointer position according to the length of the current identifier, and then determines the content to be copied in the SIDlist. Among them, for different network devices, the length of the current identifier in the DA field may be different, and the pointer offset distance may also be different. In other words, for C-SIDs of different lengths in the SID list, different pointer offset distances can be flexibly corresponded. Therefore, when C-SIDs of different lengths are mixed and arranged in the same SRv6 compression sub-path, it is compatible with the message forwarding and processing process in the existing SRv6 network, thereby improving network efficiency.
[0165] Figure 8 1 shows a flow chart of a method 100, which involves a network device 101 and a network device 102. The network device 101 is a head node on a message forwarding path. Figure 2 As shown by the dashed line, the network device 101 may be Figure 2 In the application scenario shown, the network device S is a network device other than the head node on the message forwarding path. For example, the network device 102 may be Figure 2 The network devices 1 to 9 in the application scenario are shown.
[0166] The method 100 comprises the following steps:
[0167] S110, the network device 101 determines the forwarding path of the message and generates the segment list corresponding to the forwarding path, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length.
[0168] Combination Figure 2 In the application scenario shown, the network device 101 may be Figure 2 The network device S in the example. Optionally, the network device S may be an ingress device of the SRv6 network. The network device 101 obtains a segment list corresponding to the forwarding path. Figure 2 As shown, the forwarding path includes multiple network devices. Specifically, the forwarding path passes through network device 1 to network device 10 in sequence.
[0169] The message forwarding path can be generated by the controller or by the network device S. When the message forwarding path is generated by the controller, the segment list corresponding to the message forwarding path can also be generated by the controller. At this time, the controller sends the generated segment list to the network device S. Specifically, the controller sends a control message to the network device S, and the control message includes the segment list. The network device S receives the control message from the controller and obtains the segment list. When the message forwarding path is generated by the network device S, the segment list corresponding to the message forwarding path can also be generated by the network device S. At this time, the network device S determines the message forwarding path and generates a segment list corresponding to the forwarding path.
[0170] As mentioned above, the segment list includes a plurality of compressed segment identifiers arranged in sequence. The plurality of compressed segment identifiers may include a SID with a length of 128 bits, or may include a C-SID with a length less than 128 bits, or may include an MPLS label and / or an IPv4 address.
[0171] As mentioned above, the length of C-SID can be set during the network planning process, which can also be called the whole network planning method. In addition, the length of C-SID is related to the network scale. For example, when the number of network nodes included in the network topology is more, in order to identify more network nodes, the length of C-SID is longer, and vice versa, when the number of network nodes included in the network topology is less, the length of C-SID is also shorter; when the number of behaviors that process messages in the network is more, the length of C-SID is longer, and vice versa, when the number of behaviors that process messages in the network topology is less, the length of C-SID is also shorter. For example, the network topology includes 100 nodes and the network includes 10 behaviors. In order to distinguish different behaviors of different nodes, the number of C-SIDs cannot be less than 1000, and the length of C-SID cannot be shorter than 10 bits. If it is considered that the length of C-SID needs to be aligned to 8 bits, the length of C-SID cannot be shorter than 16 bits. It can be seen that the length of C-SID cannot be shortened indefinitely. When the length of all C-SIDs in a subnet is the same, there is a compression limit for the same length. If the length of C-SID is less than the compression limit, the network node or behavior corresponding to the C-SID cannot be distinguished, resulting in network errors.
[0172] In an embodiment of the present application, the segment list may include C-SIDs of different lengths, for example, a first type of C-SID and a second type of C-SID, the length of the first type of C-SID is a first length, the length of the second type of C-SID is a second length, and the length of the first type of C-SID is less than the length of the second type of C-SID. The prefix part corresponding to the first type of C-SID is the same as the prefix part corresponding to the second type of C-SID, that is, the first type of C-SID and the second type of C-SID are located in the same SRv6 compression subpath. That is, in an embodiment of the present application, the C-SIDs in the network are classified, and each type of C-SID is planned separately during the network planning process, and different types of C-SIDs are planned to different lengths. Among them, the first type of C-SID is only for part of the message processing behavior in the network. Compared with distinguishing all message processing behaviors in the network, the C-SID length required to distinguish the part of the message processing behavior is shorter, so the first type of C-SID can be planned to be a shorter length, that is, the length of some of the C-SIDs is further shortened. For the second type of C-SID, its length can still be consistent with the above-mentioned whole network planning, that is, there is no need to increase the length of the remaining C-SIDs. Therefore, when the first type of C-SID and the second type of C-SID are mixed and arranged in the SID list, the length of the SID list can be further shortened.
[0173] For example, among the C-SIDs of different lengths, the first type of C-SID with a shorter length may correspond to a behavior with a higher frequency of occurrence in the network, and the second type of C-SID with a longer length may correspond to a behavior with a lower frequency of occurrence in the network. Compared with the number of all behaviors in the network, the number of behaviors with a higher frequency of occurrence is less. When planning for behaviors with a higher frequency of occurrence alone, the number of first type C-SIDs required to distinguish behaviors with a higher step is less, and the length of the first type of C-SID can be further shortened. When planning for the remaining behaviors with a lower frequency of occurrence, the length of the corresponding second type of C-SID can be consistent with the above-mentioned full network planning. For example, the network topology includes 100 nodes, and the network includes 10 behaviors, among which behavior 1 has a higher frequency of occurrence. If planning is performed for behavior 1 alone, in order to distinguish behavior 1 of 100 nodes, the number of first type C-SIDs cannot be less than 100, and the length of the first type of C-SID can be as short as 7 bits. If it is considered that the length of the C-SID needs to be aligned to 8 bits, the length of the first type of C-SID cannot be shorter than 8 bits. That is to say, compared with the above-mentioned full network planning, the length of the first type of C-SID is shortened by 8 bits. For the second type of C-SID, in order to distinguish the 9 behaviors of the remaining 100 nodes, the number of the second type of C-SID cannot be less than 900, then the length of the second type of C-SID can still be consistent with the above-mentioned full network planning, that is, the length of the second type of C-SID is still 16 bits, and the length of the second type of C-SID does not need to be increased. Therefore, when the first type of C-SID and the second type of C-SID are mixed and arranged in the SID list, the length of the SID list can be further shortened, and the more the number of the first type of C-SID included in the SID list, the more significant the technical effect.
[0174] by Figure 2 The application scenario shown in the figure is used as an example to illustrate the Figure 2 On the forwarding path shown by the dotted line, network devices 1 to 4 and network devices 8 to 9 execute behavior 1 which appears more frequently, while network devices 5 to 7 respectively execute behavior 2, behavior 3 and behavior 4 which appear less frequently. Therefore, the SID list corresponding to the forwarding path may include the first type of C-SID corresponding to network devices 1 to 4 and network devices 8 to 9, and the second type of C-SID corresponding to network devices 5 to 7.
[0175] For example, among the C-SIDs of different lengths, the first type of C-SID with a shorter length may correspond to the End type behavior and a part of the End.X type behavior in the network, while the second type of C-SID with a longer length may correspond to another part of the End.X type behavior in the network. Specifically, the first type of C-SID includes a global node C-SID and a local link C-SID, the global node C-SID corresponds to the processing behavior performed by a specific network device in the network, and the local link C-SID corresponds to the processing behavior performed by the current network device through a specific link in the current network device; and the second type of C-SID is a global link C-SID, which corresponds to the processing behavior performed by a specific network device in the network through a specific link on the specific network device. In order to distinguish a specific link on a specific network device, a larger number of global link C-SIDs must be planned, while the number of global node C-SIDs required to distinguish a specific network device is relatively small, or the number of local link C-SIDs required to distinguish a specific link in the current network device is also relatively small.
[0176] For example, the network topology includes 100 nodes, each of which includes 4 links, that is, the network topology includes 400 links. If the entire network is planned for all nodes and all links, the number of C-SIDs cannot be less than 500, and the length of the C-SID cannot be shorter than 9 bits in order to distinguish all nodes and all links. If the length of the C-SID needs to be aligned to 8 bits, the length of the C-SID cannot be shorter than 16 bits. However, if the first type of C-SID is planned for all nodes, including the global node C-SID, and the second type of C-SID is planned for all links, including the global link C-SID, in order to distinguish 100 nodes, the number of the first type of C-SID cannot be less than 100, even if the number of the first type of C-SID cannot be less than 104 in order to distinguish 4 local links, the length of the first type of C-SID can be as short as 7 bits. If the length of the C-SID needs to be aligned to 8 bits, the length of the first type of C-SID cannot be shorter than 8 bits. That is to say, compared with the above-mentioned full network planning, the length of the first type of C-SID is shortened by 8 bits. For the second type of C-SID, in order to distinguish 500 links, the number of the second type of C-SID cannot be less than 500, then the length of the second type of C-SID can still be consistent with the above-mentioned full network planning, that is, the length of the second type of C-SID is still 16 bits, and the length of the second type of C-SID does not need to be increased. Therefore, when the first type of C-SID and the second type of C-SID are mixed and arranged in the SIDlist, the length of the SID list can be further shortened, and the more the number of the first type of C-SID included in the SID list, the more significant the technical effect.
[0177] by Figure 2 The application scenario shown in the figure is used as an example, where for network devices 5 to 7, each network device has two links connected to the other two network devices, that is, network device 5 has two links connected to network device 6 and network device 7, and network devices 6 and 7 are similar. Figure 2 The forwarding path shown by the dotted line needs to specify a specific link at network devices 5 to 7. Specifically, the SID list corresponding to the forwarding path may include global node C-SIDs corresponding to network devices 1 to 4 and network devices 8 to 9, and global link C-SIDs corresponding to network devices 5 to 7.
[0178] Optionally, the global link C-SID is composed of a global node C-SID and a local link C-SID. Figure 2The application scenario shown is used as an example. The prefix in the subnet is A1, which is 64 bits long. The global node C-SIDs corresponding to network devices 1 to 9 are B1 to B9, which are 16 bits long. The common local link C-SID corresponding to network devices 1 to 9 is C1, and the behavior corresponding to the local link C-SID is to send the message to the next-hop neighbor through the outgoing interface 1. Network devices 5 to 7 also correspond to the common local link C-SID C2, and the behavior corresponding to the local link C-SID is to send the message to the next-hop neighbor through the outgoing interface 2. The lengths of C1 and C2 are both 16 bits. Then network device 5 corresponds to two global link C-SIDs, of which the first global link C-SID is B5:C1 and the second global link C-SID is B5:C2. Network devices 6 and 7 are similar.
[0179] When the SID list is [B9,B8,B7,B6,B5,B4,B3,B2,B1], the SID list specifies a forwarding path that passes through network devices 1 to 9 in sequence. This forwarding path is a loose path. When the SID list is [B9,B8,B7:C1,B6:C1,B5:C1,B4,B3,B2,B1], the SID list specifies the following: Figure 2 The forwarding path shown by the dotted line includes a strict forwarding path from network device 5 by the link corresponding to output interface 1 to network device 6, then from network device 6 by the link corresponding to output interface 1 to network device 7, and from network device 7 by the link corresponding to output interface 1 to network device 8.
[0180] Optionally, the first type of C-SID and the second type of C-SID may be included in the same element in the SID list, that is, the segment list includes an element with a length of 128 bits, and the element includes the first type of C-SID and the second type of C-SID.
[0181] Combination Figure 2 The application scenarios shown include SID lists of C-SIDs of different lengths. Fig. 9As shown. Among them, the segments executed by network devices 1 to 4, network device 8 and network device 9 can be represented by a C-SID with a length of 16 bits, namely C-SID 1 to C-SID 4, C-SID 8 and C-SID 9; the segments executed by network devices 5 to 7 can be represented by a C-SID with a length of 32 bits, namely C-SID 5 to C-SID 7, and the segment executed by network device 10 can be represented by a SID with a length of 128 bits, namely SID 10. The arrangement order of each C-SID and / or in the SID list is still in accordance with the execution order of the corresponding segments in the message processing process, that is, from C-SID 1 to C-SID 9, and then to SID 10.
[0182] The SID list includes three containers. The first container includes six C-SIDs, namely C-SID 1 to C-SID 6, of which C-SID 1 to C-SID 4 are 16 bits long, and C-SID 5 and C-SID 6 are 32 bits long. The second container includes three C-SIDs, namely C-SID 7 to C-SID 9, of which C-SID 7 is 32 bits long, and C-SID 8 and C-SID 9 are 16 bits long. The last 64 bits of container 2 are padding. The third container includes one SID, namely SID 10. Figure 7 Compared with the SID list shown in Fig. 9 The total length of the SID list shown is reduced by 128 bits. It can be seen that when the SID list includes C-SIDs of different lengths, the length of some C-SIDs can be further shortened, thereby further shortening the length of the entire SID list and improving network efficiency. When the number of C-SIDs in the SID list is larger, the effect of this technology will be more significant.
[0183] Optionally, the length of the second type of C-SID is an integer multiple of the length of the first type of C-SID. For example, the length of the first type of C-SID is 16 bits, and the length of the second type of C-SID is 32 bits.
[0184] Optionally, the length of the first type of C-SID and the length of the second type of C-SID are both integer multiples of a unit length, that is, the length value of the first type of C-SID and the length value of the second type of C-SID have a greatest common divisor, and the greatest common divisor is the value of the unit length.
[0185] Optionally, the length of the SID is also an integer multiple of the unit length, that is, 128 bits is an integer multiple of the unit length.
[0186] Optionally, the unit length is 2 to the Nth power bits, where N is an integer greater than or equal to 3 and less than 7.
[0187] For example, the unit length is 8 bits, the length of the first type of C-SID is 16 bits, and the length of the second type of C-SID is 32 bits.
[0188] Optionally, the length of the first type of C-SID is the unit length, that is, the length of the C-SID with a shorter length is used as the unit length.
[0189] For another example, the unit length is 16 bits, the length of the first type of C-SID is 16 bits, and the length of the second type of C-SID is 32 bits.
[0190] Optionally, when the SID list includes C-SIDs of different lengths, the C-SIDs of different lengths may include C-SIDs of two or more lengths. Optionally, the SID list also includes a third type of C-SID, the length of the third type of C-SID is greater than the length of the first type of C-SID, and the length of the third type of C-SID is less than the length of the second type of C-SID, that is, the length of the third type of C-SID is between the first type of C-SID and the second type of C-SID, the first type of C-SID is the shortest C-SID, and the second type of C-SID is the longest C-SID.
[0191] Optionally, the length of the third type of C-SID is an integer multiple of a unit length, that is, the length value of the first type of C-SID, the length value of the second type of C-SID, and the length value of the third type of C-SID have a greatest common divisor, and the greatest common divisor is the value of the unit length. For example, the unit length is 16 bits, the length of the first type of C-SID is 16 bits, the length of the third type of C-SID is 32 bits, and the length of the second type of C-SID is 64 bits.
[0192] Similar to the above description, the third type of C-SID may correspond to the behavior with the second highest frequency in the network, so that the C-SID can be classified and planned in more detail according to the different frequencies of occurrence, shortening the length of the SID list and improving network efficiency.
[0193] When the SID list further includes a fourth type of C-SID, or more types of C-SIDs, the rules and planning methods of the length values are similar to the above description and are not repeated here.
[0194] S120, the network device 101 generates a first message, where the first message includes the segment list, and the first message is forwarded along the forwarding path.
[0195] As the head node of the message forwarding path, the network device 101 encapsulates the SID list in the received data message to indicate the forwarding path of the data message. For example, the network device 101 encapsulates the SRH including the SID list inside the IPv6 message header of the received IPv6 data message to form an SRv6 data message. That is, the first message is an SRv6 data message. According to the message forwarding mechanism of the SRv6 network, the network device 101 obtains the segment list corresponding to the forwarding path of the first message, and encapsulates the segment list in the first message, so that the processing process for the first message can be carried in the message and passed to each network device on the forwarding path of the first message, and each network device on the forwarding path performs its own related message processing behavior in turn.
[0196] Optionally, when encapsulating the SRv6 data message, the network device 101 may also set a pointer in the SRv6 data message so as to accurately locate each position in the SID list.
[0197] As mentioned above, when the SID list includes C-SIDs of different lengths, the above-mentioned extended pointer can still be used to accurately locate all G-SIDs in the SID list. The extended pointer specifically includes two modes: a one-dimensional pointer or a two-dimensional pointer. It is easy to understand that at this time, the G-SID includes C-SIDs of different lengths. In the two-dimensional pointer, the first-dimensional pointer, i.e., the SL pointer, is still used to indicate a specific element in the SID list, and the second-dimensional pointer, i.e., the SI, is used to further indicate a G-SID within the element. In the one-dimensional pointer, the one-dimensional pointer, i.e., the SI, is used to indicate a G-SID in the SID list.
[0198] The extended pointer is set by the network device 101 in the second message, and the network device 101 sets the initial value of the one-dimensional pointer or the two-dimensional pointer in the second message. Optionally, in the two-dimensional pointer, the initial value of the SL pointer is set to N-1, and the initial value of the SI is set to M, where N is the number of containers included in the SID list, and M is the number of unit lengths included in each container. In other words, the unit length is the offset step of the SI. Optionally, in the one-dimensional pointer, the initial value of the SI is set to N, where N is the number of unit lengths included in the SID list. In other words, the unit length is the offset step of the SI. As mentioned above, the unit length is preferably the length of the first type of C-SID. Taking the two-dimensional pointer as an example, combined with Figure 2 The application scenarios and Fig. 9 In the message structure shown, the unit length is the length of the first type of C-SID, that is, 16 bits. The network device S sets the initial value of the SL pointer to 2 and the initial value of SI to 8. Segment[2][8] represents C-SID1, which corresponds to the first segment executed in the message forwarding process.
[0199] Other details of the extended pointer are similar to those described above and will not be repeated here. The updating method of the extended pointer will be described in detail in subsequent steps.
[0200] Optionally, when encapsulating the SRv6 datagram, the network device 101 may also place the prefix corresponding to the C-SID in the SID list in the DA field of the IPv6 header of the SRv6 datagram. Optionally, when encapsulating the SRv6 datagram, the network device 101 may also place the first G-SID in the SID list after the prefix in the DA field. Figure 2 The application scenarios and Fig. 9 In the message structure shown, the network device S places the prefix at the beginning of the DA field and places C-SID 1 after the prefix in the DA field, so that the content prefix+C-SID 1 in the DA field is restored to SID 1.
[0201] Optionally, the network device 101 may also place multiple G-SIDs including the first G-SID in the DA field, and the multiple G-SIDs are arranged in sequence after the prefix. For example, C-SID 2 is arranged after C-SID 1, so that it will not affect the restoration of SID 1 from prefix+C-SID 1.
[0202] It is worth noting that after the network device 101 places the first G-SID in the SID list in the DA field, the value of the extension pointer is not updated, that is, after the network device 101 places the first G-SID in the SID list in the DA field, the value of the extension pointer is still the initial value. In other words, for the second message, the G-SID in the SID list pointed to by the extension pointer is the G-SID included in the DA field. Taking the two-dimensional pointer as an example, combined with Figure 2 The application scenarios and Fig. 9 As shown in the message structure, the network device S places C-SID 1 in the DA field of the second message, and the value of the SL pointer in the second message is still the initial value 2, the value of SI is still the initial value 8, and segment[SL][SI] still represents C-SID1.
[0203] As mentioned above, when the SID list includes C-SIDs of different lengths, the relevant C-SID or SID can still include the compressed persistent information, and the network device learns the special update method for the DA field based on the compressed persistent information in the C-SID or SID. Optionally, the compressed persistent information can be included in both the first type of C-SID and the second type of C-SID. Optionally, the compressed persistent information can be included in the SID or C-SID. Preferably, the compressed persistent information can be carried in the function field of the SID or C-SID, corresponding to a specific behavior. The flavor that carries the compressed persistent information can be called a COC flavor. The pseudocode corresponding to the COC flavor will be introduced in detail in subsequent steps.
[0204] Combination Fig. 9 In the SID list shown, C-SID 1 to C-SID 8 all include COC flavor, while C-SID 9 does not include COC flavor. The corresponding DA field update method will be described in detail in subsequent steps.
[0205] S130, the network device 101 sends the first message along the forwarding path.
[0206] When the network device 101 sends the first message, it will determine the next hop network device of the message according to the longest match rule based on the content of the DA field in the IPv6 message header of the first message. Figure 2 The application scenarios and Fig. 9In the message structure shown, as the head node of the forwarding path, network device S has placed prefix and C-SID 1 in the SID list in the DA field of the first message, and the content prefix+C-SID 1 in the DA field of the first message restores SID 1. Network device S searches the local forwarding table entry according to SID 1, determines that the next-hop network device is network device 1, and sends the first message to network device 1. The endpoint node on the message forwarding path receives the message in turn, updates the content of the DA field according to the SID list, and then forwards the message according to the content of the DA field, so that the message is sent along the forwarding path corresponding to the SID list.
[0207] S140, the network device 102 receives the first message.
[0208] The network device 102 is an endpoint node other than the head node on the message forwarding path. The network device 102 can be Figure 2 The network devices 1 to 9 in the application scenario shown. The network device 102 receives a message sent by the previous hop network device in the forwarding path. When the network device 102 is Figure 2 When the network device 1 is shown, the first message received by the network device 1 is the message sent by the network device S, that is, the SRv6 data message after the network device S encapsulates the SID list. Figure 2 In the case of the network devices 2 to 9 shown, the first message received by the network devices 2 to 9 is the SRv6 data message updated by the previous-hop network device.
[0209] S150, the network device 102 determines that the value of the destination address field of the message header of the first message matches the local segment identifier.
[0210] The local segment identifier is a locally instantiated SRv6 SID in the FIB stored by the network device 102 .
[0211] As an endpoint node on the forwarding path, after receiving the first message, the network device 102 searches the FIB for the SID in the DA field of the IPv6 message header of the first message. If the SID in the DA field matches the locally instantiated SRv6 SID, for example, the SID in the DA field is the same as the locally instantiated SRv6 SID, the message processing behavior corresponding to the locally instantiated SRv6 SID is executed.
[0212] S160, the network device 102 determines the content to be copied in the SID list according to the indication of the local segment identifier.
[0213] Optionally, the step S160 may be included in the message processing behavior corresponding to the SRv6 SID of the local embodiment, and the step S160 may also be a behavior performed separately by the network device 102 in addition to executing the message processing behavior corresponding to the SRv6 SID of the local embodiment.
[0214] Optionally, the step S160 includes two steps S1601 and S1602.
[0215] S1601, the network device 102 determines the position of the content to be copied in the SID list according to the length indicated by the local segment identifier.
[0216] S1602: The network device 102 determines the content to be copied according to the position of the content to be copied in the SID list.
[0217] After the network device 102 matches the local segment identifier according to the content of the DA field of the first message, it can know the length indicated by the local segment identifier. The length indicated by the local segment identifier can be the length of the G-SID in the SID list corresponding to the local segment identifier. For convenience, the G-SID in the SID list corresponding to the local segment identifier can be called the local G-SID, and the length of the G-SID in the SID list corresponding to the local segment identifier can be called the length of the local G-SID, that is, the length indicated by the local segment identifier is the length of the local G-SID. In combination with the above description, the local G-SID can be the C-SID of the first type or the C-SID of the second type.
[0218] That is, when the local segment identifier corresponds to the C-SID in the SID list, that is, when the local G-SID is the C-SID, the length indicated by the local segment identifier is the length of the C-SID. Figure 2 The application scenarios and Fig. 9 In the message structure shown, for network device 1, the length of the local segment identifier indication is 16 bits, and for network device 5, the length of the local segment identifier indication is 32 bits. Similarly, when the local G-SID is SID, the length of the local segment identifier indication is the length of SID, that is, 128 bits.
[0219] The content to be copied is the content of the DA field that the network device 102 will update to the first message. In combination with the message processing mechanism of the SRv6 network, the content to be copied includes a to-be-copied identifier, which is the G-SID corresponding to the next-hop network device of the network device 102 on the forwarding path in the SID list, or the G-SID corresponding to the link of the next-hop network device. Thus, after updating the content to be copied to the DA field of the first message to generate the second message, the network device 102 can continue to forward the second message according to the content in the DA field.
[0220] As mentioned above, in the first message, the G-SID in the SID list pointed to by the extended pointer is the G-SID included in the DA field, that is, the local G-SID. For the network device 102, the content to be copied includes the identifier to be copied, and the identifier to be copied is the G-SID corresponding to the next-hop network device of the network device 102 on the forwarding path in the SID list, or the G-SID corresponding to the link of the next-hop network device. In other words, the identifier to be copied is the next G-SID of the local G-SID of the network device 102 in the SID list. Therefore, the network device 102 needs to adjust the value of the extended pointer so that the extended pointer points to the content to be copied, that is, points to the identifier to be copied, so as to determine the position of the content to be copied in the SID list.
[0221] When all C-SIDs in the same SRv6 compression sub-path have the same length, the network device will offset the pointer position by the same length, so that the pointer points to the next C-SID in the SID list. However, in the embodiment of the present application, C-SIDs of different lengths are mixed and arranged in the same SRv6 compression sub-path, so the length of the pointer position offset may be different at different network devices.
[0222] In the embodiment of the present application, the network device 102 determines the position of the content to be copied in the SID list according to the length indicated by the local segment identifier, specifically, the network device 102 offsets the position of the extended pointer according to the length indicated by the local segment identifier, and the length of the extended pointer offset is equal to the length indicated by the local segment identifier, that is, the length of the extended pointer offset is equal to the length of the local G-SID. Thus, in the SID list, the position of the extended pointer is updated from pointing to the G-SID corresponding to the local segment identifier to pointing to the next G-SID of the G-SID corresponding to the local segment identifier, that is, the extended pointer points to the content to be copied.
[0223] In order to achieve that the length of the extended pointer offset is equal to the length indicated by the local segment identifier, when the extended pointer is the one-dimensional pointer or the two-dimensional pointer, the adjustment process of the value of the extended pointer is different.
[0224] When the extended pointer is the two-dimensional pointer, the adjustment process of the extended pointer includes: the network device 102 determines the value of SI according to the length indicated by the local segment identifier, so that the value of SI is used to indicate the position of the content to be copied in the element with a length of 128 bits. Specifically, the network device 102 reads the original value of SI in the message header of the first message, and subtracts the updated value from the original value of SI to obtain the value of SI. It can be seen that the length corresponding to the updated value is the length of the SI offset, that is, the length corresponding to the updated value is the length of the local G-SID.
[0225] For different network devices, the local G-SID may be the first type of C-SID or the second type of C-SID, that is, the length of the local G-SID may be different. Therefore, the update value may be different for different network devices. Optionally, the update value may be a value obtained by dividing the length of the local G-SID by the unit length. In other words, the length corresponding to the update value is an integer multiple of the unit length, that is, the length of the SI offset is an integer multiple of the unit length. For example, when the unit length is 16 bits, the length indicated by the local segment identifier is 16 bits, the update value is 1, and the length indicated by the segment identifier is 32 bits, then the update value is 2. Preferably, the unit length is the length of the first type of C-SID.
[0226] Furthermore, the network device 102 determines the position of the content to be copied in the element with a length of 128 bits according to the value of SI, and determines the position of the element in the SID list according to the value of SL pointer. It is worth noting that in this process, the value of SL pointer may need to be adjusted. And after adjusting the value of SL pointer, the value of SI may need to be set to the initial value. For example, when the local G-SID is the last G-SID in the element, that is, the next G-SID of the local G-SID in the SID list will be located in the next element, then the value of SL pointer needs to be adjusted so that SL pointer points to the next element, and the value of SI is set to the initial value so that SI points to the first G-SID in the next element. Or, when SI points to the padding part in the current element after offset, for example, when the value of SI is 1 and the remaining 16 bits in the element are all 0, or when the value of SI is 2 and the remaining 32 bits in the element are all 0, then the value of SL pointer needs to be adjusted so that SL pointer points to the next element.
[0227] When the extended pointer is the one-dimensional pointer, the adjustment process of the extended pointer includes: the network device 102 determines the value of SI according to the length indicated by the local segment identifier, so that the value of SI is used to indicate the position of the content to be copied in the SID list; the network device 102 determines the position of the content to be copied in the SID list according to the value of SI. Specifically, the network device 102 reads the original value of SI in the message header of the first message, and subtracts the updated value from the original value of SI to obtain the value of SI. The updated value of SI is similar to the above description and will not be repeated here.
[0228] Optionally, the network device 102 writes the value of the extension pointer into the first message, that is, the message header of the updated first message, that is, the message header of the second message to be described later, includes the value of the extension pointer.
[0229] S170, the network device 102 copies the content to be copied to the destination address field to generate a second message. The second message is a message including the updated DA field.
[0230] When all C-SIDs in the same SRv6 compression sub-path have the same length, each time the network device updates the DA field in the message, the length of the content to be copied is the same, and the length of the content to be copied is the same as the length of all C-SIDs. However, in the embodiment of the present application, C-SIDs of different lengths are mixed and arranged in the same SRv6 compression sub-path, so the length of the content to be copied cannot be the same as the length of all C-SIDs.
[0231] In an embodiment of the present application, the length of the content to be copied is the same as the length of the second type of C-SID, or the length of the content to be copied is 128 bits. Among them, the second type of C-SID is the C-SID with the longest length. Specifically, when the local G-SID carries the COC information, the next G-SID in the SID list is still a C-SID, that is, the identifier to be copied is still a C-SID, and the length of the content to be copied is the same as the length of the second type of C-SID. When the local G-SID does not carry the COC information, that is, when the identifier to be copied is a SID, the length of the content to be copied is 128 bits. For example, the length of the first type of C-SID is 16 bits, the length of the second type of C-SID is 32 bits, and the length of the content to be copied is 32 bits. Therefore, regardless of whether the identifier to be copied is the first type of C-SID or the second type of C-SID, the length of the content to be copied is greater than or equal to the length of the identifier to be copied, thereby ensuring that the next G-SID is completely updated to the DA field of the first message. It can be seen that the content to be copied includes the identifier to be copied, and the length of the content to be copied is greater than or equal to the length of the identifier to be copied.
[0232] Optionally, the length of the content to be copied may be configured in the network device 102 , or the length of the content to be copied may be carried in the first message and read by the network device 102 from the first message.
[0233] Optionally, the length of the content to be copied can be determined based on the local segment identifier. Specifically, when the local G-SID carries the COC information, the identifier to be copied is still the C-SID, and the network device 102 places the content to be copied after the prefix in the DA field, overwriting the original local G-SID, so that the identifier to be copied and the prefix are restored to the SID corresponding to the identifier to be copied. When the local G-SID does not carry the COC information, that is, when the identifier to be copied is the SID, the network device 102 places the content to be copied in the DA field, overwriting 128 bits including the prefix, so that the DA field only includes the content to be copied.
[0234] Optionally, the length of the content to be copied can also be determined by parsing the partial content of the next element in the segment list. Specifically, when the current identifier is the last sub-element in the element, the network device 102 parses the partial content of the next element, that is, the content to be copied. If the partial content of the next element is not the common part of the prefix in each segment sub-path, it is determined that the C-SID in the SID list continues to be arranged, that is, the current SRv6 compression sub-path has not ended, the identifier to be copied is still C-SID, and the network device 102 places the content to be copied after the prefix in the DA field, overwriting the original local G-SID, so that the identifier to be copied and the prefix are restored to the SID corresponding to the identifier to be copied; if the partial content of the next element is the common part of the prefix in each segment sub-path, it is determined that the C-SID in the SID list is no longer arranged, that is, the current SRv6 compression sub-path ends, the identifier to be copied is SID, and the network device 102 places the content to be copied in the DA field, overwriting 128 bits including the prefix, so that the DA field only includes the content to be copied.
[0235] Combination Figure 2 The application scenarios and Fig. 9 The message structure shown is used as an example. Among them, the length of the first type of C-SID is 16 bits, the length of the second type of C-SID is 32 bits, the unit length is the length of the first type of C-SID, that is, 16 bits, and the length to be copied is the length of the second type of C-SID, that is, 32 bits.
[0236] When the network device 102 is the network device 1, the network device 1 receives a message, the value of the SL pointer in the message is 2, the value of the SI is 8, the DA field includes C-SID 1, C-SID 1 is a first type of C-SID, that is, the length of the local segment identifier is 16 bits, the update value of SI is 1, the value of SI is 7, and segment[SL][SI] points to C-SID 2. The network device 1 uses the 32 bits starting from this as the content to be copied, that is, the content to be copied includes C-SID 2 and C-SID 3. The network device 1 copies C-SID 2 and C-SID 3 to the second field of the message. The updated message is as follows: Fig.10 As shown in the figure, the length of prefix can be 64 bits.
[0237] When the network device 102 is the network device 2, the network device 2 receives the message, the value of the SL pointer in the message is 2, the value of the SI is 7, the DA field includes C-SID 2, C-SID 2 is the first type of C-SID, that is, the length of the local segment identifier indication is 16 bits, the update value of SI is 1, the value of SI is 6, and at this time segment[SL][SI] points to C-SID 3. The network device 2 uses the 32 bits starting from this as the content to be copied, that is, the content to be copied includes C-SID 3 and C-SID 4. The network device 2 copies C-SID 3 and C-SID 4 to the second field of the message. The updated message is as follows: Fig.11 shown.
[0238] When the network device 102 is the network device 3, the network device 3 receives the message, the value of the SL pointer in the message is 2, the value of the SI is 6, the DA field includes C-SID 3, C-SID 3 is the first type of C-SID, that is, the length of the local segment identifier indication is 16 bits, the update value of SI is 1, the value of SI is 5, and segment[SL][SI] points to C-SID 4. The network device 3 uses the 32 bits starting from this as the content to be copied, that is, the content to be copied includes the first 16 bits of C-SID 4 and C-SID 5. The network device 3 copies the first 16 bits of C-SID 4 and C-SID 5 to the second field of the message. The updated message is as follows: Fig.12 shown.
[0239] When the network device 102 is the network device 4, the network device 4 receives the message, the value of the SL pointer in the message is 2, the value of the SI is 5, the DA field includes C-SID 4, C-SID 4 is the first type of C-SID, that is, the length of the local segment identifier is 16 bits, the update value of SI is 1, the value of SI is 4, and segment[SL][SI] points to C-SID 5. The network device 4 uses the 32 bits starting from this as the content to be copied, that is, the content to be copied includes C-SID 5. The network device 4 copies C-SID 5 to the second field of the message. The updated message is as follows: Fig.13 shown.
[0240] When the network device 102 is the network device 5, the network device 5 receives the message, the value of the SL pointer in the message is 2, the value of the SI is 4, the DA field includes C-SID 5, C-SID 5 is the second type of C-SID, that is, the length of the local segment identifier indication is 32 bits, the update value of SI is 2, the value of SI is 2, and at this time segment[SL][SI] points to C-SID 6. The network device 5 uses the 32 bits starting from this as the content to be copied, that is, the content to be copied includes C-SID 6. The network device 5 copies C-SID 6 to the second field of the message. The updated message is as follows: Fig.14 shown.
[0241] When the network device 102 is the network device 6, the network device 6 receives a message, the value of the SL pointer in the message is 2, the value of the SI is 2, the DA field includes C-SID 6, C-SID 6 is the second type of C-SID, that is, the length of the local segment identifier indication is 32 bits, the update value of the SI is 2, the value of the SI is 0, that is, the C-SID is the last G-SID in container 1, the network device 6 reduces the value of the SL pointer by 1, that is, the value of SL is 1, and the SI is set to the initial value 8. At this time, segment[SL][SI] points to C-SID 7 in container 2. The network device 6 uses the 32 bits starting from this as the content to be copied, that is, the content to be copied includes C-SID7. The network device 6 copies C-SID 7 to the second field of the message. The updated message is as follows: Fig.15 shown.
[0242] When the network device 102 is the network device 7, the network device 7 receives the message, the value of the SL pointer in the message is 1, the value of the SI is 8, the DA field includes C-SID 7, C-SID 7 is the second type of C-SID, that is, the length of the local segment identifier indication is 32 bits, the update value of SI is 2, the value of SI is 6, and at this time segment[SL][SI] points to C-SID 8. The network device 7 uses the 32 bits starting from this as the content to be copied, that is, the content to be copied includes C-SID 8 and C-SID 9. The network device 7 copies C-SID 8 and C-SID 9 to the second field of the message. The updated message is as follows: Fig.16 shown.
[0243] When the network device 102 is the network device 8, the network device 8 receives a message, the value of the SL pointer in the message is 1, the value of the SI is 6, the DA field includes C-SID 8, C-SID 8 is a first type of C-SID, that is, the length of the local segment identifier is 16 bits, the update value of SI is 1, the value of SI is 5, and segment[SL][SI] points to C-SID 9. The network device 8 uses the 32 bits starting from this as the content to be copied, that is, the content to be copied includes C-SID 9 and 16 bits of padding. The network device 8 copies C-SID 9 and 16 bits of padding to the second field of the message. The updated message is as follows: Fig.17 shown.
[0244] When the network device 102 is the network device 9, the network device 9 receives a message, the value of the SL pointer in the message is 1, the value of the SI is 5, the DA field includes C-SID 9, C-SID 9 is a first type of C-SID, that is, the length of the local segment identifier indication is 16 bits, the update value of SI is 1, the value of SI is 4, and at this time segment[SL][SI] points to the padding part. The network device 9 reduces the value of the SL pointer by 1, that is, the value of SL is 0, and because C-SID 9 does not carry the COC information, the network device 9 copies the 128-bit length of SID 10 to the second field of the message. The updated message is as follows: Fig.18 shown.
[0245] For example, when a two-dimensional pointer is used, the unit length is 16 bits, the first type of C-SID is 16 bits, and the second type of C-SID is 32 bits. The pseudo code corresponding to the local segment identifier in the network device 102 is as follows. In the embodiment of the present application, the two-dimensional pointer adjustment process and the DA field update process performed at the network device 102 can refer to the pseudo code, including but not limited to Fig. 9 The message structure shown will not be repeated here.
[0246]
[0247]
[0248] S180, the network device 102 sends the second message.
[0249] Optionally, the network device 102 determines the next hop network device of the message according to the longest match rule based on the content of the DA field of the second message. Figure 2 The application scenarios and Fig.10In the message structure shown, when the network device 102 is the network device 1, the prefix+C-SID 2 in the DA field of the second message is restored to SID 2, the network device 1 searches the local forwarding table entry according to SID 2, determines that the next-hop network device is the network device 2, and sends the second message to the network device 2. When the network device 102 is the network device 2 to 9, the process of the network device 102 sending the second message according to the content of the destination address field is similar, and is not repeated here.
[0250] In an actual network, the forwarding path of a message can be generated by a controller or by a head node of the forwarding path. When the controller generates the forwarding path of a message, the controller also generates a segment list indicating the forwarding path. The controller sends the segment list to the head node of the forwarding path. After receiving the message, the head node of the forwarding path determines the forwarding path of the message from a number of forwarding paths stored inside the device, and determines the segment list corresponding to the forwarding path. The segment list is added to the message to guide the forwarding of the message.
[0251] An embodiment of the present invention provides a method for forwarding a message. Fig.19 2 shows a method flow chart of method 200. The method involves controller 201, network device 202 and network device 203. Controller 201 may be a controller in a network, configured to calculate a forwarding path of a message and generate a segment list indicating the forwarding path, such as Figure 2 The controller in the application scenario shown, Figure 2 The controller is not shown. The network device 201 is a head node on the message forwarding path. Figure 2 As shown by the dashed line, the network device 201 may be Figure 2 In the application scenario shown in FIG. 1 , the network device S is a network device other than the head node on the message forwarding path. For example, the network device 202 may be Figure 2 The network devices 1 to 9 in the application scenario shown. The steps of the method 200 include:
[0252] S210, the controller 201 determines a forwarding path for the first message.
[0253] The controller 201 can be connected with Figure 2 In the network device S, network devices 1 to 10 are connected. The controller can calculate the forwarding path of the message according to the network topology.
[0254] S215, the controller 201 generates the segment list corresponding to the forwarding path, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each of the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length.
[0255] In the segment list, C-SIDs of different lengths are mixed and arranged in the same SRv6 compression sub-path. For specific details of the segment list, reference may be made to the description of step S110, and similarities will not be repeated here.
[0256] S220: The controller 201 sends the segment list to the ingress device of the forwarding path.
[0257] The ingress device of the forwarding path is the network device 202, that is, the controller 201 sends the segment list to the network device 202. Specifically, the controller 201 may send a control message to the network device 202, and the control message includes the segment list.
[0258] S230, the network device 202 generates a first message, where the first message includes the segment list, and the first message is forwarded along the forwarding path.
[0259] The network device 202 may be an ingress device of the SRv6 network. After receiving the data message, the network device 202 determines the forwarding path of the data message from a plurality of forwarding paths stored inside the device, and determines a segment list corresponding to the forwarding path. The segment list is added to the data message to generate an SRv6 message, namely, the first message.
[0260] Combination Figure 2 In the application scenario shown, the specific process of step S230 can refer to the description of step S120, and the similarities are not repeated here.
[0261] S235, the network device 202 sends the first message according to the segment list.
[0262] Combination Figure 2 In the application scenario shown, the specific process of step S235 can refer to the description of step S130, and the similarities are not repeated here.
[0263] S240, the network device 203 receives the first message.
[0264] Combination Figure 2 In the application scenario shown, the specific process of step S240 can refer to the description of step S140, and the similarities are not repeated here.
[0265] S245, the network device 203 determines that the content of the destination address field of the message header of the first message matches the local segment identifier.
[0266] Combination Figure 2 In the application scenario shown, the specific process of step S245 can refer to the description of step S150, and the similarities are not repeated here.
[0267] S250: The network device 203 determines the content to be copied in the segment list according to the indication of the local segment identifier.
[0268] Combination Figure 2 In the application scenario shown, the specific process of step S250 can refer to the description of step S160, and the similarities are not repeated here.
[0269] S255, the network device 203 copies the content to be copied to the destination address field to generate a second message.
[0270] Combination Figure 2 In the application scenario shown, the specific process of step S255 can refer to the description of step S170, and the similarities are not repeated here.
[0271] S260, the network device 203 sends the second message.
[0272] Combination Figure 4 In the application scenario shown, the specific process of step S260 can refer to the description of step S180, and the similarities are not repeated here.
[0273] The above describes the method 100 and the method 200 of the embodiments of the present application. Corresponding to the above methods, the embodiments of the present application also provide a device for forwarding messages.
[0274] Fig. 20 is a schematic diagram of the structure of a network device 2000 provided in an embodiment of the present application, the device has the above Figure 8 In the method embodiment shown, the network device 101 or the above Fig.19 The network device 2000 may be a part of the network device 101 or the network device 202, or may be the network device 101 or the network device 202 itself. It should be understood that the network device 2000 may include more additional components than the components shown or omit some of the components shown therein, and the embodiments of the present application are not limited thereto. Fig. 20 As shown, the network device 2000 includes:
[0275] The processing unit 2002 is configured to generate a first message, wherein the first message includes a segment list corresponding to a forwarding path of the first message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; the processing unit 2002 may execute Figure 8 Step S120 or Fig.19 Step S230 shown;
[0276] The sending unit 2003 is configured to send the first message according to the segment list; the sending unit 2003 may execute FIG. Figure 8 Step S130 or Fig.19 Step S235 shown.
[0277] Optionally, the network device 2000 further includes:
[0278] The receiving unit 2001 is configured to receive the segment list from a controller in the network.
[0279] It should be understood that when the network device 2000 forwards a message, the division of the above-mentioned functional modules / units is only used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules / units as needed, that is, the internal structure of the network device 2000 is divided into different functional modules to complete all or part of the functions described above. Figure 8 The method 100 shown or Fig.19 The method 200 shown belongs to the same concept, and its specific implementation process is detailed in the steps of method 100 and method 200, which will not be repeated here.
[0280] In some embodiments, each unit in the network device 2000 is integrated into a processing unit. For example, each unit in the network device 2000 is integrated on the same chip. The chip includes a processing circuit and an input interface and an output interface that are connected and communicated with the internal part of the processing circuit. The processing unit 2002 is implemented by the processing circuit in the chip. The receiving unit 2001 is implemented by the input interface in the chip. The sending unit 2003 is implemented by the output interface in the chip. For example, the chip is implemented by one or more field programmable gate arrays (field-programmable gate array, English abbreviation: FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits that can perform the various functions described throughout this application.
[0281] In other embodiments, each unit in the network device 2000 exists physically separately. In other embodiments, some units of the network device 2000 exist physically separately, and other units are integrated into one unit. For example, in some embodiments, the receiving unit 2001 and the sending unit 2003 are the same unit. In other embodiments, the receiving unit 2001 and the sending unit 2003 are different units. In some embodiments, the integration of different units is implemented in the form of hardware, that is, different units correspond to the same hardware. For another example, the integration of different units is implemented in the form of software units.
[0282] In the case of being implemented by hardware in the network device 2000, for example, the processing unit 2002 in the network device 2000 is implemented by, for example, the processor 2301 in the device 2300. The receiving unit 2001 and the sending unit 2003 in the network device 2000 are implemented by, for example, the communication interface 2303 in the device 2300. For another example, the processing unit 2002 in the network device 2000 is implemented by, for example, at least one of the central processor 2411, the central processor 2431, or the network processor 2432 in the device 2400. The receiving unit 2001 and the sending unit 2003 in the network device 2000 are implemented by, for example, the physical interface card 2432 in the device 2400 or at least one of the physical interface cards 2432.
[0283] In the case where the network device 2000 is implemented by software, each unit in the network device 2000 is, for example, software generated after the processor in the device 2300 or the device 2400 reads the program code stored in the memory. For example, the network device 2000 is a virtualized device. Virtualized devices include but are not limited to at least one of virtual machines, containers, and Pods. In some embodiments, the network device 2000 is deployed on a hardware device (such as a physical server) in the form of a virtual machine. For example, the network device 2000 is implemented based on a general physical server in combination with the Network Function Virtualization (NFV) technology. When implemented in the form of a virtual machine, the network device 2000 is, for example, a virtual host, a virtual router, or a virtual switch. Those skilled in the art can virtualize the network device 2000 on a general physical server in combination with the NFV technology by reading this application. In other embodiments, the network device 2000 is deployed on a hardware device in the form of a container (such as a docker container). For example, the process of the network device 2000 executing the above method embodiment is encapsulated in an image file, and the hardware device creates the network device 2000 by running the image file. In some other embodiments, the network device 2000 is deployed on a hardware device in the form of a Pod. The Pod includes multiple containers, each of which is used to implement one or more units in the network device 2000.
[0284] Fig.21 is a schematic diagram of the structure of a network device 2100 provided in an embodiment of the present application, the device having the above Figure 8 In the method embodiment shown, the network device 102 or the above Fig.19 The network device 2100 may be a part of the network device 102 or the network device 203, or may be the network device 102 or the network device 203 itself. It should be understood that the network device 2100 may include more additional components than the components shown or omit some of the components shown therein, and the embodiments of the present application are not limited thereto. Fig.21 As shown, the network device 2100 includes:
[0285] A receiving unit 2101 is configured to receive a first message, wherein the first message includes a segment list corresponding to a forwarding path of the first message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; the receiving unit 2101 may execute Figure 8 Step S140 or Fig.19 Step S240 shown;
[0286] The processing unit 2102 is configured to determine whether the content of the destination address field of the message header of the first message matches the local segment identifier, determine the content to be copied in the segment list according to the indication of the local segment identifier, and copy the content to be copied to the destination address field to generate a second message; the processing unit 2102 may execute Figure 8 Steps S150, S160, S170 or Fig.19 Steps S245, S250, S255 shown;
[0287] The sending unit 2103 is configured to send the second message; the sending unit 2103 may execute Figure 8 Step S180 or Fig.19 Step S260 is shown.
[0288] It should be understood that when the network device 2100 forwards a message, the division of the above-mentioned functional modules / units is only used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules / units as needed, that is, the internal structure of the network device 2100 is divided into different functional modules to complete all or part of the functions described above. Figure 8 The method 100 shown or Fig.19 The method 200 shown belongs to the same concept, and its specific implementation process is detailed in the steps of method 100 and method 200, which will not be repeated here.
[0289] In some embodiments, each unit in the network device 2100 is integrated into a processing unit. For example, each unit in the network device 2100 is integrated on the same chip. The chip includes a processing circuit and an input interface and an output interface that are connected and communicated with the internal processing circuit. The processing unit 2102 is implemented by the processing circuit in the chip. The receiving unit 2101 is implemented by the input interface in the chip. The sending unit 2103 is implemented by the output interface in the chip. For example, the chip is implemented by one or more field programmable gate arrays (field-programmable gate array, English abbreviation: FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits that can perform the various functions described throughout this application.
[0290] In other embodiments, each unit in the network device 2100 exists physically separately. In other embodiments, some units of the network device 2100 exist physically separately, and other units are integrated into one unit. For example, in some embodiments, the receiving unit 2101 and the sending unit 2103 are the same unit. In other embodiments, the receiving unit 2101 and the sending unit 2103 are different units. In some embodiments, the integration of different units is implemented in the form of hardware, that is, different units correspond to the same hardware. For another example, the integration of different units is implemented in the form of software units.
[0291] In the case of being implemented by hardware in the network device 2100, for example, the processing unit 2102 in the network device 2100 is implemented by, for example, the processor 2301 in the device 2300. The receiving unit 2101 and the sending unit 2103 in the network device 2100 are implemented by, for example, the communication interface 2303 in the device 2300. For another example, the processing unit 2102 in the network device 2100 is implemented by, for example, at least one of the central processor 2411, the central processor 2431, or the network processor 2432 in the device 2400. The receiving unit 2101 and the sending unit 2103 in the network device 2100 are implemented by, for example, the physical interface card 2432 in the device 2400 or at least one of the physical interface cards 2432.
[0292] In the case where the network device 2100 is implemented by software, each unit in the network device 2100 is, for example, software generated after the processor in the device 2300 or the device 2400 reads the program code stored in the memory. For example, the network device 2100 is a virtualized device. Virtualized devices include but are not limited to at least one of virtual machines, containers, and Pods. In some embodiments, the network device 2100 is deployed on a hardware device (such as a physical server) in the form of a virtual machine. For example, the network device 2100 is implemented based on a general physical server in combination with the Network Function Virtualization (NFV) technology. When implemented in the form of a virtual machine, the network device 2100 is, for example, a virtual host, a virtual router, or a virtual switch. Those skilled in the art can virtualize the network device 2100 on a general physical server in combination with the NFV technology by reading this application. In other embodiments, the network device 2100 is deployed on a hardware device in the form of a container (such as a docker container). For example, the process of the network device 2100 executing the above method embodiment is encapsulated in an image file, and the hardware device creates the network device 2100 by running the image file. In some other embodiments, the network device 2100 is deployed on a hardware device in the form of a Pod. The Pod includes multiple containers, each of which is used to implement one or more units in the network device 2100.
[0293] Fig. 22 is a schematic diagram of the structure of a network device 2200 provided in an embodiment of the present application, the device has the above Figure 8 In the method embodiment shown, the network device 101 or Fig.19 The network device 2200 may be a part of the network device 101 or the controller 201, or may be the network device 101 or the controller 201 itself. It should be understood that the network device 2200 may include more additional components than the components shown or omit some of the components shown, and the embodiments of the present application are not limited thereto. Fig.21 As shown, the network device 2200 includes:
[0294] The processing unit 2201 is used to determine the forwarding path of the message, generate the segment list corresponding to the forwarding path, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; the receiving unit 2201 can execute Figure 8 Step S110 or Fig.19 Steps S210, S215 are shown.
[0295] Optionally, the network device 2200 further includes:
[0296] The sending unit 2202 is configured to send the segment list to the ingress device of the forwarding path; the sending unit 2202 may execute Fig.19 Step S220 is shown.
[0297] It should be understood that when the network device 2200 generates a segment list, only the division of the above-mentioned functional modules / units is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules / units as needed, that is, the internal structure of the network device 2200 is divided into different functional modules to complete all or part of the functions described above. Figure 8 The method 100 shown or described above Fig.19 The method 200 shown belongs to the same concept, and its specific implementation process is detailed in the steps of method 100 or method 200, which will not be repeated here.
[0298] In some embodiments, each unit in the network device 2200 is integrated into a processing unit. For example, each unit in the network device 2200 is integrated on the same chip. The chip includes a processing circuit and an input interface and an output interface that are connected and communicated with the internal processing circuit. The processing unit 2201 is implemented by the processing circuit in the chip. The sending unit 2202 is implemented by the output interface in the chip. For example, the chip is implemented by one or more field programmable gate arrays (field-programmable gate array, English abbreviation: FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits that can perform the various functions described throughout this application.
[0299] In other embodiments, each unit in the network device 2200 exists physically separately. In other embodiments, some units of the network device 2200 exist physically separately, and other units are integrated into one unit. For example, in some embodiments, the processing unit 2201 and the sending unit 2202 are the same unit. In other embodiments, the processing unit 2201 and the sending unit 2202 are different units. In some embodiments, the integration of different units is implemented in the form of hardware, that is, different units correspond to the same hardware. For another example, the integration of different units is implemented in the form of software units.
[0300] In the case of being implemented by hardware in the network device 2200 , for example, the processing unit 2201 in the network device 2200 is implemented by, for example, the processor 2301 in the device 2300 . The sending unit 2202 in the network device 2200 is implemented by, for example, the communication interface 2303 in the device 2300 .
[0301] In the case where the network device 2200 is implemented by software, each unit in the network device 2200 is, for example, software generated after the processor in the device 2300 reads the program code stored in the memory. For example, the network device 2200 is a virtualized device. Virtualized devices include but are not limited to at least one of virtual machines, containers, and Pods. In some embodiments, the network device 2200 is deployed on a hardware device (such as a physical server) in the form of a virtual machine. For example, the network device 2200 is implemented based on a general physical server in combination with the Network Function Virtualization (NFV) technology. When implemented in the form of a virtual machine, the network device 2200 is, for example, a virtual host, a virtual router, or a virtual switch. Those skilled in the art can virtualize the network device 2200 on a general physical server in combination with the NFV technology by reading this application. In other embodiments, the network device 2200 is deployed on a hardware device in the form of a container (such as a docker container). For example, the process of the network device 2200 executing the above method embodiment is encapsulated in an image file, and the hardware device creates the network device 2200 by running the image file. In some other embodiments, the network device 2200 is deployed on a hardware device in the form of a Pod. The Pod includes multiple containers, each of which is used to implement one or more units in the network device 2200.
[0302] The hardware structure of device 2300 is introduced below.
[0303] See also Fig.23 , Fig.23 FIG. 2 shows a schematic diagram of the structure of a device 2300 provided by an exemplary embodiment of the present application. Optionally, the device 2300 is configured as a network device or a controller. In other words, the above Figure 8 The network device 101 and the network device 102 in the method 100 shown in FIG. Fig.19 The controller 201, the network device 202, and the network device 203 in the method 200 shown are optionally implemented by a device 2300. The device 2300 is, for example, a network device, such as a switch, a router, etc. Alternatively, the device 2300 is, for example, a computing device, such as a host, a server, or a personal computer, etc. The device 2300 can be implemented by a general bus architecture.
[0304] like Fig.23 As shown, the device 2300 includes at least one processor 2301 , a memory 2302 , and at least one communication interface 2303 .
[0305] The processor 2302 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing units (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 2302 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present invention. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0306] Optionally, the device 2300 further includes a bus. The bus is used to transmit information between the components of the device 2300. The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.23 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0307] The memory 2302 is, for example, a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2302 is, for example, independent and connected to the processor 2301 via a bus. The memory 2302 can also be integrated with the processor 2301.
[0308] The communication interface 2303 uses any transceiver-like device to communicate with other devices or communication networks, and the communication network can be Ethernet, a radio access network (RAN) or a wireless local area network (WLAN), etc. The communication interface 2303 can include a wired communication interface and can also include a wireless communication interface. Specifically, the communication interface 2303 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a wireless local area network (WLAN) interface, a cellular network communication interface or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. In an embodiment of the present application, the communication interface 2303 can be used to receive and send control messages and data messages.
[0309] In a specific implementation, as an embodiment, the processor 2301 may include one or more CPUs, such as Fig.23 0 and CPU1 shown in FIG. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0310] In a specific implementation, as an embodiment, the device 2300 may include multiple processors, such as Fig.23 2301 and processor 2310 shown in . Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0311] In a specific implementation, as an embodiment, the device 2300 may also include an output device and an input device. The output device communicates with the processor 2301 and can display information in a variety of ways. For example, the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 2301 and can receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensor device.
[0312] In some embodiments, the memory 2302 is used to store the program code 2320 for executing the solution of the present application, and the processor 2301 can execute the program code 2320 stored in the memory 2302. That is, the device 2300 can implement the message forwarding method provided by the method embodiment through the processor 2301 and the program code 2320 in the memory 2302. The program code may include one or more software modules. Optionally, the processor 2301 itself may also store the program code or instruction for executing the solution of the present application.
[0313] In a specific embodiment, the processor of device 2300 is used to generate a first message, the first message includes a segment list corresponding to the forwarding path of the first message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, the first length is less than the second length, and the first message is sent through the communication interface according to the segment list. Please refer to the above for the detailed processing process of the processor Figure 8 In the embodiment shown, steps S120, S130 and Fig.19 The detailed description of steps S230 and S235 in the illustrated embodiment will not be repeated here.
[0314] In a specific embodiment, the processor of device 2300 is used to receive a first message through a communication interface, wherein the first message includes a segment list corresponding to a forwarding path of the first message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; determine that the content of the destination address field of the message header of the first message matches the local segment identifier, determine the content to be copied in the segment list according to the indication of the local segment identifier, copy the content to be copied to the destination address field to generate a second message; and send the second message through the communication interface. Please refer to the above for the detailed processing process of the processor. Figure 8 In the embodiment shown, steps S140, S150, S160, S170, S180 and Fig.19 The detailed description of steps S240, S245, S250, S255, and S260 in the illustrated embodiment will not be repeated here.
[0315] In a specific embodiment, the processor of device 2300 is used to determine the forwarding path of the message, generate the segment list corresponding to the forwarding path, the segment list includes multiple compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the multiple compressed segment identifiers is less than 128 bits, the multiple compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length. Please refer to the above for detailed processing of the processor Figure 8 Step S110 and Fig.19 The detailed description of steps S210 and S220 in the illustrated embodiment will not be repeated here.
[0316] See also Fig.24 , Fig.24 FIG. 2 shows a schematic diagram of the structure of a device 2400 provided by an exemplary embodiment of the present application. Optionally, the device 2400 is configured as a network device. In other words, the above Figure 8 The network device 101 and the network device 102 in the method 100 shown, and Fig.19 The network device 202 and the network device 203 in the method 200 shown in the figure can be optionally implemented by the device 2400. For example, the device 2400 is a switch, a router, etc. Fig.24As shown, the device 2400 includes: a main control board 2410 and an interface board 2430 .
[0317] The main control board is also called the main processing unit (MPU) or route processor card. The main control board 2410 is used to control and manage various components in the device 2400, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 2400 includes: a central processing unit 2411 and a memory 2412.
[0318] The interface board 2430 is also called a line processing unit (LPU), a line card or a service board. The interface board 2430 is used to provide various service interfaces and realize the forwarding of data packets. The service interface includes but is not limited to an Ethernet interface, a POS (Packet over SONET / SDH) interface, etc., and the Ethernet interface is, for example, a Flexible Ethernet Clients (FlexE Clients) service interface. The interface board 2430 includes: a central processing unit 2431, a network processor 2432, a forwarding table entry memory 2434 and a physical interface card (PIC) 2433.
[0319] The central processor 2431 on the interface board 2430 is used to control and manage the interface board 2430 and communicate with the central processor 2411 on the main control board 2410 .
[0320] The network processor 2432 is used to implement the forwarding processing of the message. The network processor 2432 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2432 is used to forward the received message based on the forwarding table stored in the forwarding table entry memory 2434. If the destination address of the message is the address of the device 2400, the message is sent to the CPU (such as the central processor 2411) for processing; if the destination address of the message is not the address of the device 2400, the next hop and the output interface corresponding to the destination address are found from the forwarding table according to the destination address, and the message is forwarded to the output interface corresponding to the destination address. Among them, the processing of the uplink message may include: processing of the message input interface, forwarding table search; the processing of the downlink message may include: forwarding table search, etc. In some embodiments, the central processor can also perform the function of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that the forwarding chip is not required in the interface board.
[0321] The physical interface card 2433 is used to implement the physical layer docking function, whereby the original traffic enters the interface board 2430, and the processed message is sent out from the physical interface card 2433. The physical interface card 2433, also called a daughter card, can be installed on the interface board 2430, and is responsible for converting the optical signal into a message and forwarding the message to the network processor 2433 for processing after checking the legitimacy of the message. In some embodiments, the central processor can also perform the functions of the network processor 2432, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 2432 is not required in the interface board 2430.
[0322] Optionally, the device 2400 includes multiple interface boards, for example, the device 2400 further includes an interface board 2440, and the interface board 2440 includes: a central processor 2441, a network processor 2442, a forwarding table entry memory 2444, and a physical interface card 2443. The functions and implementation methods of the components in the interface board 2440 are the same or similar to those of the interface board 2430, and are not described in detail here.
[0323] Optionally, the device 2400 further includes a switching fabric board 2420. The switching fabric board 2420 may also be referred to as a switch fabric unit (SFU). When the network device has multiple interface boards, the switching fabric board 2420 is used to complete data exchange between the interface boards. For example, the interface board 2430 and the interface board 2440 may communicate through the switching fabric board 2420.
[0324] The main control board 2410 is coupled to the interface board 2430. For example, the main control board 2410, the interface board 2430, the interface board 2440, and the switching network board 2420 are connected to the system backplane through a system bus to achieve intercommunication. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 2410 and the interface board 2430, and the main control board 2410 and the interface board 2430 communicate through the IPC channel.
[0325] Logically, the device 2400 includes a control plane and a forwarding plane. The control plane includes a main control board 2410 and a central processing unit 2411. The forwarding plane includes various components for performing forwarding, such as a forwarding table entry memory 2434, a physical interface card 2433, and a network processor 2432. The control plane performs functions such as a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the status of the device. The control plane sends the generated forwarding table to the forwarding plane. On the forwarding plane, the network processor 2432 forwards the message received by the physical interface card 2433 based on the forwarding table sent by the control plane. The forwarding table sent by the control plane can be stored in the forwarding table entry memory 2434. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same device.
[0326] It is worth noting that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly realize load sharing and redundant backup. In a centralized forwarding architecture, network devices may not need switching network boards, and the interface board is responsible for processing the service data of the entire system. In a distributed forwarding architecture, network devices can have at least one switching network board, which realizes data exchange between multiple interface boards and provides large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices with distributed architecture are greater than those of devices with centralized architecture. Optionally, the network device may have only one board, that is, no switching board, and the functions of the interface board and the main control board are integrated on the board. In this case, the central processor on the interface board and the central processor on the main control board can be combined into one central processor on the board to perform the functions of the two. This type of device has low data exchange and processing capabilities (for example, low-end switches or routers and other network devices). The specific architecture to be adopted depends on the specific networking deployment scenario, and no limitation is made here.
[0327] The device 2400 may also correspond to the above Fig. 20 The network device 2000 shown, in some embodiments, Fig. 20 The receiving unit 2001 and the sending unit 2003 in the network device 2000 shown are equivalent to the physical interface card 2433 in the device 2400; the processing unit 2002 in the network device 2000 is equivalent to the network processor 2432, the central processor 2431 or the central processor 2411.
[0328] The device 2400 may also correspond to the above Fig.21 The network device 2100 shown, in some embodiments, Fig.21 The receiving unit 2101 and the sending unit 2103 in the network device 2100 shown are equivalent to the physical interface card 2433 in the device 2400; the processing unit 2102 in the network device 2100 is equivalent to the network processor 2432, the central processor 2431 or the central processor 2411.
[0329] The device 2400 may also correspond to the above Fig. 22 The network device 2200 shown, in some embodiments, Fig. 22The sending unit 2202 in the network device 2200 shown is equivalent to the physical interface card 2433 in the device 2400; the processing unit 2201 in the network device 2200 is equivalent to the network processor 2432, the central processor 2431 or the central processor 2411.
[0330] It should be understood that the device 2400 of this embodiment may correspond to the network device in the above-mentioned method embodiments. The main control board 2410, interface board 2430 and / or 2440 in the device 2400 can implement the functions and / or various steps implemented by the network device in the above-mentioned method embodiments. For the sake of brevity, they will not be repeated here.
[0331] See also Fig.25 The embodiment of the present application provides a system 2500, which includes: a first network device 2501 and a second network device 2502. The first network device 2501 is as follows Figure 8 The device 101 shown or Fig.19 The device 202 shown, the second network device 2502 is as follows Figure 8 The device 102 shown or Fig.19 The device 203 shown. Optionally, the system 2500 also includes a controller 2503. The controller 2503 is as follows Fig. 9 The controller 201 is shown.
[0332] Those of ordinary skill in the art will appreciate that, in conjunction with the various method steps and modules described in the embodiments disclosed herein, they can be implemented in software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0333] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0334] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiment of the present application can be described in the context of a machine executable instruction, and the machine executable instruction is such as included in the program module executed in the device on the real or virtual processor of the target. Generally speaking, a program module includes a routine, a program, a library, an object, a class, a component, a data structure, etc., which performs a specific task or realizes a specific abstract data structure. In various embodiments, the function of the program module can be merged or divided between the described program modules. The machine executable instruction for the program module can be executed in a local or distributed device. In a distributed device, the program module can be located in both a local and a remote storage medium.
[0335] The computer program code for realizing the method for the embodiment of the present application can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by a computer or other programmable data processing device, causes the function / operation specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer or completely on a remote computer or server.
[0336] In the context of the embodiments of the present application, computer program codes or related data may be carried by any appropriate carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, and the like.
[0337] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.
[0338] A machine-readable medium may be any tangible medium that contains or stores a program for or related to an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of machine-readable storage media include an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0339] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0340] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or it can be an electrical, mechanical or other form of connection.
[0341] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0342] In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0343] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0344] In the present application, the terms "first", "second", etc. are used to distinguish between identical or similar items having substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various described examples, a first image may be referred to as a second image, and similarly, a second image may be referred to as a first image. Both the first image and the second image may be images, and in some cases, may be separate and different images.
[0345] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0346] The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more, for example, multiple second messages means two or more second messages. The terms "system" and "network" are often used interchangeably herein.
[0347] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0348] It should also be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0349] It should also be understood that the term “comprise” (also known as “includes,” “including,” “comprises” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0350] It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrases "if it is determined that ..." or "if [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.
[0351] It should be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.
[0352] It should also be understood that the references to "one embodiment", "an embodiment", or "a possible implementation" throughout the specification mean that specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment", or "a possible implementation" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0353] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for forwarding a message, characterized in that: The method comprises: A first network device receives a first message, wherein the first message includes a segment list corresponding to a forwarding path of the first message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; The first network device determines that content of a destination address field of a message header of the first message matches a local segment identifier; In response to determining that the content of the destination address field matches the local segment identifier, the first network device determines the content to be copied in the segment list according to an indication of the local segment identifier; The first network device copies the content to be copied to the destination address field to generate a second message; The first network device sends the second message; The first network device determines the content to be copied in the segment list according to the indication of the local segment identifier, including: The first network device determines the position of the to-be-copied content in the segment list according to the length indicated by the local segment identifier; The first network device determines the content to be copied according to the position of the content to be copied in the segment list.
2. The method according to claim 1, characterized in that The message header of the first message includes a first pointer and a second pointer, and the first network device determines the position of the to-be-copied content in the segment list according to the length indicated by the local segment identifier, including: The first network device determines the value of the first pointer according to the length indicated by the local segment identifier; The first network device determines, according to the value of the first pointer, a position of the to-be-copied content in an element having a length of 128 bits, the element being included in the segment list; The first network device determines the position of the element in the segment list according to the value of the second pointer.
3. The method according to claim 1, characterized in that The header of the first message includes a first pointer, and the first network device determines the position of the to-be-copied content in the segment list according to the length indicated by the local segment identifier, including: The first network device determines the value of the first pointer according to the length indicated by the local segment identifier; The first network device determines the position of the to-be-copied content in the segment list according to the value of the first pointer.
4. The method according to any one of claims 1 to 3, characterized in that The first length is X times the unit length, and the second length is Y times the unit length, where X and Y are both integers.
5. The method according to claim 4, characterized in that The unit length is 2 to the Nth power bits, where N is an integer greater than or equal to 3 and less than 7.
6. The method according to any one of claims 1 to 3, characterized in that The first length is 16 bits, and the second length is 32 bits.
7. The method according to any one of claims 1 to 3, characterized in that The second type of compression segment identifier includes a global link compression segment identifier, and the global link compression segment identifier indicates that a specific network device on the forwarding path forwards the message through a specific link.
8. The method according to claim 7, characterized in that The global link compression segment identifier includes a node part and a link part, the node part is used to identify a node, the link part is used to identify a link, the length of the node part is the same as the first length, and the length of the link part is the same as the first length.
9. The method according to any one of claims 1 to 3, characterized in that: The segment list includes elements with a length of 128 bits, and the elements include the first type of compressed segment identifier and the second type of compressed segment identifier.
10. The method according to any one of claims 1 to 3, characterized in that: The message header of the message includes a first pointer and a second pointer, the value of the first pointer is used to indicate the position of a compressed segment identifier among the multiple compressed segment identifiers in an element with a length of 128 bits, and the value of the second pointer is used to indicate the position of the element in the segment list; or, The message header of the message includes a first pointer, and the value of the first pointer is used to indicate the position of one of the multiple compressed segment identifiers in the segment list.
11. A network device, characterized in that: The network device comprises a unit for executing the method according to any one of claims 1-10.
12. A network system, characterized in that: The network system comprises a first network device and a second network device, wherein the first network device is configured to perform the method according to any one of claims 1 to 10, and the second network device is configured to: Generate a message, wherein the message includes a segment list corresponding to a forwarding path of the message, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the length of each compressed segment identifier in the plurality of compressed segment identifiers is less than 128 bits, the plurality of compressed segment identifiers include a first type of compressed segment identifier and a second type of compressed segment identifier, the length of the first type of compressed segment identifier is a first length, the length of the second type of compressed segment identifier is a second length, and the first length is less than the second length; The message is sent according to the segment list.
13. The network system according to claim 12, characterized in that: The first length is X times the unit length, and the second length is Y times the unit length, where X and Y are both integers.
14. The network system according to claim 13, characterized in that: The unit length is 2 to the Nth power bits, where N is an integer greater than or equal to 3 and less than 7.
15. The network system according to any one of claims 12 to 14, characterized in that: The first length is 16 bits, and the second length is 32 bits.
16. The network system according to any one of claims 12 to 14, characterized in that: The second type of compression segment identifier includes a global link compression segment identifier, and the global link compression segment identifier indicates that a specific network device on the forwarding path forwards the message through a specific link.
17. The network system according to claim 16, characterized in that: The global link compression segment identifier includes a node part and a link part, the node part is used to identify a node, the link part is used to identify a link, the length of the node part is the same as the first length, and the length of the link part is the same as the first length.
18. The network system according to any one of claims 12 to 14, characterized in that: The segment list includes elements with a length of 128 bits, and the elements include the first type of compressed segment identifier and the second type of compressed segment identifier.
19. The network system according to any one of claims 12 to 14, characterized in that: The message header of the message includes a first pointer and a second pointer, the value of the first pointer is used to indicate the position of a compressed segment identifier among the multiple compressed segment identifiers in an element with a length of 128 bits, and the value of the second pointer is used to indicate the position of the element in the segment list; or, The message header of the message includes a first pointer, and the value of the first pointer is used to indicate the position of one of the multiple compressed segment identifiers in the segment list.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program runs on a processor, the method according to any one of claims 1 to 10 is implemented.
21. A chip, characterized in that: The system comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory to execute the method according to any one of claims 1 to 10.