WO2023006002A1 - Data transmission method, related device, and computer storage medium - Google Patents

Data transmission method, related device, and computer storage medium Download PDF

Info

Publication number
WO2023006002A1
WO2023006002A1 PCT/CN2022/108376 CN2022108376W WO2023006002A1 WO 2023006002 A1 WO2023006002 A1 WO 2023006002A1 CN 2022108376 W CN2022108376 W CN 2022108376W WO 2023006002 A1 WO2023006002 A1 WO 2023006002A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
identifier
value
sid
segment
Prior art date
Application number
PCT/CN2022/108376
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 WO2023006002A1 publication Critical patent/WO2023006002A1/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • 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

Definitions

  • the present application relates to the field of computer technology, in particular to a data transmission method, related equipment and computer storage media.
  • Segment routing for IPv6 is a protocol designed based on the concept of source routing to forward IPv6 packets on the network.
  • SRv6 adds an IPv6 segment routing header (segment routing header, SRH) to the message at the source node of the message forwarding path, and the SRH contains a segment list (segment list) used to identify the forwarding path.
  • the segment list includes IPv6 addresses of network nodes on the packet forwarding path.
  • Generalized SRv6 (generalized SRv6, G-SRv6) is a new SRv6 technology proposed to save packet overhead.
  • G-SRv6 does not change the format and semantics of the original segment list in terms of data encapsulation, and supports the mixed programming of 128-bit common segment identifiers and 32/16-bit compressed segment identifiers in the segment list.
  • the application discloses a data transmission method, related equipment and computer storage medium.
  • the intermediate node on the message forwarding path detects the path failure of the next hop node, it can forward the message according to the segment list to complete the data transmission. .
  • the embodiment of the present application discloses a data transmission method, the method includes: a first node receives a first message, the first message includes a segment list, and the segment list corresponds to the first message Forwarding paths, the segment list includes one or more elements, and the elements include one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or the a link in the forwarding path;
  • the first node When determining that the path from the first node to the second node is faulty, the first node obtains the segment identifier of the third node according to one or more type-length-value TLVs in the first message, the The second node is a next-hop segment routing SR node of the first node in the forwarding path, and the third node is any node in the nodes after the second node in the forwarding path,
  • Each of the one or more TLVs includes indication information, where the indication information is used to indicate prefix information corresponding to a segment identifier SID of a node in the plurality of nodes or a link in the forwarding path ;
  • the first node obtains a second message according to the first message
  • the first node sends the second packet, and the destination address of the second packet includes the segment identifier of the third node.
  • the intermediate forwarding node on the forwarding path detects that the next-hop SR node on the forwarding path fails or the next-hop SR node fails.
  • the TLV field can be used to instruct the intermediate forwarding node to obtain the segment identifier of any one of the multiple nodes after the next hop SR node on the first packet forwarding path, and the obtained segment identifier Update the destination address of the message, and forward it according to the instruction identified in this segment, so as to bypass the fault node or fault path and complete the data transmission.
  • the first node obtains the segment identifier of the third node according to the first type-length-value TLV in the first message, including: according to the one or more The first value of type-length-value TLV and segment remaining SL obtains the segment identification of the third node, the first value of the SL indicates the position of the first element in the segment list, and the first element includes the The identification of the third node.
  • obtaining the segment identifier of the third node according to the one or more type-length-value TLVs and the first value of the segment remaining SL includes: obtaining the segment identifier according to the first value of the SL A first TLV, where the first TLV is one of the one or more TLVs; and acquiring the third node segment identifier according to the first value of the SL and the indication information of the first TLV.
  • the acquiring the first TLV according to the first value of the SL includes: acquiring the second value of the SL, where the second value of the SL means that the first node receives the The value of SL when the first message is described, the second value of the SL is used to indicate the position of the second element in the segment list, and the second element includes the identifier of the first node; according to the SL The second value of the SL determines the first value of the SL; the first TLV is obtained according to the first value of the SL.
  • the above-mentioned determining the first value of the SL according to the second value of the SL includes: if it is determined according to the identifier of the first node that the identifier of the second node is an uncompressed segment identifier , subtracting 2 from the second value of SL to obtain the first value of SL.
  • the upper first mark is used to indicate that the mark of the second node is a compressed segment identifier
  • the determining that the identifier of the second node is an uncompressed segment identifier according to the identifier of the first node includes: obtaining the identifier of the first node according to the destination address of the first message;
  • the identifier of the first node does not include the first flag, determine that the identifier of the second node is an uncompressed segment identifier.
  • the above-mentioned determining the first value of the SL according to the second value of the SL includes: if it is determined according to the identifier of the first node that the identifier of the second node is a compressed segment identifier, and determining that the first element is the same as the second element according to the value of the remaining CL identified by the compressed segment, and the first value of the SL is the second value of the SL; or
  • the third element Including the identifier of the second node, subtracting 1 from the second value of the SL to obtain the first value of the SL.
  • the above-mentioned second mark is used to indicate that the mark of the second node is a compressed segment identifier, and determining that the identifier of the second node is a compressed segment identifier according to the identifier of the first node,
  • the method includes: obtaining the identifier of the first node according to the destination address of the first message; if the identifier of the first node includes the second mark, determining that the identifier of the second node is a compressed segment identifier.
  • the acquisition of the third node segment identifier according to the first value of the SL and the indication information of the first TLV includes: according to the first value of the SL and the first The first indication information of the TLV obtains the segment identifier of the third node, wherein the indication information of the first TLV includes first indication information, and the first indication information is used to indicate a prefix of the segment identifier of the third node length.
  • the acquisition of the third node segment identifier according to the first value of the SL and the first indication information of the first TLV includes: if the first indication information of the first TLV is a first preset value, determining that the segment identifier of the third node is an uncompressed segment identifier; determining the segment identifier of the third node according to the first value of the SL.
  • the acquisition of the third node segment identifier according to the first value of the SL and the first indication information of the first TLV includes: if the first indication information of the first TLV is a second preset value, determining that the segment identifier of the third node is a compressed segment identifier;
  • the identifier of the third node acquires the segment identifier of the third node according to the identifier of the third node, the first indication information of the first TLV and the second indication information of the first TLV, wherein , the second indication information is used to indicate the location of the prefix of the segment identifier of the third node.
  • the segment list is located in the segment extended routing header SRH of the first packet, and the first TLV is located in the SRH of the first packet.
  • the segment list includes one or more elements, and the length of each element in the one or more elements is 128 bits.
  • the embodiment of the present application provides a data transmission method, including:
  • the segment list corresponds to the forwarding path of the first message
  • the segment list includes one or more elements, and each element in the one or more elements includes a or multiple identifiers, each of the one or more identifiers corresponds to a node among the plurality of nodes in the forwarding path or a link in the forwarding path;
  • the first message includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used to indicate that among the multiple nodes Prefix information corresponding to a segment identifier SID of a node or a link in the forwarding path.
  • the method before sending the first packet, includes: generating one or more type-length-value TLVs according to the segment list.
  • the above generates one or more type-length-value TLVs according to the segment list, including:
  • the indication information of the second TLV includes first indication information, and the first indication information is used to indicate the length of the identified prefix included in the fourth element;
  • the generating the second TLV according to the identification information included in the fourth element includes: generating the first indication information of the second TLV according to the length of the identified prefix included in the fourth element.
  • the generating the first indication information of the second TLV according to the length of the identifier included in the fourth element includes: the identifier included in the fourth element is an uncompressed segment identifier When, the first indication information of the second TLV is the first preset value; or, when the identifier included in the fourth element is a compressed segment identifier, and the identifier included in the fourth element is When the length of the prefix is the second preset value, the first indication information of the second TLV is the second preset value.
  • the indication information of the second TLV includes second indication information, and the second indication information is used to indicate the location of the prefix corresponding to the segment identifier of the third node;
  • the generating the second TLV according to the identification information included in the fourth element includes:
  • the generating the second indication information of the second TLV according to the position of the prefix corresponding to the identifier included in the fourth element includes: the prefix corresponding to the identifier included in the fourth element is included in the first packet In the segment list of , the second indication information is a third preset value;
  • the prefix corresponding to the identifier included in the fourth element is in the destination address of the first packet, and the second indication information is a fourth preset value.
  • the second TLV further includes third indication information, where the third indication information is used to indicate the position of the fourth element in the segment list; The position in the segment list is used to generate the third indication information.
  • the one or more TLVs have a one-to-one correspondence with the one or more elements.
  • the segment list includes one or more elements, and the length of each element in the one or more elements is 128 bits.
  • the segment list is located in the SRv6 extended routing header SRH of the first packet, and the first TLV is located in the SRH of the first packet.
  • an embodiment of the present application provides a network device, including a unit for executing the method described in the first aspect.
  • the embodiment of the present application further provides a network device, including a unit for executing the method described in the second aspect.
  • the embodiment of the present application provides a network device, including a processor, a transceiver, and a memory; the memory is used to store instructions, the processor is used to execute the instructions, and the transceiver is used to process communicate with other devices under the control of a processor; wherein, when the processor executes the instructions, it executes the method as described in the first aspect.
  • the embodiment of the present application also provides a network device, including a processor, a transceiver, and a memory; the memory is used to store instructions, the processor is used to execute the instructions, and the transceiver is used to Communicate with other devices under the control of the processor; wherein, when the processor executes the instructions, it executes the method as described in the second aspect.
  • the embodiment of the present application provides a network system, including a first network device and a second network device, the first network device includes the network device described in the third aspect, and the second network device includes the fourth network device The network equipment described in the aspect.
  • an embodiment of the present application provides a computer storage medium, the computer-readable storage medium stores a computer program, and it is characterized in that, when the computer program is executed by a processor, the method according to the first aspect is implemented.
  • the embodiment of the present application further provides a computer storage medium, the computer-readable storage medium stores a computer program, and it is characterized in that, when the computer program is executed by a processor, the method according to the second aspect is implemented .
  • FIG. 1 is a schematic diagram of a message format provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of another message format provided by the embodiment of the present application.
  • FIG. 3 is a schematic diagram of a message forwarding process provided by an embodiment of the present application.
  • FIG. 4 is a flow chart of a method for message transmission provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a G-SRv6 network provided by an embodiment of the present application.
  • FIGS. 6a-6b are schematic diagrams of another G-SRv6 network provided by the embodiment of the present application.
  • FIG. 7 is a flow chart of a method for message transmission provided by an embodiment of the present application.
  • FIGS 8a-8b are schematic diagrams of another G-SRv6 network provided by the embodiment of the present application.
  • FIGS. 9a-9b are schematic diagrams of another G-SRv6 network provided by the embodiment of the present application.
  • FIGS. 10a-10b are schematic diagrams of another G-SRv6 network provided by the embodiment of the present application.
  • Figure 11a- Figure 11b is a schematic diagram of another G-SRv6 network provided by the embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a network device provided in an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a network device provided in an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of a network device provided in an embodiment of the present application.
  • FIG. 16 is a possible schematic diagram of a network system provided by an embodiment of the present application.
  • Segment routing for IPv6 (SRv6) based on the IPv6 forwarding plane is a protocol designed to forward IPv6 packets on the network based on the concept of source routing.
  • SRv6 traffic engineering traffic engineering, TE
  • mode is an implementation (mode) of SRv6 technology.
  • SRv6 adds an IPv6 segment routing header (segment routing header, SRH) to the message at the source node of the message forwarding path, and the SRH contains a segment list (segmentlist) used to identify the forwarding path.
  • the segment list includes IPv6 addresses of nodes on the packet forwarding path.
  • the IPv6 address of a node in the segment list may also be called a segment identifier (segment identifier, SID) of the node.
  • SID segment identifier
  • the node corresponding to the segment identifier in the segment list is called an Endpoint node, and the Endpoint node is a node in the packet forwarding path that receives the SRv6 packet and processes the SRv6 packet.
  • Endpoint nodes are also called segment routing (segment routing, SR) nodes. It should be understood that in the subsequent description of the embodiment of the present application, the nodes corresponding to the segment identifiers in the segment list are all SR nodes.
  • FIG. 1 shows a schematic diagram of a packet format in an SRv6 network.
  • the packet header of the packet includes an IPv6 packet header and an SRH.
  • the IPv6 message header includes a destination address (destination address, DA) field, which is used to instruct the node to forward according to the segment identifier in the DA field.
  • SRH includes the next header (next header), header extension length (hdr ext len), routing type (routing type), segment remaining (segments left, SL), segment list, and option fields (options).
  • the segment list includes a plurality of SIDs arranged in sequence, that is, the IPv6 address of each node that the message needs to pass through during transmission, and the option field includes one or more type-length-value (type-length-value, TLV) field.
  • the SL is also referred to as an SL pointer, and is used to indicate the number of remaining SIDs to be processed, and can also be understood as the pointed position of the currently pending SID in the segment list. For example, if the value of the SL pointer is 3, it means that the number of remaining SIDs to be processed is 4.
  • the SL pointer points to the current SID to be processed, and the value of the SL pointer is 0, which means that the number of remaining segments to be processed is The number is 1, which can also be understood as the SL pointer points to the currently pending SID.
  • each node During packet forwarding on an SRv6 network, each node updates the destination address to complete hop-by-hop forwarding. That is, after the node determines the current pending SID according to the value of the SL pointer, it obtains the current pending SID in the segment list, copies the SID to the DA field in the IPv6 packet header, and forwards the packet according to the content in the DA field .
  • SID consists of two parts: location (locator) and function (function).
  • locator is used to route the message to the node corresponding to the SID;
  • function is used to instruct the node corresponding to the SID to perform the corresponding function.
  • Function can also separate an optional parameter section (Arguments).
  • Locator is used to route the message to the node corresponding to the SID;
  • Function is used to instruct the node corresponding to the SID to perform the corresponding function.
  • Function can also separate an optional parameter section (Arguments).
  • the format of SRv6SID becomes Locator, Function and Arguments.
  • Arguments occupy the low bits of IPv6 addresses. Through the Arguments field, some message flows and services can be defined. information.
  • the nodes in the network execute corresponding functions according to the function in the segment identifier.
  • the location field includes a prefix (prefix) part and a serial number (node ID) part.
  • prefix prefix
  • node ID serial number
  • the SID of each node is allocated from an address space, so the prefix part of the location field of each node is the same; the serial number part of the SID of each node is different, Each sequence number part is used to uniquely identify a node in the domain.
  • the SIDs of multiple nodes in an SRv6 network domain can share a prefix, and the serial number part and the function field are used as a compressed segment identifier (compressed SID, C-SID), that is, C-SID.
  • C-SID compressed segment identifier
  • the C-SID plus the prefix can form a complete SID, that is, the IPv6 address of the node.
  • Generalized SRv6 Generalized SRv6, G-SRv6
  • This solution is compatible with standard SRv6, and does not change the format and semantics of the original SRH in data encapsulation, but supports the 128-bit SRv6SID and A 32-bit C-SID mix is programmed in the SRH.
  • the SRH that supports 128-bit SRv6 SID and 32/16-bit C-SID hybrid SID is called a generalized segment routing extension header (generalized SRH, G-SRH).
  • Fig. 2 shows a schematic diagram of a G-SRv6 message.
  • the G-SRv6 message includes an IPv6 message header and G-SRH.
  • the segment list includes multiple elements, namely elements G-SID[0]-G-SID[n], and the length of each element It is 128 bits, and each element includes the identification.
  • the identifier included in an element is a 128-bit SID
  • the element is a complete SID
  • the identifier included in an element is a compressed SID
  • the element may include multiple C-SIDs.
  • the length of the identifier contained in the element G-SID[0] is 128 bits
  • the element G-SID[0] only contains a complete SID
  • the identifier contained in the element G-SID[2] The length is 32 bits
  • the element G-SID[2] includes 4 C-SIDs, namely C-SID1, C-SID2, C-SID3, and C-SID4. Because the C-SID is inserted into the segment list in the G-SRH, the access logic of the segment list needs to be updated.
  • the IPv6 message header also includes a compressed segment identifier remaining (C-SID Left, CL) pointer, which forms a two-dimensional pointer with the SL pointer in the SRH, and jointly indicates the position of the currently pending identifier in the segment list.
  • the SL pointer is used to indicate the position in the segment list of the element where the identifier currently to be processed is located
  • the CL pointer is used to indicate the position of the identifier to be processed in the element. As shown in FIG. 2, if the identifier currently to be processed is C-SID1, C-SID1 is in the first C-SID of the first element in the segment list.
  • the segment list includes 3 elements, that is, elements G-SID[0]-G-SID[2], and the SL pointer includes 3 values, such as 0, 1, and 2. If the initial value of the SL pointer is 2, it indicates that the element G-SID[2] is in the first element in the segment list.
  • the element G-SID[2] includes four C-SIDs, C-SID1, C-SID2, C-SID3, and C-SID4, and the value of the CL pointer includes four values, such as 0, 1, 2, and 3. If the initial value of the CL pointer is 3, it indicates the first C-SID of C-SID1 in the element G-SID[2].
  • the value of the CL pointer is decremented by 1, that is, the value of the CL pointer is updated to 2, 1 and 0 in turn, which are used to indicate C-SID2, C-SID3 and C in the element G-SID[2] in turn. -SID4.
  • the first C-SID in the first element G-SID[2] of C-SID1 in the segment list can be obtained according to the value of the SL pointer of 2 and the value of the CL pointer of 3.
  • the forwarding node determines the SID to be processed according to the SL and CL pointers, it copies the SID to the DA field in the IPv6 packet header, and forwards the packet according to the DA field.
  • the currently processed SID is a C-SID, and the currently processed C-SID is copied into the DA field.
  • FIG. 3 exemplarily shows an SRv6 packet forwarding process, taking packet forwarding in an SRv6 network domain as an example.
  • nodes A to F are included.
  • the addresses of node A-node F are A:1:1::, A:2:1::, A:3:1::, A:4:1::, A:5:1::, A :6:1::, the prefix of the segment identifier SID corresponding to node A-node F is A:.
  • Node A adds the prefix A: to the DA field of message 1, copies the first C-SID 2:1 in the segment list to the DA field, and the prefix A: and 2:1 in the DA field form a complete SID A:2:1, so node A queries the forwarding entry according to A:2:1 in the DA field, and forwards message 1 to node B according to the query result.
  • Node B receives the message 1 sent by node A, B obtains the above message 1, and obtains the SID of the next-hop node of the above message 1 according to the SRH of the above message 1, that is, the SID of node C.
  • the value of the SL pointer in message 1 is 1, indicating the position of the element G-SID[1] in the segment list, and the initial value of the CL pointer is 3, indicating that the first C-SID is in the element G-SID[1]
  • the specific position of the identifier corresponding to Node B in the segment list can be obtained through the SL pointer and the CL pointer.
  • Node B updates the value of the CL pointer to 2, indicating the position of the second C-SID in the element G-SID[1].
  • Node B locates the first element according to the indications of the SL pointer and the CL pointer
  • the second C-SID in the first element is 3:1
  • the second C-SID in the first element is 3:1.
  • the 3:1 is copied to the DA of the message to replace the original DA field.
  • the DA field includes a combination of the prefix part A: and the C-SID part 3:1, that is, A:3:1, which is the SID of node C.
  • Node B queries the forwarding entry according to the SID of node C in the DA field, and sends the message 2 to node C according to the query result.
  • node E When node E receives message 3 forwarded by node D, node E obtains the value of the SL pointer as 1 and the value of the CL pointer as 0, indicating that the C-SID in the current DA field is the last one in the element G-SID[1] C-SID, node E needs to update the SL pointer, execute SL--, update the value of the SL pointer to 0, and indicate the position of G-SID[0] in the segment list.
  • the node receiving the message on the forwarding path can obtain the segment identifier of the next-hop SR node, but when it detects that the next-hop SR node fails or the link between the next-hop SR node When a fault occurs on the forwarding path, the segment identifier of one of the nodes following the faulty node on the forwarding path cannot be obtained. Therefore, when the intermediate forwarding node on the forwarding path detects that the next-hop SR node fails or the link with the next-hop SR node fails, it cannot perform forwarding according to the segment list.
  • node D when the path from node D to node E fails, that is, node E fails or the link between node D and node E fails, node D cannot forward data packets through node E according to the forwarding path, Then node D needs to be the next hop node of node E on the forwarding path, that is, node F.
  • Node D directly sends the data message to node F, so that the data message can continue to forward the above data message according to the forwarding path after node E on the original forwarding path.
  • node D after node D detects that the path to node E is faulty, node D needs to obtain the SID of the next hop node F to node E. However, because node D cannot accurately obtain the SID of node F according to the segment list in the G-SRH, it cannot forward or protect the data message.
  • This application proposes a data transmission method, which is applied to a G-SRv6 network including a source node and an intermediate forwarding node on a forwarding path.
  • Figure 4 shows a data transmission method provided by the present application.
  • the data transmission method generates a TLV field at the source node and encapsulates it in the SRH header of the first message.
  • the TLV field can be used to instruct the intermediate forwarding node to obtain any one of multiple nodes after the next hop SR node on the first packet forwarding path.
  • the SID of the node update the obtained SID to the destination address of the message, and forward according to the instruction of the SID, so as to bypass the faulty node or faulty path and complete the data transmission.
  • the data transmission method includes two stages.
  • the first stage mainly includes the source node generating a TLV field and encapsulating the TLV field into the SRH of the first message;
  • the second stage mainly includes Including that the intermediate forwarding node on the forwarding path obtains the SID of any one of the multiple nodes after the next hop SR node on the forwarding path according to the TLV field, and forwards the message according to the SID.
  • the first stage includes the following S101 to S104,
  • the source node obtains the first packet including the segment list.
  • the segment list corresponds to the forwarding path of the first message
  • the segment list includes one or more elements
  • each element in the one or more elements includes one or more identifiers
  • each of the one or more identifiers The identifiers respectively correspond to a node in the forwarding path or a link in the forwarding path.
  • the segment list in the SRH of the message in FIG. 5 contains 5 elements, and the elements here correspond to G-SIDs. It can be seen that each G-SID includes one or more identifiers, and the identifiers include SID or C-SID.
  • the element G-SID[4] includes 3 C-SIDs, these 3 C-SIDs correspond to the nodes N2, N3 and N4 in the forwarding path, N2, N3 and N4 belong to a network domain 1, and the network domain 1
  • the node compresses the SID and uses the same compressed prefix A:.
  • the element G-SID[3] includes 1 SID, which corresponds to node N5 in network domain 2 in the forwarding path, and node N5 is a node that does not support SRv6 header compression.
  • the source node is a source node of the G-SRv6 network, and the source node inserts the SRH into the header of the first message, or adds a header to the first message and inserts the SRH.
  • the SRH includes a segment list, which can be generated by the controller. For example, the controller calculates the forwarding path of the message, generates a segment list corresponding to the forwarding path, the segment list includes the C-SID, and sends the segment list to the source node.
  • the segment list can be generated by the source node.
  • the source node calculates the forwarding path of the packet, and generates a segment list corresponding to the forwarding path, and the segment list includes the C-SID.
  • the segment list can be jointly generated by the source node and the controller.
  • the controller calculates the forwarding path of the message, and generates a segment list corresponding to the forwarding path.
  • the segment list includes an uncompressed segment identifier but does not include a C-SID.
  • the controller sends the segment list to the source node, and the source node receives A new segment list is generated from the segment list, and the new segment list includes the C-SID.
  • the forwarding path further includes a first node, a second node and a third node, the second node is a next-hop SR node of the first node in the forwarding path, and the third node is a next-hop node of the second node in the forwarding path.
  • the nodes in this embodiment of the present application are network devices, such as routers, switches, or any network devices that can support G-SRv6.
  • S102 The source node generates a TLV field according to the segment list of the first packet.
  • the number of TLV fields is consistent with the number of elements in the segment list, and each element has a one-to-one correspondence with the TLV fields.
  • Each TLV field includes indication information, and the indication information is used to indicate prefix information corresponding to a node among multiple nodes in the forwarding path or a segment identifier SID of a link in the forwarding path.
  • the above TLV field is used to indicate whether the identifier included in the corresponding element is a C-SID, and if it is a C-SID, the length and position of the prefix corresponding to the C-SID.
  • the one-to-one correspondence between each element and the TLV field may be a sequential correspondence.
  • the first packet includes three elements G-SID(0) ⁇ G-SID(2), three TLV fields are generated, G-SID(0) corresponds to the first TLV, and G-SID (1) corresponds to the second TLV, and G-SID (2) corresponds to the third TLV, where the first TLV field indicates whether the element G-SID (0) is identified as a C-SID, when it is C- For SID, the first TLV field can also indicate the location and length of the prefix of the C-SID.
  • the one-to-one correspondence between each of the above elements and the TLV fields can also be in reverse order.
  • the first message includes three elements G-SID(0)-G-SID(2)
  • G-SID(0) corresponds to the third TLV
  • G-SID(1) corresponds to the second TLV
  • G-SID(2) corresponds to the first TLV. It is not limited to the above correspondence, and the one-to-one correspondence between each element and the TLV field may be other, which is not limited in this application.
  • each TLV field includes first indication information and second indication information, and the first indication information is used to indicate whether the segment identifier contained in the element corresponding to the TLV field is a C-SID, and if it is a C-SID SID, the first indication information also indicates the length of the prefix of the segment identifier in the element corresponding to the TLV field, and the second indication information is used to indicate the position of the prefix identifying the corresponding SID included in the element corresponding to the TLV field.
  • the source node when the source node generates a TLV field corresponding to an element, the source node obtains the identification information contained in the fourth element in the segment list, and according to the length of the prefix corresponding to the identification contained in the fourth element and the position of the prefix in the first packet , generating first indication information and second indication information of the second TLV field, wherein the first element is any one of one or more elements in the segment list, and the second TLV field is one or more TLV fields Any TLV field.
  • the source node acquires the first element in the segment list, and when the identifier included in the first element is an uncompressed segment identifier, the first indication information is a first preset value.
  • the first preset value may also be a fixed value or an identifier, and the above numerical value or identifier corresponds to the fact that the identifier included in the element is an uncompressed segment identifier.
  • the first preset value is a fixed value of 128, indicating that the identifier of the uncompressed segment included in the first element is 128 bits.
  • the length value of the prefix corresponding to the identifier contained in the fourth element can be used as the value of the first indication information, that is, the prefix
  • the first indication information is the second preset value
  • the first indication information is the second preset value
  • the second preset value is 64, indicating that the length of the SID prefix corresponding to the C-SID included in the first element is 64 bits.
  • the second indication information is generated according to the position in the first packet of the prefix identifying the corresponding SID in the first element. Specifically, when the prefix corresponding to the identifier included in the first element is in the segment list, the second indication information is a third preset value, and the third preset value is the element where the prefix of the identifier included in the fourth element in the segment list is located. serial number. For example, the prefix corresponding to the segment identifier contained in the first element is in the element G-SID[3], and the sequence number of the element G-SID[3] in the segment list is 3, and the second indication information is 3.
  • the second indication information is the fourth preset value.
  • the fourth preset value is 15, indicating that the prefix corresponding to the identifier contained in the first element is in the destination address of the first packet.
  • the above preset value may also be other values or identifiers, which are not limited in this application.
  • the above exemplarily introduces the process of generating the corresponding second TLV field according to the first element. For the sequentially arranged elements contained in the segment list, according to the above process, multiple TLV fields can be sequentially generated, and details will not be repeated here.
  • the second TLV field may further include third indication information, and the third indication information is used to indicate the position of the first element corresponding to the second TLV field in the segment list.
  • the third indication information is used to indicate the corresponding relationship between the TLV field and the elements in the segment list.
  • the segment list includes n+1 elements G-SID[0]-G-SID[n], and when the third indication information is 0, it means that the TLV corresponds to the element G-SID[0].
  • the third indication information is n, it means that the TLV corresponds to the element G-SID[n].
  • FIG. 5 shows a schematic diagram of a G-SRv6 network
  • the network includes nodes N1-N10
  • node N1 is a source node of the G-SRv6 network.
  • node N1-node N4 are located in network domain 1
  • node N2-node N4 are nodes that support SRv6 header compression
  • the SIDs of node N2-node N4 in network domain 1 are compressed
  • the same compression prefix A is used:
  • node N5 is located in network domain 2 and is a node that does not support SRv6 header compression
  • node N6-node N10 is located in network domain 3
  • node N6-node N9 in network domain 3 is a node that supports SRv6 header compression
  • network domain 3 The SIDs of nodes N6-N9 are compressed, and the same compressed prefix A: is used.
  • the identifier corresponding to the node N10 is an uncompressed segment identifier.
  • the segment list of the first message contains 5 elements: G-SID[0], G-SID[1], G-SID[2], G-SID[3], G-SID [4].
  • the identifier contained in G-SID[4], G-SID[2], and G-SID[1] is C-SID, and its corresponding prefix is A:.
  • the identifiers contained in G-SID[3] and G-SID[0] are SIDs, not C-SIDs.
  • the identifiers included in G-SID[4] are 2:1, 3:1, and 4:1 respectively
  • the segment identifier SID included in G-SID[3] is B:5:1::
  • G-SID[2] includes The identifier of the segment is 6:1, the identifiers included in G-SID[1] are 7:1, 8:1, and 9:F respectively
  • the segment identifier SID included in G-SID[0] is A:10:D100::.
  • segment list contains 5 elements G-SID[0]-G-SID[4], and the corresponding 5 TLV fields are generated:
  • the identifier contained in the element G-SID[4] is C-SID
  • the prefix The length of the TLV field is 64 bits. Therefore, the first indication information of the TLV field corresponding to G-SID[4] is 64, indicating that the identifier contained in the element G-SID[4] is C-SID, and the prefix length corresponding to C-SID is 64.
  • the second indication information is 15, indicating that the above prefix is in the destination address of the first message
  • the third indication information is 4, indicating the position of the element G-SID[4] corresponding to the TLV field in the segment list, so the element The TLV field corresponding to G-SID[4] is [64, 15, 4];
  • the identifier contained in the element G-SID[3] is a non-compressed segment identifier, therefore, the first indication information of the TLV field corresponding to the element G-SID[3] is 128, indicating that the element G-SID[3] contains whether For the compressed SID, the second indication information of the TLV field corresponding to G-SID[3] is 3, indicating that the prefix of the segment identifier is in the element G-SID[3], and the third part of the TLV field corresponding to G-SID[3] The indication information is 3, indicating the position of the element G-SID[3] corresponding to the TLV field in the segment list, that is, the TLV field corresponding to the element G-SID[3] is [128, 3, 3];
  • the identifier contained in the element G-SID[2] is C-SID
  • the length of the prefix corresponding to the C-SID is 64 bits, and it is located in the element G-SID[2]. Therefore, the corresponding first indication information of the TLV field corresponding to element G-SID[2] is 64, indicating that the identifier contained in element G-SID[2] is C-SID, and the prefix length corresponding to C-SID is 64, G -
  • the second indication information of the TLV field corresponding to SID[2] is 2, indicating that the prefix corresponding to the C-SID is in the element G-SID[2], and the third indication information of the TLV field corresponding to G-SID[2] is 2, indicating the position of the element G-SID[2] corresponding to the TLV field in the segment list, that is, the TLV corresponding to the element G-SID[2] is [64, 2, 2];
  • the identifier contained in the element G-SID[1] is C-SID
  • the length of the prefix corresponding to the C-SID is 64 bits, and it is located in the element G-SID[2]. Therefore, the corresponding first indication information of the TLV field corresponding to G-SID[1] is 64, indicating that the identifier contained in the element G-SID[1] is C-SID, and the prefix length corresponding to C-SID is 64
  • G- The second indication information of the TLV field corresponding to SID[1] is 2, indicating that the prefix corresponding to the C-SID is in the element G-SID[2], and the third indication information of the TLV field corresponding to G-SID[1] is 1 , indicating the position of the element G-SID[1] corresponding to the TLV field in the segment list, that is, the TLV field corresponding to the element G-SID[1] is [64, 2, 1];
  • the identifier contained in the element G-SID[0] is a non-compressed segment identifier. Therefore, the corresponding first indication information of the TLV field corresponding to G-SID[0] is 128, indicating that the element G-SID[0] contains an uncompressed SID, and the first indication information of the TLV field corresponding to G-SID[0]
  • the second indication information is 0, indicating that the prefix of the segment identifier is in the element G-SID[0]
  • the third indication information of the TLV field corresponding to G-SID[0] is 0, indicating that the element G-SID[0] corresponding to the TLV field ] in the segment list, that is, the TLV field corresponding to the element G-SID[0] is [128, 0, 0].
  • the lengths of the prefixes corresponding to the C-SIDs of nodes in an SRv6 network domain are the same , and the position of the prefix in the segment list is the same, so that the TLV fields corresponding to the identifiers of the compressed nodes in one SRv6 network domain can share one TLV field.
  • the identifiers included in multiple elements in the segment list are C-SIDs, and the nodes corresponding to the identifiers included in the multiple elements are located in the same SRv6 network domain, then the multiple elements correspond to one TLV field.
  • the identifier contained in the element in the segment list is a SID, the element corresponds to a TLV field.
  • node N1 - node N4 belong to network domain 1 according to five elements G-SID[0]-G-SID[4] included in the segment list.
  • node N1 is the source node
  • node N2-node N4 are nodes supporting SRv6 header compression
  • the identifiers corresponding to node N2-node N4 are C-SID.
  • the three C-SIDs contained in the element G-SID[4] correspond to the nodes N2-N4 respectively, that is to say, the C-SIDs corresponding to the nodes included in the network domain 1 are located in the element G-SID [4].
  • the prefix corresponding to the C-SID in G-SID[4] is located in the destination address, and the length of the prefix is 64 bits. Therefore, the TLV field corresponding to the element G-SID[4] is [4, 64], indicating that the element G- The identifier contained in SID[4] is C-SID, the length of the prefix corresponding to C-SID is 64, and the location of the prefix corresponding to C-SID is in the element G-SID[4], and because the element G-SID[4 ] is the first element in the segment list, so the location of the prefix corresponding to the C-SID is in the destination address field of the first packet.
  • Node N5 is located in network domain 2.
  • Node N5 is a node that does not support SRv6 header compression.
  • the identifier corresponding to node N5 is SID.
  • the SID corresponding to node N5 is located in the element G-SID[3], that is, the element G-SID[3] includes The identifier is SID. Therefore, the element G-SID[3] corresponds to a TLV field.
  • the length of the SID prefix of node N5 in the element G-SID[3] is 128 bits, and the first indication information is 128, indicating that the identifier contained in the element G-SID[3] is a SID; the element G-SID[3] The prefix of the SID of the node N5 is located in the element G-SID[3], and the sequence number of the element G-SID[3] in the segment list is 3, then the second indication information is 3, indicating that the element G-SID[3] includes The prefix of the SID is located in the element G-SID[3].
  • Node N6-Node N9 belong to network domain 3, and Node N6-Node N9 are nodes supporting SRv6 header compression.
  • the identifier corresponding to node N6-node N9 is C-SID. It can be seen from Figure 5 that elements G-SID[2] and G-SID[1] contain C-SIDs corresponding to nodes N6-N9, that is to say, the C-SIDs corresponding to nodes included in network domain 3 are located in In element G-SID[1] and element G-SID[2].
  • the length of the prefix corresponding to the C-SID contained in the element G-SID[1] and element G-SID[2] is 64
  • the first indication information is 64, indicating that the identifier of the node contained in the network domain 3 is C- SID, and the prefix length corresponding to C-SID is 64
  • element G-SID[1] and element G-SID[2] contain the prefix corresponding to C-SID in element G-SID[2]
  • element G-SID [2] The sequence number in the segment list is 2, and the second indication information is 2, indicating that the prefix corresponding to the C-SID of the node contained in the network domain 3 is located in the element G-SID[2], that is, the element G-SID [1] and the prefix corresponding to the C-SID contained in the element G-SID[2] are located in the element G-SID[2].
  • Node N10 is located in network domain 3.
  • Node N10 is a node that does not support SRv6 header compression.
  • the identifier corresponding to node N10 is SID.
  • the SID corresponding to node N10 is located in the element G-SID[0], that is, the element G-SID[0] includes The identifier is SID. Therefore, the element G-SID[0] corresponds to one TLV field.
  • the length of the SID prefix of the node N10 in the element G-SID[0] is 128 bits, and the first indication information is 128, indicating that the identifier contained in the element G-SID[0] is a SID; the element G-SID[0]
  • the prefix of the SID of the node N10 is located in the element G-SID[0]
  • the sequence number of the element G-SID[0] in the segment list is 0, and the second indication information is 0, indicating that the element G-SID[0] includes
  • the prefix of the SID is located in the element G-SID[0].
  • element G-SID[4], element G-SID[3] network, element G-SID[2] and element G-SID[1], element G-SID[0] Four TLV fields can be correspondingly generated as [64, 4], [128, 3], [64, 2], [128, 0]. This can save the space of the message.
  • the indication information contained in the TLV field is not limited to the three indication information listed above, and may also include other forms of indication information, which is not limited in this application. It is not limited to the TLV field formats listed above. In a specific implementation, the TLV field format may also be other formats, which are not limited in this application.
  • S103 The source node encapsulates the TLV field into the SRH of the first packet.
  • S104 The source node sends the first packet.
  • the source node copies the segment identifier of the next-hop node of the source node in the segment list to the DA field of the IPv6 message header, and the source node sends the first message encapsulated with the IPv6 message header.
  • the source node N1 copies the segment identifier 2:1 of the next-hop node of the source node in the segment list to the DA field of the IPv6 packet header.
  • the intermediate forwarding node by generating one or more TLV fields at the source node, when the intermediate forwarding node detects the path failure of the next-hop SR node, the intermediate forwarding node can obtain the next-hop SR node according to the TLV field.
  • the segment identifier of any one of the multiple nodes in the network is updated to the destination address of the message, and forwarded according to the instruction of the segment identifier, thereby bypassing the faulty node or faulty path and completing data transmission.
  • S105 The first node receives the first packet.
  • the first node is an intermediate forwarding node on the forwarding path of the first message, can receive the first message, and process the first message according to the instruction of the segment identifier in the DA field.
  • the first node When determining that the path from the first node to the first node to the second node is faulty, the first node obtains the segment identifier of the third node according to one or more TLV fields in the first packet.
  • the first node determines the position of the element corresponding to the third node identifier in the segment list according to the first pointer and the second pointer in the first message SRH, then determines the TLV field corresponding to the element according to the above position information, and then according to the TLV
  • the indication information contained in the field obtains the segment identifier of the third node.
  • the first pointer is an SL pointer
  • the second pointer is a CL pointer.
  • the value of the SL pointer is used to indicate the position of the element where the node identifier is located in the segment list
  • the value of the CL pointer is used to indicate the position of the above-mentioned identifier in the element.
  • the third node is any one of multiple nodes after the second node on the forwarding path.
  • the third node is a next-hop node of the second node
  • the second node is a next-hop node of the first node on the first packet forwarding path.
  • the above-mentioned first node obtains the segment identifier of the third node, which specifically includes:
  • the first node determines the first value of the SL pointer corresponding to the identifier of the third node.
  • the SL pointer includes one or more values, and the number of values of the SL pointer is consistent with the number of elements contained in the segment list.
  • the first value of the SL pointer is one of one or more values, the first value of the SL pointer indicates the position of the first element in the segment list, and the first element includes the identifier of the third node.
  • the first node acquires the second value of the SL pointer in the first packet and the second value of the CL pointer in the first packet.
  • the second value of the SL pointer refers to the value of the SL pointer when the first node receives the first message, indicating the position of the second element where the identifier in the DA field (that is, the identifier of the first node) is located in the segment list , that is, the second value of the SL pointer is used to indicate the position of the second element in the segment list, and the second element includes the identifier of the first node.
  • the CL pointer includes multiple values.
  • the CL pointer includes 4 values, 0, 1, 2, and 3, which are consistent with the 4 C-SIDs included in the element.
  • the value of the CL pointer has a certain correlation with the value of the SL pointer, for example, when the value of the SL pointer is updated, the value of the CL pointer is updated to an initial value.
  • the value of the CL pointer is 0, the value of the SL pointer and the value of the CL pointer need to be updated, and the value of the SL pointer is decremented by 1, The value of the CL pointer should be updated to 3.
  • the second value of the CL pointer is one of a plurality of values, and the second value of the CL pointer refers to the value of the CL pointer when the first node receives the first message, indicating the identifier in the DA field (that is, the identifier of the first node ) in the second element.
  • the first node judges whether the identifier of the second node is a compressed segment identifier C-SID according to the identifier of the first node, if the identifier of the second node is a non-compressed segment identifier, that is, if the first node
  • the identifier of the two nodes is SID, indicating that the length of the SID of the second node is 128 bits, and the length of one element is 128 bits, and the SID of the second node is located in all bits of an element.
  • the first node judges whether the identifier of the second node is a compressed segment identifier C-SID according to the identifier of the first node. If the identifier of the second node is a compressed segment identifier, that is, the second node.
  • the identifier of the C-SID is C-SID, and the first element and the second element are determined to be the same according to the value of the CL pointer, that is, the first element and the second element are the same element, that is, the second node and the second element are determined according to the value of the CL pointer
  • the third nodes are all in the first element, and the first value of SL is the second value of SL. Wherein, the first element is an element including the identifier of the third node, and the second element is an element including the identifier of the second node.
  • the first node judges whether the identification of the second node is a compressed segment identification C-SID according to the identification of the first node, if it is determined that the identification of the second node is compressed according to the identification of the first node.
  • the identifier of the second node is a C-SID
  • subtract 1 from the second value of the CL pointer to obtain the third value of the CL pointer.
  • the third value of the CL pointer indicates the location of the identity of the second node in the second element.
  • the first node judges whether the third value of the CL pointer is the fifth preset value.
  • the fifth preset value may be a fixed value or an identifier, for example, the fifth preset value is a fixed value of 0.
  • the third value of the CL pointer is not the fifth preset value, it means that the C-SID of the second node is not the last identifier in the second element, and the identifier of the third node is still second to the C-SID of the second node.
  • the second value of the first pointer is used as the first value of the first pointer; or, in the case that the third value of the second pointer is the fifth preset value, the C-SID of the second node is specified is the last identifier in the second element, and subtracts 1 from the second value of the first pointer to obtain the first value of the first pointer.
  • the fifth preset value is associated with the initial value of the CL pointer.
  • the element G-SID[1] in the segment list includes 4 C-SIDs, and the initial value of the CL pointer can be is 3, for example, in message 1, it indicates the first C-SID in the element G-SID[1], that is, 2:1.
  • the initial value of the CL pointer is 0, it indicates the last C-SID in the element G-SID[1], that is, 5:1, and the fifth preset value is 0.
  • the initial value of the CL pointer is 4, it indicates the first C-SID in the element G-SID[1], that is, 2:1.
  • the value of the CL pointer is 1, it indicates the last C-SID in the element G-SID[1].
  • -SID that is, 5:1, the fifth preset value is 1.
  • the first node judging whether the identifier of the second node is a C-SID specifically includes: the first node obtains the identifier of the first node according to the DA field of the first message, and may pass the first The node judges whether the identifier of the first node carries the first tag.
  • the first label is used to indicate that the label of the second node is a compressed segment identifier. If the identifier of the first node does not carry the first flag, it means that the identifier of the second node is an uncompressed segment identifier. If the identifier of the first node carries the first label, it indicates that the identifier of the second node is a C-SID.
  • the first mark is COC Flavor mark. If the identifier in the DA field carries the COC Flavor flag, it means that the next identifier of this identifier in the segment list is C-SID.
  • the above-mentioned first node judging whether the identifier of the second node is a C-SID may also include: the first node obtains the identifier of the first node according to the DA field of the first message, and may pass the A node determines the flag included in the identity of the first node.
  • the mark included in the mark of the first node includes a second mark and a third mark, the second mark is used to indicate that the mark of the second node is a compressed segment mark, and the third mark is used to indicate that the mark of the second node is a non-compressed segment ID.
  • the identifier of the first node includes the second mark, it is determined that the identifier of the second node is a compressed segment identifier. If the identifier of the first node includes the third flag, it is determined that the identifier of the second node is an uncompressed segment identifier.
  • the first node determines the first TLV field according to the first value of the SL pointer corresponding to the third node.
  • the segment list includes one or more elements arranged in sequence
  • the SRH includes the TLV fields arranged in sequence
  • the one or more elements in the segment list are combined with one or more Multiple TLV fields are in a one-to-one correspondence. For example, if the segment list contains 3 elements G-SID[0]-G-SID[2], the first TLV field corresponding to element G-SID[0] and the second TLV field corresponding to element G-SID[1]
  • the first TLV field and the element G-SID[2] correspond to the third TLV field.
  • the value of the SL pointer is used to indicate the position of the element where the identifier is located in the segment list. For example, when the value of the SL pointer is 2, it indicates the element G-SID[2] where the identifier is located. Therefore, the first node acquires the first value of the SL pointer corresponding to the third node, and the first value of the SL pointer is used to indicate the position of the first element where the identifier of the third node is located in the segment list, and the first node according to the SL pointer
  • the first value of the first value of the third node can determine the corresponding sequence number in the segment list of the first element where the identifier of the third node is located, and then the first element can be obtained from one or more TLV fields according to the sequence number corresponding to the first element in the segment list.
  • the corresponding serial number of the element G-SID[2] in the segment list indicating where the identifier is located is 3, according to the corresponding serial number of the element G-SID[2] in the segment list is 3, and the third TLV field is obtained from multiple TLV fields, then it can be determined that the identifier of the third node corresponds to the third TLV field, that is, the first TLV field is the third TLV field among the multiple TLV fields.
  • the third indication information is used to indicate the position or sequence identification of the element corresponding to the identifier corresponding to the TLV in the segment list.
  • the first node may determine the first TLV field according to the first value of the SL pointer and the third indication information. For example, when the first value of the SL pointer is 2, it is determined that the TLV field whose third indication information is 2 is the first TLV field.
  • the first node after the first node obtains the first value of the SL pointer corresponding to the third node, the first node according to the first value of the SL pointer and the first value of each field in one or more TLV fields
  • the second indication information determines the first TLV field. Specifically, when the second indication information of one TLV field among the one or more TLV fields is the same as the first value of the SL pointer, the TLV field is the first TLV field. When the second indication information of each TLV field in one or more TLV fields is not the same as the first value of the SL pointer, take the smallest one of all second indication information greater than the first value of the SL pointer.
  • the TLV field corresponding to the indication information is the first TLV field.
  • the first packet includes three TLV fields [64, 3], [80, 2], [128, 0].
  • the first value of the SL pointer corresponding to the third node is 3, it is the same as the second indication information in the TLV field [64, 3], so the TLV field [64, 3] is the first TLV field.
  • the second indication information in the three TLV fields is 3, 2, and 0, which are different from the first value of the SL pointer.
  • the three second indication information greater than 1 have 3 and 2, and the smallest of 3 and 2
  • the value is 2, that is, the TLV field whose second indication information is 2 is the first TLV field, that is, the first TLV field is [80, 2].
  • S1063 Acquire the segment identifier of the third node according to the first TLV field.
  • the first TLV field includes first indication information and second indication information
  • the first indication information is used to indicate the length of the prefix of the SID corresponding to the identity of the third node
  • the second indication information is used to indicate that the identity of the third node corresponds to The position of the SID prefix in the first packet.
  • the first node obtains the first indication information of the first TLV, and if the first indication information of the first TLV is a first preset value, for example, the first preset value is 128, then determine the The length of the prefix corresponding to the identifier of the second node is 128. In this case, it means that the identifier of the second node is an uncompressed segment identifier, that is to say, the length of the identifier of the third node is 128 bits.
  • the first node may determine the position of the first element where the third node identifier is located in the segment list according to the first value of the SL pointer, and use the first element as the segment identifier of the third node.
  • the first indication information of the first TLV is a second preset value, for example, the second preset value is a value less than 128, it is determined that the identity of the third node is a C-SID.
  • the first node acquires the C-SID of the third node according to the first value of the SL pointer and the first value of the CL pointer.
  • the first value of the SL pointer indicates the position of the first element to which the identifier of the third node belongs in the segment list
  • the first value of the CL pointer indicates the position of the C-SID of the third node in the first element.
  • the first node also needs to obtain the prefix of the SID corresponding to the C-SID of the third node.
  • the first node obtains the length of the prefix of the SID corresponding to the C-SID of the third node according to the first indication information of the first TLV.
  • the second indication information of a TLV is used to obtain the position of the prefix of the SID corresponding to the C-SID of the third node in the first packet.
  • the segment identifier of the third node is obtained according to the C-SID of the third node and the prefix of the SID corresponding to the C-SID of the third node.
  • sequence of one or more TLV fields is taken as an example below, and the following three situations are combined for description.
  • the first type Cross-network domain scenario.
  • FIG. 8a and Figure 8b exemplarily show the G-SRv6 network of two network domains, as shown in Figure 8a and Figure 8b, node N1-node N4 is network domain 1, and node N1-node in network domain 1 N4 is a node that supports SRv6 header compression.
  • the SIDs of node N2-node N4 in network domain 1 are compressed, and the same compression prefix A: is used.
  • Node N5-Node N10 are located in Network Domain 2
  • Node N5-Node N9 in Network Domain 2 are nodes that support SRv6 header compression.
  • the SIDs of Node N5-Node N9 in Network Domain 2 are compressed, and the same Compression prefix B:.
  • the SRH header uses a 32-bit C-SID segment list. Within a network domain, each element contains 4 compressed segment identifiers. When the node N4 detects that the path from the node N4 to the node N5 is faulty, it needs to obtain the segment identifier of the node N6 or the segment identifiers of nodes after the node N6 on the forwarding path for forwarding.
  • node N4 After node N4 receives the first message, it obtains the value of the SL pointer in the first message, and the value of the SL pointer indicates the element where the identity of node N4 is located.
  • the value of the SL pointer A value of 3 indicates that the identifier of the node N4 is in the element G-SID[3], and the value of the CL pointer is 1, indicating that the identifier of the node N4 is in the third C-SID in the element G-SID[3].
  • the ID of the node N5 B:5:1:: is an uncompressed segment ID, indicating that the segment ID of the node N5 occupies one element , update the value of the SL pointer and the value of the CL pointer, decrement the SL pointer by 2, the value of the SL pointer is 1, point to the element G-SID[1], update the value of the CL pointer to 3, point to the element G-SID[1] ] in the first C-SID.
  • the segment identifier of the node N6 corresponds to the second TLV field [ 80, 2, 1].
  • the identifier of the node N6 is obtained as C-SID, and the prefix length corresponding to the C-SID of the node N6 is 80 bits.
  • the second indication information it is obtained that the prefix corresponding to the C-SID of the node N6 is in the element G-SID[2].
  • the prefix corresponding to the C-SID of the node N6 from the element G-SID[2] can be B:.
  • the C-SID of the node N6 is the first C-SID of the element G-SID[1], and the C-SID of the node N6 is 6:1. Therefore, adding the prefix corresponding to the C-SID to the C-SID of the node N6, the segment identifier of the node N6 can be obtained as B:6:1::.
  • the first message After node N4 receives the first message shown in Figure 8b, the first message includes three TLV fields, which are [64, 3], [80, 2], [128, 0], and node N4 obtains the first
  • the value of the SL pointer in a message is 3.
  • the value of the SL pointer corresponding to the node N6 can be obtained as 1.
  • the second indication information in the three TLV fields is not the same as the value of the SL pointer, compare 1 with the second indication information in the three TLV fields, and take the smallest value among the multiple values greater than 1, three
  • the second indication information in the TLV field is 3, 2, 0 respectively, the numbers greater than 1 are 3, 2, and the smallest of 3 and 2 is 2, therefore, it can be determined that the TLV field corresponding to node N6 is [80, 2].
  • the identifier of the node N6 is obtained as C-SID
  • the prefix length corresponding to the C-SID of the node N6 is 80 bits.
  • the prefix corresponding to the C-SID of the node N6 is in the element G-SID[2].
  • the prefix corresponding to the C-SID of the node N6 from the element G-SID[2] can be B:.
  • the value of the SL pointer 1 and the value of the CL pointer 3 it is determined that the C-SID of the node N6 is the first C-SID of the element G-SID[1], and the C-SID of the node N6 is 6:1. Therefore, adding the prefix corresponding to the C-SID to the C-SID of the node N6, the segment identifier of the node N6 can be obtained as B:6:1::.
  • the second type pure compression scene.
  • Both Fig. 9a and Fig. 9b exemplarily show a G-SRv6 network.
  • the network includes a node N1 - a node N10, and the SRH uses a 32-bit C-SID to organize a segment list.
  • node N3 detects that the path from node N3 to node N4 is faulty, it needs to obtain the segment identifier of node N5 or the node after node N5, and forward the first message according to the segment identifier of node N5 or the node after node N5, bypassing faulty node.
  • the value of the SL pointer is 2, indicating that the identifier of the node N3 is in the element G-SID[2]
  • the value of the CL pointer is 2, indicating that the identifier of the node N3 is in The second compressed segment identifier in element G-SID[2].
  • the identifier of the node N4 is obtained as C-SID
  • the value of the CL pointer is updated
  • the value of the CL pointer is reduced by 1 to obtain a value of 1 for the CL pointer
  • the value of the CL pointer is not is 0, according to the value of the SL pointer is 2 and the value of the CL pointer is 1, it points to the third C-SID in the element G-SID[2], indicating that the identity of the node N4 is not in the element G-SID[2]
  • the last C-SID, the identity of node N5 is in element G-SID[2].
  • the value of the SL pointer corresponding to the node N5 is 2. According to the value of SL being 2, indicating that the identifier of node N5 is in the element G-SID[2], and G-SID[2] corresponds to the third TLV field, it can be determined that the identifier of node N5 corresponds to the third TLV field[64 , 15, 2].
  • the prefix A: corresponding to the C-SID of the node N5 can be obtained from the destination address.
  • the third C-SID of the C-SID of node N4 in the element G-SID[2] can be obtained, the value of the CL pointer is updated, and the value of the CL pointer The value is subtracted by 1 to obtain the value of the CL pointer as 0, and the fourth C-SID of the C-SID of the node N5 in the element G-SID[2] is determined, and the C-SID of the node N5 is obtained as 5:1. Therefore, the C-SID 5:1 of the node N5 adds the prefix A: corresponding to the C-SID, and the segment identifier of the node N5 can be obtained as A:5:1::.
  • the first message After node N3 receives the first message shown in Figure 9b, the first message includes two TLV fields, which are [64,2] and [128,0] respectively, and node N3 obtains the SL pointer in the first message The value of is 2. From the above analysis of FIG. 9a, it can be known that the value of the SL pointer corresponding to the node N5 is 2. The second indication information in the TLV field [64, 2] is the same as the value of the SL pointer, therefore, it can be determined that the TLV field corresponding to the node N5 is [64, 2].
  • the prefix corresponding to the C-SID of the obtained node N5 is located in the destination address field of the first packet.
  • the prefix A: corresponding to the C-SID of the node N5 can be obtained from the destination address. According to the value of the SL pointer of 2 and the value of the CL pointer of 1, the third C-SID of the C-SID of node N4 in the element G-SID[2] can be obtained, the value of the CL pointer is updated, and the value of the CL pointer The value is subtracted by 1 to obtain the value of the CL pointer as 0, and the fourth C-SID of the C-SID of the node N5 in the element G-SID[2] is determined, and the C-SID of the node N5 is obtained as 5:1. Therefore, the C-SID 5:1 of the node N5 adds the prefix A: corresponding to the C-SID, and the segment identifier of the node N5 can be obtained as A:5:1::.
  • the segment identification of the node after the node N5 on the packet forwarding path can also be obtained, for example, the segment identification of the node N6 can be obtained, which will not be repeated here.
  • the third type Compressed and non-compressed mixed orchestration scenarios.
  • Figure 10a and Figure 10b exemplarily show a G-SRv6 network.
  • nodes N1 to node N4 are in G-SRv6 network domain 1, and nodes N2 to node N4 in network domain 1
  • the SIDs of nodes N2 to N4 in network domain 1 are compressed, and the same compression prefix A: is used.
  • Node N5 is located in network domain 2.
  • Node N5 is a standard SRv6 node that does not support SRv6 header compression.
  • the identifier corresponding to node N5 is an uncompressed segment identifier.
  • Nodes N6 to N10 are in G-SRv6 network domain 3
  • nodes N6 to node N10 in network domain 3 are nodes that support SRv6 header compression
  • the SIDs of nodes N6 to node N9 in network domain 3 are compressed and used With the same compressed prefix A:, the corresponding identifier of the node N10 is an uncompressed segment identifier.
  • the SRH header uses a 32-bit C-SID and a 128-bit SID to compile a segment list.
  • the node N3 When the node N3 detects that the path from the node N3 to the node N4 is faulty, it needs to obtain the segment identifier of the node N5 or the node after the node N5, and forward the first packet according to the segment identifier of the node N5 or the node after the node N5 on the forwarding path. text, bypassing the faulty node.
  • the value of the SL pointer is 4, indicating that the identifier of the node N3 is in the element G-SID[4], and the value of the CL pointer is 2, indicating that the identifier of the node N3 is in The second C-SID in element G-SID[4].
  • the identification of node N4 is obtained as C-SID
  • the value of the CL pointer is updated
  • the value of the CL pointer is reduced by 1
  • the value of the CL pointer is 1, not 0, according to
  • the value of the SL pointer is 4 and the value of the CL pointer is 1, and the 32-bit C-SID of N4 is obtained.
  • the value of the CL pointer is updated, and the value of the CL pointer is decremented by 1 to obtain the value of the CL pointer as 0, and the 32-bit C-SID is obtained.
  • the C-SID of the node N4 is the last C-SID in the element G-SID[4].
  • the value of the SL pointer is updated, and the value of the SL pointer is decremented by 1, so that the value of the SL pointer is 3.
  • the value of the SL pointer is 3, according to the value of the SL pointer is 3, indicating that the identification of the node N5 is in the element G-SID[3], and the element G-SID[3] corresponds to the fourth TLV field, then the node N5 can be determined
  • the identifier of corresponds to the fourth TLV field [128, 3, 3].
  • the identification of node N5 is an uncompressed segment identification, indicating that the segment identification of node N5 is 128 bits, occupying one element, that is, element G -SID[3], so the 128-bit segment identifier B:5:1:: can be obtained, that is, the segment identifier of the node N5 is B:5:1::.
  • the first message includes four TLV fields, which are [64,4], [128,3,], [64,2], [128, 0].
  • the node N3 obtains the value of the SL pointer in the first message as 3, and it can be known from the analysis of FIG. 10 a that the value of the SL pointer corresponding to the node N5 can be obtained as 3.
  • the second indication information in the TLV field [128,3,] is the same as the value of the SL pointer, therefore, it can be determined that the TLV field corresponding to the node N5 is [128,3].
  • the identifier of node N5 is a non-compressed segment identifier, indicating that the segment identifier of node N5 is 128 bits and occupies one element, that is, the element G-SID[3] , so the 128-bit segment identifier B:5:1:: can be obtained, that is, the segment identifier of the node N5 is B:5:1::.
  • the above G-SRv6 network shown in FIG. 8a-FIG. 10b also includes a transit node, which is not shown in the figure.
  • a transit node is a node that forwards G-SRv6 messages but does not process G-SRv6 messages.
  • the intermediate forwarding node on the forwarding path may be a transit node or an SR node, which is not limited in this application.
  • the first node may also be a transit node, and the transit node is a node that forwards the G-SRv6 message but does not process the G-SRv6 message.
  • the transit node detects that the path from the transit node to the next hop SR node is faulty, the transit node becomes a node supporting the SRv6 function, processes packets instead of the faulty node, and bypasses the faulty node or faulty path. For example, obtain the segment identifier of the next hop node of the faulty node, and forward the message according to the segment identifier.
  • Figure 11a and Figure 11b show a schematic diagram of a G-SRv6 network, as shown in Figure 11a and Figure 11b, the nodes N1-N10 in the network are in the G-SRv6 network domain, and the network domain contains nodes
  • the SIDs of node N2-node N9 in this network domain are compressed, and the same compressed prefix A: is used.
  • the segment list specifies the nodes to be passed along the way, and N3' is a transit node, which is not in the segment list.
  • the SRH header uses a 32-bit C-SID to program the segment list.
  • the node N3' When the node N3' detects that the next hop node N4 fails, the node N3' becomes a node capable of processing G-SRv6 messages, obtains the segment identifier of the node N5, and forwards according to the instruction of the segment identifier of the node N5.
  • the value of the SL pointer is 2, indicating that the identifier of the node N4 is in the element G-SID[2], and the value of the CL pointer is 1, indicating that the identity of the node N4 is Identifies the third C-SID in element G-SID[2].
  • the identifier of node N5 is obtained as C-SID.
  • the value of the CL pointer is not 0, indicating that the C-SID of the N4 node is not the last segment identifier in the element G-SID[2], update the value of the CL pointer, subtract 1 from the value of the CL pointer, and obtain the value of the CL pointer as 0 , indicating that the identifier of the node N5 is in the last C-SID of the element G-SID[2]. Therefore, it can be obtained that the value of the SL pointer corresponding to the node N5 is 2.
  • the node N5 corresponds to the third TLV field [64, 15, 2].
  • the first indication information in the third TLV field [64, 15, 2] being 64
  • the length of the prefix corresponding to the C-SID of the node N5 is 64 bits.
  • the second indication information is 15, and it can be obtained that the location of the prefix corresponding to the C-SID of the node N5 is located in the DA field of the first message.
  • the 64-bit prefix A can be obtained from the destination address field of the first packet.
  • the first message After the node N3' receives the first message shown in Figure 10b, the first message includes two TLV fields, which are [64,2] and [128,0] respectively.
  • the node N3' obtains the value of the SL pointer in the first message as 2, and it can be seen from the above analysis of FIG. 9a that the value of the SL pointer corresponding to the node N5 can be obtained as 2.
  • the second indication information 2 in the TLV field [64,2] is the same as the value 2 of the SL pointer, therefore, it can be determined that the TLV field corresponding to the node N5 is [64,2].
  • the possible identification of the node N5 is C-SID
  • the length of the prefix corresponding to the C-SID of the node N5 is 64 bits.
  • the second indication information is 2, and it can be obtained that the prefix corresponding to the C-SID of the node N5 is located in the element G-SID[2]. Since the second indication information of the two TLV fields in the first message is 2 and 0 respectively. 2 is the largest value in the second indication information in the first message, it can be obtained that the element G-SID[2] is a segment list Therefore, the prefix corresponding to the C-SID of the obtained node N5 is located in the destination address field of the first packet.
  • the prefix A: corresponding to the C-SID of the node N5 can be obtained from the destination address. According to the value of the SL pointer of 2 and the value of the CL pointer of 1, the third C-SID of the C-SID of node N4 in the element G-SID[2] can be obtained, the value of the CL pointer is updated, and the value of the CL pointer The value is subtracted by 1 to obtain the value of the CL pointer as 0, and the fourth C-SID of the C-SID of the node N5 in the element G-SID[2] is determined, and the C-SID of the node N5 is obtained as 5:1. Therefore, the C-SID 5:1 of the node N5 adds the prefix A: corresponding to the C-SID, and the segment identifier of the node N5 can be obtained as A:5:1::.
  • the first node Based on the first packet, the first node copies the segment identifier of the third node into the destination address of the first packet, encapsulates it into a second packet, and sends the second packet.
  • the first node After the first node obtains the segment ID of the third node, it copies the segment ID of the third node to the DA field, updates the SL pointer and the CL pointer, and encapsulates the first message into a second message, according to the DA field in the second message
  • the instruction of the segment identifier of the field is used to forward the second message.
  • the intermediate forwarding node by adding indication information in the first message, when the intermediate forwarding node on the forwarding path detects the path failure of the next hop SR node, the intermediate forwarding node can obtain the next hop SR node on the forwarding path
  • the segment identification of any one of the multiple nodes in the network forwards the message according to the instructions contained in the function field of the segment identification, thereby bypassing the faulty node, so that the message can continue to be forwarded, and the data transmission is completed.
  • the indication information may also be encapsulated in the segment identifier.
  • the indication information may also be encapsulated in the segment identifier.
  • 128 bits, 16 bits in the IPv6 address are used as indication information, and the rest are used as path information identifiers.
  • FIG. 12 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • the network device 100 at least includes: a first receiving unit 110, a first processing unit 120, and a first Sending unit 130; wherein,
  • the first receiving unit 110 is configured to obtain a segment list of the first message, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, and the one or more elements Each element in includes one or more identifiers, and each identifier in the one or more identifiers corresponds to a node among the plurality of nodes in the forwarding path or a link in the forwarding path;
  • the first processing unit 120 is configured to generate one or more type-length-value TLVs according to the segment list.
  • the first sending unit 130 is configured to send the first packet, the first packet includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used Prefix information corresponding to a segment identifier SID indicating a node in the plurality of nodes or a link in the forwarding path.
  • the above-mentioned network device 100 generates the first TLV field according to the first element in the segment list of the first message, and encapsulates and forwards the first message in a manner corresponding to that in the above-mentioned method embodiment The manner in which the source node processes the first packet will not be repeated here.
  • FIG. 13 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • the network device 200 at least includes: a second receiving unit 210, a second processing unit 220 and a The sending unit 230, wherein,
  • the second receiving unit 210 is used for the first node to receive the first message, the first message includes a segment list, the segment list corresponds to the forwarding path of the first message, and the segment list includes one or a plurality of elements, the elements including one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path;
  • the second processing unit 220 is configured to, when determining that the path from the first node to the second node is faulty, the first node obtains the first node according to one or more type-length-value TLVs in the first packet
  • the segment identification of three nodes, the second node is the next hop segment routing SR node of the first node in the forwarding path, and the third node is after the second node in the forwarding path
  • Any one of the nodes in the one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used to indicate a node in the plurality of nodes or a link in the forwarding path
  • the first node obtains a second message according to the first message
  • the second sending unit 230 is configured to send the second message, where the destination address of the second message includes the segment identifier of the third node.
  • the above-mentioned network device 100 obtains the segment identifier of the second node and forwards the first TLV field of the received first message in a manner corresponding to the first node in the above-mentioned method embodiment.
  • the manner of processing a message will not be repeated here.
  • each of the above-mentioned devices includes a corresponding hardware structure and/or software module for performing each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and method steps described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the embodiment of the present application may divide each device into functional units according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation.
  • FIG. 14 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • the network device 300 includes at least a processor 310, a transceiver 320, and a memory 330.
  • the processor 310, the transceiver 320, and The memories 330 are interconnected via a bus 340, wherein,
  • the processor 310 may be a central processing unit (central processing unit, CPU), or a combination of a CPU and a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof.
  • the aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
  • the transceiver 320 may include a receiver and a transmitter, for example, a wireless radio frequency module, and the processor 310 described below receives or sends a certain message, specifically, it can be understood that the processor 310 receives or sends a message through the transceiver .
  • the memory 330 includes but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM) or erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM or flash memory), the memory 330 is used to store related instructions and data, and can transmit the stored data to the processor 310.
  • RAM Random Access Memory
  • ROM read-only memory
  • EPROM erasable programmable Read-Only Memory
  • flash memory erasable programmable read-only memory
  • the processor 310 in the network device 300 is used to read relevant instructions in the memory 330 to perform the following operations:
  • the processor 310 acquires the segment list of the first message, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, and the one or more elements Each element of includes one or more identifiers, and each identifier in the one or more identifiers corresponds to a node among the plurality of nodes in the forwarding path or a link in the forwarding path;
  • the transmitter in the transceiver 320 sends the first packet, the first packet includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information Prefix information corresponding to a segment identifier SID used to indicate a node among the plurality of nodes or a link in the forwarding path.
  • FIG. 15 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • the network device 400 includes at least a processor 410, a transceiver 420, and a memory 430.
  • the processor 410, the transceiver 420, and the memory 430 are connected to each other through a bus 440, wherein,
  • the processor 410 may be a central processing unit (central processing unit, CPU), or a combination of a CPU and a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof.
  • the aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
  • the transceiver 420 may include a receiver and a transmitter, for example, a wireless radio frequency module, and the processor 410 described below receives or sends a certain message, specifically, it can be understood that the processor 410 receives or sends a message through the transceiver .
  • the memory 430 includes but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM) or erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM or flash memory), the memory 430 is used to store related instructions and data, and can transmit the stored data to the processor 410.
  • RAM Random Access Memory
  • ROM read-only memory
  • EPROM erasable programmable Read-Only Memory
  • flash memory erasable programmable read-only memory
  • the processor 410 in the network device 400 is used to read relevant instructions in the memory 430 to perform the following operations:
  • the processor 410 controls the receiver in the transceiver 420 to receive the first message, the first message includes a segment list, the segment list corresponds to the forwarding path of the first message, and the segment list includes one or a plurality of elements, the elements including one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path;
  • each of the one or more TLVs includes indication information, and the indication information is used to indicate a segment identifier SID of a node in the plurality of nodes or a link in the forwarding path prefix information;
  • the processor 410 obtains a second packet according to the first packet
  • the transmitter in the transceiver 420 sends a second packet, where the destination address of the second packet includes the segment identifier of the second node.
  • FIG. 16 shows a possible schematic diagram of a network system provided by an embodiment of the present application.
  • the network system 600 includes a first network device 610 and a second network device 620 .
  • the first network device 610 in the network system may execute the processing steps of the source node in the embodiment shown in FIG. 4
  • the second network device 620 in the network system may execute the processing steps of the first node in the embodiment shown in FIG. 4 .
  • the first network device 610 in the network system may be the network device 100 in the embodiment shown in FIG. 12
  • the second network device 620 may be the network device 200 in the embodiment shown in FIG. 13
  • the first network device 610 in the network system may be the network device 300 in the embodiment shown in FIG. 14
  • the second network device 620 may be the network device 400 in the embodiment shown in FIG. 15 .
  • the first network device is configured to obtain a segment list of the first message, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, the Each of the one or more elements includes one or more identifiers, each of the one or more identifiers corresponds to one of the multiple nodes in the forwarding path or a node in the forwarding path a link; send the first packet, the first packet includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used to indicate the prefix information of a node among the multiple nodes or a segment identifier SID of a link in the forwarding path.
  • a second network device configured to receive a first message, where the first message includes a segment list, the segment list corresponds to a forwarding path of the first message, and the segment list includes one or more elements,
  • the element includes one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path; when the first When the path from the node to the second node fails, the first node obtains the segment identifier of the third node according to one or more type-length-value TLVs in the first message, and the second node is the The next hop segment routing SR node of the first node in the forwarding path, the third node is any node in the nodes after the second node in the forwarding path, and the one or more Each TLV in the TLV includes indication information, and the indication information is used to indicate prefix information of a segment identifier SID of a node in the plurality of nodes or a link in the forwarding path; the first
  • the embodiment of the present invention also provides a non-transitory storage medium, which is used to store the software instructions used in the foregoing embodiments, which includes the program for executing the method shown in the foregoing embodiments, when it is stored on a computer or a network device When executed, the computer or network device shown in the example is made to execute the methods in the aforementioned method embodiments.
  • the embodiment of the present invention also provides a computer program product including computer program instructions, and when the computer program product is run on a computer, the network device is made to execute the method in the foregoing method embodiments.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)).

Landscapes

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

Abstract

Disclosed in the present application are a data transmission method, a related device, and a computer storage medium. According to the data transmission method, a TLV field is generated at a source node and encapsulated in an SRH header of a first packet, and when an intermediate forwarding node on a forwarding path detects a fault at a next segment routing SR node on the forwarding path or a path fault to the next segment routing SR node, the TLV field can be used to instruct the intermediate forwarding node to obtain a segment identifier of any one of a plurality of nodes after a next segment routing SR node on a first packet forwarding path, update the obtained segment identifier to a destination address of the packet, and perform forwarding according to an instruction of the segment identifier, so as to bypass the fault node or the fault path to complete data transmission.

Description

一种数据传输方法、相关设备及计算机存储介质A data transmission method, related equipment and computer storage medium
本申请要求于2021年07月29日提交中国专利局、申请号为202110865850.8、申请名称为“一种数据传输方法、相关设备及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110865850.8 and the application title "A data transmission method, related equipment and computer storage medium" submitted to the China Patent Office on July 29, 2021, the entire contents of which are incorporated by reference incorporated in this application.
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种数据传输方法、相关设备及计算机存储介质。The present application relates to the field of computer technology, in particular to a data transmission method, related equipment and computer storage media.
背景技术Background technique
基于转发平面的段路由(segment routing for IPv6,SRv6)是基于源路由理念而设计的在网络上转发IPv6报文的一种协议。SRv6在报文转发路径的源节点为报文添加一个IPv6的段路由报头(segment routing header,SRH),该SRH包含用于标识转发路径的段列表(segment list)。该段列表包含报文转发路径上的网络节点的IPv6地址。通用SRv6(generalized SRv6,G-SRv6)是一种为了节省报文开销而提出的新的SRv6技术。在G-SRv6中,G-SRv6在数据封装上不改变原生段列表的格式和语义,支持将128比特的普通段标识和32/16比特的压缩段标识混合编程在段列表中。Segment routing for IPv6 (SRv6) based on the forwarding plane is a protocol designed based on the concept of source routing to forward IPv6 packets on the network. SRv6 adds an IPv6 segment routing header (segment routing header, SRH) to the message at the source node of the message forwarding path, and the SRH contains a segment list (segment list) used to identify the forwarding path. The segment list includes IPv6 addresses of network nodes on the packet forwarding path. Generalized SRv6 (generalized SRv6, G-SRv6) is a new SRv6 technology proposed to save packet overhead. In G-SRv6, G-SRv6 does not change the format and semantics of the original segment list in terms of data encapsulation, and supports the mixed programming of 128-bit common segment identifiers and 32/16-bit compressed segment identifiers in the segment list.
但是在G-SRv6报文转发方案中,转发路径上的中间节点在检测到下一跳(segment routing,SR)节点的路径故障时,该中间节点无法根据段列表完成报文转发。因此,在转发路径上的中间节点在检测到下一跳SR节点的路径出现故障时,如何实现报文的转发是一个亟待解决的技术问题。But in the G-SRv6 message forwarding scheme, when the intermediate node on the forwarding path detects the path failure of the next hop (segment routing, SR) node, the intermediate node cannot complete message forwarding according to the segment list. Therefore, when the intermediate node on the forwarding path detects that the path of the next hop SR node is faulty, how to implement message forwarding is an urgent technical problem to be solved.
发明内容Contents of the invention
本申请公开了一种数据传输方法、相关设备及计算机存储介质,在报文转发路径上的中间节点在检测到下一跳节点的路径故障时,能够按照段列表进行转发报文,完成数据传输。The application discloses a data transmission method, related equipment and computer storage medium. When the intermediate node on the message forwarding path detects the path failure of the next hop node, it can forward the message according to the segment list to complete the data transmission. .
第一方面,本申请实施例公开提供了数据传输方法,该方法包括:第一节点接收第一报文,所述第一报文包括段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中的一个节点或所述转发路径中的一个链路;In the first aspect, the embodiment of the present application discloses a data transmission method, the method includes: a first node receives a first message, the first message includes a segment list, and the segment list corresponds to the first message Forwarding paths, the segment list includes one or more elements, and the elements include one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or the a link in the forwarding path;
当确定所述第一节点到第二节点的路径故障时,所述第一节点根据所述第一报文中的一个或多个类型-长度-值TLV获得第三节点的段标识,所述第二节点是所述转发路径中所述第一节点的下一跳分段路由SR节点,所述第三节点是所述转发路径中在所述第二节点之后的节点中的任意一个节点,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID对应的前缀信息;When determining that the path from the first node to the second node is faulty, the first node obtains the segment identifier of the third node according to one or more type-length-value TLVs in the first message, the The second node is a next-hop segment routing SR node of the first node in the forwarding path, and the third node is any node in the nodes after the second node in the forwarding path, Each of the one or more TLVs includes indication information, where the indication information is used to indicate prefix information corresponding to a segment identifier SID of a node in the plurality of nodes or a link in the forwarding path ;
所述第一节点根据所述第一报文获得第二报文;The first node obtains a second message according to the first message;
所述第一节点发送所述第二报文,所述第二报文的目的地址包括所述第三节点的段标识。The first node sends the second packet, and the destination address of the second packet includes the segment identifier of the third node.
本申请实施例中,通过在源节点处生成TLV字段并封装在第一报文的SRH头,在转发 路径上的中间转发节点检测到转发路径上下一跳SR节点出现故障或者到下一跳SR节点的路径故障时,该TLV字段能够用于指示该中间转发节点获取第一报文转发路径上的下一跳SR节点以后的多个节点中的任意一个节点的段标识,将获取的段标识更新在报文的目的地址,按照该段标识的指令进行转发,从而绕过故障节或者故障路径,完成数据传输。In this embodiment of the application, by generating a TLV field at the source node and encapsulating it in the SRH header of the first packet, the intermediate forwarding node on the forwarding path detects that the next-hop SR node on the forwarding path fails or the next-hop SR node fails. When the path of the node fails, the TLV field can be used to instruct the intermediate forwarding node to obtain the segment identifier of any one of the multiple nodes after the next hop SR node on the first packet forwarding path, and the obtained segment identifier Update the destination address of the message, and forward it according to the instruction identified in this segment, so as to bypass the fault node or fault path and complete the data transmission.
在一可能的实施例中,所述第一节点根据所述第一报文中的第一类型-长度-值TLV,获得所述第三节点的段标识,包括:根据所述一个或多个类型-长度-值TLV和段剩余SL的第一值获得所述第三节点段标识,所述SL的第一值指示第一元素在所述段列表中的位置,所述第一元素包括所述第三节点的标识。In a possible embodiment, the first node obtains the segment identifier of the third node according to the first type-length-value TLV in the first message, including: according to the one or more The first value of type-length-value TLV and segment remaining SL obtains the segment identification of the third node, the first value of the SL indicates the position of the first element in the segment list, and the first element includes the The identification of the third node.
在一可能的实施例中,上述根据所述一个或多个类型-长度-值TLV和段剩余SL的第一值获得所述第三节点段标识,包括:根据所述SL的第一值获取第一TLV,所述第一TLV是所述一个或多个TLV中的一个TLV;根据所述SL的第一值和所述第一TLV的指示信息获取所述第三节点段标识。In a possible embodiment, obtaining the segment identifier of the third node according to the one or more type-length-value TLVs and the first value of the segment remaining SL includes: obtaining the segment identifier according to the first value of the SL A first TLV, where the first TLV is one of the one or more TLVs; and acquiring the third node segment identifier according to the first value of the SL and the indication information of the first TLV.
在一可能的实施例中,上述根据所述SL的第一值获取第一TLV,包括:获取所述SL的第二值,所述SL的第二值是指所述第一节点接收到所述第一报文时SL的值,所述SL的第二值用于指示第二元素在所述段列表中的位置,所述第二元素包括所述第一节点的标识;根据所述SL的第二值确定所述SL的第一值;根据所述SL的第一值获取第一TLV。In a possible embodiment, the acquiring the first TLV according to the first value of the SL includes: acquiring the second value of the SL, where the second value of the SL means that the first node receives the The value of SL when the first message is described, the second value of the SL is used to indicate the position of the second element in the segment list, and the second element includes the identifier of the first node; according to the SL The second value of the SL determines the first value of the SL; the first TLV is obtained according to the first value of the SL.
在一可能的实施例中,上述根据所述SL的第二值确定所述SL的第一值,包括:如果根据所述第一节点的标识确定所述第二节点的标识为非压缩段标识,将所述SL的第二值减2得到所述SL的第一值。In a possible embodiment, the above-mentioned determining the first value of the SL according to the second value of the SL includes: if it is determined according to the identifier of the first node that the identifier of the second node is an uncompressed segment identifier , subtracting 2 from the second value of SL to obtain the first value of SL.
在一可能的实施例中,上第一标记用于指示所述第二节点的标记为压缩段标识,In a possible embodiment, the upper first mark is used to indicate that the mark of the second node is a compressed segment identifier,
所述根据所述第一节点的标识确定所述第二节点的标识为非压缩段标识,包括:根据所述第一报文的目的地址获得所述第一节点的标识;The determining that the identifier of the second node is an uncompressed segment identifier according to the identifier of the first node includes: obtaining the identifier of the first node according to the destination address of the first message;
如果所述第一节点的标识中不包括所述第一标记,确定所述第二节点的标识为非压缩段标识。If the identifier of the first node does not include the first flag, determine that the identifier of the second node is an uncompressed segment identifier.
在一可能的实施例中,上述根据所述SL的第二值确定所述SL的第一值,包括:如果根据所述第一节点的标识确定所述第二节点的标识为压缩段标识,并且根据压缩段标识剩余CL的值确定所述第一元素和所述第二元素相同,所述SL的第一值为所述SL的第二值;或In a possible embodiment, the above-mentioned determining the first value of the SL according to the second value of the SL includes: if it is determined according to the identifier of the first node that the identifier of the second node is a compressed segment identifier, and determining that the first element is the same as the second element according to the value of the remaining CL identified by the compressed segment, and the first value of the SL is the second value of the SL; or
如果根据所述第一节点的标识确定所述第二节点的标识为压缩段标识,并且根据CL的值确定所述第二节点的标识位于第三元素最后一个标识的位置,所述第三元素包括所述第二节点的标识,将所述SL的第二值减1得到所述SL的第一值。If it is determined according to the identifier of the first node that the identifier of the second node is a compressed segment identifier, and it is determined according to the value of CL that the identifier of the second node is located at the last identifier of the third element, the third element Including the identifier of the second node, subtracting 1 from the second value of the SL to obtain the first value of the SL.
在一可能的实施例中,上述第二标记用于指示所述第二节点的标记为压缩段标识,所述根据所述第一节点的标识确定所述第二节点的标识为压缩段标识,包括:根据所述第一报文的目的地址获得所述第一节点的标识;如果所述第一节点的标识中包括所述第二标记,确定所述第二节点的标识为压缩段标识。In a possible embodiment, the above-mentioned second mark is used to indicate that the mark of the second node is a compressed segment identifier, and determining that the identifier of the second node is a compressed segment identifier according to the identifier of the first node, The method includes: obtaining the identifier of the first node according to the destination address of the first message; if the identifier of the first node includes the second mark, determining that the identifier of the second node is a compressed segment identifier.
在一可能的实施例中,上述段列表中的一个或多个元素和所述一个或多个TLV是一一对应的关系,对应根据所述SL的第一值获取第一TLV,包括:根据所述SL的第一值确定所述第一元素在所述段列表中对应的序号;根据所述第一元素在所述段列表中对应的序号,在所述一个或多个TLV中获取所述第一TLV。In a possible embodiment, there is a one-to-one correspondence relationship between one or more elements in the segment list and the one or more TLVs, corresponding to obtaining the first TLV according to the first value of the SL, including: The first value of the SL determines the sequence number corresponding to the first element in the segment list; according to the sequence number corresponding to the first element in the segment list, obtain the sequence number in the one or more TLVs Describe the first TLV.
在一可能的实施例中,上述根据所述SL的第一值和所述第一TLV的指示信息获取所述第三节点段标识,包括:根据所述SL的第一值和所述第一TLV的第一指示信息获取所述第三节点段标识,其中,所述第一TLV的指示信息包括第一指示信息,所述第一指示信息用于 指示所述第三节点的段标识的前缀的长度。In a possible embodiment, the acquisition of the third node segment identifier according to the first value of the SL and the indication information of the first TLV includes: according to the first value of the SL and the first The first indication information of the TLV obtains the segment identifier of the third node, wherein the indication information of the first TLV includes first indication information, and the first indication information is used to indicate a prefix of the segment identifier of the third node length.
在一可能的实施例中,上述根据所述SL的第一值和所述第一TLV的第一指示信息获取所述第三节点段标识,包括:如果所述第一TLV的第一指示信息为第一预设值,确定所述第三节点的段标识为非压缩段标识;根据所述SL的第一值确定所述第三节点的段标识。In a possible embodiment, the acquisition of the third node segment identifier according to the first value of the SL and the first indication information of the first TLV includes: if the first indication information of the first TLV is a first preset value, determining that the segment identifier of the third node is an uncompressed segment identifier; determining the segment identifier of the third node according to the first value of the SL.
在一可能的实施例中,上述根据所述SL的第一值和所述第一TLV的第一指示信息获取所述第三节点段标识,包括:如果所述第一TLV的第一指示信息为第二预设值,确定所述第三节点的段标识为压缩段标识;In a possible embodiment, the acquisition of the third node segment identifier according to the first value of the SL and the first indication information of the first TLV includes: if the first indication information of the first TLV is a second preset value, determining that the segment identifier of the third node is a compressed segment identifier;
根据所述SL的第一值确定所述第一元素在所述段列表中的位置;根据所述CL的值确定所述第三节点的标识所在的所述第一元素中的位置;determining the position of the first element in the segment list according to the first value of the SL; determining the position in the first element where the identifier of the third node is located according to the value of the CL;
获取所述第三节点的标识;根据所述第三节点的标识,所述第一TLV的第一指示信息和所述第一TLV的第二指示信息获取所述第三节点的段标识,其中,所述第二指示信息用于指示所述第三节点的段标识的前缀的位置。Acquire the identifier of the third node; acquire the segment identifier of the third node according to the identifier of the third node, the first indication information of the first TLV and the second indication information of the first TLV, wherein , the second indication information is used to indicate the location of the prefix of the segment identifier of the third node.
在一可能的实施例中,所述段列表位于所述第一报文的段扩展路由头SRH中,所述第一TLV位于所述第一报文的SRH中。In a possible embodiment, the segment list is located in the segment extended routing header SRH of the first packet, and the first TLV is located in the SRH of the first packet.
在一可能的实施例中,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素的长度为128bits比特。In a possible embodiment, the segment list includes one or more elements, and the length of each element in the one or more elements is 128 bits.
第二方面,本申请实施例提供一种数据传送方法,包括:In the second aspect, the embodiment of the present application provides a data transmission method, including:
获取第一报文的段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中多个节点中的一个节点或所述转发路径中的一个链路;Obtain a segment list of the first message, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, and each element in the one or more elements includes a or multiple identifiers, each of the one or more identifiers corresponds to a node among the plurality of nodes in the forwarding path or a link in the forwarding path;
发送所述第一报文,所述第一报文包括一个或多个TLV,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID对应的前缀信息。sending the first message, the first message includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used to indicate that among the multiple nodes Prefix information corresponding to a segment identifier SID of a node or a link in the forwarding path.
在一可能的实施例中,所述发送所述第一报文之前,包括:根据所述段列表,生成一个或多个类型-长度-值TLV。In a possible embodiment, before sending the first packet, the method includes: generating one or more type-length-value TLVs according to the segment list.
在一可能的实施例中,上述根据所述段列表,生成一个或多个类型-长度-值TLV,包括:In a possible embodiment, the above generates one or more type-length-value TLVs according to the segment list, including:
获取所述段列表中的第四元素,所述第四元素是所述一个或多个元素中的任意一个;obtaining a fourth element in the segment list, where the fourth element is any one of the one or more elements;
根据所述第四元素中包括的一个或多个标识,生成第二TLV,所述第二TLV是所述一个或多个TLV中的一个。Generate a second TLV according to the one or more identifiers included in the fourth element, where the second TLV is one of the one or more TLVs.
在一可能的实施例中,所述第二TLV的指示信息包括第一指示信息,所述第一指示信息用于指示所述第四元素包括的标识的前缀的长度;In a possible embodiment, the indication information of the second TLV includes first indication information, and the first indication information is used to indicate the length of the identified prefix included in the fourth element;
所述根据所述第四元素中包括的标识信息,生成第二TLV,包括:根据所述第四元素中包括的标识的前缀的长度,生成所述第二TLV的第一指示信息。The generating the second TLV according to the identification information included in the fourth element includes: generating the first indication information of the second TLV according to the length of the identified prefix included in the fourth element.
在一可能的实施例中,所述根据所述第四元素中包括的标识的长度,生成第二TLV的第一指示信息,包括:在所述第四元素中包括的标识为非压缩段标识时,所述第二TLV的第一指示信息为所述第一预设值;或者,在所述第四元素中包括的标识为压缩段标识时,且所述第四元素中包括的标识的前缀的长度为第二预设值时,所述第二TLV的第一指示信息为所第二预设值。In a possible embodiment, the generating the first indication information of the second TLV according to the length of the identifier included in the fourth element includes: the identifier included in the fourth element is an uncompressed segment identifier When, the first indication information of the second TLV is the first preset value; or, when the identifier included in the fourth element is a compressed segment identifier, and the identifier included in the fourth element is When the length of the prefix is the second preset value, the first indication information of the second TLV is the second preset value.
在一可能的实施例中,所述第二TLV的指示信息包括第二指示信息,所述第二指示信息用于指示所述第三节点的段标识对应的前缀的位置;In a possible embodiment, the indication information of the second TLV includes second indication information, and the second indication information is used to indicate the location of the prefix corresponding to the segment identifier of the third node;
在一可能的实施例中,所述根据所述第四元素中包括的标识信息,生成第二TLV,包括:In a possible embodiment, the generating the second TLV according to the identification information included in the fourth element includes:
根据所述第四元素中包括的标识对应的SID的前缀的位置,生成第二TLV的第二指示信息。Generate second indication information of the second TLV according to the position of the prefix that identifies the corresponding SID included in the fourth element.
所述根据所述第四元素中包括的标识对应的前缀的位置,生成第二TLV的第二指示信息,包括:在所述第四元素中包括的标识对应的前缀在所述第一报文的段列表中,所述第二指示信息为第三预设值;The generating the second indication information of the second TLV according to the position of the prefix corresponding to the identifier included in the fourth element includes: the prefix corresponding to the identifier included in the fourth element is included in the first packet In the segment list of , the second indication information is a third preset value;
在所述第四元素中包括的标识对应的前缀在所述第一报文的目的地址中,所述第二指示信息为第四预设值。The prefix corresponding to the identifier included in the fourth element is in the destination address of the first packet, and the second indication information is a fourth preset value.
在一可能的实施例中,所述第二TLV还包括第三指示信息,所述第三指示信息用于指示所述第四元素在所述段列表中的位置;根据所述第四元素在所述段列表中的位置,生成所述第三指示信息。In a possible embodiment, the second TLV further includes third indication information, where the third indication information is used to indicate the position of the fourth element in the segment list; The position in the segment list is used to generate the third indication information.
在一可能的实施例中,所述一个或多个TLV与所述一个或多个元素呈一一对应关系。In a possible embodiment, the one or more TLVs have a one-to-one correspondence with the one or more elements.
在一可能的实施例中,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素的长度为128bits比特。In a possible embodiment, the segment list includes one or more elements, and the length of each element in the one or more elements is 128 bits.
在一可能的实施例中,所述段列表位于所述第一报文的SRv6段扩展路由头SRH中,所述第一TLV位于所述第一报文的SRH中。In a possible embodiment, the segment list is located in the SRv6 extended routing header SRH of the first packet, and the first TLV is located in the SRH of the first packet.
第三方面,本申请实施例提供一种网络设备,包括执行如第一方面所述的方法的单元。In a third aspect, an embodiment of the present application provides a network device, including a unit for executing the method described in the first aspect.
第四方面,本申请实施例还提供一种网络设备,包括执行如第二方面所述的方法的单元。In a fourth aspect, the embodiment of the present application further provides a network device, including a unit for executing the method described in the second aspect.
第五方面,本申请实施例提供一种网络设备,包括处理器、收发器以及存储器;所述存储器用于存储指令,所述处理器用于执行所述指令,所述收发器用于在所述处理器的控制下与其他设备进行通信;其中,所述处理器执行所述指令时执行如第一方面所述的方法。In the fifth aspect, the embodiment of the present application provides a network device, including a processor, a transceiver, and a memory; the memory is used to store instructions, the processor is used to execute the instructions, and the transceiver is used to process communicate with other devices under the control of a processor; wherein, when the processor executes the instructions, it executes the method as described in the first aspect.
第六方面,本申请实施例还提供一种网络设备,包括处理器、收发器以及存储器;所述存储器用于存储指令,所述处理器用于执行所述指令,所述收发器用于在所述处理器的控制下与其他设备进行通信;其中,所述处理器执行所述指令时执行如第二方面所述的方法。In a sixth aspect, the embodiment of the present application also provides a network device, including a processor, a transceiver, and a memory; the memory is used to store instructions, the processor is used to execute the instructions, and the transceiver is used to Communicate with other devices under the control of the processor; wherein, when the processor executes the instructions, it executes the method as described in the second aspect.
第七方面,本申请实施例提供一种网络系统,包括第一网络设备和第二网络设备,所述第一网络设备包括第三方面所述的网络设备,所述第二网络设备包第四方面所述的网络设备。In the seventh aspect, the embodiment of the present application provides a network system, including a first network device and a second network device, the first network device includes the network device described in the third aspect, and the second network device includes the fourth network device The network equipment described in the aspect.
第八方面,本申请实施例提供一种计算机存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如第一方面所述的方法。In an eighth aspect, an embodiment of the present application provides a computer storage medium, the computer-readable storage medium stores a computer program, and it is characterized in that, when the computer program is executed by a processor, the method according to the first aspect is implemented.
第九方面,本申请实施例还提供一种计算机存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如第二方面所述的方法。In the ninth aspect, the embodiment of the present application further provides a computer storage medium, the computer-readable storage medium stores a computer program, and it is characterized in that, when the computer program is executed by a processor, the method according to the second aspect is implemented .
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided in the foregoing aspects, the present application may further be combined to provide more implementation manners.
附图说明Description of drawings
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present invention. Ordinary technicians can also obtain other drawings based on these drawings on the premise of not paying creative work.
图1为本申请实施例提供的一种报文格式的示意图;FIG. 1 is a schematic diagram of a message format provided by an embodiment of the present application;
图2为本申请实施例提供的另一种报文格式的示意图;FIG. 2 is a schematic diagram of another message format provided by the embodiment of the present application;
图3为本申请实施例提供的一种报文转发过程示意图;FIG. 3 is a schematic diagram of a message forwarding process provided by an embodiment of the present application;
图4为本申请实施例提供的一种报文传输的方法流程图;FIG. 4 is a flow chart of a method for message transmission provided by an embodiment of the present application;
图5为本申请实施例提供的一种G-SRv6网络的示意图;FIG. 5 is a schematic diagram of a G-SRv6 network provided by an embodiment of the present application;
图6a-图6b为本申请实施例提供的另一种G-SRv6网络的示意图;6a-6b are schematic diagrams of another G-SRv6 network provided by the embodiment of the present application;
图7为本申请实施例提供的一种报文传输的方法流程图;FIG. 7 is a flow chart of a method for message transmission provided by an embodiment of the present application;
图8a-图8b为本申请实施例提供的另一种G-SRv6网络的示意图;8a-8b are schematic diagrams of another G-SRv6 network provided by the embodiment of the present application;
图9a-图9b为本申请实施例提供的另一种G-SRv6网络的示意图;9a-9b are schematic diagrams of another G-SRv6 network provided by the embodiment of the present application;
图10a-图10b为本申请实施例提供的另一种G-SRv6网络的示意图;10a-10b are schematic diagrams of another G-SRv6 network provided by the embodiment of the present application;
图11a-图11b为本申请实施例提供的另一种G-SRv6网络的示意图;Figure 11a-Figure 11b is a schematic diagram of another G-SRv6 network provided by the embodiment of the present application;
图12为本申请实施例提供的一种网络设备的结构示意图;FIG. 12 is a schematic structural diagram of a network device provided in an embodiment of the present application;
图13为本申请实施例提供的一种网络设备的结构示意图;FIG. 13 is a schematic structural diagram of a network device provided in an embodiment of the present application;
图14为本申请实施例提供的一种网络设备的结构示意图;FIG. 14 is a schematic structural diagram of a network device provided by an embodiment of the present application;
图15为本申请实施例提供的一种网络设备的结构示意图;FIG. 15 is a schematic structural diagram of a network device provided in an embodiment of the present application;
图16为本申请实施例提供的一种网络系统的可能的示意图。FIG. 16 is a possible schematic diagram of a network system provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图对本申请所提供的数据传输方法进行详细的阐述。The data transmission method provided by the present application will be described in detail below with reference to the accompanying drawings.
基于IPv6转发平面的段路由(segment routing for IPv6,SRv6)是基于源路由理念而设计的在网络上转发IPv6报文的一种协议。SRv6流量工程(traffic engineering,TE)是SRv6技术的一种实现方式(模式),在SRv6TE场景中,需要严格约束数据报文在网络中的转发路径。SRv6在报文转发路径的源节点为报文添加一个IPv6的段路由报头(segment routing header,SRH),该SRH包含用于标识转发路径的段列表(segmentlist)。该段列表包含报文转发路径上的节点的IPv6地址。在SRv6技术中段列表中的节点的IPv6地址也可以称为节点的段标识(segment identifier,SID)。段列表中段标识对应的节点称为Endpoint节点,Endpoint节点为报文转发路径中接收SRv6报文并处理SRv6报文的节点。Endpoint节点也称为分段路由(segment routing,SR)节点。应理解,本申请实施例后续的描述中,段列表中段标识对应的节点均为SR节点。Segment routing for IPv6 (SRv6) based on the IPv6 forwarding plane is a protocol designed to forward IPv6 packets on the network based on the concept of source routing. SRv6 traffic engineering (traffic engineering, TE) is an implementation (mode) of SRv6 technology. In the SRv6TE scenario, it is necessary to strictly restrict the forwarding path of data packets in the network. SRv6 adds an IPv6 segment routing header (segment routing header, SRH) to the message at the source node of the message forwarding path, and the SRH contains a segment list (segmentlist) used to identify the forwarding path. The segment list includes IPv6 addresses of nodes on the packet forwarding path. In the SRv6 technology, the IPv6 address of a node in the segment list may also be called a segment identifier (segment identifier, SID) of the node. The node corresponding to the segment identifier in the segment list is called an Endpoint node, and the Endpoint node is a node in the packet forwarding path that receives the SRv6 packet and processes the SRv6 packet. Endpoint nodes are also called segment routing (segment routing, SR) nodes. It should be understood that in the subsequent description of the embodiment of the present application, the nodes corresponding to the segment identifiers in the segment list are all SR nodes.
如图1所示,图1示出了一种SRv6网络中报文格式的示意图,在图1中,该报文的报文头包括IPv6报文头和SRH。IPv6报文头包括目的地址(destination address,DA)字段,用于指示节点根据DA字段中的段标识进行转发。SRH包括下一个报头(next header)、报头扩展长度(hdr ext len)、路由类型(routing type)、段剩余(segments left,SL)、段列表以及选项字段(options)等。其中,段列表包括依次排列的多个SID,即报文在传输过程中需要经过的每一个节点的IPv6地址,选项字段包含一个或者多个类型-长度-值(type-length-value,TLV)字段。SL也称为SL指针,用于指示剩余待处理的SID的数量,也可以理解为指向的当前待处理的SID在段列表中的位置。例如,SL指针的值为3,则表示剩余待处理的SID的数量为4个,也可以理解为SL指针指向当前待处理的SID,SL指针的值为0,则表示剩余待处理的段的数量为1个,也可以理解为SL指针指向当前待处理的SID。As shown in FIG. 1 , FIG. 1 shows a schematic diagram of a packet format in an SRv6 network. In FIG. 1 , the packet header of the packet includes an IPv6 packet header and an SRH. The IPv6 message header includes a destination address (destination address, DA) field, which is used to instruct the node to forward according to the segment identifier in the DA field. SRH includes the next header (next header), header extension length (hdr ext len), routing type (routing type), segment remaining (segments left, SL), segment list, and option fields (options). Among them, the segment list includes a plurality of SIDs arranged in sequence, that is, the IPv6 address of each node that the message needs to pass through during transmission, and the option field includes one or more type-length-value (type-length-value, TLV) field. The SL is also referred to as an SL pointer, and is used to indicate the number of remaining SIDs to be processed, and can also be understood as the pointed position of the currently pending SID in the segment list. For example, if the value of the SL pointer is 3, it means that the number of remaining SIDs to be processed is 4. It can also be understood that the SL pointer points to the current SID to be processed, and the value of the SL pointer is 0, which means that the number of remaining segments to be processed is The number is 1, which can also be understood as the SL pointer points to the currently pending SID.
SRv6网络在报文转发过程中,通过每个节点更新目的地址来完成逐跳转发。即节点根据SL指针的值确定当前待处理的SID以后,获取到段列表中的当前待处理的SID,将该SID复制至IPv6报文头中的DA字段,根据DA字段中的内容转发报文。During packet forwarding on an SRv6 network, each node updates the destination address to complete hop-by-hop forwarding. That is, after the node determines the current pending SID according to the value of the SL pointer, it obtains the current pending SID in the segment list, copies the SID to the DA field in the IPv6 packet header, and forwards the packet according to the content in the DA field .
在SRv6中,SID包含两个部分:位置(locator)和功能(function)。其中locator被用于将报 文路由到SID对应的节点;function用于指示SID对应的节点执行相应的功能。Function还可以分出一个可选的参数段(Arguments),此时SRv6SID的格式变为Locator、Function和Arguments,Arguments占据IPv6地址的低比特位,通过Arguments字段可以定义一些报文的流和服务等信息。举例来说,当节点接收到报文,判断报文的目的地址为节点的IPv6地址,也就是节点的段标识,则网络中的节点根据该段标识中的function执行相应的功能。位置字段包括前缀(prefix)部分和序号(node ID)部分。在一个SRv6网络域(domain)内,每个节点的SID都是从一个地址空间中分配,因此每个节点的位置字段的前缀部分是相同的;每个节点的SID的序号部分是不同的,每个序号部分用于唯一确定该域内的一个节点。因此,在一个SRv6网络域的多个节点的SID可以共用一个前缀,将序号部分和功能字段,作为压缩段标识(compressed SID,C-SID),即C-SID。C-SID加上前缀可以组成一个完整的SID,即节点的IPv6地址。In SRv6, SID consists of two parts: location (locator) and function (function). The locator is used to route the message to the node corresponding to the SID; the function is used to instruct the node corresponding to the SID to perform the corresponding function. Function can also separate an optional parameter section (Arguments). At this time, the format of SRv6SID becomes Locator, Function and Arguments. Arguments occupy the low bits of IPv6 addresses. Through the Arguments field, some message flows and services can be defined. information. For example, when a node receives a message and judges that the destination address of the message is the node's IPv6 address, that is, the segment identifier of the node, the nodes in the network execute corresponding functions according to the function in the segment identifier. The location field includes a prefix (prefix) part and a serial number (node ID) part. In an SRv6 network domain (domain), the SID of each node is allocated from an address space, so the prefix part of the location field of each node is the same; the serial number part of the SID of each node is different, Each sequence number part is used to uniquely identify a node in the domain. Therefore, the SIDs of multiple nodes in an SRv6 network domain can share a prefix, and the serial number part and the function field are used as a compressed segment identifier (compressed SID, C-SID), that is, C-SID. The C-SID plus the prefix can form a complete SID, that is, the IPv6 address of the node.
为了节省SRH开销,提出新的SRv6头压缩技术通用SRv6(Generalized SRv6,G-SRv6),该方案可以兼容标准SRv6,在数据封装上不改变原生SRH的格式和语义,但支持将128比特SRv6SID和32比特C-SID混合编程在SRH中。将这种支持128比特SRv6SID和32/16比特C-SID混合编排SID的SRH称为通用分段路由扩展头(generalized SRH,G-SRH)。In order to save SRH overhead, a new SRv6 header compression technology, Generalized SRv6 (Generalized SRv6, G-SRv6), is proposed. This solution is compatible with standard SRv6, and does not change the format and semantics of the original SRH in data encapsulation, but supports the 128-bit SRv6SID and A 32-bit C-SID mix is programmed in the SRH. The SRH that supports 128-bit SRv6 SID and 32/16-bit C-SID hybrid SID is called a generalized segment routing extension header (generalized SRH, G-SRH).
如图2所示,图2示出了一种G-SRv6报文的示意图。该G-SRv6报文包括IPv6报文头和G-SRH,在G-SRH中,段列表包括多个元素,即元素G-SID[0]-G-SID[n],每个元素的长度为128比特,每个元素中包括标识。其中,当一个元素中包括的标识为128比特的SID时,该元素为一个完整的SID,当一个元素中包括的标识为压缩的SID时,该元素中可包括多个C-SID。如图2所示,元素G-SID[0]中包含的标识的长度为128比特,元素G-SID[0]中只包含一个完整的SID,元素G-SID[2]中包含的标识的长度为32比特,元素G-SID[2]中包含4个C-SID,分别是C-SID1、C-SID2、C-SID3、C-SID4。因为G-SRH中段列表插入C-SID,因此需要更新段列表的访问逻辑。IPv6报文头还包括压缩段标识剩余(C-SID Left,CL)指针,与SRH中的SL指针构成二维指针,共同指示当前待处理的标识在段列表中的位置。具体地,SL指针用于指示当前待处理标识所在的元素在段列表中的位置,CL指针用于指示待处理的标识在该元素中的位置。如图2所示,如果当前待处理的标识为C-SID1,C-SID1在段列表中的第一个元素的第一个C-SID中。段列表中包括3个元素,即元素G-SID[0]-G-SID[2],SL指针的包括3个值,例如0、1、2。如果SL指针的初始值为2,指示元素G-SID[2]在段列表中的第一个元素中。元素G-SID[2]包括4个C-SID,C-SID1、C-SID2、C-SID3、C-SID4,CL指针的值包括四个值,例如0、1、2、3。如果CL指针的初始值为3,指示C-SID1在元素G-SID[2]中的第一个C-SID。则在每次更新时,将CL指针的值减1,即CL指针的值依次更新为2、1和0,依次用于指示元素G-SID[2]中C-SID2、C-SID3和C-SID4。则可以根据SL指针的值为2和CL指针的值为3,得到C-SID1在段列表中的第一个元素G-SID[2]中的第一个C-SID。同时为了加入对完整SID和C-SID边界识别方法,需要增加COC(continual of compression)Flavor标识,携带该COC Flavor标识的SID,指示该SID之后的SID是压缩的32比特的C-SID。例如,如图2中,元素G-SID[2]中的C-SID1携带COC标识,则元素G-SID[2]中的C-SID1之后的一个标识为C-SID,即为C-SID2。As shown in Fig. 2, Fig. 2 shows a schematic diagram of a G-SRv6 message. The G-SRv6 message includes an IPv6 message header and G-SRH. In G-SRH, the segment list includes multiple elements, namely elements G-SID[0]-G-SID[n], and the length of each element It is 128 bits, and each element includes the identification. Wherein, when the identifier included in an element is a 128-bit SID, the element is a complete SID; when the identifier included in an element is a compressed SID, the element may include multiple C-SIDs. As shown in Figure 2, the length of the identifier contained in the element G-SID[0] is 128 bits, the element G-SID[0] only contains a complete SID, and the identifier contained in the element G-SID[2] The length is 32 bits, and the element G-SID[2] includes 4 C-SIDs, namely C-SID1, C-SID2, C-SID3, and C-SID4. Because the C-SID is inserted into the segment list in the G-SRH, the access logic of the segment list needs to be updated. The IPv6 message header also includes a compressed segment identifier remaining (C-SID Left, CL) pointer, which forms a two-dimensional pointer with the SL pointer in the SRH, and jointly indicates the position of the currently pending identifier in the segment list. Specifically, the SL pointer is used to indicate the position in the segment list of the element where the identifier currently to be processed is located, and the CL pointer is used to indicate the position of the identifier to be processed in the element. As shown in FIG. 2, if the identifier currently to be processed is C-SID1, C-SID1 is in the first C-SID of the first element in the segment list. The segment list includes 3 elements, that is, elements G-SID[0]-G-SID[2], and the SL pointer includes 3 values, such as 0, 1, and 2. If the initial value of the SL pointer is 2, it indicates that the element G-SID[2] is in the first element in the segment list. The element G-SID[2] includes four C-SIDs, C-SID1, C-SID2, C-SID3, and C-SID4, and the value of the CL pointer includes four values, such as 0, 1, 2, and 3. If the initial value of the CL pointer is 3, it indicates the first C-SID of C-SID1 in the element G-SID[2]. Then, at each update, the value of the CL pointer is decremented by 1, that is, the value of the CL pointer is updated to 2, 1 and 0 in turn, which are used to indicate C-SID2, C-SID3 and C in the element G-SID[2] in turn. -SID4. Then the first C-SID in the first element G-SID[2] of C-SID1 in the segment list can be obtained according to the value of the SL pointer of 2 and the value of the CL pointer of 3. At the same time, in order to add the boundary identification method for the complete SID and C-SID, it is necessary to add a COC (continual of compression) Flavor identifier, carrying the SID of the COC Flavor identifier, indicating that the SID after the SID is a compressed 32-bit C-SID. For example, as shown in Figure 2, the C-SID1 in the element G-SID[2] carries the COC identifier, then the identifier after C-SID1 in the element G-SID[2] is C-SID, that is, C-SID2 .
因为G-SRH中段列表可以插入C-SID,所述需要更新段列表的访问复制逻辑和DA的替换逻辑。因此,SRv6报文在转发过程中,转发节点根据SL和CL指针确定当前要处理的SID以后,将SID复制至IPv6报文头中的DA字段,根据DA字段转发报文。例如,当前要处理的SID为C-SID,将当前处理的C-SID复制至DA字段中。DA字段中的前缀部分和当前待 处理的C-SID构成当前待处理的完整SID,从而,节点仍然可以根据DA字段的内容转发报文。例如,图3示例性示出了SRv6报文转发过程,以报文在一个SRv6网络域中转发为例,图3中,包括节点A至节点F。节点A-节点F的地址分别为A:1:1::、A:2:1::、A:3:1::、A:4:1::、A:5:1::、A:6:1::,节点A-节点F对应的段标识SID的前缀为A:。节点A将前缀A:添加到报文1的DA字段中,将段列表中第一个C-SID 2:1复制至DA字段中,DA字段中的前缀A:与2:1构成完整的SID为A:2:1,从而节点A按照DA字段中A:2:1查询转发表项,根据查询结果转发报文1给节点B。节点B接收节点A发送的报文1,B获取上述报文1,根据上述报文1的SRH获取上述报文1的下一跳节点的SID,即节点C的SID。报文1中SL指针的值为1,指示元素G-SID[1]在段列表中的位置,CL指针的初始值为3,指示第一个C-SID在元素G-SID[1]中的位置,通过SL指针和CL指针可以得到节点B对应的标识在段列表中的具体位置。节点B更新CL指针的值,将其更新为2,指示第二个C-SID在元素G-SID[1]中的位置,节点B根据SL指针和CL指针的指示,定位到第一个元素的第二个C-SID,即3:1,获得第一个元素中第二个C-SID为3:1,基于报文1将3:1复制到报文的DA中,代替DA字段中原有的2:1。此时,DA字段中包括前缀部分A:和C-SID部分3:1的组合,即A:3:1,也就是节点C的SID。节点B根据DA字段中的节点C的SID查询转发表项,根据查询结果向节点C发送所述报文2。当节点E接收节点D转发的报文3,节点E获取SL指针的值为1,CL指针的值为0,说明当前DA字段中的C-SID为元素G-SID[1]中的最后一个C-SID,节点E需要更新SL指针,执行SL--,将SL指针的值更新为0,指示G-SID[0]在段列表中的位置。根据SL指针的值为0,定位到第二个元素G-SID[0],G-SID[0]包含的段标识A:6:1::为非压缩段标识,节点E将A:6:1::复制至DA字段,节点E根据A:6:1::进行转发。上述报文转发过程中,转发路径上接收到报文的节点能够获取到下一跳SR节点的段标识,但是在检测到下一跳SR节点出现故障或者与下一跳SR节点之间的链路出现故障时,无法获取转发路径上故障节点之后的多个节点中的一个节点的段标识。因此,在转发路径上中间转发节点检测到下一跳SR节点故障或者与下一跳SR节点之间的链路出现故障时,无法根据段列表进行转发。Because the segment list in the G-SRH can be inserted into the C-SID, it is necessary to update the access replication logic of the segment list and the replacement logic of the DA. Therefore, during the forwarding process of an SRv6 packet, after the forwarding node determines the SID to be processed according to the SL and CL pointers, it copies the SID to the DA field in the IPv6 packet header, and forwards the packet according to the DA field. For example, the currently processed SID is a C-SID, and the currently processed C-SID is copied into the DA field. The prefix part in the DA field and the current C-SID to be processed constitute the current complete SID to be processed, so that the node can still forward the message according to the content of the DA field. For example, FIG. 3 exemplarily shows an SRv6 packet forwarding process, taking packet forwarding in an SRv6 network domain as an example. In FIG. 3 , nodes A to F are included. The addresses of node A-node F are A:1:1::, A:2:1::, A:3:1::, A:4:1::, A:5:1::, A :6:1::, the prefix of the segment identifier SID corresponding to node A-node F is A:. Node A adds the prefix A: to the DA field of message 1, copies the first C-SID 2:1 in the segment list to the DA field, and the prefix A: and 2:1 in the DA field form a complete SID A:2:1, so node A queries the forwarding entry according to A:2:1 in the DA field, and forwards message 1 to node B according to the query result. Node B receives the message 1 sent by node A, B obtains the above message 1, and obtains the SID of the next-hop node of the above message 1 according to the SRH of the above message 1, that is, the SID of node C. The value of the SL pointer in message 1 is 1, indicating the position of the element G-SID[1] in the segment list, and the initial value of the CL pointer is 3, indicating that the first C-SID is in the element G-SID[1] The specific position of the identifier corresponding to Node B in the segment list can be obtained through the SL pointer and the CL pointer. Node B updates the value of the CL pointer to 2, indicating the position of the second C-SID in the element G-SID[1]. Node B locates the first element according to the indications of the SL pointer and the CL pointer The second C-SID in the first element is 3:1, and the second C-SID in the first element is 3:1. Based on the message 1, the 3:1 is copied to the DA of the message to replace the original DA field. Some 2:1. At this time, the DA field includes a combination of the prefix part A: and the C-SID part 3:1, that is, A:3:1, which is the SID of node C. Node B queries the forwarding entry according to the SID of node C in the DA field, and sends the message 2 to node C according to the query result. When node E receives message 3 forwarded by node D, node E obtains the value of the SL pointer as 1 and the value of the CL pointer as 0, indicating that the C-SID in the current DA field is the last one in the element G-SID[1] C-SID, node E needs to update the SL pointer, execute SL--, update the value of the SL pointer to 0, and indicate the position of G-SID[0] in the segment list. According to the value of the SL pointer is 0, locate the second element G-SID[0], the segment identifier A:6:1:: contained in G-SID[0] is an uncompressed segment identifier, node E will A:6 :1:: is copied to the DA field, and node E forwards according to A:6:1::. During the above message forwarding process, the node receiving the message on the forwarding path can obtain the segment identifier of the next-hop SR node, but when it detects that the next-hop SR node fails or the link between the next-hop SR node When a fault occurs on the forwarding path, the segment identifier of one of the nodes following the faulty node on the forwarding path cannot be obtained. Therefore, when the intermediate forwarding node on the forwarding path detects that the next-hop SR node fails or the link with the next-hop SR node fails, it cannot perform forwarding according to the segment list.
例如,图3中当在节点D到节点E的路径故障时,即节点E故障或节点D到节点E之间的链路故障,导致节点D无法根据转发路径通过节点E进行数据报文转发,那么节点D需要由转发路径上的节点E的下一跳节点,即节点F。节点D将数据报文直接发送到节点F,使得数据报文还可以按照原转发路径上的节点E后的转发路径继续转发上述数据报文。例如,节点D检测到节点E路径发生故障后,节点D需要获取到节点E的下一跳节点F的SID。但是节点D因为无法准确根据G-SRH中的段列表获取到节点F的SID,进而无法对数据报文进行转发或数据报文保护。For example, in Figure 3, when the path from node D to node E fails, that is, node E fails or the link between node D and node E fails, node D cannot forward data packets through node E according to the forwarding path, Then node D needs to be the next hop node of node E on the forwarding path, that is, node F. Node D directly sends the data message to node F, so that the data message can continue to forward the above data message according to the forwarding path after node E on the original forwarding path. For example, after node D detects that the path to node E is faulty, node D needs to obtain the SID of the next hop node F to node E. However, because node D cannot accurately obtain the SID of node F according to the segment list in the G-SRH, it cannot forward or protect the data message.
本申请提出一种数据传输方法,应用于包括源节点和转发路径上的中间转发节点的G-SRv6网络。如图4所示,图4示出了本申请提供的一种数据传输方法,该数据传输方法通过在源节点处生成TLV字段并封装在第一报文的SRH头,在转发路径上的中间转发节点检测到转发路径上下一跳SR节点出现路径故障时,该TLV字段能够用于指示该中间转发节点获取第一报文转发路径上的下一跳SR节点以后的多个节点中的任意一个节点的SID,将获取的SID更新在报文的目的地址,按照该SID的指令进行转发,从而绕过故障节点或故障路径,完成数据传输。This application proposes a data transmission method, which is applied to a G-SRv6 network including a source node and an intermediate forwarding node on a forwarding path. As shown in Figure 4, Figure 4 shows a data transmission method provided by the present application. The data transmission method generates a TLV field at the source node and encapsulates it in the SRH header of the first message. In the middle of the forwarding path When the forwarding node detects that the next hop SR node on the forwarding path has a path failure, the TLV field can be used to instruct the intermediate forwarding node to obtain any one of multiple nodes after the next hop SR node on the first packet forwarding path The SID of the node, update the obtained SID to the destination address of the message, and forward according to the instruction of the SID, so as to bypass the faulty node or faulty path and complete the data transmission.
本申请实施例中,该数据传输方法包括可分为两个阶段,第一阶段,主要包括源节点生成TLV字段,将该TLV字段封装到第一报文的SRH的过程;第二阶段,主要包括转发路径上的中间转发节点按照TLV字段获得转发路径上下一跳SR节点以后的多个节点中的任意一 个节点的SID,根据该SID进行转发报文。In the embodiment of the present application, the data transmission method includes two stages. The first stage mainly includes the source node generating a TLV field and encapsulating the TLV field into the SRH of the first message; the second stage mainly includes Including that the intermediate forwarding node on the forwarding path obtains the SID of any one of the multiple nodes after the next hop SR node on the forwarding path according to the TLV field, and forwards the message according to the SID.
(一)第一阶段包括如下S101至S104,(1) The first stage includes the following S101 to S104,
S101:源节点获得包括段列表的第一报文。S101: The source node obtains the first packet including the segment list.
其中,段列表对应于第一报文的转发路径,段列表中包括一个或多个元素,一个或多个元素中的每个元素包括一个或多个标识,一个或多个标识中的每个标识分别对应于所述转发路径中一个节点或者转发路径中的一个链路。例如,图5中报文的SRH中的段列表包含了5个元素,这里的元素对应G-SID,可见每个G-SID包括一个或多个标识,标识包括SID或C-SID。例如,元素G-SID[4]包括了3个C-SID,这3个C-SID对应了转发路径中节点N2、N3和N4,N2、N3和N4属于一个网络域1,网络域1中的节点对SID进行压缩处理,并使用了同样的压缩前缀A:。元素G-SID[3]包括1个SID,对应了转发路径中网络域2中的节点N5,节点N5为不支持SRv6头压缩的节点。Wherein, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, each element in the one or more elements includes one or more identifiers, each of the one or more identifiers The identifiers respectively correspond to a node in the forwarding path or a link in the forwarding path. For example, the segment list in the SRH of the message in FIG. 5 contains 5 elements, and the elements here correspond to G-SIDs. It can be seen that each G-SID includes one or more identifiers, and the identifiers include SID or C-SID. For example, the element G-SID[4] includes 3 C-SIDs, these 3 C-SIDs correspond to the nodes N2, N3 and N4 in the forwarding path, N2, N3 and N4 belong to a network domain 1, and the network domain 1 The node compresses the SID and uses the same compressed prefix A:. The element G-SID[3] includes 1 SID, which corresponds to node N5 in network domain 2 in the forwarding path, and node N5 is a node that does not support SRv6 header compression.
源节点为G-SRv6网络的源节点,源节点在第一报文的报文头中插入SRH,或者,在第一报文外加上报文头并插入SRH。SRH包括段列表,段列表可以由控制器生成。例如,控制器计算报文的转发路径,生成对应于该转发路径的段列表,段列表包括C-SID,并且控制器将所述段列表发送至源节点。The source node is a source node of the G-SRv6 network, and the source node inserts the SRH into the header of the first message, or adds a header to the first message and inserts the SRH. The SRH includes a segment list, which can be generated by the controller. For example, the controller calculates the forwarding path of the message, generates a segment list corresponding to the forwarding path, the segment list includes the C-SID, and sends the segment list to the source node.
在一种可选的实施例中,段列表可以由源节点生成。例如,源节点计算报文的转发路径,并生成对应于该转发路径的段列表,段列表包括C-SID。或者,段列表可以由源节点和控制器共同生成。例如,控制器计算报文的转发路径,生成对应于该转发路径的段列表,段列表包括非压缩段标识而不包括C-SID,控制器将段列表发送至源节点,源节点根据接收到的段列表生成新的段列表,新的段列表包括C-SID。In an optional embodiment, the segment list can be generated by the source node. For example, the source node calculates the forwarding path of the packet, and generates a segment list corresponding to the forwarding path, and the segment list includes the C-SID. Alternatively, the segment list can be jointly generated by the source node and the controller. For example, the controller calculates the forwarding path of the message, and generates a segment list corresponding to the forwarding path. The segment list includes an uncompressed segment identifier but does not include a C-SID. The controller sends the segment list to the source node, and the source node receives A new segment list is generated from the segment list, and the new segment list includes the C-SID.
转发路径中还包括第一节点、第二节点以及第三节点,第二节点是转发路径中第一节点的下一跳SR节点,第三节点是转发路径中第二节点的下一跳节点。The forwarding path further includes a first node, a second node and a third node, the second node is a next-hop SR node of the first node in the forwarding path, and the third node is a next-hop node of the second node in the forwarding path.
本申请实施例中的节点为网络设备,例如路由器、交换机或者是能够支持G-SRv6的任意网络设备。The nodes in this embodiment of the present application are network devices, such as routers, switches, or any network devices that can support G-SRv6.
S102:源节点根据第一报文的段列表,生成TLV字段。S102: The source node generates a TLV field according to the segment list of the first packet.
其中,TLV字段的个数与段列表中元素的个数一致,且每个元素与TLV字段呈一一对应关系。每个TLV字段包括指示信息,上述指示信息用于指示转发路径中的多个节点中的一个节点或上述转发路径中的一个链路的段标识SID对应的前缀信息。上述TLV字段用于表示对应元素中包含的标识是否为C-SID,以及为C-SID时,C-SID对应的前缀的长度和位置。Wherein, the number of TLV fields is consistent with the number of elements in the segment list, and each element has a one-to-one correspondence with the TLV fields. Each TLV field includes indication information, and the indication information is used to indicate prefix information corresponding to a node among multiple nodes in the forwarding path or a segment identifier SID of a link in the forwarding path. The above TLV field is used to indicate whether the identifier included in the corresponding element is a C-SID, and if it is a C-SID, the length and position of the prefix corresponding to the C-SID.
上述每个元素与TLV字段的一一对应关系可以是顺序对应。例如,当第一报文中包括3个元素G-SID(0)~G-SID(2),则生成3个TLV的字段,G-SID(0)与第一个TLV对应,G-SID(1)与第二个TLV对应,G-SID(2)与第三个TLV对应,其中,第一个TLV字段表示元素G-SID(0)中标识是否为C-SID,当为C-SID时,第一个TLV字段还能够指示该C-SID的前缀的位置和长度。上述每个元素与TLV字段的一一对应关系还可以是逆序对应,例如,当第一报文中包括3个元素G-SID(0)~G-SID(2),则生成3个TLV的字段,G-SID(0)与第三个TLV对应,G-SID(1)与第二个TLV对应,G-SID(2)与第一个TLV对应。不限于与上述对应关系,每个元素与TLV字段的一一对应关系还可以是其他,本申请对此不作任何限定。The one-to-one correspondence between each element and the TLV field may be a sequential correspondence. For example, when the first packet includes three elements G-SID(0)~G-SID(2), three TLV fields are generated, G-SID(0) corresponds to the first TLV, and G-SID (1) corresponds to the second TLV, and G-SID (2) corresponds to the third TLV, where the first TLV field indicates whether the element G-SID (0) is identified as a C-SID, when it is C- For SID, the first TLV field can also indicate the location and length of the prefix of the C-SID. The one-to-one correspondence between each of the above elements and the TLV fields can also be in reverse order. For example, when the first message includes three elements G-SID(0)-G-SID(2), then three TLVs are generated field, G-SID(0) corresponds to the third TLV, G-SID(1) corresponds to the second TLV, and G-SID(2) corresponds to the first TLV. It is not limited to the above correspondence, and the one-to-one correspondence between each element and the TLV field may be other, which is not limited in this application.
在一些具体的实现方式中,每个TLV字段包括第一指示信息和第二指示信息,第一指示信息用于指示TLV字段对应的元素中包含的段标识是否为C-SID,如果为C-SID,则第一指示信息还表示TLV字段对应的元素中的段标识的前缀的长度,第二指示信息用于指示TLV 字段对应的元素中包含的标识对应的SID的前缀的位置。In some specific implementations, each TLV field includes first indication information and second indication information, and the first indication information is used to indicate whether the segment identifier contained in the element corresponding to the TLV field is a C-SID, and if it is a C-SID SID, the first indication information also indicates the length of the prefix of the segment identifier in the element corresponding to the TLV field, and the second indication information is used to indicate the position of the prefix identifying the corresponding SID included in the element corresponding to the TLV field.
例如,源节点生成一个元素对应的TLV字段时,源节点获取段列表中第四元素包含的标识信息,根据第四元素中包含的标识对应的前缀的长度和前缀在第一报文中的位置,生成第二TLV字段的第一指示信息和第二指示信息,其中,第一元素是段列表中一个或多个元素中的任意一个元素,第二TLV字段为一个或多个TLV字段中的任意一个TLV字段。For example, when the source node generates a TLV field corresponding to an element, the source node obtains the identification information contained in the fourth element in the segment list, and according to the length of the prefix corresponding to the identification contained in the fourth element and the position of the prefix in the first packet , generating first indication information and second indication information of the second TLV field, wherein the first element is any one of one or more elements in the segment list, and the second TLV field is one or more TLV fields Any TLV field.
在一些具体的实现方式中,源节点获取段列表中的第一元素,当第一元素中包含的标识为非压缩段标识,第一指示信息为第一预设值。第一预设值还可以为一个固定的数值或一个标识,上述数值或标识对应的是元素中包含的标识是非压缩段标识。例如,第一预设值为128这一固定数值,表示第一元素中包含的标识为128比特的非压缩段标识。当第一元素中包含的标识为C-SID时,即第一元素中可以包括多个标识,可以使用第四元素中包含的标识对应的前缀的长度值作为第一指示信息的数值,即将前缀的长度作为第二预设值时,那么当第一指示信息为第二预设值,指示第元素中包含的标识为C-SID,并且C-SID对应的压缩前的SID前缀的长度为第二预设值,例如,第二预设值为64,表示第一元素中包含的C-SID对应的SID前缀的长度为64比特。In some specific implementation manners, the source node acquires the first element in the segment list, and when the identifier included in the first element is an uncompressed segment identifier, the first indication information is a first preset value. The first preset value may also be a fixed value or an identifier, and the above numerical value or identifier corresponds to the fact that the identifier included in the element is an uncompressed segment identifier. For example, the first preset value is a fixed value of 128, indicating that the identifier of the uncompressed segment included in the first element is 128 bits. When the identifier contained in the first element is C-SID, that is, the first element can include multiple identifiers, the length value of the prefix corresponding to the identifier contained in the fourth element can be used as the value of the first indication information, that is, the prefix When the length of the C-SID is used as the second preset value, then when the first indication information is the second preset value, it indicates that the identifier contained in the first element is C-SID, and the length of the pre-compressed SID prefix corresponding to the C-SID is the first Two preset values, for example, the second preset value is 64, indicating that the length of the SID prefix corresponding to the C-SID included in the first element is 64 bits.
根据第一元素中标识对应的SID的前缀在第一报文中的位置,生成第二指示信息。具体地,当第一元素包含的标识对应的前缀在段列表中,第二指示信息为第三预设值,第三预设值为段列表中第四元素包含的标识的前缀所在的元素的序号。例如,第一元素中包含的段标识对应的前缀在元素G-SID[3]中,元素G-SID[3]在段列表中的序号为3,则第二指示信息为3。当第一素包含的标识对应的前缀在第一报文的目的地址中,第二指示信息为第四预设值。例如,第四预设值为15,表示第一元素中包含的标识对应的前缀在第一报文的目的地址中。不限于此,上述预设值还可以是其他的数值或者标识,本申请对此不作任何限定。上述示例性地介绍根据第一元素生成对应的第二TLV字段的过程,对段列表中包含的依次排列的元素,按照上述过程,可依次生成多个TLV字段,在此不再赘述。The second indication information is generated according to the position in the first packet of the prefix identifying the corresponding SID in the first element. Specifically, when the prefix corresponding to the identifier included in the first element is in the segment list, the second indication information is a third preset value, and the third preset value is the element where the prefix of the identifier included in the fourth element in the segment list is located. serial number. For example, the prefix corresponding to the segment identifier contained in the first element is in the element G-SID[3], and the sequence number of the element G-SID[3] in the segment list is 3, and the second indication information is 3. When the prefix corresponding to the identifier included in the first element is in the destination address of the first packet, the second indication information is the fourth preset value. For example, the fourth preset value is 15, indicating that the prefix corresponding to the identifier contained in the first element is in the destination address of the first packet. Not limited thereto, the above preset value may also be other values or identifiers, which are not limited in this application. The above exemplarily introduces the process of generating the corresponding second TLV field according to the first element. For the sequentially arranged elements contained in the segment list, according to the above process, multiple TLV fields can be sequentially generated, and details will not be repeated here.
在一种可选的实施例中,第二TLV字段还可以包括第三指示信息,第三指示信息用于指示第二TLV字段对应的第一元素在段列表中的位置。第三指示信息用于指示TLV字段与段列表中元素的对应关系。例如,段列表中包括n+1个元素G-SID[0]-G-SID[n],第三指示信息为0时,表示该TLV对应于元素G-SID[0]。当第三指示信息为n时,表示该TLV对应于元素G-SID[n]。In an optional embodiment, the second TLV field may further include third indication information, and the third indication information is used to indicate the position of the first element corresponding to the second TLV field in the segment list. The third indication information is used to indicate the corresponding relationship between the TLV field and the elements in the segment list. For example, the segment list includes n+1 elements G-SID[0]-G-SID[n], and when the third indication information is 0, it means that the TLV corresponds to the element G-SID[0]. When the third indication information is n, it means that the TLV corresponds to the element G-SID[n].
示例性地,如图5所示,图5示出了一种G-SRv6网络的示意图,该网络中包含节点N1-N10个节点,节点N1为G-SRv6网络的源节点。其中,节点N1-节点N4位于网络域1,节点N2-节点N4为支持SRv6头压缩的节点,网络域1中的节点N2-节点N4的SID进行压缩处理,并使用了同样的压缩前缀A:,节点N5位于网络域2,为不支持SRv6头压缩的节点,节点N6-节点N10位于网络域3,网络域3中的节点N6-节点N9为支持SRv6头压缩的节点,网络域3中的节点N6-节点N9的SID进行压缩处理,并使用了同样的压缩前缀A:。节点N10对应的标识为非压缩段标识。如图5所示,第一报文的段列表中包含5个元素:G-SID[0]、G-SID[1]、G-SID[2]、G-SID[3]、G-SID[4]。其中,G-SID[4]、G-SID[2]、G-SID[1]中包含的标识为C-SID,其对应的前缀为A:。G-SID[3]和G-SID[0]中包含的标识为SID,非C-SID。G-SID[4]包括的标识分别是2:1、3:1、4:1,G-SID[3]包含的段标识SID为B:5:1::,G-SID[2]包含的标识为6:1,G-SID[1]中包含的标识分别为7:1、8:1、9:F,G-SID[0]包括段标识SID为A:10:D100::。Exemplarily, as shown in FIG. 5, FIG. 5 shows a schematic diagram of a G-SRv6 network, the network includes nodes N1-N10, and node N1 is a source node of the G-SRv6 network. Among them, node N1-node N4 are located in network domain 1, node N2-node N4 are nodes that support SRv6 header compression, and the SIDs of node N2-node N4 in network domain 1 are compressed, and the same compression prefix A is used: , node N5 is located in network domain 2 and is a node that does not support SRv6 header compression, node N6-node N10 is located in network domain 3, node N6-node N9 in network domain 3 is a node that supports SRv6 header compression, and network domain 3 The SIDs of nodes N6-N9 are compressed, and the same compressed prefix A: is used. The identifier corresponding to the node N10 is an uncompressed segment identifier. As shown in Figure 5, the segment list of the first message contains 5 elements: G-SID[0], G-SID[1], G-SID[2], G-SID[3], G-SID [4]. Wherein, the identifier contained in G-SID[4], G-SID[2], and G-SID[1] is C-SID, and its corresponding prefix is A:. The identifiers contained in G-SID[3] and G-SID[0] are SIDs, not C-SIDs. The identifiers included in G-SID[4] are 2:1, 3:1, and 4:1 respectively, the segment identifier SID included in G-SID[3] is B:5:1::, and G-SID[2] includes The identifier of the segment is 6:1, the identifiers included in G-SID[1] are 7:1, 8:1, and 9:F respectively, and the segment identifier SID included in G-SID[0] is A:10:D100::.
由图6a可知,段列表包含5个元素G-SID[0]-G-SID[4],生成对应的5个TLV字段:It can be seen from Figure 6a that the segment list contains 5 elements G-SID[0]-G-SID[4], and the corresponding 5 TLV fields are generated:
1.元素G-SID[4]包含的标识为C-SID,元素G-SID[4]中的3个C-SID对应的段标识的前缀A:在第一报文的目的地址中,前缀的长度为64比特,因此,G-SID[4]对应的TLV字段的第一指示信息为64,表示元素G-SID[4]包含的标识为C-SID,C-SID对应的前缀长度为64,第二指示信息为15,表示上述前缀在第一报文的目的地址中,第三指示信息为4,表示TLV字段对应的元素G-SID[4]在段列表中的位置,因此元素G-SID[4]对应的TLV字段为[64,15,4];1. The identifier contained in the element G-SID[4] is C-SID, and the prefix A of the segment identifier corresponding to the 3 C-SIDs in the element G-SID[4]: In the destination address of the first message, the prefix The length of the TLV field is 64 bits. Therefore, the first indication information of the TLV field corresponding to G-SID[4] is 64, indicating that the identifier contained in the element G-SID[4] is C-SID, and the prefix length corresponding to C-SID is 64. The second indication information is 15, indicating that the above prefix is in the destination address of the first message, and the third indication information is 4, indicating the position of the element G-SID[4] corresponding to the TLV field in the segment list, so the element The TLV field corresponding to G-SID[4] is [64, 15, 4];
2.元素G-SID[3]包含的标识为非压缩段标识,因此,元素G-SID[3]对应的TLV字段的第一指示信息为128,表示元素G-SID[3]包含的是非压缩的SID,G-SID[3]对应的TLV字段的第二指示信息为3,表示段标识的前缀在元素G-SID[3]中,G-SID[3]对应的TLV字段的第三指示信息为3,表示TLV字段对应的元素G-SID[3]在段列表中的位置,即元素G-SID[3]对应的TLV字段为[128,3,3];2. The identifier contained in the element G-SID[3] is a non-compressed segment identifier, therefore, the first indication information of the TLV field corresponding to the element G-SID[3] is 128, indicating that the element G-SID[3] contains whether For the compressed SID, the second indication information of the TLV field corresponding to G-SID[3] is 3, indicating that the prefix of the segment identifier is in the element G-SID[3], and the third part of the TLV field corresponding to G-SID[3] The indication information is 3, indicating the position of the element G-SID[3] corresponding to the TLV field in the segment list, that is, the TLV field corresponding to the element G-SID[3] is [128, 3, 3];
3.元素G-SID[2]包含的标识为C-SID,C-SID对应的前缀的长度为64比特,且位于元素G-SID[2]。因此,元素G-SID[2]对应的TLV字段的对应的第一指示信息为64,表示元素G-SID[2]包含的标识为C-SID,C-SID对应的前缀长度为64,G-SID[2]对应的TLV字段的第二指示信息为2,表示C-SID对应的前缀在元素G-SID[2]中,G-SID[2]对应的TLV字段的第三指示信息为2,表示表示TLV字段对应的元素G-SID[2]在段列表中的位置,即元素G-SID[2]对应的TLV为[64,2,2];3. The identifier contained in the element G-SID[2] is C-SID, and the length of the prefix corresponding to the C-SID is 64 bits, and it is located in the element G-SID[2]. Therefore, the corresponding first indication information of the TLV field corresponding to element G-SID[2] is 64, indicating that the identifier contained in element G-SID[2] is C-SID, and the prefix length corresponding to C-SID is 64, G - The second indication information of the TLV field corresponding to SID[2] is 2, indicating that the prefix corresponding to the C-SID is in the element G-SID[2], and the third indication information of the TLV field corresponding to G-SID[2] is 2, indicating the position of the element G-SID[2] corresponding to the TLV field in the segment list, that is, the TLV corresponding to the element G-SID[2] is [64, 2, 2];
4.元素G-SID[1]包含的标识为C-SID,C-SID对应的前缀的长度为64比特,且位于元素G-SID[2]。因此,G-SID[1]对应的TLV字段的对应的第一指示信息为64,表示元素G-SID[1]包含的标识为C-SID,C-SID对应的前缀长度为64,G-SID[1]对应的TLV字段的第二指示信息为2,表示C-SID对应的前缀在元素G-SID[2]中,G-SID[1]对应的TLV字段的第三指示信息为1,表示表示TLV字段对应的元素G-SID[1]在段列表中的位置,即元素G-SID[1]对应的TLV字段为[64,2,1];4. The identifier contained in the element G-SID[1] is C-SID, and the length of the prefix corresponding to the C-SID is 64 bits, and it is located in the element G-SID[2]. Therefore, the corresponding first indication information of the TLV field corresponding to G-SID[1] is 64, indicating that the identifier contained in the element G-SID[1] is C-SID, and the prefix length corresponding to C-SID is 64, G- The second indication information of the TLV field corresponding to SID[1] is 2, indicating that the prefix corresponding to the C-SID is in the element G-SID[2], and the third indication information of the TLV field corresponding to G-SID[1] is 1 , indicating the position of the element G-SID[1] corresponding to the TLV field in the segment list, that is, the TLV field corresponding to the element G-SID[1] is [64, 2, 1];
5.元素G-SID[0]包含的标识为非压缩段标识。因此,G-SID[0]对应的TLV字段的对应的第一指示信息为128,表示表示元素G-SID[0]包含的是非压缩的SID,G-SID[0]对应的TLV字段的第二指示信息为0,表示段标识的前缀在元素G-SID[0]中,G-SID[0]对应的TLV字段的第三指示信息为0,表示TLV字段对应的元素G-SID[0]在段列表中的位置,即元素G-SID[0]对应的TLV字段为[128,0,0]。5. The identifier contained in the element G-SID[0] is a non-compressed segment identifier. Therefore, the corresponding first indication information of the TLV field corresponding to G-SID[0] is 128, indicating that the element G-SID[0] contains an uncompressed SID, and the first indication information of the TLV field corresponding to G-SID[0] The second indication information is 0, indicating that the prefix of the segment identifier is in the element G-SID[0], and the third indication information of the TLV field corresponding to G-SID[0] is 0, indicating that the element G-SID[0] corresponding to the TLV field ] in the segment list, that is, the TLV field corresponding to the element G-SID[0] is [128, 0, 0].
在一种可选的实施例中,由于在一个SRv6网路域的多个节点的C-SID对应的同一个前缀,因此,在一个SRv6网络域内的节点的C-SID对应的前缀的长度相同,以及前缀在段列表中的位置相同,从而,在一个SRv6网路域内进行压缩了的节点的标识对应的TLV字段可以共用一个TLV字段。当段列表中多个元素中包括的标识为C-SID,且多个元素中包括的标识对应的节点位于同一个SRv6网络域,则多个元素对应一个TLV字段。当段列表中元素中包含的标识为SID,则该元素对应一个TLV字段。In an optional embodiment, since the C-SIDs of multiple nodes in an SRv6 network domain correspond to the same prefix, the lengths of the prefixes corresponding to the C-SIDs of nodes in an SRv6 network domain are the same , and the position of the prefix in the segment list is the same, so that the TLV fields corresponding to the identifiers of the compressed nodes in one SRv6 network domain can share one TLV field. When the identifiers included in multiple elements in the segment list are C-SIDs, and the nodes corresponding to the identifiers included in the multiple elements are located in the same SRv6 network domain, then the multiple elements correspond to one TLV field. When the identifier contained in the element in the segment list is a SID, the element corresponds to a TLV field.
示例性地,如图5所示的报文中,可以根据段列表中包括的5个元素G-SID[0]-G-SID[4],节点N1-节点N4属于网络域1。在网络域1中,节点N1为源节点,节点N2-节点N4为支持SRv6头压缩的节点,节点N2-节点N4对应的标识为C-SID。由图5可知,元素G-SID[4]中包含的3个C-SID分别对应于节点N2-节点N4,也就是说,网络域1中包括的节点对应的C-SID位于元素G-SID[4]中。而且G-SID[4]中C-SID对应的前缀位于目的地址中,前缀的长度为64比特,因此,元素G-SID[4]对应的TLV字段为[4,64],表示元素G-SID[4]中包含的标识为C-SID,C-SID对应的前缀的长度为64,C-SID对应的前缀的位置在元素G-SID[4]中, 又由于元素G-SID[4]为段列表中第一个元素,因此C-SID对应的前缀的位置在第一报文的目的地址字段中。Exemplarily, in the message shown in FIG. 5 , node N1 - node N4 belong to network domain 1 according to five elements G-SID[0]-G-SID[4] included in the segment list. In network domain 1, node N1 is the source node, node N2-node N4 are nodes supporting SRv6 header compression, and the identifiers corresponding to node N2-node N4 are C-SID. It can be seen from Figure 5 that the three C-SIDs contained in the element G-SID[4] correspond to the nodes N2-N4 respectively, that is to say, the C-SIDs corresponding to the nodes included in the network domain 1 are located in the element G-SID [4]. Moreover, the prefix corresponding to the C-SID in G-SID[4] is located in the destination address, and the length of the prefix is 64 bits. Therefore, the TLV field corresponding to the element G-SID[4] is [4, 64], indicating that the element G- The identifier contained in SID[4] is C-SID, the length of the prefix corresponding to C-SID is 64, and the location of the prefix corresponding to C-SID is in the element G-SID[4], and because the element G-SID[4 ] is the first element in the segment list, so the location of the prefix corresponding to the C-SID is in the destination address field of the first packet.
节点N5位于网络域2,节点N5为不支持SRv6头压缩的节点,节点N5对应的标识为SID,节点N5对应的SID位于元素G-SID[3],即元素G-SID[3]中包括的标识为SID。因此,元素G-SID[3]对应一个TLV字段。元素G-SID[3]中节点N5的SID的前缀的长度为128比特,则第一指示信息为128,表示元素G-SID[3]中包含的标识为SID;元素G-SID[3]中节点N5的SID的前缀位于元素G-SID[3],元素G-SID[3]在段列表中的序号为3,则第二指示信息为3,表示元素G-SID[3]中包括SID的前缀位于元素G-SID[3]中。Node N5 is located in network domain 2. Node N5 is a node that does not support SRv6 header compression. The identifier corresponding to node N5 is SID. The SID corresponding to node N5 is located in the element G-SID[3], that is, the element G-SID[3] includes The identifier is SID. Therefore, the element G-SID[3] corresponds to a TLV field. The length of the SID prefix of node N5 in the element G-SID[3] is 128 bits, and the first indication information is 128, indicating that the identifier contained in the element G-SID[3] is a SID; the element G-SID[3] The prefix of the SID of the node N5 is located in the element G-SID[3], and the sequence number of the element G-SID[3] in the segment list is 3, then the second indication information is 3, indicating that the element G-SID[3] includes The prefix of the SID is located in the element G-SID[3].
节点N6-节点N9属于网络域3,节点N6-节点N9为支持SRv6头压缩的节点。节点N6-节点N9对应的标识为C-SID。由图5可知,元素G-SID[2]和元素G-SID[1]中包含节点N6-节点N9对应的C-SID,也就是说,网络域3中包括的节点对应的C-SID位于元素G-SID[1]和元素G-SID[2]中。而且元素G-SID[1]和元素G-SID[2]中包含C-SID对应的前缀的长度为64,则第一指示信息为64,表示网络域3中包含的节点的标识为C-SID,且C-SID对应的前缀长度为64;元素G-SID[1]和元素G-SID[2]中包含C-SID对应的前缀位于元素G-SID[2]中,元素G-SID[2]在段列表中的序号为2,则第二指示信息为2,表示网络域3中包含的节点的C-SID对应的前缀位于元素G-SID[2]中,即元素G-SID[1]和元素G-SID[2]中包含C-SID对应的前缀位于元素G-SID[2]中。Node N6-Node N9 belong to network domain 3, and Node N6-Node N9 are nodes supporting SRv6 header compression. The identifier corresponding to node N6-node N9 is C-SID. It can be seen from Figure 5 that elements G-SID[2] and G-SID[1] contain C-SIDs corresponding to nodes N6-N9, that is to say, the C-SIDs corresponding to nodes included in network domain 3 are located in In element G-SID[1] and element G-SID[2]. Moreover, the length of the prefix corresponding to the C-SID contained in the element G-SID[1] and element G-SID[2] is 64, and the first indication information is 64, indicating that the identifier of the node contained in the network domain 3 is C- SID, and the prefix length corresponding to C-SID is 64; element G-SID[1] and element G-SID[2] contain the prefix corresponding to C-SID in element G-SID[2], element G-SID [2] The sequence number in the segment list is 2, and the second indication information is 2, indicating that the prefix corresponding to the C-SID of the node contained in the network domain 3 is located in the element G-SID[2], that is, the element G-SID [1] and the prefix corresponding to the C-SID contained in the element G-SID[2] are located in the element G-SID[2].
节点N10位于网络域3,节点N10为不支持SRv6头压缩的节点,节点N10对应的标识为SID,节点N10对应的SID位于元素G-SID[0],即元素G-SID[0]中包括的标识为SID。因此,元素G-SID[0]对应一个TLV字段。元素G-SID[0]中节点N10的SID的前缀的长度为128比特,则第一指示信息为128,表示元素G-SID[0]中包含的标识为SID;元素G-SID[0]中节点N10的SID的前缀位于元素G-SID[0],元素G-SID[0]在段列表中的序号为0,则第二指示信息为0,表示元素G-SID[0]中包括SID的前缀位于元素G-SID[0]中。Node N10 is located in network domain 3. Node N10 is a node that does not support SRv6 header compression. The identifier corresponding to node N10 is SID. The SID corresponding to node N10 is located in the element G-SID[0], that is, the element G-SID[0] includes The identifier is SID. Therefore, the element G-SID[0] corresponds to one TLV field. The length of the SID prefix of the node N10 in the element G-SID[0] is 128 bits, and the first indication information is 128, indicating that the identifier contained in the element G-SID[0] is a SID; the element G-SID[0] The prefix of the SID of the node N10 is located in the element G-SID[0], and the sequence number of the element G-SID[0] in the segment list is 0, and the second indication information is 0, indicating that the element G-SID[0] includes The prefix of the SID is located in the element G-SID[0].
由上述可知,如图6b所示,元素G-SID[4]、元素G-SID[3]网络、元素G-SID[2]和元素G-SID[1]、元素G-SID[0]可对应生成4个TLV字段为[64,4]、[128,3]、[64,2]、[128,0]。这样可以节约报文的空间。From the above, as shown in Figure 6b, element G-SID[4], element G-SID[3] network, element G-SID[2] and element G-SID[1], element G-SID[0] Four TLV fields can be correspondingly generated as [64, 4], [128, 3], [64, 2], [128, 0]. This can save the space of the message.
其中,TLV字段中包含的指示信息不限于上述列出的三种指示信息,还可以包括其他形式的指示信息,本申请对此不作任何限定。不限于上述列出的TLV字段格式,在具体实现中,TLV字段格式还可以是其他格式,本申请在此不作任何限定。Wherein, the indication information contained in the TLV field is not limited to the three indication information listed above, and may also include other forms of indication information, which is not limited in this application. It is not limited to the TLV field formats listed above. In a specific implementation, the TLV field format may also be other formats, which are not limited in this application.
S103:源节点将TLV字段封装到第一报文的SRH中。S103: The source node encapsulates the TLV field into the SRH of the first packet.
S104:源节点发送第一报文。S104: The source node sends the first packet.
源节点将段列表中源节点的下一跳节点的段标识复制至IPv6报文头的DA字段中,源节点发送封装有IPv6报文头的第一报文。例如,如图5所示,源节点N1将段列表中源节点的下一跳节点的段标识2:1复制至IPv6报文头的DA字段中。The source node copies the segment identifier of the next-hop node of the source node in the segment list to the DA field of the IPv6 message header, and the source node sends the first message encapsulated with the IPv6 message header. For example, as shown in FIG. 5 , the source node N1 copies the segment identifier 2:1 of the next-hop node of the source node in the segment list to the DA field of the IPv6 packet header.
实施本申请实施例,通过在源节点生成一个或多个TLV字段,使得在中间转发节点检测到下一跳SR节点的路径故障时,该中间转发节点可以根据TLV字段获得下一跳SR节点以后的多个节点中的任意一个节点的段标识,将获取的段标识更新在报文的目的地址,按照该段标识的指令进行转发,从而绕过故障节或者故障路径,完成数据传输。Implementing the embodiment of the present application, by generating one or more TLV fields at the source node, when the intermediate forwarding node detects the path failure of the next-hop SR node, the intermediate forwarding node can obtain the next-hop SR node according to the TLV field. The segment identifier of any one of the multiple nodes in the network is updated to the destination address of the message, and forwarded according to the instruction of the segment identifier, thereby bypassing the faulty node or faulty path and completing data transmission.
S105:第一节点接收第一报文。S105: The first node receives the first packet.
其中,第一节点为第一报文转发路径上的中间转发节点,可以接收第一报文,并根据DA字段中的段标识的指令处理第一报文。Wherein, the first node is an intermediate forwarding node on the forwarding path of the first message, can receive the first message, and process the first message according to the instruction of the segment identifier in the DA field.
S106:当确定第一节点到第一节点到第二节点的路径故障,第一节点根据第一报文中的一个或多个TLV字段获取第三节点的段标识。S106: When determining that the path from the first node to the first node to the second node is faulty, the first node obtains the segment identifier of the third node according to one or more TLV fields in the first packet.
首先,第一节点根据第一报文SRH中的第一指针和第二指针确定第三节点标识对应的元素在段列表的位置,然后根据上述位置信息确定元素对应的TLV字段,然后根据该TLV字段中包含的指示信息获得第三节点段标识。其中,第一指针为SL指针,第二指针为CL指针。SL指针的值用于指示节点标识所在的元素在段列表中的位置,CL指针的值用于指示上述标识在该元素中的位置。第三节点是转发路径上第二节点之后的多个节点中的任意一个节点。例如,第三节点是第二节点的下一跳节点,第二节点为第一报文转发路径上第一节点的下一跳节点。First, the first node determines the position of the element corresponding to the third node identifier in the segment list according to the first pointer and the second pointer in the first message SRH, then determines the TLV field corresponding to the element according to the above position information, and then according to the TLV The indication information contained in the field obtains the segment identifier of the third node. Wherein, the first pointer is an SL pointer, and the second pointer is a CL pointer. The value of the SL pointer is used to indicate the position of the element where the node identifier is located in the segment list, and the value of the CL pointer is used to indicate the position of the above-mentioned identifier in the element. The third node is any one of multiple nodes after the second node on the forwarding path. For example, the third node is a next-hop node of the second node, and the second node is a next-hop node of the first node on the first packet forwarding path.
下面结合图7介绍上述第一节点获取第三节点段标识具体包括:The following describes in conjunction with FIG. 7 that the above-mentioned first node obtains the segment identifier of the third node, which specifically includes:
S1061:第一节点确定第三节点的标识对应的SL指针的第一值。S1061: The first node determines the first value of the SL pointer corresponding to the identifier of the third node.
其中,SL指针包括一个或多个值,SL指针的值的个数与段列表中包含的元素的个数一致。SL指针的第一值是一个或多个值中的一个,SL指针的第一值指示第一元素在段列表中的位置,第一元素包括第三节点的标识。Wherein, the SL pointer includes one or more values, and the number of values of the SL pointer is consistent with the number of elements contained in the segment list. The first value of the SL pointer is one of one or more values, the first value of the SL pointer indicates the position of the first element in the segment list, and the first element includes the identifier of the third node.
在一种实施例中,第一节点获取第一报文中SL指针的第二值和第一报文中的CL指针的第二值。其中,SL指针的第二值是指第一节点接收到第一报文时SL指针的值,指示DA字段中的标识(即第一节点的标识)所在的第二元素在段列表中的位置,即上述SL指针的第二值用于指示第二元素在所述段列表中的位置,第二元素包括所述第一节点的标识。CL指针包括多个值,例如CL指针包括4个值,0、1、2、3,与元素中包含的4个C-SID一致。其中,CL指针的值与SL指针的值有一定的关联性,例如,当SL指针的值更新后,CL指针的值更新为初始值。例如,如图3所示,在报文转发过程中,当节点E接收到报文,CL指针的值为0,需要更新SL指针的值和CL指针的值,将SL指针的值减1,CL指针的值要更新为3。CL指针的第二值是多个值中的一个,CL指针的第二值是指第一节点接收到第一报文时CL指针的值,指示DA字段中的标识(即第一节点的标识)在第二元素中的位置。In an embodiment, the first node acquires the second value of the SL pointer in the first packet and the second value of the CL pointer in the first packet. Wherein, the second value of the SL pointer refers to the value of the SL pointer when the first node receives the first message, indicating the position of the second element where the identifier in the DA field (that is, the identifier of the first node) is located in the segment list , that is, the second value of the SL pointer is used to indicate the position of the second element in the segment list, and the second element includes the identifier of the first node. The CL pointer includes multiple values. For example, the CL pointer includes 4 values, 0, 1, 2, and 3, which are consistent with the 4 C-SIDs included in the element. Wherein, the value of the CL pointer has a certain correlation with the value of the SL pointer, for example, when the value of the SL pointer is updated, the value of the CL pointer is updated to an initial value. For example, as shown in Figure 3, in the message forwarding process, when the node E receives the message, the value of the CL pointer is 0, the value of the SL pointer and the value of the CL pointer need to be updated, and the value of the SL pointer is decremented by 1, The value of the CL pointer should be updated to 3. The second value of the CL pointer is one of a plurality of values, and the second value of the CL pointer refers to the value of the CL pointer when the first node receives the first message, indicating the identifier in the DA field (that is, the identifier of the first node ) in the second element.
第一节点接收到第一报文之后,第一节点根据第一节点的标识判断第二节点的标识是否为压缩段标识C-SID,如果第二节点的标识为非压缩段标识,即如果第二节点的标识为SID,说明第二节点的SID的长度为128比特,一个元素的长度为128比特,所说第二节点的SID位于一个元素全部的比特位。在第二节点的SID占用一个元素的全部比特位时,将SL指针的第二值减2得到SL指针的第一值。After the first node receives the first message, the first node judges whether the identifier of the second node is a compressed segment identifier C-SID according to the identifier of the first node, if the identifier of the second node is a non-compressed segment identifier, that is, if the first node The identifier of the two nodes is SID, indicating that the length of the SID of the second node is 128 bits, and the length of one element is 128 bits, and the SID of the second node is located in all bits of an element. When the SID of the second node occupies all the bits of an element, subtract 2 from the second value of the SL pointer to obtain the first value of the SL pointer.
第一节点接收到第一报文之后,第一节点根据第一节点的标识判断第二节点的标识是否为压缩段标识C-SID,如果第二节点的标识为压缩段标识,即第二节点的标识为C-SID,并且根据CL指针的值确定第一元素和第二元素相同,即第一元素和第二元素为同一个元素,也就是说,根据CL指针的值确定第二节点和第三节点均在第一元素中,SL的第一值为SL的第二值。其中,第一元素为包括第三节点的标识的元素,第二元素为包括第二节点的标识的元素。After the first node receives the first message, the first node judges whether the identifier of the second node is a compressed segment identifier C-SID according to the identifier of the first node. If the identifier of the second node is a compressed segment identifier, that is, the second node The identifier of the C-SID is C-SID, and the first element and the second element are determined to be the same according to the value of the CL pointer, that is, the first element and the second element are the same element, that is, the second node and the second element are determined according to the value of the CL pointer The third nodes are all in the first element, and the first value of SL is the second value of SL. Wherein, the first element is an element including the identifier of the third node, and the second element is an element including the identifier of the second node.
第一节点接收到第一报文之后,第一节点根据第一节点的标识判断第二节点的标识是否为压缩段标识C-SID,如果根据第一节点的标识确定第二节点的标识为压缩段标识,并且根据CL的值确定第二节点的标识位于第二元素最后一个标识的位置,将SL的第二值减1得到SL的第一值。After the first node receives the first message, the first node judges whether the identification of the second node is a compressed segment identification C-SID according to the identification of the first node, if it is determined that the identification of the second node is compressed according to the identification of the first node The segment identifier, and according to the value of CL, it is determined that the identifier of the second node is located at the position of the last identifier of the second element, and the second value of SL is subtracted by 1 to obtain the first value of SL.
在一种可能的实现方式中,如果第二节点的标识为C-SID,将CL指针的第二值减1得到CL指针的第三值。CL指针的第三值指示第二节点的标识在第二元素中的位置。第一节点判 断CL指针的第三值是不是第五预设值。其中,第五预设值可以为一个固定的数值或一个标识,例如,第五预设值为0这一固定值。在CL指针的第三值不是第五预设值的情况下,说明第二节点的C-SID不是第二元素中最后一个标识,第三节点的标识还在第二节点的C-SID第二元素中,因此,将第一指针的第二值作为第一指针的第一值;或者,在第二指针的第三值是第五预设值的情况下,说明第二节点的C-SID是第二元素中最后一个标识,将第一指针的第二值减1,得到第一指针的第一值。In a possible implementation manner, if the identifier of the second node is a C-SID, subtract 1 from the second value of the CL pointer to obtain the third value of the CL pointer. The third value of the CL pointer indicates the location of the identity of the second node in the second element. The first node judges whether the third value of the CL pointer is the fifth preset value. Wherein, the fifth preset value may be a fixed value or an identifier, for example, the fifth preset value is a fixed value of 0. In the case that the third value of the CL pointer is not the fifth preset value, it means that the C-SID of the second node is not the last identifier in the second element, and the identifier of the third node is still second to the C-SID of the second node. In the element, therefore, the second value of the first pointer is used as the first value of the first pointer; or, in the case that the third value of the second pointer is the fifth preset value, the C-SID of the second node is specified is the last identifier in the second element, and subtracts 1 from the second value of the first pointer to obtain the first value of the first pointer.
本申请实施例中,第五预设值与CL指针的初始值相关联,如图3所示,段列表中的元素G-SID[1]包括4个C-SID,CL指针的初始值可以为3,例如报文1中,指示元素G-SID[1]中第一个C-SID,即2:1。例如报文3中,CL指针的值为0时,指示元素G-SID[1]中最后一个C-SID,即5:1,则第五预设值为0。如果CL指针的初始值为4,指示元素G-SID[1]中第一个C-SID,即2:1,CL指针的值为1时,指示元素G-SID[1]中最后一个C-SID,即5:1,则第五预设值为1。In the embodiment of the present application, the fifth preset value is associated with the initial value of the CL pointer. As shown in FIG. 3 , the element G-SID[1] in the segment list includes 4 C-SIDs, and the initial value of the CL pointer can be is 3, for example, in message 1, it indicates the first C-SID in the element G-SID[1], that is, 2:1. For example, in message 3, when the value of the CL pointer is 0, it indicates the last C-SID in the element G-SID[1], that is, 5:1, and the fifth preset value is 0. If the initial value of the CL pointer is 4, it indicates the first C-SID in the element G-SID[1], that is, 2:1. When the value of the CL pointer is 1, it indicates the last C-SID in the element G-SID[1]. -SID, that is, 5:1, the fifth preset value is 1.
在一些可选的实施例中,上述第一节点判断第二节点的标识是否是C-SID,具体包括:第一节点根据第一报文的DA字段获得第一节点的标识,可通过第一节点判断第一节点的标识是否携带第一标记。其中,第一标记用于指示第二节点的标记为压缩段标识。如果第一节点的标识未携带第一标记,说明第二节点的标识为非压缩段标识。如果第一节点的标识携带第一标记,说明第二节点标识为C-SID。其中,第一标记为COC Flavor标记。如果DA字段中的标识携带COC Flavor标记,说明段列表中该标识的下一个标识为C-SID。In some optional embodiments, the first node judging whether the identifier of the second node is a C-SID specifically includes: the first node obtains the identifier of the first node according to the DA field of the first message, and may pass the first The node judges whether the identifier of the first node carries the first tag. Wherein, the first label is used to indicate that the label of the second node is a compressed segment identifier. If the identifier of the first node does not carry the first flag, it means that the identifier of the second node is an uncompressed segment identifier. If the identifier of the first node carries the first label, it indicates that the identifier of the second node is a C-SID. Among them, the first mark is COC Flavor mark. If the identifier in the DA field carries the COC Flavor flag, it means that the next identifier of this identifier in the segment list is C-SID.
在一些可选的实施例中,上述第一节点判断第二节点的标识是否是C-SID,还可以包括:第一节点根据第一报文的DA字段获得第一节点的标识,可通过第一节点判断第一节点的标识中包括的标记。其中,第一节点的标识中包括的标记包括第二标记和第三标记,第二标记用于指示第二节点的标记为压缩段标识,第三标记用于指示第二节点的标识为非压缩段标识。如果第一节点的标识中包括第二标记,确定第二节点的标识为压缩段标识。如果第一节点的标识中包括第三标记,确定第二节点的标识为非压缩段标识。In some optional embodiments, the above-mentioned first node judging whether the identifier of the second node is a C-SID may also include: the first node obtains the identifier of the first node according to the DA field of the first message, and may pass the A node determines the flag included in the identity of the first node. Wherein, the mark included in the mark of the first node includes a second mark and a third mark, the second mark is used to indicate that the mark of the second node is a compressed segment mark, and the third mark is used to indicate that the mark of the second node is a non-compressed segment ID. If the identifier of the first node includes the second mark, it is determined that the identifier of the second node is a compressed segment identifier. If the identifier of the first node includes the third flag, it is determined that the identifier of the second node is an uncompressed segment identifier.
S1062:第一节点根据第三节点对应的SL指针的第一值,确定第一TLV字段。S1062: The first node determines the first TLV field according to the first value of the SL pointer corresponding to the third node.
根据S102中对根据段列表中的元素生成TLV的方法的描述,段列表中包括依次排列的一个或多个元素,SRH中包括依次排列TLV字段,段列表中的一个或多个元素与一个或多个TLV字段呈一一对应关系。例如,段列表中包含3个元素G-SID[0]-G-SID[2],则有元素G-SID[0]对应的第一个TLV字段、元素G-SID[1]对应第二个TLV字段以及元素G-SID[2]对应第三个TLV字段。而SL指针的值用于指示标识所在的元素在段列表中的位置,例如,当SL指针的值为2,指示标识所在的元素G-SID[2]。因此,第一节点获取第三节点对应的SL指针的第一值,SL指针的第一值用于指示第三节点的标识所在的第一元素在段列表中的位置,第一节点根据SL指针的第一值,可以确定第三节点的标识所在的第一元素在段列表中对应的序号,进而可以根据第一元素在段列表中对应的序号,从一个或多个TLV字段中获取第一TLV字段。示例性地,当SL指针的第一值为2,指示标识所在的元素G-SID[2]在段列表中对应的序号为3,根据元素G-SID[2]在段列表中对应的序号为3,从多个TLV字段中获取第3个TLV字段,则可以确定第三节点的标识对应第3个TLV字段,即第一TLV字段为多个TLV字段中的第3个TLV字段。According to the description of the method for generating TLV according to the elements in the segment list in S102, the segment list includes one or more elements arranged in sequence, the SRH includes the TLV fields arranged in sequence, and the one or more elements in the segment list are combined with one or more Multiple TLV fields are in a one-to-one correspondence. For example, if the segment list contains 3 elements G-SID[0]-G-SID[2], the first TLV field corresponding to element G-SID[0] and the second TLV field corresponding to element G-SID[1] The first TLV field and the element G-SID[2] correspond to the third TLV field. The value of the SL pointer is used to indicate the position of the element where the identifier is located in the segment list. For example, when the value of the SL pointer is 2, it indicates the element G-SID[2] where the identifier is located. Therefore, the first node acquires the first value of the SL pointer corresponding to the third node, and the first value of the SL pointer is used to indicate the position of the first element where the identifier of the third node is located in the segment list, and the first node according to the SL pointer The first value of the first value of the third node can determine the corresponding sequence number in the segment list of the first element where the identifier of the third node is located, and then the first element can be obtained from one or more TLV fields according to the sequence number corresponding to the first element in the segment list. TLV field. Exemplarily, when the first value of the SL pointer is 2, the corresponding serial number of the element G-SID[2] in the segment list indicating where the identifier is located is 3, according to the corresponding serial number of the element G-SID[2] in the segment list is 3, and the third TLV field is obtained from multiple TLV fields, then it can be determined that the identifier of the third node corresponds to the third TLV field, that is, the first TLV field is the third TLV field among the multiple TLV fields.
在一种可选的实施例中,当TLV字段中还包含第三指示信息,第三指示信息用于指示TLV对应的标识对应的元素在段列表中的位置或次序标识。第一节点可以根据SL指针的第一值和第三指示信息确定第一TLV字段。例如,当SL指针的第一值为2时,确定第三指示 信息为2的TLV字段为第一TLV字段。In an optional embodiment, when the TLV field further includes third indication information, the third indication information is used to indicate the position or sequence identification of the element corresponding to the identifier corresponding to the TLV in the segment list. The first node may determine the first TLV field according to the first value of the SL pointer and the third indication information. For example, when the first value of the SL pointer is 2, it is determined that the TLV field whose third indication information is 2 is the first TLV field.
在一些可选的实施例中,第一节点获取第三节点对应的SL指针的第一值后,第一节点根据SL指针的第一值以及一个或多个TLV字段中的每个字段的第二指示信息确定第一TLV字段。具体地,当一个或多个TLV字段中的一个TLV字段的第二指示信息与SL指针的第一值相同,则该TLV字段为第一TLV字段。当一个或多个TLV字段中的每个TLV字段的第二指示信息都不与SL指针的第一值相同,则取大于SL指针的第一值的所有第二指示信息中的最小一个第二指示信息对应的TLV字段为第一TLV字段。例如,第一报文包括三个TLV字段[64,3]、[80,2]、[128,0]。当第三节点对应的SL指针的第一值为3,与TLV字段[64,3]中的第二指示信息相同,因此TLV字段[64,3]为第一TLV字段。当第三节点对应的SL指针的第一值为1,三个TLV字段中的第二指示信息为3、2、0,与SL指针的第一值都不相同。因此,取三个TLV字段中的第二指示信息大于1的TLV字段中的第二指示信息最小的TLV字段,三个第二指示信息中大于1的有3和2,3和2中最小的值为2,即第二指示信息为2的TLV字段为第一TLV字段,也就是第一TLV字段为[80,2]。In some optional embodiments, after the first node obtains the first value of the SL pointer corresponding to the third node, the first node according to the first value of the SL pointer and the first value of each field in one or more TLV fields The second indication information determines the first TLV field. Specifically, when the second indication information of one TLV field among the one or more TLV fields is the same as the first value of the SL pointer, the TLV field is the first TLV field. When the second indication information of each TLV field in one or more TLV fields is not the same as the first value of the SL pointer, take the smallest one of all second indication information greater than the first value of the SL pointer. The TLV field corresponding to the indication information is the first TLV field. For example, the first packet includes three TLV fields [64, 3], [80, 2], [128, 0]. When the first value of the SL pointer corresponding to the third node is 3, it is the same as the second indication information in the TLV field [64, 3], so the TLV field [64, 3] is the first TLV field. When the first value of the SL pointer corresponding to the third node is 1, the second indication information in the three TLV fields is 3, 2, and 0, which are different from the first value of the SL pointer. Therefore, take the TLV field with the smallest second indication information among the TLV fields with the second indication information greater than 1 among the three TLV fields, the three second indication information greater than 1 have 3 and 2, and the smallest of 3 and 2 The value is 2, that is, the TLV field whose second indication information is 2 is the first TLV field, that is, the first TLV field is [80, 2].
S1063:根据第一TLV字段,获取第三节点的段标识。S1063: Acquire the segment identifier of the third node according to the first TLV field.
其中,第一TLV字段包括第一指示信息和第二指示信息,第一指示信息用于指示第三节点的标识对应的SID的前缀的长度,第二指示信息用于指示第三节点的标识对应的SID的前缀在第一报文中的位置。Wherein, the first TLV field includes first indication information and second indication information, the first indication information is used to indicate the length of the prefix of the SID corresponding to the identity of the third node, and the second indication information is used to indicate that the identity of the third node corresponds to The position of the SID prefix in the first packet.
具体地,第一节点获取所述第一TLV的第一指示信息,如果所述第一TLV的第一指示信息为第一预设值,例如,第一预设值为128,则确定所述第二节点的标识对应的前缀的长度为128,这种情况下,表示第二节点的标识为非压缩段标识,也就是说第三节点的标识长度为128比特。第一节点可根据SL指针的第一值,确定第三节点标识所在的第一元素在段列表中的位置,将第一元素作为第三节点的段标识。Specifically, the first node obtains the first indication information of the first TLV, and if the first indication information of the first TLV is a first preset value, for example, the first preset value is 128, then determine the The length of the prefix corresponding to the identifier of the second node is 128. In this case, it means that the identifier of the second node is an uncompressed segment identifier, that is to say, the length of the identifier of the third node is 128 bits. The first node may determine the position of the first element where the third node identifier is located in the segment list according to the first value of the SL pointer, and use the first element as the segment identifier of the third node.
在一种可能的实施例中,如果第一TLV的第一指示信息为第二预设值,例如,第二预设值为小于128的值,确定第三节点的标识为C-SID。第一节点根据所述SL指针的第一值和CL指针的第一值,获取第三节点的C-SID。其中,SL指针的第一值指示第三节点的标识所属的第一元素在段列表中的位置,CL指针的第一值指示第三节点的C-SID在所述第一元素中的位置。第一节点还需获取第三节点的C-SID对应的SID的前缀,第一节点根据第一TLV的第一指示信息,得到第三节点的C-SID对应的SID的前缀的长度,根据第一TLV的第二指示信息,得到第三节点的C-SID对应的SID的前缀在第一报文中的位置。最后,根据第三节点的C-SID和第三节点的C-SID对应的SID的前缀,得到所述第三节点的段标识。In a possible embodiment, if the first indication information of the first TLV is a second preset value, for example, the second preset value is a value less than 128, it is determined that the identity of the third node is a C-SID. The first node acquires the C-SID of the third node according to the first value of the SL pointer and the first value of the CL pointer. Wherein, the first value of the SL pointer indicates the position of the first element to which the identifier of the third node belongs in the segment list, and the first value of the CL pointer indicates the position of the C-SID of the third node in the first element. The first node also needs to obtain the prefix of the SID corresponding to the C-SID of the third node. The first node obtains the length of the prefix of the SID corresponding to the C-SID of the third node according to the first indication information of the first TLV. The second indication information of a TLV is used to obtain the position of the prefix of the SID corresponding to the C-SID of the third node in the first packet. Finally, the segment identifier of the third node is obtained according to the C-SID of the third node and the prefix of the SID corresponding to the C-SID of the third node.
示例性地,下面以一个或多个TLV字段为顺序排列为例,结合以下三种情况进行说明。Exemplarily, the sequence of one or more TLV fields is taken as an example below, and the following three situations are combined for description.
第一种:跨网络域场景。The first type: Cross-network domain scenario.
图8a和图8b都示例性示出了两个网络域的G-SRv6网络,如图8a和图8b所示,节点N1-节点N4为网络域1,在网络域1中的节点N1-节点N4为支持SRv6头压缩的节点,网络域1中的节点N2-节点N4的SID进行压缩处理,并使用了同样的压缩前缀A:。节点N5-节点N10位于网络域2,在网络域2中的节点N5-节点N9为支持SRv6头压缩的节点,网络域2中的节点N5-节点N9的SID进行压缩处理,并使用了同样的压缩前缀B:。SRH头使用32比特的C-SID段列表。在一个网络域内,每个元素中包含4个压缩段标识。当节点N4检测到节点N4到节点N5的路径故障时,需要获取节点N6的段标识或者转发路径上节点N6之后的节点的段标识进行转发。Both Figure 8a and Figure 8b exemplarily show the G-SRv6 network of two network domains, as shown in Figure 8a and Figure 8b, node N1-node N4 is network domain 1, and node N1-node in network domain 1 N4 is a node that supports SRv6 header compression. The SIDs of node N2-node N4 in network domain 1 are compressed, and the same compression prefix A: is used. Node N5-Node N10 are located in Network Domain 2, and Node N5-Node N9 in Network Domain 2 are nodes that support SRv6 header compression. The SIDs of Node N5-Node N9 in Network Domain 2 are compressed, and the same Compression prefix B:. The SRH header uses a 32-bit C-SID segment list. Within a network domain, each element contains 4 compressed segment identifiers. When the node N4 detects that the path from the node N4 to the node N5 is faulty, it needs to obtain the segment identifier of the node N6 or the segment identifiers of nodes after the node N6 on the forwarding path for forwarding.
在图8a所示的网络中,节点N4接收第一报文后,获取第一报文中SL指针的值,SL指 针的值指示节点N4的标识所在的元素,由图8a可知,SL指针的值为3,表明节点N4的标识在元素G-SID[3]中,CL指针的值为1,说明节点N4的标识在元素G-SID[3]中的第三个C-SID。根据DA字段中包含的N4节点的标识没有携带的COC Flavor标识,在这种情况下,得到节点N5的标识B:5:1::为非压缩段标识,说明节点N5的段标识占用一个元素,更新SL指针的值和CL指针的值,将SL指针减2,SL指针的值为1,指向元素G-SID[1],将CL指针的值更新为3,指向元素G-SID[1]中的第一个C-SID。根据SL指针的值为1,指示节点N6的标识在元素G-SID[1]中,G-SID[1]对应第二个TLV字段,则得到节点N6的段标识对应第二个TLV字段[80,2,1]。In the network shown in Figure 8a, after node N4 receives the first message, it obtains the value of the SL pointer in the first message, and the value of the SL pointer indicates the element where the identity of node N4 is located. As can be seen from Figure 8a, the value of the SL pointer A value of 3 indicates that the identifier of the node N4 is in the element G-SID[3], and the value of the CL pointer is 1, indicating that the identifier of the node N4 is in the third C-SID in the element G-SID[3]. According to the ID of the N4 node contained in the DA field does not carry the COC Flavor ID, in this case, the ID of the node N5 B:5:1:: is an uncompressed segment ID, indicating that the segment ID of the node N5 occupies one element , update the value of the SL pointer and the value of the CL pointer, decrement the SL pointer by 2, the value of the SL pointer is 1, point to the element G-SID[1], update the value of the CL pointer to 3, point to the element G-SID[1] ] in the first C-SID. According to the value of the SL pointer being 1, indicating that the identifier of the node N6 is in the element G-SID[1], and G-SID[1] corresponds to the second TLV field, the segment identifier of the node N6 corresponds to the second TLV field [ 80, 2, 1].
根据第二个TLV字段[80,2,1]中的第一指示信息为80,得到节点N6的标识为C-SID,节点N6的C-SID对应的前缀长度为80比特。根据第二指示信息为2,得到节点N6的C-SID对应的前缀在元素G-SID[2]中。根据第一指示信息为80和第二指示信息为2,可以从元素G-SID[2]中的到节点N6的C-SID对应的前缀为B:。根据SL指针的值为1和CL指针的值为3,确定节点N6的C-SID在元素G-SID[1]的第一个C-SID,得到节点N6的C-SID为6:1。因此,节点N6的C-SID加上C-SID对应的前缀,可以得到节点N6的段标识为B:6:1::。According to the first indication information in the second TLV field [80, 2, 1] being 80, the identifier of the node N6 is obtained as C-SID, and the prefix length corresponding to the C-SID of the node N6 is 80 bits. According to the second indication information being 2, it is obtained that the prefix corresponding to the C-SID of the node N6 is in the element G-SID[2]. According to the first indication information being 80 and the second indication information being 2, the prefix corresponding to the C-SID of the node N6 from the element G-SID[2] can be B:. According to the value of the SL pointer 1 and the value of the CL pointer 3, it is determined that the C-SID of the node N6 is the first C-SID of the element G-SID[1], and the C-SID of the node N6 is 6:1. Therefore, adding the prefix corresponding to the C-SID to the C-SID of the node N6, the segment identifier of the node N6 can be obtained as B:6:1::.
当节点N4接收在图8b所示的第一报文后,第一报文包括三个TLV字段,分别为[64,3]、[80,2]、[128,0],节点N4获取第一报文中SL指针的值为3,由上述图8a的分析可知,可以获得节点N6对应的SL指针的值为1。三个TLV字段中的第二指示信息都不与SL指针的值相同,将1跟三个TLV字段中的第二指示信息进行比较,取大于1的多个值中的最小一个值,三个TLV字段中的第二指示信息分别是3、2、0,大于1的数为3、2,而3和2中的最小的是2,因此,可以确定节点N6对应的TLV字段为[80,2]。根据TLV字段[80,2]中第一指示信息为80,得到节点N6的标识为C-SID,节点N6的C-SID对应的前缀长度为80比特。根据第二指示信息为2,得到节点N6的C-SID对应的前缀在元素G-SID[2]中。根据第一指示信息为80和第二指示信息为2,可以从元素G-SID[2]中的到节点N6的C-SID对应的前缀为B:。根据SL指针的值为1和CL指针的值为3,确定节点N6的C-SID在元素G-SID[1]的第一个C-SID,得到节点N6的C-SID为6:1。因此,节点N6的C-SID加上C-SID对应的前缀,可以得到节点N6的段标识为B:6:1::。After node N4 receives the first message shown in Figure 8b, the first message includes three TLV fields, which are [64, 3], [80, 2], [128, 0], and node N4 obtains the first The value of the SL pointer in a message is 3. According to the analysis of FIG. 8a above, the value of the SL pointer corresponding to the node N6 can be obtained as 1. The second indication information in the three TLV fields is not the same as the value of the SL pointer, compare 1 with the second indication information in the three TLV fields, and take the smallest value among the multiple values greater than 1, three The second indication information in the TLV field is 3, 2, 0 respectively, the numbers greater than 1 are 3, 2, and the smallest of 3 and 2 is 2, therefore, it can be determined that the TLV field corresponding to node N6 is [80, 2]. According to the first indication information in the TLV field [80, 2] being 80, the identifier of the node N6 is obtained as C-SID, and the prefix length corresponding to the C-SID of the node N6 is 80 bits. According to the second indication information being 2, it is obtained that the prefix corresponding to the C-SID of the node N6 is in the element G-SID[2]. According to the first indication information being 80 and the second indication information being 2, the prefix corresponding to the C-SID of the node N6 from the element G-SID[2] can be B:. According to the value of the SL pointer 1 and the value of the CL pointer 3, it is determined that the C-SID of the node N6 is the first C-SID of the element G-SID[1], and the C-SID of the node N6 is 6:1. Therefore, adding the prefix corresponding to the C-SID to the C-SID of the node N6, the segment identifier of the node N6 can be obtained as B:6:1::.
第二种:纯压缩场景。The second type: pure compression scene.
图9a和图9b都示例性示出了一种G-SRv6网络,如图9a和图9b都所示,该网络包括节点N1-节点N10,SRH使用32比特的C-SID编排段列表。当节点N3检测到节点N3到节点N4的路径故障时,需要获取节点N5或者节点N5之后的节点的段标识,按照节点N5或者节点N5之后的节点的段标识进行转发第一报文,绕过故障节点。Both Fig. 9a and Fig. 9b exemplarily show a G-SRv6 network. As shown in Fig. 9a and Fig. 9b, the network includes a node N1 - a node N10, and the SRH uses a 32-bit C-SID to organize a segment list. When node N3 detects that the path from node N3 to node N4 is faulty, it needs to obtain the segment identifier of node N5 or the node after node N5, and forward the first message according to the segment identifier of node N5 or the node after node N5, bypassing faulty node.
节点N3获取到如图9a所示的第一报文时,SL指针的值为2,指示N3节点的标识在元素G-SID[2],CL指针的值为2,说明节点N3的标识在元素G-SID[2]中的第二个压缩段标识。根据DA字段中N3节点段标识携带COC Flavor标识,得到节点N4的标识为C-SID,更新CL指针的值,将CL指针的值减1,得到CL指针的值为1,CL指针的值不为0,根据SL指针的值为2和CL指针的值为1,指向元素G-SID[2]中的第三个C-SID,说明节点N4的标识不是元素G-SID[2]中的最后一个C-SID,节点N5的标识在元素G-SID[2]中。因此,可以得到节点N5对应的SL指针的值为2。根据SL的值为2,指示节点N5的标识在元素G-SID[2]中,G-SID[2]对应第三个TLV字段,则可以确定节点N5的标识对应第三个TLV字段[64,15,2]。When the node N3 obtains the first message as shown in Figure 9a, the value of the SL pointer is 2, indicating that the identifier of the node N3 is in the element G-SID[2], and the value of the CL pointer is 2, indicating that the identifier of the node N3 is in The second compressed segment identifier in element G-SID[2]. According to the N3 node segment identifier in the DA field carrying the COC Flavor identifier, the identifier of the node N4 is obtained as C-SID, the value of the CL pointer is updated, and the value of the CL pointer is reduced by 1 to obtain a value of 1 for the CL pointer, and the value of the CL pointer is not is 0, according to the value of the SL pointer is 2 and the value of the CL pointer is 1, it points to the third C-SID in the element G-SID[2], indicating that the identity of the node N4 is not in the element G-SID[2] The last C-SID, the identity of node N5 is in element G-SID[2]. Therefore, it can be obtained that the value of the SL pointer corresponding to the node N5 is 2. According to the value of SL being 2, indicating that the identifier of node N5 is in the element G-SID[2], and G-SID[2] corresponds to the third TLV field, it can be determined that the identifier of node N5 corresponds to the third TLV field[64 , 15, 2].
然后根据第三个TLV[64,15,2]中的第一指示信息为64,可以的到节点N5标识为C-SID,节点N5的C-SID对应的前缀的长度为64比特。第二指示信息为15,可以得到节点N5的C-SID对应的前缀位于第一报文DA字段中。根据第一指示信息64和第二指示信息15,可以从目的地址获得节点N5的C-SID对应的前缀A:。根据SL指针的值为2和CL指针的值为1,可以得到节点N4的C-SID在元素G-SID[2]中的第三个C-SID,更新CL指针的值,将CL指针的值减1,得到CL指针的值为0,确定节点N5的C-SID在元素G-SID[2]中的第四个C-SID,得到节点N5的C-SID为5:1。因此,节点N5的C-SID 5:1加上C-SID对应的前缀A:,可以得到节点N5的段标识为A:5:1::。Then, according to the first indication information in the third TLV [64, 15, 2] being 64, it is possible to identify the node N5 as a C-SID, and the length of the prefix corresponding to the C-SID of the node N5 is 64 bits. The second indication information is 15, and it can be obtained that the prefix corresponding to the C-SID of the node N5 is located in the DA field of the first message. According to the first indication information 64 and the second indication information 15, the prefix A: corresponding to the C-SID of the node N5 can be obtained from the destination address. According to the value of the SL pointer of 2 and the value of the CL pointer of 1, the third C-SID of the C-SID of node N4 in the element G-SID[2] can be obtained, the value of the CL pointer is updated, and the value of the CL pointer The value is subtracted by 1 to obtain the value of the CL pointer as 0, and the fourth C-SID of the C-SID of the node N5 in the element G-SID[2] is determined, and the C-SID of the node N5 is obtained as 5:1. Therefore, the C-SID 5:1 of the node N5 adds the prefix A: corresponding to the C-SID, and the segment identifier of the node N5 can be obtained as A:5:1::.
当节点N3接收在图9b所示的第一报文后,第一报文包括两个TLV字段,分别为[64,2]、[128,0],节点N3获取第一报文中SL指针的值为2,由上述图9a的分析可知,可以获得节点N5对应的SL指针的值为2。TLV字段[64,2]中的第二指示信息与SL指针的值相同,因此,可以确定节点N5对应的TLV字段为[64,2]。After node N3 receives the first message shown in Figure 9b, the first message includes two TLV fields, which are [64,2] and [128,0] respectively, and node N3 obtains the SL pointer in the first message The value of is 2. From the above analysis of FIG. 9a, it can be known that the value of the SL pointer corresponding to the node N5 is 2. The second indication information in the TLV field [64, 2] is the same as the value of the SL pointer, therefore, it can be determined that the TLV field corresponding to the node N5 is [64, 2].
然后根据TLV[64,2]中的第一指示信息为64,可以的到节点N5标识为C-SID,节点N5的C-SID对应的前缀的长度为64比特。第二指示信息为2,可以得到节点N5的C-SID对应的前缀位于元素G-SID[2]中。由于第一报文中两个TLV字段的第二指示信息分别为2和0。2是第一报文中第二指示信息中最大的一个值,可以得到元素G-SID[2]是段列表中的第一个元素,因此,得到节点N5的C-SID对应的前缀位于第一报文的目的地址字段中。可以从目的地址获得节点N5的C-SID对应的前缀A:。根据SL指针的值为2和CL指针的值为1,可以得到节点N4的C-SID在元素G-SID[2]中的第三个C-SID,更新CL指针的值,将CL指针的值减1,得到CL指针的值为0,确定节点N5的C-SID在元素G-SID[2]中的第四个C-SID,得到节点N5的C-SID为5:1。因此,节点N5的C-SID 5:1加上C-SID对应的前缀A:,可以得到节点N5的段标识为A:5:1::。Then, according to the first indication information in TLV[64, 2] being 64, it is possible to identify the node N5 as a C-SID, and the length of the prefix corresponding to the C-SID of the node N5 is 64 bits. The second indication information is 2, and it can be obtained that the prefix corresponding to the C-SID of the node N5 is located in the element G-SID[2]. Since the second indication information of the two TLV fields in the first message is 2 and 0 respectively. 2 is the largest value in the second indication information in the first message, it can be obtained that the element G-SID[2] is a segment list Therefore, the prefix corresponding to the C-SID of the obtained node N5 is located in the destination address field of the first packet. The prefix A: corresponding to the C-SID of the node N5 can be obtained from the destination address. According to the value of the SL pointer of 2 and the value of the CL pointer of 1, the third C-SID of the C-SID of node N4 in the element G-SID[2] can be obtained, the value of the CL pointer is updated, and the value of the CL pointer The value is subtracted by 1 to obtain the value of the CL pointer as 0, and the fourth C-SID of the C-SID of the node N5 in the element G-SID[2] is determined, and the C-SID of the node N5 is obtained as 5:1. Therefore, the C-SID 5:1 of the node N5 adds the prefix A: corresponding to the C-SID, and the segment identifier of the node N5 can be obtained as A:5:1::.
在一种可能的实施例中,按照上述过程,在节点N5的基础上还可以获得报文转发路径上节点N5之后节点的段标识,例如,获得节点N6的段标识,在此不再赘述。In a possible embodiment, according to the above process, based on the node N5, the segment identification of the node after the node N5 on the packet forwarding path can also be obtained, for example, the segment identification of the node N6 can be obtained, which will not be repeated here.
第三种:压缩和非压缩混合编排场景。The third type: Compressed and non-compressed mixed orchestration scenarios.
图10a和图10b示例性示出了一种G-SRv6网络,如图10a和图10b所示,节点N1~节点N4在G-SRv6网络域1中,网络域1中的节点N2~节点N4为支持SRv6头压缩的节点,网络域1中的节点N2~节点N4的SID进行压缩处理,并使用了同样的压缩前缀A:。节点N5位于网络域2,节点N5为标准的SRv6节点,不支持SRv6头压缩,节点N5对应的标识为非压缩段标识。节点N6~节点N10在G-SRv6网络域3中,网络域3中的节点N6~节点N10为支持SRv6头压缩的节点,网络域3中的节点N6~节点N9的SID进行压缩处理,并使用了同样的压缩前缀A:,节点N10对应的标识为非压缩段标识.SRH头使用32比特的C-SID和128比特SID混合编排段列表。当节点N3检测到节点N3到节点N4的路径故障时,需要获取节点N5或者节点N5之后的节点的段标识,按照该节点N5或者转发路径上节点N5之后的节点的段标识进行转发第一报文,绕过故障节点。Figure 10a and Figure 10b exemplarily show a G-SRv6 network. As shown in Figure 10a and Figure 10b, nodes N1 to node N4 are in G-SRv6 network domain 1, and nodes N2 to node N4 in network domain 1 For nodes supporting SRv6 header compression, the SIDs of nodes N2 to N4 in network domain 1 are compressed, and the same compression prefix A: is used. Node N5 is located in network domain 2. Node N5 is a standard SRv6 node that does not support SRv6 header compression. The identifier corresponding to node N5 is an uncompressed segment identifier. Nodes N6 to N10 are in G-SRv6 network domain 3, nodes N6 to node N10 in network domain 3 are nodes that support SRv6 header compression, and the SIDs of nodes N6 to node N9 in network domain 3 are compressed and used With the same compressed prefix A:, the corresponding identifier of the node N10 is an uncompressed segment identifier. The SRH header uses a 32-bit C-SID and a 128-bit SID to compile a segment list. When the node N3 detects that the path from the node N3 to the node N4 is faulty, it needs to obtain the segment identifier of the node N5 or the node after the node N5, and forward the first packet according to the segment identifier of the node N5 or the node after the node N5 on the forwarding path. text, bypassing the faulty node.
节点N3获取到如图10a所示的第一报文后,SL指针的值为4,指示节点N3的标识在元素G-SID[4],CL指针的值为2,指示节点N3的标识在元素G-SID[4]中的第二个C-SID。After the node N3 obtains the first message as shown in Figure 10a, the value of the SL pointer is 4, indicating that the identifier of the node N3 is in the element G-SID[4], and the value of the CL pointer is 2, indicating that the identifier of the node N3 is in The second C-SID in element G-SID[4].
根据DA字段中节点N3的标识携带COC Flavor标识,得到节点N4的标识为C-SID,更新CL指针的值,将CL指针的值减1,得到CL指针的值为1,不为0,根据SL指针的值为4和CL指针的值为1,得到32比特的N4的C-SID。当获得的32比特的C-SID不为0,更新CL指针的值,将CL指针的值减1,得到CL指针的值为0,得到32比特的C-SID。当 获得的32比特的C-SID为0,说明节点N4的C-SID是元素G-SID[4]中最后一个C-SID。更新SL指针的值,将SL指针的值减1,得到SL指针的值为3。根据SL指针的值为3,根据SL指针的值为3,指示节点N5的标识在元素G-SID[3]中,元素G-SID[3]对应第四个TLV字段,则可以确定节点N5的标识对应第四个TLV字段[128,3,3]。According to the identification of node N3 in the DA field carrying the COC Flavor identification, the identification of node N4 is obtained as C-SID, the value of the CL pointer is updated, the value of the CL pointer is reduced by 1, and the value of the CL pointer is 1, not 0, according to The value of the SL pointer is 4 and the value of the CL pointer is 1, and the 32-bit C-SID of N4 is obtained. When the obtained 32-bit C-SID is not 0, the value of the CL pointer is updated, and the value of the CL pointer is decremented by 1 to obtain the value of the CL pointer as 0, and the 32-bit C-SID is obtained. When the obtained 32-bit C-SID is 0, it means that the C-SID of the node N4 is the last C-SID in the element G-SID[4]. The value of the SL pointer is updated, and the value of the SL pointer is decremented by 1, so that the value of the SL pointer is 3. According to the value of the SL pointer is 3, according to the value of the SL pointer is 3, indicating that the identification of the node N5 is in the element G-SID[3], and the element G-SID[3] corresponds to the fourth TLV field, then the node N5 can be determined The identifier of corresponds to the fourth TLV field [128, 3, 3].
根据第四个TLV字段[128,3,3]中的第一指示信息为128可以得到节点N5的标识为非压缩段标识,说明节点N5的段标识为128比特,占用一个元素,即元素G-SID[3],因此可以的到128比特的段标识B:5:1::,即节点N5的段标识为B:5:1::。According to the first indication information in the fourth TLV field [128, 3, 3] is 128, it can be obtained that the identification of node N5 is an uncompressed segment identification, indicating that the segment identification of node N5 is 128 bits, occupying one element, that is, element G -SID[3], so the 128-bit segment identifier B:5:1:: can be obtained, that is, the segment identifier of the node N5 is B:5:1::.
节点N3获取到如图10b所示的第一报文后,第一报文包括四个TLV字段,分别为[64,4]、[128,3,]、[64,2]、[128,0]。节点N3获取第一报文中SL指针的值为3,由上述图10a的分析可知,可以获得节点N5对应的SL指针的值为3。TLV字段[128,3,]中的第二指示信息与SL指针的值相同,因此,可以确定节点N5对应的TLV字段为[128,3]。After node N3 obtains the first message as shown in Figure 10b, the first message includes four TLV fields, which are [64,4], [128,3,], [64,2], [128, 0]. The node N3 obtains the value of the SL pointer in the first message as 3, and it can be known from the analysis of FIG. 10 a that the value of the SL pointer corresponding to the node N5 can be obtained as 3. The second indication information in the TLV field [128,3,] is the same as the value of the SL pointer, therefore, it can be determined that the TLV field corresponding to the node N5 is [128,3].
根据TLV字段[128,3]中的第一指示信息为128可以得到节点N5的标识为非压缩段标识,说明节点N5的段标识为128比特,占用一个元素,即元素G-SID[3],因此可以的到128比特的段标识B:5:1::,即节点N5的段标识为B:5:1::。According to the first indication information in the TLV field [128, 3] being 128, it can be obtained that the identifier of node N5 is a non-compressed segment identifier, indicating that the segment identifier of node N5 is 128 bits and occupies one element, that is, the element G-SID[3] , so the 128-bit segment identifier B:5:1:: can be obtained, that is, the segment identifier of the node N5 is B:5:1::.
上述图8a-图10b所示的G-SRv6网络中还包括中转节点,图中未示出。中转节点为转发G-SRv6报文但是不进行G-SRv6报文处理的节点。The above G-SRv6 network shown in FIG. 8a-FIG. 10b also includes a transit node, which is not shown in the figure. A transit node is a node that forwards G-SRv6 messages but does not process G-SRv6 messages.
值得说明的是,本申请实施例中,转发路径上的中间转发节点可以是中转节点,还可以是SR节点,本申请对此不作任何限定。It should be noted that, in the embodiment of the present application, the intermediate forwarding node on the forwarding path may be a transit node or an SR node, which is not limited in this application.
在一种可能的实施例中,第一节点还可以是中转节点,中转节点为转发G-SRv6报文但是不进行G-SRv6报文处理的节点。在中转节点检测到中转节点到下一跳SR节点的路径故障时,使该中转节点成为支持SRv6功能的节点,代替故障节点处理报文,绕过故障节点或者故障路径。例如,获取故障节点下一跳节点段标识,根据该段标识进行转发报文。In a possible embodiment, the first node may also be a transit node, and the transit node is a node that forwards the G-SRv6 message but does not process the G-SRv6 message. When the transit node detects that the path from the transit node to the next hop SR node is faulty, the transit node becomes a node supporting the SRv6 function, processes packets instead of the faulty node, and bypasses the faulty node or faulty path. For example, obtain the segment identifier of the next hop node of the faulty node, and forward the message according to the segment identifier.
示例性地,图11a和图11b示出了一种G-SRv6网络示意图,如图11a和图11b所示,该网络中节点N1-N10在G-SRv6网络域中,该网络域中包含节点为支持SRv6头压缩的节点,该网络域中的节点N2-节点N9的SID进行了压缩处理,并使用了同样的压缩前缀A:。段列表指定了沿途要经过的节点,N3’是中转节点,不在段列表中。SRH头使用32比特的C-SID编排段列表。当节点N3’检测到下一跳节点N4故障时,使节点N3’成为能够处理G-SRv6报文处理的节点,获取节点N5的段标识,根据节点N5的段标识的指令进行转发。Exemplarily, Figure 11a and Figure 11b show a schematic diagram of a G-SRv6 network, as shown in Figure 11a and Figure 11b, the nodes N1-N10 in the network are in the G-SRv6 network domain, and the network domain contains nodes For nodes supporting SRv6 header compression, the SIDs of node N2-node N9 in this network domain are compressed, and the same compressed prefix A: is used. The segment list specifies the nodes to be passed along the way, and N3' is a transit node, which is not in the segment list. The SRH header uses a 32-bit C-SID to program the segment list. When the node N3' detects that the next hop node N4 fails, the node N3' becomes a node capable of processing G-SRv6 messages, obtains the segment identifier of the node N5, and forwards according to the instruction of the segment identifier of the node N5.
节点N3’收到如图11a所示的第一报文时,SL指针的值为2,指示节点N4的标识在元素G-SID[2]中,CL指针的值为1,指示节点N4的标识在元素G-SID[2]中的第三个C-SID。根据DA字段中节点N4的标识携带COC Flavor标识,得到节点N5的标识为C-SID。CL指针的值不为0,说明N4节点的C-SID不是元素G-SID[2]中最后一个段标识,更新CL指针的值,将CL指针的值减1,得到CL指针的值为0,说明节点N5的标识在元素G-SID[2]的最后一个C-SID。因此,可以得到节点N5对应的SL指针的值为2。根据SL指针的值为2,指示节点N5的标识在元素G-SID[2],元素G-SID[2]对应第三个TLV字段,则可以确定节点N5对应第三个TLV字段[64,15,2]。When the node N3' receives the first message shown in Figure 11a, the value of the SL pointer is 2, indicating that the identifier of the node N4 is in the element G-SID[2], and the value of the CL pointer is 1, indicating that the identity of the node N4 is Identifies the third C-SID in element G-SID[2]. According to the identifier of node N4 in the DA field carrying the COC Flavor identifier, the identifier of node N5 is obtained as C-SID. The value of the CL pointer is not 0, indicating that the C-SID of the N4 node is not the last segment identifier in the element G-SID[2], update the value of the CL pointer, subtract 1 from the value of the CL pointer, and obtain the value of the CL pointer as 0 , indicating that the identifier of the node N5 is in the last C-SID of the element G-SID[2]. Therefore, it can be obtained that the value of the SL pointer corresponding to the node N5 is 2. According to the value of the SL pointer being 2, indicating that the identifier of the node N5 is in the element G-SID[2], and the element G-SID[2] corresponds to the third TLV field, it can be determined that the node N5 corresponds to the third TLV field [64, 15, 2].
然后根据第三个TLV字段[64,15,2]中第一指示信息为64,可以的到节点N5标识为C-SID,节点N5的C-SID对应的前缀的长度为64比特。第二指示信息为15,可以得到节点N5的C-SID对应的前缀的位置位于第一报文DA字段中。根据第一指示信息为64和第二指示信息15,可以从第一报文的目的地址字段获取64比特的前缀A:。根据SL指针的值为2和CL指针的值为1,得到节点N4的C-SID,更新CL指针的值,将CL指针的值减1,得到 CL指针的值为0,根据SL指针的值为2和CL指针的值为0,确定节点N5的C-SID在元素G-SID[2]中的第四个C-SID,即第四个C-SID。得到节点N5的C-SID为5:1。因此,节点N5的C-SID5:1加上前缀A:,可以得到节点N5的段标识为A:5:1::。Then, according to the first indication information in the third TLV field [64, 15, 2] being 64, it is possible to identify the node N5 as a C-SID, and the length of the prefix corresponding to the C-SID of the node N5 is 64 bits. The second indication information is 15, and it can be obtained that the location of the prefix corresponding to the C-SID of the node N5 is located in the DA field of the first message. According to the first indication information being 64 and the second indication information being 15, the 64-bit prefix A: can be obtained from the destination address field of the first packet. According to the value of SL pointer 2 and the value of CL pointer 1, get the C-SID of node N4, update the value of CL pointer, subtract 1 from the value of CL pointer, get the value of CL pointer 0, according to the value of SL pointer is 2 and the value of the CL pointer is 0, determine the fourth C-SID of the C-SID of the node N5 in the element G-SID[2], that is, the fourth C-SID. The obtained C-SID of node N5 is 5:1. Therefore, adding the prefix A: to the C-SID 5:1 of the node N5 results in the segment ID of the node N5 being A:5:1::.
当节点N3’接收在图10b所示的第一报文后,第一报文包括两个TLV字段,分别为[64,2]、[128,0]。节点N3’获取第一报文中SL指针的值为2,由上述图9a的分析可知,可以获得节点N5对应的SL指针的值为2。TLV字段[64,2]中的第二指示信息2与SL指针的值2相同,因此,可以确定节点N5对应的TLV字段为[64,2]。After the node N3' receives the first message shown in Figure 10b, the first message includes two TLV fields, which are [64,2] and [128,0] respectively. The node N3' obtains the value of the SL pointer in the first message as 2, and it can be seen from the above analysis of FIG. 9a that the value of the SL pointer corresponding to the node N5 can be obtained as 2. The second indication information 2 in the TLV field [64,2] is the same as the value 2 of the SL pointer, therefore, it can be determined that the TLV field corresponding to the node N5 is [64,2].
根据TLV[64,2]中的第一指示信息为64,可以的到节点N5标识为C-SID,节点N5的C-SID对应的前缀的长度为64比特。第二指示信息为2,可以得到节点N5的C-SID对应的前缀位于元素G-SID[2]中。由于第一报文中两个TLV字段的第二指示信息分别为2和0。2是第一报文中第二指示信息中最大的一个值,可以得到元素G-SID[2]是段列表中的第一个元素,因此,得到节点N5的C-SID对应的前缀位于第一报文的目的地址字段中。可以从目的地址获得节点N5的C-SID对应的前缀A:。根据SL指针的值为2和CL指针的值为1,可以得到节点N4的C-SID在元素G-SID[2]中的第三个C-SID,更新CL指针的值,将CL指针的值减1,得到CL指针的值为0,确定节点N5的C-SID在元素G-SID[2]中的第四个C-SID,得到节点N5的C-SID为5:1。因此,节点N5的C-SID 5:1加上C-SID对应的前缀A:,可以得到节点N5的段标识为A:5:1::。According to the first indication information in TLV [64, 2] being 64, the possible identification of the node N5 is C-SID, and the length of the prefix corresponding to the C-SID of the node N5 is 64 bits. The second indication information is 2, and it can be obtained that the prefix corresponding to the C-SID of the node N5 is located in the element G-SID[2]. Since the second indication information of the two TLV fields in the first message is 2 and 0 respectively. 2 is the largest value in the second indication information in the first message, it can be obtained that the element G-SID[2] is a segment list Therefore, the prefix corresponding to the C-SID of the obtained node N5 is located in the destination address field of the first packet. The prefix A: corresponding to the C-SID of the node N5 can be obtained from the destination address. According to the value of the SL pointer of 2 and the value of the CL pointer of 1, the third C-SID of the C-SID of node N4 in the element G-SID[2] can be obtained, the value of the CL pointer is updated, and the value of the CL pointer The value is subtracted by 1 to obtain the value of the CL pointer as 0, and the fourth C-SID of the C-SID of the node N5 in the element G-SID[2] is determined, and the C-SID of the node N5 is obtained as 5:1. Therefore, the C-SID 5:1 of the node N5 adds the prefix A: corresponding to the C-SID, and the segment identifier of the node N5 can be obtained as A:5:1::.
S107:第一节点基于第一报文将第三节点的段标识复制至第一报文的目的地址中,封装成第二报文,并发送第二报文。S107: Based on the first packet, the first node copies the segment identifier of the third node into the destination address of the first packet, encapsulates it into a second packet, and sends the second packet.
第一节点获取第三节点的段标识之后,将第三节点的段标识复制至DA字段,更新SL指针和CL指针,将第一报文封装成第二报文,根据第二报文中DA字段的段标识的指令,进行转发第二报文。After the first node obtains the segment ID of the third node, it copies the segment ID of the third node to the DA field, updates the SL pointer and the CL pointer, and encapsulates the first message into a second message, according to the DA field in the second message The instruction of the segment identifier of the field is used to forward the second message.
实施本申请实施例,通过在第一报文中添加指示信息,转发路径上的中间转发节点检测到下一跳SR节点的路径故障时,该中间转发节点可以获取转发路径上下一跳SR节点之后的多个节点中的任意一个节点的段标识,根据该段标识的功能字段中包含的指令进行转发报文,从而绕过故障节点,使得报文能够继续转发,完成数据传输。Implementing the embodiment of the present application, by adding indication information in the first message, when the intermediate forwarding node on the forwarding path detects the path failure of the next hop SR node, the intermediate forwarding node can obtain the next hop SR node on the forwarding path The segment identification of any one of the multiple nodes in the network forwards the message according to the instructions contained in the function field of the segment identification, thereby bypassing the faulty node, so that the message can continue to be forwarded, and the data transmission is completed.
可以理解的是,不限于上述封装指示信息,指示信息还可以封装在段标识中。例如,128比特,IPv6地址中的16比特用作指示信息,其余的用作路径信息标识。It can be understood that, not limited to the above encapsulation indication information, the indication information may also be encapsulated in the segment identifier. For example, 128 bits, 16 bits in the IPv6 address are used as indication information, and the rest are used as path information identifiers.
需要说明的是,对于上述方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明所必须的。It should be noted that, for the above-mentioned method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence. Secondly, Those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions involved are not necessarily required by the present invention.
上述详细阐述了本发明实施例的方法,下面为了便于更好地实施本发明实施例的上述方案,相应地,下面还提供用于配合实施上述方案的相关装置。The method of the embodiment of the present invention has been described in detail above. In order to facilitate better implementation of the above-mentioned solution of the embodiment of the present invention, correspondingly, the following also provides related devices for coordinating the implementation of the above-mentioned solution.
请参见图12,图12为本申请实施例提供的一种网络设备的结构示意图,如图12所示,所述网络设备100至少包括:第一接收单元110、第一处理单元120以及第一发送单元130;其中,Please refer to FIG. 12, which is a schematic structural diagram of a network device provided by an embodiment of the present application. As shown in FIG. 12, the network device 100 at least includes: a first receiving unit 110, a first processing unit 120, and a first Sending unit 130; wherein,
第一接收单元110用于获取第一报文的段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中多个节点中的一个节点或所述转发路径中的一个链路;The first receiving unit 110 is configured to obtain a segment list of the first message, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, and the one or more elements Each element in includes one or more identifiers, and each identifier in the one or more identifiers corresponds to a node among the plurality of nodes in the forwarding path or a link in the forwarding path;
第一处理单元120,用于根据所述段列表,生成一个或多个类型-长度-值TLV。The first processing unit 120 is configured to generate one or more type-length-value TLVs according to the segment list.
第一发送单元130,用于发送所述第一报文,所述第一报文包括一个或多个TLV,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID对应的前缀信息。The first sending unit 130 is configured to send the first packet, the first packet includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used Prefix information corresponding to a segment identifier SID indicating a node in the plurality of nodes or a link in the forwarding path.
本申请实施例中,上述网络设备100对根据第一报文的段列表中第一元素生成第一TLV字段,并对第一报文进行封装以及转发等处理方式对应于上述方法实施例中的源节点对第一报文的处理方式,在此不再赘述。In the embodiment of the present application, the above-mentioned network device 100 generates the first TLV field according to the first element in the segment list of the first message, and encapsulates and forwards the first message in a manner corresponding to that in the above-mentioned method embodiment The manner in which the source node processes the first packet will not be repeated here.
请参见图13,图13为本申请实施例提供的一种网络设备的结构示意图,如图13所示,所述网络设备200至少包括:第二接收单元210、第二处理单元220以及第二发送单元230,其中,Please refer to FIG. 13. FIG. 13 is a schematic structural diagram of a network device provided by an embodiment of the present application. As shown in FIG. 13, the network device 200 at least includes: a second receiving unit 210, a second processing unit 220 and a The sending unit 230, wherein,
第二接收单元210,用于第一节点接收第一报文,所述第一报文包括段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中的一个节点或所述转发路径中的一个链路;The second receiving unit 210 is used for the first node to receive the first message, the first message includes a segment list, the segment list corresponds to the forwarding path of the first message, and the segment list includes one or a plurality of elements, the elements including one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path;
第二处理单元220,用于当确定所述第一节点到第二节点的路径故障时,所述第一节点根据所述第一报文中的一个或多个类型-长度-值TLV获得第三节点的段标识,所述第二节点是所述转发路径中所述第一节点的下一跳分段路由SR节点,所述第三节点是所述转发路径中在所述第二节点之后的节点中的任意一个节点,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID对应的前缀信息;The second processing unit 220 is configured to, when determining that the path from the first node to the second node is faulty, the first node obtains the first node according to one or more type-length-value TLVs in the first packet The segment identification of three nodes, the second node is the next hop segment routing SR node of the first node in the forwarding path, and the third node is after the second node in the forwarding path Any one of the nodes in the one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used to indicate a node in the plurality of nodes or a link in the forwarding path The prefix information corresponding to the segment identifier SID;
所述第一节点根据所述第一报文获得第二报文;The first node obtains a second message according to the first message;
第二发送单元230,用于发送所述第二报文,所述第二报文的目的地址包括所述第三节点的段标识。The second sending unit 230 is configured to send the second message, where the destination address of the second message includes the segment identifier of the third node.
本申请实施例中,上述网络设备100对接收的第一报文的第一TLV字段,获得所述第二节点的段标识以及转发等处理方式对应于上述方法实施例中的第一节点对第一报文的处理方式,在此不再赘述。In the embodiment of the present application, the above-mentioned network device 100 obtains the segment identifier of the second node and forwards the first TLV field of the received first message in a manner corresponding to the first node in the above-mentioned method embodiment. The manner of processing a message will not be repeated here.
可以理解的是,上述各设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above-mentioned functions, each of the above-mentioned devices includes a corresponding hardware structure and/or software module for performing each function. Those skilled in the art should easily realize that the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and method steps described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本申请实施例可以根据上述方法示例对各设备进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide each device into functional units according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation.
请参见图14,图14时本申请实施例提供的一种网络设备的结构示意图,所述网络设备300至少包括处理器310、收发器320以及存储器330,所述处理器310、收发器320以及存储器330通过总线340相互连接,其中,Please refer to FIG. 14. FIG. 14 is a schematic structural diagram of a network device provided by an embodiment of the present application. The network device 300 includes at least a processor 310, a transceiver 320, and a memory 330. The processor 310, the transceiver 320, and The memories 330 are interconnected via a bus 340, wherein,
所述处理器310可以是中央处理器(central processing unit,CPU),或者CPU和硬件芯 片的组合。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。The processor 310 may be a central processing unit (central processing unit, CPU), or a combination of a CPU and a hardware chip. The aforementioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof. The aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
所述收发器320可以包括一个接收器和一个发送器,例如,无线射频模块,以下描述的处理器310接收或者发送某个消息,具体可以理解为该处理器310通过该收发器来接收或者发送。The transceiver 320 may include a receiver and a transmitter, for example, a wireless radio frequency module, and the processor 310 described below receives or sends a certain message, specifically, it can be understood that the processor 310 receives or sends a message through the transceiver .
所述存储器330包括但不限于是随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)或可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM或者快闪存储器),该存储器330用于存储相关指令及数据,并可以将存储的数据传输给处理器310。The memory 330 includes but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM) or erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM or flash memory), the memory 330 is used to store related instructions and data, and can transmit the stored data to the processor 310.
网络设备300中的处理器310用于读取存储器330中的相关指令执行以下操作:The processor 310 in the network device 300 is used to read relevant instructions in the memory 330 to perform the following operations:
所述处理器310根据获取第一报文的段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中多个节点中的一个节点或所述转发路径中的一个链路;The processor 310 acquires the segment list of the first message, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, and the one or more elements Each element of includes one or more identifiers, and each identifier in the one or more identifiers corresponds to a node among the plurality of nodes in the forwarding path or a link in the forwarding path;
所述收发器320中的发送器发送所述第一报文,所述第一报文包括一个或多个TLV,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID对应的前缀信息。The transmitter in the transceiver 320 sends the first packet, the first packet includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information Prefix information corresponding to a segment identifier SID used to indicate a node among the plurality of nodes or a link in the forwarding path.
具体地,上述网络设备300执行的各种操作的具体实现可参照上述方法实施例中源节点的具体操作,在此不再赘述。Specifically, for the specific implementation of various operations performed by the foregoing network device 300, reference may be made to the specific operations of the source node in the foregoing method embodiments, which will not be repeated here.
请参见图15,图15时本申请实施例提供的一种网络设备的结构示意图,如图15所示,所述网络设备400至少包括处理器410、收发器420以及存储器430,所述处理器410、收发器420以及存储器430通过总线440相互连接,其中,Please refer to FIG. 15, which is a schematic structural diagram of a network device provided by an embodiment of the present application. As shown in FIG. 15, the network device 400 includes at least a processor 410, a transceiver 420, and a memory 430. The processor 410, the transceiver 420, and the memory 430 are connected to each other through a bus 440, wherein,
所述处理器410可以是中央处理器(central processing unit,CPU),或者CPU和硬件芯片的组合。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。The processor 410 may be a central processing unit (central processing unit, CPU), or a combination of a CPU and a hardware chip. The aforementioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof. The aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
所述收发器420可以包括一个接收器和一个发送器,例如,无线射频模块,以下描述的处理器410接收或者发送某个消息,具体可以理解为该处理器410通过该收发器来接收或者发送。The transceiver 420 may include a receiver and a transmitter, for example, a wireless radio frequency module, and the processor 410 described below receives or sends a certain message, specifically, it can be understood that the processor 410 receives or sends a message through the transceiver .
所述存储器430包括但不限于是随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)或可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM或者快闪存储器),该存储器430用于存储相关指令及数据,并可以将存储的数据传输给处理器410。The memory 430 includes but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM) or erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM or flash memory), the memory 430 is used to store related instructions and data, and can transmit the stored data to the processor 410.
网络设备400中的处理器410用于读取存储器430中的相关指令执行以下操作:The processor 410 in the network device 400 is used to read relevant instructions in the memory 430 to perform the following operations:
处理器410控制收发器420中的接收器接收第一报文,所述第一报文包括段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述元素包括一 个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中的一个节点或所述转发路径中的一个链路;The processor 410 controls the receiver in the transceiver 420 to receive the first message, the first message includes a segment list, the segment list corresponds to the forwarding path of the first message, and the segment list includes one or a plurality of elements, the elements including one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path;
所述处理器410确定所述第一节点到第二节点的路径故障时,所述第一节点根据所述第一报文中的一个或多个类型-长度-值TLV获得第三节点的段标识,所述第二节点是所述转发路径中所述第一节点的下一跳分段路由SR节点,所述第三节点是所述转发路径中在所述第二节点之后的节点中的任意一个节点,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID的前缀信息;When the processor 410 determines that the path from the first node to the second node is faulty, the first node obtains the segment of the third node according to one or more type-length-value TLVs in the first message identification, the second node is the next hop segment routing SR node of the first node in the forwarding path, and the third node is one of the nodes after the second node in the forwarding path For any node, each of the one or more TLVs includes indication information, and the indication information is used to indicate a segment identifier SID of a node in the plurality of nodes or a link in the forwarding path prefix information;
所述处理器410根据所述第一报文获得第二报文;The processor 410 obtains a second packet according to the first packet;
所述收发器420中的发送器发送第二报文,所述第二报文的目的地址包括所述第二节点的段标识。The transmitter in the transceiver 420 sends a second packet, where the destination address of the second packet includes the segment identifier of the second node.
具体地,上述网络设备400执行的各种操作的具体实现可参照上述方法实施例中第一节点的具体操作,在此不再赘述。Specifically, for specific implementation of various operations performed by the foregoing network device 400, reference may be made to specific operations of the first node in the foregoing method embodiments, and details are not repeated here.
参阅图16所示,图16示出了本申请实施例提供的一种网络系统的可能的示意图。网络系统600包括第一网络设备610和第二网络设备620。网络系统中的第一网络设备610可以执行图4实施例中源节点的处理步骤,所述网络系统中的第二网络设备620可以执行图4所示实施例中第一节点的处理步骤。相应的,所述网络系统中的第一网络设备610可以为图12所示实施例的网络设备100,所述第二网络设备620可以为图13所示实施例的网络设备200,或者相应的,所述网络系统中的第一网络设备610可以为图14所示实施例的网络设备300,所述第二网络设备620可以为图15所示实施例的网络设备400。Referring to FIG. 16 , FIG. 16 shows a possible schematic diagram of a network system provided by an embodiment of the present application. The network system 600 includes a first network device 610 and a second network device 620 . The first network device 610 in the network system may execute the processing steps of the source node in the embodiment shown in FIG. 4 , and the second network device 620 in the network system may execute the processing steps of the first node in the embodiment shown in FIG. 4 . Correspondingly, the first network device 610 in the network system may be the network device 100 in the embodiment shown in FIG. 12 , and the second network device 620 may be the network device 200 in the embodiment shown in FIG. 13 , or the corresponding , the first network device 610 in the network system may be the network device 300 in the embodiment shown in FIG. 14 , and the second network device 620 may be the network device 400 in the embodiment shown in FIG. 15 .
具体的,所述第一网络设备,用于获取第一报文的段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中多个节点中的一个节点或所述转发路径中的一个链路;发送所述第一报文,所述第一报文包括一个或多个TLV,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID的前缀信息。Specifically, the first network device is configured to obtain a segment list of the first message, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, the Each of the one or more elements includes one or more identifiers, each of the one or more identifiers corresponds to one of the multiple nodes in the forwarding path or a node in the forwarding path a link; send the first packet, the first packet includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used to indicate the prefix information of a node among the multiple nodes or a segment identifier SID of a link in the forwarding path.
第二网络设备,用于接收第一报文,所述第一报文包括段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中的一个节点或所述转发路径中的一个链路;当确定所述第一节点到第二节点的路径故障时,所述第一节点根据所述第一报文中的一个或多个类型-长度-值TLV获得第三节点的段标识,所述第二节点是所述转发路径中所述第一节点的下一跳分段路由SR节点,所述第三节点是所述转发路径中在所述第二节点之后的节点中的任意一个节点,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID的前缀信息;所述第一节点根据所述第一报文获得第二报文;所述第一节点发送所述第二报文,所述第二报文的目的地址包括所述第三节点的段标识。A second network device, configured to receive a first message, where the first message includes a segment list, the segment list corresponds to a forwarding path of the first message, and the segment list includes one or more elements, The element includes one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path; when the first When the path from the node to the second node fails, the first node obtains the segment identifier of the third node according to one or more type-length-value TLVs in the first message, and the second node is the The next hop segment routing SR node of the first node in the forwarding path, the third node is any node in the nodes after the second node in the forwarding path, and the one or more Each TLV in the TLV includes indication information, and the indication information is used to indicate prefix information of a segment identifier SID of a node in the plurality of nodes or a link in the forwarding path; the first node according to The first message obtains a second message; the first node sends the second message, and the destination address of the second message includes the segment identifier of the third node.
本发明实施例还提供了一种非瞬态存储介质,用于储存前述实施例中所用的软件指令,其包括用于执行前述实施例所示的方法的程序,当其在计算机或网络设备上执行时,使得所示计算机或网络设备执行前述方法实施例中的方法。The embodiment of the present invention also provides a non-transitory storage medium, which is used to store the software instructions used in the foregoing embodiments, which includes the program for executing the method shown in the foregoing embodiments, when it is stored on a computer or a network device When executed, the computer or network device shown in the example is made to execute the methods in the aforementioned method embodiments.
本发明实施例还提供了一种包括计算机程序指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得网络设备执行前述方法实施例中的方法。The embodiment of the present invention also provides a computer program product including computer program instructions, and when the computer program product is run on a computer, the network device is made to execute the method in the foregoing method embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件、或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above-mentioned embodiments, it may be fully or partially implemented by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)).
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The embodiments of the present application have been introduced in detail above, and specific examples have been used in this paper to illustrate the principles and implementation methods of the present application. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application; meanwhile, for Those skilled in the art will have changes in specific implementation methods and application scopes based on the ideas of the present application. In summary, the contents of this specification should not be construed as limiting the present application.

Claims (31)

  1. 一种数据传输方法,其特征在于,所述方法包括:A data transmission method, characterized in that the method comprises:
    第一节点接收第一报文,所述第一报文包括段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中的一个节点或所述转发路径中的一个链路;The first node receives the first message, the first message includes a segment list, the segment list corresponds to the forwarding path of the first message, and the segment list includes one or more elements, the elements include one or more identifiers, each of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path;
    当确定所述第一节点到第二节点的路径故障时,所述第一节点根据所述第一报文中的一个或多个类型-长度-值TLV获得第三节点的段标识,所述第二节点是所述转发路径中所述第一节点的下一跳分段路由SR节点,所述第三节点是所述转发路径中在所述第二节点之后的节点中的任意一个节点,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID对应的前缀信息;When determining that the path from the first node to the second node is faulty, the first node obtains the segment identifier of the third node according to one or more type-length-value TLVs in the first message, the The second node is a next-hop segment routing SR node of the first node in the forwarding path, and the third node is any node in the nodes after the second node in the forwarding path, Each of the one or more TLVs includes indication information, where the indication information is used to indicate prefix information corresponding to a segment identifier SID of a node in the plurality of nodes or a link in the forwarding path ;
    所述第一节点根据所述第一报文获得第二报文;The first node obtains a second message according to the first message;
    所述第一节点发送所述第二报文,所述第二报文的目的地址包括所述第三节点的段标识。The first node sends the second packet, and the destination address of the second packet includes the segment identifier of the third node.
  2. 根据权利要求1所述的方法,其特征在于,所述第一节点根据所述第一报文中的一个或多个类型-长度-值TLV获得所述第三节点的段标识,包括:The method according to claim 1, wherein the first node obtains the segment identifier of the third node according to one or more type-length-value TLVs in the first message, including:
    根据所述一个或多个类型-长度-值TLV和段剩余SL的第一值获得所述第三节点段标识,所述SL的第一值指示第一元素在所述段列表中的位置,所述第一元素包括所述第三节点的标识。obtaining said third node segment identifier based on said one or more type-length-value TLVs and a first value of segment remaining SL, said first value of SL indicating a position of a first element in said segment list, The first element includes an identifier of the third node.
  3. 根据权利要求2所述的方法,其特征在于,根据所述一个或多个类型-长度-值TLV和段剩余SL的第一值获得所述第三节点段标识,包括:The method according to claim 2, wherein obtaining the third node segment identifier according to the one or more type-length-value TLVs and the first value of the segment remaining SL includes:
    根据所述SL的第一值获取第一TLV,所述第一TLV是所述一个或多个TLV中的一个TLV;Obtain a first TLV according to the first value of the SL, where the first TLV is one of the one or more TLVs;
    根据所述SL的第一值和所述第一TLV的指示信息获取所述第三节点段标识。Acquire the third node segment identifier according to the first value of the SL and the indication information of the first TLV.
  4. 根据权利要求2或3所述的方法,其特征在于,根据所述SL的第一值获取第一TLV,包括:The method according to claim 2 or 3, wherein obtaining the first TLV according to the first value of the SL includes:
    获取所述SL的第二值,所述SL的第二值是指所述第一节点接收到所述第一报文时SL的值,所述SL的第二值用于指示第二元素在所述段列表中的位置,所述第二元素包括所述第一节点的标识;Obtain a second value of the SL, where the second value of the SL refers to the value of the SL when the first node receives the first message, and the second value of the SL is used to indicate that the second element is in a position in the segment list, the second element comprising an identification of the first node;
    根据所述SL的第二值确定所述SL的第一值;determining a first value of the SL based on a second value of the SL;
    根据所述SL的第一值获取第一TLV。Obtain a first TLV according to the first value of the SL.
  5. 根据权利要求4所述的方法,其特征在于,根据所述SL的第二值确定所述SL的第一值,包括:The method according to claim 4, wherein determining the first value of the SL according to the second value of the SL comprises:
    如果根据所述第一节点的标识确定所述第二节点的标识为非压缩段标识,将所述SL的第二值减2得到所述SL的第一值。If it is determined according to the identifier of the first node that the identifier of the second node is an uncompressed segment identifier, subtract 2 from the second value of the SL to obtain the first value of the SL.
  6. 根据权利要求5所述的方法,其特征在于,第一标记用于指示所述第二节点的标记为压缩段标识,The method according to claim 5, wherein the first mark is used to indicate that the mark of the second node is a compressed segment identifier,
    所述根据所述第一节点的标识确定所述第二节点的标识为非压缩段标识,包括:The determining the identity of the second node as an uncompressed segment identity according to the identity of the first node includes:
    根据所述第一报文的目的地址获得所述第一节点的标识;Obtaining the identifier of the first node according to the destination address of the first packet;
    如果所述第一节点的标识中不包括所述第一标记,确定所述第二节点的标识为非压缩段标识。If the identifier of the first node does not include the first flag, determine that the identifier of the second node is an uncompressed segment identifier.
  7. 根据权利要求4所述的方法,其特征在于,所述根据所述SL的第二值确定所述SL的第一值,包括:The method according to claim 4, wherein said determining the first value of the SL according to the second value of the SL comprises:
    如果根据所述第一节点的标识确定所述第二节点的标识为压缩段标识,并且根据压缩段标识剩余CL的值确定所述第一元素和所述第二元素相同,所述SL的第一值为所述SL的第二值;或If it is determined according to the identifier of the first node that the identifier of the second node is a compressed segment identifier, and it is determined according to the value of the remaining CL of the compressed segment identifier that the first element and the second element are the same, the first element of the SL a value is a second value of said SL; or
    如果根据所述第一节点的标识确定所述第二节点的标识为压缩段标识,并且根据CL的值确定所述第二节点的标识位于第三元素最后一个标识的位置,所述第三元素包括所述第二节点的标识,将所述SL的第二值减1得到所述SL的第一值。If it is determined according to the identifier of the first node that the identifier of the second node is a compressed segment identifier, and it is determined according to the value of CL that the identifier of the second node is located at the last identifier of the third element, the third element Including the identifier of the second node, subtracting 1 from the second value of the SL to obtain the first value of the SL.
  8. 根据权利要求7所述的方法,其特征在于,第二标记用于指示所述第二节点的标记为压缩段标识,所述根据所述第一节点的标识确定所述第二节点的标识为压缩段标识,包括:The method according to claim 7, wherein the second mark is used to indicate that the mark of the second node is a compressed segment mark, and the mark of the second node is determined according to the mark of the first node as Compressed segment identification, including:
    根据所述第一报文的目的地址获得所述第一节点的标识;Obtaining the identifier of the first node according to the destination address of the first packet;
    如果所述第一节点的标识中包括所述第二标记,确定所述第二节点的标识为压缩段标识。If the identifier of the first node includes the second mark, determine that the identifier of the second node is a compressed segment identifier.
  9. 根据权利要求4所述的方法,其特征在于,所述段列表中的一个或多个元素和所述一个或多个TLV是一一对应的关系,对应根据所述SL的第一值获取第一TLV,包括:The method according to claim 4, wherein the one or more elements in the segment list and the one or more TLVs are in a one-to-one correspondence, correspondingly according to the first value of the SL to obtain the first A TLV, including:
    根据所述SL的第一值确定所述第一元素在所述段列表中对应的序号;determining the sequence number corresponding to the first element in the segment list according to the first value of the SL;
    根据所述第一元素在所述段列表中对应的序号,在所述一个或多个TLV中获取所述第一TLV。Obtain the first TLV from the one or more TLVs according to the sequence number corresponding to the first element in the segment list.
  10. 根据权利要求3所述的方法,其特征在于,所述根据所述SL的第一值和所述第一TLV的指示信息获取所述第三节点段标识,包括:The method according to claim 3, wherein the obtaining the third node segment identifier according to the first value of the SL and the indication information of the first TLV comprises:
    根据所述SL的第一值和所述第一TLV的第一指示信息获取所述第三节点段标识,其中,Obtain the third node segment identifier according to the first value of the SL and the first indication information of the first TLV, where,
    所述第一TLV的指示信息包括第一指示信息,所述第一指示信息用于指示所述第三节点的段标识的前缀的长度。The indication information of the first TLV includes first indication information, and the first indication information is used to indicate the length of the prefix of the segment identifier of the third node.
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述SL的第一值和所述第一TLV的第一指示信息获取所述第三节点段标识,包括:The method according to claim 10, wherein the obtaining the third node segment identifier according to the first value of the SL and the first indication information of the first TLV comprises:
    如果所述第一TLV的第一指示信息为第一预设值,确定所述第三节点的段标识为非压缩段标识;If the first indication information of the first TLV is a first preset value, determine that the segment identifier of the third node is an uncompressed segment identifier;
    根据所述SL的第一值确定所述第三节点的段标识。Determine the segment identifier of the third node according to the first value of the SL.
  12. 根据权利要求10所述的方法,其特征在于,所述根据所述SL的第一值和所述第一TLV的第一指示信息获取所述第三节点段标识,包括:The method according to claim 10, wherein the obtaining the third node segment identifier according to the first value of the SL and the first indication information of the first TLV comprises:
    如果所述第一TLV的第一指示信息为第二预设值,确定所述第三节点的段标识为压缩段标识;If the first indication information of the first TLV is a second preset value, determine that the segment identifier of the third node is a compressed segment identifier;
    根据所述SL的第一值确定所述第一元素在所述段列表中的位置;determining the position of the first element in the segment list according to the first value of the SL;
    根据所述CL的值确定所述第三节点的标识所在的所述第一元素中的位置;determining a position in the first element where the identifier of the third node is located according to the value of the CL;
    获取所述第三节点的标识;Obtain the identifier of the third node;
    根据所述第三节点的标识,所述第一TLV的第一指示信息和所述第一TLV的第二指示信息获取所述第三节点的段标识,其中,所述第二指示信息用于指示所述第三节点的段标识的前缀的位置。According to the identifier of the third node, the first indication information of the first TLV and the second indication information of the first TLV obtain the segment identifier of the third node, wherein the second indication information is used for Indicates the location of the prefix of the segment identifier of the third node.
  13. 根据权利要求1至12中任一项所述的方法,其特征在于,所述段列表位于所述第一报文的SRv6路由头SRH中,所述第一TLV位于所述第一报文的SRH中。The method according to any one of claims 1 to 12, wherein the segment list is located in the SRv6 routing header SRH of the first packet, and the first TLV is located in the SRH.
  14. 根据权利要求1至13中任一项所述的方法,其特征在于,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素的长度为128bits比特。The method according to any one of claims 1 to 13, wherein the segment list includes one or more elements, and the length of each element in the one or more elements is 128 bits.
  15. 一种数据传输方法,其特征在于,所述方法包括:A data transmission method, characterized in that the method comprises:
    获取第一报文的段列表,所述段列表对应于所述第一报文的转发路径,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素包括一个或多个标识,所述一个或多个标识中的每个标识分别对应于所述转发路径中多个节点中的一个节点或所述转发路径中的一个链路;Obtain a segment list of the first message, the segment list corresponds to the forwarding path of the first message, the segment list includes one or more elements, and each element in the one or more elements includes a or multiple identifiers, each of the one or more identifiers corresponds to a node among the plurality of nodes in the forwarding path or a link in the forwarding path;
    发送所述第一报文,所述第一报文包括一个或多个TLV,所述一个或多个TLV中的每个TLV包括指示信息,所述指示信息用于指示所述多个节点中的一个节点或所述转发路径中的一个链路的段标识SID对应的前缀信息。sending the first message, the first message includes one or more TLVs, each of the one or more TLVs includes indication information, and the indication information is used to indicate that among the multiple nodes Prefix information corresponding to a segment identifier SID of a node or a link in the forwarding path.
  16. 根据权利要求15所述的方法,其特征在于,所述发送所述第一报文之前,包括:The method according to claim 15, wherein, before sending the first message, comprising:
    根据所述段列表,生成一个或多个类型-长度-值TLV。From the segment list, one or more type-length-value TLVs are generated.
  17. 根据权利要求16所述的方法,所述根据所述段列表,生成一个或多个类型-长度-值TLV,包括:The method according to claim 16, said generating one or more type-length-value TLVs according to said segment list, comprising:
    获取所述段列表中的第四元素,所述第四元素是所述一个或多个元素中的任意一个;obtaining a fourth element in the segment list, where the fourth element is any one of the one or more elements;
    根据所述第四元素中包括的一个或多个标识,生成第二TLV,所述第二TLV是所述一个或多个TLV中的一个。Generate a second TLV according to the one or more identifiers included in the fourth element, where the second TLV is one of the one or more TLVs.
  18. 根据权利要求17所述的方法,其特征在于,所述第二TLV的指示信息包括第一指示信息,所述第一指示信息用于指示所述第四元素包括的标识的前缀的长度;The method according to claim 17, wherein the indication information of the second TLV includes first indication information, and the first indication information is used to indicate the length of the identified prefix included in the fourth element;
    所述根据所述第四元素中包括的标识信息,生成第二TLV,包括:The generating the second TLV according to the identification information included in the fourth element includes:
    根据所述第四元素中包括的标识的前缀的长度,生成所述第二TLV的第一指示信息。Generate the first indication information of the second TLV according to the length of the identified prefix included in the fourth element.
  19. 根据权利要求18所述的方法,其特征在于,所述根据所述第四元素中包括的标识的长度,生成第二TLV的第一指示信息,包括:The method according to claim 18, wherein the generating the first indication information of the second TLV according to the length of the identifier included in the fourth element includes:
    在所述第四元素中包括的标识为非压缩段标识时,所述第二TLV的第一指示信息为所述第一预设值;或者,When the identifier included in the fourth element is an uncompressed segment identifier, the first indication information of the second TLV is the first preset value; or,
    在所述第四元素中包括的标识为压缩段标识时,且所述第四元素中包括的标识的前缀的长度为第二预设值时,所述第二TLV的第一指示信息为所第二预设值。When the identifier included in the fourth element is a compressed segment identifier, and the length of the prefix of the identifier included in the fourth element is a second preset value, the first indication information of the second TLV is the Second default value.
  20. 根据权利要求17-19任一项所述的方法,其特征在于,所述第二TLV的指示信息包括第二指示信息,所述第二指示信息用于指示所述第三节点的段标识对应的前缀的位置;The method according to any one of claims 17-19, wherein the indication information of the second TLV includes second indication information, and the second indication information is used to indicate that the segment identifier of the third node corresponds to The location of the prefix;
    所述根据所述第四元素中包括的标识信息,生成第二TLV,包括:The generating the second TLV according to the identification information included in the fourth element includes:
    根据所述第四元素中包括的标识对应的SID的前缀的位置,生成第二TLV的第二指示信息。Generate second indication information of the second TLV according to the position of the prefix that identifies the corresponding SID included in the fourth element.
  21. 根据权利要求20所述的方法,其特征在于,所述根据所述第四元素中包括的标识对应的前缀的位置,生成第二TLV的第二指示信息,包括:The method according to claim 20, wherein the generating the second indication information of the second TLV according to the position of the corresponding prefix included in the fourth element includes:
    在所述第四元素中包括的标识对应的前缀在所述第一报文的段列表中,所述第二指示信息为第三预设值;The prefix corresponding to the identifier included in the fourth element is in the segment list of the first message, and the second indication information is a third preset value;
    在所述第四元素中包括的标识对应的前缀在所述第一报文的目的地址中,所述第二指示信息为第四预设值。The prefix corresponding to the identifier included in the fourth element is in the destination address of the first packet, and the second indication information is a fourth preset value.
  22. 根据权利要求15至21任一项所述的方法,其特征在于,所述第二TLV还包括第三指示信息,所述第三指示信息用于指示所述第四元素在所述段列表中的位置;The method according to any one of claims 15 to 21, wherein the second TLV further includes third indication information, the third indication information is used to indicate that the fourth element is in the segment list s position;
    根据所述第四元素在所述段列表中的位置,生成所述第三指示信息。Generate the third indication information according to the position of the fourth element in the segment list.
  23. 根据权利要求15-22中任一项所述的方法,其特征在于,所述一个或多个TLV与所述一个或多个元素呈一一对应关系。The method according to any one of claims 15-22, wherein the one or more TLVs have a one-to-one correspondence with the one or more elements.
  24. 根据权利要求15-23中任一项所述的方法,其特征在于,所述段列表位于所述第一报文的SRv6段扩展路由头SRH中,所述第二TLV位于所述第一报文的SRH中。The method according to any one of claims 15-23, wherein the segment list is located in the SRv6 extended routing header SRH of the first packet, and the second TLV is located in the first packet Text of the SRH.
  25. 根据权利要求15至24中任一项所述的方法,其特征在于,所述段列表包括一个或多个元素,所述一个或多个元素中的每个元素的长度为128bits比特。The method according to any one of claims 15 to 24, wherein the segment list includes one or more elements, and the length of each element in the one or more elements is 128 bits.
  26. 一种网络设备,其特征在于,包括执行如权利要求1至14任一项所述的方法的单元。A network device, characterized by comprising a unit for performing the method according to any one of claims 1 to 14.
  27. 一种网络设备,其特征在于,包括执行如权利要求15至25任一项所述的方法的单元。A network device, characterized by comprising a unit for performing the method according to any one of claims 15 to 25.
  28. 一种网络设备,其特征在于,包括处理器、收发器以及存储器;所述存储器用于存储指令,所述处理器用于执行所述指令,所述收发器用于在所述处理器的控制下与其他设备进行通信;其中,所述处理器执行所述指令时执行如上权利要求1至14任一项所述的方法。A network device, characterized in that it includes a processor, a transceiver, and a memory; the memory is used to store instructions, the processor is used to execute the instructions, and the transceiver is used to communicate with the processor under the control of the processor communicate with other devices; wherein, when the processor executes the instructions, it executes the method according to any one of claims 1 to 14.
  29. 一种网络设备,其特征在于,包括处理器、收发器以及存储器;所述存储器用于存储指令,所述处理器用于执行所述指令,所述收发器用于在所述处理器的控制下与其他设备进行通信;其中,所述处理器执行所述指令时执行如上权利要求15至25任一项所述的方法。A network device, characterized in that it includes a processor, a transceiver, and a memory; the memory is used to store instructions, the processor is used to execute the instructions, and the transceiver is used to communicate with the processor under the control of the processor communicate with other devices; wherein, when the processor executes the instructions, it executes the method according to any one of claims 15 to 25.
  30. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现如权利要求1至14中任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 14.
  31. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现如权利要求15至25中任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 15-25.
PCT/CN2022/108376 2021-07-29 2022-07-27 Data transmission method, related device, and computer storage medium WO2023006002A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110865850.8A CN115701054A (en) 2021-07-29 2021-07-29 Data transmission method, related equipment and computer storage medium
CN202110865850.8 2021-07-29

Publications (1)

Publication Number Publication Date
WO2023006002A1 true WO2023006002A1 (en) 2023-02-02

Family

ID=85087490

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/108376 WO2023006002A1 (en) 2021-07-29 2022-07-27 Data transmission method, related device, and computer storage medium

Country Status (2)

Country Link
CN (1) CN115701054A (en)
WO (1) WO2023006002A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661706A (en) * 2018-06-30 2020-01-07 华为技术有限公司 Method, device and system for processing transmission path fault
US20200366763A1 (en) * 2019-05-13 2020-11-19 Juniper Networks, Inc. Compressed routing header information for networks
CN112448888A (en) * 2019-08-31 2021-03-05 华为技术有限公司 Method, equipment and system for forwarding message in SR network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661706A (en) * 2018-06-30 2020-01-07 华为技术有限公司 Method, device and system for processing transmission path fault
CN112995028A (en) * 2018-06-30 2021-06-18 华为技术有限公司 Method, device and system for processing transmission path fault
CN112995029A (en) * 2018-06-30 2021-06-18 华为技术有限公司 Method, device and system for processing transmission path fault
US20200366763A1 (en) * 2019-05-13 2020-11-19 Juniper Networks, Inc. Compressed routing header information for networks
CN112448888A (en) * 2019-08-31 2021-03-05 华为技术有限公司 Method, equipment and system for forwarding message in SR network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU YAO, PENG SHAOFU: "SPRING Working Group SRv6 Compressed Path Recover Method", IETF DRAFT, DRAFT-PL-SPRING-COMPR-PATH-RECOVER-00, 28 June 2020 (2020-06-28), XP093029744, [retrieved on 20230307] *

Also Published As

Publication number Publication date
CN115701054A (en) 2023-02-07

Similar Documents

Publication Publication Date Title
JP7434362B2 (en) Method for generating segment list, method, device and system for forwarding packets in SRV6 network
WO2020156166A1 (en) Packet processing method and device
US11924099B2 (en) Method for forwarding packet in hybrid network, device, and system
WO2021057683A1 (en) Message processing method and apparatus
AU2021261819B2 (en) Data packet processing method and device
WO2021155759A1 (en) Method and device for processing segment identifier
EP4099648A1 (en) Method for processing segment id, and apparatus
US20230035009A1 (en) Mixing Segments With Different Sizes For Segment Routing
US20230353492A1 (en) Information sending and processing methods, node, controller, and non-transitory computer-readable storage medium
US20230030344A1 (en) Minimizing Differences In Segment Identifiers For Segment Routing
WO2022042503A1 (en) Message transmission method, apparatus, and system
EP4024782A1 (en) Method by which host network performance requirements may be programmed, device and system
CN113472718A (en) Service processing method, device, equipment and storage medium
CN116405431A (en) Data processing method, network node and computer readable storage medium
CN113630316B (en) Data transmission method and communication device
WO2023006002A1 (en) Data transmission method, related device, and computer storage medium
US20230040043A1 (en) Compressing segment identifiers for segment routing
CN113542126B (en) Generalized SRv6 full-path compression method and device
JP2024506089A (en) Packet forwarding methods, devices, and systems
CN114666259A (en) Message transmission method, device, equipment, storage medium and system
WO2022267969A1 (en) Information transmission method and related device
WO2022135321A1 (en) Packet transmission method, device and system
WO2024094082A1 (en) Information transmission method and apparatus, node, and storage medium
WO2024086991A1 (en) Node protection method and apparatus, electrical device, and medium
WO2024083219A1 (en) Message processing method and apparatus, and device and storage medium

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: 22848607

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE