[go: up one dir, main page]

WO2020010999A1 - Method and apparatus for obtaining information of forwarding path of data packet in segment routing - Google Patents

Method and apparatus for obtaining information of forwarding path of data packet in segment routing Download PDF

Info

Publication number
WO2020010999A1
WO2020010999A1 PCT/CN2019/092446 CN2019092446W WO2020010999A1 WO 2020010999 A1 WO2020010999 A1 WO 2020010999A1 CN 2019092446 W CN2019092446 W CN 2019092446W WO 2020010999 A1 WO2020010999 A1 WO 2020010999A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
list
path
value
ending
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.)
Ceased
Application number
PCT/CN2019/092446
Other languages
French (fr)
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 EP19834260.2A priority Critical patent/EP3806406B1/en
Publication of WO2020010999A1 publication Critical patent/WO2020010999A1/en
Anticipated expiration legal-status Critical
Priority to US17/145,564 priority patent/US11677657B2/en
Ceased 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
    • H04L45/12Shortest path evaluation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/34Source routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/04Interdomain routing, e.g. hierarchical routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/128Shortest path evaluation for finding disjoint paths
    • H04L45/1287Shortest path evaluation for finding disjoint paths with disjoint nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC

Definitions

  • This application relates to the field of communications, and more specifically, to a method and apparatus for obtaining information about a forwarding path of a data packet in segment routing (SR).
  • SR segment routing
  • SR is a source routing mechanism. If the SR tunnel is long, such as segment routing (Internet protocol versioning (SRv6)) deployed on the Internet Protocol data plane in the sixth version, then the length of the identification (ID) list used to indicate the path the data packet passes through It will be long. A too long ID list will reduce the transmission efficiency of the data packets, and ultimately reduce the performance of the communication network.
  • segment routing Internet protocol versioning (SRv6)
  • ID identification
  • the application provides a method and a device for obtaining information of a forwarding path of a data packet in segment routing, which is beneficial to reducing the length of an identification list used to indicate a path that a data packet passes through, thereby improving transmission efficiency of a data packet, and ultimately improving a communication network. Performance.
  • the present application provides a method for obtaining information about a forwarding path of a data packet in a segment route.
  • the method includes: obtaining initial information of a forwarding path of a data packet, where the initial information includes multiple path identifiers;
  • the initial information generates target information of a forwarding path of the data packet, the target path information includes one or more node segment identifiers, and at least one node segment identifier in the target information corresponds to a plurality of the initial information.
  • Path identifier the first path indicated by the multiple path identifiers in the initial information corresponding to the node segment identifier in the target information is the start node of the first path in the segment route to the first
  • the only shortest path between the end nodes of a path, and each node segment identifier in the target information corresponding to multiple path identifiers in the initial information is indicated by all path identifiers corresponding to each node segment identifier Node segment ID of the end node of the path.
  • the first path indicated by the multiple path identifiers in the initial information is the only shortest path between the start node of the first path and the end node of the first path
  • the first path may be used.
  • the node segment ID (SID) of the end node is used to replace the multiple path identifiers to indicate the first path, so that the number of path identifiers can be reduced, thereby improving the transmission efficiency of data packets, and ultimately improving the communication network. performance.
  • reducing the number of path identifiers can also reduce the number of times that the ingress node that forwards the data packet inserts the path identifier, thereby improving the processing performance of the ingress node, and then improving the performance of the communication network.
  • the generating target information of a forwarding path of the data packet according to the initial information includes: Step 1: obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, i has a value of 1 and j has a value of the length of the node list Value, go to step two; step two, determine whether the start node and the end node are the same node; if so, end execution, otherwise go to step three; step three, determine the start node and the end Whether the node is an adjacent node in the node list; if so, step 4 is performed, otherwise step 5 is performed; step 4 is to record in the target information the adjacent segment between the starting node and the ending node Indicates that the value of i is updated to be equal to the value of j, and then, the value of j is updated to be equal
  • step 6 If yes, go to step 6; otherwise, go to step 7;
  • the node segment identifier of the ending node is recorded in the target information, the value of i is updated to be equal to the value of j, and then, the value of j is updated to be equal to the length value of the node list, and then the node list is updated.
  • the i-th node in the node is used as the starting node, the j-th node in the node list is used as the ending node, and step 2 is performed again; in step 7, the value of j is updated to j-1, and The j-th node in the node list is used as the ending node, and step 2 is performed again.
  • the generating target information of the forwarding path of the data packet according to the initial information includes: Step 1: obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, i has a value of 1 and j has a value of the length of the node list Value, go to step two; step two, determine whether the start node and the end node are the same node; if so, end the execution, otherwise go to step three; step three, determine that the node list starts from the Whether the path indicated when all nodes between the start node and the end node are arranged in order is the only shortest path between the start node and the end node in the segment route, and if so, step four is performed.
  • step 5 is performed; step 4 is to record the node segment identifier of the end node in the target information, the value of i is updated to be equal to the value of j, and then, the value of j is updated to be equal to The lengths of the node lists are equal, then the i-th node in the node list is used as the starting node, the j-th node in the node list is used as the ending node, and step 2 is performed again; In step five, the value of j is updated to j-1, the jth node in the node list is used as the ending node, and step two is performed again.
  • the generating target information of the forwarding path of the data packet according to the initial information includes: Step 1: obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, setting the temporary ending node to be an empty node, the value of i is 1, and the value of j is If i + 1, go to step two; step two, determine whether the ending node is the last node in the node list; if so, go to step ten; otherwise, go to step three; step three, determine the node list Whether the path indicated by all the nodes from the start node to the end node in order is the only shortest path between the start node and the end node in the segment route, and if so, then Perform step four, otherwise perform step five; step four, update the temporary end node to the end node, update the value of j to
  • step 2 the node segment identifier of the temporary end node is recorded in the target information, and the value of i is updated to be equal to j-1. After that, the value of j is updated.
  • Step 10 determine whether the starting node is the penultimate node in the node list, if not, perform Step 11; otherwise, perform Step 12; Step 11: record in the target information The node segment identifier corresponding to the ending node and the execution is terminated; step twelve, recording in the target information an adjacent segment identifier for indicating a path between the starting node and the ending node, and ending the execution .
  • the generating target information of the forwarding path of the data packet according to the initial information includes: Step 1: obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, setting the temporary ending node to be an empty node, the value of i is 1, and the value of j is If i + 1, go to step two; step two, determine whether the ending node is the last node in the node list; if so, go to step eight, otherwise go to step three; step three, determine the node list Whether the path indicated by all the nodes from the start node to the end node in order is the only shortest path between the start node and the end node in the segment route, and if so, then Perform step four, otherwise perform step five; step four, update the temporary end node to the end node, update the value of j to j
  • the value of i is updated to be equal to j-1. After that, the value of j is updated to j.
  • the i-th node in the node list is used as the starting node, and the node is The j-th node in the list is used as the ending node, and the temporary ending node is left blank, and step 2 is performed again; step 7 is recorded in the target information for indicating the starting node to the ending node.
  • the value of i is updated to be equal to the value of j. After that, the value of j is updated to j + 1, and the i-th node in the node list is used as the starting point.
  • Step eight determining whether the starting node is the penultimate node in the node list, if not , Go to step nine, no Step 10 is performed;
  • Step 9 is to record the node segment identifier of the ending node in the target information and the execution is terminated;
  • Step 10 is to record the instruction for instructing the starting node to all the nodes in the target information. The identification of the adjacent segment of the path between the end nodes is described, and the execution ends.
  • the initial information is an adjacent segment identifier list, that is, the path identifier in the initial information is an adjacent segment identifier.
  • the method is executed by an ingress node of a forwarding path of a data packet.
  • the method further includes: sending a data packet according to the target information, and the data includes the target information.
  • the method further includes: the controller sends target information to an ingress node of a forwarding path of the data packet, In order to facilitate the ingress node to send a data packet including the target information according to the target information.
  • an apparatus for obtaining information about a forwarding path of a data packet in a segment route includes a module for executing the method in the first aspect or any one of the possible implementation manners of the first aspect.
  • a device for obtaining information about a forwarding path of a data packet in a segment route includes a processor, and the processor is configured to execute a program.
  • the processor executes the program, the first aspect or the first aspect is implemented.
  • the device may further include a memory.
  • the memory is used to store programs executed by the processor.
  • the apparatus may further include a receiver.
  • the receiver is used to receive information from other equipment or devices.
  • the apparatus may further include a transmitter. Used to send information to other devices or devices.
  • An example of the device is a network node or a network controller.
  • a computer-readable storage medium stores program code for execution by a communication device or a communication device, and the program code includes a method for implementing the first aspect or any one of the first aspect Instructions for possible implementations of methods.
  • a chip is provided.
  • the chip includes a processor and a communication interface.
  • the communication interface is used to travel with external devices.
  • the processor is used to implement the first aspect or any possible implementation manner of the first aspect. Methods.
  • the chip may further include a memory, and the memory stores instructions.
  • the processor is configured to execute the instructions stored in the memory.
  • the processor is configured to implement the first aspect or any one of the first aspect. Methods in possible implementations.
  • the chip may be integrated on a network node or a network controller.
  • an embodiment of the present application provides a computer program product containing instructions, which when executed on a computer, causes the computer to execute the method described in the first aspect.
  • FIG. 1 is a schematic architecture diagram of a communication system to which the methods and devices of the embodiments of the present application can be applied;
  • FIG. 2 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to an embodiment of the present application
  • FIG. 3 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to another embodiment of the present application
  • FIG. 4 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to another embodiment of the present application
  • FIG. 5 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to another embodiment of the present application
  • FIG. 6 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to another embodiment of the present application
  • FIG. 7 is an exemplary structural diagram of an apparatus for acquiring information about a forwarding path of a data packet according to an embodiment of the present application
  • FIG. 8 is an exemplary structural diagram of an apparatus for acquiring information about a forwarding path of a data packet according to another embodiment of the present application.
  • FIG. 1 A schematic architecture diagram of a communication system to which the methods and apparatuses of the embodiments of the present application can be applied is shown in FIG. 1. It should be understood that FIG. 1 is only an example.
  • the communication system to which the methods and devices of the embodiments of the present application can be applied may include the number of nodes and the connection relationship between the nodes.
  • the connection mode between the nodes may be Wired or wireless.
  • IPv6 Internet protocol
  • the nodes included in the communication system to which the methods and apparatuses of the embodiments of the present application can be applied for example, any one of node A, node B, node C, node D, node N, node O, node P, and node Z may be a router. Switch, or any network device capable of supporting SR.
  • the network controller can calculate the path that the data packet will take.
  • the path information of the path that the data packet passes through can be indicated by the IP address or SID of the nodes on the path.
  • a forwarding path of a data packet may be referred to as a tunnel of the data packet.
  • a collection of data packets can be called a data stream.
  • SR there are three types of SIDs: prefix-SID, node-SID, and adjacency-SID.
  • adjacency-SID (adj-SID) can be used to forward a data packet to a corresponding neighboring node through a designated link. Therefore, in the scenario where the SR-TE needs to implement data packet forwarding according to the specified path, the SIDs in the SID list (list) are all adj-SIDs.
  • the forwarding path of the data packet is A-> B-> C-> O-> P-> Z
  • the connection between node A and node B is adj-SID is 9101
  • adj-SID between node B and node C is 9105
  • adj-SID between node C and node O is 9107
  • adj-SID between node O and node P is 9103
  • node P When the adj-SID between the node and the node Z is 9105, the SID list of the data packet may include ⁇ 9101, 9105, 9107, 9103, 9105 ⁇ in order.
  • node A can obtain the above SID list and then send a data packet to node B according to 9101 in the SID list.
  • the data packet contains the SID list ⁇ 9105,9107 , 9103,9105 ⁇ ;
  • node B can send a data packet to node C according to 9105 in the SID list ⁇ 9105,9107,9103,9105 ⁇ , which includes the SID list ⁇ 9107,9103,9105 ⁇ ;
  • node C can send a data packet to node O according to the SID list ⁇ 9107,9103,9105 ⁇ , which includes the SID list ⁇ 9103,9105 ⁇ ;
  • node O can send a data packet to node P according to the SID list ⁇ 9103,9105 ⁇ , which includes the SID list ⁇ 9105 ⁇ ; after node P receives the data packet from no
  • the forwarding path identifier (or label) of the data packet is used as an example of the adjacent SID to introduce the process of forwarding the data packet according to the path information.
  • the information of the forwarding path of the data packet includes other path identifiers, the data packet forwarding process is similar.
  • the present application proposes a new method for obtaining the information of the forwarding path of the data packet in the SR.
  • FIG. 2 is a schematic flowchart of a method for acquiring information about a forwarding path of a data packet in an SR according to an embodiment of the present application. It should be understood that steps or operations of the communication method are shown in FIG. 2, but these steps or operations are merely examples, and the embodiments of the present application may also perform other operations or a modification of each operation in FIG. 2.
  • the restriction conditions it is calculated which nodes the path that the data packet passes through, and the identifiers of these nodes (such as the IP address of the node, the SID of the node, or other identifiers) are used as the path identifier to form the initial information of the forwarding path of the data packet.
  • the initial information composed of the identifiers of these nodes may indicate the forwarding path of the data packet.
  • the adj-SID between these nodes is used as the path identifier to form the initial information of the forwarding path of the data packet.
  • the initial information composed by the adj-SID between these nodes can indicate the forwarding path of the data packet.
  • SR-TE it is possible to calculate which nodes are included in the path that a data packet passes according to constraints such as bandwidth requirements or delay requirements.
  • the initial information may be an adj-ID list. Taking the path described in FIG. 1 as an example, the initial information may be ⁇ 9101, 9105, 9107, 9103, 9105 ⁇ .
  • the initial information may also be a list of IP addresses. Taking the path described in FIG. 1 as an example, the initial information may be ⁇ IP address A, IP address B, IP address C, IP address O, IP address P, IP address Z).
  • the initial information may be a SRv6SID list, and the SID in the list is an IPv6 address declared as a SID.
  • the initial information may be ⁇ A :: 12, B :: 23, C :: 34, O :: 45, P :: 56, Z :: 67 ⁇ .
  • the target information includes one or more node segment identifiers. At least one node segment identifier in the target information corresponds to multiple path identifiers in the initial information.
  • the initial information The first path indicated by the multiple path identifiers corresponding to the node segment identifier in the target information is the only shortest path between the start node of the first path in the segment route and the end node of the first path.
  • Each node segment identifier of a plurality of path identifiers in the initial information is a node segment identifier of an end node of the first path indicated by all path identifiers corresponding to each node segment identifier.
  • the path indicated by the target information is the same as the path indicated by the initial information.
  • a form of node segment identification is a label; in SRv6, a form of realization of a node segment identification is an IPv6 address declared as a SID.
  • the first path indicated by the multiple path identifiers in the initial information is the only shortest path between the start node of the first path and the end node of the first path
  • the first path may be used.
  • the node-SID of the end node is used instead of the multiple path identifiers to indicate the first path; otherwise, the adj-SID between the start node and the end node of the first path may be used to indicate the first path.
  • the node-SID of the end node of the first path and / or the adj-SID between the start node and the end node of the first path constitute the target information.
  • the initial SID list of the data packet includes ⁇ 9101,9105,9107,9103,9105 ⁇
  • the first two SIDs that is, the paths “A-> B-> C” jointly indicated by “9101” and “9105” are The only shortest path between node A and node C. Since "9101" and "9105" as a whole are the first SID in the initial SID list of the packet, the first SID in the destination SID list of the packet can be SID of node C.
  • the fourth SID in the target SID list of the data packet may be the SID of node Z.
  • the target information of the forwarding path of the data packet can be determined through multiple implementations according to the initial information of the forwarding path of the data packet.
  • FIG. 3 An implementation manner of determining target information of a forwarding path of a data packet according to initial information of the forwarding path of a data packet is shown in FIG. 3.
  • S301 Obtain a node list corresponding to a forwarding path of a data packet, use a first node in the node list as a starting node, use a last node in the node list as an ending node, and obtain an empty list as a temporary path information list.
  • S302. Determine whether the start node and the end node are the same node. If yes, perform S308; otherwise, perform S303.
  • S303 Determine whether the start node and the end node are adjacent nodes in the node list. If yes, perform S304; otherwise, perform S305.
  • S305 Determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the only shortest path between the start node and the end node in the SR. If yes, perform S306, otherwise Execute S307.
  • the node segment identifier corresponding to the ending node is added to the temporary path information list, the ending node is used as a new starting node, the last node in the node list is used as a new ending node, and S302 is performed again.
  • the initial information is an adj-SID list used to indicate the path that a data packet passes through.
  • the adj-SID list includes multiple adj-SIDs as an example, and a pseudo-code implementation for generating target information based on the initial information in this application is introduced. the way. Executing this pseudo code can implement the method shown in FIG. 3.
  • strict [] represents the node list corresponding to the path identified by the initial information
  • loose [] represents the temporary path information list
  • node represents the starting node
  • last represents the ending node
  • SPT (node, last) represents the starting point in the SR.
  • the shortest path from the start node to the end node, adj_sid (node, last) means get the adj-SID from node to last in the adj-SID list
  • loose.add (adj_sid (node, last)) means the adj-SID list
  • the adj-SID from node to last is added to loose
  • node_sid (node) means to get the node-SID of node.
  • the initial information of the data packet forwarding path includes ⁇ 9101, 9105, 9107, 9103, 9105 ⁇
  • the target information that can be obtained according to the method shown in FIG. 3 or the above pseudo code can include ⁇ SID of node C, 9107, SID of node Z ⁇ .
  • FIG. 4 Another implementation manner of determining target information of the forwarding path of the data packet according to the initial information of the forwarding path of the data packet is shown in FIG. 4.
  • S401 Obtain a node list corresponding to a forwarding path of a data packet, use a first node in the node list as a starting node, use a last node in the node list as an ending node, and obtain an empty list as a temporary path information list.
  • S402. Determine whether the start node and the end node are the same node. If yes, perform S406; otherwise, perform S403.
  • the initial information is an adj-SID list used to indicate the path that a data packet passes through.
  • the adj-SID list includes multiple adj-SIDs as an example, and a pseudo-code implementation for generating target information based on the initial information in this application is introduced. the way. Executing this pseudo code can implement the method shown in FIG. 4.
  • strict [] represents the node list corresponding to the path identified by the initial information
  • loose [] represents the temporary path information list
  • node represents the starting node
  • last represents the ending node
  • SPT (node, last) represents the starting point in the SR.
  • the shortest path from the start node to the end node, adj_sid (node, last) means get the adj-SID from node to last in the adj-SID list
  • loose.add (adj_sid (node, last)) means the adj-SID list
  • the adj-SID from node to last is added to loose
  • node_sid (node) means to get the node-SID of node.
  • the initial information of the data packet forwarding path includes ⁇ 9101, 9105, 9107, 9103, 9105 ⁇ .
  • the target information that can be obtained can include ⁇ SID of node C, SID of node O, SID of node Z ⁇ .
  • FIG. 5 Another implementation manner of determining target information of the forwarding path of the data packet according to the initial information of the forwarding path of the data packet is shown in FIG. 5.
  • step S504 the ending node is used as a temporary ending node, the first node after the ending node in the node list is used as a new ending node, and step S502 is performed.
  • S506. Determine whether the temporarily ending node is a neighboring node of the starting node. If so, execute S508, otherwise execute S509.
  • S510 Determine whether the starting node is the penultimate node in the node list. If not, execute S511, otherwise execute S512.
  • S512 Add an adjacent segment identifier used to indicate a path between the start node and the end node to the temporary path information, and execute S513.
  • the initial information is an adj-SID list used to indicate the path that a data packet passes through.
  • the adj-SID list includes multiple adj-SIDs as an example, and a pseudo-code implementation for generating target information based on the initial information in this application is introduced. the way. Executing this pseudo code can implement the method shown in FIG. 5.
  • the initial information of the data packet forwarding path includes ⁇ 9101, 9105, 9107, 9103, 9105 ⁇ .
  • the target information can include ⁇ SID of node C, 9107, SID of node Z ⁇ .
  • FIG. 6 Another implementation manner of determining target information of the forwarding path of the data packet according to the initial information of the forwarding path of the data packet is shown in FIG. 6.
  • S602. Determine whether the ending node is the last node in the node list, and if so, execute S608, otherwise execute S603.
  • step S604 the ending node is used as a temporary ending node, the first node after the ending node in the node list is used as a new ending node, and step S602 is performed.
  • S605 Determine whether the temporarily ending node is empty. If not, execute S606; otherwise, execute S607.
  • S608. Determine whether the starting node is the penultimate node in the node list. If not, execute S609, otherwise execute S610.
  • the initial information is an adj-SID list for indicating the path that the data packet passes through.
  • the adj-SID list includes multiple adj-SIDs as an example, and a pseudo-code implementation for generating target information based on the initial information in this application is introduced. the way. Executing this pseudo code can implement the method shown in FIG. 6.
  • the initial information of the forwarding path of the data packet includes ⁇ 9101, 9105, 9107, 9103, 9105 ⁇
  • the target information that can be obtained according to the method shown in FIG. 6 or the above pseudo code can include ⁇ SID of node C, SID of node O, SID of node Z ⁇ .
  • the use of the temporary path information list and / or the temporary end node in the methods shown in FIG. 5 and FIG. 6 is only an example, and the target information may also be obtained without using the temporary path information list and / or the temporary end node.
  • the methods in FIG. 2 to FIG. 6 may be executed by an ingress node of a path through which a data packet passes, or may be executed by a controller in a network.
  • the method in the embodiment of the present application may further include: the ingress node sends the data packet according to the target information, and the data packet includes Target information. If the methods in FIG. 2 to FIG. 6 are executed by a controller in a network, the method in the embodiment of the present application may further include: the controller sends target information to an ingress node of a path through which the data packet passes, Then the ingress node sends a data packet according to the target information, and the target information in the data packet.
  • the controller may be a path computing client (PCE), or another server running the algorithm.
  • the following uses "A-> B-> C-> O-> P-> Z" shown in FIG. 1 as the data packet forwarding path, and uses the method shown in FIG. 3 as an example to introduce the data obtained according to the method of the present application.
  • the process of sending data packets to target information It can be known from this process that forwarding the data packet according to the target information obtained by the method of the present application can reduce the length of the information of the forwarding path of the data packet between nodes, thereby improving communication efficiency.
  • node A obtains the initial information as the adj-ID list ⁇ 9101,9105,9107,9103,9105 ⁇ or the IP address list ⁇ IP addressA, IP addressB, IP addressC, IP addressO, IP addressP, IP address Z ⁇
  • the target information can be ⁇ C's Node-SID, CO's adj-SID, and Z's Node-SID ⁇ . Assuming that the Node-SID of C is 1003 and the Node-SID of Z is 1008, the target information is ⁇ 1003,9107,1008 ⁇ .
  • Node A can look up the forwarding table on node A to find out that the next hop is node B according to the Node-SID of C, and send a data packet to node B.
  • the data packet carries path information, which is ⁇ C's NodeID, CO's adj-ID and Z's Node ID ⁇ .
  • node B queries the forwarding table on node B, learns that the next hop is node C, and sends a data packet to node C.
  • the data packet carries path information.
  • the path information can be ⁇ C's NodeID, CO's adj-ID and Z's Node ID ⁇ , or ⁇ CO's adj-ID and Z's Node ID ⁇ .
  • node C After receiving the data packet from node B, node C queries the forwarding table of node C according to "adj-IDC of CO", finds the next hop is node O, and sends a data packet to node O.
  • the data packet includes path information.
  • the path information is ⁇ Z Node ID ⁇ .
  • node O After node O receives a data packet from node C, it queries the forwarding table on node O, determines that the next hop is node P, and sends a data packet to node P.
  • the data packet includes path information, and the path information is ⁇ Z's Node ID ⁇ .
  • node P After node P receives a data packet from node O, it queries the forwarding table on node P, determines that the next hop is node Z, and sends a data packet to node Z.
  • the initial information is a list of SRv6SIDs, and the SIDs in the list are IPv6 addresses declared as SIDs.
  • the initial information is ⁇ A :: 12, B :: 23, C :: 34, O :: 45, P :: 56 , Z :: 67 ⁇
  • the target information can be ⁇ C's NodeID, CO's adj-ID, and Z's Node ID ⁇ .
  • the target information can be ⁇ C :: 1, C :: 34, Z :: 1 ⁇ .
  • node A sends a data packet to node B according to C :: 1, the data packet includes path information, and the path information includes ⁇ C :: 1, C :: 34, Z :: 1 ⁇ .
  • the subsequent forwarding process follows the SRv6 forwarding process. For brevity, we will not repeat them here.
  • the methods in FIGS. 3 to 6 can make the target information use the corresponding node-SID to indicate all the path identifiers corresponding to the unique shortest path in the initial information, thereby minimizing the number of path identifiers in the target information. , That is, reduce the length of the target information.
  • the maximum length that the target information can be accepted may also be determined according to requirements, and then the target information is determined according to the maximum length.
  • the maximum length that the target information can be accepted can be determined by the maximum insertion capacity of the path identifier (or label) of the controller or the ingress node.
  • part of the path identifier in the initial information can be replaced by the corresponding node-SID in the target information, and the number of path identifiers in the target information is less than or equal to the maximum insertion capacity of the controller or the ingress node, it can be omitted. Then continue to detect whether the initial information has a path identifier, which can be indicated by the corresponding node-SID.
  • the method in the embodiment of the present application reduces the number of path identifiers indicating the forwarding path of the data packet, and also reduces the number of insertions of the controller or the ingress node, thereby improving the performance of the controller or the ingress node.
  • FIG. 7 is a schematic block diagram of an apparatus 700 for acquiring information about a forwarding path of a data packet according to an embodiment of the present application. It should be understood that the apparatus 700 is only an example.
  • the device in the embodiment of the present application may further include other modules or units, or include modules similar in function to each module in FIG. 7, or not all modules in FIG. 7.
  • the obtaining module 710 is configured to obtain initial information of a forwarding path of a data packet, where the initial information includes multiple path identifiers.
  • a generating module 720 is configured to generate target information of a forwarding path of the data packet according to the initial information, where the target path information includes one or more node segment identifiers, and at least one node segment identifier in the target information corresponds to Multiple path identifiers in the initial information, and the first path indicated by the multiple path identifiers in the initial information corresponding to the node segment identifier in the target information is the first path in the segment route
  • the only shortest path between the start node and the end node of the first path, and each node segment identifier in the target information corresponding to multiple path identifiers in the initial information is the each node segment identifier
  • the generating module is specifically configured to perform the following steps: Step 1. Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and use the node The j-th node in the list is used as the end node. The value of i is 1. The value of j is the length of the node list. Go to step 2. Step 2.
  • step 3 it is determined whether the starting node and the ending node are adjacent nodes in the node list, and if so, step 4 is performed, otherwise Perform step five; step four, record the identifier of the adjacent segment between the start node and the end node in the target information, update the value of i to be equal to the value of j, and then, the value of j Update to be equal to the length value of the node list, then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and restart Execution step Step two; Step five, determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the start node to the The only shortest path between the end nodes is described, if yes, step 6 is performed, otherwise step 7 is performed;
  • the generating module is specifically configured to perform the following steps: Step 1. Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and use the node The j-th node in the list is used as the end node. The value of i is 1. The value of j is the length of the node list. Go to step 2. Step 2.
  • step 3 it is judged whether the path indicated when all nodes in the node list from the starting node to the ending node are arranged in order Is the only shortest path between the start node and the end node in the segment route; if it is, step 4 is performed; otherwise, step 5 is performed; step 4 is recorded in the target information of the end node Node segment identifier.
  • the value of i is updated to be equal to the value of j.
  • the value of j is updated to be equal to the length of the node list, and the i-th node in the node list is used as the The starting node, using the jth node in the node list as the ending node, and performing step 2 again; step five, the value of j is updated to j-1, and the jth node in the node list is updated As the end node, perform step two again.
  • the generating module is specifically configured to perform the following steps: Step 1. Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and use the node The j-th node in the list is used as the end node, and the temporary end node is set to be an empty node. The value of i is 1 and the value of j is i + 1, and step two is performed.
  • Step two is to determine whether the end node is the The last node in the node list, if yes, go to step ten, otherwise go to step three; step three, judge that all nodes in the node list from the starting node to the ending node are arranged in order Whether the path is the only shortest path between the start node and the end node in the segment route, if yes, go to step four, otherwise go to step five; step four, update the temporary end node to all The end node is updated, the value of j is updated to j + 1, and then the jth node in the node list is used as the end node, and step 2 is performed again; step 5 is to determine the temporary end node Whether it is empty, if not, go to step 6, otherwise go to step 7; step 6, determine whether the temporary ending node is a neighboring node of the starting node; if so, go to step 8; otherwise, go to step 9; Step 7.
  • step 8 Record the identifier of the adjacent segment of the path between the starting node and the temporary ending node in the target information, the value of i is updated to be equal to j-1, and then the value of j is updated to j, Use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, leave the temporary ending node empty, and perform step two again; step nine Recorded in the target information The node segment identifier of the temporary ending node.
  • step 10 is determining whether the starting node is the second to last in the node list If not, perform step 11; otherwise, perform step 12; step 11: record the node segment identifier corresponding to the ending node in the target information and end execution; step 12: The target information records an adjacent segment identifier used to indicate a path between the start node and the end node, and ends execution.
  • the generating module is specifically configured to perform the following steps: generating target information of the forwarding path of the data packet according to the initial information includes: step one, obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, setting the temporary ending node to be an empty node, the value of i is 1, and the value of j is If i + 1, go to step two; step two, determine whether the ending node is the last node in the node list; if so, go to step eight, otherwise go to step three; step three, determine the node list Whether the path indicated by all the nodes from the start node to the end node in order is the only shortest path between the start node and the end node in the segment route, and if so, then Perform step four, otherwise perform step five; step four, update the temporary end node to the end node, update the value of j to j
  • the value of i is updated to be equal to j-1. After that, the value of j is updated to j.
  • the i-th node in the node list is used as the starting node.
  • the j-th node in the node list is used as the ending node, and the temporary ending node is left blank, and step 2 is performed again; step 7 is recorded in the target information for indicating the starting node to the ending.
  • the identifier of the adjacent segment of the path between the nodes the value of i is updated to be equal to the value of j, and then, the value of j is updated to j + 1, and the i-th node in the node list is used as the The starting node, using the jth node in the node list as the ending node, and performing step 2 again; step eight, determining whether the starting node is the penultimate node in the node list.
  • step 9 If not, go to step 9. Otherwise, perform step ten; step nine, record the node segment identifier of the ending node in the target information, and end the execution; step ten, record the instruction for instructing the starting node to all nodes in the target information. The identification of the adjacent segment of the path between the end nodes is described, and the execution ends.
  • the initial information is an adjacent segment identifier list
  • the path identifier in the initial information is an adjacent segment identifier
  • the apparatus 700 is an ingress node of a forwarding path of the data packet.
  • the device 700 further includes a sending module 730, configured to send a data packet according to the target information, where the data packet includes the target information.
  • the device 700 is a controller of the segment routing.
  • the apparatus 700 further includes a sending module 730, configured to send the target information to an ingress node of a forwarding path of the data packet.
  • the apparatus 700 may be configured to execute the steps of the methods described in FIG. 2 to FIG. 6. For brevity, details are not described herein again.
  • FIG. 8 is a schematic structural diagram of an apparatus for acquiring information about a forwarding path of a data packet according to another embodiment of the present application. It should be understood that the device 800 shown in FIG. 8 is merely an example, and the device in the embodiment of the present application may further include other modules or units, or include modules similar in function to each module in FIG. 8.
  • the apparatus 800 may include one or more processors 810, one or more memories 820, a receiver 830, and a transmitter 840.
  • the receiver 830 and the transmitter 840 may be integrated together and called a transceiver.
  • the memory 820 is configured to store a program code executed by the processor 810.
  • the processor 810 may be integrated with a memory 820, or the processor 810 is coupled to one or more memories 820, and is configured to fetch instructions in the memory 820.
  • the processor 810 may be used to implement operations or steps that can be implemented by the obtaining module 710 and the generating module 720 in FIG. 7, and the transmitter 840 may be used to implement operations or steps that can be implemented by the sending module 730 in FIG. 7.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the processor in the embodiment of the present application may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), and application-specific integrated circuits. (application specific integrated circuit, ASIC), ready-made programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially a part that contributes to the existing technology or a part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
  • the aforementioned storage media include: U disks, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks, and other media that can store program codes .

Landscapes

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

Abstract

The present application provides a method and apparatus for obtaining information of a forwarding path of a data packet in segment routing. In the method and apparatus, when a first path instructed by multiple path identifications in initial information is the unique shortest path between an initial node of the first path and an end node of the first path, a node-SID of the end node of the first path can be used for replacing the multiple path identifications to instruct the first path, so that the number of the path identifications can be reduced, and thus transmission efficiency of the data packet can be improved, and the performance of a communication network is finally improved.

Description

段路由中获取数据包的转发路径的信息的方法和装置Method and device for obtaining information of forwarding path of data packet in segment routing

本申请要求于2018年07月09日提交中国国家知识产权局、申请号为201810744644.X、申请名称为“段路由中获取数据包的转发路径的信息的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of a Chinese patent application submitted on July 9, 2018, with the State Intellectual Property Office of China, application number 201810744644.X, and application name "Method and Device for Obtaining Information on the Forwarding Path of Data Packets in Segment Routing" Rights, the entire contents of which are incorporated herein by reference.

技术领域Technical field

本申请涉及通信领域,并且更具体地,涉及段路由(segment routing,SR)中获取数据包的转发路径的信息的方法和装置。This application relates to the field of communications, and more specifically, to a method and apparatus for obtaining information about a forwarding path of a data packet in segment routing (SR).

背景技术Background technique

SR是一种源路由机制。如果SR隧道很长,例如部署在第六版本的互联网协议数据平面的段路由(internet protocol version segment routing,SRv6),那么用于指示数据包经过的路径的标识(Identification,ID)列表的长度就会很长。过长的ID列表会降低数据包的传输效率,最终降低通信网络的性能。SR is a source routing mechanism. If the SR tunnel is long, such as segment routing (Internet protocol versioning (SRv6)) deployed on the Internet Protocol data plane in the sixth version, then the length of the identification (ID) list used to indicate the path the data packet passes through It will be long. A too long ID list will reduce the transmission efficiency of the data packets, and ultimately reduce the performance of the communication network.

发明内容Summary of the invention

本申请提供段路由中获取数据包的转发路径的信息的方法和装置,有利于减少用于指示数据包经过的路径的标识列表的长度,从而有利于提高数据包的传输效率,最终提高通信网络的性能。The application provides a method and a device for obtaining information of a forwarding path of a data packet in segment routing, which is beneficial to reducing the length of an identification list used to indicate a path that a data packet passes through, thereby improving transmission efficiency of a data packet, and ultimately improving a communication network. Performance.

第一方面,本申请提供了一种段路由中获取数据包的转发路径的信息的方法,该方法包括:获取数据包的转发路径的初始信息,所述初始信息包括多个路径标识;根据所述初始信息生成所述数据包的转发路径的目标信息,所述目标路径信息包括一个或多个节点段标识,所述目标信息中至少有一个节点段标识对应于所述初始信息中的多个路径标识,所述初始信息中对应于所述目标信息中的节点段标识的多个路径标识所指示的第一路径为所述段路由中所述第一路径的起始节点至所述第一路径的结束节点之间唯一的最短路径,所述目标信息中对应于所述初始信息中的多个路径标识的每个节点段标识为所述每个节点段标识对应的所有路径标识所指示的路径的结束节点的节点段标识。In a first aspect, the present application provides a method for obtaining information about a forwarding path of a data packet in a segment route. The method includes: obtaining initial information of a forwarding path of a data packet, where the initial information includes multiple path identifiers; The initial information generates target information of a forwarding path of the data packet, the target path information includes one or more node segment identifiers, and at least one node segment identifier in the target information corresponds to a plurality of the initial information. Path identifier, the first path indicated by the multiple path identifiers in the initial information corresponding to the node segment identifier in the target information is the start node of the first path in the segment route to the first The only shortest path between the end nodes of a path, and each node segment identifier in the target information corresponding to multiple path identifiers in the initial information is indicated by all path identifiers corresponding to each node segment identifier Node segment ID of the end node of the path.

该方法中,当初始信息中的多个路径标识所指示的第一路径为该第一路径的起始节点与该第一路径的结束节点间的唯一最短路径时,可以用该第一路径的结束节点的节点(node)段标识(segment ID,SID)来替代这多个路径标识指示该第一路径,从而可以减少路径标识的数量,进而可以提高数据包的传输效率,最终提高通信网络的性能。In this method, when the first path indicated by the multiple path identifiers in the initial information is the only shortest path between the start node of the first path and the end node of the first path, the first path may be used. The node segment ID (SID) of the end node is used to replace the multiple path identifiers to indicate the first path, so that the number of path identifiers can be reduced, thereby improving the transmission efficiency of data packets, and ultimately improving the communication network. performance.

此外,减少路径标识的数量,还可以减少转发数据包的入节点插入路径标识的次数,从而提高入节点的处理性能,进而提高通信网络的性能。In addition, reducing the number of path identifiers can also reduce the number of times that the ingress node that forwards the data packet inserts the path identifier, thereby improving the processing performance of the ingress node, and then improving the performance of the communication network.

结合第一方面,在第一种可能的实现方式中,所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中的第j个节点作为结 束节点,i的取值为1,j的取值为所述节点列表的长度值,执行步骤二;步骤二,判断所述起始节点与所述结束节点是否是同一个节点,若是,则结束执行,否则执行步骤三;步骤三,判断所述起始节点与所述结束节点是否为所述节点列表中相邻的节点,若是,则执行步骤四,否则执行步骤五;步骤四,在所述目标信息中记录所述起始节点至所述结束节点之间的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;步骤五,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列时所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤六,否则执行步骤七;步骤六,在所述目标信息中记录所述结束节点的节点段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;步骤七,j的取值更新为j-1,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二。With reference to the first aspect, in a first possible implementation manner, the generating target information of a forwarding path of the data packet according to the initial information includes: Step 1: obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, i has a value of 1 and j has a value of the length of the node list Value, go to step two; step two, determine whether the start node and the end node are the same node; if so, end execution, otherwise go to step three; step three, determine the start node and the end Whether the node is an adjacent node in the node list; if so, step 4 is performed, otherwise step 5 is performed; step 4 is to record in the target information the adjacent segment between the starting node and the ending node Indicates that the value of i is updated to be equal to the value of j, and then, the value of j is updated to be equal to the length value of the node list, and then the i-th node in the node list is used as the start Section Point, use the jth node in the node list as the ending node, and perform step 2 again; step five, determine all nodes in the node list from the starting node to the ending node Whether the path indicated in the sequence is the only shortest path between the start node and the end node in the segment route. If yes, go to step 6; otherwise, go to step 7; The node segment identifier of the ending node is recorded in the target information, the value of i is updated to be equal to the value of j, and then, the value of j is updated to be equal to the length value of the node list, and then the node list is updated. The i-th node in the node is used as the starting node, the j-th node in the node list is used as the ending node, and step 2 is performed again; in step 7, the value of j is updated to j-1, and The j-th node in the node list is used as the ending node, and step 2 is performed again.

结合第一方面,在第二种可能的实现方式中,所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中的第j个节点作为结束节点,i的取值为1,j的取值为所述节点列表的长度值,执行步骤二;步骤二,判断所述起始节点与所述结束节点是否是同一个节点,若是,则结束执行,否则执行步骤三;步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列时所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;步骤四,在所述目标信息中记录所述结束节点的节点段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;步骤五,j的取值更新为j-1,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二。With reference to the first aspect, in a second possible implementation manner, the generating target information of the forwarding path of the data packet according to the initial information includes: Step 1: obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, i has a value of 1 and j has a value of the length of the node list Value, go to step two; step two, determine whether the start node and the end node are the same node; if so, end the execution, otherwise go to step three; step three, determine that the node list starts from the Whether the path indicated when all nodes between the start node and the end node are arranged in order is the only shortest path between the start node and the end node in the segment route, and if so, step four is performed. Otherwise, step 5 is performed; step 4 is to record the node segment identifier of the end node in the target information, the value of i is updated to be equal to the value of j, and then, the value of j is updated to be equal to The lengths of the node lists are equal, then the i-th node in the node list is used as the starting node, the j-th node in the node list is used as the ending node, and step 2 is performed again; In step five, the value of j is updated to j-1, the jth node in the node list is used as the ending node, and step two is performed again.

结合第一方面,在第三种可能的实现方式中,所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中第j个节点作为结束节点,设置临时结束节点为空节点,i的取值为1,j的取值为i+1,执行步骤二;步骤二,判断所述结束节点是否是所述节点列表中的最后一个节点,若是,则执行步骤十,否则执行步骤三;步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;步骤四,将所述临时结束节点更新为所述结束节点,j的取值更新为j+1,再将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;步骤五,判断所述临时结束节点是否为空,若不是,则执行步骤六,否则执行步骤七;步骤六,判断所述临时结束节点是否为所述起始节点的相邻节点,若是,则执行步骤八,否则执行步骤九;步骤七,在所述目 标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为j+1,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;步骤八,在所述目标信息中记录所述起始节点至所述临时结束节点之间的路径的邻接段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;步骤九,在所述目标信息中记录所述临时结束节点的节点段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;步骤十,判断所述起始节点是否为所述节点列表中的倒数第二个节点,若不是,则执行步骤十一,否则执行步骤十二;步骤十一,在所述目标信息中记录所述结束节点对应的节点段标识,并结束执行;步骤十二,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,并结束执行。With reference to the first aspect, in a third possible implementation manner, the generating target information of the forwarding path of the data packet according to the initial information includes: Step 1: obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, setting the temporary ending node to be an empty node, the value of i is 1, and the value of j is If i + 1, go to step two; step two, determine whether the ending node is the last node in the node list; if so, go to step ten; otherwise, go to step three; step three, determine the node list Whether the path indicated by all the nodes from the start node to the end node in order is the only shortest path between the start node and the end node in the segment route, and if so, then Perform step four, otherwise perform step five; step four, update the temporary end node to the end node, update the value of j to j + 1, and use the jth node in the node list as The end node, and perform step two again; step five, determine whether the temporary end node is empty, if not, perform step six, otherwise perform step seven; step six, determine whether the temporary end node is the If it is a neighboring node of the starting node, go to step 8; otherwise, go to step 9; Step 7: record in the target information an adjacent segment indicating the path between the starting node and the ending node Indicates that the value of i is updated to be equal to the value of j, and then the value of j is updated to j + 1, and then the i-th node in the node list is used as the starting node, and the node is The j-th node in the list is used as the end node, and step 2 is performed again; step 8: record the adjacent segment identifier of the path between the start node and the temporary end node in the target information, i of The value is updated to be equal to j-1. After that, the value of j is updated to j. The i-th node in the node list is used as the starting node, and the j-th node in the node list is used as the End node, place the pro The end node is left blank, and step 2 is performed again. In step 9, the node segment identifier of the temporary end node is recorded in the target information, and the value of i is updated to be equal to j-1. After that, the value of j is updated. Is j, the i-th node in the node list is used as the starting node, the j-th node in the node list is used as the ending node, the temporary ending node is left blank, and step 2 is performed again Step 10: determine whether the starting node is the penultimate node in the node list, if not, perform Step 11; otherwise, perform Step 12; Step 11: record in the target information The node segment identifier corresponding to the ending node and the execution is terminated; step twelve, recording in the target information an adjacent segment identifier for indicating a path between the starting node and the ending node, and ending the execution .

结合第一方面,在第四种可能的实现方式中,所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中第j个节点作为结束节点,设置临时结束节点为空节点,i的取值为1,j的取值为i+1,执行步骤二;步骤二,判断所述结束节点是否是所述节点列表中的最后一个节点,若是,则执行步骤八,否则执行步骤三;步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;步骤四,将所述临时结束节点更新为所述结束节点,j的取值更新为j+1,再将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;步骤五,判断所述临时结束节点是否为空,若不是,则执行步骤六,否则执行步骤七;步骤六,在所述目标信息中记录所述临时结束节点的节点段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;步骤七,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为j+1,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;步骤八,判断所述起始节点是否为所述节点列表中的倒数第二个节点,若不是,则执行步骤九,否则执行步骤十;步骤九,在所述目标信息中记录所述结束节点的节点段标识,并结束执行;步骤十,在所述目标信息中记录所述用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,并结束执行。With reference to the first aspect, in a fourth possible implementation manner, the generating target information of the forwarding path of the data packet according to the initial information includes: Step 1: obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, setting the temporary ending node to be an empty node, the value of i is 1, and the value of j is If i + 1, go to step two; step two, determine whether the ending node is the last node in the node list; if so, go to step eight, otherwise go to step three; step three, determine the node list Whether the path indicated by all the nodes from the start node to the end node in order is the only shortest path between the start node and the end node in the segment route, and if so, then Perform step four, otherwise perform step five; step four, update the temporary end node to the end node, update the value of j to j + 1, and use the jth node in the node list as The end node, and perform step two again; step five, determine whether the temporary end node is empty, if not, perform step six, otherwise perform step seven; step six, record the temporary node in the target information The node segment identifier of the ending node. The value of i is updated to be equal to j-1. After that, the value of j is updated to j. The i-th node in the node list is used as the starting node, and the node is The j-th node in the list is used as the ending node, and the temporary ending node is left blank, and step 2 is performed again; step 7 is recorded in the target information for indicating the starting node to the ending node. The identifier of the adjacent segment of the path. The value of i is updated to be equal to the value of j. After that, the value of j is updated to j + 1, and the i-th node in the node list is used as the starting point. The starting node, using the jth node in the node list as the ending node, and performing step two again; step eight, determining whether the starting node is the penultimate node in the node list, if not , Go to step nine, no Step 10 is performed; Step 9 is to record the node segment identifier of the ending node in the target information and the execution is terminated; Step 10 is to record the instruction for instructing the starting node to all the nodes in the target information. The identification of the adjacent segment of the path between the end nodes is described, and the execution ends.

结合第一方面或第一种至第四种任意一种可能的实现方式,在第五种可能的实现方式中,初始信息为邻接段标识列表,即初始信息中的路径标识为邻接段标识。With reference to the first aspect or any one of the first to fourth possible implementation manners, in a fifth possible implementation manner, the initial information is an adjacent segment identifier list, that is, the path identifier in the initial information is an adjacent segment identifier.

结合第一方面或第一种至第五种任意一种可能的实现方式,在第六种可能的实现方式中,该方法由数据包的转发路径的入节点执行。With reference to the first aspect or any one of the first to fifth possible implementation manners, in a sixth possible implementation manner, the method is executed by an ingress node of a forwarding path of a data packet.

其中,该方法还包括:根据目标信息发送数据包,该数据包括中包括目标信息。The method further includes: sending a data packet according to the target information, and the data includes the target information.

结合第一方面或第一种至第五种任意一种可能的实现方式,在第七种可能的实现方式中,该方法还包括:控制器向数据包的转发路径的入节点发送目标信息,以便于该入节点根据目标信息发送包括该目标信息的数据包。With reference to the first aspect or any one of the first to fifth possible implementation manners, in a seventh possible implementation manner, the method further includes: the controller sends target information to an ingress node of a forwarding path of the data packet, In order to facilitate the ingress node to send a data packet including the target information according to the target information.

第二方面,提供了一种段路由中获取数据包的转发路径的信息的装置,该装置包括用于执行第一方面或第一方面的任意一种可能的实现方式中的方法的模块。In a second aspect, an apparatus for obtaining information about a forwarding path of a data packet in a segment route is provided, and the apparatus includes a module for executing the method in the first aspect or any one of the possible implementation manners of the first aspect.

第三方面,提供了一种段路由中获取数据包的转发路径的信息的装置,该装置包括处理器,处理器用于执行程序,当处理器执行程序时,实现第一方面或第一方面的任意一种可能的实现方式中的方法。According to a third aspect, a device for obtaining information about a forwarding path of a data packet in a segment route is provided. The device includes a processor, and the processor is configured to execute a program. When the processor executes the program, the first aspect or the first aspect is implemented. Method in any possible implementation.

可选地,该装置还可以包括存储器。存储器用于存储处理器执行的程序。Optionally, the device may further include a memory. The memory is used to store programs executed by the processor.

可选地,该装置还可以包括接收器。接收器用于从其他设备或装置接收信息。Optionally, the apparatus may further include a receiver. The receiver is used to receive information from other equipment or devices.

可选地,该装置还可以包括发送器。用于向其他设备或装置发送信息。Optionally, the apparatus may further include a transmitter. Used to send information to other devices or devices.

该装置的一种示例为网络节点或网络控制器。An example of the device is a network node or a network controller.

第四方面,提供一种计算机可读存储介质,该计算机可读存储介质存储用于通信装置或通信设备执行的程序代码,该程序代码包括用于实现第一方面或第一方面的任意一种可能的实现方式中的方法的指令。According to a fourth aspect, a computer-readable storage medium is provided, where the computer-readable storage medium stores program code for execution by a communication device or a communication device, and the program code includes a method for implementing the first aspect or any one of the first aspect Instructions for possible implementations of methods.

第五方面,提供一种芯片,该芯片包括处理器和通信接口,该通信接口用于与外部器件进行同行,该处理器用于实现第一方面或第一方面的任意一种可能的实现方式中的方法。According to a fifth aspect, a chip is provided. The chip includes a processor and a communication interface. The communication interface is used to travel with external devices. The processor is used to implement the first aspect or any possible implementation manner of the first aspect. Methods.

可选地,该芯片还可以包括存储器,该存储器中存储有指令,处理器用于执行存储器中存储的指令,当该指令被执行时,处理器用于实现第一方面或第一方面的任意一种可能的实现方式中的方法。Optionally, the chip may further include a memory, and the memory stores instructions. The processor is configured to execute the instructions stored in the memory. When the instructions are executed, the processor is configured to implement the first aspect or any one of the first aspect. Methods in possible implementations.

可选地,该芯片可以集成在网络节点或网络控制器上。Alternatively, the chip may be integrated on a network node or a network controller.

第六方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行第一方面所述的方法。In a sixth aspect, an embodiment of the present application provides a computer program product containing instructions, which when executed on a computer, causes the computer to execute the method described in the first aspect.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是可以应用本申请实施例的方法和装置的通信系统的示意性架构图;FIG. 1 is a schematic architecture diagram of a communication system to which the methods and devices of the embodiments of the present application can be applied;

图2是本申请一个实施例的获取数据包的转发路径的信息的方法的示例性流程图;2 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to an embodiment of the present application;

图3是本申请另一个实施例的获取数据包的转发路径的信息的方法的示例性流程图;3 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to another embodiment of the present application;

图4是本申请另一个实施例的获取数据包的转发路径的信息的方法的示例性流程图;4 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to another embodiment of the present application;

图5是本申请另一个实施例的获取数据包的转发路径的信息的方法的示例性流程图;5 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to another embodiment of the present application;

图6是本申请另一个实施例的获取数据包的转发路径的信息的方法的示例性流程图;6 is an exemplary flowchart of a method for obtaining information about a forwarding path of a data packet according to another embodiment of the present application;

图7是本申请一个实施例的获取数据包的转发路径的信息的装置的示例性结构图;7 is an exemplary structural diagram of an apparatus for acquiring information about a forwarding path of a data packet according to an embodiment of the present application;

图8是本申请另一个实施例的获取数据包的转发路径的信息的装置的示例性结构 图。FIG. 8 is an exemplary structural diagram of an apparatus for acquiring information about a forwarding path of a data packet according to another embodiment of the present application.

具体实施方式detailed description

下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in this application will be described below with reference to the drawings.

可以应用本申请实施例的方法和装置的通信系统的示意性架构图如图1所示。应理解,图1仅是一种示例,可以应用本申请实施例的方法和装置的通信系统中可以包括节点的数量以及节点之间的连接关系可以不限于此,节点之间的连接方式可以是有线的,也可以是无线的。A schematic architecture diagram of a communication system to which the methods and apparatuses of the embodiments of the present application can be applied is shown in FIG. 1. It should be understood that FIG. 1 is only an example. The communication system to which the methods and devices of the embodiments of the present application can be applied may include the number of nodes and the connection relationship between the nodes. The connection mode between the nodes may be Wired or wireless.

图1所示的通信系统中可以应用多协议标签交换(multiprotocol label switching,MPLS)数据平面,也可以应用第六版本的互联网协议(internet protocol,IP),简称IPv6。In the communication system shown in FIG. 1, a multiprotocol label switching (MPLS) data plane can be applied, and a sixth version of an Internet protocol (IP), which is referred to as IPv6, can also be applied.

可以应用本申请实施例的方法和装置的通信系统中包括的节点,例如节点A、节点B、节点C、节点D、节点N、节点O、节点P和节点Z中的任意一个可以是路由器,交换机,或者能够支持SR的任意网络设备。The nodes included in the communication system to which the methods and apparatuses of the embodiments of the present application can be applied, for example, any one of node A, node B, node C, node D, node N, node O, node P, and node Z may be a router. Switch, or any network device capable of supporting SR.

在如图1所示的网络结构中,网络控制器可以计算出数据包所要经过的路径。该数据包所要经过路径的路径信息可以通过路径上的节点的IP地址或SID等来指示。In the network structure shown in Figure 1, the network controller can calculate the path that the data packet will take. The path information of the path that the data packet passes through can be indicated by the IP address or SID of the nodes on the path.

应理解,本申请中,数据包的转发路径可以称为数据包的隧道。数据包组成的集合可以称为数据流。It should be understood that, in this application, a forwarding path of a data packet may be referred to as a tunnel of the data packet. A collection of data packets can be called a data stream.

SR中,主要有三种SID,分别为前缀(prefix)-SID、节点(node)-SID和邻接(adjacency)-SID。In SR, there are three types of SIDs: prefix-SID, node-SID, and adjacency-SID.

其中,adjacency-SID(adj-SID)可以用于将数据包通过指定的链路来转发到对应的邻节点。因此,在SR-TE中需要实现按照指定的路径转发数据包的场景下,SID列表(list)中的SID均为adj-SID。Among them, adjacency-SID (adj-SID) can be used to forward a data packet to a corresponding neighboring node through a designated link. Therefore, in the scenario where the SR-TE needs to implement data packet forwarding according to the specified path, the SIDs in the SID list (list) are all adj-SIDs.

例如,图1所示的网络结构中,以MPLS为例,若为数据包的转发路径为A->B->C->O->P->Z,且节点A与节点B之间的adj-SID为9101,节点B与节点C之间的adj-SID为9105,节点C与节点O之间的adj-SID为9107,节点O与节点P之间的adj-SID为9103,节点P与节点Z之间的adj-SID为9105时,数据包的SID列表中可以依次包括{9101,9105,9107,9103,9105}。For example, in the network structure shown in FIG. 1, taking MPLS as an example, if the forwarding path of the data packet is A-> B-> C-> O-> P-> Z, and the connection between node A and node B is adj-SID is 9101, adj-SID between node B and node C is 9105, adj-SID between node C and node O is 9107, adj-SID between node O and node P is 9103, node P When the adj-SID between the node and the node Z is 9105, the SID list of the data packet may include {9101, 9105, 9107, 9103, 9105} in order.

节点A作为数据包的转发路径的入节点(ingress node),获取到上述SID列表后,可以根据该SID列表中的9101向节点B发送数据包,所述数据包中包含SID列表{9105,9107,9103,9105};节点B接收到节点A发来的数据包后,可以根据SID列表{9105,9107,9103,9105}中的9105向节点C发送数据包,该数据包中包括SID列表{9107,9103,9105};节点C接收到节点B发送的数据包后,可以根据SID列表{9107,9103,9105}向节点O发送数据包,该数据包中包括SID列表{9103,9105};节点O接收到节点C发送的数据包后,可以根据SID列表{9103,9105}向节点P发送数据包,该数据包中包括SID列表{9105};节点P从节点O接收到数据包后,可以根据SID列表{9105}向节点Z发送数据包。As the ingress node of the forwarding path of the data packet, node A can obtain the above SID list and then send a data packet to node B according to 9101 in the SID list. The data packet contains the SID list {9105,9107 , 9103,9105}; After receiving the data packet from node A, node B can send a data packet to node C according to 9105 in the SID list {9105,9107,9103,9105}, which includes the SID list { 9107,9103,9105}; after receiving the data packet sent by node B, node C can send a data packet to node O according to the SID list {9107,9103,9105}, which includes the SID list {9103,9105}; After receiving the data packet sent by node C, node O can send a data packet to node P according to the SID list {9103,9105}, which includes the SID list {9105}; after node P receives the data packet from node O, A data packet can be sent to node Z according to the SID list {9105}.

上述仅是以数据包的转发路径的信息为邻接SID列表,即以数据包的转发路径标识(或标签)为邻接SID为示例来介绍根据路径信息转发数据包的过程。数据包的转发路径的信息包括其他路径标识时,数据包的转发过程类似。The above only uses the information of the forwarding path of the data packet as the adjacent SID list, that is, the forwarding path identifier (or label) of the data packet is used as an example of the adjacent SID to introduce the process of forwarding the data packet according to the path information. When the information of the forwarding path of the data packet includes other path identifiers, the data packet forwarding process is similar.

由上述过程可以看出,如果网络规模很大,SR-隧道很长,那么数据包的转发路径的信息(例如SID列表)就会很长。过长的路径信息会降低节点间的传输效率,从而影响网络的传输性能。It can be seen from the above process that if the network size is large and the SR-tunnel is long, then the information of the forwarding path of the data packet (such as the SID list) will be very long. Too long path information will reduce the transmission efficiency between nodes and affect the transmission performance of the network.

为了减少数据包的转发路径的信息的长度,以提高节点间的传输效率,从而提高网络的传输性能,本申请提出了SR中获取数据包的转发路径的信息的新方法。In order to reduce the length of the information of the forwarding path of the data packet, in order to improve the transmission efficiency between nodes, and thereby improve the transmission performance of the network, the present application proposes a new method for obtaining the information of the forwarding path of the data packet in the SR.

图2为本申请一个实施例的SR中获取数据包的转发路径的信息的方法的示意性流程图。应理解,图2示出了该通信方法的步骤或操作,但这些步骤或操作仅是示例,本申请实施例还可以执行其他操作或者图2中的各个操作的变形。FIG. 2 is a schematic flowchart of a method for acquiring information about a forwarding path of a data packet in an SR according to an embodiment of the present application. It should be understood that steps or operations of the communication method are shown in FIG. 2, but these steps or operations are merely examples, and the embodiments of the present application may also perform other operations or a modification of each operation in FIG. 2.

S201,获取数据包的转发路径的初始信息,该初始信息包括多个路径标识。S201. Acquire initial information of a forwarding path of a data packet, where the initial information includes multiple path identifiers.

例如,根据限制条件,计算出数据包所要经过的路径包括哪些节点,这些节点的标识(例如节点的IP地址、节点的SID或其他标识)作为路径标识从而组成数据包的转发路径的初始信息。或者说,这些节点的标识共同组成的初始信息可以指示数据包的转发路径。For example, according to the restriction conditions, it is calculated which nodes the path that the data packet passes through, and the identifiers of these nodes (such as the IP address of the node, the SID of the node, or other identifiers) are used as the path identifier to form the initial information of the forwarding path of the data packet. In other words, the initial information composed of the identifiers of these nodes may indicate the forwarding path of the data packet.

又如,根据限制条件,计算出数据包所要经过的路径包括哪些节点,这些节点之间的adj-SID作为路径标识从而组成数据包的转发路径的初始信息。或者说,这些节点间的adj-SID共同组成的初始信息可以指示数据包的转发路径。For another example, according to the constraint conditions, it is calculated which nodes the path that the data packet passes through, and the adj-SID between these nodes is used as the path identifier to form the initial information of the forwarding path of the data packet. In other words, the initial information composed by the adj-SID between these nodes can indicate the forwarding path of the data packet.

例如,在SR-TE中,可以根据带宽要求,或者时延要求等限制条件计算出数据包所要经过的路径包括哪些节点。For example, in SR-TE, it is possible to calculate which nodes are included in the path that a data packet passes according to constraints such as bandwidth requirements or delay requirements.

例如,在SR-MPLS中,初始信息可以是adj-ID列表。以图1中所述的路径为例,该初始信息可以是{9101,9105,9107,9103,9105}。For example, in SR-MPLS, the initial information may be an adj-ID list. Taking the path described in FIG. 1 as an example, the initial information may be {9101, 9105, 9107, 9103, 9105}.

在SR-MPLS中,初始信息也可以是IP地址(address)列表。以图1中所述的路径为例,该初始信息可以是{IP address A,IP address B,IP address C,IP address O,IP address P,IP address Z)。In SR-MPLS, the initial information may also be a list of IP addresses. Taking the path described in FIG. 1 as an example, the initial information may be {IP address A, IP address B, IP address C, IP address O, IP address P, IP address Z).

又如,在SRv6中,初始信息可以是SRv6SID列表,该列表中的SID是声明为SID的IPv6地址。以图1中所述的路径为例,该初始信息可以是{A::12,B::23,C::34,O::45,P::56,Z::67}。As another example, in SRv6, the initial information may be a SRv6SID list, and the SID in the list is an IPv6 address declared as a SID. Taking the path described in FIG. 1 as an example, the initial information may be {A :: 12, B :: 23, C :: 34, O :: 45, P :: 56, Z :: 67}.

S202,根据该初始信息生成该数据包的转发路径的目标信息,目标信息包括一个或多个节点段标识,目标信息中至少有一个节点段标识对应于初始信息中的多个路径标识,初始信息中对应于目标信息中的节点段标识的多个路径标识所指示的第一路径为段路由中第一路径的起始节点至第一路径的结束节点之间唯一的最短路径,目标信息中对应于初始信息中的多个路径标识的每个节点段标识为每个节点段标识对应的所有路径标识所指示的第一路径的结束节点的节点段标识。S202. Generate target information of the forwarding path of the data packet according to the initial information. The target information includes one or more node segment identifiers. At least one node segment identifier in the target information corresponds to multiple path identifiers in the initial information. The initial information The first path indicated by the multiple path identifiers corresponding to the node segment identifier in the target information is the only shortest path between the start node of the first path in the segment route and the end node of the first path. Each node segment identifier of a plurality of path identifiers in the initial information is a node segment identifier of an end node of the first path indicated by all path identifiers corresponding to each node segment identifier.

其中,目标信息指示的路径与初始信息指示的路径相同。在MPLS中,节点段标识的一种表现形式是标签;在SRv6中,节点段标识的一种变现形式是声明为SID的IPv6地址。The path indicated by the target information is the same as the path indicated by the initial information. In MPLS, a form of node segment identification is a label; in SRv6, a form of realization of a node segment identification is an IPv6 address declared as a SID.

该方法中,当初始信息中的多个路径标识所指示的第一路径为该第一路径的起始节点与该第一路径的结束节点间的唯一最短路径时,可以用该第一路径的结束节点的node-SID来替代这多个路径标识指示该第一路径;否则可以使用第一路径的起始节点至结束节点之间的adj-SID来指示该第一路径。这样,第一路径的结束节点的node-SID 和/或第一路径的起始节点至结束节点之间的adj-SID即组成了目标信息。In this method, when the first path indicated by the multiple path identifiers in the initial information is the only shortest path between the start node of the first path and the end node of the first path, the first path may be used. The node-SID of the end node is used instead of the multiple path identifiers to indicate the first path; otherwise, the adj-SID between the start node and the end node of the first path may be used to indicate the first path. In this way, the node-SID of the end node of the first path and / or the adj-SID between the start node and the end node of the first path constitute the target information.

这样,可以减少路径标识的数量,进而可以提高数据包的传输效率,最终提高通信网络的性能。In this way, the number of path identifiers can be reduced, thereby improving the transmission efficiency of data packets, and ultimately improving the performance of the communication network.

例如,数据包的初始SID列表包括{9101,9105,9107,9103,9105}时,若前两个SID,即“9101”和“9105”共同指示的路径“A->B->C”为节点A至节点C之间唯一的最短路径,由于“9101”和“9105”作为整体为数据包的初始SID列表中的第一个SID,则数据包的目标SID列表中的第一个SID可以为节点C的SID。For example, when the initial SID list of the data packet includes {9101,9105,9107,9103,9105}, if the first two SIDs, that is, the paths “A-> B-> C” jointly indicated by “9101” and “9105” are The only shortest path between node A and node C. Since "9101" and "9105" as a whole are the first SID in the initial SID list of the packet, the first SID in the destination SID list of the packet can be SID of node C.

又如,若数据包的初始SID列表中的后两个SID,即“9103”和“9105”共同指示的路径“O->P->Z”为节点O至节点Z之间唯一的最短路径,由于“9103”和“9105”作为整体为数据包的初始SID列表中的第四个SID,则数据包的目标SID列表中的第四个SID可以为节点Z的SID。For another example, if the last two SIDs in the initial SID list of the data packet, that is, the path "O-> P-> Z" indicated by "9103" and "9105" are the only shortest path between node O and node Z Since "9103" and "9105" as a whole are the fourth SID in the initial SID list of the data packet, the fourth SID in the target SID list of the data packet may be the SID of node Z.

可以通过多种实现方式来根据数据包的转发路径的初始信息确定数据包的转发路径的目标信息。The target information of the forwarding path of the data packet can be determined through multiple implementations according to the initial information of the forwarding path of the data packet.

一种根据数据包的转发路径的初始信息确定数据包的转发路径的目标信息的实现方式如图3所示。An implementation manner of determining target information of a forwarding path of a data packet according to initial information of the forwarding path of a data packet is shown in FIG. 3.

S301,获取数据包的转发路径对应的节点列表,将节点列表中的第一个节点作为起始节点,将节点列表中的最后一个节点作为结束节点,获取空列表作为临时路径信息列表。S301: Obtain a node list corresponding to a forwarding path of a data packet, use a first node in the node list as a starting node, use a last node in the node list as an ending node, and obtain an empty list as a temporary path information list.

S302,判断起始节点与结束节点是否是同一个节点,若是,则执行S308,否则执行S303。S302. Determine whether the start node and the end node are the same node. If yes, perform S308; otherwise, perform S303.

S303,判断起始节点与结束节点是否为节点列表中相邻的节点,若是,则执行S304,否则执行S305。S303: Determine whether the start node and the end node are adjacent nodes in the node list. If yes, perform S304; otherwise, perform S305.

S304,在目标信息中记录起始节点至结束节点之间的邻接段标识,将结束节点作为新的起始节点,将节点列表中的最后一个节点作为新的结束节点,并重新执行S302。S304. Record the identifier of the adjacent segment between the start node and the end node in the target information, use the end node as the new start node, use the last node in the node list as the new end node, and execute S302 again.

S305,判断节点列表中由起始节点至结束节点之间的所有节点按顺序排列时所指示的路径是否为SR中起始节点至结束节点之间唯一的最短路径,若是,则执行S306,否则执行S307。S305: Determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the only shortest path between the start node and the end node in the SR. If yes, perform S306, otherwise Execute S307.

S306,将结束节点对应的节点段标识加入到临时路径信息列表,将结束节点作为新的起始节点,将节点列表中的最后一个节点作为新的结束节点,并重新执行S302。S306. The node segment identifier corresponding to the ending node is added to the temporary path information list, the ending node is used as a new starting node, the last node in the node list is used as a new ending node, and S302 is performed again.

S307,将节点列表中结束节点之前的第一个节点作为新的结束节点,并重新执行S302。S307. Use the first node before the ending node in the node list as the new ending node, and re-execute S302.

S308,将临时路径信息列表作为目标信息。S308. Use the temporary path information list as the target information.

下面以初始信息是用于指示数据包所经过的路径的adj-SID列表,该adj-SID列表中包括多个adj-SID为例,介绍本申请根据初始信息生成目标信息的一种伪代码实现方式。执行该伪代码可以实现图3所示的方法。In the following, the initial information is an adj-SID list used to indicate the path that a data packet passes through. The adj-SID list includes multiple adj-SIDs as an example, and a pseudo-code implementation for generating target information based on the initial information in this application is introduced. the way. Executing this pseudo code can implement the method shown in FIG. 3.

Figure PCTCN2019092446-appb-000001
Figure PCTCN2019092446-appb-000001

Figure PCTCN2019092446-appb-000002
Figure PCTCN2019092446-appb-000002

该伪代码中,strict[]表示初始信息标识的路径对应的节点列表,loose[]表示临时路径信息列表,node表示起始节点,last表示结束节点,SPT(node,last)表示获取SR中起始节点至结束节点间的最短路径,adj_sid(node,last)表示获取adj-SID列表中node至last之间的adj-SID,loose.add(adj_sid(node,last))表示将adj-SID列表中node至last之间的adj-SID加入到loose中,node_sid(node)表示获取node的node-SID。In this pseudo code, strict [] represents the node list corresponding to the path identified by the initial information, loose [] represents the temporary path information list, node represents the starting node, last represents the ending node, and SPT (node, last) represents the starting point in the SR. The shortest path from the start node to the end node, adj_sid (node, last) means get the adj-SID from node to last in the adj-SID list, and loose.add (adj_sid (node, last)) means the adj-SID list The adj-SID from node to last is added to loose, and node_sid (node) means to get the node-SID of node.

以图1所示的SR为例,数据包的转发路径的初始信息包括{9101,9105,9107,9103,9105},根据图3所示的方法或上述伪代码可以得到的目标信息可以包括{节点C的SID,9107,节点Z的SID}。Taking the SR shown in FIG. 1 as an example, the initial information of the data packet forwarding path includes {9101, 9105, 9107, 9103, 9105}, and the target information that can be obtained according to the method shown in FIG. 3 or the above pseudo code can include { SID of node C, 9107, SID of node Z}.

另一种根据数据包的转发路径的初始信息确定数据包的转发路径的目标信息的实现方式如图4所示。Another implementation manner of determining target information of the forwarding path of the data packet according to the initial information of the forwarding path of the data packet is shown in FIG. 4.

S401,获取数据包的转发路径对应的节点列表,将节点列表中的第一个节点作为起始节点,将节点列表中的最后一个节点作为结束节点,获取空列表作为临时路径信息列表。S401: Obtain a node list corresponding to a forwarding path of a data packet, use a first node in the node list as a starting node, use a last node in the node list as an ending node, and obtain an empty list as a temporary path information list.

S402,判断起始节点与结束节点是否是同一个节点,若是,则执行S406,否则执行S403。S402. Determine whether the start node and the end node are the same node. If yes, perform S406; otherwise, perform S403.

S403,判断节点列表中由起始节点至结束节点之间的所有节点按顺序排列时所指示的路径是否为SR中起始节点至结束节点之间唯一的最短路径,若是,则执行S404,否则执行S405。S403. Determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the only shortest path between the start node and the end node in the SR. If yes, execute S404, otherwise Execute S405.

S404,将结束节点对应的节点段标识加入到临时路径信息列表,将结束节点作为新的起始节点,将节点列表中的最后一个节点作为新的结束节点,并重新执行S402。S404. Add the node segment identifier corresponding to the ending node to the temporary path information list, use the ending node as a new starting node, use the last node in the node list as a new ending node, and execute S402 again.

S405,将节点列表中结束节点之前的第一个节点作为新的结束节点,并重新执行S402。S405. Use the first node before the ending node in the node list as the new ending node, and re-execute S402.

S406,将临时路径信息列表作为目标信息。S406. Use the temporary path information list as the target information.

下面以初始信息是用于指示数据包所经过的路径的adj-SID列表,该adj-SID列表中包括多个adj-SID为例,介绍本申请根据初始信息生成目标信息的一种伪代码实现方式。执行该伪代码可以实现图4所示的方法。In the following, the initial information is an adj-SID list used to indicate the path that a data packet passes through. The adj-SID list includes multiple adj-SIDs as an example, and a pseudo-code implementation for generating target information based on the initial information in this application is introduced. the way. Executing this pseudo code can implement the method shown in FIG. 4.

Figure PCTCN2019092446-appb-000003
Figure PCTCN2019092446-appb-000003

该伪代码中,strict[]表示初始信息标识的路径对应的节点列表,loose[]表示临时路径信息列表,node表示起始节点,last表示结束节点,SPT(node,last)表示获取SR中起始节点至结束节点间的最短路径,adj_sid(node,last)表示获取adj-SID列表中node至last之间的adj-SID,loose.add(adj_sid(node,last))表示将adj-SID列表中node至last之间的adj-SID加入到loose中,node_sid(node)表示获取node的node-SID。In this pseudo code, strict [] represents the node list corresponding to the path identified by the initial information, loose [] represents the temporary path information list, node represents the starting node, last represents the ending node, and SPT (node, last) represents the starting point in the SR. The shortest path from the start node to the end node, adj_sid (node, last) means get the adj-SID from node to last in the adj-SID list, and loose.add (adj_sid (node, last)) means the adj-SID list The adj-SID from node to last is added to loose, and node_sid (node) means to get the node-SID of node.

以图1所示的SR为例,数据包的转发路径的初始信息包括{9101,9105,9107,9103,9105},根据图4所示的方法或上述伪代码可以得到的目标信息可以包括{节点C的SID,节点O的SID,节点Z的SID}。Taking the SR shown in FIG. 1 as an example, the initial information of the data packet forwarding path includes {9101, 9105, 9107, 9103, 9105}. According to the method shown in FIG. 4 or the above pseudo code, the target information that can be obtained can include { SID of node C, SID of node O, SID of node Z}.

应理解,图3和图4所示的方法中使用临时路径信息列表仅是一种示例,也可以不使用临时路径信息列表来得到目标信息。It should be understood that using the temporary path information list in the methods shown in FIG. 3 and FIG. 4 is only an example, and the target information may also be obtained without using the temporary path information list.

另一种根据数据包的转发路径的初始信息确定数据包的转发路径的目标信息的实现方式如图5所示。Another implementation manner of determining target information of the forwarding path of the data packet according to the initial information of the forwarding path of the data packet is shown in FIG. 5.

S501,获取初始信息标识的路径对应的节点列表,将节点列表中的第一个节点作为起始节点,将节点列表中位于起始节点后的第一个节点作为结束节点,将空列表作为临时路径信息列表,将空节点作为临时结束节点。S501. Obtain a node list corresponding to the path identified by the initial information, use the first node in the node list as the starting node, use the first node in the node list after the starting node as the ending node, and use the empty list as the temporary node. Path information list, with empty nodes as temporary ending nodes.

S502,判断结束节点是否是所述节点列表中的最后一个节点,若是,则执行S510,否则执行S503。S502. Determine whether the ending node is the last node in the node list. If so, execute S510, otherwise execute S503.

S503,判断节点列表中由起始节点至结束节点之间的所有节点按顺序排列所指示的路径是否为SR中起始节点至结束节点之间唯一的最短路径,若是,则执行S504,否则执行S505。S503. Determine whether the path indicated by all nodes in the node list from the start node to the end node is the only shortest path between the start node and the end node in the SR. If yes, execute S504, otherwise execute S505.

S504,将结束节点作为临时结束节点,将节点列表中结束节点之后的第一个节点作为新的结束节点,并执行S502。In step S504, the ending node is used as a temporary ending node, the first node after the ending node in the node list is used as a new ending node, and step S502 is performed.

S505,判断临时结束节点是否为空,若不是,则执行S506,否则执行S507。S505. Determine whether the temporarily ending node is empty. If not, execute S506; otherwise, execute S507.

S506,判断临时结束节点是否为起始节点的相邻节点,若是,则执行S508,否则执行S509。S506. Determine whether the temporarily ending node is a neighboring node of the starting node. If so, execute S508, otherwise execute S509.

S507,将用于指示起始节点至结束节点之间的路径的邻接段标识加入到临时路径信息列表,将结束节点作为新的起始节点,将节点列表中结束节点后的第一个节点作为新的结束节点,并执行S502。S507. Add an adjacent segment identifier indicating a path between the start node and the end node to the temporary path information list, use the end node as a new start node, and use the first node after the end node in the node list as the first node. The new end node, and execute S502.

S508,将用于指示起始节点和临时结束节点之间的路径的邻接段标识加入到临时路径信息列表,,将临时结束节点作为新的起始节点,将临时结束节点置空,并执行S502。S508. Add an adjacent segment identifier indicating a path between the start node and the temporary end node to the temporary path information list, use the temporary end node as a new start node, empty the temporary end node, and execute S502. .

S509,将临时结束节点对应的节点段标识加入到临时路径信息列表,将临时结束节点作为新的起始节点,将临时结束节点置空,并执行S502。S509. Add the node segment identifier corresponding to the temporary end node to the temporary path information list, use the temporary end node as a new starting node, empty the temporary end node, and execute S502.

S510,判断起始节点是否为节点列表中的倒数第二个节点,若不是,则执行S511,否则执行S512。S510. Determine whether the starting node is the penultimate node in the node list. If not, execute S511, otherwise execute S512.

S511,将结束节点对应的节点段标识加入到临时路径信息列表,并执行S513。S511. Add the node segment identifier corresponding to the ending node to the temporary path information list, and execute S513.

S512,将用于指示起始节点和结束节点之间的路径的邻接段标识加入到临时路径信息,并执行S513。S512: Add an adjacent segment identifier used to indicate a path between the start node and the end node to the temporary path information, and execute S513.

S513,将临时路径信息列表作为目标信息。S513. Use the temporary path information list as the target information.

下面以初始信息是用于指示数据包所经过的路径的adj-SID列表,该adj-SID列表中包括多个adj-SID为例,介绍本申请根据初始信息生成目标信息的一种伪代码实现方式。执行该伪代码可以实现图5所示的方法。In the following, the initial information is an adj-SID list used to indicate the path that a data packet passes through. The adj-SID list includes multiple adj-SIDs as an example, and a pseudo-code implementation for generating target information based on the initial information in this application is introduced. the way. Executing this pseudo code can implement the method shown in FIG. 5.

Figure PCTCN2019092446-appb-000004
Figure PCTCN2019092446-appb-000004

该伪代码中,strict[]表示初始信息标识的路径对应的节点列表,loose[]表示临时路 径信息列表,node表示起始节点,TEN表示临时结束节点,next表示结束节点,adj_SID(node,next)表示获取adj-SID列表中node至next之间的adj-SID,loose.add(adj_SID(node,TENT))表示将adj-SID列表中node至TENT之间的adj-SID加入到loose中,node_SID(TENT)表示获取TENT的node-SID,loose.add(node_SID(next))表示将next的node-SID加入到loose中。In this pseudo code, strict [] represents the node list corresponding to the path identified by the initial information, loose [] represents the temporary path information list, node represents the starting node, TEN represents the temporary ending node, next represents the ending node, and adj_SID (node, next ) Means to get the adj-SID from node to next in the adj-SID list, and loose.add (adj_SID (node, TENT)) means to add the adj-SID from node to TENT in the adj-SID list to loose, node_SID (TENT) means get the node-SID of TENT, and loose.add (node_SID (next)) means add the next node-SID to loose.

以图1所示的SR为例,数据包的转发路径的初始信息包括{9101,9105,9107,9103,9105},根据图5所示的方法或上述伪代码可以得到的目标信息可以包括{节点C的SID,9107,节点Z的SID}。Taking the SR shown in FIG. 1 as an example, the initial information of the data packet forwarding path includes {9101, 9105, 9107, 9103, 9105}. According to the method shown in FIG. 5 or the above pseudo code, the target information can include { SID of node C, 9107, SID of node Z}.

另一种根据数据包的转发路径的初始信息确定数据包的转发路径的目标信息的实现方式如图6所示。Another implementation manner of determining target information of the forwarding path of the data packet according to the initial information of the forwarding path of the data packet is shown in FIG. 6.

S601,获取初始信息标识的路径对应的节点列表,将节点列表中的第一个节点作为起始节点,将节点列表中位于起始节点后的第一个节点作为结束节点,将空列表作为临时路径信息列表,将空节点作为临时结束节点。S601. Obtain a node list corresponding to the path identified by the initial information, use the first node in the node list as the starting node, use the first node in the node list after the starting node as the ending node, and use the empty list as the temporary node. Path information list, with empty nodes as temporary ending nodes.

S602,判断结束节点是否是所述节点列表中的最后一个节点,若是,则执行S608,否则执行S603。S602. Determine whether the ending node is the last node in the node list, and if so, execute S608, otherwise execute S603.

S603,判断节点列表中由起始节点至结束节点之间的所有节点按顺序排列所指示的路径是否为SR中起始节点至结束节点之间唯一的最短路径,若是,则执行S604,否则执行S605。S603. Determine whether the path indicated by all nodes in the node list from the start node to the end node in order is the only shortest path between the start node and the end node in the SR. If yes, execute S604, otherwise execute S605.

S604,将结束节点作为临时结束节点,将节点列表中结束节点之后的第一个节点作为新的结束节点,并执行S602。In step S604, the ending node is used as a temporary ending node, the first node after the ending node in the node list is used as a new ending node, and step S602 is performed.

S605,判断临时结束节点是否为空,若不是,则执行S606,否则执行S607。S605: Determine whether the temporarily ending node is empty. If not, execute S606; otherwise, execute S607.

S606,将临时结束节点对应的节点段标识加入到临时路径信息列表,将临时结束节点作为新的起始节点,将临时结束节点置空,并执行S602。S606. Add the node segment identifier corresponding to the temporary end node to the temporary path information list, use the temporary end node as a new starting node, leave the temporary end node empty, and execute S602.

S607,将用于指示起始节点和结束节点之间的路径的邻接段标识加入到临时路径信息列表,将结束节点作为新的起始节点,将节点列表中结束节点后的第一个节点作为新的结束节点,并执行S602。S607. Add an adjacent segment identifier indicating a path between the start node and the end node to the temporary path information list, use the end node as a new start node, and use the first node after the end node in the node list as the first node. The new end node, and execute S602.

S608,判断起始节点是否为节点列表中的倒数第二个节点,若不是,则执行S609,否则执行S610。S608. Determine whether the starting node is the penultimate node in the node list. If not, execute S609, otherwise execute S610.

S609,将结束节点对应的节点段标识加入到临时路径信息列表,并执行S611。S609. Add the node segment identifier corresponding to the ending node to the temporary path information list, and execute S611.

S610,将用于指示起始节点和结束节点之间的路径的邻接段标识加入到临时路径信息,并执行S611。S610. Add an adjacent segment identifier indicating a path between the start node and the end node to the temporary path information, and execute S611.

S611,将临时路径信息列表作为目标信息。S611. Use the temporary path information list as the target information.

下面以初始信息是用于指示数据包所经过的路径的adj-SID列表,该adj-SID列表中包括多个adj-SID为例,介绍本申请根据初始信息生成目标信息的一种伪代码实现方式。执行该伪代码可以实现图6所示的方法。In the following, the initial information is an adj-SID list for indicating the path that the data packet passes through. The adj-SID list includes multiple adj-SIDs as an example, and a pseudo-code implementation for generating target information based on the initial information in this application is introduced. the way. Executing this pseudo code can implement the method shown in FIG. 6.

Figure PCTCN2019092446-appb-000005
Figure PCTCN2019092446-appb-000005

Figure PCTCN2019092446-appb-000006
Figure PCTCN2019092446-appb-000006

该伪代码中,strict[]表示初始信息标识的路径对应的节点列表,loose[]表示临时路径信息列表,node表示起始节点,TEN表示临时结束节点,next表示结束节点,adj_SID(node,next)表示获取adj-SID列表中node至next之间的adj-SID,loose.add(adj_SID(node,TENT))表示将adj-SID列表中node至TENT之间的adj-SID加入到loose中,node_SID(TENT)表示获取TENT的node-SID,loose.add(node_SID(next))表示将next的node-SID加入到loose中。In this pseudo code, strict [] represents the node list corresponding to the path identified by the initial information, loose [] represents the temporary path information list, node represents the starting node, TEN represents the temporary ending node, next represents the ending node, and adj_SID (node, next ) Means to get the adj-SID from node to next in the adj-SID list, and loose.add (adj_SID (node, TENT)) means to add the adj-SID from node to TENT in the adj-SID list to loose, node_SID (TENT) means get the node-SID of TENT, and loose.add (node_SID (next)) means add the next node-SID to loose.

以图1所示的SR为例,数据包的转发路径的初始信息包括{9101,9105,9107,9103,9105},根据图6所示的方法或上述伪代码可以得到的目标信息可以包括{节点C的SID,节点O的SID,节点Z的SID}。Taking the SR shown in FIG. 1 as an example, the initial information of the forwarding path of the data packet includes {9101, 9105, 9107, 9103, 9105}, and the target information that can be obtained according to the method shown in FIG. 6 or the above pseudo code can include { SID of node C, SID of node O, SID of node Z}.

应理解,图5和图6所示的方法中使用临时路径信息列表和/或临时结束节点仅是一种示例,也可以不使用临时路径信息列表和/或临时结束节点来得到目标信息。It should be understood that the use of the temporary path information list and / or the temporary end node in the methods shown in FIG. 5 and FIG. 6 is only an example, and the target information may also be obtained without using the temporary path information list and / or the temporary end node.

本申请的实施例中,可选地,图2至图6中的方法可以由数据包所经过的路径的入节点来执行,也可以由网络中的控制器来执行。In the embodiment of the present application, optionally, the methods in FIG. 2 to FIG. 6 may be executed by an ingress node of a path through which a data packet passes, or may be executed by a controller in a network.

应理解,图3至图6中所示的方法仅是一种示例,对图3至图6中任意一个所示的方法中的步骤进行变换或改进后所得的方法也属于本申请的保护范围。It should be understood that the method shown in FIG. 3 to FIG. 6 is only an example, and a method obtained by transforming or improving the steps in the method shown in any of FIG. 3 to FIG. 6 also belongs to the protection scope of the present application. .

若图2至图6中的方法由数据包所经过的路径的入节点来执行,则本申请实施例中的方法还可以包括:该入节点根据目标信息来发送数据包,该数据包中包括目标信息。若图2至图6中的方法由网络中的控制器(controller)来执行,则本申请实施例中的方法还可以包括:该控制器向数据包所经过的路径的入节点发送目标信息,然后入节点根据目标信息来发送数据包,该数据包中目标信息。控制器可以是路径计算客户端(path computation client,PCE),或其他运行该算法的服务器。If the methods in FIG. 2 to FIG. 6 are executed by the ingress node of the path that the data packet passes through, the method in the embodiment of the present application may further include: the ingress node sends the data packet according to the target information, and the data packet includes Target information. If the methods in FIG. 2 to FIG. 6 are executed by a controller in a network, the method in the embodiment of the present application may further include: the controller sends target information to an ingress node of a path through which the data packet passes, Then the ingress node sends a data packet according to the target information, and the target information in the data packet. The controller may be a path computing client (PCE), or another server running the algorithm.

下面以图1所示的“A->B->C->O->P->Z”为数据包的转发路径,以图3所示的方 法为例,介绍根据本申请的方法得到的目标信息发送数据包的流程。从该流程中可知,根据本申请的方法得到的目标信息来转发数据包,可以较少节点间的数据包的转发路径的信息的长度,从而可以提高通信效率。The following uses "A-> B-> C-> O-> P-> Z" shown in FIG. 1 as the data packet forwarding path, and uses the method shown in FIG. 3 as an example to introduce the data obtained according to the method of the present application. The process of sending data packets to target information. It can be known from this process that forwarding the data packet according to the target information obtained by the method of the present application can reduce the length of the information of the forwarding path of the data packet between nodes, thereby improving communication efficiency.

例如,节点A获得初始信息为adj-ID列表{9101,9105,9107,9103,9105}或为IP地址列表{IP address A,IP address B,IP address C,IP address O,IP address P,IP address Z}时,目标信息可以为{C的Node-SID,C-O的adj-SID和Z的Node-SID}。假设C的Node-SID为1003,Z的Node-SID为1008,则目标信息为{1003,9107,1008}.For example, node A obtains the initial information as the adj-ID list {9101,9105,9107,9103,9105} or the IP address list {IP addressA, IP addressB, IP addressC, IP addressO, IP addressP, IP address Z}, the target information can be {C's Node-SID, CO's adj-SID, and Z's Node-SID}. Assuming that the Node-SID of C is 1003 and the Node-SID of Z is 1008, the target information is {1003,9107,1008}.

节点A可以根据C的Node-SID,查找节点A上的转发表获知下一跳为节点B,并向节点B发送数据包,该数据包中携带路径信息,该路径信息为{C的NodeID,C-O的adj-ID和Z的Node ID}。节点B从节点A收到数据包后,查询节点B上的转发表,获知下一跳为节点C,并向节点C发送数据包,该数据包中携带路径信息,此时的路径信息可以是{C的NodeID,C-O的adj-ID和Z的Node ID},也可以是{C-O的adj-ID和Z的Node ID}。节点C从节点B收到数据包后,根据“C-O的adj-IDC”查询节点C的转发表,找到下一跳为节点O,并向节点O发送数据包,该数据包包括路径信息,该路径信息为{Z的Node ID}。节点O从节点C接收数据包后,查询节点O上的转发表,确定下一跳为节点P,并向节点P发送数据包,该数据包包括路径信息,该路径信息为{Z的Node ID}。节点P从节点O接收数据包后,查询节点P上的转发表,确定下一跳为节点Z,并向节点Z发送数据包。Node A can look up the forwarding table on node A to find out that the next hop is node B according to the Node-SID of C, and send a data packet to node B. The data packet carries path information, which is {C's NodeID, CO's adj-ID and Z's Node ID}. After receiving a data packet from node A, node B queries the forwarding table on node B, learns that the next hop is node C, and sends a data packet to node C. The data packet carries path information. At this time, the path information can be {C's NodeID, CO's adj-ID and Z's Node ID}, or {CO's adj-ID and Z's Node ID}. After receiving the data packet from node B, node C queries the forwarding table of node C according to "adj-IDC of CO", finds the next hop is node O, and sends a data packet to node O. The data packet includes path information. The path information is {Z Node ID}. After node O receives a data packet from node C, it queries the forwarding table on node O, determines that the next hop is node P, and sends a data packet to node P. The data packet includes path information, and the path information is {Z's Node ID }. After node P receives a data packet from node O, it queries the forwarding table on node P, determines that the next hop is node Z, and sends a data packet to node Z.

例如,初始信息为SRv6SID列表,该列表中的SID是声明为SID的IPv6地址,例如初始信息是{A::12,B::23,C::34,O::45,P::56,Z::67}时,根据图3所示的方法的处理或运行上述伪代码后,目标信息可以为{C的NodeID,C-O的adj-ID和Z的Node ID},例如目标信息可以是{C::1,C::34,Z::1}。For example, the initial information is a list of SRv6SIDs, and the SIDs in the list are IPv6 addresses declared as SIDs. For example, the initial information is {A :: 12, B :: 23, C :: 34, O :: 45, P :: 56 , Z :: 67}, after processing according to the method shown in FIG. 3 or after running the above pseudo code, the target information can be {C's NodeID, CO's adj-ID, and Z's Node ID}. For example, the target information can be {C :: 1, C :: 34, Z :: 1}.

然后,节点A根据C::1,向节点B发送数据包,该数据包包括路径信息,该路径信息包括{C::1,C::34,Z::1}。后续转发流程遵循SRv6转发流程,为了简洁,此处不再赘述。Then, node A sends a data packet to node B according to C :: 1, the data packet includes path information, and the path information includes {C :: 1, C :: 34, Z :: 1}. The subsequent forwarding process follows the SRv6 forwarding process. For brevity, we will not repeat them here.

图3至图6中的方法均可以使得在目标信息中,用相应的node-SID来指示初始信息中所有对应唯一最短路径的路径标识,从而可以最大化的减少目标信息中的路径标识的数量,即减小目标信息的长度。The methods in FIGS. 3 to 6 can make the target information use the corresponding node-SID to indicate all the path identifiers corresponding to the unique shortest path in the initial information, thereby minimizing the number of path identifiers in the target information. , That is, reduce the length of the target information.

当然,在执行本申请实施例中的方法时,也可以根据需求确定目标信息能被接受的最大长度,然后根据该最大长度来确定目标信息。目标信息能被接受的最大长度可以由控制器或入节点的路径标识(或称为标签)的最大插入能力来确定。Of course, when the method in the embodiment of the present application is executed, the maximum length that the target information can be accepted may also be determined according to requirements, and then the target information is determined according to the maximum length. The maximum length that the target information can be accepted can be determined by the maximum insertion capacity of the path identifier (or label) of the controller or the ingress node.

例如,当初始信息中的部分路径标识可以通过目标信息中相应地的node-SID来替代,且目标信息中的路径标识的数量已小于或等于控制器或入节点的最大插入能力,则可以不用再继续检测初始信息是否还有路径标识可以通过对应的node-SID来指示了。For example, when part of the path identifier in the initial information can be replaced by the corresponding node-SID in the target information, and the number of path identifiers in the target information is less than or equal to the maximum insertion capacity of the controller or the ingress node, it can be omitted. Then continue to detect whether the initial information has a path identifier, which can be indicated by the corresponding node-SID.

从上述分析可以看出,本申请实施例中的方法减少指示数据包的转发路径的路径标识的数量,还可以减少控制器或入节点的插入次数,从而可以提高控制器或入节点的性能。It can be seen from the foregoing analysis that the method in the embodiment of the present application reduces the number of path identifiers indicating the forwarding path of the data packet, and also reduces the number of insertions of the controller or the ingress node, thereby improving the performance of the controller or the ingress node.

图7是本申请实施例的获取数据包的转发路径的信息的装置700的示意性框图。 应理解,装置700仅是一种示例。本申请实施例的装置还可包括其他模块或单元,或者包括与图7中的各个模块的功能相似的模块,或者并非要包括图7中的所有模块。FIG. 7 is a schematic block diagram of an apparatus 700 for acquiring information about a forwarding path of a data packet according to an embodiment of the present application. It should be understood that the apparatus 700 is only an example. The device in the embodiment of the present application may further include other modules or units, or include modules similar in function to each module in FIG. 7, or not all modules in FIG. 7.

获取模块710,用于获取数据包的转发路径的初始信息,所述初始信息包括多个路径标识。The obtaining module 710 is configured to obtain initial information of a forwarding path of a data packet, where the initial information includes multiple path identifiers.

生成模块720,用于根据所述初始信息生成所述数据包的转发路径的目标信息,所述目标路径信息包括一个或多个节点段标识,所述目标信息中至少有一个节点段标识对应于所述初始信息中的多个路径标识,所述初始信息中对应于所述目标信息中的节点段标识的多个路径标识所指示的第一路径为所述段路由中所述第一路径的起始节点至所述第一路径的结束节点之间唯一的最短路径,所述目标信息中对应于所述初始信息中的多个路径标识的每个节点段标识为所述每个节点段标识对应的所有路径标识所指示的路径的结束节点的节点段标识。A generating module 720 is configured to generate target information of a forwarding path of the data packet according to the initial information, where the target path information includes one or more node segment identifiers, and at least one node segment identifier in the target information corresponds to Multiple path identifiers in the initial information, and the first path indicated by the multiple path identifiers in the initial information corresponding to the node segment identifier in the target information is the first path in the segment route The only shortest path between the start node and the end node of the first path, and each node segment identifier in the target information corresponding to multiple path identifiers in the initial information is the each node segment identifier The node segment identifiers of the end nodes of the paths indicated by the corresponding all path identifiers.

可选地,所述生成模块具体用于执行以下步骤:步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中的第j个节点作为结束节点,i的取值为1,j的取值为所述节点列表的长度值,执行步骤二;步骤二,判断所述起始节点与所述结束节点是否是同一个节点,若是,则结束执行,否则执行步骤三;步骤三,判断所述起始节点与所述结束节点是否为所述节点列表中相邻的节点,若是,则执行步骤四,否则执行步骤五;步骤四,在所述目标信息中记录所述起始节点至所述结束节点之间的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;步骤五,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列时所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤六,否则执行步骤七;步骤六,在所述目标信息中记录所述结束节点的节点段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;步骤七,j的取值更新为j-1,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二。Optionally, the generating module is specifically configured to perform the following steps: Step 1. Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and use the node The j-th node in the list is used as the end node. The value of i is 1. The value of j is the length of the node list. Go to step 2. Step 2. Determine whether the start node and the end node are It is the same node, if it is, the execution is terminated, otherwise step 3 is performed; step 3, it is determined whether the starting node and the ending node are adjacent nodes in the node list, and if so, step 4 is performed, otherwise Perform step five; step four, record the identifier of the adjacent segment between the start node and the end node in the target information, update the value of i to be equal to the value of j, and then, the value of j Update to be equal to the length value of the node list, then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and restart Execution step Step two; Step five, determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the start node to the The only shortest path between the end nodes is described, if yes, step 6 is performed, otherwise step 7 is performed; step 6, the node segment identifier of the end node is recorded in the target information, and the value of i is updated to be the same as j After the values are equal, the value of j is updated to be equal to the length value of the node list, and then the i-th node in the node list is used as the starting node, and the j-th node in the node list is used. And the second node is used as the end node, and step 2 is performed again; in step 7, the value of j is updated to j-1, the jth node in the node list is used as the end node, and step 2 is performed again.

可选地,所述生成模块具体用于执行以下步骤:步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中的第j个节点作为结束节点,i的取值为1,j的取值为所述节点列表的长度值,执行步骤二;步骤二,判断所述起始节点与所述结束节点是否是同一个节点,若是,则结束执行,否则执行步骤三;步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列时所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;步骤四,在所述目标信息中记录所述结束节点的节点段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;步骤五,j的取值更新为j-1,将所述节点列表中第j个节点作为所述结束 节点,并重新执行步骤二。Optionally, the generating module is specifically configured to perform the following steps: Step 1. Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and use the node The j-th node in the list is used as the end node. The value of i is 1. The value of j is the length of the node list. Go to step 2. Step 2. Determine whether the start node and the end node are It is the same node, if so, the execution is terminated, otherwise step 3 is performed; step 3, it is judged whether the path indicated when all nodes in the node list from the starting node to the ending node are arranged in order Is the only shortest path between the start node and the end node in the segment route; if it is, step 4 is performed; otherwise, step 5 is performed; step 4 is recorded in the target information of the end node Node segment identifier. The value of i is updated to be equal to the value of j. After that, the value of j is updated to be equal to the length of the node list, and the i-th node in the node list is used as the The starting node, using the jth node in the node list as the ending node, and performing step 2 again; step five, the value of j is updated to j-1, and the jth node in the node list is updated As the end node, perform step two again.

可选地,所述生成模块具体用于执行以下步骤:步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中第j个节点作为结束节点,设置临时结束节点为空节点,i的取值为1,j的取值为i+1,执行步骤二;步骤二,判断所述结束节点是否是所述节点列表中的最后一个节点,若是,则执行步骤十,否则执行步骤三;步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;步骤四,将所述临时结束节点更新为所述结束节点,j的取值更新为j+1,再将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;步骤五,判断所述临时结束节点是否为空,若不是,则执行步骤六,否则执行步骤七;步骤六,判断所述临时结束节点是否为所述起始节点的相邻节点,若是,则执行步骤八,否则执行步骤九;步骤七,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为j+1,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;步骤八,在所述目标信息中记录所述起始节点至所述临时结束节点之间的路径的邻接段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;步骤九,在所述目标信息中记录所述临时结束节点的节点段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;步骤十,判断所述起始节点是否为所述节点列表中的倒数第二个节点,若不是,则执行步骤十一,否则执行步骤十二;步骤十一,在所述目标信息中记录所述结束节点对应的节点段标识,并结束执行;步骤十二,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,并结束执行。Optionally, the generating module is specifically configured to perform the following steps: Step 1. Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and use the node The j-th node in the list is used as the end node, and the temporary end node is set to be an empty node. The value of i is 1 and the value of j is i + 1, and step two is performed. Step two is to determine whether the end node is the The last node in the node list, if yes, go to step ten, otherwise go to step three; step three, judge that all nodes in the node list from the starting node to the ending node are arranged in order Whether the path is the only shortest path between the start node and the end node in the segment route, if yes, go to step four, otherwise go to step five; step four, update the temporary end node to all The end node is updated, the value of j is updated to j + 1, and then the jth node in the node list is used as the end node, and step 2 is performed again; step 5 is to determine the temporary end node Whether it is empty, if not, go to step 6, otherwise go to step 7; step 6, determine whether the temporary ending node is a neighboring node of the starting node; if so, go to step 8; otherwise, go to step 9; Step 7. Record the identifier of the adjacent segment indicating the path between the start node and the end node in the target information, and the value of i is updated to be equal to the value of j. After that, the value of j The value is updated to j + 1, then the i-th node in the node list is used as the starting node, the j-th node in the node list is used as the ending node, and step 2 is performed again; step 8 , Record the identifier of the adjacent segment of the path between the starting node and the temporary ending node in the target information, the value of i is updated to be equal to j-1, and then the value of j is updated to j, Use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, leave the temporary ending node empty, and perform step two again; step nine Recorded in the target information The node segment identifier of the temporary ending node. The value of i is updated to be equal to j-1. After that, the value of j is updated to j, and the i-th node in the node list is used as the starting node. The jth node in the node list is used as the ending node, and the temporary ending node is left blank, and step 2 is performed again; step 10 is determining whether the starting node is the second to last in the node list If not, perform step 11; otherwise, perform step 12; step 11: record the node segment identifier corresponding to the ending node in the target information and end execution; step 12: The target information records an adjacent segment identifier used to indicate a path between the start node and the end node, and ends execution.

可选地,所述生成模块具体用于执行以下步骤:所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中第j个节点作为结束节点,设置临时结束节点为空节点,i的取值为1,j的取值为i+1,执行步骤二;步骤二,判断所述结束节点是否是所述节点列表中的最后一个节点,若是,则执行步骤八,否则执行步骤三;步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;步骤四,将所述临时结束节点更新为所述结束节点,j的取值更新为j+1,再将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;步骤五,判断所述临时结束节点是否为空,若不是,则执行步骤六,否则执行步骤七;步骤六,在所述目标信息中记录所述临时结束节点的节点段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所 述结束节点,将所述临时结束节点置空,并重新执行步骤二;步骤七,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为j+1,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;步骤八,判断所述起始节点是否为所述节点列表中的倒数第二个节点,若不是,则执行步骤九,否则执行步骤十;步骤九,在所述目标信息中记录所述结束节点的节点段标识,并结束执行;步骤十,在所述目标信息中记录所述用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,并结束执行。Optionally, the generating module is specifically configured to perform the following steps: generating target information of the forwarding path of the data packet according to the initial information includes: step one, obtaining a node list of the forwarding path of the data packet Taking the i-th node in the node list as the starting node and the j-th node in the node list as the ending node, setting the temporary ending node to be an empty node, the value of i is 1, and the value of j is If i + 1, go to step two; step two, determine whether the ending node is the last node in the node list; if so, go to step eight, otherwise go to step three; step three, determine the node list Whether the path indicated by all the nodes from the start node to the end node in order is the only shortest path between the start node and the end node in the segment route, and if so, then Perform step four, otherwise perform step five; step four, update the temporary end node to the end node, update the value of j to j + 1, and then update the jth node in the node list as For the end node, and step 2 is performed again; step 5 is to determine whether the temporary end node is empty; if not, step 6 is performed, otherwise step 7 is performed; step 6 is to record the target information in the target information The node segment identifier of the temporarily ending node. The value of i is updated to be equal to j-1. After that, the value of j is updated to j. The i-th node in the node list is used as the starting node. The j-th node in the node list is used as the ending node, and the temporary ending node is left blank, and step 2 is performed again; step 7 is recorded in the target information for indicating the starting node to the ending The identifier of the adjacent segment of the path between the nodes, the value of i is updated to be equal to the value of j, and then, the value of j is updated to j + 1, and the i-th node in the node list is used as the The starting node, using the jth node in the node list as the ending node, and performing step 2 again; step eight, determining whether the starting node is the penultimate node in the node list. If not, go to step 9. Otherwise, perform step ten; step nine, record the node segment identifier of the ending node in the target information, and end the execution; step ten, record the instruction for instructing the starting node to all nodes in the target information. The identification of the adjacent segment of the path between the end nodes is described, and the execution ends.

可选地,所述初始信息为邻接段标识列表,所述初始信息中的路径标识为邻接段标识。Optionally, the initial information is an adjacent segment identifier list, and the path identifier in the initial information is an adjacent segment identifier.

可选地,所述装置700为所述数据包的转发路径的入节点。其中,所述装置700还包括发送模块730,用于根据所述目标信息发送数据包,该数据包包括所述目标信息。Optionally, the apparatus 700 is an ingress node of a forwarding path of the data packet. The device 700 further includes a sending module 730, configured to send a data packet according to the target information, where the data packet includes the target information.

可选地,所述装置700为所述段路由的控制器。其中,所述装置700还包括发送模块730,用于向所述数据包的转发路径的入节点发送所述目标信息。Optionally, the device 700 is a controller of the segment routing. The apparatus 700 further includes a sending module 730, configured to send the target information to an ingress node of a forwarding path of the data packet.

装置700可以用于执行图2至图6描述的方法的步骤,为了简洁,此处不再赘述。The apparatus 700 may be configured to execute the steps of the methods described in FIG. 2 to FIG. 6. For brevity, details are not described herein again.

图8是本申请另一个实施例的获取数据包的转发路径的信息的装置的示意性结构图。应理解,图8示出的装置800仅是示例,本申请实施例的装置还可包括其他模块或单元,或者包括与图8中的各个模块的功能相似的模块。FIG. 8 is a schematic structural diagram of an apparatus for acquiring information about a forwarding path of a data packet according to another embodiment of the present application. It should be understood that the device 800 shown in FIG. 8 is merely an example, and the device in the embodiment of the present application may further include other modules or units, or include modules similar in function to each module in FIG. 8.

装置800可以包括一个或多个处理器810、一个或多个存储器820、接收器830和发送器840。接收器830和发送器840可以集成在一起,称为收发器。存储器820用于存储处理器810执行的程序代码。其中,处理器810中可以集成有存储器820,或者处理器810耦合到一个或多个存储器820,用于调取存储器820中的指令。The apparatus 800 may include one or more processors 810, one or more memories 820, a receiver 830, and a transmitter 840. The receiver 830 and the transmitter 840 may be integrated together and called a transceiver. The memory 820 is configured to store a program code executed by the processor 810. The processor 810 may be integrated with a memory 820, or the processor 810 is coupled to one or more memories 820, and is configured to fetch instructions in the memory 820.

处理器810可以用于实现图7中的获取模块710和生成模块720能够实现的操作或步骤,发送器840可以用于实现图7中的发送模块730能够实现的操作或步骤。The processor 810 may be used to implement operations or steps that can be implemented by the obtaining module 710 and the generating module 720 in FIG. 7, and the transmitter 840 may be used to implement operations or steps that can be implemented by the sending module 730 in FIG. 7.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art may realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and are not repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显 示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.

应理解,本申请实施例中的处理器可以为中央处理单元(central processing unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor in the embodiment of the present application may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), and application-specific integrated circuits. (application specific integrated circuit, ASIC), ready-made programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。When the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially a part that contributes to the existing technology or a part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage media include: U disks, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks, and other media that can store program codes .

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present invention. It should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (18)

一种段路由中获取数据包的转发路径的信息的方法,其特征在于,包括:A method for obtaining information of a forwarding path of a data packet in a segment route, which is characterized in that it includes: 获取数据包的转发路径的初始信息,所述初始信息包括多个路径标识;Acquiring initial information of a forwarding path of a data packet, where the initial information includes multiple path identifiers; 根据所述初始信息生成所述数据包的转发路径的目标信息,所述目标路径信息包括一个或多个节点段标识,所述目标信息中至少有一个节点段标识对应于所述初始信息中的多个路径标识,所述初始信息中对应于所述目标信息中的节点段标识的多个路径标识所指示的第一路径为所述段路由中所述第一路径的起始节点至所述第一路径的结束节点之间唯一的最短路径,所述目标信息中对应于所述初始信息中的多个路径标识的每个节点段标识为所述每个节点段标识对应的所有路径标识所指示的路径的结束节点的节点段标识。Generating target information of a forwarding path of the data packet according to the initial information, the target path information including one or more node segment identifiers, and at least one node segment identifier in the target information corresponding to the initial information Multiple path identifiers, and the first path indicated by the multiple path identifiers in the initial information corresponding to the node segment identifier in the target information is the start node of the first path in the segment route to the The only shortest path between the end nodes of the first path, and each node segment identifier in the target information corresponding to multiple path identifiers in the initial information is identified by all path identifiers corresponding to each node segment identifier. Node segment ID of the end node of the indicated path. 根据权利要求1所述的方法,其特征在于,所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:The method according to claim 1, wherein the generating target information of a forwarding path of the data packet according to the initial information comprises: 步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中的第j个节点作为结束节点,i的取值为1,j的取值为所述节点列表的长度值,执行步骤二;Step 1: Obtain a node list of the forwarding path of the data packet, use the i-th node in the node list as the starting node, and the j-th node in the node list as the ending node, and the value of i Is 1, the value of j is the length of the node list, and step 2 is performed; 步骤二,判断所述起始节点与所述结束节点是否是同一个节点,若是,则结束执行,否则执行步骤三;Step 2: determine whether the starting node and the ending node are the same node; if yes, terminate the execution; otherwise, execute step 3; 步骤三,判断所述起始节点与所述结束节点是否为所述节点列表中相邻的节点,若是,则执行步骤四,否则执行步骤五;In step three, it is determined whether the starting node and the ending node are adjacent nodes in the node list, and if so, step 4 is performed, otherwise step 5 is performed; 步骤四,在所述目标信息中记录所述起始节点至所述结束节点之间的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;Step 4: Record the identifier of the adjacent segment between the start node and the end node in the target information, and the value of i is updated to be equal to the value of j. After that, the value of j is updated to match the value of The lengths of the node lists are equal, then the i-th node in the node list is used as the starting node, the j-th node in the node list is used as the ending node, and step 2 is performed again; 步骤五,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列时所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤六,否则执行步骤七;Step five, determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the start node to the end node in the segment route The only shortest path between them, if yes, go to step 6, otherwise go to step 7; 步骤六,在所述目标信息中记录所述结束节点的节点段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;Step 6. Record the node segment identifier of the ending node in the target information, update the value of i to be equal to the value of j, and then update the value of j to be equal to the length value of the node list. Then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and perform step 2 again; 步骤七,j的取值更新为j-1,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二。In step 7, the value of j is updated to j-1, the jth node in the node list is used as the ending node, and step 2 is performed again. 根据权利要求1所述的方法,其特征在于,所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:The method according to claim 1, wherein the generating target information of a forwarding path of the data packet according to the initial information comprises: 步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中的第j个节点作为结束节点,i的取值为1,j的取值为所述节点列表的长度值,执行步骤二;Step 1: Obtain a node list of the forwarding path of the data packet, use the i-th node in the node list as the starting node, and the j-th node in the node list as the ending node, and the value of i Is 1, the value of j is the length of the node list, and step 2 is performed; 步骤二,判断所述起始节点与所述结束节点是否是同一个节点,若是,则结束执行,否则执行步骤三;Step 2: determine whether the starting node and the ending node are the same node; if yes, terminate the execution; otherwise, execute step 3; 步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列时所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;Step 3: Determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the start node to the end node in the segment route The only shortest path between them, if yes, go to step 4, otherwise go to step 5; 步骤四,在所述目标信息中记录所述结束节点的节点段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;Step four: record the node segment identifier of the ending node in the target information, update the value of i to be equal to the value of j, and then update the value of j to be equal to the length value of the node list, Then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and perform step 2 again; 步骤五,j的取值更新为j-1,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二。In step five, the value of j is updated to j-1, the jth node in the node list is used as the ending node, and step two is performed again. 根据权利要求1所述的方法,其特征在于,所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:The method according to claim 1, wherein the generating target information of a forwarding path of the data packet according to the initial information comprises: 步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中第j个节点作为结束节点,设置临时结束节点为空节点,i的取值为1,j的取值为i+1,执行步骤二;Step 1: Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and a j-th node in the node list as an ending node, and set a temporary ending node as For empty nodes, the value of i is 1 and the value of j is i + 1. Go to step 2. 步骤二,判断所述结束节点是否是所述节点列表中的最后一个节点,若是,则执行步骤十,否则执行步骤三;Step 2: determine whether the ending node is the last node in the node list, and if so, perform step 10; otherwise, perform step 3; 步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;Step 3: Determine whether the path indicated by all the nodes in the node list from the start node to the end node is in order from the start node to the end node in the segment route. The only shortest path between them, if yes, go to step 4, otherwise go to step 5; 步骤四,将所述临时结束节点更新为所述结束节点,j的取值更新为j+1,再将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;Step four: update the temporary ending node to the ending node, and update the value of j to j + 1, then use the jth node in the node list as the ending node, and perform step two again; 步骤五,判断所述临时结束节点是否为空,若不是,则执行步骤六,否则执行步骤七;Step five: determine whether the temporary end node is empty; if not, perform step six; otherwise, perform step seven; 步骤六,判断所述临时结束节点是否为所述起始节点的相邻节点,若是,则执行步骤八,否则执行步骤九;In step 6, it is determined whether the temporary ending node is a neighboring node of the starting node, and if so, step 8 is performed, otherwise step 9 is performed; 步骤七,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为j+1,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;Step 7. Record the identifier of the adjacent segment indicating the path between the start node and the end node in the target information, and the value of i is updated to be equal to the value of j. After that, the value of j Update the value to j + 1, then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and perform step two again; 步骤八,在所述目标信息中记录所述起始节点至所述临时结束节点之间的路径的邻接段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;Step 8. Record the identifier of the adjacent segment of the path between the start node and the temporary end node in the target information, and the value of i is updated to be equal to j-1, and then the value of j is updated to j. Use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, empty the temporary ending node, and perform step 2 again; 步骤九,在所述目标信息中记录所述临时结束节点的节点段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;Step Nine, record the node segment identifier of the temporary ending node in the target information, update the value of i to be equal to j-1, and then update the value of j to j, and update the i-th node in the node list. Three nodes as the starting node, the j-th node in the node list as the ending node, leaving the temporary ending node empty, and performing step two again; 步骤十,判断所述起始节点是否为所述节点列表中的倒数第二个节点,若不是,则执行步骤十一,否则执行步骤十二;Step 10: Determine whether the starting node is the penultimate node in the node list, and if not, perform Step 11; otherwise, perform Step 12; 步骤十一,在所述目标信息中记录所述结束节点对应的节点段标识,并结束执行;Step 11: Record the node segment identifier corresponding to the ending node in the target information and end execution; 步骤十二,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,并结束执行。In step twelve, an identifier of an adjacent segment indicating a path between the start node and the end node is recorded in the target information, and execution is terminated. 根据权利要求1所述的方法,其特征在于,所述根据所述初始信息生成所述数据包的转发路径的目标信息,包括:The method according to claim 1, wherein the generating target information of a forwarding path of the data packet according to the initial information comprises: 步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中第j个节点作为结束节点,设置临时结束节点为空节点,i的取值为1,j的取值为i+1,执行步骤二;Step 1: Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and a j-th node in the node list as an ending node, and set a temporary ending node as For empty nodes, the value of i is 1 and the value of j is i + 1. Go to step 2. 步骤二,判断所述结束节点是否是所述节点列表中的最后一个节点,若是,则执行步骤八,否则执行步骤三;Step 2: determine whether the ending node is the last node in the node list, and if so, perform step 8; otherwise, perform step 3; 步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;Step 3: Determine whether the path indicated by all the nodes in the node list from the start node to the end node is in order from the start node to the end node in the segment route. The only shortest path between them, if yes, go to step 4, otherwise go to step 5; 步骤四,将所述临时结束节点更新为所述结束节点,j的取值更新为j+1,再将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;Step four: update the temporary ending node to the ending node, and update the value of j to j + 1, then use the jth node in the node list as the ending node, and perform step two again; 步骤五,判断所述临时结束节点是否为空,若不是,则执行步骤六,否则执行步骤七;Step five: determine whether the temporary end node is empty; if not, perform step six; otherwise, perform step seven; 步骤六,在所述目标信息中记录所述临时结束节点的节点段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;Step 6: Record the node segment identifier of the temporary ending node in the target information, update the value of i to be equal to j-1, and then update the value of j to j, and update the i-th node in the node list. Three nodes as the starting node, the j-th node in the node list as the ending node, leaving the temporary ending node empty, and performing step two again; 步骤七,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为j+1,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;Step 7. Record the identifier of the adjacent segment indicating the path between the start node and the end node in the target information, and the value of i is updated to be equal to the value of j. After that, the value of j Update the value to j + 1, then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and perform step two again; 步骤八,判断所述起始节点是否为所述节点列表中的倒数第二个节点,若不是,则执行步骤九,否则执行步骤十;Step 8. Determine whether the starting node is the penultimate node in the node list, and if not, perform step 9; otherwise, perform step 10; 步骤九,在所述目标信息中记录所述结束节点的节点段标识,并结束执行;Step Nine: record the node segment identifier of the ending node in the target information, and end execution; 步骤十,在所述目标信息中记录所述用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,并结束执行。Step 10: Record the adjacent segment identifier used to indicate the path between the start node and the end node in the target information, and end execution. 根据权利要求1至5中任一项所述的方法,其特征在于,所述初始信息为邻接段标识列表,所述初始信息中的路径标识为邻接段标识。The method according to any one of claims 1 to 5, wherein the initial information is an adjacent segment identifier list, and the path identifier in the initial information is an adjacent segment identifier. 根据权利要求1至6中任一项所述的方法,其特征在于,所述方法由所述数据包的转发路径的入节点执行;The method according to any one of claims 1 to 6, wherein the method is performed by an ingress node of a forwarding path of the data packet; 其中,所述方法还包括:The method further includes: 根据所述目标信息发送所述数据包,所述数据包中包括所述目标信息。Sending the data packet according to the target information, and the data packet includes the target information. 根据权利要求1至6中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 6, wherein the method further comprises: 控制器向所述数据包的转发路径的入节点发送所述目标信息。The controller sends the target information to an ingress node of a forwarding path of the data packet. 一种段路由中获取数据包的转发路径的信息的装置,其特征在于,包括:A device for obtaining information about a forwarding path of a data packet in a segment route, which is characterized in that it includes: 获取模块,用于获取数据包的转发路径的初始信息,所述初始信息包括多个路径标识;An obtaining module, configured to obtain initial information of a forwarding path of a data packet, where the initial information includes multiple path identifiers; 生成模块,用于根据所述初始信息生成所述数据包的转发路径的目标信息,所述目标路径信息包括一个或多个节点段标识,所述目标信息中至少有一个节点段标识对应于所述初始信息中的多个路径标识,所述初始信息中对应于所述目标信息中的节点段标识的多个路径标识所指示的第一路径为所述段路由中所述第一路径的起始节点至所述第一路径的结束节点之间唯一的最短路径,所述目标信息中对应于所述初始信息中的多个路径标识的每个节点段标识为所述每个节点段标识对应的所有路径标识所指示的路径的结束节点的节点段标识。A generating module, configured to generate target information of a forwarding path of the data packet according to the initial information, the target path information includes one or more node segment identifiers, and at least one node segment identifier in the target information corresponds to the The plurality of path identifiers in the initial information, and the first path indicated by the plurality of path identifiers corresponding to the node segment identifier in the target information is the starting point of the first path in the segment route The only shortest path between the start node and the end node of the first path, and each node segment identifier in the target information corresponding to multiple path identifiers in the initial information corresponds to each node segment identifier The node segment ID of the end node of the path indicated by all path IDs. 根据权利要求9所述的装置,其特征在于,所述生成模块具体用于执行以下步骤:The apparatus according to claim 9, wherein the generating module is specifically configured to perform the following steps: 步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中的第j个节点作为结束节点,i的取值为1,j的取值为所述节点列表的长度值,执行步骤二;Step 1: Obtain a node list of the forwarding path of the data packet, use the i-th node in the node list as the starting node, and the j-th node in the node list as the ending node, and the value of i Is 1, the value of j is the length of the node list, and step 2 is performed; 步骤二,判断所述起始节点与所述结束节点是否是同一个节点,若是,则结束执行,否则执行步骤三;Step 2: determine whether the starting node and the ending node are the same node; if yes, terminate the execution; otherwise, execute step 3; 步骤三,判断所述起始节点与所述结束节点是否为所述节点列表中相邻的节点,若是,则执行步骤四,否则执行步骤五;In step three, it is determined whether the starting node and the ending node are adjacent nodes in the node list, and if so, step 4 is performed, otherwise step 5 is performed; 步骤四,在所述目标信息中记录所述起始节点至所述结束节点之间的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;Step 4: Record the identifier of the adjacent segment between the start node and the end node in the target information, and the value of i is updated to be equal to the value of j. After that, the value of j is updated to match the value of The lengths of the node lists are equal, then the i-th node in the node list is used as the starting node, the j-th node in the node list is used as the ending node, and step 2 is performed again; 步骤五,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列时所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤六,否则执行步骤七;Step five, determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the start node to the end node in the segment route The only shortest path between them, if yes, go to step 6, otherwise go to step 7; 步骤六,在所述目标信息中记录所述结束节点的节点段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;Step 6. Record the node segment identifier of the ending node in the target information, update the value of i to be equal to the value of j, and then update the value of j to be equal to the length value of the node list. Then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and perform step 2 again; 步骤七,j的取值更新为j-1,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二。In step 7, the value of j is updated to j-1, the jth node in the node list is used as the ending node, and step 2 is performed again. 根据权利要求9所述的装置,其特征在于,所述生成模块具体用于执行以下步骤:The apparatus according to claim 9, wherein the generating module is specifically configured to perform the following steps: 步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中的第j个节点作为结束节点,i的取值为1,j的取值为所述节点列表的长度值,执行步骤二;Step 1: Obtain a node list of the forwarding path of the data packet, use the i-th node in the node list as the starting node, and the j-th node in the node list as the ending node, and the value of i Is 1, the value of j is the length of the node list, and step 2 is performed; 步骤二,判断所述起始节点与所述结束节点是否是同一个节点,若是,则结束执行,否则执行步骤三;Step 2: determine whether the starting node and the ending node are the same node; if yes, terminate the execution; otherwise, execute step 3; 步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按 顺序排列时所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;Step 3: Determine whether the path indicated when all nodes in the node list from the start node to the end node are arranged in order is the start node to the end node in the segment route The only shortest path between them, if yes, go to step 4, otherwise go to step 5; 步骤四,在所述目标信息中记录所述结束节点的节点段标识,i的取值更新为与j的取值相等,之后,j的取值更新为与所述节点列表的长度值相等,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中的第j个节点作为所述结束节点,并重新执行步骤二;Step four: record the node segment identifier of the ending node in the target information, update the value of i to be equal to the value of j, and then update the value of j to be equal to the length value of the node list, Then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and perform step 2 again; 步骤五,j的取值更新为j-1,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二。In step five, the value of j is updated to j-1, the jth node in the node list is used as the ending node, and step two is performed again. 根据权利要求9所述的装置,其特征在于,所述生成模块具体用于执行以下步骤:The apparatus according to claim 9, wherein the generating module is specifically configured to perform the following steps: 步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中第j个节点作为结束节点,设置临时结束节点为空节点,i的取值为1,j的取值为i+1,执行步骤二;Step 1: Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and a j-th node in the node list as an ending node, and set a temporary ending node as For empty nodes, the value of i is 1 and the value of j is i + 1. Go to step 2. 步骤二,判断所述结束节点是否是所述节点列表中的最后一个节点,若是,则执行步骤十,否则执行步骤三;Step 2: determine whether the ending node is the last node in the node list, and if so, perform step 10; otherwise, perform step 3; 步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;Step 3: Determine whether the path indicated by all the nodes in the node list from the start node to the end node is in order from the start node to the end node in the segment route. The only shortest path between them, if yes, go to step 4, otherwise go to step 5; 步骤四,将所述临时结束节点更新为所述结束节点,j的取值更新为j+1,再将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;Step four: update the temporary ending node to the ending node, and update the value of j to j + 1, then use the jth node in the node list as the ending node, and perform step two again; 步骤五,判断所述临时结束节点是否为空,若不是,则执行步骤六,否则执行步骤七;Step five: determine whether the temporary end node is empty; if not, perform step six; otherwise, perform step seven; 步骤六,判断所述临时结束节点是否为所述起始节点的相邻节点,若是,则执行步骤八,否则执行步骤九;In step 6, it is determined whether the temporary ending node is a neighboring node of the starting node, and if so, step 8 is performed, otherwise step 9 is performed; 步骤七,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为j+1,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;Step 7. Record the identifier of the adjacent segment indicating the path between the start node and the end node in the target information, and the value of i is updated to be equal to the value of j. After that, the value of j Update the value to j + 1, then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and perform step two again; 步骤八,在所述目标信息中记录所述起始节点至所述临时结束节点之间的路径的邻接段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;Step 8. Record the identifier of the adjacent segment of the path between the start node and the temporary end node in the target information, and the value of i is updated to be equal to j-1, and then the value of j is updated to j. Use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, empty the temporary ending node, and perform step 2 again; 步骤九,在所述目标信息中记录所述临时结束节点的节点段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;Step Nine, record the node segment identifier of the temporary ending node in the target information, update the value of i to be equal to j-1, and then update the value of j to j, and update the i-th node in the node list. Three nodes as the starting node, the j-th node in the node list as the ending node, leaving the temporary ending node empty, and performing step two again; 步骤十,判断所述起始节点是否为所述节点列表中的倒数第二个节点,若不是,则执行步骤十一,否则执行步骤十二;Step 10: Determine whether the starting node is the penultimate node in the node list, and if not, perform Step 11; otherwise, perform Step 12; 步骤十一,在所述目标信息中记录所述结束节点对应的节点段标识,并结束执行;Step 11: Record the node segment identifier corresponding to the ending node in the target information and end execution; 步骤十二,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,并结束执行。In step twelve, an identifier of an adjacent segment indicating a path between the start node and the end node is recorded in the target information, and execution is terminated. 根据权利要求9所述的装置,其特征在于,所述生成模块具体用于执行以下步骤:The apparatus according to claim 9, wherein the generating module is specifically configured to perform the following steps: 步骤一,获取所述数据包的转发路径的节点列表,将所述节点列表中的第i个节点作为起始节点,将所述节点列表中第j个节点作为结束节点,设置临时结束节点为空节点,i的取值为1,j的取值为i+1,执行步骤二;Step 1: Obtain a node list of a forwarding path of the data packet, use an i-th node in the node list as a starting node, and a j-th node in the node list as an ending node, and set a temporary ending node as For empty nodes, the value of i is 1 and the value of j is i + 1. Go to step 2. 步骤二,判断所述结束节点是否是所述节点列表中的最后一个节点,若是,则执行步骤八,否则执行步骤三;Step 2: determine whether the ending node is the last node in the node list, and if so, perform step 8; otherwise, perform step 3; 步骤三,判断所述节点列表中由所述起始节点至所述结束节点之间的所有节点按顺序排列所指示的路径是否为所述段路由中所述起始节点至所述结束节点之间唯一的最短路径,若是,则执行步骤四,否则执行步骤五;Step 3: Determine whether the path indicated by all the nodes in the node list from the start node to the end node is in order from the start node to the end node in the segment route. The only shortest path between them, if yes, go to step 4, otherwise go to step 5; 步骤四,将所述临时结束节点更新为所述结束节点,j的取值更新为j+1,再将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;Step four: update the temporary ending node to the ending node, and update the value of j to j + 1, then use the jth node in the node list as the ending node, and perform step two again; 步骤五,判断所述临时结束节点是否为空,若不是,则执行步骤六,否则执行步骤七;Step five: determine whether the temporary end node is empty; if not, perform step six; otherwise, perform step seven; 步骤六,在所述目标信息中记录所述临时结束节点的节点段标识,i的取值更新为与j-1相等,之后,j的取值更新为j,将所述节点列表中第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,将所述临时结束节点置空,并重新执行步骤二;Step 6: Record the node segment identifier of the temporary ending node in the target information, update the value of i to be equal to j-1, and then update the value of j to j, and update the i-th node in the node list. Three nodes as the starting node, the j-th node in the node list as the ending node, leaving the temporary ending node empty, and performing step two again; 步骤七,在所述目标信息中记录用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,i的取值更新为与j的取值相等,之后,j的取值更新为j+1,再将所述节点列表中的第i个节点作为所述起始节点,将所述节点列表中第j个节点作为所述结束节点,并重新执行步骤二;Step 7. Record the identifier of the adjacent segment indicating the path between the start node and the end node in the target information, and the value of i is updated to be equal to the value of j. After that, the value of j Update the value to j + 1, then use the i-th node in the node list as the starting node, the j-th node in the node list as the ending node, and perform step two again; 步骤八,判断所述起始节点是否为所述节点列表中的倒数第二个节点,若不是,则执行步骤九,否则执行步骤十;Step 8. Determine whether the starting node is the penultimate node in the node list, and if not, perform step 9; otherwise, perform step 10; 步骤九,在所述目标信息中记录所述结束节点的节点段标识,并结束执行;Step Nine: record the node segment identifier of the ending node in the target information, and end execution; 步骤十,在所述目标信息中记录所述用于指示所述起始节点至所述结束节点之间的路径的邻接段标识,并结束执行。Step 10: Record the adjacent segment identifier used to indicate the path between the start node and the end node in the target information, and end execution. 根据权利要求9至13中任一项所述的装置,其特征在于,所述初始信息为邻接段标识列表,所述初始信息中的路径标识为邻接段标识。The device according to any one of claims 9 to 13, wherein the initial information is an adjacent segment identifier list, and the path identifier in the initial information is an adjacent segment identifier. 根据权利要求9至14中任一项所述的装置,其特征在于,所述装置为所述数据包的转发路径的入节点;The device according to any one of claims 9 to 14, wherein the device is an ingress node of a forwarding path of the data packet; 其中,所述装置还包括发送模块,用于根据所述目标信息发送所述数据包,所述数据包中包括所述目标信息。The device further includes a sending module, configured to send the data packet according to the target information, where the data packet includes the target information. 根据权利要求9至14中任一项所述的装置,其特征在于,所述装置为所述段路由的控制器;The device according to any one of claims 9 to 14, wherein the device is a controller of the segment routing; 其中,所述装置还包括发送模块,用于向所述数据包的转发路径的入节点发送所述目标信息。The device further includes a sending module, configured to send the target information to an ingress node of a forwarding path of the data packet. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有程序,当所述程序运行时,实现如权利要求1至8中任一项所述的方法。A computer-readable storage medium, characterized in that a program is stored on the computer-readable storage medium, and when the program runs, the method according to any one of claims 1 to 8 is implemented. 一种段路由中获取数据包的转发路径的信息的装置,其特征在于,包括:A device for obtaining information about a forwarding path of a data packet in a segment route, which is characterized in that it includes: 与程序指令相关的硬件,所述硬件用于执行权1至8中任一项所述的方法。Program instruction-related hardware for performing the method of any one of claims 1 to 8.
PCT/CN2019/092446 2018-07-09 2019-06-23 Method and apparatus for obtaining information of forwarding path of data packet in segment routing Ceased WO2020010999A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19834260.2A EP3806406B1 (en) 2018-07-09 2019-06-23 Method and apparatus for obtaining information of forwarding path of data packet in segment routing
US17/145,564 US11677657B2 (en) 2018-07-09 2021-01-11 Method and apparatus for obtaining information about forwarding path of data packet in segment routing

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810744644.X 2018-07-09
CN201810744644.XA CN110708243B (en) 2018-07-09 2018-07-09 Method and device for obtaining forwarding path information of data packets in segment routing

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/145,564 Continuation US11677657B2 (en) 2018-07-09 2021-01-11 Method and apparatus for obtaining information about forwarding path of data packet in segment routing

Publications (1)

Publication Number Publication Date
WO2020010999A1 true WO2020010999A1 (en) 2020-01-16

Family

ID=69142263

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/092446 Ceased WO2020010999A1 (en) 2018-07-09 2019-06-23 Method and apparatus for obtaining information of forwarding path of data packet in segment routing

Country Status (4)

Country Link
US (1) US11677657B2 (en)
EP (1) EP3806406B1 (en)
CN (1) CN110708243B (en)
WO (1) WO2020010999A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021189993A1 (en) * 2020-03-23 2021-09-30 中兴通讯股份有限公司 Routing method, routing apparatus and computer-readable storage medium
EP4120742A4 (en) * 2020-03-09 2024-03-20 China Mobile Communication Co., Ltd Research Institute PATH ESTABLISHMENT METHOD, DATA TRANSMISSION METHOD AND APPARATUS, NETWORK NODE, AND STORAGE MEDIUM

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971433B (en) * 2018-09-29 2022-02-22 华为技术有限公司 Method, device and system for acquiring SRv6 tunnel information
CN113141339B (en) * 2020-01-20 2024-11-05 华为技术有限公司 A method, device and system for transmitting SR message
CN113315702B (en) 2020-02-26 2025-02-11 华为技术有限公司 A method, device and system for transmitting node identification
CN115865769A (en) * 2021-09-23 2023-03-28 华为技术有限公司 Message processing method, network device and system
CN114363236B (en) * 2021-12-20 2023-10-20 鹏城实验室 Flow control method based on explicit path and related equipment
CN120434189A (en) * 2024-02-05 2025-08-05 华为技术有限公司 A message sending method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105850082A (en) * 2013-08-23 2016-08-10 华为技术有限公司 Segmented source routing in a network
CN105871721A (en) * 2015-01-19 2016-08-17 中兴通讯股份有限公司 Segment routing processing method, processing device and sending device
WO2017198319A1 (en) * 2016-05-20 2017-11-23 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for segment routing and rsvp-te routing in transport sdn networks
CN108156077A (en) * 2016-12-02 2018-06-12 中兴通讯股份有限公司 A kind of Segment routing retransmission method and device based on IPv6 data planes

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9537718B2 (en) * 2013-03-15 2017-01-03 Cisco Technology, Inc. Segment routing over label distribution protocol
US9537769B2 (en) * 2013-03-15 2017-01-03 Cisco Technology, Inc. Opportunistic compression of routing segment identifier stacks
US9369387B2 (en) * 2013-10-24 2016-06-14 Cisco Technology, Inc. Segment routing based wide area network orchestration in a network environment
CN105282028A (en) * 2014-06-05 2016-01-27 中兴通讯股份有限公司 Message transmission method, nodes and path management servers
US9807001B2 (en) * 2014-07-17 2017-10-31 Cisco Technology, Inc. Segment routing using a remote forwarding adjacency identifier
US10757012B2 (en) * 2014-12-23 2020-08-25 Telefonaktiebolaget Lm Ericsson (Publ) Path computation in a segment routing network
US10326688B2 (en) * 2017-05-25 2019-06-18 Nokia Of America Corporation Method and apparatus for instantiating a path with the minimum number of segments
US10742599B2 (en) * 2017-06-30 2020-08-11 Juniper Networks, Inc. Conflict resolution in segment routing
CN109218189B (en) * 2017-07-03 2022-04-29 中兴通讯股份有限公司 Method, device and storage medium for determining identification information of a cross-domain path

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105850082A (en) * 2013-08-23 2016-08-10 华为技术有限公司 Segmented source routing in a network
CN105871721A (en) * 2015-01-19 2016-08-17 中兴通讯股份有限公司 Segment routing processing method, processing device and sending device
WO2017198319A1 (en) * 2016-05-20 2017-11-23 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for segment routing and rsvp-te routing in transport sdn networks
CN108156077A (en) * 2016-12-02 2018-06-12 中兴通讯股份有限公司 A kind of Segment routing retransmission method and device based on IPv6 data planes

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3806406A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4120742A4 (en) * 2020-03-09 2024-03-20 China Mobile Communication Co., Ltd Research Institute PATH ESTABLISHMENT METHOD, DATA TRANSMISSION METHOD AND APPARATUS, NETWORK NODE, AND STORAGE MEDIUM
WO2021189993A1 (en) * 2020-03-23 2021-09-30 中兴通讯股份有限公司 Routing method, routing apparatus and computer-readable storage medium

Also Published As

Publication number Publication date
CN110708243B (en) 2021-08-13
EP3806406A4 (en) 2021-07-21
EP3806406B1 (en) 2024-01-24
EP3806406A1 (en) 2021-04-14
CN110708243A (en) 2020-01-17
US20210135979A1 (en) 2021-05-06
US11677657B2 (en) 2023-06-13

Similar Documents

Publication Publication Date Title
WO2020010999A1 (en) Method and apparatus for obtaining information of forwarding path of data packet in segment routing
EP3742685B1 (en) Packet processing method and device
US6968393B1 (en) Method and apparatus for an attribute oriented routing update
RU2643475C2 (en) Multi-domain relaying with routing from source based on interacting network controllers
US12267226B2 (en) Routing control method and apparatus
EP4270898B1 (en) Message processing method, device, and computer storage medium
US10038623B2 (en) Reducing flooding of link state changes in networks
JP7403635B2 (en) METHODS, APPARATUS AND SYSTEM FOR FORWARDING PACKETS IN SR NETWORK
JP2020520612A (en) Packet transmission method, edge device, and machine-readable storage medium
JP5888338B2 (en) Communication system and communication method
JP2016134876A (en) Information processing system, information processing apparatus, and information processing system control method
JP2016012896A (en) Communication device and multi-hopping network
CN112448888A (en) Method, equipment and system for forwarding message in SR network
EP4152701A1 (en) Routing processing method and related device
WO2017143717A1 (en) Multicast information processing method and device
WO2018184487A1 (en) Bier message forwarding method and device
CN104937878B (en) The method that Protocol Independent Multicast tree is established in the presence of unidirectional tunnel
US7764692B1 (en) Bypass of routing protocol filtering in a multi-subnet network
US20080212585A1 (en) Preventing Loops during Recovery in Network Rings Using Cost Metric Routing Protocol
CN104684011B (en) The measuring method of dynamic topology in a kind of wireless sensor network
US20210344592A1 (en) Transfer device and transfer method
JP6134571B2 (en) Communication confirmation device, network system, communication confirmation method, and communication confirmation program
WO2022232712A1 (en) Framework for bier fast reroute
WO2025145572A1 (en) Message processing method, communication node and storage medium
WO2018107475A1 (en) Method and device for processing data packet

Legal Events

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

Ref document number: 19834260

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019834260

Country of ref document: EP

Effective date: 20210108