CN115701054A - Data transmission method, related equipment and computer storage medium - Google Patents

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

Info

Publication number
CN115701054A
CN115701054A CN202110865850.8A CN202110865850A CN115701054A CN 115701054 A CN115701054 A CN 115701054A CN 202110865850 A CN202110865850 A CN 202110865850A CN 115701054 A CN115701054 A CN 115701054A
Authority
CN
China
Prior art keywords
node
identifier
value
segment
sid
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110865850.8A
Other languages
Chinese (zh)
Inventor
赵科强
李呈
陈新隽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202110865850.8A priority Critical patent/CN115701054A/en
Priority to PCT/CN2022/108376 priority patent/WO2023006002A1/en
Publication of CN115701054A publication Critical patent/CN115701054A/en
Pending legal-status Critical Current

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

Landscapes

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

Abstract

The data transmission method comprises the steps that a TLV field is generated at a source node and is packaged at an SRH head of a first message, when an intermediate forwarding node on a forwarding path detects that an SR node on the next hop of the forwarding path has a fault or a path to the SR node on the next hop of the forwarding path has a fault, the TLV field can be used for indicating the intermediate forwarding node to acquire a segment identifier of any one of a plurality of nodes behind the SR node on the next hop of the forwarding path of the first message, the acquired segment identifier is updated at a destination address of the message, and the message is forwarded according to an instruction of the segment identifier, so that the fault node or the fault path is bypassed, and data transmission is completed.

Description

Data transmission method, related equipment and computer storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data transmission method, a related device, and a computer storage medium.
Background
Segment routing for IPv6 (SRv) based on forwarding plane is a protocol designed based on the concept of source routing to forward IPv6 messages on a network. SRv6 adds an IPv6 Segment Routing Header (SRH) to the packet at the source node of the packet forwarding path, where the SRH contains a segment list (segment list) for identifying the forwarding path. The segment list contains the IPv6 addresses of the network nodes on the packet forwarding path. The general SRv (generalized SRv6, G-SRv) is a new SRv technology proposed to save message overhead. In G-SRv, G-SRv does not change the format and semantics of the native segment list on data packaging, and supports mixed programming of 128-bit ordinary segment identification and 32/16-bit compressed segment identification in the segment list.
However, in the G-SRv packet forwarding scheme, when an intermediate node on a forwarding path detects a path failure of a next-hop (SR) node, the intermediate node cannot complete packet forwarding according to a segment list. Therefore, how to implement forwarding of a packet when an intermediate node on a forwarding path detects that a path of a next-hop SR node fails is an urgent technical problem to be solved.
Disclosure of Invention
The application discloses a data transmission method, related equipment and a computer storage medium, wherein when an intermediate node on a message forwarding path detects a path fault of a next hop node, the intermediate node can forward a message according to a segment list to complete data transmission.
In a first aspect, an embodiment of the present application discloses a data transmission method, including: a first node receives a first message, wherein the first message comprises a segment list, the segment list corresponds to a forwarding path of the first message, the segment list comprises one or more elements, the elements comprise one or more identifiers, and each identifier in the one or more identifiers corresponds to one node in the forwarding path or one link in the forwarding path respectively;
when determining that a path from the first node to a second node fails, the first node obtains a segment identifier of a third node according to one or more type-length-value TLVs in the first message, wherein the second node is a next-hop Segment Routing (SR) node of the first node in the forwarding path, the third node is any one of nodes after the second node in the forwarding path, and each TLV in the one or more TLVs comprises indication information used for indicating prefix information corresponding to a Segment Identifier (SID) of one node in the plurality of nodes or one link in the forwarding path;
the first node obtains a second message according to the first message;
and the first node sends the second message, and the destination address of the second message comprises the segment identifier of the third node.
In the embodiment of the application, by generating a TLV field at a source node and encapsulating the TLV field in an SRH header of a first packet, when an intermediate forwarding node on a forwarding path detects that a next-hop SR node on the forwarding path has a fault or a path fault to the next-hop SR node, the TLV field can be used to instruct the intermediate forwarding node to obtain a segment identifier of any one node of a plurality of nodes after the next-hop SR node on the first packet forwarding path, update the obtained segment identifier at a destination address of the packet, and forward the packet according to an instruction of the segment identifier, thereby bypassing a faulty node or a faulty path and completing data transmission.
In a possible embodiment, the obtaining, by the first node, the segment identifier of the third node according to the first type-length-value TLV in the first message includes: obtaining the third node segment identification from the one or more type-length-value TLVs and a first value of a segment remaining SL, the first value of the SL indicating a position of a first element in the segment list, the first element including an identification of the third node.
In a possible embodiment, the obtaining the third node segment identifier according to the one or more type-length-values TLV and the first value of segment residual SL includes: obtaining a first TLV according to a first value of the SL, the first TLV being 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.
In a possible embodiment, the obtaining the first TLV according to the first value of the SL includes: acquiring a second value of the SL, where the second value of the SL is a value of the SL when the first node receives the first packet, and the second value of the SL is used to indicate a position of a second element in the segment list, where the second element includes an identifier of the first node; determining a first value of the SL according to the second value of the SL; and acquiring a first TLV according to the first value of the SL.
In a possible embodiment, the determining the first value of the SL according to the second value of the SL includes: and if the identifier of the second node is determined to be the identifier of the non-compression section according to the identifier of the first node, subtracting 2 from the second value of the SL to obtain a first value of the SL.
In a possible embodiment, the upper first flag is used to indicate that the flag of the second node is a compressed segment flag,
the determining that the identifier of the second node is an identifier of an uncompressed segment according to the identifier of the first node includes: acquiring the identifier of the first node according to the destination address of the first message;
and if the first mark is not included in the identification of the first node, determining that the identification of the second node is the identification of the non-compressed segment.
In a possible embodiment, the determining the first value of the SL according to the second value of the SL includes: if the identifier of the second node is determined to be a compressed segment identifier according to the identifier of the first node, and the first element and the second element are determined to be the same according to the value of the residual CL of the compressed segment identifier, the first value of the SL is the second value of the SL; or
And if the identifier of the second node is determined to be a compressed segment identifier according to the identifier of the first node and the identifier of the second node is determined to be located at the position of the last identifier of a third element according to the value of CL, wherein the third element comprises the identifier of the second node, and the second value of the SL is reduced by 1 to obtain the first value of the SL.
In a possible embodiment, the determining, according to the identifier of the first node, that the identifier of the second node is a compressed segment identifier includes: acquiring the identifier of the first node according to the destination address of the first message; and if the identifier of the first node comprises the second mark, determining that the identifier of the second node is a compressed segment identifier.
In a possible embodiment, one or more elements in the segment list and the one or more TLVs are in a one-to-one correspondence relationship, and obtaining the first TLV according to the first value of the SL includes: determining a corresponding sequence number of the first element in the segment list according to a first value of the SL; and acquiring the first TLV from the one or more TLVs according to the corresponding sequence number of the first element in the segment list.
In a possible embodiment, the obtaining the third node segment identifier according to the first value of the SL and the indication information of the first TLV includes: and acquiring the segment identifier of the third node according to the first value of the SL and the first indication information of the first TLV, wherein the indication information of the first TLV comprises first indication information, and the first indication information is used for indicating the length of a prefix of the segment identifier of the third node.
In a possible embodiment, the obtaining 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 a segment identity of the third node according to the first value of the SL.
In a possible embodiment, the obtaining 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;
determining a position of the first element in the segment list according to a first value of the SL; determining the position of the identifier of the third node in the first element according to the value of the CL;
acquiring an identifier of the third node; and acquiring a 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 for indicating a position of a prefix of the segment identifier of the third node.
In a possible embodiment, the segment list is located in a segment extended routing header SRH of the first packet, and the first TLV is located in an SRH of the first packet.
In a possible embodiment, the segment list comprises one or more elements, each of the one or more elements having a length of 128 bits.
In a second aspect, an embodiment of the present application provides a data transmission method, including:
obtaining a segment list of a first packet, where the segment list corresponds to a forwarding path of the first packet, the segment list includes one or more elements, each element of the one or more elements includes one or more identifiers, and each identifier of the one or more identifiers corresponds to one node of multiple nodes in the forwarding path or one link in the forwarding path, respectively;
sending the first packet, where the first packet includes one or more TLVs, and 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 one of the nodes or one of links in the forwarding path.
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.
In a possible embodiment, the generating one or more type-length-value TLVs according to the segment list includes:
obtaining a fourth element in the segment list, wherein the fourth element is any one of the one or more elements;
generating a second TLV from the one or more identifications included in the fourth element, the second TLV being one of the one or more TLVs.
In a possible embodiment, the indication information of the second TLV includes first indication information for indicating a length of an identified prefix included in the fourth element;
generating, by the processor, a second TLV according to the identification information included in the fourth element, including: generating first indication information for the second TLV according to a length of the identified prefix included in the fourth element.
In a possible embodiment, the generating first indication information of a second TLV according to the length of the identifier included in the fourth element includes: when the identifier included in the fourth element is a non-compressed segment identifier, the first indication information of the second TLV is the first preset value; or, when the identifier included in the fourth element is a compression 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 preset value.
In a possible embodiment, the indication information of the second TLV includes second indication information, where the second indication information is used to indicate a location of a corresponding prefix identified by the segment identifier of the third node;
in a possible embodiment, the generating a second TLV according to the identification information included in the fourth element includes:
and generating second indication information of the second TLV according to the position of the prefix of the SID corresponding to the identifier included in the fourth element.
Generating, by the device, second indication information of a second TLV according to a location of a prefix corresponding to an identifier included in the fourth element, where the second indication information includes: a prefix corresponding to the identifier included in the fourth element is in a segment list of the first packet, and the second indication information is a third preset value;
and in the destination address of the first packet, the prefix corresponding to the identifier included in the fourth element is a fourth preset value.
In a possible embodiment, the second TLV further comprises third indication information indicating a position of the fourth element in the segment list; and generating the third indication information according to the position of the fourth element in the segment list.
In a possible embodiment, the one or more TLVs have a one-to-one correspondence with the one or more elements.
In a possible embodiment, the segment list comprises one or more elements, each of the one or more elements having a length of 128 bits.
In a possible embodiment, the segment list is located in the SRv segment 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 that performs the method according to the first aspect.
In a fourth aspect, an embodiment of the present application further provides a network device, which includes a unit that executes the method according to the second aspect.
In a fifth aspect, an embodiment of the present application provides a network device, including a processor, a transceiver, and a memory; the memory is configured to store instructions, the processor is configured to execute the instructions, and the transceiver is configured to communicate with other devices under control of the processor; wherein the processor, when executing the instructions, performs the method of the first aspect.
In a sixth aspect, an embodiment of the present application further provides a network device, including a processor, a transceiver, and a memory; the memory is configured to store instructions, the processor is configured to execute the instructions, and the transceiver is configured to communicate with other devices under control of the processor; wherein the processor, when executing the instructions, performs the method of the second aspect.
In a seventh aspect, an embodiment of the present application provides a network system, including a first network device and a second network device, where the first network device includes the network device in the third aspect, and the second network device includes the network device in the fourth aspect.
In an eighth aspect, the present application provides a computer storage medium, where the computer storage medium stores a computer program, where the computer program is configured to implement the method according to the first aspect when executed by a processor.
In a ninth aspect, the present application further provides a computer storage medium, where a computer program is stored, where the computer program is implemented by a processor to implement the method according to the second aspect.
The present application can further combine to provide more implementations on the basis of the implementations provided by the above aspects.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a message format according to an embodiment of the present application;
fig. 2 is a schematic diagram of another message format provided in the embodiment of the present application;
fig. 3 is a schematic diagram of a packet forwarding process provided in an embodiment of the present application;
fig. 4 is a flowchart of a method for message transmission according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a G-SRv network provided by an embodiment of the present application;
FIGS. 6 a-6 b are schematic diagrams of another G-SRv network provided by embodiments of the present application;
fig. 7 is a flowchart of a method for message transmission according to an embodiment of the present application;
FIGS. 8 a-8 b are schematic diagrams of another G-SRv network provided by embodiments of the present application;
FIGS. 9 a-9 b are schematic diagrams of another G-SRv network provided by embodiments of the present application;
FIGS. 10 a-10 b are schematic diagrams of another G-SRv network provided by embodiments of the present application;
FIGS. 11 a-11 b are schematic diagrams of another G-SRv network provided by embodiments of the present application;
fig. 12 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 16 is a schematic diagram of a network system according to an embodiment of the present disclosure.
Detailed Description
The data transmission method provided by the present application is explained in detail below with reference to the accompanying drawings.
Segment routing for IPv6 based on IPv6 forwarding plane (SRv) is a protocol designed based on the concept of source routing to forward IPv6 messages on a network. SRv6 Traffic Engineering (TE) is an implementation (mode) of SRv technology, and in a SRv TE scenario, a forwarding path of a data packet in a network needs to be strictly restricted. SRv6 adds an IPv6 Segment Routing Header (SRH) to the packet at the source node of the packet forwarding path, where the SRH contains a segment list (segment list) for identifying the forwarding path. The segment list contains the IPv6 addresses of the nodes on the packet forwarding path. The IPv6 addresses of nodes in the segment list may also be referred to as Segment Identifiers (SIDs) of the nodes in the SRv technology. The node corresponding to the segment identifier in the segment list is called an Endpoint node, and the Endpoint node is a node which receives a SRv message and processes a SRv message in the message forwarding path. An Endpoint node is also called a Segment Routing (SR) node. It should be understood that, in the subsequent description of the embodiment of the present application, nodes corresponding to segment identifiers in a segment list are SR nodes.
As shown in fig. 1, fig. 1 shows a schematic diagram of a packet format in a SRv network, and in fig. 1, a packet header of the packet includes an IPv6 packet header and an SRH. The IPv6 message header includes a Destination Address (DA) field, and is used to instruct the node to forward according to the segment identifier in the DA field. The SRH includes a next header (next header), a header extension length (hdr ext len), a routing type (routing type), segment Left (SL), duan Liebiao, and option fields (options), and the like. The segment list includes a plurality of SIDs arranged in sequence, that is, IPv6 addresses of each node through which the packet needs to pass in the transmission process, and the option field includes one or more type-length-value (TLV) fields. The SL is also called SL pointer, and is used to indicate the number of remaining pending SIDs, and can also be understood as the position of the pointed current pending SID in the segment list. For example, if the value of the SL pointer is 3, it may indicate that the number of remaining pending SIDs is 4, or it may be understood that the SL pointer points to the current pending SID, and if the value of the SL pointer is 0, it may indicate that the number of remaining pending segments is 1, or it may be understood that the SL pointer points to the current pending SID.
5363 and in the process of forwarding the message, the network SRv completes hop-by-hop forwarding by updating the destination address of each node. That is, after determining the current SID to be processed according to the value of the SL pointer, the node acquires the current SID to be processed 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.
In SRv, the SID contains two parts: position (locator) and function (function). Wherein the locator is used for routing the message to the node corresponding to the SID; the function is used for instructing the node corresponding to the SID to execute the corresponding function. The Function may also separate an optional parameter segment (entries), at this time, the format of SRv SID is changed into Locator, function and entries, the entries occupy low bits of IPv6 address, and information such as stream and service of some messages may be defined through the entries. For example, when a node receives a packet, and determines that a destination address of the packet is an IPv6 address of the node, that is, a segment identifier of the node, the node in the network executes a corresponding function according to a function in the segment identifier. The location field includes a prefix (prefix) portion and a sequence number (node ID) portion. Within a SRv network domain (domain), the SID of each node is assigned from an address space, so the prefix portion of the location field of each node is the same; the sequence number portion of the SID for each node is different and each sequence number portion is used to uniquely identify a node within the domain. Thus, SIDs of multiple nodes in a SRv network domain may share a prefix, with the sequence number portion and the function field as compressed segment identifiers (C-SIDs), i.e., C-SIDs. The C-SID plus the prefix may constitute a complete SID, i.e., the IPv6 address of the node.
In order to save SRH overhead, a new SRv6 header compression technology, general SRv (Generalized SRv6, G-SRv 6), is proposed, which can be compatible with standard SRv, does not change the format and semantics of the native SRH on data encapsulation, but supports mixed programming of 128-bit SRv SID and 32-bit C-SID in SRH. This SRH that supports 128-bit SRv SID and 32/16-bit C-SID mixed-arrangement SID is called a generic segment routed extended header (G-SRH).
As shown in fig. 2, fig. 2 shows a schematic diagram of a G-SRv message. The G-SRv message includes an IPv6 header and a G-SRH, where the segment list includes a plurality of elements, i.e., elements G-SID [0] -G-SID [ n ], each element has a length of 128bits, and each element includes an identifier. Wherein, when the identifier included in an element is a 128-bit SID, the element is a complete SID, and when the identifier included in an element is a compressed SID, a plurality of C-SIDs may be included in the element. As shown in FIG. 2, the length of the mark contained in the element G-SID [0] is 128bits, the length of the mark contained in the element G-SID [0] is only one complete SID, the length of the mark contained in the element G-SID [2] is 32 bits, and the number of the marks contained in the element G-SID [2] is 4, i.e., C-SID1, C-SID2, C-SID3, and C-SID4. Because the segment list is inserted into the C-SID in G-SRH, access logic to update the segment list is required. The IPv6 message header also comprises a compressed segment identifier residue (C-SID Left, CL) pointer, and the compressed segment identifier residue (C-SID Left, CL) pointer and an SL pointer in the SRH form a two-dimensional pointer which jointly indicates the position of the identifier to be processed currently in the segment list. Specifically, the SL pointer is used to indicate the position of the element where the current to-be-processed identifier is located in the segment list, and the CL pointer is used to indicate the position of the to-be-processed identifier 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, namely elements G-SID [0] -G-SID [2], and the SL pointer includes 3 values, e.g., 0, 1, 2. If the initial value of the SL pointer is 2, the element G-SID [2] is indicated as being in the first element in the segment list. The element G-SID [2] includes 4C-SIDs, C-SID1, C-SID2, C-SID3, C-SID4, and the value of the CL pointer includes four values, e.g., 0, 1, 2, 3. If the initial value of the CL pointer is 3, it indicates that C-SID1 is the first C-SID in the element G-SID [2]. Then at each update the value of the CL pointer is decremented by 1, i.e., the values of the CL pointer are updated to 2,1, and 0 in order to indicate C-SID2, C-SID3, and C-SID4 in the element G-SID [2]. The first C-SID of C-SID1 in the first element G-SID [2] in the segment list may be derived from the SL pointer value of 2 and the CL pointer value of 3. Meanwhile, in order to add a method for identifying a complete SID and a C-SID boundary, a COC (continuous of compression) flag needs to be added to carry the SID of the COC flag, which indicates that the SID after the SID is a compressed 32-bit C-SID. For example, as in FIG. 2, C-SID1 in element G-SID [2] carries a COC identifier, and then the one following C-SID1 in element G-SID [2] is identified as C-SID, i.e., C-SID2.
Because the G-SRH segment list can insert C-SIDs, the access copy logic and DA replacement logic that need to update the segment list. Therefore, in the process of forwarding the SRv message, after the forwarding node determines the SID to be processed currently according to the SL and CL pointers, the forwarding node copies the SID to the DA field in the IPv6 message header and forwards the message according to the DA field. For example, the SID to be currently processed 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 C-SID to be processed currently form the complete SID to be processed currently, so that the node can still forward the message according to the content of the DA field. For example, fig. 3 exemplarily shows a SRv packet forwarding process, and takes packet forwarding in a SRv network domain as an example, in fig. 3, the packet includes nodes a to F. The addresses of the nodes A and F are respectively A1:1, A2:1, A3:1, A4:1, A5:1, A6:1, and the prefix of the segment identification SID corresponding to the nodes A and F is A. The node A adds the prefix A into the DA field of the message 1, copies the first C-SID 2:1 in the segment list into the DA field, and the prefix A and 2:1 in the DA field form a complete SID of A:2:1, so that the node A queries the forwarding table entry according to the A:2:1 in the DA field and forwards the message 1 to the node B according to the query result. The node B receives the message 1,B sent by the node a to obtain the message 1, and obtains the SID of the next hop node of the message 1, i.e., the SID of the node C, according to the SRH of the message 1. The SL pointer in message 1 has a value of 1, indicates the position of the element G-SID [1] in the segment list, the initial value of CL pointer is 3, indicates the position of the first C-SID in the element G-SID [1], and the specific position of the identifier corresponding to the node B in the segment list can be obtained through the SL pointer and the CL pointer. And the node B updates the value of the CL pointer to 2, indicates the position of the second C-SID in the element G-SID [1], locates the second C-SID of the first element, namely 3:1 according to the indication of the SL pointer and the CL pointer, obtains the second C-SID of the first element as 3:1, copies 3:1 to the DA of the message based on the message 1, and replaces 2:1 originally in the DA field. At this time, the DA field includes a combination of the prefix portion A and the C-SID portion 3:1, A:3:1, i.e., the SID of node C. And the node B inquires a forwarding table item according to the SID of the node C in the DA field and sends the message 2 to the node C according to the inquiry result. When the node E receives the message 3 forwarded by the node D, the node E acquires that the value of the SL pointer is 1, the value of the CL pointer is 0, the C-SID in the current DA field is the last C-SID in the element G-SID [1], the node E needs to update the SL pointer, execute SL- -, update the value of the SL pointer to 0, and indicate the position of the G-SID [0] in the segment list. According to the SL pointer value of 0, the second element G-SID [0] is located, the segment identifier A: 6:1:containedin the G-SID [0] is an uncompressed segment identifier, the node E copies A:6:1:: to the DA field, and the node E forwards according to A: 6:1:. In the message forwarding process, a node receiving a message on a forwarding path can acquire a segment identifier of an SR node of a next hop, but when it is detected that the SR node of the next hop fails or a link between the SR node of the next hop fails, a segment identifier of one node among a plurality of nodes behind the failed node on the forwarding path cannot be acquired. Therefore, when the intermediate forwarding node on the forwarding path detects a failure of the SR node of the next hop or a failure occurs in a link between the intermediate forwarding node and the SR node of the next hop, the intermediate forwarding node cannot forward according to the segment list.
For example, when the path from node D to node E in fig. 3 fails, that is, the failure of node E or the failure of the link between node D and node E results in that node D cannot forward data packets through node E according to the forwarding path, then node D needs to be forwarded by the next-hop node of node E on the forwarding path, that is, node F. And the node D directly sends the data message to the node F, so that the data message can be continuously forwarded according to the forwarding path behind the node E on the original forwarding path. For example, after detecting that the path of the node E fails, the node D needs to acquire the SID of the next hop node F of the node E. However, node D cannot accurately obtain the SID of node F according to the segment list in G-SRH, and thus cannot forward or protect the data packet.
The application provides a data transmission method which is applied to a G-SRv network comprising a source node and an intermediate forwarding node on a forwarding path. As shown in fig. 4, fig. 4 shows a data transmission method provided by the present application, in which a TLV field is generated at a source node and encapsulated in an SRH header of a first packet, when an intermediate forwarding node on a forwarding path detects that a path fault occurs at an SR node on a next hop on the forwarding path, the TLV field can be used to instruct the intermediate forwarding node to acquire a SID of any one node of a plurality of nodes after the SR node on the next hop on the first packet forwarding path, update the acquired SID at a destination address of the packet, and forward the packet according to an instruction of the SID, so as to bypass a faulty node or a faulty path, thereby completing data transmission.
In the embodiment of the application, the data transmission method comprises two stages, wherein the first stage mainly comprises the process that a source node generates a TLV field and encapsulates the TLV field to an SRH of a first message; and the second stage, mainly comprising that the intermediate forwarding node on the forwarding path obtains the SID of any node in the plurality of nodes after the SR node of the next hop on the forwarding path according to the TLV field, and forwards the message according to the SID.
The first stage (a) includes S101 to S104,
s101: the source node obtains a first packet comprising a list of segments.
The segment list corresponds to a forwarding path of the first packet, the segment list includes one or more elements, each element of the one or more elements includes one or more identifiers, and each identifier of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path, respectively. For example, the segment list in the SRH of the packet in fig. 5 includes 5 elements, where the elements correspond to G-SIDs, and it can be seen that each G-SID includes one or more identifiers, and the identifier includes a SID or a C-SID. For example, the element G-SID [4] includes 3C-SIDs, the 3C-SIDs corresponding to nodes N2, N3, and N4 in the forwarding path, N2, N3, and N4 belonging to a network domain 1, and the node in the network domain 1 compressing the SIDs and using the same compressed prefix A:. The element G-SID [3] includes 1 SID, corresponding to node N5 in network domain 2 in the forwarding path, node N5 being a node that does not support SRv header compression.
The source node is a source node of the G-SRv network, and the source node inserts the SRH into the message header of the first message, or adds the message header to the first message and inserts the SRH. The SRH includes a segment list, which may be generated by the controller. For example, the controller calculates a forwarding path of the packet, generates a segment list corresponding to the forwarding path, the segment list including the C-SID, and transmits the segment list to the source node.
In an alternative embodiment, the segment list may be generated by the source node. For example, the source node computes a forwarding path for the packet and generates a segment list corresponding to the forwarding path, the segment list including the C-SID. Alternatively, the segment list may be generated by both the source node and the controller. For example, the controller calculates a forwarding path of the packet, generates a segment list corresponding to the forwarding path, where the segment list includes the uncompressed segment identifier but not the C-SID, and sends the segment list to the source node, where the source node generates a new segment list according to the received segment list, where the new segment list includes the C-SID.
The forwarding path further comprises a first node, a second node and a third node, wherein 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 the embodiment of the present application are network devices, such as routers, switches, or any network device capable of supporting G-SRv.
S102: and the source node generates a TLV field according to the segment list of the first message.
The number of the TLV fields is consistent with the number of the elements in the segment list, and each element is in one-to-one correspondence with the TLV fields. Each TLV field comprises indication information, and the indication information is used for indicating prefix information corresponding to the segment identification SID of one node in a plurality of nodes in the forwarding path or one link in the forwarding path. The TLV field is used for indicating whether the identifier contained in the corresponding element is the C-SID or not, and the length and the position of the prefix corresponding to the C-SID when the identifier is the C-SID.
The one-to-one correspondence of each element to the TLV field described above may be an ordered correspondence. For example, when the first packet includes 3 elements G-SID (0) to G-SID (2), 3 TLV fields are generated, where G-SID (0) corresponds to a first TLV, G-SID (1) corresponds to a second TLV, and G-SID (2) corresponds to a third TLV, where the first TLV field indicates whether element G-SID (0) is identified as a C-SID, and when element G-SID is identified as a C-SID, the first TLV field can also indicate a location and a length of a prefix of the C-SID. For example, when the first packet includes 3 elements G-SID (0) to G-SID (2), 3 TLV fields are generated, where G-SID (0) corresponds to a third TLV, G-SID (1) corresponds to a second TLV, and G-SID (2) corresponds to a first TLV. The mapping relationship is not limited to the above-mentioned mapping relationship, and the one-to-one mapping relationship between each element and the TLV field may be other, which is not limited in this application.
In some specific implementations, each TLV field includes first indication information and second indication information, the first indication information is used to indicate whether a segment identifier included in an element corresponding to the TLV field is a C-SID, and if the segment identifier is a C-SID, the first indication information also indicates a length of a prefix of the segment identifier included in the element corresponding to the TLV field, and the second indication information is used to indicate a position of the prefix identifying the corresponding SID included in the element corresponding to the TLV field.
For example, when the source node generates a TLV field corresponding to one element, the source node acquires identification information included in a fourth element in the segment list, and generates first indication information and second indication information of a second TLV field according to a length of a prefix included in the fourth element and a position of the prefix in the first message, where the prefix is corresponding to the identification, the first element is any one of one or more elements in the segment list, and the second TLV field is any one of the one or more TLV fields.
In some specific implementation manners, the source node obtains a first element in the segment list, and when an 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 a flag, and the value or the flag corresponds to a flag included in an element, i.e., a flag indicating an uncompressed section. For example, the first preset value is a fixed value of 128, which indicates that the uncompressed segment identifier included in the first element is 128 bits. When the identifier included in the first element is a C-SID, that is, the first element may include a plurality of identifiers, a length value of a prefix corresponding to the identifier included in the fourth element may be used as a numerical value of the first indication information, that is, when the length of the prefix is a second preset value, then when the first indication information is the second preset value, it indicates that the identifier included in the first element is the C-SID, and the length of the SID prefix before compression corresponding to the C-SID is the second preset value, for example, the second preset value is 64, which indicates that the SID length corresponding to the C-SID included in the first element is 64 bits.
And generating second indication information according to the position of the prefix which identifies the corresponding SID in the first element in the first message. 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 a sequence number of an element in which the prefix of the identifier included in the fourth element is located in the segment list. For example, the prefix corresponding to the segment identifier contained in the first element is in the element G-SID [3], the sequence number of the element G-SID [3] in the segment list is 3, and the second indication information is 3. And when the prefix corresponding to the identifier contained in the first element is in the destination address of the first message, the second indication information is a fourth preset value. For example, the fourth preset value is 15, which indicates that the prefix corresponding to the identifier included in the first element is in the destination address of the first packet. The preset value may also be other values or marks, which is not limited in this application. The above exemplary description describes a process of generating the corresponding second TLV field according to the first element, and for the sequentially arranged elements included in the segment list, according to the above process, a plurality of TLV fields may be sequentially generated, which is not described herein again.
In an optional embodiment, the second TLV field may further include third indication information, where the third indication information indicates a position of the first element corresponding to the second TLV field in the segment list. The third indication information is used for indicating the corresponding relation 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 indicates that the TLV corresponds to the element G-SID [0]. When the third indication information is n, it indicates that the TLV corresponds to the element G-SID [ n ].
Exemplarily, as shown in fig. 5, fig. 5 shows a schematic diagram of a G-SRv network, where the network includes nodes N1-N10, and node N1 is a source node of a G-SRv network. The nodes N1 to N4 are located in the network domain 1, the nodes N2 to N4 are nodes supporting SRv header compression, the SIDs of the nodes N2 to N4 in the network domain 1 are compressed and use the same compressed prefix A, the node N5 is located in the network domain 2 and is a node not supporting SRv header compression, the nodes N6 to N10 in the network domain 3 are nodes supporting SRv header compression, the SIDs of the nodes N6 to N9 in the network domain 3 are compressed and use the same compressed prefix A. The identifier corresponding to the node N10 is an uncompressed segment identifier. As shown in fig. 5, the segment list of the first packet includes 5 elements: G-SID [0], G-SID [1], G-SID [2], G-SID [3], G-SID [4]. Wherein, the mark contained in G-SID [4], G-SID [2] and G-SID [1] is C-SID, and the corresponding prefix is A. The identifier contained in G-SID [3] and G-SID [0] is SID, not C-SID. G-SID [4] includes identifications 2:1, 3:1, 4, respectively, G-SID [3] includes segment identification SIDs B:5:1:, G-SID [2] includes identification 7:1, 8:1, 9F, respectively, G-SID [0] includes segment identification SIDs A:10: : .
As can be seen in FIG. 6a, the segment list contains 5 elements G-SID [0] -G-SID [4], generating corresponding 5 TLV fields:
1. in the destination address of the first message, the length of the prefix is 64 bits, so that the first indication information of the TLV field corresponding to the G-SID [4] is 64, the indication that the element G-SID [4] comprises the identifier of C-SID, the prefix length corresponding to the C-SID is 64, the second indication information is 15, the prefix is in the destination address of the first message, the third indication information is 4, the position of the element G-SID [4] corresponding to the TLV field in the segment list is indicated, so that the TLV field corresponding to the element G-SID [4] is [64, 15,4];
2. the element G-SID [3] contains identification which is non-compressed segment identification, therefore, the first indication information of the TLV field corresponding to the element G-SID [3] is 128, the element G-SID [3] contains non-compressed SID, the second indication information of the TLV field corresponding to the G-SID [3] is 3, the prefix representing the segment identification is in the element G-SID [3], the third indication information of the TLV field corresponding to the G-SID [3] is 3, and the position of the element G-SID [3] corresponding to the TLV field in the segment list is represented, namely the TLV field corresponding to the element G-SID [3] is [128,3,3];
3. the element G-SID [2] contains a prefix identified as C-SID, which corresponds to a prefix of 64 bits and is located at the element G-SID [2]. Therefore, the corresponding first indication information of the TLV field corresponding to the element G-SID [2] is 64, the indication that the element G-SID [2] contains C-SID with the prefix length of 64, the second indication information of the TLV field corresponding to the G-SID [2] is 2, the prefix corresponding to the C-SID is in the element G-SID [2], the third indication information of the TLV field corresponding to the G-SID [2] is 2, and the indication that the position of the element G-SID [2] corresponding to the TLV field is in the segment list, that is, the TLV corresponding to the element G-SID [2] is [64,2,2];
4. the element G-SID [1] contains a prefix identified as C-SID, which corresponds to a length of 64 bits and is located at element G-SID [2]. Therefore, the corresponding first indication information of the TLV field corresponding to the G-SID [1] is 64, the indication element G-SID [1] contains C-SID which is identified as C-SID, the prefix length corresponding to the C-SID is 64, the second indication information of the TLV field corresponding to the G-SID [1] is 2, the prefix corresponding to the C-SID is in the element G-SID [2], the third indication information of the TLV field corresponding to the G-SID [1] is 1, and the indication element G-SID [1] indicates the position of the TLV field 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. the element G-SID [0] contains an identification that is an uncompressed section identification. Therefore, the corresponding first indication information of the TLV field corresponding to the G-SID [0] is 128, which indicates that the element G-SID [0] contains uncompressed SID, the second indication information of the TLV field corresponding to the G-SID [0] is 0, the prefix indicating the segment identification is in the element G-SID [0], the third indication information of the TLV field corresponding to the G-SID [0] is 0, which indicates the position of the TLV field corresponding to the TLV field in the segment list, i.e. the TLV field corresponding to the element G-SID [0] is [128,0,0].
In an alternative embodiment, since the C-SIDs of the nodes in a SRv network domain correspond to the same prefix, the length of the prefix corresponding to the C-SID of the node in a SRv network domain is 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 nodes compressed in a SRv network domain can share one TLV field. When the identifiers included in the 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 SRv network domain, the multiple elements correspond to one TLV field. When the identifier contained in the element in the segment list is SID, the element corresponds to a TLV field.
Illustratively, in the message shown in FIG. 5, nodes N1-N4 may belong to network domain 1 according to the 5 elements G-SID [0] -G-SID [4] included in the segment list. In the network domain 1, the node N1 is a source node, the nodes N2 to N4 are nodes supporting SRv header compression, and the identifiers corresponding to the nodes N2 to N4 are C-SIDs. As can be seen from FIG. 5, the 3C-SIDs contained in the element G-SID [4] correspond to the nodes N2-N4, respectively, i.e., the C-SID corresponding to the node contained in the network domain 1 is located in the element G-SID [4]. And the prefix corresponding to the C-SID in the G-SID [4] is positioned in the destination address, and the length of the prefix is 64 bits, so that the TLV field corresponding to the element G-SID [4] is [4, 64], which indicates that the prefix contained in the element G-SID [4] is identified as the C-SID, the position of the prefix corresponding to the C-SID is 64, and the position of the prefix corresponding to the C-SID is in the element G-SID [4], and because the element G-SID [4] is the first element in the segment list, the position of the prefix corresponding to the C-SID is in the destination address field of the first message.
Node N5 is located in network domain 2, node N5 is a node that does not support SRv header compression, node N5 corresponds to the identifier SID, and node N5 corresponds to the SID located in element G-SID [3], i.e., the identifier included in element G-SID [3] is the SID. Thus, element G-SID [3] corresponds to a TLV field. The prefix length of the SID of the node N5 in the element G-SID [3] is 128bits, the first indication information is 128, which indicates that the identifier contained in the element G-SID [3] is SID; the prefix of SID of node N5 in element G-SID [3] is located in element G-SID [3], the sequence number of element G-SID [3] in the segment list is 3, the second indication information is 3, it indicates that the prefix including SID in element G-SID [3] is located in element G-SID [ 3].
The nodes N6 to N9 belong to the network domain 3, and the nodes N6 to N9 are nodes supporting SRv header compression. The identifiers corresponding to the nodes N6 and N9 are C-SIDs. As shown in FIG. 5, the element G-SID [2] and the element G-SID [1] include C-SID corresponding to node N6 and node N9, that is, the C-SID corresponding to the node included in the network domain 3 is located in the element G-SID [1] and the element G-SID [2]. And the element G-SID [1] and the element G-SID [2] contain the prefix length corresponding to the C-SID as 64, the first indication information is 64, the node identifier contained in the network domain 3 is C-SID, and the prefix length corresponding to the C-SID is 64; the prefix corresponding to the C-SID contained in the element G-SID [1] and the element G-SID [2] is located in the element G-SID [2], the sequence number of the element G-SID [2] in the segment list is 2, the second indication information is 2, and the prefix corresponding to the C-SID representing the node contained in the network domain 3 is located in the element G-SID [2], that is, the prefix corresponding to the C-SID contained in the element G-SID [1] and the element G-SID [2] is located in the element G-SID [2].
Node N10 is located in network domain 3, node N10 is a node that does not support SRv header compression, node N10 corresponds to the identifier SID, and node N10 corresponds to the SID located in element G-SID [0], i.e., the identifier included in element G-SID [0] is the SID. Thus, element G-SID [0] corresponds to a TLV field. The prefix length of the SID of the node N10 in the element G-SID [0] is 128bits, then the first indication information is 128, which indicates that the identifier contained in the element G-SID [0] is SID; the prefix of the SID of node N10 in element G-SID [0] is located in element G-SID [0], the serial number of element G-SID [0] in the segment list is 0, then the second indication information is 0, which indicates that the prefix including SID in element G-SID [0] is located in element G-SID [0].
As can be seen from the above, as shown in FIG. 6b, the element G-SID [4], the element G-SID [3] network, the element G-SID [2], the element G-SID [1], and the element G-SID [0] can generate 4 TLV fields of [64,4], [128,3], [64,2], [128,0]. Thus, the space of the message can be saved.
The indication information included in the TLV field is not limited to the three kinds of indication information listed above, and may also include other forms of indication information, which is not limited in this application. The TLV field format is not limited to the above listed TLV field formats, and in a specific implementation, the TLV field format may also be other formats, and the application is not limited in any way herein.
S103: the source node encapsulates the TLV field into the SRH of the first packet.
S104: the source node sends a first message.
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 into the DA field of the IPv6 header.
By means of the method and the device for forwarding the data, the one or more TLV fields are generated at the source node, so that when the intermediate forwarding node detects the path fault of the next-hop SR node, the intermediate forwarding node can obtain the segment identifier of any one of the plurality of nodes after the next-hop SR node according to the TLV fields, update the obtained segment identifier at the destination address of the message, and forward the message according to the instruction of the segment identifier, thereby bypassing the fault node or the fault path and completing the data transmission.
S105: the first node receives a first packet.
The first node is an intermediate forwarding node on the first packet forwarding path, and may receive the first packet and process the first packet according to the instruction of the segment identifier in the DA field.
S106: and when the path fault from the first node to the second node is determined, the first node acquires the segment identifier of the third node according to one or more TLV fields in the first message.
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 packet SRH, then determines the TLV field corresponding to the element according to the position information, and then obtains the third node segment identifier according to the indication information contained in the TLV field. The first pointer is an SL pointer, and the second pointer is a CL pointer. The value of SL pointer is used for indicating the position of the element where the node identifier is located in the segment list, and the value of CL pointer is used for indicating the position of the identifier in the element. The third node is any one of a plurality of nodes following 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.
The following describes, with reference to fig. 7, that the acquiring, by the first node, the third node segment identifier specifically includes:
s1061: the first node determines a first value of the SL pointer corresponding to the identity of the third node.
The SL pointer comprises one or more values, and the number of the values of the SL pointer is consistent with the number of the 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 indicating a position of a first element in the segment list, the first element including an identification of a third node.
In one embodiment, the first node obtains a second value of the SL pointer in the first message and a second value of the CL pointer in the first message. The second value of the SL pointer is a value of the SL pointer when the first node receives the first packet, and indicates a position of a second element where an identifier (i.e., an identifier of the first node) in the DA field is located in the segment list, that is, the second value of the SL pointer is used to indicate a position of a second element in the segment list, where the second element includes the identifier of the first node. The CL pointer includes a plurality of values, e.g., the CL pointer includes 4 values, 0, 1, 2,3, consistent with the 4C-SIDs contained in the element. The value of the CL pointer has a certain relationship 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 the initial value. For example, as shown in fig. 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, the value of the SL pointer is subtracted by 1, and the value of the CL pointer needs to 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 a value of the CL pointer when the first packet is received by the first node, and indicates a position of the identifier in the DA field (i.e., the identifier of the first node) in the second element.
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, and if the identifier of the second node is an uncompressed segment identifier, that is, if the identifier of the second node is a SID, it indicates that the SID of the second node has a length of 128bits and an element has a length of 128bits, and the SID of the second node is located at all bits of an element. And when the SID of the second node occupies all bits of one element, subtracting 2 from the second value of the SL pointer to obtain the first value of the SL pointer.
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 the compressed segment identifier, that is, the identifier of the second node is the C-SID, and determines that the first element and the second element are 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, determines that the second node and the third node are both in the first element according to the value of the CL pointer, and the first value of the SL is the second value of the SL. Wherein the first element is an element comprising an identification of the third node and the second element is an element comprising an identification of the second node.
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 or not according to the identifier of the first node, if the identifier of the second node is determined to be the compressed segment identifier according to the identifier of the first node, and determines that the identifier of the second node is located at the position of the last identifier of the second element according to the value of CL, and subtracts 1 from the second value of SL to obtain the first value of SL.
In one possible implementation, if the identification of the second node is a C-SID, the second value of the CL pointer is decremented by 1 to obtain a third value of the CL pointer. The third value of the CL pointer indicates the location of the identification of the second node in the second element. The first node determines whether the third value of the CL pointer is the fifth preset value. The fifth preset value may be a fixed value or a flag, 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 also in the C-SID second element of the second node, so that the second value of the first pointer is taken 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, it indicates that the C-SID of the second node is the last identifier in the second element, and the second value of the first pointer is subtracted by 1 to obtain the first value of the first pointer.
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 4C-SIDs, and the initial value of the CL pointer may be 3, for example, in the packet 1, indicating the first C-SID in the element G-SID [1], i.e., 2:1. For example, in message 3, if the value of the CL pointer is 0, the last C-SID in the indication element G-SID [1], that is, 5:1, is indicated, and the fifth preset value is 0. If the initial value of the CL pointer is 4, indicating that the first C-SID in the element G-SID [1], i.e. 2, and the value of the CL pointer is 1, indicating that the last C-SID in the element G-SID [1], i.e. 5:1, the fifth preset value is 1.
In some optional embodiments, the determining, by the first node, 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 whether the identifier of the first node carries the first mark or not can be judged through the first node. Wherein the first flag is used to indicate that the flag of the second node is a compressed segment identification. And if the identifier of the first node does not carry the first mark, the identifier of the second node is the identifier of the uncompressed section. And if the identifier of the first node carries the first mark, the second node identifier is the C-SID. Wherein the first marker is a COC flavour marker. If the identifier in the DA field carries a COC flag, it indicates that the next identifier of the identifier in the segment list is a C-SID.
In some optional embodiments, the determining, by the first node, whether the identifier of the second node is a C-SID may further include: the first node obtains the identifier of the first node according to the DA field of the first message, and the identifier of the first node can be judged by the first node. The mark included in the mark of the first node comprises a second mark and a third mark, the second mark is used for indicating that the mark of the second node is a compressed segment mark, and the third mark is used for indicating that the mark of the second node is an uncompressed segment mark. And if the identifier of the first node comprises the second mark, determining that the identifier of the second node is the compressed segment identifier. And if the identifier of the first node comprises the third mark, determining that the identifier of the second node is the identifier of the non-compressed segment.
S1062: the first node determines a first TLV field according to a first value of the SL pointer corresponding to the third node.
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 TLV fields arranged in sequence, and one or more elements in the segment list and one or more TLV fields are in one-to-one correspondence. For example, if the fragment list contains 3 elements G-SID [0] -G-SID [2], there is a first TLV field corresponding to element G-SID [0], a second TLV field corresponding to element G-SID [1], and a third TLV field corresponding to element G-SID [2]. And the value of the SL pointer is used to indicate the position of the element in which the identifier is located in the segment list, for example, when the value of the SL pointer is 2, the element G-SID [2] in which the identifier is located is indicated. Therefore, the first node obtains a first value of the SL pointer corresponding to the third node, where the first value of the SL pointer is used to indicate a position of a first element where the identifier of the third node is located in the segment list, and the first node may determine, according to the first value of the SL pointer, a sequence number corresponding to the first element where the identifier of the third node is located in the segment list, and further may obtain, according to the sequence number corresponding to the first element in the segment list, the first TLV field from the one or more TLV fields. Illustratively, when the first value of the SL pointer is 2, which indicates that the corresponding sequence number of the element G-SID [2] where the identifier is located in the segment list is 3, and the 3 rd TLV field is obtained from the plurality of TLV fields according to the corresponding sequence number of the element G-SID [2] in the segment list is 3, it may be determined that the identifier of the third node corresponds to the 3 rd TLV field, that is, the first TLV field is the 3 rd TLV field of the plurality of TLV fields.
In an optional embodiment, when the TLV field further includes third indication information, the third indication information is used to indicate a position or an order identifier of the element corresponding to the identifier corresponding to the TLV in the segment list. The first node may determine the first TLV field from the first value of the SL pointer and the third indication information. For example, when the first value of the SL pointer is 2, the TLV field of which the third indication information is 2 is determined to be the first TLV field.
In some optional embodiments, after the first node obtains the first value of the SL pointer corresponding to the third node, the first node determines the first TLV field according to the first value of the SL pointer and the second indication information of each of the one or more TLV fields. Specifically, when the second indication information of one of 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. And when the second indication information of each of the one or more TLV fields is not the same as the first value of the SL pointer, taking the TLV field corresponding to the minimum second indication information of all the second indication information which is larger than the first value of the SL pointer as 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], and thus 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, the TLV field with the smallest second indication information in the TLV fields with the second indication information larger than 1 is taken, the TLV field with the smallest second indication information in the TLV fields with the second indication information larger than 1 is 3 in the three second indication information, and the smallest value in the 2,3 and 2 in the three second indication information is 2, that is, the TLV field with the second indication information of 2 is the first TLV field, that is, the first TLV field is [80,2].
S1063: and acquiring the segment identification of the third node according to the first TLV field.
The first TLV field comprises first indication information and second indication information, wherein the first indication information is used for indicating the length of the prefix of the SID corresponding to the identifier of the third node, and the second indication information is used for indicating the position of the prefix of the SID corresponding to the identifier of the third node in the first message.
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, it determines that the length of the prefix corresponding to the identifier of the second node is 128, in this case, the identifier of the second node is an uncompressed segment identifier, that is, the identifier length of the third node is 128 bits. The first node may determine, according to the first value of the SL pointer, a position of the first element where the third node identifier is located in the segment list, and use the first element as the segment identifier of the third node.
In one possible embodiment, the identification of the third node is determined to be the C-SID if the first indication information of the first TLV is a second preset value, e.g., the second preset value is a value less than 128. And 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 a position of a first element in the segment list to which the identity of the third node belongs, and the first value of the CL pointer indicates a position of the C-SID of the third node in the first element. The first node also needs to acquire a prefix of the SID corresponding to the C-SID of the third node, and the first node acquires 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 and acquires the position of the prefix of the SID corresponding to the C-SID of the third node in the first message according to the second indication information of the first TLV. And finally, obtaining the segment identifier of the third node according to the C-SID of the third node and the prefix of the SID corresponding to the C-SID of the third node.
Exemplarily, the following description is made in connection with the following three cases, taking one or more TLV fields as an example for sequential arrangement.
The first method comprises the following steps: a cross-network domain scenario.
Fig. 8a and 8b both exemplarily show G-SRv networks of two network domains, as shown in fig. 8a and 8b, the nodes N1-N4 are network domain 1, the nodes N1-N4 in network domain 1 are nodes supporting SRv header compression, and the SIDs of the nodes N2-N4 in network domain 1 are compressed and use the same compressed prefix a:. The nodes N5-N10 are located in the network domain 2, the nodes N5-N9 in the network domain 2 are the nodes supporting SRv header compression, SID of the nodes N5-N9 in the network domain 2 is compressed, and the same compressed prefix B is used. The SRH header uses a 32-bit C-SID fragment list. In a network domain, each element contains 4 compressed segment identifiers. When the node N4 detects a path fault from the node N4 to the node N5, it needs to acquire a segment identifier of the node N6 or a segment identifier of a node after the node N6 on a forwarding path for forwarding.
In the network shown in fig. 8a, after receiving the first packet, the node N4 obtains the value of the SL pointer in the first packet, where the value of the SL pointer indicates the element where the identifier of the node N4 is located, and as can be seen from fig. 8a, the value of the SL pointer is 3, which indicates that the identifier of the node N4 is in the element G-SID [3], and the value of the CL pointer is 1, which indicates that the identifier of the node N4 is in the third C-SID in the element G-SID [ 3]. According to the COC flag not carried by the N4 node flag contained in the DA field, under the condition, the flag B of the node N5 is obtained, namely 5:1, which is the non-compressed segment flag and indicates that the segment flag of the node N5 occupies one element, the value of the SL pointer and the value of the CL pointer are updated, the SL pointer is reduced by 2, the value of the SL pointer is 1 and points to the element G-SID [1], the value of the CL pointer is updated to 3 and points to the first C-SID in the element G-SID [ 1]. According to the SL pointer value of 1, the identifier of the node N6 is indicated in the element G-SID [1], and the G-SID [1] corresponds to the second TLV field, so that the segment identifier of the node N6 corresponds to the second TLV field [80,2,1].
And according to the fact that the first indication information in the second TLV field [80,2,1] is 80, the identifier of the node N6 is obtained to be C-SID, and the prefix length corresponding to the C-SID of the node N6 is 80 bits. And obtaining the prefix corresponding to the C-SID of the node N6 in the element G-SID [2] according to the second indication information of 2. According to the first indication information of 80 and the second indication information of 2, the prefix corresponding to the C-SID from the element G-SID [2] to the node N6 is B. And determining the first C-SID of the node N6 in the element G-SID [1] according to the SL pointer value of 1 and the CL pointer value of 3, and obtaining that the C-SID of the node N6 is 6:1. Therefore, the C-SID of the node N6 is added with the prefix corresponding to the C-SID, and the segment identifier of the node N6 is obtained as B: 6:1:.
After the node N4 receives the first packet shown in fig. 8b, the first packet includes three TLV fields, which are [64,3], [80,2], [128,0], and the value of the SL pointer in the first packet acquired by the node N4 is 3, and as can be known from the analysis in fig. 8a, the value of the SL pointer corresponding to the node N6 can be acquired as 1. The second indication information in none of the three TLV fields is the same as the value of the SL pointer, 1 is compared with the second indication information in the three TLV fields to take the smallest value of the values larger than 1, the second indication information in the three TLV fields is 3, 2, 0, the number larger than 1 is 3, 2, and the smallest of 3 and 2 is 2, so that the TLV field corresponding to node N6 can be determined to be [80,2]. And according to the fact that the first indication information in the TLV field [80,2] is 80, the obtained identifier of the node N6 is the C-SID, and the prefix length corresponding to the C-SID of the node N6 is 80 bits. And obtaining the prefix corresponding to the C-SID of the node N6 in the element G-SID [2] according to the second indication information of 2. According to the first indication information of 80 and the second indication information of 2, the prefix corresponding to the C-SID from the element G-SID [2] to the node N6 is B. And determining the first C-SID of the node N6 in the element G-SID [1] according to the SL pointer value of 1 and the CL pointer value of 3, and obtaining that the C-SID of the node N6 is 6:1. Therefore, the C-SID of the node N6 is added with the prefix corresponding to the C-SID, and the segment identifier of the node N6 is obtained as B: 6:1:.
And the second method comprises the following steps: purely compressed scenes.
Both fig. 9a and 9b illustrate a G-SRv network, as shown in both fig. 9a and 9b, that includes nodes N1-N10, SRH marshals the segment list with 32-bit C-SIDs. When the node N3 detects a path fault from the node N3 to the node N4, it needs to acquire the segment identifier of the node N5 or a node after the node N5, and forward the first packet according to the segment identifier of the node N5 or a node after the node N5, bypassing the faulty node.
When the node N3 acquires the first packet shown in fig. 9a, the value of the SL pointer is 2, which indicates that the identifier of the node N3 is in the element G-SID [2], and the value of the CL pointer is 2, which indicates that the identifier of the node N3 is in the second compression segment identifier in the element G-SID [2]. According to the fact that N3 node segment identification in the DA field carries COC flag identification, the identification of the node N4 is obtained to be 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 obtained to be 1, the value of the CL pointer is not 0, according to the value of the SL pointer being 2 and the value of the CL pointer being 1, the node N4 points to the third C-SID in the element G-SID [2], the fact that the identification of the node N4 is not the last C-SID in the element G-SID [2] is indicated, and the identification of the node N5 is in the element G-SID [2]. Therefore, the SL pointer corresponding to node N5 may be obtained to have a value of 2. In accordance with a SL value of 2, indicating that the identity of node N5 is in element G-SID [2], G-SID [2] corresponds to the third TLV field, it may be determined that the identity of node N5 corresponds to the third TLV field [64, 15,2].
Then, according to the first indication information in the third TLV [64, 15,2] being 64, the identifier to 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 15, and it can be obtained that the prefix corresponding to the C-SID of the node N5 is located in the first packet DA field. Based on 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 SL pointer value of 2 and the CL pointer value of 1, the third C-SID of the node N4 in the element G-SID [2] can be obtained, the CL pointer value is updated, the CL pointer value is reduced by 1 to obtain the CL pointer value of 0, the fourth C-SID of the node N5 in the element G-SID [2] is determined, and the C-SID of the node N5 is 5:1. Therefore, the C-SID5:1 of the node N5 is added with the prefix A corresponding to the C-SID, and the segment identifier of the node N5 is obtained as A: 5:1:.
After the node N3 receives the first packet shown in fig. 9b, the first packet includes two TLV fields, which are [64,2], [128,0], and the node N3 obtains the value of the SL pointer in the first packet as 2, as can be seen from the analysis in fig. 9a, the value of the SL pointer corresponding to the node N5 can be obtained as 2. The second indication information in the TLV field 64,2 is the same as the value of the SL pointer, and thus, it can be determined that the TLV field corresponding to the node N5 is 64,2.
Then, according to the first indication information of 64 in the TLV [64,2], the node N5 can be identified as the C-SID, and the prefix corresponding to the C-SID of the node N5 has a length of 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 packet are 2 and 0, respectively. 2 is the largest value in the second indication information in the first message, and the resulting element G-SID [2] is the first element in the segment list, so that the prefix corresponding to the C-SID resulting from node N5 is located in the destination address field of the first message. The prefix A corresponding to the C-SID for node N5 may be obtained from the destination address. According to the SL pointer value of 2 and the CL pointer value of 1, the third C-SID of the node N4 in the element G-SID [2] can be obtained, the CL pointer value is updated, the CL pointer value is reduced by 1 to obtain the CL pointer value of 0, the fourth C-SID of the node N5 in the element G-SID [2] is determined, and the C-SID of the node N5 is 5:1. Therefore, the C-SID5:1 of the node N5 is added with the prefix A corresponding to the C-SID, and the segment identifier of the node N5 is obtained as A: 5:1:.
In a possible embodiment, according to the above process, on the basis of the node N5, a segment identifier of a node after the node N5 on the packet forwarding path may also be obtained, for example, a segment identifier of the node N6 is obtained, which is not described herein again.
And the third is that: compressed and uncompressed hybrid choreography scenes.
10a and 10b illustrate a G-SRv network, as shown in FIG. 10a and 10b, nodes N1 to N4 are in the G-SRv network domain 1, nodes N2 to N4 in the network domain 1 are nodes supporting SRv header compression, SIDs of nodes N2 to N4 in the network domain 1 are compressed, and the same compressed prefix A is used. The node N5 is located in the network domain 2, the node N5 is a standard SRv node, and does not support SRv header compression, and the identifier corresponding to the node N5 is an uncompressed segment identifier. In the G-SRv network domain 3, the nodes N6 to N10 in the network domain 3 are nodes supporting SRv header compression, SIDs of the nodes N6 to N9 in the network domain 3 are compressed, the same compression prefix A is used, the corresponding identifier of the node N10 is an uncompressed segment identifier, and the SRH header uses a 32-bit C-SID and a 128-bit SID to mix and arrange a segment list. When the node N3 detects a path fault from the node N3 to the node N4, it needs to acquire the segment identifier of the node N5 or a node after the node N5, and forwards the first packet according to the segment identifier of the node N5 or a node after the node N5 on the forwarding path, so as to bypass the faulty node.
After the node N3 acquires the first packet shown in FIG. 10a, the SL pointer has a value of 4, which indicates that the identifier of the node N3 is in the element G-SID [4], the CL pointer has a value of 2, which indicates that the identifier of the node N3 is in the second C-SID in the element G-SID [4].
And obtaining the identifier of the node N4 as C-SID according to the identifier of the node N3 in the DA field, updating the value of the CL pointer, subtracting 1 from the value of the CL pointer to obtain the value of the CL pointer as 1, wherein the value of the CL pointer is not 0, and obtaining the 32-bit C-SID of the N4 according to the value of the SL pointer as 4 and the value of the CL pointer as 1. And when the obtained 32-bit C-SID is not 0, updating the value of the CL pointer, subtracting 1 from the value of the CL pointer to obtain the value of the CL pointer as 0, and obtaining the 32-bit C-SID. 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]. And updating the value of the SL pointer, and subtracting 1 from the value of the SL pointer to obtain the value of the SL pointer as 3. With the SL pointer value of 3 and the SL pointer value of 3, indicating that the identity of node N5 is in element G-SID [3], element G-SID [3] corresponds to the fourth TLV field, it may be determined that the identity of node N5 corresponds to the fourth TLV field [128,3,3].
According to the fact that the first indication information in the fourth TLV field 128,3,3 is 128, the identification of the node N5 is an uncompressed segment identification, the segment identification of the node N5 is 128bits, one element, namely the element G-SID [3], can be obtained, and therefore the 128-bit segment identification B:5:1:, namely the segment identification of the node N5 is B:5:1:, can be obtained.
After the node N3 acquires the first packet shown in fig. 10b, the first packet includes four TLV fields, which are [64,4], [128,3], [64,2], [128,0]. The node N3 obtains that the value of the SL pointer in the first message is 3, and as can be seen from the analysis of fig. 10a, 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, and thus, the TLV field corresponding to node N5 may be determined to be [128,3].
According to the first indication information of 128 in the TLV field 128,3, the identifier of the node N5 is obtained as the non-compressed segment identifier, which indicates that the segment identifier of the node N5 is 128bits and occupies one element, namely the element G-SID [3], so that the segment identifier B:5:1:, namely the segment identifier of the node N5B: 5:1:, can be obtained as the 128 bits.
The G-SRv network shown in fig. 8 a-10 b also includes transit nodes, which are not shown. The transit node is a node which forwards the G-SRv message but does not process the G-SRv message.
It should be noted that, in this embodiment of the present application, the intermediate forwarding node on the forwarding path may be a relay node or an SR node, which is not limited in this application.
In a possible embodiment, the first node may also be a transit node, where the transit node is a node that forwards a G-SRv packet but does not perform G-SRv packet processing. When the transit node detects a path fault from the transit node to the next-hop SR node, the transit node becomes a node supporting the function of SRv, and replaces the fault node to process a message and bypass the fault node or the fault path. For example, the next hop node segment identifier of the failed node is obtained, and the packet is forwarded according to the segment identifier.
Illustratively, fig. 11a and 11b show a G-SRv network schematic diagram, as shown in fig. 11a and 11b, in which the nodes N1-N10 are in the G-SRv network domain, the network domain contains nodes supporting SRv header compression, the SID of the node N2-node N9 in the network domain is compressed, and the same compressed prefix a is used. The segment list specifies the nodes to be passed along, and N3' is a transit node and is not in the segment list. The SRH header programs the segment list with a 32-bit C-SID. When the node N3 'detects that the next hop node N4 is in fault, the node N3' becomes a node capable of processing the G-SRv message, the segment identifier of the node N5 is obtained, and forwarding is carried out according to the instruction of the segment identifier of the node N5.
When the node N3' receives the first packet as shown in FIG. 11a, the SL pointer has a value of 2, which indicates that the identifier of the node N4 is in the element G-SID [2], the CL pointer has a value of 1, which indicates that the identifier of the node N4 is in the third C-SID in the element G-SID [2]. And obtaining the identifier of the node N5 as C-SID according to the COC flag identifier carried by the identifier of the node N4 in the DA field. The value of the CL pointer is not 0, which indicates that the C-SID of the N4 node is not the last segment identifier in the element G-SID [2], the value of the CL pointer is updated, the value of the CL pointer is subtracted by 1, the value of the CL pointer is 0, and the value of the node N5 identifier is the last C-SID of the element G-SID [2]. Therefore, the SL pointer corresponding to node N5 may be obtained to have a value of 2. Based on the SL pointer value of 2, indicating that node N5 is identified at element G-SID [2], and element G-SID [2] corresponds to the third TLV field, it may be determined that node N5 corresponds to the third TLV field [64, 15,2].
Then, according to the first indication information of the third TLV field [64, 15,2] being 64, the identifier to 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 15, and the position of the prefix corresponding to the C-SID of the node N5 can be obtained and is located in the first message DA field. According to the first indication information being 64 and the second indication information 15, a 64-bit prefix a can be obtained from the destination address field of the first message. And obtaining the C-SID of the node N4 according to the SL pointer value of 2 and the CL pointer value of 1, updating the CL pointer value, subtracting 1 from the CL pointer value to obtain the CL pointer value of 0, and determining the fourth C-SID, namely the fourth C-SID, of the C-SID of the node N5 in the element G-SID [2] according to the SL pointer value of 2 and the CL pointer value of 0. The C-SID for node N5 is found to be 5:1. Therefore, the C-SID5:1 of the node N5 is added with the prefix A:, and the segment identifier of the node N5 is A:5:1:: can be obtained.
After the node N3' receives the first packet shown in fig. 10b, the first packet includes two TLV fields, which are [64,2], [128,0]. The node N3' obtains the value of the SL pointer in the first message as 2, and as can be seen from the analysis of fig. 9a, the value of the SL pointer corresponding to the node N5 as 2 can be obtained. The second indication information 2 in the TLV field 64,2 is the same as the value 2 of the SL pointer, and therefore, it can be determined that the TLV field corresponding to the node N5 is 64,2.
According to the first indication information of 64 in the TLV [64,2], the identifier to the node N5 is identified as the C-SID, and the prefix corresponding to the C-SID of the node N5 has 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 packet are 2 and 0, respectively. 2 is the largest value in the second indication information in the first message, and the resulting element G-SID [2] is the first element in the segment list, so that the prefix corresponding to the C-SID resulting from node N5 is located in the destination address field of the first message. The prefix A corresponding to the C-SID for node N5 may be obtained from the destination address. According to the SL pointer value of 2 and the CL pointer value of 1, the third C-SID of the node N4 in the element G-SID [2] can be obtained, the CL pointer value is updated, the CL pointer value is reduced by 1 to obtain the CL pointer value of 0, the fourth C-SID of the node N5 in the element G-SID [2] is determined, and the C-SID of the node N5 is 5:1. Therefore, the C-SID5:1 of the node N5 is added with the prefix A corresponding to the C-SID, and the segment identifier of the node N5 is obtained as A: 5:1:.
S107: the first node copies the segment identifier of the third node to the destination address of the first message based on the first message, encapsulates the segment identifier into a second message, and sends the second message.
After the first node obtains the segment identifier of the third node, the segment identifier of the third node is copied to the DA field, the SL pointer and the CL pointer are updated, the first message is encapsulated into a second message, and the second message is forwarded according to the instruction of the segment identifier of the DA field in the second message.
By adding the indication information in the first message, when the intermediate forwarding node on the forwarding path detects a path fault of the SR node of the next hop, the intermediate forwarding node may obtain a segment identifier of any one of the plurality of nodes after the SR node of the next hop on the forwarding path, and forward the message according to an instruction included in a functional field of the segment identifier, thereby bypassing the faulty node, so that the message can be continuously forwarded, and data transmission is completed.
It is to be understood that, not limited to the above-mentioned encapsulation indication information, the indication information may also be encapsulated in the segment identification. For example, 128bits, 16 bits in the IPv6 address are used as indication information, and the rest are used as path information identification.
It should be noted that, for simplicity of description, the above method embodiments are described as a series of action combinations, but those skilled in the art should understand that the present invention is not limited by the described sequence of actions, and those skilled in the art should understand that the embodiments described in the specification all belong to the preferred embodiments, and the actions involved are not necessarily required by the present invention.
While the method of the embodiments of the present invention has been described in detail, in order to better implement the above-described aspects of the embodiments of the present invention, the following also provides related apparatus for implementing the aspects.
Referring to fig. 12, fig. 12 is a schematic structural diagram of a network device according to an embodiment of the present application, and 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 transmitting unit 130; wherein the content of the first and second substances,
the first receiving unit 110 is configured to obtain a segment list of a first packet, where the segment list corresponds to a forwarding path of the first packet, the segment list includes one or more elements, each element of the one or more elements includes one or more identifiers, and each identifier of the one or more identifiers corresponds to one node of multiple nodes in the forwarding path or one link in the forwarding path, respectively;
a first processing unit 120 configured to generate one or more type-length-value TLVs according to the segment list.
A first sending unit 130, configured to send the first packet, where the first packet includes one or more TLVs, and 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 one of the nodes or one of links in the forwarding path.
In this embodiment, the network device 100 generates a first TLV field for the first element in the segment list according to the first packet, and performs processing modes such as encapsulation and forwarding on the first packet, which correspond to the processing mode of the source node for the first packet in the method embodiment, and details are not described here again.
Referring to fig. 13, fig. 13 is a schematic structural diagram of a network device according to an embodiment of the present application, and as shown in fig. 13, the network device 200 at least includes: a second receiving unit 210, a second processing unit 220, and a second transmitting unit 230, wherein,
a second receiving unit 210, configured to receive a first packet by a first node, where the first packet includes a segment list, the segment list corresponds to a forwarding path of the first packet, the segment list includes one or more elements, the elements include one or more identifiers, and each identifier of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path, respectively;
a second processing unit 220, configured to, when it is determined that a path from the first node to a second node fails, obtain, by the first node, a segment identifier of a third node according to one or more type-length-value TLVs in the first message, where the second node is a next-hop segment routing SR node of the first node in the forwarding path, the third node is any one of nodes following the second node in the forwarding path, and 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 one node in the plurality of nodes or one link in the forwarding path;
the first node obtains a second message according to the first message;
a second sending unit 230, configured to send the second packet, where a destination address of the second packet includes a segment identifier of the third node.
In this embodiment, the network device 100 obtains the segment identifier of the second node and forwards the first TLV field of the received first packet, which corresponds to the processing manner of the first packet by the first node in the method embodiment, and is not described herein again.
It is understood that each device described above, in order to implement the above functions, includes a corresponding hardware structure and/or software module for performing each function. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative elements and method steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, functional units may be divided according to the above method examples, 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 integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Referring to fig. 14, fig. 14 is a schematic structural diagram of a network device according to an embodiment of the present disclosure, where the network device 300 at least includes a processor 310, a transceiver 320, and a memory 330, and the processor 310, the transceiver 320, and the memory 330 are connected to each other through a bus 340, where,
the processor 310 may be a Central Processing Unit (CPU) or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The transceiver 320 may include a receiver and a transmitter, such as a radio frequency module, and the processor 310 described below receives or transmits a message, which is specifically understood to be the processor 310 receiving or transmitting through the transceiver.
The Memory 330 includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), or an Erasable Programmable Read-Only Memory (EPROM or flash Memory), and the Memory 330 is used to store related instructions and data and can transmit the stored data to the processor 310.
The processor 310 in the network device 300 is configured to read the relevant instructions in the memory 330 to perform the following operations:
the processor 310, according to obtaining a segment list of a first packet, where the segment list corresponds to a forwarding path of the first packet, the segment list includes one or more elements, each element of the one or more elements includes one or more identifiers, and each identifier of the one or more identifiers corresponds to one node of multiple nodes in the forwarding path or one link in the forwarding path, respectively;
the transmitter in the transceiver 320 transmits the first packet, where the first packet includes one or more TLVs, and 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 one of the nodes or one of the links in the forwarding path.
Specifically, for specific implementation of various operations executed by the network device 300, reference may be made to specific operations of the source node in the foregoing method embodiment, and details are not described here again.
Referring to fig. 15, fig. 15 is a schematic structural diagram of a network device according to an embodiment of the present disclosure, as shown in fig. 15, the network device 400 at least includes 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 (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The transceiver 420 may include a receiver and a transmitter, such as a radio frequency module, and the processor 410 described below receives or transmits a message, which is specifically understood to be the transceiver through which the processor 410 receives or transmits.
The Memory 430 includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), or an Erasable Programmable Read-Only Memory (EPROM or flash Memory), and the Memory 430 is used for storing related instructions and data and transmitting the stored data to the processor 410.
The processor 410 in the network device 400 is configured to read the relevant instructions in the memory 430 to perform the following operations:
the processor 410 controls a receiver in the transceiver 420 to receive a first packet, the first packet including a segment list, the segment list corresponding to a forwarding path of the first packet, the segment list including one or more elements, the elements including one or more identifiers, each of the one or more identifiers corresponding to a node in the forwarding path or a link in the forwarding path, respectively;
when the processor 410 determines that a path from the first node to a second node fails, the first node obtains a segment identifier of a third node according to one or more type-length-value TLVs in the first message, the second node is a next-hop segment routing SR node of the first node in the forwarding path, the third node is any one of nodes following the second node in the forwarding path, and each of the one or more TLVs includes indication information, where the indication information is used to indicate prefix information of a segment identifier SID of one of the nodes or one of links in the forwarding path;
the processor 410 obtains a second message according to the first message;
the transmitter in the transceiver 420 transmits a second packet, the destination address of which includes the segment identification of the second node.
Specifically, the specific implementation of the operations executed by the network device 400 may refer to the specific operations of the first node in the foregoing method embodiment, and details are not described herein again.
Referring to fig. 16, fig. 16 is a schematic diagram illustrating a possible network system according to an embodiment of the present disclosure. Network system 600 includes a first network device 610 and a second network device 620. A first network device 610 in the network system may perform the processing steps of the source node in the embodiment of fig. 4, and a second network device 620 in the network system may perform the processing steps of the first node in the embodiment shown in fig. 4. Accordingly, 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 correspondingly, 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.
Specifically, the first network device is configured to obtain a segment list of a first packet, where the segment list corresponds to a forwarding path of the first packet, the segment list includes one or more elements, each element of the one or more elements includes one or more identifiers, and each identifier of the one or more identifiers corresponds to one node of multiple nodes in the forwarding path or one link in the forwarding path, respectively; sending the first packet, where the first packet includes one or more TLVs, and each of the one or more TLVs includes indication information, where the indication information is used to indicate prefix information of a Segment Identification (SID) of one of the nodes or one of links in the forwarding path.
A second network device, configured to receive a first packet, where the first packet includes a segment list, where the segment list corresponds to a forwarding path of the first packet, the segment list includes one or more elements, where the elements include one or more identifiers, and each identifier of the one or more identifiers corresponds to a node in the forwarding path or a link in the forwarding path, respectively; when determining that a path from the first node to a second node fails, the first node obtains a segment identifier of a third node according to one or more type-length-value TLVs in the first message, wherein the second node is a next-hop Segment Routing (SR) node of the first node in the forwarding path, the third node is any one of nodes after the second node in the forwarding path, and each TLV in the one or more TLVs comprises indication information used for indicating prefix information of a Segment Identifier (SID) of one node in the plurality of nodes or one link in the forwarding path; the first node obtains a second message according to the first message; and the first node sends the second message, and the destination address of the second message comprises the segment identifier of the third node.
Embodiments of the present invention also provide a non-transitory storage medium for storing software instructions used in the foregoing embodiments, which includes a program for executing the method shown in the foregoing embodiments, and when the program is executed on a computer or a network device, the computer or the network device is caused to execute the method in the foregoing method embodiments.
Embodiments of the present invention also provide a computer program product comprising computer program instructions, which, when run on a computer, cause the network device to perform the method in the foregoing method embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, 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 loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (31)

1. A method of data transmission, the method comprising:
a first node receives a first message, wherein the first message comprises a segment list, the segment list corresponds to a forwarding path of the first message, the segment list comprises one or more elements, the elements comprise one or more identifiers, and each identifier in the one or more identifiers corresponds to one node in the forwarding path or one link in the forwarding path respectively;
when determining that a path from the first node to a second node fails, the first node obtains a segment identifier of a third node according to one or more type-length-value TLVs in the first message, wherein the second node is a next-hop Segment Routing (SR) node of the first node in the forwarding path, the third node is any one of nodes after the second node in the forwarding path, and each TLV in the one or more TLVs comprises indication information used for indicating prefix information corresponding to a Segment Identifier (SID) of one node in the plurality of nodes or one link in the forwarding path;
the first node obtains a second message according to the first message;
and the first node sends the second message, and the destination address of the second message comprises the segment identifier of the third node.
2. The method of claim 1, wherein the first node obtaining the segment identifier of the third node according to one or more type-length-value TLVs in the first message comprises:
obtaining the third node segment identification from the one or more type-length-value TLVs and a first value of a segment remaining SL, the first value of the SL indicating a position of a first element in the segment list, the first element including an identification of the third node.
3. The method of claim 2, wherein obtaining the third node segment identity from the one or more type-length-value TLVs and the first value of segment remaining SLs comprises:
obtaining a first TLV according to a first value of the SL, the first TLV being 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.
4. The method of claim 2 or 3, wherein obtaining the first TLV according to the first value of the SL comprises:
acquiring a second value of the SL, where the second value of the SL is a value of the SL when the first node receives the first packet, and the second value of the SL is used to indicate a position of a second element in the segment list, where the second element includes an identifier of the first node;
determining a first value of the SL according to the second value of the SL;
and acquiring a first TLV according to the first value of the SL.
5. The method of claim 4, wherein determining the first value of the SL from the second value of the SL comprises:
and if the identifier of the second node is determined to be the identifier of the non-compression section according to the identifier of the first node, subtracting 2 from the second value of the SL to obtain a first value of the SL.
6. The method of claim 5, wherein a first flag is used to indicate that the flag of the second node is a compressed segment identification,
the determining that the identifier of the second node is an identifier of an uncompressed segment according to the identifier of the first node includes:
acquiring the identifier of the first node according to the destination address of the first message;
and if the first mark is not included in the identification of the first node, determining that the identification of the second node is the identification of the non-compressed segment.
7. The method of claim 4, wherein the determining a first value of the SL from a second value of the SL comprises:
if the identifier of the second node is determined to be a compressed segment identifier according to the identifier of the first node, and the first element and the second element are determined to be the same according to the value of the residual CL of the compressed segment identifier, the first value of the SL is the second value of the SL; or
And if the identifier of the second node is determined to be a compressed segment identifier according to the identifier of the first node and the identifier of the second node is determined to be located at the position of the last identifier of a third element according to the value of CL, wherein the third element comprises the identifier of the second node, and the second value of the SL is reduced by 1 to obtain the first value of the SL.
8. The method of claim 7, wherein a second flag is used to indicate that the flag of the second node is a compressed segment flag, and wherein determining that the flag of the second node is a compressed segment flag according to the flag of the first node comprises:
acquiring the identifier of the first node according to the destination address of the first message;
and if the identifier of the first node comprises the second mark, determining that the identifier of the second node is a compressed segment identifier.
9. The method of 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, and wherein obtaining the first TLV according to the first value of the SL comprises:
determining a corresponding sequence number of the first element in the segment list according to a first value of the SL;
and acquiring the first TLV from the one or more TLVs according to the corresponding sequence number of the first element in the segment list.
10. The method of 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:
obtaining the third node segment identifier according to the first value of the SL and the first indication information of the first TLV, wherein,
the indication information of the first TLV includes first indication information indicating a length of a prefix of a segment identification of the third node.
11. The method according to claim 10, wherein said obtaining the third node segment identifier according to the first value of the SL and the first indication information of the first TLV comprises:
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 a segment identity of the third node according to the first value of the SL.
12. The method according to claim 10, wherein said obtaining the third node segment identifier according to the first value of the SL and the first indication information of the first TLV comprises:
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;
determining a position of the first element in the segment list according to a first value of the SL;
determining the position of the identifier of the third node in the first element according to the value of the CL;
acquiring an identifier of the third node;
and acquiring a 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 for indicating a position of a prefix of the segment identifier of the third node.
13. The method of any of claims 1-12, wherein the segment list is located in a SRv Routing Header (SRH) of the first packet, and wherein the first TLV is located in an SRH of the first packet.
14. The method of any one of claims 1 to 13, wherein the segment list comprises one or more elements, each of the one or more elements having a length of 128 bits.
15. A method of data transmission, the method comprising:
obtaining a segment list of a first packet, where the segment list corresponds to a forwarding path of the first packet, the segment list includes one or more elements, each element of the one or more elements includes one or more identifiers, and each identifier of the one or more identifiers corresponds to one node of multiple nodes in the forwarding path or one link in the forwarding path, respectively;
sending the first packet, where the first packet includes one or more TLVs, and 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 one of the nodes or one of links in the forwarding path.
16. The method of claim 15, wherein prior to sending the first packet, comprising:
generating one or more type-length-value TLVs according to the segment list.
17. The method of claim 16, said generating one or more type-length-value TLVs from the segment list comprising:
obtaining a fourth element in the segment list, wherein the fourth element is any one of the one or more elements;
generating a second TLV from the one or more identifications included in the fourth element, the second TLV being one of the one or more TLVs.
18. The method of claim 17, wherein the indication information of the second TLV comprises first indication information indicating a length of an identified prefix included in the fourth element;
generating, by the processor, a second TLV according to the identification information included in the fourth element, including:
generating first indication information for the second TLV according to a length of the identified prefix included in the fourth element.
19. The method of 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 comprises:
when the identifier included in the fourth element is a non-compressed segment identifier, the first indication information of the second TLV is the first preset value; alternatively, the first and second electrodes may be,
and 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 preset value.
20. The method according to any of claims 17-19, wherein the indication information of the second TLV comprises second indication information for indicating a location of a segment identification corresponding prefix of the third node;
generating, by the processor, a second TLV according to the identification information included in the fourth element, including:
and generating second indication information of a second TLV according to the position of the prefix of the SID corresponding to the identifier included in the fourth element.
21. The method of claim 20, wherein the generating second indication information for a second TLV according to a location included in the fourth element that identifies a corresponding prefix comprises:
a prefix corresponding to the identifier included in the fourth element is in a segment list of the first packet, and the second indication information is a third preset value;
and in the destination address of the first packet, the prefix corresponding to the identifier included in the fourth element is a fourth preset value.
22. The method according to any of claims 15-21, wherein the second TLV further comprises a third indication information indicating a position of the fourth element in the segment list;
and generating the third indication information according to the position of the fourth element in the segment list.
23. The method according to any of claims 15-22, wherein the one or more TLVs are in a one-to-one correspondence with the one or more elements.
24. The method of any of claims 15-23, wherein the segment list is located in a SRv segment extended routing header (SRH) of the first packet, and wherein the second TLV is located in the SRH of the first packet.
25. The method of any one of claims 15 to 24, wherein the segment list comprises one or more elements, each of the one or more elements having a length of 128 bits.
26. A network device comprising means to perform the method of any of claims 1 to 14.
27. A network device comprising means to perform the method of any of claims 15 to 25.
28. A network device comprising a processor, a transceiver, and a memory; the memory is configured to store instructions, the processor is configured to execute the instructions, and the transceiver is configured to communicate with other devices under control of the processor; wherein the processor, when executing the instructions, performs the method of any of claims 1 to 14 above.
29. A network device comprising a processor, a transceiver, and a memory; the memory is configured to store instructions, the processor is configured to execute the instructions, and the transceiver is configured to communicate with other devices under control of the processor; wherein the processor, when executing the instructions, performs the method of any of claims 15 to 25 above.
30. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method of any one of claims 1 to 14.
31. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method according to any one of claims 15 to 25.
CN202110865850.8A 2021-07-29 2021-07-29 Data transmission method, related equipment and computer storage medium Pending CN115701054A (en)

Priority Applications (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
PCT/CN2022/108376 WO2023006002A1 (en) 2021-07-29 2022-07-27 Data transmission method, related device, and computer storage medium

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN115701054A true CN115701054A (en) 2023-02-07

Family

ID=85087490

Family Applications (1)

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

Country Status (2)

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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112995029B (en) * 2018-06-30 2024-03-19 华为技术有限公司 Transmission path fault processing method, device and system
US11412071B2 (en) * 2019-05-13 2022-08-09 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

Also Published As

Publication number Publication date
WO2023006002A1 (en) 2023-02-02

Similar Documents

Publication Publication Date Title
US11245620B2 (en) Method for forwarding packet and network device
CN111917640B (en) SRv6 network segment list generation method, message forwarding method, device and system
JP7481436B2 (en) Method, device and system for forwarding packets in a SR network
CN111385209B (en) Message processing method, message forwarding method, device and equipment
CN113556284B (en) Data packet processing method and device
US20200389391A1 (en) Packet processing method and apparatus
JP7403635B2 (en) METHODS, APPARATUS AND SYSTEM FOR FORWARDING PACKETS IN SR NETWORK
CN110401599A (en) The processing method and processing device of data packet, storage medium, electronic device
EP3972207B1 (en) Message processing method, device, and computer storage medium
CN113098770B (en) Message sending method, route table item generating method, device and storage medium
CN112583711A (en) Message processing method and device
CN112448888A (en) Method, equipment and system for forwarding message in SR network
EP4099648A1 (en) Method for processing segment id, and apparatus
CN114844828A (en) Method, device and system for sending message
CN113472718A (en) Service processing method, device, equipment and storage medium
CN115701054A (en) Data transmission method, related equipment and computer storage medium
CN113542126B (en) Generalized SRv6 full-path compression method and device
JP2024506089A (en) Packet forwarding methods, devices, and systems
CN114697254A (en) Message processing method and related device
CN114666259A (en) Message transmission method, device, equipment, storage medium and system
CN112565044A (en) Message processing method and device
WO2022267969A1 (en) Information transmission method and related device
CN116074395A (en) Message sending method and device
CN114726754A (en) Message transmission method, device and system
CN115811493A (en) Information transmission method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication