WO2022111606A1 - Message transmission method, segment list generation method, compressed segment identifier acquisition method, and apparatuses - Google Patents

Message transmission method, segment list generation method, compressed segment identifier acquisition method, and apparatuses Download PDF

Info

Publication number
WO2022111606A1
WO2022111606A1 PCT/CN2021/133327 CN2021133327W WO2022111606A1 WO 2022111606 A1 WO2022111606 A1 WO 2022111606A1 CN 2021133327 W CN2021133327 W CN 2021133327W WO 2022111606 A1 WO2022111606 A1 WO 2022111606A1
Authority
WO
WIPO (PCT)
Prior art keywords
length
network device
compressed segment
identifier
segment
Prior art date
Application number
PCT/CN2021/133327
Other languages
French (fr)
Chinese (zh)
Inventor
平善明
薛奇
刘立杰
方晟
沈凯强
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022111606A1 publication Critical patent/WO2022111606A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/34Source routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/44Distributed routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a method and device for message transmission, segment list generation, and compressed segment identifier acquisition.
  • the segment routing (SR) protocol is a source routing protocol.
  • the source node specifies the path for the application packet, and converts the path into an ordered segment (Segment) list and encapsulates it in the packet header. Intermediate nodes only need to forward according to the path specified in the packet header.
  • the basic idea of SR is to divide the network into different segments (Segments), and guide packets to be forwarded according to the specified path by splicing these segments together. Specifically, segment identity (SID) is used to identify a segment.
  • IPv6 segment routing (SRv6) When SR is deployed on the Internet Protocol Version 6 (IPv6) data plane, it is called IPv6 segment routing (SRv6).
  • forwarding path information is carried by a segment routing header (SRH) that includes a segment identification list (SID list).
  • SID list includes multiple segment identifiers (SIDs) arranged in sequence, respectively representing multiple segments, and each segment is an instruction or instruction set for processing the message.
  • the SRH is encapsulated in the packet, and the segment ID list in the packet carries the processing process of the packet by the SR network.
  • the length of each SID in the SRv6 network is 128 bits, and each time a SID is added to 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.
  • the increase of the packet length will cause a lot of network resources to be occupied during the forwarding process, resulting in low utilization of network link bandwidth.
  • the length of the SRH is too long, it will increase the difficulty of packet processing, making it difficult for existing devices to effectively process the SRH.
  • the embodiments of the present application provide a method and device for message transmission, segment list generation, and compressed segment identifier acquisition, which can solve the problem that the length of the SRH is too long and affects the transmission efficiency of the SRv6 message.
  • a method for transmitting a packet includes: a second network device receives a first packet sent by the first network device, where the first packet includes a packet corresponding to A segment list of the forwarding path of the first packet, where the segment list includes multiple compressed segment identifiers arranged in sequence, and the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bits; the second network The device reads the content to be copied in the segment list according to the encoding rule, and the encoding rule is used to indicate the encoding rule corresponding to the content to be copied; the second network device updates the first packet according to the content to be copied to generate the second packet; the second network device sends the second packet.
  • the second network device reads the content to be copied in the segment list according to an encoding rule, including: determining, by the second network device, a starting position, where the starting position is used for Indicates the starting position corresponding to the content to be copied; the second network device determines the length of the content to be copied according to the encoding rule and the starting position.
  • the lengths of the compressed segment identifiers included in the segment list may be different, when reading the content to be copied (the next segment identifier or the next compressed segment identifier) from the segment list, first determine the content to be copied The corresponding starting position, and then the length of the content to be copied is determined from the starting position according to the encoding rule, that is, the content to be copied is read.
  • the second network device determines the length of the content to be copied according to the encoding rule and the starting position, including: the second network device obtains the first parameter set and/or the first parameter set and/or the first parameter set and/or the first parameter set. Two parameter sets, the first parameter set includes the first initial length and the first increment length corresponding to the node identifier in the compressed segment identifier, and the second parameter set includes the first parameter corresponding to the function identifier in the compressed segment identifier. Two initial lengths and second incremental lengths; the second network device determines the length of the content to be copied according to the encoding rule, the first parameter set and/or the second parameter set, and the starting position.
  • the first initial length and the first increment length corresponding to the node identifier and the second initial length and the first increment corresponding to the function identifier are obtained.
  • Two incremental lengths Since the encoding rule is related to the above four lengths, the second network device reads the content to be copied according to the above four lengths, the encoding rule and the starting position, that is, determines the length of the content to be copied.
  • the compressed segment identifier generated according to the encoding rule may only include two parts, the node identifier and the function identifier, and does not include other information, such as marker bits, to increase the compression rate of the segment identifier.
  • the compressed segment identifiers generated according to the encoding rules may be continuous. For example, taking the variable length of the function identifier as an example, the node identifier is 001 and the length of the function identifier is 3 bits, then the compressed segment identifier generated according to the encoding rule can be are 001000, 001001, 001010, 001011, etc.
  • both the first initial length and the first increment length are multiples of 8 bits, and/or the second initial length and the second increment length are both 8 multiples of bits.
  • the first initial length and the first increment length and the second initial length and the second increment length corresponding to the node identifier can be multiples of 8 bits, so that the formed compressed segment identifier can achieve 8-bit alignment .
  • the first initial length, the first incremental length, the second initial length and the second incremental length can be set according to actual requirements.
  • the first packet further includes an extension pointer, where the extension pointer is used to sequentially indicate each compressed segment identifier in the multiple compressed segment identifiers, and the second network device determines The starting position includes: determining, by the second network device, a starting position of the content to be copied in the segment list according to the extension pointer.
  • the first message may also carry an extension pointer, so as to determine the starting position of the content to be copied in the segment list through the extension pointer.
  • the extension pointer indicates the starting position of the compressed segment identifier corresponding to the second network device
  • the second network device determines that the content to be copied is in the segment list according to the extension pointer , including: the second network device updates the value of the extension pointer according to the length of the compressed segment identifier corresponding to the second network device, so that the updated value of the extension pointer corresponds to the to-be-copied value
  • the starting position of the content in the segment list when the extension pointer indicates the starting position of the compressed segment identifier corresponding to the current network device (the second network device), since the second network device can determine the length of its own compressed segment identifier, the value of the extension pointer can be increased.
  • the extension pointer may be updated at the first network device first, and when the second network device receives the first packet, the extension pointer points to the starting position of the content to be copied in the segment list.
  • the second network device updates the destination address DA in the first packet according to the content to be copied, so as to generate a second packet, including: the second network device according to The content to be copied and the prefix corresponding to the content to be copied update the destination address DA in the first message to generate a second message.
  • the destination address DA in the first message is updated by using the prefix corresponding to the content to be copied and the content to be copied, thereby obtaining the second message.
  • the second network device updates the destination address DA in the first packet according to the content to be copied, so as to generate a second packet, including: the second network device utilizes The to-be-copied content updates information other than the prefix in the destination address DA of the first packet to generate a second packet.
  • the information other than the prefix in the destination address DA can be directly updated using the content to be copied, Thereby, the second message is obtained.
  • the plurality of compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, and the first length and the second length are different.
  • the lengths of each compressed segment identifier may be different. Compared with the implementation in which all the compressed segment identifiers have the same length, the lengths of all the compressed segment identifiers do not need to be maintained. Consistent, the length of some compressed segment identifiers can be compressed to a shorter length. For example, for network devices with a small number of functions, the corresponding compressed segment identifiers are shorter, which can greatly improve the compression rate of segment identifiers and reduce resource consumption. occupied.
  • a packet transmission method includes: a first network device generates a first packet, where the first packet includes forwarding corresponding to the first packet A segment list of the 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 or equal to 128 bits, and the multiple compressed segment identifiers include the first A compressed segment identifier of one length and a compressed segment identifier of a second length, the first length and the second length are different, and each of the multiple compressed segment identifiers includes a prefix code; the first network The device sends the first packet according to the segment list.
  • the first network device after obtaining the segment list, the first network device generates a first packet including the segment list, and sends the first packet according to the segment list.
  • each compressed segment identifier includes a variable-length portion, and the length of the variable-length portion of the compressed segment identifier of the first length is different from the length of the compressed segment identifier of the second length.
  • the length of the variable-length part is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
  • each compressed segment identifier includes a variable length portion, and the lengths of the variable length portions of the compressed segment identifiers of different lengths are different.
  • each compressed segment identifier includes a function identifier, and the function identifier is the prefix code.
  • the variable length portion is the function identifier. That is, the length of the function identifier can be extended for the increase in the number of functions, so that when the number of functions of a certain network device is large, the function identifier can be carried through the variable-length compressed segment identifier to support capacity expansion.
  • each compressed segment identifier includes a node identifier, and the node identifier is the prefix code. That is, in response to the increase in the number of network devices, network capacity expansion can be supported by extending the length of the node identifiers, and capacity expansion can be supported without changing the assigned node identifiers.
  • the first packet further includes an extension pointer, where the extension pointer is used to sequentially indicate each compressed segment identifier in the multiple compressed segment identifiers.
  • the compressed segment identifier of the first length and the compressed segment identifier of the second length respectively correspond to the same prefix, or the compressed segment identifier of the first length and the second length
  • the compressed segment identifiers of , respectively, correspond to different prefixes.
  • the first packet is an IPv6-based segment routing SRv6 packet
  • the segment list is located in the segment routing header SRH.
  • a method for generating a segment list includes: a first network device determines a forwarding path of a packet; the first network device generates a segment list corresponding to the forwarding path,
  • the segment list includes multiple compressed segment identifiers arranged in sequence, each of the multiple compressed segment identifiers has a length of less than or equal to 128 bits, and the multiple compressed segment identifiers include a compressed segment of a first length An identifier and a compressed segment identifier of a second length, the first length and the second length are different, and each compressed segment identifier of the plurality of compressed segment identifiers includes a prefix code.
  • each compressed segment identifier includes a variable-length portion, and the length of the variable-length portion of the compressed segment identifier of the first length is different from the length of the compressed segment identifier of the second length.
  • the length of the variable-length part is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
  • the first network device is a controller in the network, and the method further includes: the first network device sends the segment list to an ingress device of the forwarding path.
  • the first network device is an ingress device of the forwarding path, and the method further includes: the first network device generates a packet including the segment list; the first network device The network device sends a message including the segment list.
  • a method for obtaining a compressed segment identifier includes: a first network device obtains a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable A variable-length part, the first variable-length part belongs to a first resource pool, and the first resource pool includes a plurality of the first variable-length parts; based on insufficient resources of the first resource pool, the first variable-length part is A network device obtains a compressed segment identifier of a second length, the second length is greater than or equal to the first length, the compressed segment identifier of the second length includes a second variable length part, and the second variable length part belong to the second resource pool, the second resource pool includes a plurality of the second variable length parts; the first network device sends the compressed segment identifier of the first length and the compressed segment identifier of the second length , the compressed segment identifier of the first length and the compressed segment identifier of the second length
  • the compressed segment identifier of the first length and the compressed segment identifier of the second length include function identifiers
  • the first variable length part and the second variable length part are For the function identifier
  • the first resource pool and the second resource pool are resource pools corresponding to the function identifier.
  • the method further includes: based on insufficient resources of the nth resource pool, the first network device obtains the compressed segment identifier of the n+1th length, where the n+1th length is greater than or equal to The nth length, the compressed segment identifier of the n+1th length includes the n+1th variable length part, the n+1th variable length part belongs to the n+1th resource pool, and the n+1th resource
  • the pool includes a plurality of the n+1th variable length parts; wherein, the n is a natural number greater than 1.
  • the coding rule corresponding to the i-th resource pool is that the first i bit is 1, the i+1-th bit is 0, and the subsequent (i+1)*2 bits are 0 or 1 can take any value.
  • the coding rule corresponding to the i-th resource pool is that the first i bit is 0, the i+1-th bit is 1, and the subsequent (i+1)*2 bits are 0 or 1 can take any value.
  • both the initial length and the increment length are multiples of 8 bits.
  • a message transmission device including: a receiving unit, a processing unit, and a sending unit.
  • a receiving unit configured to receive a first packet sent by the first network device, where the first packet includes a segment list corresponding to a forwarding path of the first packet, and the segment list includes a sequence of multiple There are several compressed segment identifiers, and the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bits.
  • a processing unit configured to read the content to be copied in the segment list according to an encoding rule, where the encoding rule is used to indicate an encoding rule corresponding to the content to be copied.
  • the processing unit is further configured to update the destination address DA in the first message according to the content to be copied, so as to generate a second message.
  • a sending unit configured to send the second message.
  • the processing unit is specifically configured to determine a starting position, where the starting position is used to indicate a starting position corresponding to the content to be copied; according to the encoding rule and the starting position The start position determines the length of the content to be copied.
  • the processing unit is specifically configured to acquire a first parameter set and/or a second parameter set, where the first parameter set includes a first initial parameter corresponding to the node identifier in the compressed segment identifier length and the first increment length, the second parameter set includes the second initial length and the second increment length corresponding to the function identifier in the compressed segment identifier; according to the encoding rule, the first parameter set and/or the The second parameter set and the starting position determine the length of the content to be copied.
  • the length of the function identifier of the to-be-copied content; the length of the to-be-copied content is obtained according to the length of the node identifier in the to-
  • both the first initial length and the first increment length are multiples of 8 bits, and/or the second initial length and the second increment length are both 8 multiples of bits.
  • the first packet further includes an extension pointer, where the extension pointer is used to sequentially indicate each compressed segment identifier in the multiple compressed segment identifiers, and the processing unit specifically uses determining the starting position of the content to be copied in the segment list according to the extension pointer.
  • the extension pointer indicates a starting position of the compressed segment identifier corresponding to the second network device
  • the processing unit is specifically configured to determine the length of the compressed segment identifier corresponding to the second network device according to the length of the compressed segment identifier corresponding to the second network device.
  • the value of the extension pointer is updated, so that the updated value of the extension pointer corresponds to the starting position of the content to be copied in the segment list.
  • the processing unit is specifically configured to update the destination address DA in the first packet according to the content to be copied and a prefix corresponding to the content to be copied, so as to generate a second packet arts.
  • the processing unit is specifically configured to update the information except the prefix in the destination address DA of the first packet by using the content to be copied, so as to generate the second packet.
  • the plurality of compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, and the first length and the second length are different.
  • a message transmission device including: a processing unit and a sending unit.
  • a processing unit configured to generate a first packet, where the first packet includes a segment list corresponding to a forwarding path of the first packet, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the multiple The length of each compressed segment identifier in the plurality of compressed segment identifiers is less than or equal to 128 bits, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the The second lengths are different, and each of the multiple compressed segment identifiers includes a prefix code.
  • a sending unit configured to send the first packet according to the segment list.
  • each compressed segment identifier includes a variable-length portion, and the length of the variable-length portion of the compressed segment identifier of the first length is different from the length of the compressed segment identifier of the second length.
  • the length of the variable-length part is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
  • each compressed segment identifier includes a function identifier, and the function identifier is the prefix code.
  • each compressed segment identifier includes a node identifier, and the node identifier is the prefix code.
  • the first packet further includes an extension pointer, where the extension pointer is used to sequentially indicate each compressed segment identifier in the multiple compressed segment identifiers.
  • the compressed segment identifier of the first length and the compressed segment identifier of the second length respectively correspond to the same prefix, or the compressed segment identifier of the first length and the second length
  • the compressed segment identifiers of , respectively, correspond to different prefixes.
  • the first packet is an IPv6-based segment routing SRv6 packet
  • the segment list is located in the segment routing header SRH.
  • an apparatus for generating a segment list includes: a processing unit.
  • the processing unit is used to determine the forwarding path of the packet.
  • the processing unit is further configured to generate a segment list corresponding to the forwarding path, where the segment list includes multiple compressed segment identifiers arranged in sequence, and the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bit, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the second length are different, and each of the multiple compressed segment identifiers
  • the compressed segment identification includes a prefix code.
  • each compressed segment identifier includes a variable-length portion, and the length of the variable-length portion of the compressed segment identifier of the first length is different from the length of the compressed segment identifier of the second length.
  • the length of the variable-length part is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
  • the apparatus is a controller in a network, and the apparatus further includes: a sending unit; and a sending unit, configured to send the segment list to an ingress device of the forwarding path.
  • the apparatus is an ingress device of the forwarding path, and the apparatus further includes: a sending unit; the processing unit, further configured to generate a packet including the segment list; the A sending unit, configured to send a message including the segment list.
  • an apparatus for obtaining a compressed segment identifier includes: a processing unit and a sending unit.
  • a processing unit configured to obtain a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable length part, the first variable length part belongs to a first resource pool, and the first resource The pool includes a plurality of said first variable length portions.
  • the processing unit is further configured to obtain a compressed segment identifier of a second length based on insufficient resources of the first resource pool, where the second length is greater than or equal to the first length, and the compressed segment identifier of the second length includes the first length.
  • variable length parts the second variable length parts belong to a second resource pool, and the second resource pool includes a plurality of the second variable length parts.
  • a sending unit configured to send the compressed segment identifier of the first length and the compressed segment identifier of the second length, and the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the The segment executed by the first network device.
  • the compressed segment identifier of the first length and the compressed segment identifier of the second length include function identifiers, and the first variable length part and the second variable length part are For the function identifier, the first resource pool and the second resource pool are resource pools corresponding to the function identifier.
  • the processing unit is further configured to obtain the compressed segment identifier of the n+1th length based on insufficient resources of the nth resource pool, where the n+1th length is greater than or equal to the nth length,
  • the compressed segment identifier of the n+1th length includes the n+1th variable length part, the n+1th variable length part belongs to the n+1th resource pool, and the n+1th resource pool includes multiple the n+1th variable length portion; wherein, the n is a natural number greater than 1.
  • the coding rule corresponding to the i-th resource pool is that the first i bit is 1, the i+1-th bit is 0, and the subsequent (i+1)*2 bits are 0 or 1 can take any value.
  • the coding rule corresponding to the i-th resource pool is that the first i bit is 0, the i+1-th bit is 1, and the subsequent (i+1)*2 bits are 0 or 1 can take any value.
  • both the initial length and the increment length are multiples of 8 bits.
  • a network system including a first network device and a second network device.
  • the first network device may execute the method described in the second aspect, the third aspect or the fourth aspect; the second network device may execute the method described in the first aspect.
  • a communication device in a tenth aspect of an embodiment of the present application, includes: a processor and a memory; the memory is used to store instructions or computer programs; the processor is used to execute the The instructions or computer program in memory cause the communication device to perform the method of the first aspect, the second aspect, the third aspect or the fourth aspect.
  • a computer-readable storage medium including instructions, which, when executed on a computer, cause the computer to execute the above first aspect, second aspect, third aspect or fourth aspect the method described.
  • the first packet received by the second network device includes a segment list corresponding to the forwarding path of the first packet, and the segment list includes multiple compressed segment identifiers arranged in sequence, wherein each The length of each compressed segment identifier is less than or equal to 128 bits.
  • the second network device reads the content to be copied from the segment list according to the encoding rule, and the network device corresponding to the content to be copied is the next-hop network device.
  • the encoding rule is a rule corresponding to the network device corresponding to the content to be copied generating the content to be copied.
  • the second network device updates the destination address DA in the first packet by using the read content to be copied, so as to generate a second packet, and forward the second packet.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a SRv6 packet format according to an embodiment of the present application
  • Fig. 3 is a kind of SID structure schematic diagram provided for the implementation of this application.
  • FIG. 4 is a flowchart of a method for obtaining a compressed segment identifier provided by an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of a segment list provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of another SRv6 packet structure provided by an embodiment of the present application.
  • FIG. 7 is a flowchart of a message transmission method provided by an embodiment of the present application.
  • FIG. 8a is a schematic diagram of another SRv6 packet structure provided by an embodiment of the present application.
  • FIG. 8b is a schematic diagram of another SRv6 packet structure provided by an embodiment of the present application.
  • FIG. 9 is a flowchart of another message transmission method provided by an embodiment of the present application.
  • FIG. 10 is a structural diagram of a message transmission apparatus provided by an embodiment of the present application.
  • FIG. 11 is a structural diagram of another message transmission apparatus provided by an embodiment of the application.
  • FIG. 12 is a structural diagram of an apparatus for generating a segment list provided by an embodiment of the present application.
  • FIG. 13 is a structural diagram of an apparatus for generating a compressed segment identification provided by an embodiment of the present application.
  • FIG. 14 is a structural diagram of a network device provided by an embodiment of the present application.
  • FIG. 15 is another structural diagram of a network device provided by an embodiment of the present application.
  • the packet processing process can be divided into several segments, and each segment is a specific processing behavior performed by a specific network device. Several segments are executed separately by network devices on the packet forwarding path, forming the entire packet processing process. Each segment has a corresponding segment identification, ie SID.
  • the SID adopts an IPv6 address format with a length of 128 bits, that is, the length of each SID is 128 bits.
  • Each SID may include a locator field and a function field.
  • the content of the locator field may also be referred to as a locator for short, which is an identifier allocated to a network node in the network topology and used to identify the network node in the network topology.
  • the SID may include two types of node segment identifier (node SID) and adjacent segment identifier (adjacent SID).
  • the locator in the SID is used to indicate the network device that executes the segment corresponding to the SID. For node segment identification, the network device executing the segment corresponding to the SID is the network node identified by the locator in the SID, and for the adjacent segment identification, the network device executing the segment corresponding to the SID is the network identified by the locator in the SID. node.
  • a network node and a network device have the same meaning, and both refer to a switch, a router, a virtual routing device, a virtual forwarding device, 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 the data packet to the network node.
  • the length of the locator is variable, and the length of the locator is related to the size of the network. For example, when the network scale is larger, the number of network nodes included in the network topology is greater, and the length of the locator is longer in order to identify the greater number of network nodes. Conversely, when the network size is smaller, the length of the locator is also shorter.
  • the content of the function field can also be referred to as function for short, which is used to represent the instruction or instruction set for processing the message, which is equivalent to the opcode of the computer instruction.
  • function for short, which is used to represent the instruction or instruction set for processing the message, which is equivalent to the opcode of the computer instruction.
  • the instruction or instruction set represented by function When executed on the network node, it will cause the network node to perform the corresponding forwarding behavior (behavior). For example, forwarding data packets to a specified link, or looking up a table for forwarding in a specified table, etc.
  • Some SIDs may also include an argument field and/or a padding field after the function field.
  • 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 the function.
  • the parameters are, for example, flow information, service information or other related information.
  • the SID is used to represent the corresponding segment.
  • the SID can indicate the network device that executes the segment, and the SID can indicate the packet processing behavior corresponding to the segment.
  • the SID can also indicate the execution of the above-mentioned packets. Parameters involved in handling the behavior.
  • the SID list can indicate the processing process of the message.
  • the arrangement order of several SIDs in the SID list is the execution order of several segments in the message processing process.
  • the SRH including the SID list is encapsulated in the packet, so that the processing of the packet by the SRv6 network can be carried in the packet and passed to the network devices on the packet forwarding path.
  • the network devices on the packet forwarding path execute in sequence Self-related packet processing behavior.
  • the application scenario includes an SRv6 network
  • the SRv6 network includes a network device S and network devices 1 to 5 .
  • 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.
  • the identifier of network device 1 is locator 1
  • the identifiers of network devices 2 to 5 are locator 2 to locator 5, respectively.
  • the dotted line in FIG. 1 shows a packet forwarding path
  • the head node of the forwarding path is the network device S, and then passes through the network devices 1 to 5 in sequence.
  • the head node on the forwarding path may also be an ingress node of the SRv6 network, also referred to as an ingress device or an ingress network device.
  • the packet processing process corresponding to the forwarding path includes a total of 5 segments, which are respectively the packet processing behaviors performed by the network devices 1 to 5 .
  • the function corresponding to the packet processing behavior on network device 1 is function 1
  • the functions corresponding to the packet processing behavior on network devices 2 to 5 are function 2 to function 5, respectively.
  • locator 1 and function 1 form SID 1, that is, SID 1 is used to indicate the segment executed by network device 1 during packet processing.
  • SID 2 to SID 5 are used to indicate network device 2. to 5 executed segments.
  • SID 1 to SID 5 are arranged in order to form a SID list corresponding to the above message processing process.
  • the arrangement order of the 5 SIDs in the SID list is the execution order of the corresponding 5 segments in the message processing process, that is, the arrangement order is SID 1 to SID 5.
  • Figure 2 shows a message in an SRv6 network encapsulated with a SID list.
  • the packet header of the packet includes an IPv6 packet header and an SRH.
  • the IPv6 packet header includes the Version field, the Traffic Type field, the Flow Label field, the Payload Length field, the Next Header field, and the hop count. Limit (Hop Limit) field, source address (Source Address) field and destination address (destination address, DA) field.
  • the meaning of each field can refer to the explanation in Request for Comments (RFC) 8200.
  • SRH includes the next header (Next Header) field, header extension length (Hdr Ext Len) field, routing type (Routing Type) field, segment left (Segment Left) field, last index (Last Entry) field, marker ( Flags) field, tag (Tag) field and SID list.
  • the meaning of each field can refer to the explanation in RFC8754.
  • 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 turn, that is, with the different SL values, segment[SL] is used to represent each element in the SID list .
  • 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.
  • the SIDs in the SID list can be arranged from back to front, segment list[0] corresponds to the last executed segment, segment list[1] corresponds to the penultimate segment to be executed, and so on.
  • the SID list includes 5 SIDs, segment list[n] is SID 1, and segment list[0] is SID 5.
  • the SRH including the SID list can be encapsulated in the packet by the head node on the forwarding path, and subsequent network devices on the packet forwarding path can process the packet according to the SID list.
  • the head node encapsulates the IPv6 packet header and the SRH outside the received data packet to form an SRv6 data packet.
  • the head node on the forwarding path may also set the value of the DA field in the IPv6 header of the packet to the SID corresponding to the first executed segment in the SID list.
  • 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 packet along the forwarding path.
  • 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 .
  • the head node on the forwarding path sends the packet along the forwarding path.
  • the SID list is encapsulated in the message by the network device S, and the network devices 1 to 5 process the message according to the SID list in the message.
  • the network device S copies the SID 1 corresponding to the first executed segment into the DA field in the IPv6 packet header.
  • the network device S sets the value of the SL field to 4.
  • the network device S searches the local forwarding table according to the content of the
  • network devices on the forwarding path can be divided into transit nodes and endpoint nodes.
  • the SID in the DA field of the IPv6 header of the packet is not the local SID, that is, the SID in the DA field is not configured locally to indicate a segment.
  • the SID in the DA field of the IPv6 header of the packet is the local SID, that is, the SID in the DA field is configured locally to indicate a segment.
  • the network device when it is determined that the SID in the DA field is not a local SID, the network device is the transit node on the packet forwarding path.
  • the transit node does not need to parse the content in the SRH, but only searches the local IPv6 routing table according to the content of the DA field, and forwards the packet. Can.
  • the transit node can also be a network device that does not support SRv6.
  • the network device is the endpoint node on the packet forwarding path.
  • the endpoint node searches the forwarding information base (FIB) according to the SID in the DA field, and matches the local instantiation SRv6 SID, executes the packet processing behavior corresponding to the SRv6 SID of the local embodiment.
  • the endpoint node decrements the value of the SL field in the packet SRH by 1, and copies the segment list[SL] into the DA field of the IPv6 packet header, that is, updates the content of the DA field. And, continue to forward the message according to the updated DA field.
  • network device 1 receives the message, determines that SID 1 in the DA field is the local SID, executes the message processing behavior corresponding to SID 1, and subtracts 1 from the value of the SL field, that is, the value of the SL field. If it is 3, copy segment list[3], that is, SID 2, into the DA field, and send the message to network device 2 according to SID 2.
  • the execution steps from the network device 2 to the network device 5 are similar to those of the network device 1, which constitute a complete packet processing process.
  • the SID in the SRv6 network has the routable attribute, and 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.
  • the functions in the SID support programmability, can flexibly meet the needs of various services and network functions, and adapt to the needs of service and network development.
  • a SID with a length of 128 bits will also bring about the problems of low utilization of network link bandwidth and high packet processing difficulty.
  • different network devices in the network have different network functions, and the required SID space is different. For network devices with a small number of network functions, using a long SID will waste space; for network devices with a large number of network functions. Using a fixed-length SID may result in insufficient space.
  • the locator field in the SID may further include a prefix and a node ID.
  • the prefix is usually assigned by the network operator to the subnet where the network device is located, and is used to identify the entire subnet.
  • a subnet can also be called a network segment. All SIDs in the entire subnet have the same prefix. It can be considered that all SIDs in the entire subnet form a SID block, and 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 within a subnet. The node IDs in the SIDs of different nodes in the subnet are different.
  • the SIDs corresponding to the above multiple network devices in the SID list all carry the same prefix, resulting in repeated redundancy. Optimizing this part of redundant content can achieve the technical effect of reducing the length of the SID list. Specifically, only one SID with the same prefix is carried in the message, and different SIDs can be obtained by restoring the same prefix and different C-SIDs at each network device on the forwarding path.
  • the prefix can be placed in the DA field of the IPv6 header of the packet by the head node on the packet forwarding path, and the endpoint nodes on the packet forwarding path can respectively update different C-SIDs to the prefix content in the DA field After that, the C-SID updated later overwrites the C-SID updated earlier. Therefore, different C-SIDs can be combined with prefixes to restore the corresponding SIDs. That is, although only C-SIDs are included in the SID list, the corresponding SIDs are still present 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.
  • the C-SID may include an argument field, and the content of the argument field is consistent with the content of the argument field in the SID. Therefore, the length of the argument field is also consistent with the length of the argument field in the SID.
  • each element with a length of 128 bits in the SID list may be defined as a container (container), and each container accommodates an integer number of C-SIDs.
  • the remaining space less than the length of one C-SID is padding.
  • 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.
  • the C-SID can also be mixed with the SID and arranged in the SID list.
  • the SID corresponding to some network devices that do not support the C-SID function still adopts the 128-bit format.
  • the forwarding path involves a virtual private network (VPN)
  • VPN virtual private network
  • the corresponding VPN SID still adopts the 128-bit format.
  • the SID can be accommodated in a container.
  • the SRH that includes both a 128-bit SID and a C-SID less than 128 bits can be called generalized SRH (generalized SRH, G-SRH), and the corresponding SRv6 technology that supports G-SRH can be called generalized SRv6 (generalized SRv6, G-SRv6) technology.
  • generalized SRH generalized SRH, G-SRH
  • SRv6 generalized SRv6
  • the SID list of the G-SRH may also include other types of identifiers, such as MPLS labels and Internet Protocol Version 6 (IPv4) addresses.
  • IPv4 Internet Protocol Version 6
  • G-SID All the 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. More descriptions of G-SRH and G-SRv6 can be found in draft-lc-6man-generalized-srh-00 entitled “Generalized Segment Routing Header” dated February 2020, and March 2020 entitled “Generalized Segment Routing Header” Generalized SRv6 Network Programming" draft-cl-spring-generalized-srv6-np-01, May 2020 draft-cl-spring-generalized-srv6-for-cmpr titled "Generalized SRv6 Network Programming for SRv6 Compression” -01, their entire contents are hereby incorporated by reference as if all stated.
  • the packet forwarding path corresponding to the SID list in which the C-SID and the SID are mixed can be called a G-SRv6 path, and the G-SRv6 path can include SRv6 sub-paths and SRv6 compression sub-paths.
  • Figure 5 shows a schematic structure of the SID list corresponding to the G-SRv6 path.
  • the G-SRv6 path includes two SRv6 subpaths and two SRv6 compression subpaths, SRv6 subpath 1 and SRv6 subpath 2, SRv6 compression subpath 1 and SRv6 compression subpath 2, respectively.
  • 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 in the figure for short). path 2) and the parts corresponding to the two SRv6 compression sub-paths (referred to as SRv6 compression sub-path 1 and SRv6 compression sub-path 2 for short in the figure).
  • the part corresponding to SRv6 subpath 1 is similar in structure to the part corresponding to SRv6 subpath 2, and both may include at least one SID.
  • the part corresponding to the SRv6 compression sub-path 1 is similar in structure to the part corresponding to the SRv6 compression sub-path 2, and both may include at least one C-SID.
  • the part includes at least one container.
  • the first SID in this part can be stored in the SID list in the form of a complete SID, or can be stored in the SID list in the form of a C-SID.
  • 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 packet processing process. The processing for the first container will be described in detail below.
  • each container includes C-SIDs arranged in sequence.
  • the SID included in the first container can be divided into three parts: prefix 1, C-SID 1, and an optional argument field or padding field.
  • the second container includes 4 C-SIDs from C-SID 2 to C-SID5. Subsequent containers and so on.
  • the SID list in which the C-SID and the SID are mixed can include multiple SRv6 compression subpaths.
  • the multi-segment SRv6 compression sub-paths are located in different subnets, that is, the SIDs corresponding to the nodes in the multi-segment SRv6 compression sub-paths have different prefixes.
  • the G-SRv6 path further includes the SRv6 compression subpath 2 .
  • the part corresponding to SRv6 compression subpath 1 is similar in structure to the part corresponding to SRv6 compression subpath 2, but in the part corresponding to SRv6 compression subpath 2, the prefix part included in the SID included in the first container is prefix 2, which is different from the above prefix 1. That is to say, different SRv6 compression sub-paths are distinguished by whether the SID includes the same prefix, that is, whether the C-SID corresponds to the same prefix. Therefore, each node in the same segment of SRv6 compressed subpath belongs to the same subnet.
  • the forwarding path passes through the network device 1 to the network device 5 in sequence.
  • the segments executed by the network device 1 to the network device 4 can be represented by C-SID 1 to C-SID 4 respectively, and the length of each C-SID is 32 bits.
  • the segment executed by the network device 5 is represented by a VPN SID with a length of 128 bits.
  • the packet format including the SID list corresponding to the forwarding path is shown in Figure 6.
  • the SID list includes 2 containers, the first container includes C-SID 1 to C-SID 4, and the second container includes SID 5.
  • the total length of the SID list is 32 bytes.
  • the length of the SID list is greatly shortened and the network efficiency is improved.
  • the arrangement order of C-SIDs in the SID list can be arranged in positive order, as shown in Figure 6, or can be arranged in reverse order, such as replacing the arrangement in Figure 6 with C from top to bottom -SID4 to C-SID1.
  • the SRH includes the SL field.
  • 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.
  • the network device corresponding to each SID in the SID list of the SRH that is, the endpoint node on the forwarding path, sequentially decrements the value of the SL field in the SRH of the message by 1, that is, the value of the SL field is decremented by 1. value, and copy the segment list[SL] to the DA field of the IPv6 header of the packet, that is, update the content of the DA field.
  • the content of the SL field can also be called the SL pointer, which in turn points to each element in the SID list.
  • the network device on the forwarding path can locate each element in the SID list according to the SL pointer, so as to find the next SID to be processed, and update the DA field.
  • each element in the SID list may accommodate multiple C-SIDs due to the shorter length of the C-SID. 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, so it is impossible to precisely locate each sub-element only by relying on the SL pointer. If these sub-elements include C-SIDs, it is impossible to accurately locate each C-SID in them.
  • the existing SL pointer needs to be extended. Specifically, one-dimensional pointer and two-dimensional pointer can be adopted.
  • a new pointer in addition to the existing SL pointer, a new pointer can be added to the message.
  • the new pointer can be called SI, or it can also be called compressed segment identifier remaining (C-SID left, CL )pointer.
  • the first-dimensional pointer that is, the SL pointer
  • the second-dimensional pointer that is, SI
  • C-SIDs can be arranged in elements from front to back.
  • the value of SI corresponding to the C-SID executed first is m-1
  • the value of the SI corresponding to the C-SID executed last is m-1
  • the SI value of 0 is 0, and so on.
  • the value of the SI pointer is decremented by 1, and the SI is shifted to the next C-SID. Therefore, through the combination of SL pointer and SI, not only all elements in the SID list can be accurately located, but also all sub-elements in the SID list can be accurately located.
  • the segment list[SL][SI] can be used to represent all G in the SID list. -SID. Taking the message shown in Figure 6 as an example, segment list[1][3] can be used to represent C-SID 1, and segment list[1][0] can be used to represent C-SID 4.
  • the SI when the SI is offset within the element, in the process of updating the pointer, the SI can be decremented by 1, and the SL pointer can remain unchanged, that is, the SL pointer still points to the same element, And SI points to the next child element in the element; and when SI currently points to the last child element of the element, that is, when SI needs to move to the next element, in the process of updating the pointer, the SL pointer can be decremented by 1, SI is set to m-1, that is, the SL pointer points to the next element, and the SI points to the first child element of the next element.
  • the newly added second-dimensional pointer ie, SI
  • SI may be located in the SRH in the message, or may be located in the DA field.
  • SI may be located in the lowest two bits in the DA field, or in the lowest three bits in the DA field.
  • the least significant byte of the DA field can also be used to place the SI, which is convenient for hardware implementation and facilitates the expansion of future solutions.
  • the offset step size of the existing SL pointer can be adjusted to form a new pointer, which can be called a generalized SID index (SI), or can be Still called the SL pointer.
  • SI generalized SID index
  • the one-dimensional pointer, ie SI is used to indicate a certain G-SID in the SID list.
  • the offset step size of the existing SL pointer is the length of the element in the SID list, that is, 128 bits, and the SL pointer points to the next element in the SID list after each offset.
  • the offset step size of SI is the length of the sub-element in the SID list, such as 32 bits or 16 bits, then the SI points to the next sub-element in the SID list after each offset.
  • segment list[SI] can be used to represent all G-SIDs in the SID list. It should be noted that since the offset step size of SI decreases, when it needs 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 offset Multiple steps to achieve offset length by one element.
  • the new one-dimensional pointer, SI can be located in the SRH in the message or in the DA field.
  • SI is still in the SL field.
  • the least significant byte of the DA field can also be used to place the SI, which is convenient for hardware implementation and facilitates the expansion of future solutions.
  • the expanded one-dimensional pointer and the expanded two-dimensional pointer may be collectively referred to as an expanded pointer.
  • the embodiment of the present application provides a method for message transmission.
  • the method adopts a compressed segment identifier (compressed SID, C-SID) whose length is less than 128 bits. It improves network efficiency and reduces the difficulty of packet processing, and can also solve the problem of wasted space or insufficient space for fixed-length SIDs.
  • This embodiment of the present application provides the format of the C-SID, as shown in FIG. 3 . Omit the prefix of the locator field and the possible argument field and/or padding field in the SID, and combine the node ID and function fields of the locator field to form the C-SID. Therefore, the C-SID is composed of node ID and function field, and its length can be less than 128 bits. Only C-SIDs can be included in the SID list, thereby achieving the technical effect of reducing the length of the SID list.
  • variable length in the variable-length compressed C-SID may mean that the length of the node ID is variable, and/or the length of the function ID is variable.
  • the initial length NodeInitlen and the incremental length NodeIncrLen of the node ID can be preset.
  • the resources of the node ID resource pool corresponding to the initial length NodeInitlen When the resources of the node ID resource pool corresponding to the initial length NodeInitlen are insufficient, increase the length of the node ID by NodeIncrLen to obtain a new node ID resource pool, that is, the second resource pool, so as to continue to provide other resources in the network according to the second resource pool.
  • Network devices assign node IDs.
  • the resources of the nth resource pool are insufficient, the n+1th resource pool corresponding to the node ID can be continuously expanded, and the resources of the n+1th resource pool can be used to allocate the node ID to the newly added network device.
  • the length of the function is variable, the initial length FuncIniLen and the incremental length FunIncrLen of the function can be preset.
  • the initial length NodeInitlen and the incremental length NodeIncrLen corresponding to the node ID, and the specific values of the initial length FuncIniLen and the incremental length FunIncrLen corresponding to the function can be set according to the actual application.
  • the initial length NodeInitlen, the incremental length NodeIncrLen, the initial length FuncIniLen and the incremental length FunIncrLen are all multiples of 8 bits to implement byte alignment.
  • the node ID allocation is taken as an example for description, and further, the initial length NodeInitlen is 3 bits, and the incremental length NodeIncrLen is 3 bits as an example.
  • the length of the node ID is 3 bits.
  • the first bit can be fixed to 0, and the last two bits can be arbitrarily valued to obtain the first bit about the node ID.
  • it can be expanded for the first time.
  • the initial node ID length is 3 bits, and the expansion is 6 bits, so the node ID length is 9 bits; the first 3 bits can be fixed at 110, and the last 6 bits can be arbitrarily valued to obtain
  • the third resource pool, the size of the third resource pool is 2 6 64.
  • the initial node ID length is 3 bits
  • i*3bit is expanded
  • the node ID length is (i+1)*3bit
  • the first i+1 bits are fixed at 1...10 (the front There are i 1s)
  • the last (i+1)*2 bits take any value to obtain the i+1th resource pool
  • the size of the i+1th resource pool is 2 (2i+2) .
  • the set of the expanded node ID and the existing node ID is a prefix code and can coexist.
  • the prefix code means that the code with the prefix code characteristic is the prefix code
  • the prefix code characteristic means that when encoding the character set, it is required that the code of any character in the character set is not the prefix of the code of other characters.
  • the character set includes a/b/c, where the code corresponding to a is 0, the code corresponding to b is 10, and the code corresponding to c is 110, and the code corresponding to each character is not a prefix of the other two codes.
  • Prefix codes have a wide range of applications in the computer field.
  • the node ID when encoding the node ID, it can also be encoded according to the following rules.
  • the first bit can be fixed to 1, and the last two bits can be arbitrarily set to obtain the first resource pool.
  • the first expansion can be performed.
  • the second expansion can be performed.
  • the initial node ID length is 3 bits, and the expansion is 6 bits, so the node ID length is 9 bits; the first 3 bits can be fixed as 001, and the last 6 bits can be arbitrarily set to obtain
  • the initial node ID length is 3 bits
  • the node ID length is (i+1)*3bit
  • the first i+1 bits are fixed as 0...01 (the front There are i 0s)
  • the last (i+1)*2 bits take any value to obtain the i+1th resource pool
  • the size of the i+1th resource pool is 2 (2i+2 ).
  • the set of the expanded node ID and the existing node ID is a prefix code and can coexist.
  • the resource pool size corresponding to the i-th expansion is a coding space with a size of 2 (NodeInitLen+i*NodeIncrLen-i-1) .
  • the encoding rules corresponding to the function can refer to the above node ID encoding process.
  • the initial length FuncIniLen and the incremental length FunIncrLen are both 3 bits.
  • the first bit can be fixed to 0, and the last two bits can be arbitrarily set to obtain the first resource pool for the function ID.
  • the first expansion can be carried out.
  • the initial function ID length is 3 bits, and if the expansion is 3 bits, the function ID length is 6 bits; the first 2 bits are fixed at 10, and the last 4 bits can take any value.
  • the initial functionID length is 3bit
  • i*3bit is expanded
  • the function ID length is (i+1)*3bit
  • the first i+1 bits are fixed to 1...10 (preceded by i 1)
  • the following (i+1)*2 bits can be arbitrarily valued to obtain the i+1th resource pool
  • the size of the i+1th resource pool is 2 (2i+2) .
  • the first expansion can be performed.
  • the initial function ID length is 3 bits, and the length of the function ID is 6 bits.
  • the second expansion can be carried out.
  • the initial function ID length is 3 bits
  • the function ID length is (i+1)*3bit
  • the first i+1 bits are fixed as 0...01 (the front There are i 0s)
  • the following (i+1)*2 bits take any value to obtain the i+1th resource pool
  • the size of the i+1th resource pool is 2 (2i+2) .
  • the set of the expanded function ID and the existing function ID is a prefix code and can coexist.
  • the prefixes of all SIDs are the same, but the lengths of the node IDs in all SIDs are not the same.
  • the node ID corresponding to network device 1 is 000
  • the node ID corresponding to network device 2 is 001
  • the length is 3 bits
  • the node ID corresponding to network device 5 is 100000
  • the length is 6 bits.
  • the length of the function ID field in all SIDs is not the same.
  • the function ID in a SID corresponding to network device 1 is 000
  • the function ID in a SID corresponding to network device 2 is 001
  • the length is 3 bits
  • the function ID in a SID corresponding to network device 5 is 100000
  • the length is 6bit.
  • the expansion of the node ID resource pool is usually performed by the user multiple times according to the current network size, so as to assign a unique node ID to each network device in the network.
  • function IDs due to the different functions undertaken by different network devices, some network devices undertake more functions and require a larger number of function IDs, while other network devices undertake fewer functions and require The number of function IDs is small, so the expansion of function IDs can be performed by each network device.
  • the method may include:
  • the first network device obtains a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable-length part, the first variable-length part belongs to a first resource pool, and the first resource pool includes a plurality of first variable length portions.
  • the corresponding compressed segment identifier can be obtained.
  • the compressed segment identifier includes node ID and function ID.
  • the first variable length part in the compressed segment identifier of the first length obtained by the first network device is the function identifier function ID, wherein the function ID in the compressed segment identifier of the first length belongs to the first resource pool, and the first The resource pool includes a plurality of first variable-length function IDs.
  • the first resource pool is [000, 001, 010, 011]
  • the first resource pool includes 4 function IDs of the first variable length, wherein 000 indicates function1, 001 indicates function2, 010 indicates function3, and 011 indicates function4.
  • the first network device Based on insufficient resources in the first resource pool, the first network device obtains a compressed segment identifier of a second length, where the second length is greater than or equal to the first length, and the compressed segment identifier of the second length includes a second variable length part,
  • the second variable length portion belongs to a second resource pool that includes a plurality of second variable length portions.
  • the first network device can be based on the preconfigured function IDs.
  • the initial length and incremental length of the ID expand the resource pool of the function ID to obtain a second variable-length function ID.
  • the first network device obtains the compressed segment identifier of the second length based on the node ID and the function ID of the second variable length.
  • the compressed segment identifier of the second length includes a second variable length part, that is, a function ID of the second variable length, and the second resource pool to which the second variable length part belongs may include a plurality of second variable lengths The function ID of .
  • the second resource pool is [100000, 100001, 100010, 100011], where 100000 indicates function5, 100001 indicates function6, 100010 indicates function7, and 100011 indicates function8.
  • the first network device may automatically generate the second resource pool through an interior gateway protocol (interior gateway protocol, IGP) and a preconfigured initial length and incremental length.
  • IGP interior gateway protocol
  • the first network device obtains the compressed segment identifier of the second length according to the generated second resource, and delivers the compressed segment identifier of the second length to the forwarding entry.
  • the first network device can also obtain a compressed segment identifier of a third length, where the third length is greater than or equal to the second length, and the compressed segment identifier of the third length is A third variable length portion is included, the third variable length portion belongs to a third resource pool, and the third resource pool includes a plurality of third variable length portions.
  • the first network device obtains the compressed segment identifier of the n+1th length, where the n+1th length is greater than or equal to the nth length.
  • the compressed segment identifier of the n+1th length includes the n+1th variable length part, the n+1th variable length part belongs to the n+1th resource pool, and the n+1th resource pool includes a plurality of nth +1 variable length part, where n is a natural number greater than 1. That is, when the number of functions corresponding to the first network device is large, the length of the function ID can be expanded multiple times to obtain compressed segment identifiers of different lengths. With the method provided in this embodiment, when the number of functions corresponding to the network device is small, a shorter function ID can be used to shorten the length of the C-SID and avoid using the space of a long SID.
  • a longer function ID can be used to increase the length of the C-SID to avoid the problem of insufficient space caused by the fixed-length SID.
  • the extended implementation of the function ID reference may be made to the description of the encoding rule for the function ID above, which will not be repeated in this embodiment.
  • the tolerance is equal to the difference between the second variable length part and the first variable length part, that is, the incremental length.
  • the length of the node ID is 8 bits
  • the initial length of the function ID is 8 bits
  • the increment length is 8 bits
  • the length of the C-SID of the first length is 16 bits
  • the length of the C-SID of the second length is 24 bits. bits
  • the difference between the lengths of the two is 8 bits.
  • the first network device sends the compressed segment identifier of the first length and the compressed segment identifier of the second length, where the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the segment executed by the first network device .
  • the first network device may send the compressed segment identifier of the first length and the compressed segment identifier of the second length to other network devices according to the actual application situation. For example, information related to the identifier of the compressed segment can be flooded out through the IGP protocol. Other network devices obtain the compressed segment identifier sent by the first network device, thereby implementing network functions, for example, generating a forwarding entry according to the compressed segment identifier sent by the first network device, or generating a guide based on the compressed segment identifier sent by the first network device The segment identifier for packet forwarding.
  • the first network device sends compressed segment identifiers of different lengths, the two compressed segment identifiers of different lengths are both used to indicate segments executed by the first network device.
  • the first network device may send compressed segment identifiers of different lengths according to the function to be implemented. For example, if the function to be implemented by the first network device is function1, the compressed segment identifier of the first length is sent; when the function implemented by the first network device is function7, the compressed segment identifier of the second length is sent; The function is function 30, then the compressed segment identifier of the third length is sent.
  • the first network device may also send the synthesized locator and the initial length and increment length corresponding to the variable length part.
  • the variable length part includes the node identifier and the function identifier
  • the first network device sends the initial length NodeInitlen and the increment length NodeIncrLen corresponding to the node identifier and the initial length FuncIniLen and the increment length FunIncrLen corresponding to the function identifier.
  • the initial length and incremental length of the node identifier and the initial length and incremental length of the function identifier can be manually configured by the user when configuring the locator, and the parameters configured in the same sub-network domain are the same.
  • the length of the C-SID may be aligned with 8 bits, that is, the length of the C-SID is an integer multiple of 8 bits.
  • the length of the C-SID may be 32 bits or 16 bits.
  • the initial length NodeInitlen and the increment length NodeIncrLen corresponding to the node ID should both be multiples of 8 bits, and/or the initial length FuncIniLen and the increment length FunIncrLen corresponding to the function should both be multiples of 8 bits.
  • SRv6 SIDs that are conducive to compression.
  • a shorter function field can be used, or a shorter node ID can be used.
  • the prefix is 64 bits
  • the node ID is 16 bits
  • the function field is 16 bits
  • the corresponding C-SID is 32 bits.
  • the prefix is 64 bits
  • the node ID is 8 bits
  • the function field is 8 bits
  • the rest is the padding field, so the corresponding C-SID is 16 bits.
  • An embodiment of the present application proposes a method for forwarding a packet, and the method involves a network device on a packet forwarding path.
  • the first packet received by the second network device includes a segment list corresponding to the forwarding path of the first packet, and the segment list includes a plurality of compressed segment identifiers arranged in sequence, wherein each compressed segment identifier The length is less than or equal to 128 bits.
  • the second network device reads the content to be copied from the segment list according to the encoding rule, and the network device corresponding to the content to be copied is the next-hop network device.
  • the encoding rule is a rule corresponding to the network device corresponding to the content to be copied generating the content to be copied.
  • the encoding rules corresponding to the compressed segment identifiers in the same sub-domain are the same, and the same sub-domain means that the prefixes in the sub-domain are the same.
  • the second network device updates the destination address DA in the first packet by using the read content to be copied, so as to generate a second packet, and forward the second packet. That is, for the multiple compressed segment identifiers included in the segment list, it is not necessary to know the corresponding length of each compressed segment identifier in advance, but can be obtained according to the encoding rule corresponding to the sub-network domain to which the compressed segment identifier belongs.
  • C-SIDs of different lengths are mixed in the same SRv6 compression sub-path, it is compatible with the packet forwarding and processing process in the existing SRv6 network.
  • the method involves a network device 101 and a network device 102 .
  • the network device 101 is the head node on the packet forwarding path.
  • the network device 101 may be the network device S in the application scenario shown in FIG. 1.
  • the network device 102 is another network device except the head node on the packet forwarding path.
  • the network device 102 may be the network device 1 to the network device 5 in the application scenario shown in FIG. 1 .
  • the method can include:
  • S701 The network device 101 obtains a segment list of the forwarding path.
  • the network device 101 may be the network device S in FIG. 1 , and the network device S may be an ingress device of the SRv6 network.
  • the network device 101 obtains the segment list of the forwarding path, including the segment list of the forwarding path received by the network device 101 from the controller, or the segment list of the forwarding path generated by the network device 101.
  • the network device 101 When the network device 101 generates the segment list of the forwarding path, it first determines the forwarding path corresponding to the forwarding packet, and generates the segment list according to the forwarding path.
  • the segment list includes multiple compressed segment identifiers arranged in sequence, each of the multiple compressed segment identifiers has a length of less than 128 bits, and the multiple compressed segment identifiers include a compressed segment identifier of a first length and a first compressed segment identifier.
  • a two-length compressed segment identifier, the first length and the second length are different, and each compressed segment identifier includes a prefix code.
  • the compressed segment identifier includes a node identifier and a function identifier.
  • the length of the node identifier node ID and/or function identifier function ID can be expanded to meet the expansion of the network scale and the number of functions corresponding to each network device. expand.
  • each compressed segment identifier may include a variable length portion, wherein the length of the variable length portion of the compressed segment identifier of the first length and the length of the variable length portion of the compressed segment identifier of the second length are different, and the length of the variable length portion of the compressed segment identifier of the second length is different.
  • the variable-length part includes a prefix code and the length of the variable-length part can be determined according to the encoding rule of the variable-length part. Wherein, for the coding rules of the variable-length part, reference may be made to the description of the above-mentioned node ID and/or function ID coding rules, which will not be repeated in this embodiment.
  • variable length part can be the function ID function ID, which is the prefix code, or the variable length part is the node ID node ID, and the node ID is the prefix code.
  • the variable length part in the compressed segment identifier of the first length corresponds to the identifier type corresponding to the variable length part of the compressed segment identifier of the second length, for example, both are function identifiers or both are node identifiers.
  • the node identifiers in the compressed segment identifier of the first length and the compressed segment identifier of the second length may be the same or different.
  • the node identifiers in the compressed segment identifier of the first length and the compressed segment identifier of the second length are the same, it indicates that the compressed segment identifier of the first length and the compressed segment identifier of the second length indicate segments executed by the same network device, for example, Both the compressed segment identifier of the first length and the compressed segment identifier of the second length indicate segments executed by the network device 1 .
  • the compressed segment identifier of the first length and the compressed segment identifier of the second length respectively indicate segments executed by different network devices, for example
  • the compressed segment identifier of the first length is used to indicate the segment executed by the network device 1
  • the compressed segment identifier of the second length is used to indicate the segment executed by the network device 2 .
  • the segment list may include multiple compressed segment identifiers C-SIDs of different lengths, for example, C-SIDs of a first length and C-SIDs of a second length.
  • the prefix part of the prefix corresponding to the C-SID of the first length and the prefix corresponding to the C-SID of the second length may be the same.
  • the C-SID of the first length and the C-SID of the second length are located in the same segment of SRv6 in the subnet.
  • the prefix part of the prefix corresponding to the C-SID of the first length and the prefix part of the prefix part of the C-SID of the second length may also be different.
  • the prefix part corresponding to the C-SID of the first length is prefix1
  • the C-SID of the second length is prefix2. That is, the C-SID of the first length and the C-SID of the second length are located in different SRv6 subnets, respectively.
  • the packet processing process includes 5 segments
  • the total length of the 5 SIDs is 80 bytes.
  • the total length of C-SID is 20 bytes, and the compression effect is obvious.
  • first obtain the SID list including the SID then compress the SID in the SID list including the segment identifier, replace the SID in it with the corresponding C-SID, and obtain the SID including the SID list.
  • the SID list of the C-SID; or, the SID can also be compressed first to obtain the corresponding C-SID, and then the SID list including the C-SID is obtained according to the C-SID.
  • the segment list includes elements of length 128 bits, and the C-SID of the first length and the C-SID of the second length may be located in the same element in the segment list.
  • a segment list including C-SIDs of different lengths is shown in FIG. 8a, and the segments executed by network device 1-network device 4 can be identified by a C-SID with a length of 16 bits, that is, C - SID1 to C-SID4; the segment performed by the network device 5 can be represented by a C-SID with a length of 32 bits, ie C-SID5.
  • the segment list can include only 1 container.
  • the total length of the segment list shown in Figure 8a 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, so that the length of the entire SID list is further shortened and network efficiency is improved. When the number of C-SIDs in the SID list is larger, the effect of this technique will be more significant.
  • the network device 101 generates a first packet, where the first packet includes a segment list corresponding to a forwarding path of the first packet.
  • the network device 101 after the network device 101 generates or obtains the segment list corresponding to the message forwarding path, it can encapsulate the segment list SID List in the received data message to pass
  • the segment list indicates the forwarding path of the data packet.
  • the network device 101 encapsulates the IPv6 header and the SRH outside the received data packet to form an SRv6 data packet. That is, the first packet is an SRv6 data packet.
  • the network device 101 obtains a segment list corresponding to the forwarding path of the first packet, and encapsulates the segment list in the first packet, so as to process the first packet.
  • the process is carried in the message and transmitted to each network device on the forwarding path of the first message, so that each network device on the forwarding path executes its own related message processing behavior in sequence after receiving the first message.
  • the first packet may further include an extension pointer, so as to use the extension pointer to sequentially indicate each compressed segment identifier and/or segment identifier among the multiple compressed segment identifiers in the segment list.
  • the extended pointer may be a one-dimensional pointer or a two-dimensional pointer.
  • the first-dimensional pointer namely the SL pointer
  • the second-dimensional pointer namely the SI
  • the one-dimensional pointer is used to indicate a certain -SID in the SID list.
  • the extension pointer may be located in the SRH in the message, or may be located in the DA field.
  • the extension pointer may be located in a specific field in the SRH.
  • the least significant byte of the DA field can also be used to place the SI, which is convenient for hardware implementation and facilitates the expansion of future solutions.
  • the extended pointer may be added to the first packet by the network device 101, and the initial value of the extended pointer in the first packet is set.
  • the initial value of the SL pointer is set to N-1, where N is the number of containers included in the SID list, and the SL pointer points to each container in a decremented form.
  • the initial value of SI can be set to M, where M is the length of each container, that is, 128, and the SI pointer points to the bits in the container in a decremented form.
  • the initial value of SI can be set to 0, pointing to the bits in the container in incrementing form.
  • the initial value of SI is configured as N, where N is the total length of all G-SIDs included in the SID list.
  • the network device 101 may also place the prefix corresponding to the C-SID in the segment list in the DA field of the IPv6 packet header of the SRv6 data packet.
  • the network device 101 may place the first C-SID in the segment list after the prefix in the DA field.
  • the network device S places the prefix at the starting position of the DA field, and places the C-SID 1 after the prefix in the DA field, so that the Content prefix+C-SID 1 restores SID 1.
  • the value of the extension pointer may not be updated, that is, the network device 101 places the first G-SID in the SID list in the DA field
  • the value of the extended pointer is still the initial value. That is, for 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.
  • the network device S places C-SID 1 in the DA field of the second message, and the The value of the SL pointer in the second packet is still the initial value of 0, and the value of the SI is still the initial value of 0 or 127.
  • the value range of SI is 0-127, which is used to indicate each bit.
  • the value of the extended pointer may be updated, that is, the network device 101 places the first G-SID in the segment list in the DA field
  • the value of the extension pointer is increased by the first G-SID length. That is, the extension pointer points to the second G-SID in the segment list.
  • the SID list only consists of SIDs.
  • the network device decrements the value of the SL field in the packet SRH by 1, and copies the segment list[SL] to the DA of the IPv6 header. field, that is, update the content of the DA field.
  • the C-SID is also included in the SID list, in order to be compatible with the packet forwarding process in the above-mentioned SRv6 network, the update method of the DA field by the network device will change.
  • the network device needs to know the starting position of the next compressed SID, read the node ID and function ID according to the coding rules from the starting position, combine the two to obtain the next compressed SID, and use the compressed SID to update the DA. field.
  • the initial length of the entire network configuration is 3 bits
  • the incremental length is 3 bits.
  • the locator of network device 1 is FFFF:001X::/19, where FFFF is the prefix part with a length of 16 bits, and 001 is a binary node ID with a length of 3 bits, that is, the sum of the length of the prefix part and the node id is 19 Bit, X represents a placeholder for all zeros, after the node id.
  • the SID is FFFF:001001X::, the length is 128 bits, FFFF is the prefix part, the length is 16 bits, 001 is the node ID in binary form, the length is 3 bits, 001 is the function ID in binary form, the length is 3 bits, X stands for an all-zero placeholder after the function ID, and the compressed SID is 001001.
  • the locator of network device 2 is FFFF:100001X::/22, where FFFF is the prefix part with a length of 16 bits, 100001 is a binary node ID with a length of 6 bits, that is, the sum of the length of the prefix part and the node id is 22 Bit, X represents a placeholder for all zeros, after the node id.
  • SID is FFFF:100001110010011X::, the length is 128 bits, FFFF is the prefix part, the length is 16 bits, 100001 is the node ID in binary form, the length is 6 bits, 110010011 is the function ID in binary form, the length is 9 bits, X stands for an all-zero placeholder after the function ID, and the compressed SID is 100001110010011.
  • the incoming DA is FFFF:001001X::20, and the SID list is [Y001001100001110010011Y], where Y identifies other content, such as the SIDs corresponding to other network devices.
  • the network device 1 is a pointer in hexadecimal form, that is, it points to the 32nd bit in an element with a length of 128 bits.
  • the network device 1 executes the function of FFFF:001001X, and at the same time, the network device 1 moves the SI pointer to the next compressed SID (6 bits) according to the length of its corresponding SID (6 bits).
  • the starting position 26 of the SID corresponding to the network device 2) indicates that the pointer points to the 38th bit in the element with a length of 128 bits, then the network device 1 starts from the position indicated by the pointer, according to the node ID encoding rules, first read 1 1 and 1 0, then read 3+1*3-1-1 bits as 0001, get the node ID code 100001; then, according to the function ID encoding rules, read 2 1s and 1 0, continue to read 3+2*3-2-1 bits as 010011, get the function ID as 110010011, merge the node ID and function ID to get 100001110010011, replace it on DA to get FFFF: 100001110010011X :26.
  • S703 The network device 101 sends the first packet according to the segment list.
  • the network device 101 after the network device 101 generates the first packet, it forwards the first packet according to the forwarding path indicated by the segment list. Specifically, the network device 101 determines the next-hop network device according to the DA field in the IPv6 header of the first packet, and then sends the first packet to the next-hop network device.
  • the network device S has placed the C-SID 1 in the prefix and the SID list in the DA of the first message.
  • the network device S can restore the SID 1 according to the content prefix+C-SID 1 in the DA field of the first message, and the network device S searches for the local forwarding entry according to the SID 1, and determines that the next hop network device is the network device 1.
  • the endpoint node on the packet forwarding path receives the packets sent by the previous hop network device in turn, updates the content of the DA field according to the segment list, and then forwards the packet according to the content of the DA field, so that the packet follows the forwarding path corresponding to the segment list. send out.
  • S704 The network device 102 receives the first packet.
  • the network device 102 may receive the first packet sent by the previous-hop network device, where the network device 102 is an endpoint node other than the head node on the packet forwarding path.
  • the network device 102 may be the network devices 1 to 5 in the application scenario shown in FIG. 1 .
  • the first packet received by the network device 1 is the packet sent by the network device S, that is, the SRv6 data packet after the network device S encapsulates the SID list.
  • the first packets received by the network devices 2 to 5 are the SRv6 data packets updated by the previous hop network device.
  • the network device 102 reads the content to be copied from the segment list according to the encoding rule.
  • the network device 102 can read the content to be copied from the segment list according to the encoding rule, so as to use the content to be copied to update the destination DA in the first packet and use the content to be copied.
  • the compressed segment identifier determines the next hop network device.
  • the content to be copied is the compressed segment identifier updated by the network device 102 to the DA field of the first packet.
  • the network device 102 reads the content to be copied in the segment list according to the encoding rule, which can be implemented by the following two steps:
  • the network device 102 determines the starting position, where the starting position is used to indicate the starting position corresponding to the content to be copied.
  • the network device 102 may use the extension pointer to determine the starting position of the content to be copied in the segment list. Specifically, if the value of the extension pointer is not updated after the network device 101 places the first G-SID in the SID list in the DA field, the extension pointer points to the first G-SID at this time. In this case, the network device 102 updates the value of the extension pointer according to the length of its corresponding compressed segment identifier, so that the value of the updated extension pointer corresponds to the second G-SID, that is, the start of the content to be copied in the segment list Location.
  • the segment list may include compressed segment identifiers of different lengths, and the value of the extension pointer updated by the network device 102 is also different.
  • the length of the corresponding compressed segment identifier is 16 bits
  • the extension pointer is offset by 16 bits
  • the length of the corresponding compressed segment identifier is 32 bits
  • the extension pointer is offset by 32 bits.
  • the adjustment process of the value of the extended pointer is different.
  • the adjustment process of the extended pointer includes: the network device 102 determines the value of SI according to the length of its corresponding compressed segment identifier, so that the value of SI is used to indicate the length of the content to be copied. is the position in the 128-bit element. Specifically, the network device 102 reads the original value of SI in the header of the first packet, and subtracts the updated value from the original value of SI to obtain the value of SI. That is, the length corresponding to the update value is the length of the SI offset, and the length corresponding to the update value is the length of the G-SID corresponding to the network device 102 .
  • the update value may be a value obtained by dividing the length of the local G-SID by the unit length. That is, the length corresponding to the update value is an integral multiple of the unit length, that is, the length of the SI offset is an integral multiple of the unit length. For example, when the unit length is 16 bits, and the length indicated by the local segment identifier is 16 bits, the update value is 1, and the length indicated by the local segment identifier is 32 bits, and the update value is 2.
  • 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 the SL pointer. It is worth noting that during this process, the value of the SL pointer may need to be adjusted. Also, after adjusting the value of the SL pointer, it may be necessary to set the value of SI to the initial value.
  • the SL needs to be adjusted at this time
  • the value of the pointer is set so that the SL pointer points to the next element, and the value of SI is set to the initial value, so that the SI points to the first bit in the next element.
  • the SI offset points to the padding part of the current element
  • the value of SI is 111, pointing to the 112th bit, and the remaining 16 bits in the element are all 0, or the value of SI is 95, pointing to When the 96th bit and the remaining 32 bits in the element are all 0s, the value of the SL pointer needs to be adjusted so that the SL pointer points to the next element.
  • 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. Specifically, the network device 102 reads the original value of SI in the header of the first packet, and subtracts the updated value from the original value of SI to obtain the value of SI.
  • the update value of SI is similar to the above description, and will not be repeated here.
  • the network device 102 writes the value of the extended pointer into the first packet. That is, the updated message header of the first message, that is, the message header of the second message described later, includes the value of the extended pointer.
  • the extension pointer If the value of the extension pointer is updated after the network device 101 places the first G-SID in the segment list in the DA field, the extension pointer now points to the second G-SID. That is, the value of the extension pointer at this time corresponds to the starting position of the content to be copied in the segment list.
  • the network device 102 determines the length of the content to be copied according to the encoding rule and the starting position.
  • the network device 102 may determine the length of the content to be copied according to the encoding rule and the starting position, that is, obtain the content to be copied.
  • the network device 102 obtains a first parameter set and/or a second parameter set, where the first parameter set includes the first initial length and the first incremental length corresponding to the node identifier, and the second parameter set includes the first parameter set corresponding to the function identifier. 2.
  • the initial length and the second incremental length; the network device 102 determines the length of the content to be copied according to the encoding rule, the first parameter set and/or the second parameter set, and the starting position.
  • both the first initial length and the first increment length may be multiples of 8 bits
  • both the second initial length and the second increment length may be multiples of 8 bits.
  • the length of the content to be copied is related to the number of expansions i or j, which can be specifically determined by the following steps:
  • the network device 102 reads N bits backward from the starting position, the first i bit in the N bits is 1, and the i+1th bit is 0 or the first among the N bits. The i bits are 0, and the i+1th bit is 1.
  • the value of i can also represent the number of times that the node identifier is expanded.
  • the network device 102 continues to read P bits backward, the first j bits in the P bits are 1, the j+1th bit is 0, or the first j among the P bits The bit is 0, and the j+1th bit is 1.
  • the Q second initial length+j*second increment length ⁇ j ⁇ 1 bits, and uses P+Q bits as the content to be copied.
  • the length of the feature ID is the length of the feature ID.
  • the value of j may also represent the number of times the function identifier is expanded.
  • the network device 102 obtains the length of the content to be copied according to the length of the node identifier in the content to be copied and the length of the function identifier in the content to be copied.
  • the compressed segment identifier of the second network device is "001001"
  • the extended pointer points to the first bit "0" of the compressed segment identifier of the second network device
  • the extension pointer is moved backward by 6 bits to point to the first bit of the content to be copied.
  • the network device 102 can determine whether the C-SID or SID value in the DA field in the first packet is the same as the local segment identifier SID, if they are the same , the operation of S706 is performed.
  • the network device 102 updates the destination address DA in the first packet according to the content to be copied, so as to generate a second packet.
  • the network device 102 uses the content to be copied to update the content of the destination address DA in the first message, and uses the message including the updated DA as the second message.
  • the network device 102 can directly use the content to be copied to update the information in the DA field except the prefix part, so as to obtain the updated information DA field.
  • S707 The network device 102 sends the second packet.
  • the network device 102 may determine the next-hop network device according to the content of the DA field in the second packet, and send the second packet to the next-hop network device. For example, when the network device 102 is the network device 1, the prefix+C-SID 2 in the DA field of the second packet restores the SID 2, and the network device 1 searches the local forwarding entry according to the SID 2 to determine the next hop network device For the network device 2, the second packet is sent to the network device 2. When the network device 102 is the network devices 2 to 5, the process of sending the second packet by the network device 102 according to the content of the destination address field is analogous, and details are not repeated here.
  • the network device may also update the DA field in the following manner.
  • the C-SID or SID may carry the continue of compression (COC) information, and the COC information is used to indicate the SID list Whether the C-SID continues to be arranged.
  • COC continue of compression
  • the C-SID in the current DA field includes COC information, it indicates that the next C-SID to be processed corresponds to the same prefix as the C-SID in the DA field, and the next C-SID to be processed is copied to the DA field After the prefix, the next C-SID to be processed and the prefix restore the next SID.
  • the C-SID in the current DA field does not include the COC message, it indicates that the prefix will change.
  • the network device uses the standard processing method to copy the 128-bit SID into the DA field.
  • the SID includes COC information, it indicates that the next C-SID to be processed corresponds to the same prefix as the SID, and the network device only needs to copy the next C-SID to be processed after the prefix in the DA field, and the next The pending C-SID and prefix restore the next SID.
  • the above COC information may be an attribute of SID or C-SID, also referred to as COC attribute.
  • the method relates to an implementation process of acquiring a segment list by the first network device, and the method may include:
  • S901 The first network device determines the forwarding path of the packet.
  • the first network device generates a segment list corresponding to the forwarding path.
  • the segment list includes multiple compressed segment identifiers arranged in sequence, each of the multiple compressed segment identifiers has a length of less than or equal to 128 bits, and the multiple compressed segment identifiers include a compressed segment identifier of a first length and The compressed segment identifier of the second length, the first length is different from the second length, and each compressed segment identifier of the plurality of compressed segment identifiers includes a prefix code.
  • each compressed segment identifier includes a variable length portion, and the length of the variable length portion of the compressed segment identifier of the first length is the same as the variable length of the compressed segment identifier of the second length.
  • the lengths of the parts are different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
  • the first network device may be the network device S in the embodiment corresponding to FIG. 1 , and the network device S may be an ingress device of the SRv6 network. After generating the segment list corresponding to the forwarding path, the first network device may generate a segment list including segments list of messages. Alternatively, the first network device may also be a controller in the network. In this case, the first network device sends the segment list to the ingress device of the forwarding path, and the ingress device generates the first packet according to the segment list.
  • S701 For the specific implementation of determining the forwarding path and generating the segment list by the first network device, reference may be made to the detailed description of S701, and details are not described herein again in this embodiment.
  • FIG. 10 is a structural diagram of a message transmission apparatus provided by an embodiment of the present application.
  • the apparatus 1000 includes: a receiving unit 1001 , a processing unit 1002 , and a sending unit 1003 .
  • a receiving unit 1001 configured to receive a first packet sent by the first network device, where the first packet includes a segment list corresponding to a forwarding path of the first packet, and the segment list includes sequentially arranged Multiple compressed segment identifiers, each of the multiple compressed segment identifiers has a length of less than or equal to 128 bits.
  • the receiving unit 1001 reference may be made to the detailed description of S705.
  • the processing unit 1002 is configured to read the content to be copied in the segment list according to an encoding rule, where the encoding rule is used to indicate an encoding rule corresponding to the content to be copied.
  • an encoding rule is used to indicate an encoding rule corresponding to the content to be copied.
  • the processing unit 1002 is further configured to update the destination address DA in the first packet according to the content to be copied, so as to generate a second packet.
  • the processing unit 1002 reference may be made to the relevant description of S707.
  • a sending unit 1003, configured to send the second packet.
  • the sending unit 1003 reference may be made to the relevant description of S707.
  • the apparatus 1100 includes: a processing unit 1101 and a sending unit 1102 .
  • the processing unit 1101 is configured to generate a first packet, where the first packet includes a segment list corresponding to a forwarding path of the first packet, the segment list includes a plurality of compressed segment identifiers arranged in sequence, and the The length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bits, and the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, and the first length and The second lengths are different, and each of the plurality of compressed segment identifiers includes a prefix code.
  • the processing unit 1101 reference may be made to the relevant description of S703.
  • the sending unit 1102 is configured to send the first packet according to the segment list.
  • the sending unit 1102 reference may be made to the relevant description of S704.
  • the apparatus 1200 includes: a processing unit 1201 .
  • the processing unit 1201 is configured to determine the forwarding path of the packet.
  • the processing unit 1201 is further configured to generate a segment list corresponding to the forwarding path, where the segment list includes multiple compressed segment identifiers arranged in sequence, and the length of each compressed segment identifier in the multiple compressed segment identifiers less than or equal to 128 bits, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the second length are different, the multiple compressed segment identifiers Each compressed segment identifier in includes a prefix code.
  • the processing unit 1101 reference may be made to the relevant descriptions of S701-S702.
  • the apparatus 1200 includes: a processing unit 1301 and a sending unit 1302 .
  • the processing unit 1301 is configured to obtain a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable-length part, the first variable-length part belongs to a first resource pool, and the first The resource pool includes a plurality of said first variable length portions.
  • the processing unit 1301 reference may be made to the relevant description of S401.
  • the processing unit 1301 is further configured to obtain a compressed segment identifier of a second length based on insufficient resources of the first resource pool, where the second length is greater than or equal to the first length, and a compressed segment of the second length is
  • the identification includes a second variable length portion, the second variable length portion belongs to a second resource pool, the second resource pool includes a plurality of the second variable length portions.
  • the sending unit 1302 is configured to send the compressed segment identifier of the first length and the compressed segment identifier of the second length, where the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the Describe the segment executed by the first network device.
  • the sending unit 1303 For the specific implementation of the sending unit 1303, reference may be made to the relevant description of S403.
  • an embodiment of the present application further provides a communication system, the system includes: a first network device and a second network device; wherein, the operations that can be performed by the first network device may refer to the first network device in the embodiment shown in FIG. 9 .
  • the operations that can be performed by the first network device may refer to the first network device in the embodiment shown in FIG. 9 .
  • the operations that can be performed by the second network device refer to the related description of the second network device in the example shown in FIG. 9 .
  • FIG. 14 is a schematic structural diagram of a network device according to an embodiment of the present application.
  • the network device may be the first network device or the second network device in the embodiment shown in FIG. 9 , or may also be the implementation shown in FIG. 10 .
  • the apparatus 1000 in the example, the apparatus 1100 in the embodiment shown in FIG. 11 , the apparatus 1200 in the embodiment shown in FIG. 12 , and the apparatus 1300 in the embodiment shown in FIG. 13 are implemented by equipment.
  • the network device 1400 includes at least a processor 1410 .
  • Network device 1400 may also include communication interface 1420 and memory 1430 .
  • the number of processors 1410 in the network device 1400 may be one or more, and one processor is taken as an example in FIG. 14 .
  • the processor 1410, the communication interface 1420, and the memory 1430 may be connected through a bus system or other manners, wherein the connection through the bus system 1440 is taken as an example in FIG. 14 .
  • Processor 1410 may be a CPU, NP, or a combination of CPU and NP.
  • the processor 1410 may further include hardware chips.
  • the above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general-purpose array logic (generic array logic, GAL) or any combination thereof.
  • the processor 1410 may execute the first network device in the foregoing method embodiment to obtain the compressed segment identifier of the first length and the compressed segment identifier of the second length, determine the forwarding path of the packet, and generate the corresponding For the segment list of the forwarding path, generating the first packet, etc.
  • the processor 1410 may perform related functions such as reading the content to be copied in the segment list according to the encoding rule and updating the destination address DA of the first packet according to the content to be copied in the above method example.
  • the communication interface 1420 is used for receiving and sending messages.
  • the communication interface 1420 may include a receiving interface and a sending interface.
  • the receiving interface may be used to receive packets, and the sending interface may be used to send packets.
  • the number of communication interfaces 1420 may be one or more.
  • the memory 1430 may include a volatile memory (English: volatile memory), such as random-access memory (RAM); the memory 1430 may also include a non-volatile memory (English: non-volatile memory), such as a fast memory Flash memory (English: flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); the memory 1430 may also include a combination of the above-mentioned types of memory.
  • volatile memory such as random-access memory (RAM)
  • non-volatile memory such as a fast memory Flash memory (English: flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD)
  • HDD hard disk drive
  • SSD solid-state drive
  • the memory 1430 stores an operating system and programs, executable modules or data structures, or their subsets, or their extended sets, wherein the programs may include various operation instructions for implementing various operations.
  • the operating system may include various system programs for implementing various basic services and handling hardware-based tasks.
  • the processor 1410 may read the program in the memory 1430, and implement the method for message transmission, the method for generating a segment list, and the method for obtaining a compressed segment identifier provided by the embodiments of the present application.
  • the memory 1430 may be a storage device in the network device 1400 , or may be a storage device independent of the network device 1400 .
  • the bus system 1440 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus system 1440 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is shown in FIG. 14, but it does not mean that there is only one bus or one type of bus.
  • FIG. 15 is a schematic structural diagram of another network device 1500 provided by an embodiment of the present application.
  • the network device 1500 may be the first network device or the second network device in the embodiment shown in FIG. 9 , or may also be the implementation shown in FIG. 10 .
  • the apparatus 1000 in the example, the apparatus 1100 in the embodiment shown in FIG. 11 , the apparatus 1200 in the embodiment shown in FIG. 12 , and the apparatus 1300 in the embodiment shown in FIG. 13 are implemented by equipment.
  • the network device 1500 includes: a main control board 1510 and an interface board 1530 .
  • the main control board 1510 is also called the main processing unit (main processing unit, MPU) or the route processor card (route processor card).
  • the main control board 1510 controls and manages each component in the network device 1500 Equipment maintenance, protocol processing functions.
  • the main control board 1510 includes: a central processing unit 1511 and a memory 1512 .
  • the interface board 1530 is also referred to as a line processing unit (LPU), a line card or a service board.
  • the interface board 1530 is used to provide various service interfaces and realize data packet forwarding.
  • the service interface includes, but is not limited to, an Ethernet interface, a POS (Packet over SONET/SDH) interface, etc.
  • the Ethernet interface is, for example, a flexible Ethernet service interface (Flexible Ethernet Clients, FlexE Clients).
  • the interface board 1530 includes: a central processing unit 1531 , a network processor 1532 , a forwarding table entry memory 1534 and a physical interface card (ph8sical interface card, PIC) 1533 .
  • the central processing unit 1531 on the interface board 1530 is used to control and manage the interface board 1530 and communicate with the central processing unit 1511 on the main control board 1510 .
  • the network processor 1532 is used to implement packet forwarding processing.
  • the network processor 1532 may be in the form of a forwarding chip.
  • the processing of the uplink packet includes: processing of the incoming interface of the packet, and searching of the forwarding table; processing of the downlink packet: searching of the forwarding table, and so on.
  • the physical interface card 1533 is used to realize the interconnection function of the physical layer, the original traffic enters the interface board 1530 through this, and the processed packets are sent from the physical interface card 1533 .
  • the physical interface card 1533 includes at least one physical interface, which is also called a physical port.
  • the physical interface card 1533 is also called a daughter card, which can be installed on the interface board 1530, and is responsible for converting the photoelectric signal into a message, and after checking the validity of the message, it is forwarded to the network processor 1532 for processing.
  • the central processing unit 1531 of the interface board 1503 can also perform the functions of the network processor 1532 , such as implementing software forwarding based on a general-purpose CPU, so that the network processor 1532 is not required in the physical interface card 1533 .
  • the network device 1500 includes multiple interface boards.
  • the network device 1500 further includes an interface board 1540.
  • the interface board 1540 includes a central processing unit 1541, a network processor 1542, a forwarding table entry storage 1544, and a physical interface card 1543.
  • the network device 1500 further includes a switch fabric board 1520 .
  • the switch fabric unit 1520 may also be referred to as a switch fabric unit (switch fabric unit, SFU).
  • SFU switch fabric unit
  • the switching network board 1520 is used to complete data exchange between the interface boards.
  • the interface board 1530 and the interface board 1540 can communicate through the switch fabric board 1520 .
  • the main control board 1510 and the interface board 1530 are coupled.
  • the main control board 1510 , the interface board 1530 , the interface board 1540 , and the switch fabric board 1520 are connected to the system backplane through a system bus to implement intercommunication.
  • an inter-process communication (inter-process communication, IPC) channel is established between the main control board 1510 and the interface board 1530, and the main control board 1510 and the interface board 1530 communicate through the IPC channel.
  • IPC inter-process communication
  • the network device 1500 includes a control plane and a forwarding plane
  • the control plane includes the main control board 1510 and the central processing unit 1531
  • the forwarding plane includes various components that perform forwarding, such as the forwarding entry storage 1534, the physical interface card 1533 and the network processing device 1532.
  • the control plane performs functions such as routers, generating forwarding tables, processing signaling and protocol packets, configuring and maintaining device status, etc.
  • the control plane delivers the generated forwarding tables to the forwarding plane.
  • the network processor 1532 is based on the control plane.
  • the delivered forwarding table forwards the packets received by the physical interface card 1533 by looking up the table.
  • the forwarding table issued by the control plane may be stored in the forwarding table entry storage 1534 .
  • the control plane and forwarding plane may be completely separate and not on the same device.
  • the sending unit and the receiving unit in each embodiment of FIGS. 10-13 may be different physical interface cards.
  • the receiving unit 1001 corresponds to the physical interface card 1533 and the sending unit 1003 corresponds to the physical interface card 1534.
  • the processing unit 1002 in the apparatus 1000, the processing unit 1101 in the apparatus 1100, the processing unit 1201 in the apparatus 1200, the processing unit 1301 in the apparatus 1300, etc. may be equivalent to the central processing unit 1511, the central processing unit 1531, One or more of the central processing units 1541.
  • the operations on the interface board 1540 in this embodiment of the present application are the same as the operations on the interface board 1530 , and for brevity, details are not repeated here.
  • the network device 1500 in this embodiment may correspond to the first network device or the second network device in the foregoing method embodiments, and the main control board 1510 , the interface board 1530 and/or the interface board 1540 in the network device 1500
  • the functions and/or various steps performed by the first network device or the second network device in the foregoing method embodiments can be implemented, which are not repeated here for brevity.
  • main control boards there may be one or more main control boards, and when there are more than one main control board, it may include an active main control board and a backup main control board.
  • a network device may have at least one switching network board, and the switching network board realizes data exchange between multiple interface boards, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices in a distributed architecture are greater than those in a centralized architecture.
  • the form of the network device can also be that there is only one board, that is, there is no switching network board, and the functions of the interface board and the main control board are integrated on this board.
  • the central processing unit on the board can be combined into a central processing unit on the board to perform the functions of the two superimposed, the data exchange and processing capacity of this form of equipment is low (for example, low-end switches or routers and other networks. equipment).
  • the specific architecture used depends on the specific networking deployment scenario.
  • the above-mentioned first network device or second network device may be implemented as a virtualized device.
  • the virtualization device may be a virtual machine (English: Virtual Machine, VM) running a program for sending a message function, and the virtual machine is deployed on a hardware device (for example, a physical server).
  • a virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment.
  • the virtual machine can be configured as a first network device or a second network device.
  • the first network device or the second network device may be implemented based on a general-purpose physical server in combination with a network function virtualization (Network Functions Virtualization, NFV) technology.
  • Network Functions Virtualization Network Functions Virtualization
  • the first network device or the second network device may be a virtual host, a virtual router or a virtual switch.
  • Those skilled in the art can virtualize a first network device or a second network device having the above functions on a general physical server in combination with the NFV technology by reading this application, and details are not described herein again.
  • network devices in the above-mentioned various product forms respectively have any functions of the first network device or the second network device in the above method embodiments, and details are not described herein again.
  • An embodiment of the present application also provides a chip, including a processor and an interface circuit, where the interface circuit is used to receive instructions and transmit them to the processor; the processor, for example, may be a specific implementation form of the apparatus 1000 shown in FIG. 10 . , which can be used to perform the above method of message transmission.
  • the processor is coupled to a memory, and the memory is used to store programs or instructions, and when the programs or instructions are executed by the processor, the chip system enables the method in any of the foregoing method embodiments.
  • the number of processors in the chip system may be one or more.
  • the processor can be implemented by hardware or by software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software codes stored in memory.
  • the memory may be integrated with the processor, or may be provided separately from the processor, which is not limited in this application.
  • the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip, or can be provided on different chips.
  • the setting method of the processor is not particularly limited.
  • the system-on-chip may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (SoC), It can also be a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), or a microcontroller (microcontroller).
  • controller unit, MCU it can also be a programmable logic device (PLD) or other integrated chips.
  • Embodiments of the present application further provide a computer-readable storage medium, including instructions or computer programs, which, when run on a computer, cause the computer to execute the packet transmission method, the segment list generation method, and the compressed segment identifier provided by the above embodiments get method.
  • the embodiments of the present application also provide a computer program product including an instruction or a computer program, which, when running on a computer, enables the computer to execute the message transmission method, the segment list generation method, and the compressed segment identifier acquisition method provided by the above embodiments .
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of units is only a logical business division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each service unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of a software business unit.
  • the integrated unit if implemented as a software business unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
  • the services described in the present invention may be implemented by hardware, software, firmware or any combination thereof.
  • the services may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
  • Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Disclosed are a message transmission method, a segment list generation method, a compressed segment identifier acquisition method, and apparatuses. A first message received by a second network device comprises a segment list corresponding to a first message forwarding path, wherein the segment list comprises a plurality of compressed segment identifiers which are arranged in sequence, and the length of each compressed segment identifier is less than or equal to 128 bits; the second network device reads, from the segment list and according to an encoding rule, content to be copied, wherein the encoding rule is a rule corresponding to a network device corresponding to said content when generating said content; and the second network device updates a destination address (DA) in the first message by using the read content, so as to generate a second message, and forwards the second message. That is, with regard to a plurality of compressed segment identifiers included in a segment list, it is not necessary to learn the length of each compressed segment identifier in advance, and the length of the compressed segment identifier can be learned of according to an encoding rule corresponding to the compressed segment identifier, such that the compressed segment identifier is read from the segment list.

Description

一种报文传输、段列表生成、压缩段标识获取方法及装置Method and device for message transmission, segment list generation, and compressed segment identifier acquisition
本申请要求于2020年11月30日提交的申请号为202011377914.1、申请名称为“一种报文传输、段列表生成、压缩段标识获取方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on November 30, 2020 with the application number 202011377914.1 and the application name "A method and device for message transmission, segment list generation, and compressed segment identification acquisition", the entire contents of which are Incorporated herein by reference.
技术领域technical field
本申请涉及通信技术领域,尤其涉及一种报文传输、段列表生成、压缩段标识获取方法及装置。The present application relates to the field of communication technologies, and in particular, to a method and device for message transmission, segment list generation, and compressed segment identifier acquisition.
背景技术Background technique
段路由(segment routing,SR)协议是一种源路由协议,由源节点为应用报文指定路径,并将路径转换成一个有序的段(Segment)列表封装到报文头中,路径上的中间节点只需要根据报文头中指定的路径进行转发。SR的基本理念是把网络分为不同的段(Segment),通过将这些段拼接起来指导报文按指定的路径转发,具体利用段标识(segment identity,SID)来标识一个段。当SR部署在互联网协议版本6(Internet Protocol Version 6,IPv6)数据平面上时,称为IPv6 segment routing(SRv6)。The segment routing (SR) protocol is a source routing protocol. The source node specifies the path for the application packet, and converts the path into an ordered segment (Segment) list and encapsulates it in the packet header. Intermediate nodes only need to forward according to the path specified in the packet header. The basic idea of SR is to divide the network into different segments (Segments), and guide packets to be forwarded according to the specified path by splicing these segments together. Specifically, segment identity (SID) is used to identify a segment. When SR is deployed on the Internet Protocol Version 6 (IPv6) data plane, it is called IPv6 segment routing (SRv6).
在SRv6应用中,转发路径信息由包含段标识列表(SID list)的段路由头(segment routing header,SRH)携带。SID list包括依次排列的多个段标识(SID),分别表示多个段,每个段为处理报文的指令或指令集合。SRH被封装在报文中,通过其中的段标识列表承载SR网络对该报文的处理过程。SRv6网络中的每个SID的长度为128比特(bit),则SID list中每增加一个SID,SRH的长度就会增加128bit,报文的长度也会增加128bit。一方面,报文长度增加将导致转发过程中占用大量的网络资源,导致网络链路带宽利用率低。另一方面,SRH长度过长将增加报文处理难度,造成现有设备难以对SRH进行有效处理。In SRv6 applications, forwarding path information is carried by a segment routing header (SRH) that includes a segment identification list (SID list). The SID list includes multiple segment identifiers (SIDs) arranged in sequence, respectively representing multiple segments, and each segment is an instruction or instruction set for processing the message. The SRH is encapsulated in the packet, and the segment ID list in the packet carries the processing process of the packet by the SR network. The length of each SID in the SRv6 network is 128 bits, and each time a SID is added to 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 of the packet length will cause a lot of network resources to be occupied during the forwarding process, resulting in low utilization of network link bandwidth. On the other hand, if the length of the SRH is too long, it will increase the difficulty of packet processing, making it difficult for existing devices to effectively process the SRH.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种报文传输、段列表生成、压缩段标识获取方法及装置,可以解决SRH长度过长影响SRv6报文传输效率的问题。The embodiments of the present application provide a method and device for message transmission, segment list generation, and compressed segment identifier acquisition, which can solve the problem that the length of the SRH is too long and affects the transmission efficiency of the SRv6 message.
在本申请实施例的第一方面,提供了一种报文传输方法,该方法包括:第二网络设备接收所述第一网络设备发送的第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中每个压缩段标识的长度小于等于128比特;第二网络设备根据编码规则在所述段列表中读取待拷贝内容,所述编码规则用于指示所述待拷贝内容对应的编码规则;第二网络设备根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文;第二网络设备发送所述第二报文。在该实现方式中,针对段列表中所包括的多个压缩段标识,无需提前获知每个压缩段标识各自对应的长度,而是根据压缩段标识对应的编码规则即可以获取。当不同长度的C-SID在同一段SRv6压缩子路径中混合编排时,与现有的SRv6网络中报文转发和处理过程相兼容。In a first aspect of the embodiments of the present application, a method for transmitting a packet is provided. The method includes: a second network device receives a first packet sent by the first network device, where the first packet includes a packet corresponding to A segment list of the forwarding path of the first packet, where the segment list includes multiple compressed segment identifiers arranged in sequence, and the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bits; the second network The device reads the content to be copied in the segment list according to the encoding rule, and the encoding rule is used to indicate the encoding rule corresponding to the content to be copied; the second network device updates the first packet according to the content to be copied to generate the second packet; the second network device sends the second packet. In this implementation manner, for the multiple compressed segment identifiers included in the segment list, it is not necessary to know the corresponding length of each compressed segment identifier in advance, but can be obtained according to the encoding rule corresponding to the compressed segment identifier. When C-SIDs of different lengths are mixed in the same SRv6 compression sub-path, it is compatible with the packet forwarding and processing process in the existing SRv6 network.
在一种可能的实现方式中,所述第二网络设备根据编码规则在所述段列表中读取待拷贝内容,包括:所述第二网络设备确定起始位置,所述起始位置用于指示所述待拷贝内容对应的起始位置;所述第二网络设备根据所述编码规则以及所述起始位置确定所述待拷贝内容的长度。在该实现方式中,由于段列表中所包括的压缩段标识的长度可以不同,在从段列表中读取待拷贝内容(下一个段标识或下一个压缩段标识)时,先确定待拷贝内容对应的起始位置,进而从起始位置开始按照编码规则确定待拷贝内容的长度,即读取待拷贝内容。In a possible implementation manner, the second network device reads the content to be copied in the segment list according to an encoding rule, including: determining, by the second network device, a starting position, where the starting position is used for Indicates the starting position corresponding to the content to be copied; the second network device determines the length of the content to be copied according to the encoding rule and the starting position. In this implementation manner, since the lengths of the compressed segment identifiers included in the segment list may be different, when reading the content to be copied (the next segment identifier or the next compressed segment identifier) from the segment list, first determine the content to be copied The corresponding starting position, and then the length of the content to be copied is determined from the starting position according to the encoding rule, that is, the content to be copied is read.
在一种可能的实现方式中,所述第二网络设备根据所述编码规则以及所述起始位置确定所述待拷贝内容的长度,包括:第二网络设备获取第一参数集合和/或第二参数集合,所述第一参数集合包括所述压缩段标识中节点标识对应的第一初始长度和第一增量长度,所述第二参数集合包括所述压缩段标识中功能标识对应的第二初始长度和第二增量长度;第二网络设备根据编码规则、所述第一参数集合和/或所述第二参数集合以及所述起始位置确定所述待拷贝内容的长度。在该实现方式中,当压缩段标识中的节点标识长度和功能标识长度均可变时,获取节点标识对应的第一初始长度和第一增量长度以及功能标识对应的第二初始长度和第二增量长度。由于编码规则与上述四个长度有关,第二网络设备根据上述四个长度、编码规则以及起始位置读取待拷贝内容,即确定待拷贝内容的长度。In a possible implementation manner, the second network device determines the length of the content to be copied according to the encoding rule and the starting position, including: the second network device obtains the first parameter set and/or the first parameter set and/or the first parameter set and/or the first parameter set. Two parameter sets, the first parameter set includes the first initial length and the first increment length corresponding to the node identifier in the compressed segment identifier, and the second parameter set includes the first parameter corresponding to the function identifier in the compressed segment identifier. Two initial lengths and second incremental lengths; the second network device determines the length of the content to be copied according to the encoding rule, the first parameter set and/or the second parameter set, and the starting position. In this implementation, when the length of the node identifier and the length of the function identifier in the compressed segment identifier are both variable, the first initial length and the first increment length corresponding to the node identifier and the second initial length and the first increment corresponding to the function identifier are obtained. Two incremental lengths. Since the encoding rule is related to the above four lengths, the second network device reads the content to be copied according to the above four lengths, the encoding rule and the starting position, that is, determines the length of the content to be copied.
在一种可能的实现方式中,所述第二网络设备根据编码规则、所述第一参数集合和/或所述第二参数集合以及所述起始位置确定所述待拷贝内容的长度,包括:所述第二网络设备从所述起始位置向后读取N个比特位,所述N个比特位中前i个比特位为1,第i+1个比特位为0,或者所述N个比特位中前i个比特位为0,第i+1个比特位为1;所述第二网络设备继续向后读取M个比特位,所述M=所述第一初始长度+i*所述第一增量长度-i-1,并将N+M个比特作为所述待拷贝内容中的节点标识的长度;所述第二网络设备继续向后读取P个比特位,所述P个比特位中前j个比特位为1,第j+1个比特位为0,或者所述P个比特位中前j个比特位为0,第j+1个比特位为1;所述第二网络设备继续后读取Q个比特位,所述Q=所述第二初始长度+j*所述第二增量长度-j-1个比特位,并将P+Q个比特作为所述待拷贝内容中的功能标识的长度;所述第二网络设备根据所述待拷贝内容中的节点标识的长度和所述待拷贝内容中的功能标识的长度获得所述待拷贝内容的长度。通过该实现方式可知,按照编码规则生成的压缩段标识可以仅包括节点标识和功能标识两部分,不包括其他信息,例如标记位,增加段标识的压缩率。同时,根据编码规则生成的压缩段标识之间可以是连续的,例如,以功能标识长度可变为例,节点标识为001,功能标识长度为3比特,则按照编码规则生成的压缩段标识可以为001000、001001、001010、001011等。In a possible implementation manner, the second network device determines the length of the content to be copied according to the encoding rule, the first parameter set and/or the second parameter set, and the starting position, including : the second network device reads N bits backward from the starting position, the first i bit of the N bits is 1, the i+1th bit is 0, or the The first i bits among the N bits are 0, and the i+1th bit is 1; the second network device continues to read M bits backward, where M=the first initial length+ i* the first increment length-i-1, and use N+M bits as the length of the node identifier in the content to be copied; the second network device continues to read P bits backward, The first j bits among the P bits are 1, and the j+1th bit is 0, or the first j bits among the P bits are 0, and the j+1th bit is 1 ; After the second network device continues to read Q bits, the Q=the second initial length+j*the second increment length-j-1 bits, and P+Q bits bits as the length of the function identifier in the content to be copied; the second network device obtains the content to be copied according to the length of the node identifier in the content to be copied and the length of the function identifier in the content to be copied length. It can be known from this implementation manner that the compressed segment identifier generated according to the encoding rule may only include two parts, the node identifier and the function identifier, and does not include other information, such as marker bits, to increase the compression rate of the segment identifier. At the same time, the compressed segment identifiers generated according to the encoding rules may be continuous. For example, taking the variable length of the function identifier as an example, the node identifier is 001 and the length of the function identifier is 3 bits, then the compressed segment identifier generated according to the encoding rule can be are 001000, 001001, 001010, 001011, etc.
在一种可能的实现方式中,所述第一初始长度和所述第一增量长度均为8比特的倍数,和/或所述第二初始长度和所述第二增量长度均为8比特的倍数。在该实现方式中,节点标识对应的第一初始长度和第一增量长度以及第二初始长度和第二增量长度均可以为8比特的倍数,从而使得构成的压缩段标识实现8比特对齐。当然,第一初始长度、第一增量长度、第二初始长度和第二增量长度可以根据实际需求进行设定。In a possible implementation manner, both the first initial length and the first increment length are multiples of 8 bits, and/or the second initial length and the second increment length are both 8 multiples of bits. In this implementation manner, the first initial length and the first increment length and the second initial length and the second increment length corresponding to the node identifier can be multiples of 8 bits, so that the formed compressed segment identifier can achieve 8-bit alignment . Of course, the first initial length, the first incremental length, the second initial length and the second incremental length can be set according to actual requirements.
在一种可能的实现方式中,所述第一报文还包括扩展指针,所述扩展指针用于依次指 示所述多个压缩段标识中的每个压缩段标识,所述第二网络设备确定起始位置,包括:所述第二网络设备根据所述扩展指针确定所述待拷贝内容在所述段列表中的起始位置。在该实现方式中,为便于后续读取压缩段标识或段标识,第一报文中还可以携带扩展指针,以通过该扩展指针确定待拷贝内容在段列表中的起始位置。In a possible implementation manner, the first packet further includes an extension pointer, where the extension pointer is used to sequentially indicate each compressed segment identifier in the multiple compressed segment identifiers, and the second network device determines The starting position includes: determining, by the second network device, a starting position of the content to be copied in the segment list according to the extension pointer. In this implementation manner, in order to facilitate subsequent reading of the compressed segment identifier or segment identifier, the first message may also carry an extension pointer, so as to determine the starting position of the content to be copied in the segment list through the extension pointer.
在一种可能的实现方式中,所述扩展指针指示所述第二网络设备对应压缩段标识的起始位置,所述第二网络设备根据所述扩展指针确定待拷贝内容在所述段列表中的起始位置,包括:所述第二网络设备根据所述第二网络设备对应压缩段标识的长度更新所述扩展指针的值,以使得更新后的所述扩展指针的值对应所述待拷贝内容在所述段列表中的起始位置。在该实现方式中,当扩展指针指示当前网络设备(第二网络设备)对应压缩段标识的起始位置时,由于第二网络设备可以确定自身压缩段标识的长度,可以将扩展指针的值增加上述长度,使得更新后的扩展指针的值对应待拷贝内容在段列表中的起始位置。当然,扩展指针可以先在第一网络设备处更新,当第二网络设备接收到第一报文时,该扩展指针指向待拷贝内容在段列表中的起始位置。In a possible implementation manner, the extension pointer indicates the starting position of the compressed segment identifier corresponding to the second network device, and the second network device determines that the content to be copied is in the segment list according to the extension pointer , including: the second network device updates the value of the extension pointer according to the length of the compressed segment identifier corresponding to the second network device, so that the updated value of the extension pointer corresponds to the to-be-copied value The starting position of the content in the segment list. In this implementation, when the extension pointer indicates the starting position of the compressed segment identifier corresponding to the current network device (the second network device), since the second network device can determine the length of its own compressed segment identifier, the value of the extension pointer can be increased. The above-mentioned length makes the value of the updated extension pointer correspond to the starting position of the content to be copied in the segment list. Certainly, the extension pointer may be updated at the first network device first, and when the second network device receives the first packet, the extension pointer points to the starting position of the content to be copied in the segment list.
在一种可能的实现方式中,所述第二网络设备根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文,包括:所述第二网络设备根据所述待拷贝内容以及所述待拷贝内容对应的前缀更新所述第一报文中的目的地址DA,以生成第二报文。在该实现方式中,当确定出待拷贝内容后,利用该待拷贝内容对应的前缀以及待拷贝内容更新第一报文中的目的地址DA,从而获得第二报文。In a possible implementation manner, the second network device updates the destination address DA in the first packet according to the content to be copied, so as to generate a second packet, including: the second network device according to The content to be copied and the prefix corresponding to the content to be copied update the destination address DA in the first message to generate a second message. In this implementation manner, after the content to be copied is determined, the destination address DA in the first message is updated by using the prefix corresponding to the content to be copied and the content to be copied, thereby obtaining the second message.
在一种可能的实现方式中,所述第二网络设备根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文,包括:所述第二网络设备利用所述待拷贝内容更新所述第一报文的目的地址DA中除前缀之外的信息,以生成第二报文。在该实现方式中,当确定出待拷贝内容后,当待拷贝内容对应的前缀与当前目的地址DA中的前缀一致时,可以直接利用待拷贝内容更新目的地址DA中除前缀之外的信息,从而获得第二报文。In a possible implementation manner, the second network device updates the destination address DA in the first packet according to the content to be copied, so as to generate a second packet, including: the second network device utilizes The to-be-copied content updates information other than the prefix in the destination address DA of the first packet to generate a second packet. In this implementation, after the content to be copied is determined, when the prefix corresponding to the content to be copied is consistent with the prefix in the current destination address DA, the information other than the prefix in the destination address DA can be directly updated using the content to be copied, Thereby, the second message is obtained.
在一种可能的实现方式中,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同。在该实现方式中,段列表中所包括的多个压缩段标识中,每个压缩段标识的长度可以不同,相比于所有压缩段标识长度相同的实现方式,所有压缩段标识的长度无需保持一致,部分压缩段标识的的长度可以压缩至更短,例如,当对于功能数量较少的网络设备,其对应的压缩段标识较短,从而可以大幅提高段标识的压缩率,减少对资源的占用。In a possible implementation manner, the plurality of compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, and the first length and the second length are different. In this implementation, among the multiple compressed segment identifiers included in the segment list, the lengths of each compressed segment identifier may be different. Compared with the implementation in which all the compressed segment identifiers have the same length, the lengths of all the compressed segment identifiers do not need to be maintained. Consistent, the length of some compressed segment identifiers can be compressed to a shorter length. For example, for network devices with a small number of functions, the corresponding compressed segment identifiers are shorter, which can greatly improve the compression rate of segment identifiers and reduce resource consumption. occupied.
在本申请实施例第二方面,提供了一种报文传输方法,所述方法包括:第一网络设备生成第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码;所述第一网络设备根据所述段列表发送所述第一报文。在该实现方式中,当第一网络设备获得段列表后,生成包括该段列表的第一报文,并根据该段列表中发送第一报文。In a second aspect of the embodiments of the present application, a packet transmission method is provided, the method includes: a first network device generates a first packet, where the first packet includes forwarding corresponding to the first packet A segment list of the 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 or equal to 128 bits, and the multiple compressed segment identifiers include the first A compressed segment identifier of one length and a compressed segment identifier of a second length, the first length and the second length are different, and each of the multiple compressed segment identifiers includes a prefix code; the first network The device sends the first packet according to the segment list. In this implementation manner, after obtaining the segment list, the first network device generates a first packet including the segment list, and sends the first packet according to the segment list.
在一种可能的实现方式中,所述每个压缩段标识包括可变长度部分,所述第一长度的 压缩段标识的可变长度部分的长度与所述第二长度的压缩段标识的可变长度部分的长度不同,所述可变长度部分包括所述前缀码,所述可变长度部分的长度根据所述可变长度部分的编码规则确定。在该实现方式中,每个压缩段标识包括可变长部分,且不同长度的压缩段标识的可变长部分的长度是不相同的。In a possible implementation manner, each compressed segment identifier includes a variable-length portion, and the length of the variable-length portion of the compressed segment identifier of the first length is different from the length of the compressed segment identifier of the second length. The length of the variable-length part is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part. In this implementation manner, each compressed segment identifier includes a variable length portion, and the lengths of the variable length portions of the compressed segment identifiers of different lengths are different.
在一种可能的实现方式中,所述每个压缩段标识包括功能标识,所述功能标识为所述前缀码。在该实现方式中,可变长部分为功能标识。即,可以针对功能数量的增加,扩充功能标识的长度,从而当某网络设备的功能数量较大时,可以通过变长的压缩段标识携带功能标识,支持扩容。In a possible implementation manner, each compressed segment identifier includes a function identifier, and the function identifier is the prefix code. In this implementation, the variable length portion is the function identifier. That is, the length of the function identifier can be extended for the increase in the number of functions, so that when the number of functions of a certain network device is large, the function identifier can be carried through the variable-length compressed segment identifier to support capacity expansion.
在一种可能的实现方式中,所述每个压缩段标识包括节点标识,所述节点标识为所述前缀码。即,可以针对网络设备数量的增加,可以通过扩充节点标识的长度的方式支持网络扩容,且无需改变已分配的节点标识,支持扩容。In a possible implementation manner, each compressed segment identifier includes a node identifier, and the node identifier is the prefix code. That is, in response to the increase in the number of network devices, network capacity expansion can be supported by extending the length of the node identifiers, and capacity expansion can be supported without changing the assigned node identifiers.
在一种可能的实现方式中,所述第一报文还包括扩展指针,所述扩展指针用于依次指示所述多个压缩段标识中的每个压缩段标识。In a possible implementation manner, the first packet further includes an extension pointer, where the extension pointer is used to sequentially indicate each compressed segment identifier in the multiple compressed segment identifiers.
在一种可能的实现方式中,所述第一长度的压缩段标识和所述第二长度的压缩段标识分别对应相同的前缀,或所述第一长度的压缩段标识和所述第二长度的压缩段标识分别对应不同的前缀。In a possible implementation manner, the compressed segment identifier of the first length and the compressed segment identifier of the second length respectively correspond to the same prefix, or the compressed segment identifier of the first length and the second length The compressed segment identifiers of , respectively, correspond to different prefixes.
在一种可能的实现方式中,所述第一报文为基于IPv6的段路由SRv6报文,所述段列表位于段路由头SRH中。In a possible implementation manner, the first packet is an IPv6-based segment routing SRv6 packet, and the segment list is located in the segment routing header SRH.
在本申请实施第三方面,提供了一种段列表生成方法,所述方法包括:第一网络设备确定报文的转发路径;所述第一网络设备生成对应于所述转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码。In a third aspect of the implementation of the present application, a method for generating a segment list is provided, and the method includes: a first network device determines a forwarding path of a packet; the first network device generates a segment list corresponding to the forwarding path, The segment list includes multiple compressed segment identifiers arranged in sequence, each of the multiple compressed segment identifiers has a length of less than or equal to 128 bits, and the multiple compressed segment identifiers include a compressed segment of a first length An identifier and a compressed segment identifier of a second length, the first length and the second length are different, and each compressed segment identifier of the plurality of compressed segment identifiers includes a prefix code.
在一种可能的实现方式中,所述每个压缩段标识包括可变长度部分,所述第一长度的压缩段标识的可变长度部分的长度与所述第二长度的压缩段标识的可变长度部分的长度不同,所述可变长度部分包括所述前缀码,所述可变长度部分的长度根据所述可变长度部分的编码规则确定。In a possible implementation manner, each compressed segment identifier includes a variable-length portion, and the length of the variable-length portion of the compressed segment identifier of the first length is different from the length of the compressed segment identifier of the second length. The length of the variable-length part is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
在一种可能的实现方式中,所述第一网络设备为网络中的控制器,所述方法还包括:所述第一网络设备向所述转发路径的入口设备发送所述段列表。In a possible implementation manner, the first network device is a controller in the network, and the method further includes: the first network device sends the segment list to an ingress device of the forwarding path.
在一种可能的实现方式中,所述第一网络设备为所述转发路径的入口设备,所述方法还包括:所述第一网络设备生成包括所述段列表的报文;所述第一网络设备发送包括所述段列表的报文。In a possible implementation manner, the first network device is an ingress device of the forwarding path, and the method further includes: the first network device generates a packet including the segment list; the first network device The network device sends a message including the segment list.
在本申请实施例第四方面,提供了一种压缩段标识获取方法,所述方法包括:第一网络设备获得第一长度的压缩段标识,所述第一长度的压缩段标识包括第一可变长度部分,所述第一可变长度部分属于第一资源池,所述第一资源池包括多个所述第一可变长度部分;基于所述第一资源池的资源不足,所述第一网络设备获得第二长度的压缩段标识,所述第二长度大于等于所述第一长度,所述第二长度的压缩段标识包括第二可变长度部分,所述 第二可变长度部分属于第二资源池,所述第二资源池包括多个所述第二可变长度部分;所述第一网络设备发送所述第一长度的压缩段标识和所述第二长度的压缩段标识,所述第一长度的压缩段标识和所述第二长度的压缩段标识用于指示所述第一网络设备所执行的段。在该实现方式中,第一网络设备可以基于资源池的不足,获取不同长度的压缩段标识。其中,不同长度的压缩段标识中分别包括不同可变长度部分,不同的资源池可以包括多个可变长度部分。In a fourth aspect of the embodiments of the present application, a method for obtaining a compressed segment identifier is provided, the method includes: a first network device obtains a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable A variable-length part, the first variable-length part belongs to a first resource pool, and the first resource pool includes a plurality of the first variable-length parts; based on insufficient resources of the first resource pool, the first variable-length part is A network device obtains a compressed segment identifier of a second length, the second length is greater than or equal to the first length, the compressed segment identifier of the second length includes a second variable length part, and the second variable length part belong to the second resource pool, the second resource pool includes a plurality of the second variable length parts; the first network device sends the compressed segment identifier of the first length and the compressed segment identifier of the second length , the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the segment executed by the first network device. In this implementation manner, the first network device may acquire compressed segment identifiers of different lengths based on the shortage of the resource pool. Wherein, the compressed segment identifiers of different lengths respectively include different variable length parts, and different resource pools may include multiple variable length parts.
在一种可能的实现方式中,所述第一长度的压缩段标识和所述第二长度的压缩段标识包括功能标识,所述第一可变长度部分和所述第二可变长度部分为所述功能标识,所述第一资源池和所述第二资源池为所述功能标识对应的资源池。在该实现方式中,通常情况下,当第一网络设备的节点标识确定后,不再发生变化,可以变化为功能标识,因此第一可变长度部分和第二可变长度部分均为功能标识。In a possible implementation manner, the compressed segment identifier of the first length and the compressed segment identifier of the second length include function identifiers, and the first variable length part and the second variable length part are For the function identifier, the first resource pool and the second resource pool are resource pools corresponding to the function identifier. In this implementation, under normal circumstances, after the node identifier of the first network device is determined, it will not change, but can be changed to a function identifier, so the first variable length part and the second variable length part are both function identifiers .
在一种可能的实现方式中,所述方法还包括:基于第n资源池的资源不足,所述第一网络设备获得第n+1长度的压缩段标识,所述第n+1长度大于等于第n长度,所述第n+1长度的压缩段标识包括第n+1可变长度部分,所述第n+1可变长度部分属于第n+1资源池,所述第n+1资源池包括多个所述第n+1可变长度部分;其中,所述n为大于1的自然数。In a possible implementation manner, the method further includes: based on insufficient resources of the nth resource pool, the first network device obtains the compressed segment identifier of the n+1th length, where the n+1th length is greater than or equal to The nth length, the compressed segment identifier of the n+1th length includes the n+1th variable length part, the n+1th variable length part belongs to the n+1th resource pool, and the n+1th resource The pool includes a plurality of the n+1th variable length parts; wherein, the n is a natural number greater than 1.
在一种可能的实现方式中,第i+1资源池包括2的X次幂个数的第i+1可变长度部分,所述X=初始长度+i*增量长度-i-1,所述i为大于等于0正整数。In a possible implementation manner, the i+1 th resource pool includes the i+1 th variable length part of the number of 2 raised to the power of X, where X=initial length+i*incremental length-i-1, The i is a positive integer greater than or equal to 0.
在一种可能的实现方式中,所述第i资源池对应的编码规则为前i个比特位为1,第i+1个比特位为0,后续(i+1)*2个比特位为0或1任意取值。In a possible implementation manner, the coding rule corresponding to the i-th resource pool is that the first i bit is 1, the i+1-th bit is 0, and the subsequent (i+1)*2 bits are 0 or 1 can take any value.
在一种可能的实现方式中,所述第i资源池对应的编码规则为前i个比特位为0,第i+1个比特位为1,后续(i+1)*2个比特位为0或1任意取值。In a possible implementation manner, the coding rule corresponding to the i-th resource pool is that the first i bit is 0, the i+1-th bit is 1, and the subsequent (i+1)*2 bits are 0 or 1 can take any value.
在一种可能的实现方式中,所述初始长度和所述增量长度均为8比特的倍数。In a possible implementation manner, both the initial length and the increment length are multiples of 8 bits.
在本申请实施例第五方面,提供了一种报文传输装置,包括:接收单元、处理单元和发送单元。接收单元,用于接收所述第一网络设备发送的第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中每个压缩段标识的长度小于等于128比特。处理单元,用于根据编码规则在所述段列表中读取待拷贝内容,所述编码规则用于指示所述待拷贝内容对应的编码规则。处理单元,还用于根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文。发送单元,用于发送所述第二报文。In a fifth aspect of the embodiments of the present application, a message transmission device is provided, including: a receiving unit, a processing unit, and a sending unit. A receiving unit, configured to receive a first packet sent by the first network device, where the first packet includes a segment list corresponding to a forwarding path of the first packet, and the segment list includes a sequence of multiple There are several compressed segment identifiers, and the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bits. A processing unit, configured to read the content to be copied in the segment list according to an encoding rule, where the encoding rule is used to indicate an encoding rule corresponding to the content to be copied. The processing unit is further configured to update the destination address DA in the first message according to the content to be copied, so as to generate a second message. A sending unit, configured to send the second message.
在一种可能的实现方式中,所述处理单元,具体用于确定起始位置,所述起始位置用于指示所述待拷贝内容对应的起始位置;根据所述编码规则以及所述起始位置确定所述待拷贝内容的长度。In a possible implementation manner, the processing unit is specifically configured to determine a starting position, where the starting position is used to indicate a starting position corresponding to the content to be copied; according to the encoding rule and the starting position The start position determines the length of the content to be copied.
在一种可能的实现方式中,所述处理单元,具体用于获取第一参数集合和/或第二参数集合,所述第一参数集合包括所述压缩段标识中节点标识对应的第一初始长度和第一增量长度,所述第二参数集合包括所述压缩段标识中功能标识对应的第二初始长度和第二增量长度;根据编码规则、所述第一参数集合和/或所述第二参数集合以及所述起始位置确定所述待拷贝内容的长度。In a possible implementation manner, the processing unit is specifically configured to acquire a first parameter set and/or a second parameter set, where the first parameter set includes a first initial parameter corresponding to the node identifier in the compressed segment identifier length and the first increment length, the second parameter set includes the second initial length and the second increment length corresponding to the function identifier in the compressed segment identifier; according to the encoding rule, the first parameter set and/or the The second parameter set and the starting position determine the length of the content to be copied.
在一种可能的实现方式中,所述处理单元,具体用于从所述起始位置向后读取N个比特位,所述N个比特位中前i个比特位为1,第i+1个比特位为0,或者所述N个比特位中前i个比特位为0,第i+1个比特位为1;继续向后读取M个比特位,所述M=所述第一初始长度+i*所述第一增量长度-i-1,并将N+M个比特作为所述待拷贝内容中的节点标识的长度;继续向后读取P个比特位,所述P个比特位中前j个比特位为1,第j+1个比特位为0,或者所述P个比特位中前j个比特位为0,第j+1个比特位为1;继续后读取Q个比特位,所述Q=所述第二初始长度+j*所述第二增量长度-j-1个比特位,并将P+Q个比特作为所述待拷贝内容中的功能标识的长度;根据所述待拷贝内容中的节点标识的长度和所述待拷贝内容中的功能标识的长度获得所述待拷贝内容的长度。In a possible implementation manner, the processing unit is specifically configured to read N bits backward from the starting position, the first i bit in the N bits is 1, and the i+th bit is 1. 1 bit is 0, or the first i bit in the N bits is 0, and the i+1th bit is 1; continue to read M bits backward, the M=the an initial length+i*the first increment length-i-1, and use N+M bits as the length of the node identifier in the content to be copied; continue to read P bits backward, the The first j bits among the P bits are 1, and the j+1th bit is 0, or the first j bits among the P bits are 0, and the j+1th bit is 1; continue Then read Q bits, the Q=the second initial length+j*the second increment length-j-1 bits, and use the P+Q bits as the content to be copied The length of the function identifier of the to-be-copied content; the length of the to-be-copied content is obtained according to the length of the node identifier in the to-be-copied content and the length of the function identifier in the to-be-copied content.
在一种可能的实现方式中,所述第一初始长度和所述第一增量长度均为8比特的倍数,和/或所述第二初始长度和所述第二增量长度均为8比特的倍数。In a possible implementation manner, both the first initial length and the first increment length are multiples of 8 bits, and/or the second initial length and the second increment length are both 8 multiples of bits.
在一种可能的实现方式中,所述第一报文还包括扩展指针,所述扩展指针用于依次指示所述多个压缩段标识中的每个压缩段标识,所述处理单元,具体用于根据所述扩展指针确定所述待拷贝内容在所述段列表中的起始位置。In a possible implementation manner, the first packet further includes an extension pointer, where the extension pointer is used to sequentially indicate each compressed segment identifier in the multiple compressed segment identifiers, and the processing unit specifically uses determining the starting position of the content to be copied in the segment list according to the extension pointer.
在一种可能的实现方式中,所述扩展指针指示所述第二网络设备对应压缩段标识的起始位置,所述处理单元,具体用于根据所述第二网络设备对应压缩段标识的长度更新所述扩展指针的值,以使得更新后的所述扩展指针的值对应所述待拷贝内容在所述段列表中的起始位置。In a possible implementation manner, the extension pointer indicates a starting position of the compressed segment identifier corresponding to the second network device, and the processing unit is specifically configured to determine the length of the compressed segment identifier corresponding to the second network device according to the length of the compressed segment identifier corresponding to the second network device. The value of the extension pointer is updated, so that the updated value of the extension pointer corresponds to the starting position of the content to be copied in the segment list.
在一种可能的实现方式中,所述处理单元,具体用于根据所述待拷贝内容以及所述待拷贝内容对应的前缀更新所述第一报文中的目的地址DA,以生成第二报文。In a possible implementation manner, the processing unit is specifically configured to update the destination address DA in the first packet according to the content to be copied and a prefix corresponding to the content to be copied, so as to generate a second packet arts.
在一种可能的实现方式中,所述处理单元,具体用于利用所述待拷贝内容更新所述第一报文的目的地址DA中除前缀之外信息,以生成第二报文。In a possible implementation manner, the processing unit is specifically configured to update the information except the prefix in the destination address DA of the first packet by using the content to be copied, so as to generate the second packet.
在一种可能的实现方式中,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同。In a possible implementation manner, the plurality of compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, and the first length and the second length are different.
在本申请实施例第六方面,提供了一种报文传输装置,包括:处理单元和发送单元。处理单元,用于生成第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码。发送单元,用于根据所述段列表发送所述第一报文。In a sixth aspect of the embodiments of the present application, a message transmission device is provided, including: a processing unit and a sending unit. A processing unit, configured to generate a first packet, where the first packet includes a segment list corresponding to a forwarding path of the first packet, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the multiple The length of each compressed segment identifier in the plurality of compressed segment identifiers is less than or equal to 128 bits, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the The second lengths are different, and each of the multiple compressed segment identifiers includes a prefix code. A sending unit, configured to send the first packet according to the segment list.
在一种可能的实现方式中,所述每个压缩段标识包括可变长度部分,所述第一长度的压缩段标识的可变长度部分的长度与所述第二长度的压缩段标识的可变长度部分的长度不同,所述可变长度部分包括所述前缀码,所述可变长度部分的长度根据所述可变长度部分的编码规则确定。In a possible implementation manner, each compressed segment identifier includes a variable-length portion, and the length of the variable-length portion of the compressed segment identifier of the first length is different from the length of the compressed segment identifier of the second length. The length of the variable-length part is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
在一种可能的实现方式中,所述每个压缩段标识包括功能标识,所述功能标识为所述前缀码。In a possible implementation manner, each compressed segment identifier includes a function identifier, and the function identifier is the prefix code.
在一种可能的实现方式中,所述每个压缩段标识包括节点标识,所述节点标识为所述 前缀码。In a possible implementation manner, each compressed segment identifier includes a node identifier, and the node identifier is the prefix code.
在一种可能的实现方式中,所述第一报文还包括扩展指针,所述扩展指针用于依次指示所述多个压缩段标识中的每个压缩段标识。In a possible implementation manner, the first packet further includes an extension pointer, where the extension pointer is used to sequentially indicate each compressed segment identifier in the multiple compressed segment identifiers.
在一种可能的实现方式中,所述第一长度的压缩段标识和所述第二长度的压缩段标识分别对应相同的前缀,或所述第一长度的压缩段标识和所述第二长度的压缩段标识分别对应不同的前缀。In a possible implementation manner, the compressed segment identifier of the first length and the compressed segment identifier of the second length respectively correspond to the same prefix, or the compressed segment identifier of the first length and the second length The compressed segment identifiers of , respectively, correspond to different prefixes.
在一种可能的实现方式中,所述第一报文为基于IPv6的段路由SRv6报文,所述段列表位于段路由头SRH中。In a possible implementation manner, the first packet is an IPv6-based segment routing SRv6 packet, and the segment list is located in the segment routing header SRH.
在本申请实施例第七方面,提供了一种段列表生成装置,该装置包括:处理单元。处理单元,用于确定报文的转发路径。处理单元,还用于生成对应于所述转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码。In a seventh aspect of the embodiments of the present application, an apparatus for generating a segment list is provided, and the apparatus includes: a processing unit. The processing unit is used to determine the forwarding path of the packet. The processing unit is further configured to generate a segment list corresponding to the forwarding path, where the segment list includes multiple compressed segment identifiers arranged in sequence, and the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bit, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the second length are different, and each of the multiple compressed segment identifiers The compressed segment identification includes a prefix code.
在一种可能的实现方式中,所述每个压缩段标识包括可变长度部分,所述第一长度的压缩段标识的可变长度部分的长度与所述第二长度的压缩段标识的可变长度部分的长度不同,所述可变长度部分包括所述前缀码,所述可变长度部分的长度根据所述可变长度部分的编码规则确定。In a possible implementation manner, each compressed segment identifier includes a variable-length portion, and the length of the variable-length portion of the compressed segment identifier of the first length is different from the length of the compressed segment identifier of the second length. The length of the variable-length part is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
在一种可能的实现方式中,所述装置为网络中的控制器,所述装置还包括:发送单元;发送单元,用于向所述转发路径的入口设备发送所述段列表。In a possible implementation manner, the apparatus is a controller in a network, and the apparatus further includes: a sending unit; and a sending unit, configured to send the segment list to an ingress device of the forwarding path.
在一种可能的实现方式中,所述装置为所述转发路径的入口设备,所述装置还包括:发送单元;所述处理单元,还用于生成包括所述段列表的报文;所述发送单元,用于发送包括所述段列表的报文。In a possible implementation manner, the apparatus is an ingress device of the forwarding path, and the apparatus further includes: a sending unit; the processing unit, further configured to generate a packet including the segment list; the A sending unit, configured to send a message including the segment list.
在本申请实施例第八方面,提供了一种压缩段标识获取装置,装置包括:处理单元和发送单元。处理单元,用于获得第一长度的压缩段标识,所述第一长度的压缩段标识包括第一可变长度部分,所述第一可变长度部分属于第一资源池,所述第一资源池包括多个所述第一可变长度部分。处理单元,还用于基于所述第一资源池的资源不足,获得第二长度的压缩段标识,所述第二长度大于等于所述第一长度,所述第二长度的压缩段标识包括第二可变长度部分,所述第二可变长度部分属于第二资源池,所述第二资源池包括多个所述第二可变长度部分。发送单元,用于发送所述第一长度的压缩段标识和所述第二长度的压缩段标识,所述第一长度的压缩段标识和所述第二长度的压缩段标识用于指示所述第一网络设备所执行的段。In an eighth aspect of the embodiment of the present application, an apparatus for obtaining a compressed segment identifier is provided, the apparatus includes: a processing unit and a sending unit. a processing unit, configured to obtain a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable length part, the first variable length part belongs to a first resource pool, and the first resource The pool includes a plurality of said first variable length portions. The processing unit is further configured to obtain a compressed segment identifier of a second length based on insufficient resources of the first resource pool, where the second length is greater than or equal to the first length, and the compressed segment identifier of the second length includes the first length. Two variable length parts, the second variable length parts belong to a second resource pool, and the second resource pool includes a plurality of the second variable length parts. A sending unit, configured to send the compressed segment identifier of the first length and the compressed segment identifier of the second length, and the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the The segment executed by the first network device.
在一种可能的实现方式中,所述第一长度的压缩段标识和所述第二长度的压缩段标识包括功能标识,所述第一可变长度部分和所述第二可变长度部分为所述功能标识,所述第一资源池和所述第二资源池为所述功能标识对应的资源池。In a possible implementation manner, the compressed segment identifier of the first length and the compressed segment identifier of the second length include function identifiers, and the first variable length part and the second variable length part are For the function identifier, the first resource pool and the second resource pool are resource pools corresponding to the function identifier.
在一种可能的实现方式中,所述处理单元,还用于基于第n资源池的资源不足,获得第n+1长度的压缩段标识,所述第n+1长度大于等于第n长度,所述第n+1长度的压缩段 标识包括第n+1可变长度部分,所述第n+1可变长度部分属于第n+1资源池,所述第n+1资源池包括多个所述第n+1可变长度部分;其中,所述n为大于1的自然数。In a possible implementation manner, the processing unit is further configured to obtain the compressed segment identifier of the n+1th length based on insufficient resources of the nth resource pool, where the n+1th length is greater than or equal to the nth length, The compressed segment identifier of the n+1th length includes the n+1th variable length part, the n+1th variable length part belongs to the n+1th resource pool, and the n+1th resource pool includes multiple the n+1th variable length portion; wherein, the n is a natural number greater than 1.
在一种可能的实现方式中,第i+1资源池包括2的X次幂个数的第i+1可变长度部分,所述X=初始长度+i*增量长度-i-1,所述i为大于等于0正整数。In a possible implementation manner, the i+1 th resource pool includes the i+1 th variable length part of the number of 2 raised to the power of X, where X=initial length+i*incremental length-i-1, The i is a positive integer greater than or equal to 0.
在一种可能的实现方式中,所述第i资源池对应的编码规则为前i个比特位为1,第i+1个比特位为0,后续(i+1)*2个比特位为0或1任意取值。In a possible implementation manner, the coding rule corresponding to the i-th resource pool is that the first i bit is 1, the i+1-th bit is 0, and the subsequent (i+1)*2 bits are 0 or 1 can take any value.
在一种可能的实现方式中,所述第i资源池对应的编码规则为前i个比特位为0,第i+1个比特位为1,后续(i+1)*2个比特位为0或1任意取值。In a possible implementation manner, the coding rule corresponding to the i-th resource pool is that the first i bit is 0, the i+1-th bit is 1, and the subsequent (i+1)*2 bits are 0 or 1 can take any value.
在一种可能的实现方式中,所述初始长度和所述增量长度均为8比特的倍数。In a possible implementation manner, both the initial length and the increment length are multiples of 8 bits.
在本申请实施例第九方面,提供了一种网络系统,该网络系统包括第一网络设备和第二网络设备。其中,第一网络设备可以执行第二方面、第三方面或第四方面所述的方法;第二网络设备可以执行第一方面所述的方法。In a ninth aspect of an embodiment of the present application, a network system is provided, where the network system includes a first network device and a second network device. Wherein, the first network device may execute the method described in the second aspect, the third aspect or the fourth aspect; the second network device may execute the method described in the first aspect.
在本申请实施例第十方面,提供了一种一种通信设备,所述设备包括:处理器和存储器;所述存储器,用于存储指令或计算机程序;所述处理器,用于执行所述存储器中的所述指令或计算机程序,使得所述通信设备执行第一方面、第二方面、第三方面或第四方面所述的方法。In a tenth aspect of an embodiment of the present application, a communication device is provided, the device includes: a processor and a memory; the memory is used to store instructions or computer programs; the processor is used to execute the The instructions or computer program in memory cause the communication device to perform the method of the first aspect, the second aspect, the third aspect or the fourth aspect.
在本申请实施例第十一方面,提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行以上第一方面、第二方面、第三方面或第四方面所述的方法。In an eleventh aspect of the embodiments of the present application, a computer-readable storage medium is provided, including instructions, which, when executed on a computer, cause the computer to execute the above first aspect, second aspect, third aspect or fourth aspect the method described.
基于本申请实施例提供的方法,第二网络设备接收到的第一报文包括对应于第一报文的转发路径的段列表,该段列表包括依次排列的多个压缩段标识,其中,每个压缩段标识的长度小于等于128比特。第二网络设备根据编码规则从段列表中读取待拷贝内容,该待拷贝内容对应的网络设备即为下一跳网络设备。其中,编码规则为待拷贝内容对应的网络设备在生成待拷贝内容所对应的规则。第二网络设备利用读取到的待拷贝内容更新第一报文中的目的地址DA,以生成第二报文,并转发该第二报文。即,针对段列表中所包括的多个压缩段标识,无需提前获知每个压缩段标识的长度,而是根据压缩段标识对应的编码规则即可以获知该压缩段标识的长度,进而从段列表中读取该压缩段标识。当不同长度的压缩段标识在同一段SRv6压缩子路径中混合编排时,与现有的SRv6网络中报文转发和处理过程相兼容。Based on the method provided in this embodiment of the present application, the first packet received by the second network device includes a segment list corresponding to the forwarding path of the first packet, and the segment list includes multiple compressed segment identifiers arranged in sequence, wherein each The length of each compressed segment identifier is less than or equal to 128 bits. The second network device reads the content to be copied from the segment list according to the encoding rule, and the network device corresponding to the content to be copied is the next-hop network device. The encoding rule is a rule corresponding to the network device corresponding to the content to be copied generating the content to be copied. The second network device updates the destination address DA in the first packet by using the read content to be copied, so as to generate a second packet, and forward the second packet. That is, for the multiple compressed segment identifiers included in the segment list, it is not necessary to know the length of each compressed segment identifier in advance, but the length of the compressed segment identifier can be known according to the encoding rule corresponding to the compressed segment identifier, and then from the segment list Read the compressed segment identifier in . When compressed segment identifiers of different lengths are mixed in the same segment of SRv6 compression sub-paths, it is compatible with the packet forwarding and processing process in the existing SRv6 network.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments described in this application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本申请实施例提供的一种应用场景示意图;1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图2为本申请实施例提供的一种SRv6报文格式结构示意图;FIG. 2 is a schematic structural diagram of a SRv6 packet format according to an embodiment of the present application;
图3为本申请实施提供的一种SID结构示意图;Fig. 3 is a kind of SID structure schematic diagram provided for the implementation of this application;
图4为本申请实施例提供的一种获取压缩段标识方法的流程图;4 is a flowchart of a method for obtaining a compressed segment identifier provided by an embodiment of the present application;
图5为本申请实施例提供的一种段列表结构示意图;FIG. 5 is a schematic structural diagram of a segment list provided by an embodiment of the present application;
图6为本申请实施例提供的另一种SRv6报文结构示意图;FIG. 6 is a schematic diagram of another SRv6 packet structure provided by an embodiment of the present application;
图7为本申请实施例提供的一种报文传输方法流程图;FIG. 7 is a flowchart of a message transmission method provided by an embodiment of the present application;
图8a为本申请实施例提供的又一种SRv6报文结构示意图;FIG. 8a is a schematic diagram of another SRv6 packet structure provided by an embodiment of the present application;
图8b为本申请实施例提供的又一种SRv6报文结构示意图;FIG. 8b is a schematic diagram of another SRv6 packet structure provided by an embodiment of the present application;
图9为本申请实施例提供的另一种报文传输方法流程图;FIG. 9 is a flowchart of another message transmission method provided by an embodiment of the present application;
图10为本申请实施例提供的一种报文传输装置结构图;FIG. 10 is a structural diagram of a message transmission apparatus provided by an embodiment of the present application;
图11为本申请实施例提供的另一种报文传输装置结构图;FIG. 11 is a structural diagram of another message transmission apparatus provided by an embodiment of the application;
图12为本申请实施例提供的一种段列表生成装置结构图;12 is a structural diagram of an apparatus for generating a segment list provided by an embodiment of the present application;
图13为本申请实施例提供的一种生成压缩段标识装置结构图;13 is a structural diagram of an apparatus for generating a compressed segment identification provided by an embodiment of the present application;
图14为本申请实施例提供的一种网络设备结构图;FIG. 14 is a structural diagram of a network device provided by an embodiment of the present application;
图15为本申请实施例提供的另一种网络设备结构图。FIG. 15 is another structural diagram of a network device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明中的方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。In order to enable those skilled in the art to better understand the solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described implementation The examples are only a part of the embodiments of the present invention, but not all of the embodiments.
在SRv6网络中,可以将对报文的处理过程划分为若干个段,每个段是特定的网络设备所执行的特定处理行为。若干个段由报文转发路径上的网络设备分别执行,构成整个报文处理过程。每个段具有相应的段标识,即SID。SID采用128比特长度的IPv6地址格式,即每个SID的长度为128比特。每个SID可以包括位置(locator)字段和功能(function)字段。In an SRv6 network, the packet processing process can be divided into several segments, and each segment is a specific processing behavior performed by a specific network device. Several segments are executed separately by network devices on the packet forwarding path, forming the entire packet processing process. Each segment has a corresponding segment identification, ie SID. The SID adopts an IPv6 address format with a length of 128 bits, that is, the length of each SID is 128 bits. Each SID may include a locator field and a function field.
其中,locator字段的内容也可以简称为locator,是在网络拓扑中分配给一个网络节点的标识,用于在网络拓扑中标识该网络节点。并且,SID可以包括节点段标识(node SID)和邻接段标识(adjacent SID)两种类型。SID中的locator用于指示执行该SID对应的段的网络设备。对于节点段标识来说,执行该SID对应的段的网络设备为该SID中locator标识的网络节点,对于邻接段标识来说,执行该SID对应的段的网络设备为该SID中locator标识的网络节点。The content of the locator field may also be referred to as a locator for short, which is an identifier allocated to a network node in the network topology and used to identify the network node in the network topology. And, the SID may include two types of node segment identifier (node SID) and adjacent segment identifier (adjacent SID). The locator in the SID is used to indicate the network device that executes the segment corresponding to the SID. For node segment identification, the network device executing the segment corresponding to the SID is the network node identified by the locator in the SID, and for the adjacent segment identification, the network device executing the segment corresponding to the SID is the network identified by the locator in the SID. node.
在本申请实施例中,网络节点与网络设备的含义相同,均指交换机、路由器、虚拟路由设备、虚拟转发设备或其他转发设备。该网络节点通过网络协议将locator对应的路由信息发布到网络中,以使得网络中的其他网络节点转发数据包到该网络节点。locator的长度可变,并且locator的长度与网络规模有关。例如,当网络规模越大时,网络拓扑中包括的网络节点数量越多,则为了标识更多数量的网络节点,locator的长度更长。反之,当网络规模越小时,locator的长度也越短。In the embodiments of the present application, a network node and a network device have the same meaning, and both refer to a switch, a router, a virtual routing device, a virtual forwarding device, 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 the data packet to the network node. The length of the locator is variable, and the length of the locator is related to the size of the network. For example, when the network scale is larger, the number of network nodes included in the network topology is greater, and the length of the locator is longer in order to identify the greater number of network nodes. Conversely, when the network size is smaller, the length of the locator is also shorter.
function字段的内容也可以简称为function,用于表示处理报文的指令或指令集合,相当于计算机指令的操作码。当function所表示的指令或指令集合在网络节点上被执行时,将使 得网络节点执行相应的转发行为(behavior)。例如,转发数据包到指定链路,或在指定表中查表转发等。The content of the function field can also be referred to as function for short, which is used to represent the instruction or instruction set for processing the message, which is equivalent to the opcode of the computer instruction. When the instruction or instruction set represented by function is executed on the network node, it will cause the network node to perform the corresponding forwarding behavior (behavior). For example, forwarding data packets to a specified link, or looking up a table for forwarding in a specified table, etc.
有些SID在function字段后还可以包括参数(argument)字段和/或填充(padding)字段。其中,argument字段的内容,也可以简称为argument,是function所表示的指令或指令集合在执行时所涉及的参数。所述参数例如是流信息、服务信息或其他相关的信息。Some SIDs may also include an argument field and/or a padding field after the function field. 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 the function. The parameters are, for example, flow information, service information or other related information.
当SID中的locator、function以及可选的argument的长度之和仍不足128比特时,在SID的末尾部分需要设置填充(padding)字段。When the total length 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.
由此可见,SID用于表示对应的段,具体的,SID能够指示执行该段的网络设备,并且SID能够指示该段对应的报文处理行为,可选的,SID还能够指示执行上述报文处理行为时所涉及的参数。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 packet processing behavior corresponding to the segment. Optionally, the SID can also indicate the execution of the above-mentioned packets. Parameters involved in handling the behavior.
当对应上述若干个段的若干个SID依次排列组成SID list时,SID list就可以指示报文的处理过程。其中,若干个SID在SID list中的排列顺序就是若干个段在报文的处理过程中的执行顺序。包括SID list的SRH被封装在报文中,从而SRv6网络对该报文的处理过程能够承载在报文中,传递给报文转发路径上的网络设备,报文转发路径上的网络设备依次执行自身相关的报文处理行为。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 message processing process. The SRH including the SID list is encapsulated in the packet, so that the processing of the packet by the SRv6 network can be carried in the packet and passed to the network devices on the packet forwarding path. The network devices on the packet forwarding path execute in sequence Self-related packet processing behavior.
参见图1所示的应用场景,该应用场景包括SRv6网络,该SRv6网络包括网络设备S以及网络设备1至5。其中,每个网络设备具有对应的locator,即网络拓扑中分配给该网络设备的标识,用于在网络拓扑中标识该网络设备。例如,网络设备1的标识为locator 1,类似的,网络设备2至5的标识分别为locator 2至locator 5。Referring to the application scenario shown in FIG. 1 , the application scenario includes an SRv6 network, and the SRv6 network includes a network device S and network devices 1 to 5 . Wherein, 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 locator 1, and similarly, the identifiers of network devices 2 to 5 are locator 2 to locator 5, respectively.
图1中的虚线示出了一条报文转发路径,该转发路径的头节点为网络设备S,随后依次经过网络设备1至5。其中,转发路径上的头节点也可以是SRv6网络的入口节点,也称为入口设备或入口网络设备。例如,该转发路径对应的报文处理过程共包括5个段,分别为网络设备1至5所执行的报文处理行为。其中,网络设备1上的报文处理行为对应的function为function 1,类似的,网络设备2至5上的报文处理行为对应的function分别为function 2至function 5。对于网络设备1来说,locator 1和function 1组成SID 1,即SID 1用于指示报文处理过程中网络设备1所执行的段,类似的,SID 2至SID 5分别用于指示网络设备2至5所执行的段。SID 1至SID 5依次排列,组成对应上述报文处理过程的SID list。5个SID在SID list中的排列顺序就是对应的5个段在报文的处理过程中的执行顺序,即排列顺序为SID 1至SID 5。The dotted line in FIG. 1 shows a packet forwarding path, the head node of the forwarding path is the network device S, and then passes through the network devices 1 to 5 in sequence. The head node on the forwarding path may also be an ingress node of the SRv6 network, also referred to as an ingress device or an ingress network device. For example, the packet processing process corresponding to the forwarding path includes a total of 5 segments, which are respectively the packet processing behaviors performed by the network devices 1 to 5 . The function corresponding to the packet processing behavior on network device 1 is function 1, and similarly, the functions corresponding to the packet processing behavior on network devices 2 to 5 are function 2 to function 5, 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 packet processing. Similarly, SID 2 to SID 5 are used to indicate network device 2. to 5 executed segments. SID 1 to SID 5 are arranged in order to form a SID list corresponding to the above message processing process. The arrangement order of the 5 SIDs in the SID list is the execution order of the corresponding 5 segments in the message processing process, that is, the arrangement order is SID 1 to SID 5.
图2示出了封装有SID list的SRv6网络中的报文。如图2所示,该报文的报文头包括IPv6报文头和SRH。其中,IPv6报文头包括版本(Version)字段、流量类型(Traffic Type)字段、流标识(Flow Label)字段、载荷长度(Payload Length)字段、下一个报文头(Next Header)字段、跳数限制(Hop Limit)字段、源地址(Source Address)字段以及目的地址(destination address,DA)字段。各个字段的含义可以参考请求评议(Request for Comments,RFC)8200中的解释。SRH包括下一个报文头(Next Header)字段、头扩展长度(Hdr Ext Len)字段、路由类型(Routing Type)字段、段剩余(Segment Left)字段、最后一个索引(Last Entry)字段、标记(Flags)字段、标签(Tag)字段以及SID list。各个字段的含义可以参考RFC8754 中的解释。其中,SL字段也称为SL指针,在报文转发过程中,SL指针依次指向SID list中的各个元素,即随着SL取值的不同,segment[SL]用于表示SID list中的各个元素。Figure 2 shows a message in an SRv6 network encapsulated with a SID list. As shown in Figure 2, the packet header of the packet includes an IPv6 packet header and an SRH. Among them, the IPv6 packet header includes the Version field, the Traffic Type field, the Flow Label field, the Payload Length field, the Next Header field, and the hop count. Limit (Hop Limit) field, source address (Source Address) field and destination address (destination address, DA) field. The meaning of each field can refer to the explanation in Request for Comments (RFC) 8200. SRH includes the next header (Next Header) field, header extension length (Hdr Ext Len) field, routing type (Routing Type) field, segment left (Segment Left) field, last index (Last Entry) field, marker ( Flags) field, tag (Tag) field and 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 turn, that is, with the different SL values, segment[SL] is used to represent each element in the SID list .
其中,SID list由依次排列的多个元素segment list[0]至segment list[n]组成,每个元素为一个SID,每个元素的长度为128比特。并且,SID list中的SID可以由后至前排列,segment list[0]对应最后执行的段,segment list[1]对应倒数第二执行的段,以此类推。结合图1所示的应用场景,SID list包括5个SID,segment list[n]为SID 1,segment list[0]为SID 5。Among them, 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[1] corresponds to the penultimate segment to be executed, and so on. Combined with the application scenario shown in Figure 1, the SID list includes 5 SIDs, segment list[n] is SID 1, and segment list[0] is SID 5.
在SRv6网络中,包括SID list的SRH可以由转发路径上的头节点封装在报文中,报文转发路径上后续的网络设备可以根据SID list处理该报文。具体的,头节点在接收到的数据报文外侧封装IPv6报文头和SRH,以形成SRv6数据报文。并且,转发路径上的头节点还可以将报文的IPv6报文头中DA字段的值设置为SID list中最先执行的段对应的SID。并且,头节点还可以将SL字段的值设置为N-1,其中N为SID list中包括的SID的数量,即segment[SL]为SID list中的第一个SID,对应最先执行的段。然后,转发路径上的头节点将报文沿转发路径发送出去。结合图1所示的应用场景,SID list由网络设备S封装在报文中,网络设备1至5根据报文中的SID list处理该报文。网络设备S将最先执行的段对应的SID 1拷贝至IPv6报文头中的DA字段中。网络设备S将SL字段的值设置为4。网络设备S根据DA字段的内容,即SID 1,查找本地转发表,根据查表结果将报文发送至网络设备1。In an SRv6 network, the SRH including the SID list can be encapsulated in the packet by the head node on the forwarding path, and subsequent network devices on the packet forwarding path can process the packet according to the SID list. Specifically, the head node encapsulates the IPv6 packet header and the SRH outside the received data packet to form an SRv6 data packet. In addition, the head node on the forwarding path may also set the value of the DA field in the IPv6 header of the packet 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 packet along the forwarding path. Combined with the application scenario shown in Figure 1, the SID list is encapsulated in the message by the network device S, and the network devices 1 to 5 process the message according to the SID list in the message. The network device S copies the SID 1 corresponding to the first executed segment into the DA field in the IPv6 packet header. The network device S sets the value of the SL field to 4. The network device S searches the local forwarding table according to the content of the DA field, that is, SID 1, and sends the message to the network device 1 according to the table lookup result.
在SRv6网络中,针对具体报文,转发路径上的网络设备可以分为传输节点(transit node)和端点节点(endpoint node)。其中,对于transit node来说,报文的IPv6报文头的DA字段中的SID不是本地SID,即DA字段中的SID在本地未配置为指示一个段。而对于endpoint node来说,报文的IPv6报文头的DA字段中的SID是本地SID,即DA字段中的SID在本地配置为指示一个段。In an SRv6 network, for specific packets, network devices on the forwarding path can be divided into transit nodes and endpoint nodes. Among them, for the transit node, the SID in the DA field of the IPv6 header of the packet is not the local SID, that is, the SID in the DA field is not configured locally to indicate a segment. For the endpoint node, the SID in the DA field of the IPv6 header of the packet is the local SID, that is, the SID in the DA field is configured locally to indicate a segment.
因此,当网络设备接收到报文时,将判断DA字段中的SID是否为本地SID。当确定DA字段中的SID非本地SID时,该网络设备为报文转发路径上的transit node,transit node无需解析SRH中的内容,仅根据DA字段的内容查找本地IPv6路由表,转发报文即可。并且,transit node也可以是不支持SRv6的网络设备。而当确定DA字段中的SID为本地SID时,该网络设备为报文转发路径上的endpoint node,endpoint node根据DA字段中的SID查找转发信息库(forwarding information base,FIB),匹配本地实例化SRv6 SID,执行本地实施例SRv6 SID对应的报文处理行为。并且,endpoint node将报文SRH中的SL字段的值减1,并将segment list[SL]拷贝至IPv6报文头的DA字段中,即对DA字段的内容进行更新。并且,根据更新后的DA字段继续转发报文。Therefore, when the network device receives the message, it will judge whether the SID in the DA field is the local SID. When it is determined that the SID in the DA field is not a local SID, the network device is the transit node on the packet forwarding path. The transit node does not need to parse the content in the SRH, but only searches the local IPv6 routing table according to the content of the DA field, and forwards the packet. Can. Moreover, the transit node can also be a network device that does not support SRv6. When it is determined that the SID in the DA field is the local SID, the network device is the endpoint node on the packet forwarding path. The endpoint node searches the forwarding information base (FIB) according to the SID in the DA field, and matches the local instantiation SRv6 SID, executes the packet processing behavior corresponding to the SRv6 SID of the local embodiment. In addition, the endpoint node decrements the value of the SL field in the packet SRH by 1, and copies the segment list[SL] into the DA field of the IPv6 packet header, that is, updates the content of the DA field. And, continue to forward the message according to the updated DA field.
结合图1所示的应用场景,网络设备1接收报文,确定DA字段中的SID 1为本地SID,执行SID 1对应的报文处理行为,将SL字段的值减1,即SL字段的值为3,将segment list[3],即SID 2拷贝至DA字段中,并根据SID 2将报文发送至网络设备2。Combined with the application scenario shown in Figure 1, network device 1 receives the message, determines that SID 1 in the DA field is the local SID, executes the message processing behavior corresponding to SID 1, and subtracts 1 from the value of the SL field, that is, the value of the SL field. If it is 3, copy segment list[3], that is, SID 2, into the DA field, and send the message to network device 2 according to SID 2.
此后,网络设备2至网络设备5的执行步骤与网络设备1类似,构成完整的报文处理过程。可以看出,SRv6网络中的SID具备可路由属性,用在SID list中,能够简化域间路径创建,在网络中快速建立端到端路径。同时,SID中的function支持可编程能力,能够灵活地满足各种业务和网络功能的需要,适应业务和网络发展的需要。然而,如上所述,128比特长度 的SID也会带来网络链路带宽利用率低以及报文处理难度高的问题。另外,网络中不同的网络设备所承担的网络功能不同,其所需要的SID空间大小不同,对于网络功能数量较少的网络设备使用长的SID会浪费空间;对于网络功能数量较多的网络设备使用定长的SID可能造成空间不够。After that, the execution steps from the network device 2 to the network device 5 are similar to those of the network device 1, which constitute a complete packet processing process. It can be seen that the SID in the SRv6 network has the routable attribute, and 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 functions in the SID support programmability, can flexibly meet the needs of various services and network functions, and adapt to the needs of service and network development. However, as mentioned above, a SID with a length of 128 bits will also bring about the problems of low utilization of network link bandwidth and high packet processing difficulty. In addition, different network devices in the network have different network functions, and the required SID space is different. For network devices with a small number of network functions, using a long SID will waste space; for network devices with a large number of network functions. Using a fixed-length SID may result in insufficient space.
其中,SID中的locator字段可以进一步包括前缀(prefix)和节点标识(node ID)两部分。其中,prefix通常由网络运营商分配给网络设备所在的子网,用于标识整个子网。其中,子网也可以称为网段。整个子网内所有SID的prefix相同。可以认为整个子网内所有SID组成SID block,则prefix也用于标识SID block,因而prefix也可以称为block。node ID用于在子网内区分节点。子网内不同节点的SID中node ID不同。The locator field in the SID may further include a prefix and a node ID. Among them, the prefix is usually assigned by the network operator to the subnet where the network device is located, and is used to identify the entire subnet. Among them, a subnet can also be called a network segment. All SIDs in the entire subnet have the same prefix. It can be considered that all SIDs in the entire subnet form a SID block, and 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 within a subnet. The node IDs in the SIDs of different nodes in the subnet are different.
在报文转发路径中,相邻的多个网络设备位于相同的子网中,从而SID list中上述多个网络设备对应的SID都携带相同的prefix,造成重复冗余。针对这部分冗余内容进行优化,可以达到减小SID list的长度的技术效果。具体为,将具有相同prefix的SID在报文中仅携带一份,而在转发路径上的各个网络设备处可以分别利用相同的prefix与不同的C-SID还原得出不同的SID。例如,可以由报文转发路径上的头节点将prefix放置在报文的IPv6报文头的DA字段中,报文转发路径上的endpoint node分别将不同的C-SID更新至DA字段中prefix内容之后,在后更新的C-SID覆盖在先更新的C-SID。因此,不同的C-SID可以分别与prefix组合,还原出对应的SID。也就是说,虽然SID list中仅包括C-SID,但DA字段中仍然呈现对应的SID。从而,在转发路径上的网络设备根据报文中DA字段的内容进行报文处理时,DA字段的内容仍然是SID,与标准的SRv6报文处理机制相兼容。In the packet forwarding path, multiple adjacent network devices are located in the same subnet, so the SIDs corresponding to the above multiple network devices in the SID list all carry the same prefix, resulting in repeated redundancy. Optimizing this part of redundant content can achieve the technical effect of reducing the length of the SID list. Specifically, only one SID with the same prefix is carried in the message, and different SIDs can be obtained by restoring the same prefix and different C-SIDs at each network device on the forwarding path. For example, the prefix can be placed in the DA field of the IPv6 header of the packet by the head node on the packet forwarding path, and the endpoint nodes on the packet forwarding path can respectively update different C-SIDs to the prefix content in the DA field After that, the C-SID updated later overwrites the C-SID updated earlier. Therefore, different C-SIDs can be combined with prefixes to restore the corresponding SIDs. That is, although only C-SIDs are included in the SID list, the corresponding SIDs are still present 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.
可选的,C-SID可以包括argument字段,该argument字段与SID中的argument字段内容保持一致,因而,该argument字段的长度也与SID中的argument字段的长度保持一致。Optionally, the C-SID may include an argument field, and the content of the argument field is consistent with the content of the argument field in the SID. Therefore, the length of the argument field is also consistent with the length of the argument field in the SID.
当C-SID被编排在SRH中的SID list时,为了与标准的SRH机制兼容,准确定位至C-SID,需要将C-SID按照128比特对齐的方式来编排。具体的,可以将SID list中每128比特长度的元素定义为一个容器(container),每个container中容纳整数数量的C-SID。When the C-SID is arranged in the SID list in the 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 alignment. Specifically, each element with a length of 128 bits in the SID list may be defined as a container (container), and each container accommodates an integer number of C-SIDs.
在一些实现方式中,当container中容纳整数个C-SID后,小于1个C-SID长度的剩余空间为填充内容(padding)。In some implementations, after an integer number of C-SIDs are accommodated in the container, the remaining space less than the length of one C-SID is padding.
当SID list中包括多个C-SID时,这些C-SID按照在SID list中的顺序依次排列在至少一个container中。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.
并且,C-SID还可以与SID混合编排在SID list中。例如,转发路径中仅部分网络设备支持C-SID功能时,不支持C-SID功能的部分网络设备所对应的SID仍然采用128比特的格式。又例如,转发路径涉及虚拟私有网络(virtual private network,VPN)时,对应的VPN SID仍然采用128比特的格式。此时,SID可以容纳在一个container中。将同时包括128比特的SID和小于128比特的C-SID的SRH可以称为通用SRH(generalized SRH,G-SRH),相应的支持G-SRH的SRv6技术可以称为通用的SRv6(generalized SRv6,G-SRv6)技术。除了128比特的SID和小于128比特的C-SID以外,G-SRH的SID list中还可以包括其他类型的标识,例如MPLS标签和互联网协议4(Internet Protocol Version 6,IPv4)地址。所有包括在G-SRH的SID list中的标识,例如SID,C-SID,MPLS标签以及IPv4地址等,可以统称为G-SID。关于 G-SRH和G-SRv6的更多描述可以参见日期为2020年2月的题为“Generalized Segment Routing Header”的draft-lc-6man-generalized-srh-00,2020年3月的题为“Generalized SRv6 Network Programming”的draft-cl-spring-generalized-srv6-np-01,2020年5月的题为“Generalized SRv6 Network Programming for SRv6 Compression”的draft-cl-spring-generalized-srv6-for-cmpr-01,它们的全部内容通过引证结合于此,犹如全部陈述的一样。In addition, the C-SID can also be mixed with the SID and arranged in the SID list. For example, when only some network devices in the forwarding path support the C-SID function, the SID corresponding to some network devices that do not support the C-SID function still adopts the 128-bit format. For another example, when the forwarding path involves a virtual private network (VPN), the corresponding VPN SID still adopts the 128-bit format. At this point, the SID can be accommodated in a container. The SRH that includes both a 128-bit SID and a C-SID less than 128 bits can be called generalized SRH (generalized SRH, G-SRH), and the corresponding SRv6 technology that supports G-SRH can be called generalized SRv6 (generalized SRv6, G-SRv6) technology. In addition to the SID of 128 bits and the C-SID of less than 128 bits, the SID list of the G-SRH may also include other types of identifiers, such as MPLS labels and Internet Protocol Version 6 (IPv4) addresses. All the 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. More descriptions of G-SRH and G-SRv6 can be found in draft-lc-6man-generalized-srh-00 entitled "Generalized Segment Routing Header" dated February 2020, and March 2020 entitled "Generalized Segment Routing Header" Generalized SRv6 Network Programming" draft-cl-spring-generalized-srv6-np-01, May 2020 draft-cl-spring-generalized-srv6-for-cmpr titled "Generalized SRv6 Network Programming for SRv6 Compression" -01, their entire contents are hereby incorporated by reference as if all stated.
C-SID与SID混合编排的SID list对应的报文转发路径可以称为G-SRv6路径,G-SRv6路径可以包括SRv6子路径和SRv6压缩子路径。图5示出了G-SRv6路径对应的SID list的一种示意性结构。该G-SRv6路径包括两段SRv6子路径和两段SRv6压缩子路径,分别为SRv6子路径1和SRv6子路径2,SRv6压缩子路径1和SRv6压缩子路径2。相应的,图5示出的该G-SRv6路径对应的SID list(图中简称为G-SRv6路径)也包括分别与两段SRv6子路径的部分(图中简称为SRv6子路径1和SRv6子路径2)以及分别与两段SRv6压缩子路径对应的部分(图中简称为SRv6压缩子路径1和SRv6压缩子路径2)。The packet forwarding path corresponding to the SID list in which the C-SID and the SID are mixed can be called a G-SRv6 path, and the G-SRv6 path can include SRv6 sub-paths and SRv6 compression sub-paths. Figure 5 shows a schematic structure of the SID list corresponding to the G-SRv6 path. The G-SRv6 path includes two SRv6 subpaths and two SRv6 compression subpaths, SRv6 subpath 1 and SRv6 subpath 2, SRv6 compression subpath 1 and SRv6 compression subpath 2, respectively. Correspondingly, the SID list corresponding to the G-SRv6 path shown in FIG. 5 (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 in the figure for short). path 2) and the parts corresponding to the two SRv6 compression sub-paths (referred to as SRv6 compression sub-path 1 and SRv6 compression sub-path 2 for short in the figure).
在SID list中,SRv6子路径1对应的部分与SRv6子路径2对应的部分结构相似,都可以包括至少一个SID。SRv6压缩子路径1对应的部分与SRv6压缩子路径2对应的部分结构相似,都可以包括至少一个C-SID。In the SID list, the part corresponding to SRv6 subpath 1 is similar in structure to the part corresponding to SRv6 subpath 2, and both may include at least one SID. The part corresponding to the SRv6 compression sub-path 1 is similar in structure to the part corresponding to the SRv6 compression sub-path 2, and both may include at least one C-SID.
以SRv6压缩子路径1对应的部分为例,该部分包括至少一个container。可选的,这部分中第一个SID可以采用完整SID的形式存放在SID list中,也可以采用C-SID的形式存放在SID list中。如图5所示,这部分中第一个SID可以采用完整SID的形式存放在SID list中,即第一个container可以包括128比特的SID,以便于简化报文处理过程。针对第一个container的处理过程将在下文详细介绍。从第二个container开始,每个container中包括依次排列的C-SID。例如,如图5所示,第一个container中包括的SID可以分为prefix 1,C-SID 1以及可选的argument字段或padding字段三部分。第二个container中包括C-SID 2至C-SID5共4个C-SID。其后的container以此类推。Take the part corresponding to the SRv6 compression sub-path 1 as an example, the part 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 can be stored in the SID list in the form of a C-SID. As shown in Figure 5, 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 packet processing process. The processing 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, as shown in Figure 5, the SID included in the first container can be divided into three parts: prefix 1, C-SID 1, and an optional argument field or padding field. The second container includes 4 C-SIDs from C-SID 2 to C-SID5. Subsequent containers and so on.
可选的,在C-SID与SID混合编排的SID list中,可以包括多段SRv6压缩子路径。可选的,多段SRv6压缩子路径位于不同的子网,即多段SRv6压缩子路径中节点对应的SID具有不同的prefix。如图5所示,G-SRv6路径还包括SRv6压缩子路径2。在SID list中,SRv6压缩子路径1对应的部分与SRv6压缩子路径2对应的部分结构相似,但SRv6压缩子路径2对应的部分中,第一个container包括的SID中包括的前缀部分为prefix 2,与上述prefix 1不同。也就是说,不同的SRv6压缩子路径之间通过SID中是否包括相同的prefix进行区分,也即通过C-SID是否对应相同的prefix进行区分。因此,同一段SRv6压缩子路径中的各个节点属于相同的子网。Optionally, the SID list in which the C-SID and the SID are mixed can include multiple SRv6 compression subpaths. Optionally, the multi-segment SRv6 compression sub-paths are located in different subnets, that is, the SIDs corresponding to the nodes in the multi-segment SRv6 compression sub-paths have different prefixes. As shown in FIG. 5 , the G-SRv6 path further includes the SRv6 compression subpath 2 . In the SID list, the part corresponding to SRv6 compression subpath 1 is similar in structure to the part corresponding to SRv6 compression subpath 2, but in the part corresponding to SRv6 compression subpath 2, the prefix part included in the SID included in the first container is prefix 2, which is different from the above prefix 1. That is to say, different SRv6 compression sub-paths are distinguished by whether the SID includes the same prefix, that is, whether the C-SID corresponds to the same prefix. Therefore, each node in the same segment of SRv6 compressed subpath belongs to the same subnet.
结合图1所示的应用场景,转发路径依次经过网络设备1至网络设备5。其中网络设备1至网络设备4所执行的段分别可以用C-SID 1至C-SID 4表示,每个C-SID的长度为32比特。而网络设备5所执行的段用128比特长度的VPN SID表示。包括该转发路径对应的SID list的报文格式如图6所示。该SID list包括2个container,其中第一个container包括C-SID 1至C-SID 4,第二个container包括SID 5。该SID list总长为32字节,与包括5个SID、长度为80字节的SID list相比,SID list长度大大缩短,提高网络效率。其中,C-SID在SID list中的排列顺序 可以按照正序方式进行排列,如图6所示,也可以按照倒序方式进行排列,如将图6中的排列方式替换为从上到下为C-SID4至C-SID1。With reference to the application scenario shown in FIG. 1 , the forwarding path passes through the network device 1 to the network device 5 in sequence. The segments executed by the network device 1 to the network device 4 can be represented by C-SID 1 to C-SID 4 respectively, and the length of each C-SID is 32 bits. The segment executed by the network device 5 is represented by a VPN SID with a length of 128 bits. The packet format including the SID list corresponding to the forwarding path is shown in Figure 6. The SID list includes 2 containers, the first container includes C-SID 1 to C-SID 4, and the second container includes SID 5. The total length of the SID list is 32 bytes. Compared with the SID list including 5 SIDs and a length of 80 bytes, the length of the SID list is greatly shortened and the network efficiency is improved. Among them, the arrangement order of C-SIDs in the SID list can be arranged in positive order, as shown in Figure 6, or can be arranged in reverse order, such as replacing the arrangement in Figure 6 with C from top to bottom -SID4 to C-SID1.
如上所述,SRH中包括SL字段,当SRH被封装在报文中时,转发路径的头节点将SL字段的值设置为N-1,其中N为SID list中包括的SID的数量。在报文的转发过程中,SRH的SID list中各个SID对应的网络设备,也即转发路径上的endpoint node,依次将报文的SRH中的SL字段的值减1,也即对SL字段的值进行更新,并将segment list[SL]拷贝至报文的IPv6头的DA字段中,即对DA字段的内容进行更新。因此,SL字段的内容也可以称为SL指针,依次指向SID list中的每个元素。转发路径上的网络设备能够根据SL指针对SID list中的各个元素进行定位,从而找到下一个待处理的SID,并对DA字段进行更新。As mentioned above, the SRH includes the 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 of the message, the network device corresponding to each SID in the SID list of the SRH, that is, the endpoint node on the forwarding path, sequentially decrements the value of the SL field in the SRH of the message by 1, that is, the value of the SL field is decremented by 1. value, and copy the segment list[SL] to the DA field of the IPv6 header of the packet, that is, update the content of the DA field. Therefore, the content of the SL field can also be called the SL pointer, which in turn points to each element in the SID list. The network device on the forwarding path can locate each element in the SID list according to the SL pointer, so as to find the next SID to be processed, and update the DA field.
当采用包括C-SID的G-SRH时,由于C-SID长度更短,SID list中每个元素,也即每个container,可能容纳多个C-SID。或者可以认为,SID list中的元素可以进一步被划分为多个子元素。从而对于原有的SL指针来说,SL指针依次指向SID list中的每个元素,而每个元素进一步包括多个子元素,则无法仅依靠SL指针精确定位其中的每个子元素。如果这些子元素中包括C-SID,也就无法准确定位其中的每个C-SID。When the G-SRH including the C-SID is used, each element in the SID list, that is, each container, may accommodate multiple C-SIDs due to the shorter length of the C-SID. 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, so it is impossible to precisely locate each sub-element only by relying on the SL pointer. If these sub-elements include C-SIDs, it is impossible to accurately locate each C-SID in them.
此时,为了能够准确定位至SID list中的所有G-SID,需要对现有的SL指针进行扩展。具体的,可以采取一维指针和二维指针两种方式。At this time, in order to accurately locate all G-SIDs in the SID list, the existing SL pointer needs to be extended. Specifically, one-dimensional pointer and two-dimensional pointer can be adopted.
在二维指针的方式中,除了现有的SL指针以外,可以在报文中增加新的指针,该新的指针可以称为SI,也可以称为压缩段标识剩余(C-SID left,CL)指针。此时,第一维指针,即SL指针,仍然用于在SID list中指示某个具体的元素,而第二维指针,即SI,用于在元素内部进一步指示某个C-SID。C-SID在元素中可以由前至后排列,例如,当元素中包括m个C-SID时,最先执行的C-SID对应的SI取值为m-1,最后执行的C-SID对应的SI取值为0,以此类推。SI指针的值减1,则SI偏移至下一个C-SID。从而通过SL指针和SI的组合,不但可以精确定位SID list中的所有元素,还可以精确定位SID list中的所有子元素,segment list[SL][SI]可以用来表示SID list中的所有G-SID。以图6所示的报文为例,segment list[1][3]可以用于表示C-SID 1,segment list[1][0]可以用于表示C-SID 4。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 it can also be called compressed segment identifier remaining (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, and the second-dimensional pointer, that is, SI, is used to further indicate a certain C-SID inside the element. C-SIDs can be arranged in elements from front to back. For example, when an element includes m C-SIDs, the value of SI corresponding to the C-SID executed first is m-1, and the value of the SI corresponding to the C-SID executed last is m-1. The SI value of 0 is 0, and so on. The value of the SI pointer is decremented by 1, and the SI is shifted to the next C-SID. Therefore, through the combination of SL pointer and SI, not only all elements in the SID list can be accurately located, but also all sub-elements in the SID list can be accurately located. The segment list[SL][SI] can be used to represent all G in the SID list. -SID. Taking the message shown in Figure 6 as an example, segment list[1][3] can be used to represent C-SID 1, and segment list[1][0] can be used to represent C-SID 4.
关于二维指针的更新方式,当SI在元素内部偏移时,在更新指针的过程中,可以将SI减1,而SL指针保持不变即可,也就是说,SL指针仍然指向相同元素,而SI指向该元素中的下一个子元素;而当SI当前指向元素的最后一个子元素时,也即SI需要移至下一个元素时,在更新指针的过程中,可以将SL指针减1,SI置为m-1,也就是说,SL指针指向下一个元素,SI指向下一个元素的第一个子元素。Regarding the update method of the two-dimensional pointer, when the SI is offset within the element, in the process of updating the pointer, the SI can be decremented by 1, and the SL pointer can remain unchanged, that is, the SL pointer still points to the same element, And SI points to the next child element in the element; and when SI currently points to the last child element of the element, that is, when SI needs to move to the next element, in the process of updating the pointer, the SL pointer can be decremented by 1, SI is set to m-1, that is, the SL pointer points to the next element, and the SI points to the first child element of the next element.
新增加的第二维指针,即SI,可以位于报文中的SRH中,也可以位于DA字段中。例如,SI可以位于DA字段中的最低两个比特位,或者DA字段中的最低三个比特位。例如,也可以将DA字段的最低位字节用于放置SI,以便于硬件实现,且有利于未来方案的扩展。The newly added second-dimensional pointer, ie, SI, may be located in the SRH in the message, or may be located in the DA field. For example, SI may be located in the lowest two bits in the DA field, or in the lowest three bits in the DA field. For example, the least significant byte of the DA field can also be used to place the SI, which is convenient for hardware implementation and facilitates the expansion of future solutions.
在一维指针的方式中,可以将现有的SL指针的偏移步长进行调整,以形成新的指针,该新的指针可以称为通用段标识指针(generalized SID index,SI),也可以仍然称为SL指针。该一维指针,即SI,用于在SID list中指示某个G-SID。现有的SL指针的偏移步长为SID list中元素的长度,即128比特,则SL指针每次偏移后指向SID list中的下一个元素。而SI的偏移 步长为SID list中子元素的长度,例如32比特或16比特,则SI每次偏移后指向SID list中的下一个子元素。从而通过SI的不同取值,可以精确定位SID list中的所有元素和所有子元素,segment list[SI]可以用来表示SID list中的所有G-SID。需要说明的是,由于SI的偏移步长减小,当需要指向SID list中的下一个元素时,例如,当SID list中两个SID相邻时,为了指向下一个SID,SI需要偏移多个步长以实现偏移一个元素的长度。In the one-dimensional pointer mode, the offset step size of the existing SL pointer can be adjusted to form a new pointer, which can be called a generalized SID index (SI), or can be Still called the SL pointer. The one-dimensional pointer, ie SI, is used to indicate a certain G-SID in the SID list. The offset step size of the existing SL pointer is the length of the element in the SID list, that is, 128 bits, and the SL pointer points to the next element in the SID list after each offset. And the offset step size of SI is the length of the sub-element in the SID list, such as 32 bits or 16 bits, then 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 precisely located, and segment list[SI] can be used to represent all G-SIDs in the SID list. It should be noted that since the offset step size of SI decreases, when it needs 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 offset Multiple steps to achieve offset length by one element.
新的一维指针,即SI,可以位于报文中的SRH中,也可以位于DA字段中。例如,SI仍然位于SL字段。例如,也可以将DA字段的最低位字节用于放置SI,以便于硬件实现,且有利于未来方案的扩展。The new one-dimensional pointer, SI, can be located in the SRH in the message or in the DA field. For example, SI is still in the SL field. For example, the least significant byte of the DA field can also be used to place the SI, which is convenient for hardware implementation and facilitates the expansion of future solutions.
为了方便,所述扩展后的一维指针和所述扩展后的二维指针可以统称为扩展指针。For convenience, the expanded one-dimensional pointer and the expanded two-dimensional pointer may be collectively referred to as an expanded pointer.
本申请实施例提供了一种报文传输的方法,该方法采用长度小于128比特的压缩段标识(compressed SID,C-SID),在兼容SRH的前提下,使用变长压缩C-SID,不仅提高网络效率并且降低报文处理难度,还可以解决定长SID浪费空间或空间不够大的问题。The embodiment of the present application provides a method for message transmission. The method adopts a compressed segment identifier (compressed SID, C-SID) whose length is less than 128 bits. It improves network efficiency and reduces the difficulty of packet processing, and can also solve the problem of wasted space or insufficient space for fixed-length SIDs.
本申请实施例提供了C-SID的格式,如图3所示。将SID中locator字段的prefix和可能存在的argument字段和/或padding字段省略,而将locator字段的node ID和function字段组成C-SID。从而,由node ID和function字段组成C-SID,其长度可以小于128比特。SID list中可以仅包括C-SID,从而实现减小SID list长度的技术效果。This embodiment of the present application provides the format of the C-SID, as shown in FIG. 3 . Omit the prefix of the locator field and the possible argument field and/or padding field in the SID, and combine the node ID and function fields of the locator field to form the C-SID. Therefore, the C-SID is composed of node ID and function field, and its length can be less than 128 bits. Only C-SIDs can be included in the SID list, thereby achieving the technical effect of reducing the length of the SID list.
具体地,变长压缩C-SID中的变长可以指node ID的长度是可变的,和/或function ID的长度是可变的。当node ID长度可变时,可以预先设置node ID的初始长度NodeInitlen以及增量长度NodeIncrLen。首先利用初始长度NodeInitlen对应的node ID资源池,即第一资源池,为网络中的网络设备分配node ID。当初始长度NodeInitlen对应的node ID资源池的资源不足时后,将node ID的长度增加NodeIncrLen,得到新的node ID资源池,即第二资源池,以根据第二资源池继续为网络中的其他网络设备分配node ID。以此类推,当第n资源池的资源不足时,可以继续扩充获得node ID对应的第n+1资源池,利用该第n+1资源池的资源为新增的网络设备分配node ID。同理,当function的长度可变时,可以预先设置function的初始长度FuncIniLen和增量长度FunIncrLen。首先利用初始长度FuncIniLen对应的function ID资源池,即第一资源池,进行分配,当初始长度FuncIniLen对应的function ID资源池的资源不足时,将function的长度增加FunIncrLen,得到新的function ID资源池,即第二资源池,以继续为网络设备分配function ID。以此类推,当第n资源池的资源不足时,可以继续扩充获得function对应的第n+1资源池,以利用该第n+1资源池的资源为网络设备的新功能分配function ID。其中,node ID对应的初始长度NodeInitlen、增量长度NodeIncrLen,以及function对应的初始长度FuncIniLen和增量长度FunIncrLen的具体取值可以根据实际应用情况进行设定。例如,初始长度NodeInitlen、增量长度NodeIncrLen,初始长度FuncIniLen和增量长度FunIncrLen均为8比特的倍数,实现字节对齐。Specifically, the variable length in the variable-length compressed C-SID may mean that the length of the node ID is variable, and/or the length of the function ID is variable. When the length of the node ID is variable, the initial length NodeInitlen and the incremental length NodeIncrLen of the node ID can be preset. First, use the node ID resource pool corresponding to the initial length NodeInitlen, that is, the first resource pool, to assign node IDs to network devices in the network. When the resources of the node ID resource pool corresponding to the initial length NodeInitlen are insufficient, increase the length of the node ID by NodeIncrLen to obtain a new node ID resource pool, that is, the second resource pool, so as to continue to provide other resources in the network according to the second resource pool. Network devices assign node IDs. By analogy, when the resources of the nth resource pool are insufficient, the n+1th resource pool corresponding to the node ID can be continuously expanded, and the resources of the n+1th resource pool can be used to allocate the node ID to the newly added network device. Similarly, when the length of the function is variable, the initial length FuncIniLen and the incremental length FunIncrLen of the function can be preset. First, use the function ID resource pool corresponding to the initial length FuncIniLen, that is, the first resource pool, to allocate. When the resource of the function ID resource pool corresponding to the initial length FuncIniLen is insufficient, increase the length of the function by FunIncrLen to obtain a new function ID resource pool. , that is, the second resource pool to continue to assign function IDs to network devices. By analogy, when the resources of the nth resource pool are insufficient, the n+1th resource pool corresponding to the function can be continuously expanded to use the resources of the n+1th resource pool to allocate function IDs for new functions of the network device. Among them, the initial length NodeInitlen and the incremental length NodeIncrLen corresponding to the node ID, and the specific values of the initial length FuncIniLen and the incremental length FunIncrLen corresponding to the function can be set according to the actual application. For example, the initial length NodeInitlen, the incremental length NodeIncrLen, the initial length FuncIniLen and the incremental length FunIncrLen are all multiples of 8 bits to implement byte alignment.
为便于理解,以node ID分配为例进行说明,进一步地,以初始长度NodeInitlen为3bit,增量长度NodeIncrLen为3bit为例。当网络设备数量不超过4时,node ID的长度为3bit,该情况下可以按照以下规则进行编码,第1个bit可以固定为0,后2个bit任意取值,得到关于node ID的第一资源池,该第一资源池的大小为2 2=4。例如000、001、010和011。当网络设备数 量超过4时,可以进行第一次扩充,初始node ID长度为3bit,扩充3bit,则node ID长度为6bit;前2个bit固定为10,后4个bit任意取值,得到第二资源池,该第二资源池的大小为2 2=16。例如100000、100001、100010、100011等,此时,所有资源池大小之和共2 2+2 4=20。当网络设备数量超过20时,可以进行第二次扩充,初始node ID长度为3bit,扩充6bit,则node ID长度为9bit;前3个bit可以固定为110,后6个bit任意取值,得到第三资源池,该第三资源池的大小为2 6=64。例如110000000、110000001、110000010、110000011等,所有资源池大小之和共2 2+2 4+2 6=84。以此类推,当进行第i次扩充时,初始node ID长度为3bit,扩充i*3bit,则node ID长度为(i+1)*3bit;前i+1个bit固定为1…10(前面有i个1),后(i+1)*2个bit任意取值,得到第i+1资源池,该第i+1资源池的大小为2 (2i+2)。如此可以持续扩充,并且扩充后的node ID与已存在的node ID的集合是前缀码,可以共存。其中,前缀码是指具有前缀码特性的编码即为前缀码,前缀码特性是指对字符集进行编码时,要求字符集中任一字符的编码都不是其它字符的编码的前缀。例如,字符集包括a/b/c,其中,a对应的编码为0,b对应的编码为10,c对应的编码为110,每个字符对应的编码均不是其他两个编码的前缀。前缀码在计算机领域具有广泛的应用。通过上述可知,当进行第i次扩充时,第i次扩充对应第i+1资源池,该第i+1资源池对应的资源数量为2 X,X=(NodeInitLen+i*NodeIncrLen-i-1)。 For ease of understanding, the node ID allocation is taken as an example for description, and further, the initial length NodeInitlen is 3 bits, and the incremental length NodeIncrLen is 3 bits as an example. When the number of network devices does not exceed 4, the length of the node ID is 3 bits. In this case, it can be encoded according to the following rules. The first bit can be fixed to 0, and the last two bits can be arbitrarily valued to obtain the first bit about the node ID. resource pool, the size of the first resource pool is 2 2 =4. For example 000, 001, 010 and 011. When the number of network devices exceeds 4, it can be expanded for the first time. The initial node ID length is 3 bits, and the length of the node ID is 6 bits when expanded by 3 bits; the first 2 bits are fixed at 10, and the last 4 bits can be arbitrarily set to obtain the first Two resource pools, the size of the second resource pool is 2 2 =16. For example, 100000, 100001, 100010, 100011, etc. At this time, the sum of all resource pool sizes is 2 2 +2 4 =20. When the number of network devices exceeds 20, the second expansion can be performed. The initial node ID length is 3 bits, and the expansion is 6 bits, so the node ID length is 9 bits; the first 3 bits can be fixed at 110, and the last 6 bits can be arbitrarily valued to obtain The third resource pool, the size of the third resource pool is 2 6 =64. For example, 110000000, 110000001, 110000010, 110000011, etc., the sum of all resource pool sizes is 2 2 +2 4 +2 6 =84. By analogy, when the i-th expansion is performed, the initial node ID length is 3 bits, and if i*3bit is expanded, the node ID length is (i+1)*3bit; the first i+1 bits are fixed at 1...10 (the front There are i 1s), and the last (i+1)*2 bits take any value to obtain the i+1th resource pool, and the size of the i+1th resource pool is 2 (2i+2) . In this way, it can be continuously expanded, and the set of the expanded node ID and the existing node ID is a prefix code and can coexist. Among them, the prefix code means that the code with the prefix code characteristic is the prefix code, and the prefix code characteristic means that when encoding the character set, it is required that the code of any character in the character set is not the prefix of the code of other characters. For example, the character set includes a/b/c, where the code corresponding to a is 0, the code corresponding to b is 10, and the code corresponding to c is 110, and the code corresponding to each character is not a prefix of the other two codes. Prefix codes have a wide range of applications in the computer field. It can be seen from the above that when the i-th expansion is performed, the i-th expansion corresponds to the i+1-th resource pool, and the number of resources corresponding to the i+1-th resource pool is 2 X , X=(NodeInitLen+i*NodeIncrLen-i- 1).
此外,在进行node ID编码时,还可以按照以下规则进行编码,第1个bit可以固定为1,后2个bit任意取值,得到第一资源池,该第一资源池大小为2 2=4。例如100、101、110和111。当网络设备数量超过4时,可以进行第一次扩充,初始node ID长度为3bit,扩充3bit,则node ID长度为6bit;前2个bit固定为01,后4个bit任意取值,得到第二资源池,该第二资源池大小为2 4=16。例如010000、010001、010010、010011等,此时,所有资源池大小之和共2 2+2 4=20。当网络设备数量超过20时,可以进行第二次扩充,初始node ID长度为3bit,扩充6bit,则node ID长度为9bit;前3个bit可以固定为001,后6个bit任意取值,得到第三资源池,该第三资源池的大小为2 6=64。例如001000000、001000001、001000010、001000011等,所有资源池大小之和共2 2+2 4+2 6=84。以此类推,当进行第i次扩充时,初始node ID长度为3bit,扩充i*3bit,则node ID长度为(i+1)*3bit;前i+1个bit固定为0…01(前面有i个0),后(i+1)*2个bit任意取值,得到第i+1资源池,该第i+1资源池的大小为2 (2i+2)。如此可以持续扩充,并且扩充后的node ID与已存在的node ID的集合是前缀码,可以共存。通过上述可知,当进行第i次扩充时,第i次扩充对应的资源池大小为2 (NodeInitLen+i*NodeIncrLen-i-1)的编码空间。 In addition, when encoding the node ID, it can also be encoded according to the following rules. The first bit can be fixed to 1, and the last two bits can be arbitrarily set to obtain the first resource pool. The size of the first resource pool is 2 2 = 4. For example 100, 101, 110 and 111. When the number of network devices exceeds 4, the first expansion can be performed. The initial node ID length is 3 bits, and the length of the node ID is 6 bits when expanded by 3 bits; the first 2 bits are fixed at 01, and the last 4 bits can be arbitrarily set to obtain the first Two resource pools, the size of the second resource pool is 2 4 =16. For example, 010000, 010001, 010010, 010011, etc. At this time, the sum of all resource pool sizes is 2 2 +2 4 =20. When the number of network devices exceeds 20, the second expansion can be performed. The initial node ID length is 3 bits, and the expansion is 6 bits, so the node ID length is 9 bits; the first 3 bits can be fixed as 001, and the last 6 bits can be arbitrarily set to obtain The third resource pool, the size of the third resource pool is 2 6 =64. For example, 001000000, 001000001, 001000010, 001000011, etc., the sum of all resource pool sizes is 2 2 +2 4 +2 6 =84. By analogy, when the i-th expansion is performed, the initial node ID length is 3 bits, and if i*3bit is expanded, the node ID length is (i+1)*3bit; the first i+1 bits are fixed as 0...01 (the front There are i 0s), and the last (i+1)*2 bits take any value to obtain the i+1th resource pool, and the size of the i+1th resource pool is 2 (2i+2 ). In this way, it can be continuously expanded, and the set of the expanded node ID and the existing node ID is a prefix code and can coexist. It can be known from the above that when the i-th expansion is performed, the resource pool size corresponding to the i-th expansion is a coding space with a size of 2 (NodeInitLen+i*NodeIncrLen-i-1) .
可以理解的是,当function的长度可变时,function对应的编码规则可以参见上述node ID编码过程。例如,初始长度FuncIniLen和增量长度FunIncrLen均为3bit,按照第一种编码规则进行编码时,第1个bit可以固定为0,后2个bit任意取值,得到关于function ID的第一资源池,该第一资源池大小为2 2=4。例如000、001、010和011。当网络设备的功能数量超过4时,可以进行第一次扩充,初始function ID长度为3bit,扩充3bit,则function ID长度为6bit;前2个bit固定为10,后4个bit任意取值,得到第二资源池,该第二资源池大小为2 4=16。例如100000、100001、100010、100011等,此时,所有资源池大小之和共2 2+2 4=20。当网络设备的功能数量超过20时,可以进行第二次扩充,则function ID长度为9bit;前3个bit可以固定为110,后6个bit任意取值,得到第三资源池,该第三资源池的大小为2 6=64。例如 110000000、110000001、110000010、110000011等,所有资源池大小之和共2 2+2 4+2 6=84。以此类推,当进行第i次扩充时,初始functionID长度为3bit,扩充i*3bit,则function ID长度为(i+1)*3bit;前i+1个bit固定为1…10(前面有i个1),后面(i+1)*2个bit任意取值,得到第i+1资源池,该第i+1资源池大小为2 (2i+2)It can be understood that when the length of the function is variable, the encoding rules corresponding to the function can refer to the above node ID encoding process. For example, the initial length FuncIniLen and the incremental length FunIncrLen are both 3 bits. When encoding according to the first encoding rule, the first bit can be fixed to 0, and the last two bits can be arbitrarily set to obtain the first resource pool for the function ID. , the size of the first resource pool is 2 2 =4. For example 000, 001, 010 and 011. When the number of functions of the network device exceeds 4, the first expansion can be carried out. The initial function ID length is 3 bits, and if the expansion is 3 bits, the function ID length is 6 bits; the first 2 bits are fixed at 10, and the last 4 bits can take any value. A second resource pool is obtained, and the size of the second resource pool is 2 4 =16. For example, 100000, 100001, 100010, 100011, etc. At this time, the sum of all resource pool sizes is 2 2 +2 4 =20. When the number of functions of the network device exceeds 20, the second expansion can be performed, and the length of the function ID is 9 bits; the first 3 bits can be fixed to 110, and the last 6 bits can be arbitrarily set to obtain a third resource pool, the third The size of the resource pool is 2 6 =64. For example, 110000000, 110000001, 110000010, 110000011, etc., the sum of all resource pool sizes is 2 2 +2 4 +2 6 =84. By analogy, when the i-th expansion is performed, the initial functionID length is 3bit, and if i*3bit is expanded, then the function ID length is (i+1)*3bit; the first i+1 bits are fixed to 1...10 (preceded by i 1), the following (i+1)*2 bits can be arbitrarily valued to obtain the i+1th resource pool, and the size of the i+1th resource pool is 2 (2i+2) .
当按照第二种编码规则进行编码时,第1个bit可以固定为1,后2个bit任意取值,得到第一资源池,该第一资源池大小为2 2=4。例如100、101、110和111。当网络设备的功能数量超过4时,可以进行第一次扩充,初始function ID长度为3bit,扩充3bit,则function ID的长度为6bit;前2个bit固定为01,后4个bit任意取值,得到第二资源池,该第二资源池大小为2 4=16。例如010000、010001、010010、010011等,此时,所有资源池大小之和共2 2+2 4=20。当网络设备的功能数量超过20时,可以进行第二次扩充,初始function ID长度为3bit,扩充6bit,则function ID长度为9bit;前3个bit可以固定为001,后6个bit任意取值,得到第三资源池,该第三资源池的大小为2 6=64。例如001000000、001000001、001000010、001000011等,所有资源池大小之和共2 2+2 4+2 6=84。以此类推,当进行第i次扩充时,初始function ID长度为3bit,扩充i*3bit,则function ID长度为(i+1)*3bit;前i+1个bit固定为0…01(前面有i个0),后面(i+1)*2个bit任意取值,得到第i+1资源池,该第i+1资源池大小为2 (2i+2)When encoding is performed according to the second encoding rule, the first bit can be fixed as 1, and the last two bits can take any value to obtain the first resource pool, and the size of the first resource pool is 2 2 =4. For example 100, 101, 110 and 111. When the number of functions of the network device exceeds 4, the first expansion can be performed. The initial function ID length is 3 bits, and the length of the function ID is 6 bits. The first 2 bits are fixed at 01, and the last 4 bits can be arbitrarily set , the second resource pool is obtained, and the size of the second resource pool is 2 4 =16. For example, 010000, 010001, 010010, 010011, etc. At this time, the sum of all resource pool sizes is 2 2 +2 4 =20. When the number of functions of the network device exceeds 20, the second expansion can be carried out. The initial function ID length is 3 bits, and if the expansion is 6 bits, the function ID length is 9 bits; the first 3 bits can be fixed to 001, and the last 6 bits can take any value , a third resource pool is obtained, and the size of the third resource pool is 2 6 =64. For example, 001000000, 001000001, 001000010, 001000011, etc., the sum of all resource pool sizes is 2 2 +2 4 +2 6 =84. By analogy, when the i-th expansion is performed, the initial function ID length is 3 bits, and if i*3bit is expanded, the function ID length is (i+1)*3bit; the first i+1 bits are fixed as 0...01 (the front There are i 0s), and the following (i+1)*2 bits take any value to obtain the i+1th resource pool, and the size of the i+1th resource pool is 2 (2i+2) .
通过上述可知,扩充后的function ID与已存在的function ID的集合是前缀码,可以共存。而且,当进行第i次扩充时,第i次扩充对应第i+1资源池,该第i+1资源池对应的资源数量为2 X,X=(FuncInitLen+i*FuncIncrLen-i-1)。 It can be seen from the above that the set of the expanded function ID and the existing function ID is a prefix code and can coexist. Moreover, when the i-th expansion is performed, the i-th expansion corresponds to the i+1-th resource pool, and the number of resources corresponding to the i+1-th resource pool is 2 X , X=(FuncInitLen+i*FuncIncrLen-i-1) .
通过上述可知,在同一个子网中,所有SID的prefix相同,但所有SID中的node ID的长度并不都是相同。结合图1所示的应用场景,例如网络设备1对应node ID为000、网络设备2对应node ID为001,长度均为3bit,但网络设备5对应的node ID为100000,长度为6bit。可选的,所有SID中的function ID字段长度也并不都是相同。例如,网络设备1对应的一个SID中的function ID为000、网络设备2对应的一个SID中的function ID为001,长度均为3bit,网络设备5对应的一个SID中的function ID为100000,长度为6bit。It can be seen from the above that in the same subnet, the prefixes of all SIDs are the same, but the lengths of the node IDs in all SIDs are not the same. Combined with the application scenario shown in Figure 1, for example, the node ID corresponding to network device 1 is 000, the node ID corresponding to network device 2 is 001, and the length is 3 bits, but the node ID corresponding to network device 5 is 100000, and the length is 6 bits. Optionally, the length of the function ID field in all SIDs is not the same. For example, the function ID in a SID corresponding to network device 1 is 000, the function ID in a SID corresponding to network device 2 is 001, the length is 3 bits, the function ID in a SID corresponding to network device 5 is 100000, the length is 6bit.
需要说明的是,对于node ID资源池的扩充通常由用户根据当前网络规模的大小进行多次扩充,以为网络中的每个网络设备分配唯一的node ID。而对于function ID的扩充,由于不同的网络设备所承担的功能不同,某些网络设备所承担的功能较多,需要的function ID数量较大,而另一些网络设备所承担的功能较少,需要的function ID数量较小,因此,function ID的扩充可以由每个网络设备进行。It should be noted that the expansion of the node ID resource pool is usually performed by the user multiple times according to the current network size, so as to assign a unique node ID to each network device in the network. For the expansion of function IDs, due to the different functions undertaken by different network devices, some network devices undertake more functions and require a larger number of function IDs, while other network devices undertake fewer functions and require The number of function IDs is small, so the expansion of function IDs can be performed by each network device.
参见图4,该图为本申请实施例提供的一种获取压缩段标识的方法流程图,该方法可以包括:Referring to FIG. 4 , which is a flowchart of a method for obtaining a compressed segment identifier provided by an embodiment of the present application, the method may include:
S401:第一网络设备获得第一长度的压缩段标识,该第一长度的压缩段标识包括第一可变长度部分,该第一可变长度部分属于第一资源池,该第一资源池包括多个第一可变长度部分。S401: The first network device obtains a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable-length part, the first variable-length part belongs to a first resource pool, and the first resource pool includes a plurality of first variable length portions.
针对网络系统中的任一网络设备,例如图1所示的应用场景中的网络设备S、网络设备1-网络设备5,均可以获得自身对应的压缩段标识。其中,压缩段标识包括node ID和function ID,对于网络设备而言,通常情况下,当用户或控制器为其分配node ID后,其对应的node  ID不会发生变化,而发生变化的通常为function ID。也就是,第一网络设备获得的第一长度的压缩段标识中第一可变长度部分为功能标识function ID,其中,第一长度的压缩段标识中function ID属于第一资源池,该第一资源池中包括多个第一可变长度的function ID。例如,第一资源池为[000、001、010、011],该第一资源池包括4个第一可变长度的function ID,其中,000指示function1、001指示function2、010指示function3、011指示function4。For any network device in the network system, for example, the network device S, the network device 1 to the network device 5 in the application scenario shown in FIG. 1 , the corresponding compressed segment identifier can be obtained. Among them, the compressed segment identifier includes node ID and function ID. For network devices, under normal circumstances, after the user or controller assigns a node ID to it, the corresponding node ID will not change, and the one that changes is usually function ID. That is, the first variable length part in the compressed segment identifier of the first length obtained by the first network device is the function identifier function ID, wherein the function ID in the compressed segment identifier of the first length belongs to the first resource pool, and the first The resource pool includes a plurality of first variable-length function IDs. For example, the first resource pool is [000, 001, 010, 011], the first resource pool includes 4 function IDs of the first variable length, wherein 000 indicates function1, 001 indicates function2, 010 indicates function3, and 011 indicates function4.
S402:基于第一资源池的资源不足,第一网络设备获得第二长度的压缩段标识,其中,第二长度大于等于第一长度,第二长度的压缩段标识包括第二可变长度部分,该第二可变长度部分属于第二资源池,第二资源池包括多个第二可变长度部分。S402: Based on insufficient resources in the first resource pool, the first network device obtains a compressed segment identifier of a second length, where the second length is greater than or equal to the first length, and the compressed segment identifier of the second length includes a second variable length part, The second variable length portion belongs to a second resource pool that includes a plurality of second variable length portions.
当第一网络设备的功能数量超过第一资源池所包括的function ID的数量时,此时无法利用第一资源池为新增的功能分配function ID,则第一网络设备可以基于预先配置的function ID的初始长度和增量长度对function ID的资源池进行扩充,获得第二可变长度的function ID。第一网络设备基于node ID和第二可变长度的function ID获得第二长度的压缩段标识。该第二长度的压缩段标识包括第二可变长部分,即第二可变长度的function ID,且该第二可变长部分所属的第二资源池中可以包括多个第二可变长度的function ID。例如,第二资源池为[100000、100001、100010、100011],其中,100000指示function5、100001指示function6、100010指示function7、100011指示function8。具体地,当第一资源池的资源耗尽时,第一网络设备可以通过内部网关协议(interior gateway protocol,IGP)以及预先配置的初始长度和增量长度自动生成第二资源池。同时,第一网络设备根据生成的第二资源获得第二长度的压缩段标识,并将第二长度的压缩段标识下发至转发表项。When the number of functions of the first network device exceeds the number of function IDs included in the first resource pool, and the first resource pool cannot be used to allocate function IDs for the newly added functions, the first network device can be based on the preconfigured function IDs. The initial length and incremental length of the ID expand the resource pool of the function ID to obtain a second variable-length function ID. The first network device obtains the compressed segment identifier of the second length based on the node ID and the function ID of the second variable length. The compressed segment identifier of the second length includes a second variable length part, that is, a function ID of the second variable length, and the second resource pool to which the second variable length part belongs may include a plurality of second variable lengths The function ID of . For example, the second resource pool is [100000, 100001, 100010, 100011], where 100000 indicates function5, 100001 indicates function6, 100010 indicates function7, and 100011 indicates function8. Specifically, when the resources of the first resource pool are exhausted, the first network device may automatically generate the second resource pool through an interior gateway protocol (interior gateway protocol, IGP) and a preconfigured initial length and incremental length. At the same time, the first network device obtains the compressed segment identifier of the second length according to the generated second resource, and delivers the compressed segment identifier of the second length to the forwarding entry.
在实际的应用场景中,当第二资源池的资源不足时,第一网络设备还可以获得第三长度的压缩段标识,其中,第三长度大于等于第二长度,第三长度的压缩段标识包括第三可变长部分,该第三可变长部分属于第三资源池,该第三资源池包括多个第三可变长部分。以此类推,当第n资源池的资源不足时,第一网络设备获得第n+1长度的压缩段标识,该第n+1长度大于等于第n长度。其中,第n+1长度的压缩段标识包括第n+1可变长度部分,该第n+1可变长度部分属于第n+1资源池,该第n+1资源池包括多个第n+1可变长度部分,其中,n为大于1的自然数。也就是,当第一网络设备对应的功能数量较大时,可以对function ID的长度进行多次扩充,以获得不同长度的压缩段标识。通过本实施例提供的方法,当网络设备对应的功能数量较少时,可以利用较短的function ID,缩短C-SID的长度,避免使用长的SID的空间。当网络设备对应的功能数量较多时,可以利用较长的function ID,增加C-SID的长度,避免定长SID造成的空间不足的问题。其中,关于function ID的扩充实现可以参见上述function ID的编码规则的说明,本实施例在此不再赘述。In an actual application scenario, when the resources of the second resource pool are insufficient, the first network device can also obtain a compressed segment identifier of a third length, where the third length is greater than or equal to the second length, and the compressed segment identifier of the third length is A third variable length portion is included, the third variable length portion belongs to a third resource pool, and the third resource pool includes a plurality of third variable length portions. By analogy, when the resources of the nth resource pool are insufficient, the first network device obtains the compressed segment identifier of the n+1th length, where the n+1th length is greater than or equal to the nth length. Wherein, the compressed segment identifier of the n+1th length includes the n+1th variable length part, the n+1th variable length part belongs to the n+1th resource pool, and the n+1th resource pool includes a plurality of nth +1 variable length part, where n is a natural number greater than 1. That is, when the number of functions corresponding to the first network device is large, the length of the function ID can be expanded multiple times to obtain compressed segment identifiers of different lengths. With the method provided in this embodiment, when the number of functions corresponding to the network device is small, a shorter function ID can be used to shorten the length of the C-SID and avoid using the space of a long SID. When the number of functions corresponding to the network device is large, a longer function ID can be used to increase the length of the C-SID to avoid the problem of insufficient space caused by the fixed-length SID. Wherein, regarding the extended implementation of the function ID, reference may be made to the description of the encoding rule for the function ID above, which will not be repeated in this embodiment.
其中,第一长度的C-SID的长度和第二长度的C-SID的长度存在公差,该公差等于第二可变长部分与第一可变长部分的差值,即增量长度。例如,node ID的长度为8比特,function ID的初始长度为8比特,增量长度为8比特,第一长度的C-SID的长度为16比特,第二长度的C-SID的长度为24比特,二者的长度差值为8比特。There is a tolerance between the length of the C-SID of the first length and the length of the C-SID of the second length, and the tolerance is equal to the difference between the second variable length part and the first variable length part, that is, the incremental length. For example, the length of the node ID is 8 bits, the initial length of the function ID is 8 bits, the increment length is 8 bits, the length of the C-SID of the first length is 16 bits, and the length of the C-SID of the second length is 24 bits. bits, the difference between the lengths of the two is 8 bits.
S403:第一网络设备发送第一长度的压缩段标识和第二长度的压缩段标识,该第一长度的压缩段标识和第二长度的压缩段标识用于指示第一网络设备所执行的段。S403: The first network device sends the compressed segment identifier of the first length and the compressed segment identifier of the second length, where the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the segment executed by the first network device .
本实施例中,第一网络设备可以根据实际应用情况向其它网络设备发送第一长度的压缩段标识和第二长度的压缩段标识。例如,压缩段标识的相关信息可以通过IGP协议泛洪出去。其他网络设备获得第一网络设备发送的压缩段标识,从而实现网络功能,例如,根据第一网络设备发送的压缩段标识生成转发表项,或者,根据第一网络设备发送的压缩段标识生成指导报文转发的段标识。虽然,第一网络设备发送不同长度的压缩段标识,但该两个不同长度的压缩段标识均用于指示第一网络设备所执行的段。具体地,第一网络设备根据要实现的功能可以发送不同长度的压缩段标识。例如,第一网络设备要实现的功能为function1,则发送第一长度的压缩段标识;当第一网络设备实现的功能为function7,则发送第二长度的压缩段标识;当第一网络设备实现的功能为function 30,则发送第三长度的压缩段标识。In this embodiment, the first network device may send the compressed segment identifier of the first length and the compressed segment identifier of the second length to other network devices according to the actual application situation. For example, information related to the identifier of the compressed segment can be flooded out through the IGP protocol. Other network devices obtain the compressed segment identifier sent by the first network device, thereby implementing network functions, for example, generating a forwarding entry according to the compressed segment identifier sent by the first network device, or generating a guide based on the compressed segment identifier sent by the first network device The segment identifier for packet forwarding. Although the first network device sends compressed segment identifiers of different lengths, the two compressed segment identifiers of different lengths are both used to indicate segments executed by the first network device. Specifically, the first network device may send compressed segment identifiers of different lengths according to the function to be implemented. For example, if the function to be implemented by the first network device is function1, the compressed segment identifier of the first length is sent; when the function implemented by the first network device is function7, the compressed segment identifier of the second length is sent; The function is function 30, then the compressed segment identifier of the third length is sent.
在一些实现方式中,第一网络设备在发送第一长度的压缩段标识和第二长度的压缩段标识时,还可以发送合成的locator以及可变长度部分对应的初始长度和增量长度。例如,当可变长度部分包括节点标识以及功能标识,则第一网络设备发送节点标识对应的初始长度NodeInitlen以及增量长度NodeIncrLen以及功能标识对应的初始长度FuncIniLen和增量长度FunIncrLen。其中,节点标识的初始长度、增量长度和功能标识的初始长度、增量长度,可以在配置locator时由用户手动配置,并且在同一子网域内所配置的参数相同。In some implementation manners, when sending the compressed segment identifier of the first length and the compressed segment identifier of the second length, the first network device may also send the synthesized locator and the initial length and increment length corresponding to the variable length part. For example, when the variable length part includes the node identifier and the function identifier, the first network device sends the initial length NodeInitlen and the increment length NodeIncrLen corresponding to the node identifier and the initial length FuncIniLen and the increment length FunIncrLen corresponding to the function identifier. The initial length and incremental length of the node identifier and the initial length and incremental length of the function identifier can be manually configured by the user when configuring the locator, and the parameters configured in the same sub-network domain are the same.
在一些实现方式中,C-SID的长度可以为8比特对齐,即C-SID的长度为8比特的整数倍。优选的,C-SID的长度可以为32比特或16比特。在该情况下,node ID对应的初始长度NodeInitlen以及增量长度NodeIncrLen应均为8比特的倍数,和/或function对应的初始长度FuncIniLen和增量长度FunIncrLen应均为8比特的倍数。In some implementations, the length of the C-SID may be aligned with 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. In this case, the initial length NodeInitlen and the increment length NodeIncrLen corresponding to the node ID should both be multiples of 8 bits, and/or the initial length FuncIniLen and the increment length FunIncrLen corresponding to the function should both be multiples of 8 bits.
为了获得较好的压缩效果,在网络规划过程中,可以规划有利于压缩的SRv6 SID。例如,在有利于压缩的SRv6 SID中,可以采用较短的function字段,也可以采用较短的node ID。优选的,在有利于压缩的SRv6 SID中,prefix为64比特,node ID为16比特,function字段为16比特,从而对应的C-SID为32比特。优选的,在有利于压缩的SRv6 SID中,prefix为64比特,node ID为8比特,function字段为8比特,剩余部分为padding字段,从而对应的C-SID为16比特。In order to obtain better compression effects, in the network planning process, you can plan SRv6 SIDs that are conducive to compression. For example, in SRv6 SIDs that favor compression, a shorter function field can be used, or a shorter node ID can be used. Preferably, in the 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 the corresponding C-SID is 32 bits. Preferably, in the 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 rest is the padding field, so the corresponding C-SID is 16 bits.
本申请实施例提出一种转发报文的方法,该方法涉及报文转发路径上的网络设备。在该方法中,第二网络设备接收到的第一报文包括对应于第一报文的转发路径的段列表,该段列表包括依次排列的多个压缩段标识,其中,每个压缩段标识的长度小于等于128比特。第二网络设备根据编码规则从段列表中读取待拷贝内容,该待拷贝内容对应的网络设备即为下一跳网络设备。其中,编码规则为待拷贝内容对应的网络设备在生成待拷贝内容所对应的规则。其中,同一子网域内压缩段标识对应的编码规则相同,该同一子网域是指该子网域内的前缀相同。第二网络设备利用读取到的待拷贝内容更新第一报文中的目的地址DA,以生成第二报文,并转发该第二报文。即,针对段列表中所包括的多个压缩段标识,无需提前获知每个压缩段标识各自对应的长度,而是根据该压缩段标识所属子网域对应的编码规则即可以获取。当不同长度的C-SID在同一段SRv6压缩子路径中混合编排时,与现有的SRv6网络中报文转发和处理过程相兼容。An embodiment of the present application proposes a method for forwarding a packet, and the method involves a network device on a packet forwarding path. In this method, the first packet received by the second network device includes a segment list corresponding to the forwarding path of the first packet, and the segment list includes a plurality of compressed segment identifiers arranged in sequence, wherein each compressed segment identifier The length is less than or equal to 128 bits. The second network device reads the content to be copied from the segment list according to the encoding rule, and the network device corresponding to the content to be copied is the next-hop network device. The encoding rule is a rule corresponding to the network device corresponding to the content to be copied generating the content to be copied. The encoding rules corresponding to the compressed segment identifiers in the same sub-domain are the same, and the same sub-domain means that the prefixes in the sub-domain are the same. The second network device updates the destination address DA in the first packet by using the read content to be copied, so as to generate a second packet, and forward the second packet. That is, for the multiple compressed segment identifiers included in the segment list, it is not necessary to know the corresponding length of each compressed segment identifier in advance, but can be obtained according to the encoding rule corresponding to the sub-network domain to which the compressed segment identifier belongs. When C-SIDs of different lengths are mixed in the same SRv6 compression sub-path, it is compatible with the packet forwarding and processing process in the existing SRv6 network.
参见图7,该图为本申请实施例提供的一种报文传输方法流程图,该方法涉及网络设备101和网络设备102。其中,网络设备101为报文转发路径上的头节点,例如,当报文转发路径如图1中虚线所示时,网络设备101可以是图1所示应用场景中的网络设备S,网络设备102为报文转发路径上除头节点以外的其他网络设备,例如,网络设备102可以是图1所示应用场景中的网络设备1至网络设备5。该方法可以包括:Referring to FIG. 7 , which is a flowchart of a packet transmission method provided by an embodiment of the present application, the method involves a network device 101 and a network device 102 . The network device 101 is the head node on the packet forwarding path. For example, when the packet forwarding path is shown by the dotted line in FIG. 1, the network device 101 may be the network device S in the application scenario shown in FIG. 1. The network device 102 is another network device except the head node on the packet forwarding path. For example, the network device 102 may be the network device 1 to the network device 5 in the application scenario shown in FIG. 1 . The method can include:
S701:网络设备101获取转发路径的段列表。S701: The network device 101 obtains a segment list of the forwarding path.
其中,网络设备101可以为图1中网络设备S,该网络设备S可以为SRv6网络的入口设备。本实施例中,网络设备101获取转发路径的段列表,包括网络设备101从控制器接收转发路径的段列表,或者网络设备101生成转发路径的段列表。当网络设备101生成转发路径的段列表时,首先确定转发报文所对应的转发路径,并根据转发路径生成段列表。The network device 101 may be the network device S in FIG. 1 , and the network device S may be an ingress device of the SRv6 network. In this embodiment, the network device 101 obtains the segment list of the forwarding path, including the segment list of the forwarding path received by the network device 101 from the controller, or the segment list of the forwarding path generated by the network device 101. When the network device 101 generates the segment list of the forwarding path, it first determines the forwarding path corresponding to the forwarding packet, and generates the segment list according to the forwarding path.
其中,段列表包括依次排列的多个压缩段标识,该多个压缩段标识中的每个压缩段标识的长度小于128比特,且多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,第一长度和第二长度不同,每个压缩段标识包括前缀码。通过前述可知,压缩段标识包括节点标识和功能标识,在应用中,可以扩充节点标识node ID和/或功能标识function ID的长度,以满足网络规模的扩大以及每个网络设备所对应功能数量的扩大。也就是,每个压缩段标识中可以包括可变长度部分,其中,第一长度的压缩段标识的可变长度部分的长度和第二长度的压缩段标识的可变长度部分的长度不同,该可变长度部分包括前缀码且该可变长度部分的长度可以根据可变长度部分的编码规则确定。其中,关于可变长度部分的编码规则可以参见上述node ID和/或function ID编码规则的描述,本实施例在此不再赘述。The segment list includes multiple compressed segment identifiers arranged in sequence, each of the multiple compressed segment identifiers has a length of less than 128 bits, and the multiple compressed segment identifiers include a compressed segment identifier of a first length and a first compressed segment identifier. A two-length compressed segment identifier, the first length and the second length are different, and each compressed segment identifier includes a prefix code. It can be seen from the foregoing that the compressed segment identifier includes a node identifier and a function identifier. In applications, the length of the node identifier node ID and/or function identifier function ID can be expanded to meet the expansion of the network scale and the number of functions corresponding to each network device. expand. That is, each compressed segment identifier may include a variable length portion, wherein the length of the variable length portion of the compressed segment identifier of the first length and the length of the variable length portion of the compressed segment identifier of the second length are different, and the length of the variable length portion of the compressed segment identifier of the second length is different. The variable-length part includes a prefix code and the length of the variable-length part can be determined according to the encoding rule of the variable-length part. Wherein, for the coding rules of the variable-length part, reference may be made to the description of the above-mentioned node ID and/or function ID coding rules, which will not be repeated in this embodiment.
其中,可变长度部分可以为功能标识function ID,该function ID为前缀码,或者可变长度部分为节点标识node ID,该node ID为前缀码。第一长度的压缩段标识中的可变长度部分和第二长度的压缩段标识的可变长度部分所对应的标识类型一致,例如均为功能标识或均为节点标识。在该实施例中,第一长度的压缩段标识和第二长度的压缩段标识中的节点标识可以相同,也可以不同。当第一长度的压缩段标识和第二长度的压缩段标识中的节点标识相同时,表明第一长度的压缩段标识和第二长度的压缩段标识指示同一网络设备所执行的段,例如,第一长度的压缩段标识和第二长度的压缩段标识均指示网络设备1所执行的段。当第一长度的压缩段标识和第二长度的压缩段标识的节点标识不相同时,第一长度的压缩段标识和第二长度的压缩段标识分别指示不同的网络设备所执行的段,例如第一长度的压缩段标识用于指示网络设备1所执行的段,第二长度的压缩段标识用于指示网络设备2所执行的段。Wherein, the variable length part can be the function ID function ID, which is the prefix code, or the variable length part is the node ID node ID, and the node ID is the prefix code. The variable length part in the compressed segment identifier of the first length corresponds to the identifier type corresponding to the variable length part of the compressed segment identifier of the second length, for example, both are function identifiers or both are node identifiers. In this embodiment, the node identifiers in the compressed segment identifier of the first length and the compressed segment identifier of the second length may be the same or different. When the node identifiers in the compressed segment identifier of the first length and the compressed segment identifier of the second length are the same, it indicates that the compressed segment identifier of the first length and the compressed segment identifier of the second length indicate segments executed by the same network device, for example, Both the compressed segment identifier of the first length and the compressed segment identifier of the second length indicate segments executed by the network device 1 . When the node identifiers of the compressed segment identifier of the first length and the compressed segment identifier of the second length are different, the compressed segment identifier of the first length and the compressed segment identifier of the second length respectively indicate segments executed by different network devices, for example The compressed segment identifier of the first length is used to indicate the segment executed by the network device 1 , and the compressed segment identifier of the second length is used to indicate the segment executed by the network device 2 .
在本实施例中,段列表可以包括多个不同长度的压缩段标识C-SID,例如,第一长度的C-SID、第二长度的C-SID。其中,第一长度的C-SID对应的前缀部分prefix和第二长度的C-SID对应的前缀prefix可以相同,例如,第一长度的C-SID和第二长度的C-SID位于同一段SRv6子网中。第一长度的C-SID对应的前缀部分prefix和第二长度的C-SID的前缀部分Prefix也可以不同,例如,第一长度的C-SID对应的前缀部分为prefix1,第二长度的C-SID对应的前缀部分为prefix2。也就是,第一长度的C-SID和第二长度的C-SID分 别位于不同的SRv6子网中。In this embodiment, the segment list may include multiple compressed segment identifiers C-SIDs of different lengths, for example, C-SIDs of a first length and C-SIDs of a second length. The prefix part of the prefix corresponding to the C-SID of the first length and the prefix corresponding to the C-SID of the second length may be the same. For example, the C-SID of the first length and the C-SID of the second length are located in the same segment of SRv6 in the subnet. The prefix part of the prefix corresponding to the C-SID of the first length and the prefix part of the prefix part of the C-SID of the second length may also be different. For example, the prefix part corresponding to the C-SID of the first length is prefix1, and the C-SID of the second length The prefix part corresponding to the SID is prefix2. That is, the C-SID of the first length and the C-SID of the second length are located in different SRv6 subnets, respectively.
当报文处理过程包括5个段时,如果采用128比特长度的SID,5个SID的总长度为80字节,而采用C-SID时,以C-SID长度为32比特为例,5个C-SID的总长度为20字节,压缩效果明显。为了获得包括所述C-SID的SID list,可以先获得包括SID的SID list,再将包括段标识的SID list中的SID进行压缩,将其中的SID替换为对应的C-SID,获得包括所述C-SID的SID list;或者,也可以先将SID进行压缩,获得对应的C-SID,再根据C-SID获得包括所述C-SID的SID list。When the packet processing process includes 5 segments, if a SID with a length of 128 bits is used, the total length of the 5 SIDs is 80 bytes. The total length of C-SID is 20 bytes, and the compression effect is obvious. In order to obtain the SID list including the C-SID, first obtain the SID list including the SID, then compress the SID in the SID list including the segment identifier, replace the SID in it with the corresponding C-SID, and obtain the SID including the SID list. The SID list of the C-SID; or, the SID can also be compressed first to obtain the corresponding C-SID, and then the SID list including the C-SID is obtained according to the C-SID.
在一些实现方式中,段列表包括长度为128比特的元素,第一长度的C-SID和第二长度的C-SID可以位于在段列表中的同一元素中。结合图1所示的应用场景,包括不同长度的C-SID的段列表如图8a所示,网络设备1-网络设备4所执行的段可以用长度为16比特的C-SID标识,即C-SID1至C-SID4;网络设备5所执行的段可以用长度为32比特的C-SID表示,即C-SID5。该段列表中可以仅包括1个container。与图6所示的段列表相比,图8a所示的段列表总长减少了128比特。由此可见,当SID list中包括不同长度的C-SID时,可以将部分C-SID的长度进一步缩短,从而整个SID list的长度进一步缩短,提高网络效率。当SID list中C-SID数量更多时,该技术效果将更加显著。In some implementations, the segment list includes elements of length 128 bits, and the C-SID of the first length and the C-SID of the second length may be located in the same element in the segment list. In combination with the application scenario shown in FIG. 1, a segment list including C-SIDs of different lengths is shown in FIG. 8a, and the segments executed by network device 1-network device 4 can be identified by a C-SID with a length of 16 bits, that is, C - SID1 to C-SID4; the segment performed by the network device 5 can be represented by a C-SID with a length of 32 bits, ie C-SID5. The segment list can include only 1 container. Compared with the segment list shown in Figure 6, the total length of the segment list shown in Figure 8a 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, so that the length of the entire SID list is further shortened and network efficiency is improved. When the number of C-SIDs in the SID list is larger, the effect of this technique will be more significant.
S702:网络设备101生成第一报文,该第一报文包括对应于第一报文的转发路径的段列表。S702: The network device 101 generates a first packet, where the first packet includes a segment list corresponding to a forwarding path of the first packet.
在本实施例中,作为报文转发路径上的头节点,当网络设备101生成或获取到报文转发路径对应的段列表后,可以在接收的数据报文中封装段列表SID List,以通过该段列表指示该数据报文的转发路径。例如,网络设备101在接收到的数据报文外侧封装IPv6报文头和SRH,以形成SRv6数据报文。即所述第一报文为SRv6数据报文。根据SRv6网络的报文转发机制,网络设备101获得对应于第一报文的转发路径的段列表,将所述段列表封装在所述第一报文中,从而将针对第一报文的处理过程承载在报文中,传递给第一报文的转发路径上的各个网络设备,以使得转发路径上的各个网络设备在接收到第一报文后,依次执行自身相关的报文处理行为。In this embodiment, as the head node on the message forwarding path, after the network device 101 generates or obtains the segment list corresponding to the message forwarding path, it can encapsulate the segment list SID List in the received data message to pass The segment list indicates the forwarding path of the data packet. For example, the network device 101 encapsulates the IPv6 header and the SRH outside the received data packet to form an SRv6 data packet. That is, the first packet is an SRv6 data packet. According to the packet forwarding mechanism of the SRv6 network, the network device 101 obtains a segment list corresponding to the forwarding path of the first packet, and encapsulates the segment list in the first packet, so as to process the first packet. The process is carried in the message and transmitted to each network device on the forwarding path of the first message, so that each network device on the forwarding path executes its own related message processing behavior in sequence after receiving the first message.
在一些实现方式中,第一报文还可以包括扩展指针,以利用该扩展指针依次指示段列表中多个压缩段标识中的每个压缩段标识和/或段标识。其中,扩展指针可以为一维指针或二维指针。在二维指针中,第一维指针,即SL指针,仍然用于在SID list中指示某个具体的元素,而第二维指针,即SI,用于在元素内部进一步指示某个C-SID。在一维指针中,该一维指针,即SI,用于在SID list中指示某个-SID。其中,扩展指针可以位于报文中的SRH中,也可以位于DA字段中。例如,扩展指针可以位于SRH中的特定字段中。例如,也可以将DA字段的最低位字节用于放置SI,以便于硬件实现,且有利于未来方案的扩展。In some implementation manners, the first packet may further include an extension pointer, so as to use the extension pointer to sequentially indicate each compressed segment identifier and/or segment identifier among the multiple compressed segment identifiers in the segment list. The extended pointer may be a one-dimensional pointer or a two-dimensional pointer. In the two-dimensional pointer, the first-dimensional pointer, namely the SL pointer, is still used to indicate a specific element in the SID list, while the second-dimensional pointer, namely the SI, is used to further indicate a certain C-SID inside the element . In a one-dimensional pointer, the one-dimensional pointer, ie SI, is used to indicate a certain -SID in the SID list. Wherein, the extension pointer may be located in the SRH in the message, or may be located in the DA field. For example, the extension pointer may be located in a specific field in the SRH. For example, the least significant byte of the DA field can also be used to place the SI, which is convenient for hardware implementation and facilitates the expansion of future solutions.
其中,扩展指针可以由网络设备101添加至第一报文中,并设置该扩展指针在第一报文中的初始值。当扩展指针为二维指针时,SL指针的初始值被设置为N-1,其中N为SID list中包括的container的数量,SL指针按照递减形式指向每个container。SI的初始值可以被设置为M,M为每个container的长度,即128,SI指针按照递减形式指向container中的比特位。或者,SI的初始值可以被设置为0,按照递增形式指向container中的比特位。当 扩展指针为一维指针时,SI的初始值被配置为N,其中N为SID list中包括的所有G-SID的总长度。其中,关于扩展指针的其他实现细节与以上描述类似,在此不再赘述。所述扩展指针的更新方式将在后续步骤中详细介绍。The extended pointer may be added to the first packet by the network device 101, and the initial value of the extended pointer in the first packet is set. When the extended pointer is a two-dimensional pointer, the initial value of the SL pointer is set to N-1, where N is the number of containers included in the SID list, and the SL pointer points to each container in a decremented form. The initial value of SI can be set to M, where M is the length of each container, that is, 128, and the SI pointer points to the bits in the container in a decremented form. Alternatively, the initial value of SI can be set to 0, pointing to the bits in the container in incrementing form. When the extended pointer is a one-dimensional pointer, the initial value of SI is configured as N, where N is the total length of all G-SIDs included in the SID list. Wherein, other implementation details about the extended pointer are similar to those described above, and are not repeated here. The update method of the extended pointer will be described in detail in the subsequent steps.
在一些实现方式中,网络设备101在封装SRv6数据报文的过程中,还可以在该SRv6数据报文的IPv6报文头的DA字段中放置段列表中C-SID对应的prefix。可选的,网络设备101在封装SRv6数据报文的过程中,可以在DA字段中prefix之后放置段列表中的第一个C-SID。结合图1所示的应用场景和图8a所示的报文结构,网络设备S将prefix放置在DA字段的起始位置,将C-SID 1放置在DA字段中prefix之后,从而DA字段中的内容prefix+C-SID 1还原出SID 1。In some implementation manners, during the process of encapsulating the SRv6 data packet, the network device 101 may also place the prefix corresponding to the C-SID in the segment list in the DA field of the IPv6 packet header of the SRv6 data packet. Optionally, in the process of encapsulating the SRv6 data packet, the network device 101 may place the first C-SID in the segment list after the prefix in the DA field. Combined with the application scenario shown in Figure 1 and the message structure shown in Figure 8a, the network device S places the prefix at the starting position of the DA field, and places the C-SID 1 after the prefix in the DA field, so that the Content prefix+C-SID 1 restores SID 1.
需要说明的是,网络设备101在DA字段中放置SID list中的第一个G-SID之后,可以不更新扩展指针的值,即网络设备101在DA字段中放置SID list中的第一个G-SID之后,所述扩展指针的值仍然为初始值。也就是说,对于第一报文来说,所述扩展指针指向的SID list中的G-SID即为DA字段中包括的G-SID。以所述二维指针为例,结合图1所示的应用场景和图8a所示的报文结构,网络设备S在所述第二报文的DA字段中放置C-SID 1,而所述第二报文中SL指针的值仍为初始值0,SI的值仍为初始值0或127。其中SI的取值范围为0-127,用于指示每个比特位。It should be noted 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 may not be updated, that is, the network device 101 places the first G-SID in the SID list in the DA field After -SID, the value of the extended pointer is still the initial value. That is, for 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. Taking the two-dimensional pointer as an example, in combination with the application scenario shown in FIG. 1 and the message structure shown in FIG. 8a, the network device S places C-SID 1 in the DA field of the second message, and the The value of the SL pointer in the second packet is still the initial value of 0, and the value of the SI is still the initial value of 0 or 127. The value range of SI is 0-127, which is used to indicate each bit.
在一些实现方式中,网络设备101在DA字段中放置段列表中的第一G-SID之后,可以更新扩展指针的值,即网络设备101在DA字段中放置段列表中的第一G-SID之后,将扩展指针的值增加第一G-SID长度。即,扩展指针指向段列表中第二G-SID。In some implementations, after the network device 101 places the first G-SID in the segment list in the DA field, the value of the extended pointer may be updated, that is, the network device 101 places the first G-SID in the segment list in the DA field After that, the value of the extension pointer is increased by the first G-SID length. That is, the extension pointer points to the second G-SID in the segment list.
对于传统的SRv6网络来说,SID list仅由SID组成,在报文转发过程中,网络设备将报文SRH中的SL字段的值减1,并将segment list[SL]拷贝至IPv6头的DA字段中,即对DA字段的内容进行更新。当SID list中还包括C-SID时,为了兼容上述SRv6网络中的报文转发过程,网络设备对DA字段的更新方式将发生变化。For a traditional SRv6 network, the SID list only consists of SIDs. During packet forwarding, the network device decrements the value of the SL field in the packet SRH by 1, and copies the segment list[SL] to the DA of the IPv6 header. field, that is, update the content of the DA field. When the C-SID is also included in the SID list, in order to be compatible with the packet forwarding process in the above-mentioned SRv6 network, the update method of the DA field by the network device will change.
可选的,网络设备需要获知下一个压缩SID的起始位置,并从起始位置开始按照编码规则读取node ID和function ID,将二者合并得到下一个压缩SID,利用该压缩SID更新DA字段。结合图1所示应用场景为例,全网配置的初始长度为3bit,增量长度为3bit。网络设备1的locator为FFFF:001X::/19,其中FFFF为prefix部分,长度为16比特,001为二进制形式的node ID,长度为3比特,即prefix部分和node id的长度之和为19比特,X代表全零的占位符,位于node id之后。SID为FFFF:001001X::,长度为128比特,其中FFFF为prefix部分,长度为16比特,001为二进制形式的node ID,长度为3比特,001为二进制形式的function ID,长度为3比特,X代表全零的占位符,位于function ID之后,压缩SID为001001。网络设备2的locator为FFFF:100001X::/22,其中FFFF为prefix部分,长度为16比特,100001为二进制形式的node ID,长度为6比特,即prefix部分和node id的长度之和为22比特,X代表全零的占位符,位于node id之后。SID为FFFF:100001110010011X::,长度为128比特,其中FFFF为prefix部分,长度为16比特,100001为二进制形式的node ID,长度为6比特,110010011为二进制形式的function ID,长度为9比特,X代表全零的占位符,位于function ID之后,压缩SID为100001110010011。 入包的DA为FFFF:001001X::20,SID list为[Y001001100001110010011Y],其中,Y标识其他内容,例如其它网络设备对应的SID。,20为16进制形式的指针,即指向长度为128比特的元素中的第32个比特位。当网络设备1接收到网络设备S发送的报文后,网络设备1执行FFFF:001001X的功能,同时网络设备1根据自身对应的SID的长度(6个比特)移动SI指针至下一个压缩SID(网络设备2对应的SID)的起始位置26,该26(16进制形式)表示指针指向长度为128比特的元素中第38个比特位,则网络设备1从指针指示的位置开始,按照node ID的编码规则,先读取1个1和1个0,再读取3+1*3-1-1位为0001,得到node ID编码100001;然后,按照function ID的编码规则,再读取2个1和1个0,继续读取3+2*3-2-1位为010011,得到function ID为110010011,将node ID和function ID合并得到100001110010011,将其替换到DA上得到FFFF:100001110010011X:26。Optionally, the network device needs to know the starting position of the next compressed SID, read the node ID and function ID according to the coding rules from the starting position, combine the two to obtain the next compressed SID, and use the compressed SID to update the DA. field. Taking the application scenario shown in Figure 1 as an example, the initial length of the entire network configuration is 3 bits, and the incremental length is 3 bits. The locator of network device 1 is FFFF:001X::/19, where FFFF is the prefix part with a length of 16 bits, and 001 is a binary node ID with a length of 3 bits, that is, the sum of the length of the prefix part and the node id is 19 Bit, X represents a placeholder for all zeros, after the node id. The SID is FFFF:001001X::, the length is 128 bits, FFFF is the prefix part, the length is 16 bits, 001 is the node ID in binary form, the length is 3 bits, 001 is the function ID in binary form, the length is 3 bits, X stands for an all-zero placeholder after the function ID, and the compressed SID is 001001. The locator of network device 2 is FFFF:100001X::/22, where FFFF is the prefix part with a length of 16 bits, 100001 is a binary node ID with a length of 6 bits, that is, the sum of the length of the prefix part and the node id is 22 Bit, X represents a placeholder for all zeros, after the node id. SID is FFFF:100001110010011X::, the length is 128 bits, FFFF is the prefix part, the length is 16 bits, 100001 is the node ID in binary form, the length is 6 bits, 110010011 is the function ID in binary form, the length is 9 bits, X stands for an all-zero placeholder after the function ID, and the compressed SID is 100001110010011. The incoming DA is FFFF:001001X::20, and the SID list is [Y001001100001110010011Y], where Y identifies other content, such as the SIDs corresponding to other network devices. , 20 is a pointer in hexadecimal form, that is, it points to the 32nd bit in an element with a length of 128 bits. After the network device 1 receives the message sent by the network device S, the network device 1 executes the function of FFFF:001001X, and at the same time, the network device 1 moves the SI pointer to the next compressed SID (6 bits) according to the length of its corresponding SID (6 bits). The starting position 26 of the SID corresponding to the network device 2), the 26 (hexadecimal form) indicates that the pointer points to the 38th bit in the element with a length of 128 bits, then the network device 1 starts from the position indicated by the pointer, according to the node ID encoding rules, first read 1 1 and 1 0, then read 3+1*3-1-1 bits as 0001, get the node ID code 100001; then, according to the function ID encoding rules, read 2 1s and 1 0, continue to read 3+2*3-2-1 bits as 010011, get the function ID as 110010011, merge the node ID and function ID to get 100001110010011, replace it on DA to get FFFF: 100001110010011X :26.
S703:网络设备101根据段列表发送第一报文。S703: The network device 101 sends the first packet according to the segment list.
本实施例中,当网络设备101生成第一报文后,根据段列表所指示的转发路径对该第一报文进行转发。具体地,网络设备101根据第一报文的IPv6报文头中的DA字段确定下一跳网络网络设备,进而将第一报文发送给下一跳网络设备。结合图1所示的应用场景和图8a所示的报文结构,作为所述转发路径的头节点,网络设备S已经将prefix和SID list中的C-SID 1放置在第一报文的DA字段中,网络设备S可以根据第一报文的DA字段中的内容prefix+C-SID 1还原出SID 1,网络设备S根据SID 1查找本地转发表项,确定下一跳网络设备为网络设备1,将该第一报文向网络设备1发送。报文转发路径上的endpoint node依次接收上一跳网络设备发送的报文,并根据段列表更新DA字段的内容,再根据DA字段的内容转发报文,从而报文沿段列表对应的转发路径发送出去。In this embodiment, after the network device 101 generates the first packet, it forwards the first packet according to the forwarding path indicated by the segment list. Specifically, the network device 101 determines the next-hop network device according to the DA field in the IPv6 header of the first packet, and then sends the first packet to the next-hop network device. Combined with the application scenario shown in Figure 1 and the message structure shown in Figure 8a, as the head node of the forwarding path, the network device S has placed the C-SID 1 in the prefix and the SID list in the DA of the first message. In the field, the network device S can restore the SID 1 according to the content prefix+C-SID 1 in the DA field of the first message, and the network device S searches for the local forwarding entry according to the SID 1, and determines that the next hop network device is the network device 1. Send the first packet to the network device 1. The endpoint node on the packet forwarding path receives the packets sent by the previous hop network device in turn, updates the content of the DA field according to the segment list, and then forwards the packet according to the content of the DA field, so that the packet follows the forwarding path corresponding to the segment list. send out.
S704:网络设备102接收第一报文。S704: The network device 102 receives the first packet.
本实施例中,网络设备102可以接收上一跳网络设备发送的第一报文,该网络设备102为报文转发路径上除头节点以外的endpoint node。例如,网络设备102可以是图1所示应用场景中的网络设备1至5。当网络设备102为图1所示的网络设备1时,网络设备1接收到的第一报文为网络设备S发出的报文,即网络设备S封装SID list后的SRv6数据报文,当网络设备102为图1所示的网络设备2至5时,网络设备2至5接收到的第一报文为上一跳网络设备更新后的SRv6数据报文。In this embodiment, the network device 102 may receive the first packet sent by the previous-hop network device, where the network device 102 is an endpoint node other than the head node on the packet forwarding path. For example, the network device 102 may be the network devices 1 to 5 in the application scenario shown in FIG. 1 . When the network device 102 is the network device 1 shown in FIG. 1 , the first packet received by the network device 1 is the packet sent by the network device S, that is, the SRv6 data packet after the network device S encapsulates the SID list. When the device 102 is the network devices 2 to 5 shown in FIG. 1 , the first packets received by the network devices 2 to 5 are the SRv6 data packets updated by the previous hop network device.
S705:网络设备102根据编码规则在段列表中读取待拷贝内容。S705: The network device 102 reads the content to be copied from the segment list according to the encoding rule.
本实施例中,网络设备102在接收到第一报文后,可以根据编码规则从段列表中读取待拷贝内容,以利用该待拷贝内容更新第一报文中的目的地DA以及利用该压缩段标识确定下一跳网络设备。其中,待拷贝内容为网络设备102更新至第一报文的DA字段的压缩段标识。In this embodiment, after receiving the first packet, the network device 102 can read the content to be copied from the segment list according to the encoding rule, so as to use the content to be copied to update the destination DA in the first packet and use the content to be copied. The compressed segment identifier determines the next hop network device. The content to be copied is the compressed segment identifier updated by the network device 102 to the DA field of the first packet.
其中,网络设备102根据编码规则在段列表中读取待拷贝内容,可以通过以下两个步骤实现:Wherein, the network device 102 reads the content to be copied in the segment list according to the encoding rule, which can be implemented by the following two steps:
1)网络设备102确定起始位置,该起始位置用于指示待拷贝内容对应的起始位置。1) The network device 102 determines the starting position, where the starting position is used to indicate the starting position corresponding to the content to be copied.
当第一报文中包括扩展指针时,网络设备102可以利用该扩展指针确定待拷贝内容在段列表中的起始位置。具体地,如果扩展指针的值在网络设备101在DA字段中放置SID list 中的第一个G-SID之后未更新,此时扩展指针指向第一个G-SID。该情况下,网络设备102根据自身对应的压缩段标识的长度更新扩展指针的值,从而使得更新后的扩展指针的值对应第二个G-SID,即待拷贝内容在段列表中的起始位置。需要说明的是,段列表中可以包括不同长度的压缩段标识,网络设备102更新扩展指针的值也不相同,例如,当网络设备102为网络设备1时,其对应的压缩段标识的长度为16比特,则将扩展指针偏移16比特长度;当网络设备102为网络设备5时,其对应的压缩段标识的长度为32比特,则将扩展指针偏移32比特长度。When the first packet includes an extension pointer, the network device 102 may use the extension pointer to determine the starting position of the content to be copied in the segment list. Specifically, if the value of the extension pointer is not updated after the network device 101 places the first G-SID in the SID list in the DA field, the extension pointer points to the first G-SID at this time. In this case, the network device 102 updates the value of the extension pointer according to the length of its corresponding compressed segment identifier, so that the value of the updated extension pointer corresponds to the second G-SID, that is, the start of the content to be copied in the segment list Location. It should be noted that the segment list may include compressed segment identifiers of different lengths, and the value of the extension pointer updated by the network device 102 is also different. For example, when the network device 102 is the network device 1, the length of the corresponding compressed segment identifier is 16 bits, the extension pointer is offset by 16 bits; when the network device 102 is network device 5, and the length of the corresponding compressed segment identifier is 32 bits, the extension pointer is offset by 32 bits.
当扩展指针分别为一维指针或二维指针时,所述扩展指针的值的调整过程有所不同。When the extended pointer is a one-dimensional pointer or a two-dimensional pointer, the adjustment process of the value of the extended pointer is different.
当扩展指针为所述二维指针时,所述扩展指针的调整过程包括:网络设备102根据自身对应的压缩段标识的长度确定SI的值,以使得SI的值用于指示待拷贝内容在长度为128比特的元素中的位置。具体的,网络设备102读取第一报文的报文头中SI的原始值,将SI的原始值减去更新值,以获得SI的值。即,更新值对应的长为SI偏移的长度,该更新值对应的长度为网络设备102对应的G-SID的长度。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 of its corresponding compressed segment identifier, so that the value of SI is used to indicate the length of the content to be copied. is the position in the 128-bit element. Specifically, the network device 102 reads the original value of SI in the header of the first packet, and subtracts the updated value from the original value of SI to obtain the value of SI. That is, the length corresponding to the update value is the length of the SI offset, and the length corresponding to the update value is the length of the G-SID corresponding to the network device 102 .
在一些实现方式中,更新值可以为本地G-SID的长度除以单位长度所得的值。也就是说,更新值对应的长度为单位长度的整数倍,即SI偏移的长度是单位长度的整数倍。例如,当单位长度为16比特时,所述本地段标识指示的长度为16比特,则更新值为1,本地段标识指示的长度为32比特,则更新值为2。In some implementations, the update value may be a value obtained by dividing the length of the local G-SID by the unit length. That is, the length corresponding to the update value is an integral multiple of the unit length, that is, the length of the SI offset is an integral multiple of the unit length. For example, when the unit length is 16 bits, and the length indicated by the local segment identifier is 16 bits, the update value is 1, and the length indicated by the local segment identifier is 32 bits, and the update value is 2.
进而,网络设备102根据SI的值确定待拷贝内容在长度为128比特的元素中的位置,并根据SL指针的值确定元素在SID list中的位置。值得注意的是,在此过程中,可能需要调整SL指针的值。并且,在调整SL指针的值之后,可能需要将SI的值设置为初始值。例如,当所述本地C-SID为元素中的最后一个C-SID时,即,本地C-SID在所述SID list中的下一个C-SID将位于下一个元素中,此时需要调整SL指针的值,以使得SL指针指向所述下一个元素,并设置SI的值为初始值,以使得SI指向所述下一个元素中的第一个比特位。或者,当SI偏移后指向当前元素中的padding部分时,例如,SI的值为111,指向第112个比特,而该元素中剩余16比特为全0时,或者SI的值为95,指向第96个比特,而该元素中剩余32比特为全0时,此时需要调整SL指针的值,以使得SL指针指向所述下一个元素。Further, 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 the SL pointer. It is worth noting that during this process, the value of the SL pointer may need to be adjusted. Also, after adjusting the value of the SL pointer, it may be necessary to set the value of SI to the initial value. For example, when the local C-SID is the last C-SID in the element, that is, the next C-SID of the local C-SID in the SID list will be in the next element, and the SL needs to be adjusted at this time The value of the pointer is set so that the SL pointer points to the next element, and the value of SI is set to the initial value, so that the SI points to the first bit in the next element. Or, when the SI offset points to the padding part of the current element, for example, the value of SI is 111, pointing to the 112th bit, and the remaining 16 bits in the element are all 0, or the value of SI is 95, pointing to When the 96th bit and the remaining 32 bits in the element are all 0s, the value of the SL pointer needs to be adjusted so that the SL pointer points to the next element.
当扩展指针为一维指针时,扩展指针的调整过程包括:网络设备102根据本地段标识指示的长度确定SI的值,以使得SI的值用于指示待拷贝内容在SID list中的位置。具体的,网络设备102读取第一报文的报文头中SI的原始值,将SI的原始值减去更新值,以获得SI的值。其中SI的更新值与以上描述相似,在此不再赘述。When the extended pointer is a 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. Specifically, the network device 102 reads the original value of SI in the header of the first packet, and subtracts the updated value from the original value of SI to obtain the value of SI. The update value of SI is similar to the above description, and will not be repeated here.
在一些实现方式中,网络设备102将所述扩展指针的值写入所述第一报文中。即更新后的所述第一报文的报文头中,也即后续介绍的第二报文的报文头中,包括扩展指针的值。In some implementations, the network device 102 writes the value of the extended pointer into the first packet. That is, the updated message header of the first message, that is, the message header of the second message described later, includes the value of the extended pointer.
如果扩展指针的值在网络设备101在DA字段中放置段列表中的第一个G-SID之后进行更新,此时扩展指针指向第二个G-SID。即,此时扩展指针的值对应待拷贝内容在段列表中的起始位置。If the value of the extension pointer is updated after the network device 101 places the first G-SID in the segment list in the DA field, the extension pointer now points to the second G-SID. That is, the value of the extension pointer at this time corresponds to the starting position of the content to be copied in the segment list.
2)网络设备102根据编码规则以及起始位置确定待拷贝内容的长度。2) The network device 102 determines the length of the content to be copied according to the encoding rule and the starting position.
网络设备102在确定出起始位置后,可以根据编码规则以及起始位置确定待拷贝内容的长度,即获得待拷贝内容。After determining the starting position, the network device 102 may determine the length of the content to be copied according to the encoding rule and the starting position, that is, obtain the content to be copied.
具体地,网络设备102获得第一参数集合和/或第二参数集合,该第一参数集合包括节点标识对应的第一初始长度和第一增量长度,第二参数集合包括功能标识对应的第二初始长度和第二增量长度;网络设备102根据编码规则、第一参数集合和/或第二参数集合以及起始位置确定待拷贝内容的长度。其中,第一初始长度和第一增量长度可以均为8比特的倍数,和/或,第二初始长度和第二增量长度可以均为8比特的倍数。该待拷贝内容的长度与扩充的次数i或j有关,具体可以通过以下步骤确定:Specifically, the network device 102 obtains a first parameter set and/or a second parameter set, where the first parameter set includes the first initial length and the first incremental length corresponding to the node identifier, and the second parameter set includes the first parameter set corresponding to the function identifier. 2. The initial length and the second incremental length; the network device 102 determines the length of the content to be copied according to the encoding rule, the first parameter set and/or the second parameter set, and the starting position. Wherein, both the first initial length and the first increment length may be multiples of 8 bits, and/or both the second initial length and the second increment length may be multiples of 8 bits. The length of the content to be copied is related to the number of expansions i or j, which can be specifically determined by the following steps:
1)网络设备102从起始位置向后读取N个比特位,该N个比特位中前i个比特位为1,第i+1个比特位为0或者所述N个比特位中前i个比特位为0,第i+1个比特位为1。1) The network device 102 reads N bits backward from the starting position, the first i bit in the N bits is 1, and the i+1th bit is 0 or the first among the N bits. The i bits are 0, and the i+1th bit is 1.
2)第二网络设备102继续向后读取M个比特位,M=第一初始长度+i*第一增量长度-i-1,并将N+M个比特作为待拷贝内容中的节点标识的长度。2) The second network device 102 continues to read M bits backward, M=first initial length+i*first increment length-i-1, and uses N+M bits as a node in the content to be copied The length of the ID.
其中,i的取值也可以表示节点标识进行扩充的次数。Among them, the value of i can also represent the number of times that the node identifier is expanded.
3)网络设备102继续向后读取P个比特位,该P个比特位中前j个比特位为1,第j+1个比特位为0,或者所述P个比特位中前j个比特位为0,第j+1个比特位为1。3) The network device 102 continues to read P bits backward, the first j bits in the P bits are 1, the j+1th bit is 0, or the first j among the P bits The bit is 0, and the j+1th bit is 1.
4)网络设备102继续后读取Q个比特位,该Q=第二初始长度+j*第二增量长度-j-1个比特位,并将P+Q个比特作为待拷贝内容中的功能标识的长度。4) After the network device 102 continues to read Q bits, the Q=second initial length+j*second increment length−j−1 bits, and uses P+Q bits as the content to be copied. The length of the feature ID.
其中,j的取值也可以表示功能标识进行扩充的次数。The value of j may also represent the number of times the function identifier is expanded.
5)网络设备102根据待拷贝内容中的节点标识的长度和待拷贝内容中的功能标识的长度获得待拷贝内容的长度。5) The network device 102 obtains the length of the content to be copied according to the length of the node identifier in the content to be copied and the length of the function identifier in the content to be copied.
例如,图8b所示的段列表,第二网络设备的压缩段标识为“001001”,在更新扩展指针之前,该扩展指针指向第二网络设备的压缩段标识的第一个比特位“0”,由于第二网络设备的压缩段标识的长度为6,则将扩展指针后移6个比特位,指向待拷贝内容的第一个比特位。第二网络设备从扩展指针所指向的位置向后读取“10”,其为节点标识对应编码中的前缀部分,通过该前缀部分可以获知N=(i+1)=2,i=1,则继续读取M=(3+i*3-i-1)=4个比特位“0001”,则读取长度为6比特的节点标识100001。第二网络设备继续向后读取比特位“110”,其为功能标识对应编码中的前缀部分,通过该前缀部分可以获知P=(j+1)=3,j=2,再继续向后读取Q=3+3*j-j-1=6个比特位“010011”,则读取长度为9比特的功能标识“110010011”,则获取的待拷贝内容为“100001110010011”。For example, in the segment list shown in Fig. 8b, the compressed segment identifier of the second network device is "001001", and before the extended pointer is updated, the extended pointer points to the first bit "0" of the compressed segment identifier of the second network device , since the length of the compressed segment identifier of the second network device is 6, the extension pointer is moved backward by 6 bits to point to the first bit of the content to be copied. The second network device reads "10" backwards from the position pointed to by the extension pointer, which is the prefix part in the code corresponding to the node identifier, and through the prefix part, it can be known that N=(i+1)=2, i=1, Then continue to read M=(3+i*3-i-1)=4 bits "0001", then read the node identifier 100001 with a length of 6 bits. The second network device continues to read the bit "110" backwards, which is the prefix part in the coding corresponding to the function identifier, through which it can be learned that P=(j+1)=3, j=2, and then continues backwards Read Q=3+3*j-j-1=6 bits "010011", then read the function identifier "110010011" with a length of 9 bits, then the acquired content to be copied is "100001110010011".
在一种可能的实现方式中,网络设备102在根据编码规则获取待拷贝内容之前,可以判断第一报文中的DA字段中的C-SID或SID值与本地段标识SID是否相同,如果相同,则执行S706的操作。In a possible implementation manner, before acquiring the content to be copied according to the encoding rule, the network device 102 can determine whether the C-SID or SID value in the DA field in the first packet is the same as the local segment identifier SID, if they are the same , the operation of S706 is performed.
S706:网络设备102根据待拷贝内容更新第一报文中的目的地址DA,以生成第二报文。S706: The network device 102 updates the destination address DA in the first packet according to the content to be copied, so as to generate a second packet.
本实施例中,当网络设备102获得待拷贝内容后,利用该待拷贝内容更新第一报文中的目的地址DA的内容,将包括更新后的DA的报文作为第二报文。In this embodiment, after obtaining the content to be copied, the network device 102 uses the content to be copied to update the content of the destination address DA in the first message, and uses the message including the updated DA as the second message.
在一些实现方式中,当待拷贝内容对应的前缀部分与当前DA字段中的前缀部分相同 时,网络设备102可以直接利用待拷贝内容更新DA字段中除前缀部分之外的信息,从而获得更新后的DA字段。In some implementations, when the prefix part corresponding to the content to be copied is the same as the prefix part in the current DA field, the network device 102 can directly use the content to be copied to update the information in the DA field except the prefix part, so as to obtain the updated information DA field.
S707:网络设备102发送第二报文。S707: The network device 102 sends the second packet.
本实施例中,网络设备102可以根据第二报文中DA字段的内容,确定下一跳网络设备,并将该第二报文发送给该下一跳网络设备。例如,当网络设备102为网络设备1时,第二报文的DA字段中的prefix+C-SID 2还原出SID 2,网络设备1根据SID 2查找本地转发表项,确定下一跳网络设备为网络设备2,将第二报文发送给网络设备2。当网络设备102为网络设备2至5时,网络设备102根据所述目的地址字段的内容发送所述第二报文的过程以此类推,在此不再赘述。In this embodiment, the network device 102 may determine the next-hop network device according to the content of the DA field in the second packet, and send the second packet to the next-hop network device. For example, when the network device 102 is the network device 1, the prefix+C-SID 2 in the DA field of the second packet restores the SID 2, and the network device 1 searches the local forwarding entry according to the SID 2 to determine the next hop network device For the network device 2, the second packet is sent to the network device 2. When the network device 102 is the network devices 2 to 5, the process of sending the second packet by the network device 102 according to the content of the destination address field is analogous, and details are not repeated here.
在实际应用中,网络设备还可以通过以下方式更新DA字段,在该实现方式中,在C-SID或SID中可以承载压缩持续(continue of compression,COC)信息,该COC信息用于指示SID list中C-SID是否继续排列。在当前DA字段中的C-SID包括COC信息时,表明下一个待处理C-SID与DA字段中的C-SID对应相同的前缀prefix,将下一个待处理的C-SID拷贝至DA字段中的prefix之后,下一个待处理的C-SID与prefix还原出下一个SID。在当前DA字段中的C-SID不包括COC消息时,表明前缀将发生变化。网络设备采用标准的处理方式,将128比特的SID拷贝至DA字段中。在该SID包括COC信息时,表明下一个待处理的C-SID与该SID对应相同的prefix,则网络设备只需将下一个待处理的C-SID拷贝至DA字段中的prefix之后,下一个待处理的C-SID与prefix还原下一个SID。In practical applications, the network device may also update the DA field in the following manner. In this implementation manner, the C-SID or SID may carry the continue of compression (COC) information, and the COC information is used to indicate the SID list Whether the C-SID continues to be arranged. When the C-SID in the current DA field includes COC information, it indicates that the next C-SID to be processed corresponds to the same prefix as the C-SID in the DA field, and the next C-SID to be processed is copied to the DA field After the prefix, the next C-SID to be processed and the prefix restore the next SID. When the C-SID in the current DA field does not include the COC message, it indicates that the prefix will change. The network device uses the standard processing method to copy the 128-bit SID into the DA field. When the SID includes COC information, it indicates that the next C-SID to be processed corresponds to the same prefix as the SID, and the network device only needs to copy the next C-SID to be processed after the prefix in the DA field, and the next The pending C-SID and prefix restore the next SID.
可选的,上述COC信息可以是SID或C-SID的属性,也称为COC属性。Optionally, the above COC information may be an attribute of SID or C-SID, also referred to as COC attribute.
为便于理解本申请例提供的技术方案,参见图9所示的方法流程图。该方法涉及第一网络设备获取段列表的实现过程,该方法可以包括:To facilitate understanding of the technical solutions provided by the examples of this application, please refer to the method flowchart shown in FIG. 9 . The method relates to an implementation process of acquiring a segment list by the first network device, and the method may include:
S901:第一网络设备确定报文的转发路径。S901: The first network device determines the forwarding path of the packet.
S902:第一网络设备生成对应于转发路径的段列表。S902: The first network device generates a segment list corresponding to the forwarding path.
其中,段列表包括依次排列的多个压缩段标识,该多个压缩段标识中的每个压缩段标识的长度小于等于128比特,该多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,第一长度和第二长度不同,该多个压缩段标识中每个压缩段标识包括前缀码。The segment list includes multiple compressed segment identifiers arranged in sequence, each of the multiple compressed segment identifiers has a length of less than or equal to 128 bits, and the multiple compressed segment identifiers include a compressed segment identifier of a first length and The compressed segment identifier of the second length, the first length is different from the second length, and each compressed segment identifier of the plurality of compressed segment identifiers includes a prefix code.
在一种实现方式中,所述每个压缩段标识包括可变长度部分,所述第一长度的压缩段标识的可变长度部分的长度与所述第二长度的压缩段标识的可变长度部分的长度不同,所述可变长度部分包括所述前缀码,所述可变长度部分的长度根据所述可变长度部分的编码规则确定。In an implementation manner, each compressed segment identifier includes a variable length portion, and the length of the variable length portion of the compressed segment identifier of the first length is the same as the variable length of the compressed segment identifier of the second length. The lengths of the parts are different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
具体地,第一网络设备可以为图1对应实施例的网络设备S,该网络设备S可以为SRv6网络的入口设备,第一网络设备在生成对应于转发路径的段列表后,可以生成包括段列表的报文。或者,第一网络设备也可以为网络中的控制器,在该情形下,第一网络设备向转发路径的入口设备发送段列表,由入口设备根据段列表生成第一报文。关于第一网络设备确定转发路径以及生成段列表的具体实现可以参见S701的详细描述,本实施例在此不再赘述。Specifically, the first network device may be the network device S in the embodiment corresponding to FIG. 1 , and the network device S may be an ingress device of the SRv6 network. After generating the segment list corresponding to the forwarding path, the first network device may generate a segment list including segments list of messages. Alternatively, the first network device may also be a controller in the network. In this case, the first network device sends the segment list to the ingress device of the forwarding path, and the ingress device generates the first packet according to the segment list. For the specific implementation of determining the forwarding path and generating the segment list by the first network device, reference may be made to the detailed description of S701, and details are not described herein again in this embodiment.
基于上述方法实施例,本申请实施例提供了一种报文传输装置,下面将结合附图进行说明。Based on the foregoing method embodiments, the embodiments of the present application provide a message transmission device, which will be described below with reference to the accompanying drawings.
图10为本申请实施例提供的一种报文传输装置结构图,该装置1000,包括:接收单元1001、处理单元1002和发送单元1003。FIG. 10 is a structural diagram of a message transmission apparatus provided by an embodiment of the present application. The apparatus 1000 includes: a receiving unit 1001 , a processing unit 1002 , and a sending unit 1003 .
接收单元1001,用于接收所述第一网络设备发送的第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中每个压缩段标识的长度小于等于128比特。关于接收单元1001的实现可以参见S705的详细描述。A receiving unit 1001, configured to receive a first packet sent by the first network device, where the first packet includes a segment list corresponding to a forwarding path of the first packet, and the segment list includes sequentially arranged Multiple compressed segment identifiers, each of the multiple compressed segment identifiers has a length of less than or equal to 128 bits. For the implementation of the receiving unit 1001, reference may be made to the detailed description of S705.
处理单元1002,用于根据编码规则在所述段列表中读取待拷贝内容,所述编码规则用于指示所述待拷贝内容对应的编码规则。关于处理单元1002的实现可以参见S706的相关描述。The processing unit 1002 is configured to read the content to be copied in the segment list according to an encoding rule, where the encoding rule is used to indicate an encoding rule corresponding to the content to be copied. For the implementation of the processing unit 1002, reference may be made to the relevant description of S706.
所述处理单元1002,还用于根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文。关于处理单元1002的具体实现可以参见S707的相关描述。The processing unit 1002 is further configured to update the destination address DA in the first packet according to the content to be copied, so as to generate a second packet. For the specific implementation of the processing unit 1002, reference may be made to the relevant description of S707.
发送单元1003,用于发送所述第二报文。关于发送单元1003的具体实现可以参见S707的相关描述。A sending unit 1003, configured to send the second packet. For the specific implementation of the sending unit 1003, reference may be made to the relevant description of S707.
参见图11,该图为本申请实施例提供的另一种报文传输装置结构图,该装置1100,包括:处理单元1101和发送单元1102。Referring to FIG. 11 , which is a structural diagram of another message transmission apparatus provided by an embodiment of the present application, the apparatus 1100 includes: a processing unit 1101 and a sending unit 1102 .
处理单元1101,用于生成第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码。关于处理单元1101的具体实现可以参见S703的相关描述。The processing unit 1101 is configured to generate a first packet, where the first packet includes a segment list corresponding to a forwarding path of the first packet, the segment list includes a plurality of compressed segment identifiers arranged in sequence, and the The length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bits, and the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, and the first length and The second lengths are different, and each of the plurality of compressed segment identifiers includes a prefix code. For the specific implementation of the processing unit 1101, reference may be made to the relevant description of S703.
发送单元1102,用于根据所述段列表发送所述第一报文。关于发送单元1102的具体实现可以参见S704的相关描述。The sending unit 1102 is configured to send the first packet according to the segment list. For the specific implementation of the sending unit 1102, reference may be made to the relevant description of S704.
参见图12,该图为本申请实施例提供的一种段列表生成装置结构图,所述装置1200包括:处理单元1201。Referring to FIG. 12 , which is a structural diagram of an apparatus for generating a segment list provided by an embodiment of the present application, the apparatus 1200 includes: a processing unit 1201 .
处理单元1201,用于确定报文的转发路径。The processing unit 1201 is configured to determine the forwarding path of the packet.
所述处理单元1201,还用于生成对应于所述转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码。关于处理单元1101的具体实现可以参见S701-S702的相关描述。The processing unit 1201 is further configured to generate a segment list corresponding to the forwarding path, where the segment list includes multiple compressed segment identifiers arranged in sequence, and the length of each compressed segment identifier in the multiple compressed segment identifiers less than or equal to 128 bits, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the second length are different, the multiple compressed segment identifiers Each compressed segment identifier in includes a prefix code. For the specific implementation of the processing unit 1101, reference may be made to the relevant descriptions of S701-S702.
参见图13,该图为本申请实施例提供的一种压缩段标识获取装置结构图,所述装置1200包括:处理单元1301和发送单元1302。Referring to FIG. 13 , which is a structural diagram of an apparatus for obtaining a compressed segment identifier according to an embodiment of the present application, the apparatus 1200 includes: a processing unit 1301 and a sending unit 1302 .
处理单元1301,用于获得第一长度的压缩段标识,所述第一长度的压缩段标识包括第一可变长度部分,所述第一可变长度部分属于第一资源池,所述第一资源池包括多个所述第一可变长度部分。关于处理单元1301的具体实现可以参见S401的相关描述。The processing unit 1301 is configured to obtain a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable-length part, the first variable-length part belongs to a first resource pool, and the first The resource pool includes a plurality of said first variable length portions. For the specific implementation of the processing unit 1301, reference may be made to the relevant description of S401.
所述处理单元1301,还用于基于所述第一资源池的资源不足,获得第二长度的压缩段标识,所述第二长度大于等于所述第一长度,所述第二长度的压缩段标识包括第二可变长度部分,所述第二可变长度部分属于第二资源池,所述第二资源池包括多个所述第二可变长度部分。关于处理单元1301的具体实现可以参见S402的相关描述。The processing unit 1301 is further configured to obtain a compressed segment identifier of a second length based on insufficient resources of the first resource pool, where the second length is greater than or equal to the first length, and a compressed segment of the second length is The identification includes a second variable length portion, the second variable length portion belongs to a second resource pool, the second resource pool includes a plurality of the second variable length portions. For the specific implementation of the processing unit 1301, reference may be made to the relevant description of S402.
发送单元1302,用于发送所述第一长度的压缩段标识和所述第二长度的压缩段标识,所述第一长度的压缩段标识和所述第二长度的压缩段标识用于指示所述第一网络设备所执行的段。关于发送单元1303的具体实现可以参见S403的相关描述。The sending unit 1302 is configured to send the compressed segment identifier of the first length and the compressed segment identifier of the second length, where the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the Describe the segment executed by the first network device. For the specific implementation of the sending unit 1303, reference may be made to the relevant description of S403.
另外,本申请实施例还提供了一种通信系统,所述系统包括:第一网络设备和第二网络设备;其中,第一网络设备,可以执行的操作可以参见图9所示实施例中第一网络设备的相关描述;第二网络设备,可以执行的操作可以参见图9所示实例中第二网络设备的相关描述。In addition, an embodiment of the present application further provides a communication system, the system includes: a first network device and a second network device; wherein, the operations that can be performed by the first network device may refer to the first network device in the embodiment shown in FIG. 9 . For the related description of a network device; for the operations that can be performed by the second network device, refer to the related description of the second network device in the example shown in FIG. 9 .
图14为本申请实施例提供的一种网络设备的结构示意图,该网络设备例如可以是图9所示实施例中的第一网络设备或第二网络设备,或者也可以是图10所示实施例中装置1000、图11所示实施例中装置1100、图12所示实施例中的装置1200以及图13所示实施例中的装置1300的设备实现。FIG. 14 is a schematic structural diagram of a network device according to an embodiment of the present application. For example, the network device may be the first network device or the second network device in the embodiment shown in FIG. 9 , or may also be the implementation shown in FIG. 10 . The apparatus 1000 in the example, the apparatus 1100 in the embodiment shown in FIG. 11 , the apparatus 1200 in the embodiment shown in FIG. 12 , and the apparatus 1300 in the embodiment shown in FIG. 13 are implemented by equipment.
请参阅图14所示,网络设备1400至少包括处理器1410。网络设备1400还可以包括通信接口1420和存储器1430。其中网络设备1400中的处理器1410的数量可以一个或多个,图14中以一个处理器为例。本申请实施例中,处理器1410、通信接口1420和存储器1430可通过总线系统或其它方式连接,其中,图14中以通过总线系统1440连接为例。Referring to FIG. 14 , the network device 1400 includes at least a processor 1410 . Network device 1400 may also include communication interface 1420 and memory 1430 . The number of processors 1410 in the network device 1400 may be one or more, and one processor is taken as an example in FIG. 14 . In this embodiment of the present application, the processor 1410, the communication interface 1420, and the memory 1430 may be connected through a bus system or other manners, wherein the connection through the bus system 1440 is taken as an example in FIG. 14 .
处理器1410可以是CPU、NP、或者CPU和NP的组合。处理器1410还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。 Processor 1410 may be a CPU, NP, or a combination of CPU and NP. The processor 1410 may further include hardware chips. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general-purpose array logic (generic array logic, GAL) or any combination thereof.
当网络设备为第一网络设备时,处理器1410可以执行上述方法实施例中第一网络设备获得第一长度的压缩段标识以及第二长度的压缩段标识、确定报文的转发路径以及生成对应于转发路径的段列表、生成第一报文等。当网络设备为第二网络设备时,处理器1410可以执行上述方法实例中根据编码规则在段列表中读取待拷贝内容以及根据待拷贝内容更新第一报文的目的地址DA等相关功能。When the network device is the first network device, the processor 1410 may execute the first network device in the foregoing method embodiment to obtain the compressed segment identifier of the first length and the compressed segment identifier of the second length, determine the forwarding path of the packet, and generate the corresponding For the segment list of the forwarding path, generating the first packet, etc. When the network device is the second network device, the processor 1410 may perform related functions such as reading the content to be copied in the segment list according to the encoding rule and updating the destination address DA of the first packet according to the content to be copied in the above method example.
通信接口1420用于接收和发送报文,具体地,通信接口1420可以包括接收接口和发送接口。其中,接收接口可以用于接收报文,发送接口可以用于发送报文。通信接口1420的个数可以为一个或多个。The communication interface 1420 is used for receiving and sending messages. Specifically, the communication interface 1420 may include a receiving interface and a sending interface. The receiving interface may be used to receive packets, and the sending interface may be used to send packets. The number of communication interfaces 1420 may be one or more.
存储器1430可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(random-access memory,RAM);存储器1430也可以包括非易失性存储器(英文:non-volatile memory),例如快闪存储器(英文:flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储器1430还可以包括上述种类的存储器的组合。The memory 1430 may include a volatile memory (English: volatile memory), such as random-access memory (RAM); the memory 1430 may also include a non-volatile memory (English: non-volatile memory), such as a fast memory Flash memory (English: flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); the memory 1430 may also include a combination of the above-mentioned types of memory.
可选地,存储器1430存储有操作系统和程序、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,程序可包括各种操作指令,用于实现各种操作。操作系统可包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。处理器1410可以读取存储器1430中的程序,实现本申请实施例提供的报文传输方法、段列表生成方法以及压缩段标识获取方法。Optionally, the memory 1430 stores an operating system and programs, executable modules or data structures, or their subsets, or their extended sets, wherein the programs may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and handling hardware-based tasks. The processor 1410 may read the program in the memory 1430, and implement the method for message transmission, the method for generating a segment list, and the method for obtaining a compressed segment identifier provided by the embodiments of the present application.
其中,存储器1430可以为网络设备1400中的存储器件,也可以为独立于网络设备1400的存储装置。The memory 1430 may be a storage device in the network device 1400 , or may be a storage device independent of the network device 1400 .
总线系统1440可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线系统1440可以分为地址总线、数据总线、控制总线等。为便于表示,图14中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus system 1440 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like. The bus system 1440 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is shown in FIG. 14, but it does not mean that there is only one bus or one type of bus.
图15是本申请实施例提供的另一种网络设备1500的结构示意图,网络设备1500可以图9所示实施例中的第一网络设备或第二网络设备,或者也可以是图10所示实施例中装置1000、图11所示实施例中装置1100、图12所示实施例中的装置1200以及图13所示实施例中的装置1300的设备实现。FIG. 15 is a schematic structural diagram of another network device 1500 provided by an embodiment of the present application. The network device 1500 may be the first network device or the second network device in the embodiment shown in FIG. 9 , or may also be the implementation shown in FIG. 10 . The apparatus 1000 in the example, the apparatus 1100 in the embodiment shown in FIG. 11 , the apparatus 1200 in the embodiment shown in FIG. 12 , and the apparatus 1300 in the embodiment shown in FIG. 13 are implemented by equipment.
网络设备1500包括:主控板1510和接口板1530。The network device 1500 includes: a main control board 1510 and an interface board 1530 .
主控板1510也称为主处理单元(main processing unit,MPU)或路由处理卡(route processor card),主控板1510对网络设备1500中各个组件的控制和管理,包括路由计算、设备管理、设备维护、协议处理功能。主控板1510包括:中央处理器1511和存储器1512。The main control board 1510 is also called the main processing unit (main processing unit, MPU) or the route processor card (route processor card). The main control board 1510 controls and manages each component in the network device 1500 Equipment maintenance, protocol processing functions. The main control board 1510 includes: a central processing unit 1511 and a memory 1512 .
接口板1530也称为线路接口单元卡(line processing unit,LPU)、线卡(line card)或业务板。接口板1530用于提供各种业务接口并实现数据包的转发。业务接口包括而不限于以太网接口、POS(Packet over SONET/SDH)接口等,以太网接口例如是灵活以太网业务接口(Flexible Ethernet Clients,FlexE Clients)。接口板1530包括:中央处理器1531、网络处理器1532、转发表项存储器1534和物理接口卡(ph8sical interface card,PIC)1533。The interface board 1530 is also referred to as a line processing unit (LPU), a line card or a service board. The interface board 1530 is used to provide various service interfaces and realize data packet forwarding. The service interface includes, but is not limited to, an Ethernet interface, a POS (Packet over SONET/SDH) interface, etc. The Ethernet interface is, for example, a flexible Ethernet service interface (Flexible Ethernet Clients, FlexE Clients). The interface board 1530 includes: a central processing unit 1531 , a network processor 1532 , a forwarding table entry memory 1534 and a physical interface card (ph8sical interface card, PIC) 1533 .
接口板1530上的中央处理器1531用于对接口板1530进行控制管理并与主控板1510上的中央处理器1511进行通信。The central processing unit 1531 on the interface board 1530 is used to control and manage the interface board 1530 and communicate with the central processing unit 1511 on the main control board 1510 .
网络处理器1532用于实现报文的转发处理。网络处理器1532的形态可以是转发芯片。具体而言,上行报文的处理包括:报文入接口的处理,转发表查找;下行报文的处理:转发表查找等等。The network processor 1532 is used to implement packet forwarding processing. The network processor 1532 may be in the form of a forwarding chip. Specifically, the processing of the uplink packet includes: processing of the incoming interface of the packet, and searching of the forwarding table; processing of the downlink packet: searching of the forwarding table, and so on.
物理接口卡1533用于实现物理层的对接功能,原始的流量由此进入接口板1530,以及处理后的报文从该物理接口卡1533发出。物理接口卡1533包括至少一个物理接口,物理接口也称物理口。物理接口卡1533也称为子卡,可安装在接口板1530上,负责将光电信号转换为报文并对报文进行合法性检查后转发给网络处理器1532处理。在一些实施例中,接口板1503的中央处理器1531也可执行网络处理器1532的功能,比如基于通用CPU实现软件转发,从而物理接口卡1533中不需要网络处理器1532。The physical interface card 1533 is used to realize the interconnection function of the physical layer, the original traffic enters the interface board 1530 through this, and the processed packets are sent from the physical interface card 1533 . The physical interface card 1533 includes at least one physical interface, which is also called a physical port. The physical interface card 1533 is also called a daughter card, which can be installed on the interface board 1530, and is responsible for converting the photoelectric signal into a message, and after checking the validity of the message, it is forwarded to the network processor 1532 for processing. In some embodiments, the central processing unit 1531 of the interface board 1503 can also perform the functions of the network processor 1532 , such as implementing software forwarding based on a general-purpose CPU, so that the network processor 1532 is not required in the physical interface card 1533 .
可选地,网络设备1500包括多个接口板,例如网络设备1500还包括接口板1540,接口板1540包括:中央处理器1541、网络处理器1542、转发表项存储器1544和物理接口卡 1543。Optionally, the network device 1500 includes multiple interface boards. For example, the network device 1500 further includes an interface board 1540. The interface board 1540 includes a central processing unit 1541, a network processor 1542, a forwarding table entry storage 1544, and a physical interface card 1543.
可选地,网络设备1500还包括交换网板1520。交换网板1520也可以称为交换网板单元(switch fabric unit,SFU)。在网络设备有多个接口板1530的情况下,交换网板1520用于完成各接口板之间的数据交换。例如,接口板1530和接口板1540之间可以通过交换网板1520通信。Optionally, the network device 1500 further includes a switch fabric board 1520 . The switch fabric unit 1520 may also be referred to as a switch fabric unit (switch fabric unit, SFU). When the network device has multiple interface boards 1530, the switching network board 1520 is used to complete data exchange between the interface boards. For example, the interface board 1530 and the interface board 1540 can communicate through the switch fabric board 1520 .
主控板1510和接口板1530耦合。例如。主控板1510、接口板1530和接口板1540,以及交换网板1520之间通过系统总线与系统背板相连实现互通。在一种可能的实现方式中,主控板1510和接口板1530之间建立进程间通信协议(inter-process communication,IPC)通道,主控板1510和接口板1530之间通过IPC通道进行通信。The main control board 1510 and the interface board 1530 are coupled. E.g. The main control board 1510 , the interface board 1530 , the interface board 1540 , and the switch fabric board 1520 are connected to the system backplane through a system bus to implement intercommunication. In a possible implementation manner, an inter-process communication (inter-process communication, IPC) channel is established between the main control board 1510 and the interface board 1530, and the main control board 1510 and the interface board 1530 communicate through the IPC channel.
在逻辑上,网络设备1500包括控制面和转发面,控制面包括主控板1510和中央处理器1531,转发面包括执行转发的各个组件,比如转发表项存储器1534、物理接口卡1533和网络处理器1532。控制面执行路由器、生成转发表、处理信令和协议报文、配置与维护设备的状态等功能,控制面将生成的转发表下发给转发面,在转发面,网络处理器1532基于控制面下发的转发表对物理接口卡1533收到的报文查表转发。控制面下发的转发表可以保存在转发表项存储器1534中。在一些实施例中,控制面和转发面可以完全分离,不在同一设备上。Logically, the network device 1500 includes a control plane and a forwarding plane, the control plane includes the main control board 1510 and the central processing unit 1531, and the forwarding plane includes various components that perform forwarding, such as the forwarding entry storage 1534, the physical interface card 1533 and the network processing device 1532. The control plane performs functions such as routers, generating forwarding tables, processing signaling and protocol packets, configuring and maintaining device status, etc. The control plane delivers the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 1532 is based on the control plane. The delivered forwarding table forwards the packets received by the physical interface card 1533 by looking up the table. The forwarding table issued by the control plane may be stored in the forwarding table entry storage 1534 . In some embodiments, the control plane and forwarding plane may be completely separate and not on the same device.
应理解,图10-图13每个实施例中的发送单元和接收单元可以是不同的物理接口卡,例如,接收单元1001相当于物理接口卡1533、发送单元1003相当于物理接口卡1534。装置1000中的处理单元1002、装置1100中的处理单元1101、装置1200中的处理单元1201、装置1300中的处理单元1301等可以相当于网络设备1500中的中央处理器1511、中央处理器1531、中央处理器1541中的一个或多个。It should be understood that the sending unit and the receiving unit in each embodiment of FIGS. 10-13 may be different physical interface cards. For example, the receiving unit 1001 corresponds to the physical interface card 1533 and the sending unit 1003 corresponds to the physical interface card 1534. The processing unit 1002 in the apparatus 1000, the processing unit 1101 in the apparatus 1100, the processing unit 1201 in the apparatus 1200, the processing unit 1301 in the apparatus 1300, etc. may be equivalent to the central processing unit 1511, the central processing unit 1531, One or more of the central processing units 1541.
应理解,本申请实施例中接口板1540上的操作与接口板1530的操作一致,为了简洁,不再赘述。应理解,本实施例的网络设备1500可对应于上述各个方法实施例中的第一网络设备或第二网络设备,该网络设备1500中的主控板1510、接口板1530和/或接口板1540可以实现上述各个方法实施例中的第一网络设备或第二网络设备所具有的功能和/或所实施的各种步骤,为了简洁,在此不再赘述。It should be understood that the operations on the interface board 1540 in this embodiment of the present application are the same as the operations on the interface board 1530 , and for brevity, details are not repeated here. It should be understood that the network device 1500 in this embodiment may correspond to the first network device or the second network device in the foregoing method embodiments, and the main control board 1510 , the interface board 1530 and/or the interface board 1540 in the network device 1500 The functions and/or various steps performed by the first network device or the second network device in the foregoing method embodiments can be implemented, which are not repeated here for brevity.
应理解,主控板可能有一块或多块,有多块的时候可以包括主用主控板和备用主控板。接口板可能有一块或多块,网络设备的数据处理能力越强,提供的接口板越多。接口板上的物理接口卡也可以有一块或多块。交换网板可能没有,也可能有一块或多块,有多块的时候可以共同实现负荷分担冗余备份。在集中式转发架构下,网络设备可以不需要交换网板,接口板承担整个系统的业务数据的处理功能。在分布式转发架构下,网络设备可以有至少一块交换网板,通过交换网板实现多块接口板之间的数据交换,提供大容量的数据交换和处理能力。所以,分布式架构的网络设备的数据接入和处理能力要大于集中式架构的设备。可选地,网络设备的形态也可以是只有一块板卡,即没有交换网板,接口板和主控板的功能集成在该一块板卡上,此时接口板上的中央处理器和主控板上的中央处理器在该一块板卡上可以合并为一个中央处理器,执行两者叠加后的功能,这种形态设备的数据交换和处理能力较低(例如,低端交换机或路由器等网络设备)。具体采用哪种架构,取决于具 体的组网部署场景。It should be understood that there may be one or more main control boards, and when there are more than one main control board, it may include an active 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 can also be one or more physical interface cards on the interface board. There may be no switch fabric boards, or there may be one or more boards. When there are multiple boards, they can jointly implement load sharing and redundant backup. Under the centralized forwarding architecture, the network device does not need to switch the network board, and the interface board undertakes the processing function of the service data of the entire system. Under the distributed forwarding architecture, a network device may have at least one switching network board, and the switching network board realizes data exchange between multiple interface boards, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices in a distributed architecture are greater than those in a centralized architecture. Optionally, the form of the network device can also be that there is only one board, that is, there is no switching network board, and the functions of the interface board and the main control board are integrated on this board. The central processing unit on the board can be combined into a central processing unit on the board to perform the functions of the two superimposed, the data exchange and processing capacity of this form of equipment is low (for example, low-end switches or routers and other networks. equipment). The specific architecture used depends on the specific networking deployment scenario.
在一些可能的实施例中,上述第一网络设备或第二网络设备可以实现为虚拟化设备。例如,虚拟化设备可以是运行用于发送报文功能的程序的虚拟机(英文:Virtual Machine,VM),虚拟机部署在硬件设备上(例如,物理服务器)。虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。可以将虚拟机配置为第一网络设备或第二网络设备。例如,可以基于通用的物理服务器结合网络功能虚拟化(Network Functions Virtualization,NFV)技术来实现第一网络设备或第二网络设备。第一网络设备或第二网络设备可以为虚拟主机、虚拟路由器或虚拟交换机。本领域技术人员通过阅读本申请即可结合NFV技术在通用物理服务器上虚拟出具有上述功能的第一网络设备或第二网络设备,此处不再赘述。In some possible embodiments, the above-mentioned first network device or second network device may be implemented as a virtualized device. For example, the virtualization device may be a virtual machine (English: Virtual Machine, VM) running a program for sending a message function, and the virtual machine is deployed on a hardware device (for example, a physical server). A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. The virtual machine can be configured as a first network device or a second network device. For example, the first network device or the second network device may be implemented based on a general-purpose physical server in combination with a network function virtualization (Network Functions Virtualization, NFV) technology. The first network device or the second network device may be a virtual host, a virtual router or a virtual switch. Those skilled in the art can virtualize a first network device or a second network device having the above functions on a general physical server in combination with the NFV technology by reading this application, and details are not described herein again.
应理解,上述各种产品形态的网络设备,分别具有上述方法实施例中第一网络设备或第二网络设备的任意功能,此处不再赘述。It should be understood that the network devices in the above-mentioned various product forms respectively have any functions of the first network device or the second network device in the above method embodiments, and details are not described herein again.
本申请实施例还提供了一种芯片,包括处理器和接口电路,接口电路,用于接收指令并传输至处理器;处理器,例如可以是图10示出的装置1000的一种具体实现形式,可以用于执行上述报文传输的方法。其中,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片系统实现上述任一方法实施例中的方法。An embodiment of the present application also provides a chip, including a processor and an interface circuit, where the interface circuit is used to receive instructions and transmit them to the processor; the processor, for example, may be a specific implementation form of the apparatus 1000 shown in FIG. 10 . , which can be used to perform the above method of message transmission. The processor is coupled to a memory, and the memory is used to store programs or instructions, and when the programs or instructions are executed by the processor, the chip system enables the method in any of the foregoing method embodiments.
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。Optionally, the number of processors in the chip system may be one or more. The processor can be implemented by hardware or by software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like. When implemented in software, the processor may be a general-purpose processor implemented by reading software codes stored in memory.
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请并不限定。示例性的,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型,以及存储器与处理器的设置方式不作具体限定。Optionally, there may also be one or more memories in the chip system. The memory may be integrated with the processor, or may be provided separately from the processor, which is not limited in this application. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip, or can be provided on different chips. The setting method of the processor is not particularly limited.
示例性的,该芯片系统可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。Exemplarily, the system-on-chip may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (SoC), It can also be a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), or a microcontroller (microcontroller). controller unit, MCU), it can also be a programmable logic device (PLD) or other integrated chips.
本申请实施例还提供了一种计算机可读存储介质,包括指令或计算机程序,当其在计算机上运行时,使得计算机执行以上实施例提供的报文传输方法、段列表生成方法以及压缩段标识获取方法。Embodiments of the present application further provide a computer-readable storage medium, including instructions or computer programs, which, when run on a computer, cause the computer to execute the packet transmission method, the segment list generation method, and the compressed segment identifier provided by the above embodiments get method.
本申请实施例还提供了一种包含指令或计算机程序的计算机程序产品,当其在计算机上运行时,使得计算机执行以上实施例提供的报文传输方法、段列表生成方法以及压缩段标识获取方法。The embodiments of the present application also provide a computer program product including an instruction or a computer program, which, when running on a computer, enables the computer to execute the message transmission method, the segment list generation method, and the compressed segment identifier acquisition method provided by the above embodiments .
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四” 等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above may refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑业务划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of units is only a logical business division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各业务单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件业务单元的形式实现。In addition, each service unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of a software business unit.
集成的单元如果以软件业务单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented as a software business unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的业务可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些业务存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should realize that, in one or more of the above examples, the services described in the present invention may be implemented by hardware, software, firmware or any combination thereof. When implemented in software, the services may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
以上的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上仅为本发明的具体实施方式而已。The above specific embodiments further describe the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific embodiments of the present invention.
以上,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施 例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be used for the foregoing implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims (33)

  1. 一种报文传输方法,其特征在于,所述方法包括:A message transmission method, characterized in that the method comprises:
    第二网络设备接收所述第一网络设备发送的第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中每个压缩段标识的长度小于等于128比特;The second network device receives the first packet sent by the first network device, the first packet includes a segment list corresponding to the forwarding path of the first packet, and the segment list includes a plurality of sequentially arranged a compressed segment identifier, where the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bits;
    所述第二网络设备根据编码规则在所述段列表中读取待拷贝内容,所述编码规则用于指示所述待拷贝内容对应的编码规则;The second network device reads the content to be copied in the segment list according to an encoding rule, and the encoding rule is used to indicate an encoding rule corresponding to the content to be copied;
    所述第二网络设备根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文;The second network device updates the destination address DA in the first message according to the content to be copied, to generate a second message;
    所述第二网络设备发送所述第二报文。The second network device sends the second packet.
  2. 根据权利要求1所述的方法,其特征在于,所述第二网络设备根据编码规则在所述段列表中读取待拷贝内容,包括:The method according to claim 1, wherein the second network device reads the content to be copied in the segment list according to an encoding rule, comprising:
    所述第二网络设备确定起始位置,所述起始位置用于指示所述待拷贝内容对应的起始位置;The second network device determines a starting position, where the starting position is used to indicate a starting position corresponding to the content to be copied;
    所述第二网络设备根据所述编码规则以及所述起始位置确定所述待拷贝内容的长度。The second network device determines the length of the content to be copied according to the encoding rule and the starting position.
  3. 根据权利要求2所述的方法,其特征在于,所述第二网络设备根据所述编码规则以及所述起始位置确定所述待拷贝内容的长度,包括:The method according to claim 2, wherein the second network device determines the length of the content to be copied according to the encoding rule and the starting position, comprising:
    所述第二网络设备获取第一参数集合和/或第二参数集合,所述第一参数集合包括所述压缩段标识中节点标识对应的第一初始长度和第一增量长度,所述第二参数集合包括所述压缩段标识中功能标识对应的第二初始长度和第二增量长度;The second network device obtains a first parameter set and/or a second parameter set, where the first parameter set includes the first initial length and the first incremental length corresponding to the node ID in the compressed segment ID, and the first parameter set is The second parameter set includes the second initial length and the second increment length corresponding to the function identifier in the compressed segment identifier;
    所述第二网络设备根据编码规则、所述第一参数集合和/或所述第二参数集合以及所述起始位置确定所述待拷贝内容的长度。The second network device determines the length of the content to be copied according to the encoding rule, the first parameter set and/or the second parameter set, and the starting position.
  4. 根据权利要求3所述的方法,其特征在于,所述第二网络设备根据编码规则、所述第一参数集合和/或所述第二参数集合以及所述起始位置确定所述待拷贝内容的长度,包括:The method according to claim 3, wherein the second network device determines the content to be copied according to an encoding rule, the first parameter set and/or the second parameter set, and the starting position length, including:
    所述第二网络设备从所述起始位置向后读取N个比特位,所述N个比特位中前i个比特位为1,第i+1个比特位为0,或者所述N个比特位中前i个比特位为0,第i+1个比特位为1;The second network device reads N bits backward from the starting position, the first i bit of the N bits is 1, the i+1th bit is 0, or the N The first i bits in the bits are 0, and the i+1th bit is 1;
    所述第二网络设备继续向后读取M个比特位,所述M=所述第一初始长度+i*所述第一增量长度-i-1,并将N+M个比特作为所述待拷贝内容中的节点标识的长度;The second network device continues to read M bits backward, where M=the first initial length+i*the first increment length−i−1, and uses N+M bits as the total number of bits. Describe the length of the node identifier in the content to be copied;
    所述第二网络设备继续向后读取P个比特位,所述P个比特位中前j个比特位为1,第j+1个比特位为0,或者所述P个比特位中前j个比特位为0,第j+1个比特位为1;The second network device continues to read P bits backwards, the first j bits in the P bits are 1, the j+1th bit is 0, or the first among the P bits is 0. The j bits are 0, and the j+1th bit is 1;
    所述第二网络设备继续后读取Q个比特位,所述Q=所述第二初始长度+j*所述第二增量长度-j-1个比特位,并将P+Q个比特作为所述待拷贝内容中的功能标识的长度;The second network device continues to read Q bits, where Q=the second initial length+j*the second increment length−j−1 bits, and converts P+Q bits as the length of the function identifier in the content to be copied;
    所述第二网络设备根据所述待拷贝内容中的节点标识的长度和所述待拷贝内容中的功能标识的长度获得所述待拷贝内容的长度。The second network device obtains the length of the content to be copied according to the length of the node identifier in the content to be copied and the length of the function identifier in the content to be copied.
  5. 根据权利要求3或4所述的方法,其特征在于,所述第一初始长度和所述第一增量 长度均为8比特的倍数,和/或所述第二初始长度和所述第二增量长度均为8比特的倍数。The method according to claim 3 or 4, wherein the first initial length and the first increment length are both multiples of 8 bits, and/or the second initial length and the second The increment lengths are all multiples of 8 bits.
  6. 根据权利要求2-5任一项所述的方法,其特征在于,所述第一报文还包括扩展指针,所述扩展指针用于依次指示所述多个压缩段标识中的每个压缩段标识,所述第二网络设备确定起始位置,包括:The method according to any one of claims 2-5, wherein the first packet further includes an extension pointer, and the extension pointer is used to sequentially indicate each compressed segment in the multiple compressed segment identifiers identifier, the second network device determines the starting position, including:
    所述第二网络设备根据所述扩展指针确定所述待拷贝内容在所述段列表中的起始位置。The second network device determines, according to the extension pointer, a starting position of the content to be copied in the segment list.
  7. 根据权利要求6所述的方法,其特征在于,所述扩展指针指示所述第二网络设备对应压缩段标识的起始位置,所述第二网络设备根据所述扩展指针确定待拷贝内容在所述段列表中的起始位置,包括:The method according to claim 6, wherein the extension pointer indicates a start position of the compressed segment identifier corresponding to the second network device, and the second network device determines, according to the extension pointer, where the content to be copied is located. The starting position in the paragraph list, including:
    所述第二网络设备根据所述第二网络设备对应压缩段标识的长度更新所述扩展指针的值,以使得更新后的所述扩展指针的值对应所述待拷贝内容在所述段列表中的起始位置。The second network device updates the value of the extension pointer according to the length of the compressed segment identifier corresponding to the second network device, so that the updated value of the extension pointer corresponds to the content to be copied in the segment list starting position.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述第二网络设备根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文,包括:The method according to any one of claims 1-7, wherein the second network device updates the destination address DA in the first packet according to the content to be copied, so as to generate a second packet, include:
    所述第二网络设备根据所述待拷贝内容以及所述待拷贝内容对应的前缀更新所述第一报文中的目的地址DA,以生成第二报文。The second network device updates the destination address DA in the first packet according to the content to be copied and the prefix corresponding to the content to be copied, so as to generate a second packet.
  9. 根据权利要求1-7任一项所述的方法,其特征在于,所述第二网络设备根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文,包括:The method according to any one of claims 1-7, wherein the second network device updates the destination address DA in the first packet according to the content to be copied, so as to generate a second packet, include:
    所述第二网络设备利用所述待拷贝内容更新所述第一报文的目的地址DA中除前缀之外的信息,以生成第二报文。The second network device updates the information except the prefix in the destination address DA of the first packet by using the content to be copied, so as to generate a second packet.
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同。The method according to any one of claims 1-9, wherein the plurality of compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, and the first length and the The second length is different.
  11. 一种报文传输方法,其特征在于,所述方法包括:A message transmission method, characterized in that the method comprises:
    第一网络设备生成第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码;The first network device generates a first packet, the first packet includes a segment list corresponding to the forwarding path of the first packet, the segment list includes multiple compressed segment identifiers arranged in sequence, the multiple The length of each compressed segment identifier in the compressed segment identifiers is less than or equal to 128 bits, and the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the The second length is different, and each compressed segment identifier in the multiple compressed segment identifiers includes a prefix code;
    所述第一网络设备根据所述段列表发送所述第一报文。The first network device sends the first packet according to the segment list.
  12. 根据权利要求11所述的方法,其特征在于,所述每个压缩段标识包括可变长度部分,所述第一长度的压缩段标识的可变长度部分的长度与所述第二长度的压缩段标识的可变长度部分的长度不同,所述可变长度部分包括所述前缀码,所述可变长度部分的长度根据所述可变长度部分的编码规则确定。The method according to claim 11, wherein each compressed segment identifier includes a variable length portion, and the length of the variable length portion of the compressed segment identifier of the first length is compressed with the length of the variable length portion of the second length. The length of the variable-length part of the segment identification is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
  13. 根据权利要求11或12所述的方法,其特征在于,所述每个压缩段标识包括功能标识,所述功能标识为所述前缀码。The method according to claim 11 or 12, wherein each compressed segment identifier includes a function identifier, and the function identifier is the prefix code.
  14. 根据权利要求11或12所述的方法,其特征在于,所述每个压缩段标识包括节点标识,所述节点标识为所述前缀码。The method according to claim 11 or 12, wherein each compressed segment identifier includes a node identifier, and the node identifier is the prefix code.
  15. 根据权利要求11-14任一项所述的方法,其特征在于,所述第一报文还包括扩展指 针,所述扩展指针用于依次指示所述多个压缩段标识中的每个压缩段标识。The method according to any one of claims 11-14, wherein the first packet further includes an extension pointer, and the extension pointer is used to sequentially indicate each compressed segment in the multiple compressed segment identifiers logo.
  16. 根据权利要求11-15任一项所述的方法,其特征在于,所述第一长度的压缩段标识和所述第二长度的压缩段标识分别对应相同的前缀,或所述第一长度的压缩段标识和所述第二长度的压缩段标识分别对应不同的前缀。The method according to any one of claims 11-15, wherein the compressed segment identifier of the first length and the compressed segment identifier of the second length respectively correspond to the same prefix, or the first length of the compressed segment identifier The compressed segment identifier and the compressed segment identifier of the second length correspond to different prefixes respectively.
  17. 根据权利要求11-16任一项所述的方法,其特征在于,所述第一报文为基于IPv6的段路由SRv6报文,所述段列表位于段路由头SRH中。The method according to any one of claims 11-16, wherein the first packet is an IPv6-based segment routing SRv6 packet, and the segment list is located in a segment routing header SRH.
  18. 一种段列表生成方法,其特征在于,所述方法包括:A method for generating a segment list, characterized in that the method comprises:
    第一网络设备确定报文的转发路径;The first network device determines the forwarding path of the packet;
    所述第一网络设备生成对应于所述转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码。The first network device generates a segment list corresponding to the forwarding path, the segment list includes multiple compressed segment identifiers arranged in sequence, and the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bit, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the second length are different, and each of the multiple compressed segment identifiers The compressed segment identification includes a prefix code.
  19. 根据权利要求18所述的方法,其特征在于,所述每个压缩段标识包括可变长度部分,所述第一长度的压缩段标识的可变长度部分的长度与所述第二长度的压缩段标识的可变长度部分的长度不同,所述可变长度部分包括所述前缀码,所述可变长度部分的长度根据所述可变长度部分的编码规则确定。The method according to claim 18, wherein each compressed segment identifier includes a variable length portion, and the length of the variable length portion of the compressed segment identifier of the first length is compressed with the length of the variable length portion of the second length. The length of the variable-length part of the segment identification is different, the variable-length part includes the prefix code, and the length of the variable-length part is determined according to the encoding rule of the variable-length part.
  20. 根据权利要求18或19所述的方法,其特征在于,所述第一网络设备为网络中的控制器,所述方法还包括:The method according to claim 18 or 19, wherein the first network device is a controller in the network, and the method further comprises:
    所述第一网络设备向所述转发路径的入口设备发送所述段列表。The first network device sends the segment list to an ingress device of the forwarding path.
  21. 根据权利要求18或19所述的方法,其特征在于,所述第一网络设备为所述转发路径的入口设备,所述方法还包括:The method according to claim 18 or 19, wherein the first network device is an ingress device of the forwarding path, and the method further comprises:
    所述第一网络设备生成包括所述段列表的报文;generating, by the first network device, a message including the segment list;
    所述第一网络设备发送包括所述段列表的报文。The first network device sends a message including the segment list.
  22. 一种压缩段标识获取方法,其特征在于,所述方法包括:A method for obtaining a compressed segment identifier, characterized in that the method comprises:
    第一网络设备获得第一长度的压缩段标识,所述第一长度的压缩段标识包括第一可变长度部分,所述第一可变长度部分属于第一资源池,所述第一资源池包括多个所述第一可变长度部分;The first network device obtains a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable length part, the first variable length part belongs to a first resource pool, and the first resource pool including a plurality of said first variable length portions;
    基于所述第一资源池的资源不足,所述第一网络设备获得第二长度的压缩段标识,所述第二长度大于等于所述第一长度,所述第二长度的压缩段标识包括第二可变长度部分,所述第二可变长度部分属于第二资源池,所述第二资源池包括多个所述第二可变长度部分;Based on insufficient resources in the first resource pool, the first network device obtains a compressed segment identifier of a second length, where the second length is greater than or equal to the first length, and the compressed segment identifier of the second length includes the first length. two variable length parts, the second variable length parts belong to a second resource pool, and the second resource pool includes a plurality of the second variable length parts;
    所述第一网络设备发送所述第一长度的压缩段标识和所述第二长度的压缩段标识,所述第一长度的压缩段标识和所述第二长度的压缩段标识用于指示所述第一网络设备所执行的段。The first network device sends the compressed segment identifier of the first length and the compressed segment identifier of the second length, and the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the Describe the segment executed by the first network device.
  23. 根据权利要求22所述的方法,其特征在于,所述第一长度的压缩段标识和所述第二长度的压缩段标识包括功能标识,所述第一可变长度部分和所述第二可变长度部分为所述功能标识,所述第一资源池和所述第二资源池为所述功能标识对应的资源池。The method of claim 22, wherein the compressed segment identifier of the first length and the compressed segment identifier of the second length comprise function identifiers, the first variable length portion and the second variable length portion The variable-length part is the function identifier, and the first resource pool and the second resource pool are resource pools corresponding to the function identifier.
  24. 根据权利要求22或23所述的方法,其特征在于,所述方法还包括:The method according to claim 22 or 23, wherein the method further comprises:
    基于第n资源池的资源不足,所述第一网络设备获得第n+1长度的压缩段标识,所述第n+1长度大于等于第n长度,所述第n+1长度的压缩段标识包括第n+1可变长度部分,所述第n+1可变长度部分属于第n+1资源池,所述第n+1资源池包括多个所述第n+1可变长度部分;其中,所述n为大于1的自然数。Based on insufficient resources in the nth resource pool, the first network device obtains a compressed segment identifier of the n+1th length, the n+1th length is greater than or equal to the nth length, and the n+1th length of the compressed segment identifier including the n+1th variable length part, the n+1th variable length part belongs to the n+1th resource pool, and the n+1th resource pool includes a plurality of the n+1th variable length parts; Wherein, the n is a natural number greater than 1.
  25. 根据权利要求22-24任一项所述的方法,其特征在于,第i+1资源池包括2的X次幂个数的第i+1可变长度部分,所述X=初始长度+i*增量长度-i-1,所述i为大于等于0正整数。The method according to any one of claims 22-24, wherein the i+1 th resource pool includes the i+1 th variable length part of the number of 2 raised to the power of X, where X=initial length+i *Increment length-i-1, the i is a positive integer greater than or equal to 0.
  26. 根据权利要求25所述的方法,其特征在于,所述第i资源池对应的编码规则为前i个比特位为1,第i+1个比特位为0,后续(i+1)*2个比特位为0或1任意取值。The method according to claim 25, wherein the coding rule corresponding to the i-th resource pool is that the first i-th bit is 1, the i+1-th bit is 0, and the subsequent (i+1)*2 The bits are 0 or 1 and take any value.
  27. 根据权利要求25所述的方法,其特征在于,所述第i资源池对应的编码规则为前i个比特位为0,第i+1个比特位为1,后续(i+1)*2个比特位为0或1任意取值。The method according to claim 25, wherein the coding rule corresponding to the i-th resource pool is that the first i bit is 0, the i+1-th bit is 1, and the subsequent (i+1)*2 The bits are 0 or 1 and take any value.
  28. 根据权利要求25-27任一项所述的方法,其特征在于,所述初始长度和所述增量长度均为8比特的倍数。The method according to any one of claims 25-27, wherein both the initial length and the increment length are multiples of 8 bits.
  29. 一种报文传输装置,其特征在于,所述装置包括:A message transmission device, characterized in that the device comprises:
    接收单元,用于接收所述第一网络设备发送的第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中每个压缩段标识的长度小于等于128比特;A receiving unit, configured to receive a first packet sent by the first network device, where the first packet includes a segment list corresponding to a forwarding path of the first packet, and the segment list includes a sequence of multiple compressed segment identifiers, the length of each compressed segment identifier in the multiple compressed segment identifiers is less than or equal to 128 bits;
    处理单元,用于根据编码规则在所述段列表中读取待拷贝内容,所述编码规则用于指示所述待拷贝内容对应的编码规则;a processing unit, configured to read the content to be copied in the segment list according to an encoding rule, and the encoding rule is used to indicate an encoding rule corresponding to the content to be copied;
    所述处理单元,还用于根据所述待拷贝内容更新所述第一报文中的目的地址DA,以生成第二报文;The processing unit is further configured to update the destination address DA in the first message according to the content to be copied, to generate a second message;
    发送单元,用于发送所述第二报文。A sending unit, configured to send the second message.
  30. 一种报文传输装置,其特征在于,所述装置包括:A message transmission device, characterized in that the device comprises:
    处理单元,用于生成第一报文,所述第一报文包括对应于所述第一报文的转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码;A processing unit, configured to generate a first packet, where the first packet includes a segment list corresponding to a forwarding path of the first packet, the segment list includes a plurality of compressed segment identifiers arranged in sequence, the multiple The length of each compressed segment identifier in the plurality of compressed segment identifiers is less than or equal to 128 bits, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the The second lengths are different, and each compressed segment identifier in the multiple compressed segment identifiers includes a prefix code;
    发送单元,用于根据所述段列表发送所述第一报文。A sending unit, configured to send the first packet according to the segment list.
  31. 一种段列表生成装置,其特征在于,所述装置包括:An apparatus for generating a segment list, characterized in that the apparatus comprises:
    处理单元,用于确定报文的转发路径;a processing unit, used to determine the forwarding path of the message;
    所述处理单元,还用于生成对应于所述转发路径的段列表,所述段列表包括依次排列的多个压缩段标识,所述多个压缩段标识中的每个压缩段标识的长度小于等于128比特,所述多个压缩段标识中包括第一长度的压缩段标识和第二长度的压缩段标识,所述第一长度和所述第二长度不同,所述多个压缩段标识中每个压缩段标识包括前缀码。The processing unit is further configured to generate a segment list corresponding to the forwarding path, where the segment list includes multiple compressed segment identifiers arranged in sequence, and the length of each compressed segment identifier in the multiple compressed segment identifiers is less than Equal to 128 bits, the multiple compressed segment identifiers include a compressed segment identifier of a first length and a compressed segment identifier of a second length, the first length and the second length are different, and the multiple compressed segment identifiers are Each compressed segment identifier includes a prefix code.
  32. 一种压缩段标识获取装置,其特征在于,所述装置包括:An apparatus for obtaining a compressed segment identifier, characterized in that the apparatus comprises:
    处理单元,用于获得第一长度的压缩段标识,所述第一长度的压缩段标识包括第一可 变长度部分,所述第一可变长度部分属于第一资源池,所述第一资源池包括多个所述第一可变长度部分;a processing unit, configured to obtain a compressed segment identifier of a first length, where the compressed segment identifier of the first length includes a first variable length part, the first variable length part belongs to a first resource pool, and the first resource the pool includes a plurality of said first variable length portions;
    所述处理单元,还用于基于所述第一资源池的资源不足,获得第二长度的压缩段标识,所述第二长度大于等于所述第一长度,所述第二长度的压缩段标识包括第二可变长度部分,所述第二可变长度部分属于第二资源池,所述第二资源池包括多个所述第二可变长度部分;The processing unit is further configured to obtain a compressed segment identifier of a second length based on insufficient resources of the first resource pool, where the second length is greater than or equal to the first length, and the compressed segment identifier of the second length is comprising a second variable length portion, the second variable length portion belonging to a second resource pool, the second resource pool including a plurality of the second variable length portions;
    发送单元,用于发送所述第一长度的压缩段标识和所述第二长度的压缩段标识,所述第一长度的压缩段标识和所述第二长度的压缩段标识用于指示所述第一网络设备所执行的段。A sending unit, configured to send the compressed segment identifier of the first length and the compressed segment identifier of the second length, and the compressed segment identifier of the first length and the compressed segment identifier of the second length are used to indicate the The segment executed by the first network device.
  33. 一种通信系统,其特征在于,所述系统包括:第一网络设备和第二网络设备;A communication system, characterized in that the system comprises: a first network device and a second network device;
    其中,第一网络设备,用于执行权利要求11-28任一项所述的方法;Wherein, the first network device is configured to execute the method of any one of claims 11-28;
    所述第二网络设备,用于执行权利要求1-10任一项所述的方法。The second network device is configured to execute the method of any one of claims 1-10.
PCT/CN2021/133327 2020-11-30 2021-11-26 Message transmission method, segment list generation method, compressed segment identifier acquisition method, and apparatuses WO2022111606A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011377914.1 2020-11-30
CN202011377914.1A CN114640616A (en) 2020-11-30 2020-11-30 Message transmission, segment list generation and compressed segment identification acquisition method and device

Publications (1)

Publication Number Publication Date
WO2022111606A1 true WO2022111606A1 (en) 2022-06-02

Family

ID=81755318

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/133327 WO2022111606A1 (en) 2020-11-30 2021-11-26 Message transmission method, segment list generation method, compressed segment identifier acquisition method, and apparatuses

Country Status (2)

Country Link
CN (1) CN114640616A (en)
WO (1) WO2022111606A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499358A (en) * 2022-09-14 2022-12-20 中国电信股份有限公司 SRv6-TE message forwarding method and forwarding equipment
CN115499358B (en) * 2022-09-14 2024-05-14 中国电信股份有限公司 SRv6-TE message forwarding method and forwarding equipment

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024000136A1 (en) * 2022-06-28 2024-01-04 新华三技术有限公司 Message sending
CN117527693A (en) * 2022-08-03 2024-02-06 华为技术有限公司 Message forwarding method, device, system and storage medium
CN116192968B (en) * 2023-01-10 2024-02-13 广东云下汇金科技有限公司 IPv6 message data processing method and communication method based on SRv6

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3643022A1 (en) * 2017-07-14 2020-04-29 Huawei Technologies Co., Ltd. A method for establishing segment routing for ipv6 tunnel
CN111628995A (en) * 2020-05-26 2020-09-04 新华三信息安全技术有限公司 SID compression method, SID compression device, SID compression equipment and storage medium based on SRv6
CN111917640A (en) * 2019-05-09 2020-11-10 华为技术有限公司 SRv6 method, device and system for network generation segment list and message forwarding
CN113824638A (en) * 2020-06-18 2021-12-21 华为技术有限公司 Method, equipment and system for forwarding message

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3643022A1 (en) * 2017-07-14 2020-04-29 Huawei Technologies Co., Ltd. A method for establishing segment routing for ipv6 tunnel
CN111917640A (en) * 2019-05-09 2020-11-10 华为技术有限公司 SRv6 method, device and system for network generation segment list and message forwarding
CN111628995A (en) * 2020-05-26 2020-09-04 新华三信息安全技术有限公司 SID compression method, SID compression device, SID compression equipment and storage medium based on SRv6
CN113824638A (en) * 2020-06-18 2021-12-21 华为技术有限公司 Method, equipment and system for forwarding message

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
B. DECRAENE ORANGE R. RASZUK BLOOMBERG: "SRv6 vSID: Network Programming extension for variable length SIDs; draft-decraene-spring-srv6-vlsid-02.txt", SRV6 VSID: NETWORK PROGRAMMING EXTENSION FOR VARIABLE LENGTH SIDS; DRAFT-DECRAENE-SPRING-SRV6-VLSID-02.TXT, no. 2, 5 February 2020 (2020-02-05), pages 1 - 17, XP015137598 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499358A (en) * 2022-09-14 2022-12-20 中国电信股份有限公司 SRv6-TE message forwarding method and forwarding equipment
CN115499358B (en) * 2022-09-14 2024-05-14 中国电信股份有限公司 SRv6-TE message forwarding method and forwarding equipment

Also Published As

Publication number Publication date
CN114640616A (en) 2022-06-17

Similar Documents

Publication Publication Date Title
WO2022111606A1 (en) Message transmission method, segment list generation method, compressed segment identifier acquisition method, and apparatuses
CN111512601B (en) Segmented routing network processing of packets
US10320664B2 (en) Cloud overlay for operations administration and management
EP4009596A1 (en) Message forwarding method, device, and system in sr network
JP2023549797A (en) BIER packet forwarding methods, devices, and systems
EP4037267A1 (en) Method, apparatus and system for sending message
JP2023515112A (en) Packet transmission methods, devices and systems
CN112448888A (en) Method, equipment and system for forwarding message in SR network
JP7448597B2 (en) Message generation method and device and message processing method and device
CN116746129A (en) Method and apparatus for encoding locally processed metadata in a network header
JP6525256B2 (en) Virtual network system and virtual network route setting method
WO2022007702A1 (en) Message processing method and network device
CN112532563B (en) Message sending method and device
KR100636274B1 (en) Apparatus and method for forwarding packet in network processor
CN114301839B (en) Multicast message transmission method and device
KR20230104716A (en) Root advertising method, apparatus, and system
CN113285878A (en) Load sharing method and first network equipment
WO2023125774A1 (en) Vxlan packet transmission method, network device, and system
WO2023016110A1 (en) Method and apparatus for transmitting network layer readable information, device, system, and medium
WO2023088145A1 (en) Packet processing method, apparatus and device
WO2023125767A1 (en) Message transmission method, network device, and system
CN115499366B (en) Message transmission method and device
WO2023231438A1 (en) Message sending method, network device and system
WO2022083610A1 (en) Ip address allocation method, apparatus and system
CN116527642A (en) Message processing method and related equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21897106

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21897106

Country of ref document: EP

Kind code of ref document: A1