WO2021233168A1 - Method and device for sending packet - Google Patents

Method and device for sending packet Download PDF

Info

Publication number
WO2021233168A1
WO2021233168A1 PCT/CN2021/093168 CN2021093168W WO2021233168A1 WO 2021233168 A1 WO2021233168 A1 WO 2021233168A1 CN 2021093168 W CN2021093168 W CN 2021093168W WO 2021233168 A1 WO2021233168 A1 WO 2021233168A1
Authority
WO
WIPO (PCT)
Prior art keywords
network node
label
forwarding path
node
network
Prior art date
Application number
PCT/CN2021/093168
Other languages
French (fr)
Chinese (zh)
Inventor
李臣习
兰如钦
刘国权
李海潮
胡志波
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021233168A1 publication Critical patent/WO2021233168A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]

Definitions

  • This application relates to the field of communications, and in particular to a method and device for message sending.
  • the route saved by the network node ie, network device, such as a router (router, RT)
  • the interior gateway protocol Interior Gateway Protocol, IGP
  • the Border Gateway Protocol BGP
  • IGP Interior Gateway Protocol
  • BGP Border Gateway Protocol
  • segment routing (SR) technology can be used to solve the convergence loop problem.
  • SR segment routing
  • a forwarding path label switching path, LSP
  • LSP label switching path
  • SID link segment identification
  • the label stack can be ⁇ 1001,1002,1003,1004,1005 ⁇ , for example, where 1001 is the neighbor segment label (adjacency segment identifier, Adj-SID) between RT2 and RT3, and Adj-SID can also be called a link Label, 1002 is the link label between RT3 and RT4, 1003 is the link label between RT4 and RT5, 1004 is the link label between RT5 and RT6, and 1005 is the link label between RT6 and RT7.
  • Adj-SID neighbor segment label
  • RT3 and RT4 1003 is the link label between RT4 and RT5
  • 1004 is the link label between RT5 and RT6 and RT7.
  • the label stack capacity of each network node is limited, that is, the number of labels that can be pushed in the label stack of each network node is limited (such as layer 2, layer 3, layer 6). Or 10 layers, etc.).
  • the longer the forwarding path the longer the label stack (also called the deeper).
  • the label stack cannot be pushed in, that is, the packet cannot be forwarded according to the label stack.
  • the label stack corresponding to the forwarding path includes 5 layers of labels
  • the label stack capability of RT1 is 3 layers
  • RT1 cannot forward packets according to the label stack.
  • the embodiments of the present application provide a method and device for sending a message, which can shorten the length of the label stack of the message. Under the condition that the label stack capability of the network device remains unchanged, it can support more scenarios (for example, it can support longer The scenario of the forwarding path).
  • an embodiment of the present application provides a method for sending a message, including: a first network node determines that a first forwarding path for forwarding a message is unavailable; in response to determining that the first forwarding path is unavailable, the first network The node determines the second forwarding path for forwarding the message; the first network node adds a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network The link label of the link between the node and the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, between the first network node and the second network node The shortest path does not include the first forwarding path, and the second network node is a network node on the second forwarding path; the first network node sends the packet with the label stack added.
  • the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding one between the first network node and the second network node in the label stack.
  • multiple link labels or node labels can shorten the length of the label stack, and can support more scenarios (for example, scenarios where a longer forwarding path can be supported) under the condition that the label stack capability of the network device remains unchanged.
  • the unavailability of the first forwarding path for forwarding packets includes at least one of the following: the minimum link cost of the first forwarding path is greater than or equal to a preset threshold; or the first forwarding path fails; Or the first forwarding path is congested.
  • the second network node is the network node that is the farthest from the first network node among the M network nodes, the M network nodes are respectively located on the second forwarding path, and the first network node reaches The shortest path between each of the M network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1. It is understandable that the second network node is the network node that is the farthest from the first network node among the M network nodes, that is, the second network node is the network node that is separated from the first network node by the number of hops in the M network nodes the most. For the network node, since the label stack does not include the link label or the node label of the link between the first network node and the second network node, the length of the label stack can be greatly shortened.
  • the second forwarding path includes a third network node
  • the third network node is a next-hop network node of the second network node in the second forwarding path
  • the method further includes: the first network node determines Whether the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node
  • the label stack further includes a link label between the second network node and the third network node.
  • the connection between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the connection between the second network node and the third network node
  • the direct link of is not the shortest path between the second network node and the third network node. Since the second network node may not have converged or has not known that the link in the network has failed, the second network node determines independently The shortest path between the second network node and the third network node may include a faulty link, causing loop problems.
  • the second forwarding path includes a third network node
  • the third network node is a next-hop network node of the second network node in the second forwarding path
  • the method further includes: the first network node determines Whether the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node When the link cost is less than or equal to the minimum link cost between the first network node and the third network node, the label stack does not include the link label between the second network node and the third network node.
  • the direct link between the second network node and the third network node is the shortest path between the second network node and the third network node.
  • the second network node can send packets to the third network node autonomously (that is, according to its own path plan).
  • the link label between the second network node and the third network node is added to the stack.
  • the second forwarding path includes a fourth network node
  • the fourth network node is a next-hop network node of the third network node in the second forwarding path
  • the method further includes: the first network node determines Whether the minimum link cost between the third network node and the fourth network node is greater than the minimum link cost between the first network node and the fourth network node; the minimum link between the third network node and the fourth network node When the cost is greater than the minimum link cost between the first network node and the fourth network node, the label stack further includes a link label between the third network node and the fourth network node.
  • the second forwarding path includes a fourth network node
  • the fourth network node is a next-hop network node of the third network node in the second forwarding path
  • the method further includes: the first network node determines Whether the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node; the minimum link between the third network node and the fourth network node When the path cost is less than or equal to the minimum link cost between the first network node and the fourth network node, the label stack does not include the link label between the third network node and the fourth network node.
  • the label stack when the label stack does not include the link label between the second network node and the third network node, and the label stack includes the link label between the third network node and the fourth network node , the label stack also includes the node label of the third network node. This is because the second network node may not be able to identify the link label between the third network node and the fourth network node. When the message is forwarded to the second network node, the second network node cannot identify the link label between the third network node and the fourth network node. The label of the link between network nodes determines how to send the message.
  • an embodiment of the present application provides a first network node, including: a determining unit, configured to determine that a first forwarding path for forwarding packets is unavailable; and a determining unit, further configured to respond to determining the first forwarding path Not available, determine the second forwarding path for forwarding the message; the processing unit is configured to add a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include The link label of the link between the first network node and the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, the first network node and the second network The shortest path between nodes does not include the first forwarding path, and the second network node is a network node on the second forwarding path; the sending unit is configured to send the message with the label stack added.
  • the unavailability of the first forwarding path for forwarding packets includes at least one of the following: the minimum link cost of the first forwarding path is greater than or equal to a preset threshold; or the first forwarding path fails; Or the first forwarding path is congested.
  • the second network node is the network node that is the farthest from the first network node among the M network nodes, the M network nodes are respectively located on the second forwarding path, and the first network node reaches The shortest path between each of the M network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1.
  • the second forwarding path includes a third network node
  • the third network node is a next-hop network node of the second network node in the second forwarding path
  • the determining unit is further configured to: determine the second network Whether the minimum link cost between the node and the third network node is greater than the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node is greater than When the link cost between the first network node and the third network node is the smallest, the label stack further includes the link label between the second network node and the third network node.
  • the second forwarding path includes a third network node
  • the third network node is a next-hop network node of the second network node in the second forwarding path
  • the determining unit is further configured to: determine the second network Whether the minimum link cost between the node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node When it is less than or equal to the minimum link overhead between the first network node and the third network node, the label stack does not include the link label between the second network node and the third network node.
  • the second forwarding path includes a fourth network node
  • the fourth network node is a next-hop network node of the third network node in the second forwarding path
  • the determining unit is further configured to: determine the third network Whether the minimum link cost between the node and the fourth network node is greater than the minimum link cost between the first network node and the fourth network node; the minimum link cost between the third network node and the fourth network node is greater than the first network node
  • the label stack also includes a link label between the third network node and the fourth network node.
  • the second forwarding path includes a fourth network node
  • the fourth network node is a next-hop network node of the third network node in the second forwarding path
  • the determining unit is further configured to: determine the third network Whether the minimum link cost between the node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node; the minimum link cost between the third network node and the fourth network node is less than When equal to the minimum link overhead between the first network node and the fourth network node, the label stack does not include the link label between the third network node and the fourth network node.
  • the label stack when the label stack does not include the link label between the second network node and the third network node, and the label stack includes the link label between the third network node and the fourth network node , the label stack also includes the node label of the third network node.
  • the present application also provides a communication device, which may be a first network node or a chip.
  • the communication device includes a processor, configured to implement any one of the methods provided in the first aspect.
  • the communication device may further include a memory for storing program instructions and data.
  • the memory may be a memory integrated in the communication device or an off-chip memory provided outside the communication device.
  • the memory is coupled with the processor, and the processor can call and execute the program instructions stored in the memory to implement any one of the methods provided in the first aspect.
  • the memory can be provided in the processor, or the memory and the processor can be provided independently.
  • the communication device may further include a transceiver (communication interface/interface circuit), which is used for the communication device to communicate with other devices (for example, a next-hop network node of the first network node).
  • the present application provides a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute any of the methods provided in the first aspect.
  • this application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the methods provided in the first aspect.
  • the present application provides a chip system, which includes a processor and may also include a memory, configured to implement any one of the methods provided in the first aspect.
  • the chip system can be composed of chips, or it can include chips and other discrete devices.
  • the present application provides a message sending system, including a first network node and a second network node, wherein: the first network node is used to determine that the first forwarding path for forwarding the message is unavailable; responding To determine that the first forwarding path is not available, determine the second forwarding path for forwarding the message; add a label stack corresponding to the second forwarding path to the message; the label stack includes the node label of the second network node, and the label stack is not Including the link label of the link between the first network node and the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, the first network node and the second network node.
  • the shortest path between network nodes does not include the first forwarding path, and the second network node is a network node on the second forwarding path; sends the packet with the label stack added to the second network node; the second network node receives the label added Stack messages, and send the messages according to the label
  • Figure 1 is a schematic diagram of a network architecture in the prior art
  • FIG. 2 is a schematic diagram of yet another network architecture in the prior art
  • FIG. 3 is a schematic diagram of a network architecture provided by an embodiment of the application.
  • FIG. 4 is a schematic structural diagram of a first network node provided by an embodiment of this application.
  • FIG. 5 is a schematic diagram of signals applicable to a method for sending a message according to an embodiment of the application
  • FIG. 6 is a schematic diagram of another network architecture provided by an embodiment of this application.
  • FIG. 7 is a schematic diagram of a shortest path tree of RT1 provided by an embodiment of this application.
  • FIG. 8 is a schematic diagram of another network architecture provided by an embodiment of this application.
  • FIG. 9 is a schematic diagram of another network architecture provided by an embodiment of this application.
  • FIG. 10 is a schematic structural diagram of yet another first network node provided by an embodiment of this application.
  • the embodiment of the present application provides a method for sending a message, which can be applied in an autonomous network system, for example, in an IGP network. Exemplarily, it can be applied to scenarios such as link failure or congestion in an IGP network.
  • the network architecture may include a first network node, a sixth network node, and other network nodes (for example, network node 1-network node 5).
  • the first network node determines the second forwarding path for forwarding the message.
  • the first forwarding path may include a link between the first network node and the sixth network node.
  • the second forwarding path may include a link between forwarding node 1-forwarding node 5, that is, the first network node can forward the message to the sixth network node through forwarding node 1-forwarding node 5.
  • the first network node may add a label stack corresponding to the second forwarding path to the message, so that forwarding node 1-forwarding node 5 can forward the message according to the label stack.
  • the label stack capacity of each network node is limited, that is, the number of labels that can be pushed in the label stack of each network node is limited (for example, the labels that can be pushed are 2 layers, 3 layers). Layer, 6 layers or 10 layers, etc., you can press in 2 labels, 3 labels, 6 labels or 10 labels, etc.).
  • the longer the forwarding path the longer (deeper) the label stack.
  • the network node will not be able to correctly process the message containing the label stack.
  • An embodiment of the present application provides a method for sending a message, including: a first network node determines that a first forwarding path for forwarding a message is unavailable; in response to determining that the first forwarding path is unavailable, the first network node determines The second forwarding path for forwarding the message; the first network node adds a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network node and the second network node.
  • the link label of the link between the network nodes, or the label stack does not include the node label of the node between the first network node and the second network node, and the shortest path between the first network node and the second network node does not include On the first forwarding path, the second network node is a node on the second forwarding path; the first network node sends the packet with the label stack added.
  • the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding one between the first network node and the second network node in the label stack.
  • multiple link labels or node labels can shorten the length of the label stack, and can support more scenarios (for example, scenarios where a longer forwarding path can be supported) under the condition that the label stack capability of the network device remains unchanged.
  • the first network node in FIG. 3 of the embodiment of the present application may be implemented by a device, or may be a functional module in a device, which is not specifically limited in the embodiment of the present application. It is understandable that the above functions can be network elements in hardware devices, software functions running on dedicated hardware, or virtualization functions instantiated on platforms (for example, cloud platforms), or chip systems . In the embodiments of the present application, the chip system may be composed of chips, or may include chips and other discrete devices.
  • FIG. 4 shows a schematic diagram of the hardware structure of an apparatus 400 provided by an embodiment of the application.
  • the device 400 includes at least one processor 401, configured to implement the function of the first network node provided in the embodiment of the present application.
  • the device 400 may also include a bus 402 and at least one communication interface 404.
  • the device 400 may also include a memory 403.
  • the processor may be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processing (DSP), or a micro processing unit.
  • CPU central processing unit
  • NP network processor
  • DSP digital signal processing
  • micro processing unit Device, microcontroller, programmable logic device (PLD) or any combination of them.
  • PLD programmable logic device
  • the processor may also be any other device with processing functions, such as a circuit, a device, or a software module.
  • the bus 402 can be used to transfer information between the aforementioned components.
  • the communication interface 404 is used to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
  • the communication interface 404 may be an interface, a circuit, a transceiver or other devices capable of realizing communication, which is not limited in this application.
  • the communication interface 404 may be coupled with the processor 401.
  • the coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, and may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
  • the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), or storage
  • ROM read-only memory
  • RAM random access memory
  • EEPROM electrically erasable programmable read-only memory
  • CD-ROM compact disc
  • optical disc storage including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.
  • magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired commands or data structures
  • Program code and any other medium that can be accessed by the computer but not limited to this.
  • the memory may exist independently, or may be coupled with the processor, for example, through the bus 402.
  • the memory can also be integrated with the processor.
  • the memory 403 is used to store program instructions, and the processor 401 can control the execution, so as to implement the method provided in the following embodiments of the present application.
  • the processor 401 is configured to call and execute instructions stored in the memory 403, so as to implement the method provided in the following embodiments of the present application.
  • the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
  • the memory 403 may be included in the processor 401.
  • the processor 401 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 4.
  • the apparatus 400 may include multiple processors, such as the processor 401 and the processor 405 in FIG. 4. Each of these processors can be a single-CPU (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).
  • the above-mentioned apparatus 400 may be a general-purpose device or a special-purpose device.
  • the first network node 400 may be a router, a switching device (switch) supporting a routing protocol, a network bridge, a gateway, or a device with a similar structure in FIG. 4.
  • the embodiment of the present application does not limit the type of the device 400.
  • an embodiment of the present application provides a method for sending a message, including:
  • the first network node determines that a first forwarding path for forwarding a packet is unavailable.
  • the unavailability of the first forwarding path includes at least one of the following: the minimum link cost of the first forwarding path is greater than or equal to a preset threshold; or, the first forwarding path fails; or, the first forwarding path is congested.
  • the first network node determines a second forwarding path for forwarding the packet.
  • the first forwarding path includes a direct link between the first network node and the sixth network node
  • failure convergence referred to as convergence for short
  • Convergence means that after the first network node finds a link failure, it updates its routing table or shortest path tree (SPT) according to related algorithms (for example, Dijkstra's algorithm) to eliminate the failure of the link to the subsequent traffic forwarding process. Influence.
  • SPT shortest path tree
  • the first network node after convergence may re-determine the forwarding path, that is, the second forwarding path, for the message to be forwarded to the sixth network node.
  • the forwarding path may also be referred to as a convergence path, which is not limited in this application.
  • the foregoing message to be sent to the sixth network node may be a message received by the first network node from other network nodes, or may be a message generated by the first network node, which is not limited in this application.
  • RT1 determines that the direct link between RT1 and RT7 has failed, it can re-determine the forwarding path for the message (packet) to be forwarded to RT7, that is, the second forwarding path. That is, abandon the direct link between RT1 and RT7, and forward the message to RT7 through other network nodes.
  • the second forwarding path determined by RT1 may be RT1->RT2->RT3->RT4->RT5->RT6->RT7.
  • the first network node determines that a link other than its direct link fails, it can also perform failure convergence, and determine a second forwarding path for packets on the first network node that originally need to pass through the failed link.
  • the first network node is RT2
  • the sixth network node is RT7
  • the faulty link is the link between RT1 and RT7.
  • the forwarding path (second forwarding path) can be determined again for the packets to be forwarded to RT7.
  • the second forwarding path may be RT2->RT3->RT4->RT5->RT6->RT7.
  • the first network node adds a label stack corresponding to the second forwarding path to the message.
  • the label stack includes the node label of the second network node, and the label stack does not include the link label of the link between the first network node and the second network node, or the label stack does not include the first network node and the second network
  • the node label of the node between the nodes, the shortest path between the first network node and the second network node does not include the first forwarding path, and the second network node is a node on the second forwarding path.
  • the second network node is the network node that is the furthest away from the first network node among the M network nodes, the M network nodes are respectively located on the second forwarding path, and the first network nodes are respectively connected to M
  • the shortest path between each of the network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1.
  • the M network nodes are network nodes that are not affected by the unavailable first forwarding path.
  • the second network node is the network node that is the furthest away from the first network node among the M network nodes, that is, the second network node is the network node that has the largest number of hops from the first network node among the M network nodes.
  • the M network nodes may include RT2, RT3 and RT4. This is because for RT2, regardless of whether the direct link between RT1 and RT7 is faulty, the shortest path from RT1 to RT2 is not affected, RT1->RT2. For RT3, regardless of whether the direct link between RT1 and RT7 is faulty, the shortest path from RT1 to RT3 is not affected, which is RT1->RT2->RT3.
  • RT4 For RT4, regardless of whether the direct link between RT1 and RT7 is faulty, the shortest path from RT1 to RT4 is not affected, which is RT1->RT2->RT3->RT4.
  • RT2->RT2->RT3->RT4 a shortest path from RT1 to RT4 is not affected.
  • RT4 is the farthest from RT1, that is, the network node separating RT4 and RT1 has the largest number of hops, which is two hops. Therefore, the second network node can be RT4.
  • the M network nodes include all network nodes on the edges that do not include the faulty link in the shortest path tree before the first network node converges, and the second network node is the leaf network of the above-mentioned edge that does not include the faulty link. node.
  • the shortest path tree corresponding to RT1 before the failure convergence.
  • the shortest path tree includes two edges, the root network node of both edges is RT1, and the leaf network nodes of the two edges are respectively For RT4 and RT5, since the edge of the leaf network node RT4 does not include the faulty link, RT1 can determine that the M network nodes include RT2, RT3, and RT4, and the second network node is RT4.
  • the node label of the second network node may be added to (that is, pushed into) the label stack. In this way, the message can be forwarded to the second network node according to the node label of the second network node without pressing one or more link labels or nodes between the first network node and the second network node in the label stack. Labels, which can achieve the purpose of shortening the label stack.
  • the first network node may start hop-by-hop detection from the second network node to determine whether the label stack needs to include other link labels or node labels.
  • the first network node may determine the second network node and the third network node Whether the minimum link cost between nodes is less than the sum of the minimum link cost between the first network node and the third network node and the minimum link cost between the first network node and the second network node.
  • the minimum link cost between the second network node and the third network node refers to the minimum cost of the direct link between the second network node and the third network node, and the difference between the first network node and the third network node
  • the minimum link cost between the first network node and the third network node refers to the cost of all links included in the shortest path between the first network node and the third network node
  • the minimum link cost between the first network node and the second network node refers to the first network node and the second network node.
  • the minimum link cost between the first network node and the second network node is greater than 0, whether the minimum link cost between the second network node and the third network node is less than the difference between the first network node and the third network node.
  • the sum of the minimum link cost between the first network node and the second network node and the minimum link cost between the first network node and the second network node can be simplified to whether the minimum link cost between the second network node and the third network node is less than or equal to the first The minimum link overhead between the network node and the third network node.
  • the first network node can determine whether the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node (or the first network node can It is determined whether the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node), which simplifies the calculation process and saves calculation cost.
  • the label stack does not include the second network node and the third network node
  • the link label between is because when the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node, the difference between the second network node and the third network node
  • the direct link between the second network node and the third network node is the shortest path between the second network node and the third network node.
  • the second network node can send packets to the third network node autonomously (that is, according to its own path plan).
  • the link label between the second network node and the third network node is added to the stack.
  • the label stack When the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the label stack also includes the difference between the second network node and the third network node The label of the link between. This is because when the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the connection between the second network node and the third network node The direct link of is not the shortest path between the second network node and the third network node.
  • the second network node Since the second network node may not have converged or has not known that the link in the network has failed, the second network node determines independently The shortest path between the second network node and the third network node may include a faulty link, causing loop problems. Therefore, it is necessary to add the link label between the second network node and the third network node in the label stack, so that the second network node can send the message according to the link label between the second network node and the third network node To the third network node to avoid loop problems.
  • the link overhead of the direct link between RT4 and RT5 is 1000, and the minimum link cost between RT1 and RT5 is 30 (before the network converges, the shortest path between RT1 and RT5 can be RT1->RT7->RT6->RT5).
  • the minimum link cost between RT4 and RT5 The direct link is not the shortest path between RT4 and RT5.
  • RT4 may pass RT4-> RT3->RT2->RT1->RT7 (the minimum link cost of the forwarding path is less than 1000) forwards the packet. In this way, a loop will be caused between RT3 and RT4, that is, after RT3 forwards the packet to RT4, RT4 It will forward the message to RT3. Therefore, it is necessary to add the link label between RT4 and RT5 in the label stack, so that RT4 can send packets to RT5 according to the link label between RT4 and RT5 to avoid loop problems.
  • the fourth network node is the next-hop network node of the third network node in the second forwarding path, and the first network node determines the third network node and the fourth network Whether the minimum link cost between nodes is greater than the minimum link cost between the first network node and the fourth network node (or the first network node determines whether the minimum link cost between the third network node and the fourth network node is Less than or equal to the minimum link overhead between the first network node and the fourth network node).
  • the minimum link cost between the third network node and the fourth network node refers to the minimum cost of the direct link between the third network node and the fourth network node, and the difference between the first network node and the fourth network node
  • the minimum link cost between the first network node and the fourth network node refers to the cost of all links included in the shortest path between the first network node and the fourth network node.
  • the label stack does not include the third network node and the fourth network node The link label between.
  • the label stack also includes the difference between the third network node and the fourth network node The label of the link between.
  • the label stack may also include the third network node.
  • the node label of the node This is because the second network node may not be able to identify the link label between the third network node and the fourth network node.
  • the second network node cannot identify the link label between the third network node and the fourth network node.
  • the label of the link between network nodes determines how to send the message.
  • the fifth network node is the next-hop network node of the fourth network node in the second forwarding path, and it can be determined whether the label stack includes the connection between the fourth network node and the fifth network node.
  • the link label, and so on, until the last hop network node (for example, the sixth network node) in the second forwarding path is detected.
  • the last hop network node for example, the sixth network node
  • RT1 determines that the second network node is RT4, and can push the node label of RT4 into the label stack. Then RT1 can start hop-by-hop detection from RT4 to determine whether the minimum link overhead between RT4 and RT5 satisfies formula (1):
  • RT4->RT5 represents the minimum link cost between RT4 and RT5, that is, the minimum cost of the direct link between RT4 and RT5.
  • the minimum link cost of the direct link can be based on RT1
  • the routing information before convergence is determined;
  • RT4->RT1(cost) represents the minimum link cost between RT4 and RT1, that is, the cost of the link included in the shortest path between RT4 and RT1, and the cost between RT4 and RT1
  • the minimum link cost is determined by RT1 based on the routing information before convergence;
  • RT1->RT5 (cost) represents the minimum link cost between RT1 and RT5, that is, the cost of the link included in the shortest path between RT1 and RT5;
  • the minimum link overhead between RT1 and RT5 is determined by RT1 based on the routing information before convergence.
  • the minimum link overhead between RT4 and RT5 is 10.
  • RT1 determines the shortest path between RT1 and RT5 based on the path information before convergence is RT1->RT7->RT6->RT5, that is, RT1 to RT5.
  • the label needs to include five-layer link labels such as ⁇ 1001,1002,1003,1004,1005 ⁇
  • five-layer link labels such as ⁇ 1001,1002,1003,1004,1005 ⁇
  • only two layers of labels one layer of node label and one layer of link label are required in the label stack, which shortens the length of the label stack.
  • RT1 may first generate a complete label stack of the second forwarding path, and the complete label stack includes each of the second forwarding paths.
  • the link label of the link may include ⁇ 1001, 1002, 1003, 1004, 1005 ⁇ ; among them, 1001 is the link label between RT2 and RT3, 1002 is the link label between RT3 and RT4, and 1003 is the link label between RT4 and RT4.
  • the link label between RT5, 1004 is the link label between RT5 and RT6, and 1005 is the link label between RT6 and RT7.
  • RT1 determines that the second network node is RT4
  • the link label between RT1 and RT4 can be replaced with the node label of RT4. For example, you can replace 1001 and 1002 in the label stack with 4000, where 4000 is the node label of RT4.
  • this application compresses the label stack by replacing the link label with the node label, so that the label stack is as short as possible. Under the condition that the label stack capacity remains unchanged, more scenarios can be supported (for example, scenarios where a longer forwarding path can be supported).
  • the link label between RT6 and RT7 can be deleted from the label stack.
  • the final label stack only includes RT4 node labels.
  • the labels need to include five-layer link labels such as ⁇ 1001, 1002, 1003, 1004, 1005 ⁇ . In the embodiment of this application, only one label stack is required.
  • the layer node label greatly shortens the length of the label stack.
  • the first network node sends the message with the label stack added.
  • the first network node sends the message to the next-hop network node of the first network node in the second forwarding path.
  • the message carries a label stack, which is the label stack corresponding to the second forwarding path.
  • RT1 can send a message to the next hop network node of RT1 (ie RT2) in the second forwarding path, and the message carries a label stack ⁇ 4000 ⁇ , 4000 is the node label of the second network node (RT4).
  • RT2 After RT2 receives the message, it is determined according to the node label 4000 in the label stack that the message needs to be forwarded to the network node corresponding to the node label 4000 (ie RT4), according to its own shortest path tree, or by looking up the routing table, RT2 can determine The next hop network node is RT3, and then sends a message to RT3.
  • RT3 After RT3 receives the message, it determines the need to forward the message to the network node corresponding to the node label 4000 (ie RT4) according to the node label 4000 in the label stack. According to its shortest path tree, RT3 can determine the next hop The network node is RT4, and then sends a message to RT4.
  • RT4 After RT4 receives the message, it deletes (pops up) the node label 4000, and identifies the destination address of the message (the sixth network node, RT7). RT4 can determine the next hop network node as RT5 according to its shortest path tree , And then send a message to RT5.
  • the destination address of the message can be encapsulated at the Internet Protocol (IP) layer, and the label stack can be encapsulated at the multiprotocol label switching (MPLS) layer.
  • IP Internet Protocol
  • MPLS multiprotocol label switching
  • RT5 After RT5 receives the message, it recognizes the destination address (RT7) of the message. Based on its shortest path tree, RT5 can determine that the next hop network node is RT6, and then send the message to RT6.
  • RT7 the destination address of the message.
  • RT6 After RT6 receives the message, it recognizes the destination address (RT7) of the message. According to its shortest path tree, RT6 can determine that the next hop network node is RT7, and then send the message to RT7 so that RT7 can receive the message .
  • the first network node when the first network node determines that the first forwarding path for forwarding the message is unavailable, it can re-determine the second forwarding path for forwarding the message; the first network node adds Corresponding to the label stack of the second forwarding path, the label stack includes the node label of the second network node, and the label stack does not include the link label of the link between the first network node and the second network node, or the label stack does not include the first network node.
  • the first network node sends the message with the label stack added.
  • the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding one or more links between the first network node and the second network node in the label stack
  • Labels or node labels can shorten the length of the label stack, and can support more scenarios (for example, scenarios that can support a longer forwarding path) under the condition that the label stack capability of the network device remains unchanged.
  • the method provided in the embodiments of the present application is introduced from the perspective of the first network node and the interaction between the first network node and other network nodes.
  • the first network node may include a hardware structure and/or a software module, and realize the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above-mentioned functions is executed by a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
  • FIG. 10 shows a possible structural schematic diagram of the device involved in the foregoing embodiment.
  • the device may be the first network node 10, and the first network node 10 includes : The determining unit 1001, the processing unit 1002, and the sending unit 1003.
  • the determining unit 1001 is configured to determine that the first forwarding path used to forward the packet is unavailable; the determining unit 1001 is further configured to determine that the first forwarding path is not available in response to determining that the first forwarding path is not available
  • the processing unit 1002 is configured to add a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network node and the second network
  • the link label of the link between nodes, or the label stack does not include the node label of the network node between the first network node and the second network node, and the shortest path between the first network node and the second network node does not include
  • the second network node is a network node on the second forwarding path
  • the sending unit 1003 is configured to send the packet with the label stack added.
  • the determining unit 1001 may be used to support the first network node to perform the processes 501 and 502 in FIG. 5.
  • the processing unit 1002 is configured to support the first network node to perform the process 503 in FIG. 5.
  • the sending unit 1003 is configured to support the first network node to perform the process 504 in FIG. 5.
  • the determining unit 1001 and the processing unit 1002 may be the processor 401 and/or the processor 405 in FIG. 4.
  • the sending unit 1003 may be the communication interface 404 in FIG. 4.
  • the division of modules in the embodiments of this application is illustrative, and it is only a logical function division. In actual implementation, there may be other division methods.
  • the functional modules in the various embodiments of this application can be integrated into one process. In the device, it can also exist alone physically, or two or more modules can be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules.
  • the receiving unit and the sending unit may be integrated into the transceiver unit.
  • the methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software When implemented by software, it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a digital video disc (digital video disc, DVD)), or a semiconductor medium (for example, a solid state drive (solid state drives, SSD)) )Wait.

Landscapes

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

Abstract

Embodiments of the present application relate to the field of communications. Provided are a method and device for sending a packet, which can shorten the length of a label stack of a packet. The method comprises: a first network node determines that a first forwarding path used for forwarding a packet is unavailable; in response to determining that the first forwarding path is unavailable, the first network node determines a second forwarding path used for forwarding a packet; the first network node adds, to the packet, a label stack corresponding to the second forwarding path, wherein the label stack comprises a node label of a second network node, and does not comprise a link label of a link between the first network node and the second network node, or the label stack does not comprise a node label of a network node between the first network node and the second network node; the shortest path between the first network node and the second network node does not comprise the first forwarding path; the second network node is a network node on the second forwarding path; the first network node sends the packet having the label stack added.

Description

一种报文发送的方法和装置Method and device for message sending
本申请要求于2020年05月19日提交国家知识产权局、申请号为202010427453.8、申请名称为“一种报文发送的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office on May 19, 2020, the application number is 202010427453.8, and the application name is "a method and device for message transmission", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及通信领域,尤其涉及一种报文发送的方法和装置。This application relates to the field of communications, and in particular to a method and device for message sending.
背景技术Background technique
当网络出现链路故障后,网络节点(即网络设备,例如路由器(router,RT))保存的路由需要进行收敛。网络中可以运行内部网关协议(Interior Gateway Protocol,IGP)或边界网关协议(Border Gateway Protocol,BGP)。如图1所示,当RT1与RT7之间的链路发生故障后,RT1到RT7的路由由原来的RT1->RT7收敛为RT1->RT2->RT7,RT2到RT7的路由由原来的RT2->RT1->RT7收敛为RT2->RT3->RT7,以此类推,直至收敛到RT7。在上述收敛过程中,如果网络节点间的收敛性能存在差异,会导致收敛环路(收敛微环)问题。例如,如果RT2的收敛速度比RT1的收敛速度慢,那么就会在RT1和RT2间形成环路,即RT1将需要发送给RT7的报文转发给RT2后,由于RT2收敛较慢,RT2接收到RT1发送的报文后,会根据收敛前的流量转发路径(即路径RT2-RT1-RT7)转发该报文,即重新将该报文发送给RT1,形成环路。When a link failure occurs in the network, the route saved by the network node (ie, network device, such as a router (router, RT)) needs to be converged. The interior gateway protocol (Interior Gateway Protocol, IGP) or the Border Gateway Protocol (Border Gateway Protocol, BGP) can be run in the network. As shown in Figure 1, when the link between RT1 and RT7 fails, the route from RT1 to RT7 is converged from the original RT1->RT7 to RT1->RT2->RT7, and the route from RT2 to RT7 is changed from the original RT2. ->RT1->RT7 converges to RT2->RT3->RT7, and so on, until it converges to RT7. In the above convergence process, if there are differences in convergence performance between network nodes, it will cause convergence loop (convergence microloop) problems. For example, if the convergence speed of RT2 is slower than the convergence speed of RT1, then a loop will be formed between RT1 and RT2, that is, after RT1 forwards the message that needs to be sent to RT7 to RT2, RT2 has slower convergence, and RT2 receives it. After the message sent by RT1, it will be forwarded according to the traffic forwarding path before convergence (that is, the path RT2-RT1-RT7), that is, the message will be sent to RT1 again, forming a loop.
相关技术中,可以采用分段路由(segment routing,SR)技术解决收敛环路问题。如图2所示,假设RT1与RT7之间的链路发生故障,RT1收敛后,可以根据转发需求为原本需要通过故障链路转发的报文重新确定一条转发路径(label switching path,LSP),并将该转发路径对应的标签栈添加在待转发的报文中。其中,该标签栈包括LSP经过的链路信息,例如链路分段标识(segment identification,SID)。该标签栈例如可以是{1001,1002,1003,1004,1005},其中,1001是RT2和RT3之间的邻居段标签(adjacency segment identifier,Adj-SID),Adj-SID也可以称为链路标签,1002是RT3和RT4之间的链路标签,1003是RT4和RT5之间的链路标签,1004是RT5和RT6之间的链路标签,1005是RT6和RT7之间的链路标签。这样,经过RT1转发到RT7的流量可以按照RT1压入的标签栈进行转发,而不依赖其他网络节点(例如,RT2)的收敛,从而避免出现收敛环路问题。In related technologies, segment routing (SR) technology can be used to solve the convergence loop problem. As shown in Figure 2, assuming that the link between RT1 and RT7 fails, after RT1 converges, a forwarding path (label switching path, LSP) can be re-determined for packets that originally needed to be forwarded through the failed link according to the forwarding requirements. And the label stack corresponding to the forwarding path is added to the message to be forwarded. Wherein, the label stack includes link information that the LSP passes through, such as link segment identification (segment identification, SID). The label stack can be {1001,1002,1003,1004,1005}, for example, where 1001 is the neighbor segment label (adjacency segment identifier, Adj-SID) between RT2 and RT3, and Adj-SID can also be called a link Label, 1002 is the link label between RT3 and RT4, 1003 is the link label between RT4 and RT5, 1004 is the link label between RT5 and RT6, and 1005 is the link label between RT6 and RT7. In this way, the traffic forwarded to RT7 through RT1 can be forwarded according to the label stack pushed by RT1 without relying on the convergence of other network nodes (for example, RT2), thereby avoiding convergence loop problems.
但是,受硬件能力限制,每个网络节点的标签栈能力是有限的,即每个网络节点的标签栈中能够压入的标签的层数是有限制的(比如2层、3层、6层或10层等)。转发路径越长时,标签栈就会越长(也可以称为越深),当标签栈的长度超过网络节点的标签栈能力后,标签栈就无法压入,即无法根据标签栈转发报文。例如,如图2所示,当转发路径对应的标签栈包括5层标签时,而RT1的标签栈能力是3层时,RT1无法根据标签栈转发报文。However, due to the limitation of hardware capabilities, the label stack capacity of each network node is limited, that is, the number of labels that can be pushed in the label stack of each network node is limited (such as layer 2, layer 3, layer 6). Or 10 layers, etc.). The longer the forwarding path, the longer the label stack (also called the deeper). When the length of the label stack exceeds the label stack capacity of the network node, the label stack cannot be pushed in, that is, the packet cannot be forwarded according to the label stack. . For example, as shown in Figure 2, when the label stack corresponding to the forwarding path includes 5 layers of labels, and the label stack capability of RT1 is 3 layers, RT1 cannot forward packets according to the label stack.
发明内容Summary of the invention
本申请实施例提供一种报文发送的方法和装置,能够缩短报文的标签栈的长度,在网 络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。The embodiments of the present application provide a method and device for sending a message, which can shorten the length of the label stack of the message. Under the condition that the label stack capability of the network device remains unchanged, it can support more scenarios (for example, it can support longer The scenario of the forwarding path).
第一方面,本申请实施例提供一种报文发送的方法,包括:第一网络节点确定用于转发报文的第一转发路径不可用;响应于确定第一转发路径不可用,第一网络节点确定用于转发报文的第二转发路径;第一网络节点在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的网络节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的网络节点;第一网络节点发送添加了标签栈的报文。In a first aspect, an embodiment of the present application provides a method for sending a message, including: a first network node determines that a first forwarding path for forwarding a message is unavailable; in response to determining that the first forwarding path is unavailable, the first network The node determines the second forwarding path for forwarding the message; the first network node adds a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network The link label of the link between the node and the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, between the first network node and the second network node The shortest path does not include the first forwarding path, and the second network node is a network node on the second forwarding path; the first network node sends the packet with the label stack added.
基于本申请实施例提供的方法,可以根据标签栈中第二网络节点的节点标签将报文转发至第二网络节点,无需在标签栈中添加第一网络节点至第二网络节点之间的一个或多个链路标签或节点标签,可以缩短标签栈的长度,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。Based on the method provided by the embodiments of the present application, the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding one between the first network node and the second network node in the label stack. Or multiple link labels or node labels can shorten the length of the label stack, and can support more scenarios (for example, scenarios where a longer forwarding path can be supported) under the condition that the label stack capability of the network device remains unchanged.
在一种可能的实现方式中,用于转发报文的第一转发路径不可用包括以下至少一种:第一转发路径的最小链路开销大于等于预设阈值;或者第一转发路径发生故障;或者第一转发路径发生拥塞。In a possible implementation manner, the unavailability of the first forwarding path for forwarding packets includes at least one of the following: the minimum link cost of the first forwarding path is greater than or equal to a preset threshold; or the first forwarding path fails; Or the first forwarding path is congested.
在一种可能的实现方式中,第二网络节点是M个网络节点中与第一网络节点相隔最远的网络节点,M个网络节点分别位于第二转发路径上,且第一网络节点分别到M个网络节点中的每个网络节点之间的最短路径都不包括第一转发路径,M为大于或等于1的整数。可以理解的是,第二网络节点是M个网络节点中与第一网络节点距离最远的网络节点,即第二网络节点是M个网络节点中与第一网络节点相隔网络节点跳数最多的网络节点,由于标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签或节点标签,可以较大程度缩短标签栈的长度。In a possible implementation, the second network node is the network node that is the farthest from the first network node among the M network nodes, the M network nodes are respectively located on the second forwarding path, and the first network node reaches The shortest path between each of the M network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1. It is understandable that the second network node is the network node that is the farthest from the first network node among the M network nodes, that is, the second network node is the network node that is separated from the first network node by the number of hops in the M network nodes the most. For the network node, since the label stack does not include the link label or the node label of the link between the first network node and the second network node, the length of the label stack can be greatly shortened.
在一种可能的实现方式中,第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,该方法还包括:第一网络节点确定第二网络节点与第三网络节点之间的最小链路开销是否大于第一网络节点与第三网络节点之间的最小链路开销;当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,标签栈还包括第二网络节点与第三网络节点之间的链路标签。这是由于当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,第二网络节点与第三网络节点之间的直连链路并非第二网络节点与第三网络节点之间的最短路径,由于第二网络节点可能还未收敛或还未获知网络中的链路发生了故障,因此第二网络节点自主确定的第二网络节点与第三网络节点之间的最短路径可能包括故障链路,导致环路问题。因此需要在标签栈中添加第二网络节点与第三网络节点之间的链路标签,这样,第二网络节点可以根据第二网络节点与第三网络节点之间的链路标签将报文发送至第三网络节点,避免环路问题。In a possible implementation manner, the second forwarding path includes a third network node, and the third network node is a next-hop network node of the second network node in the second forwarding path, and the method further includes: the first network node determines Whether the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node When the path cost is greater than the minimum link cost between the first network node and the third network node, the label stack further includes a link label between the second network node and the third network node. This is because when the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the connection between the second network node and the third network node The direct link of is not the shortest path between the second network node and the third network node. Since the second network node may not have converged or has not known that the link in the network has failed, the second network node determines independently The shortest path between the second network node and the third network node may include a faulty link, causing loop problems. Therefore, it is necessary to add the link label between the second network node and the third network node in the label stack, so that the second network node can send the message according to the link label between the second network node and the third network node To the third network node to avoid loop problems.
在一种可能的实现方式中,第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,该方法还包括:第一网络节点确定第二网络节点与第三网络节点之间的最小链路开销是否小于等于第一网络节点与第三网络节点之间的最小链路开销;当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络 节点与第三网络节点之间的最小链路开销时,标签栈不包括第二网络节点与第三网络节点之间的链路标签。这是由于当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,第二网络节点与第三网络节点之间的直连链路是第二网络节点与第三网络节点之间的最短路径,第二网络节点可以自主(即根据自身的路径规划)将报文发送至第三网络节点,因此无需在标签栈中添加第二网络节点与第三网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a third network node, and the third network node is a next-hop network node of the second network node in the second forwarding path, and the method further includes: the first network node determines Whether the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node When the link cost is less than or equal to the minimum link cost between the first network node and the third network node, the label stack does not include the link label between the second network node and the third network node. This is because when the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node, the difference between the second network node and the third network node The direct link between the second network node and the third network node is the shortest path between the second network node and the third network node. The second network node can send packets to the third network node autonomously (that is, according to its own path plan). The link label between the second network node and the third network node is added to the stack.
在一种可能的实现方式中,第二转发路径包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,该方法还包括:第一网络节点确定第三网络节点与第四网络节点之间的最小链路开销是否大于第一网络节点与第四网络节点之间的最小链路开销;第三网络节点与第四网络节点之间的最小链路开销大于第一网络节点与第四网络节点之间的最小链路开销时,标签栈还包括第三网络节点与第四网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a fourth network node, and the fourth network node is a next-hop network node of the third network node in the second forwarding path, and the method further includes: the first network node determines Whether the minimum link cost between the third network node and the fourth network node is greater than the minimum link cost between the first network node and the fourth network node; the minimum link between the third network node and the fourth network node When the cost is greater than the minimum link cost between the first network node and the fourth network node, the label stack further includes a link label between the third network node and the fourth network node.
在一种可能的实现方式中,第二转发路径包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,该方法还包括:第一网络节点确定第三网络节点与第四网络节点之间的最小链路开销是否小于等于第一网络节点与第四网络节点之间的最小链路开销;第三网络节点与第四网络节点之间的最小链路开销小于等于第一网络节点与第四网络节点之间的最小链路开销时,标签栈不包括第三网络节点与第四网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a fourth network node, and the fourth network node is a next-hop network node of the third network node in the second forwarding path, and the method further includes: the first network node determines Whether the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node; the minimum link between the third network node and the fourth network node When the path cost is less than or equal to the minimum link cost between the first network node and the fourth network node, the label stack does not include the link label between the third network node and the fourth network node.
在一种可能的实现方式中,当标签栈不包括第二网络节点与第三网络节点之间的链路标签,且标签栈包括第三网络节点与第四网络节点之间的链路标签时,标签栈还包括第三网络节点的节点标签。这是由于第二网络节点可能无法识别第三网络节点与第四网络节点之间的链路标签,当报文转发至第二网络节点时,第二网络节点无法根据第三网络节点与第四网络节点之间的链路标签确定如何发送报文。因此需要在标签栈中添加第三网络节点的节点标签,以便第二网络节点将报文发送给第三网络节点,由第三网络节点根据第三网络节点与第四网络节点之间的链路标签将报文转发给第四网络节点。In a possible implementation, when the label stack does not include the link label between the second network node and the third network node, and the label stack includes the link label between the third network node and the fourth network node , The label stack also includes the node label of the third network node. This is because the second network node may not be able to identify the link label between the third network node and the fourth network node. When the message is forwarded to the second network node, the second network node cannot identify the link label between the third network node and the fourth network node. The label of the link between network nodes determines how to send the message. Therefore, it is necessary to add the node label of the third network node to the label stack, so that the second network node sends the message to the third network node, and the third network node uses the link between the third network node and the fourth network node The label forwards the message to the fourth network node.
第二方面,本申请实施例提供一种第一网络节点,包括:确定单元,用于确定用于转发报文的第一转发路径不可用;确定单元,还用于响应于确定第一转发路径不可用,确定用于转发报文的第二转发路径;处理单元,用于在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的网络节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的网络节点;发送单元,用于发送添加了标签栈的报文。In a second aspect, an embodiment of the present application provides a first network node, including: a determining unit, configured to determine that a first forwarding path for forwarding packets is unavailable; and a determining unit, further configured to respond to determining the first forwarding path Not available, determine the second forwarding path for forwarding the message; the processing unit is configured to add a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include The link label of the link between the first network node and the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, the first network node and the second network The shortest path between nodes does not include the first forwarding path, and the second network node is a network node on the second forwarding path; the sending unit is configured to send the message with the label stack added.
在一种可能的实现方式中,用于转发报文的第一转发路径不可用包括以下至少一种:第一转发路径的最小链路开销大于等于预设阈值;或者第一转发路径发生故障;或者第一转发路径发生拥塞。In a possible implementation manner, the unavailability of the first forwarding path for forwarding packets includes at least one of the following: the minimum link cost of the first forwarding path is greater than or equal to a preset threshold; or the first forwarding path fails; Or the first forwarding path is congested.
在一种可能的实现方式中,第二网络节点是M个网络节点中与第一网络节点相隔最远的网络节点,M个网络节点分别位于第二转发路径上,且第一网络节点分别到M个网络节点中的每个网络节点之间的最短路径都不包括第一转发路径,M为大于或等于1的整数。In a possible implementation, the second network node is the network node that is the farthest from the first network node among the M network nodes, the M network nodes are respectively located on the second forwarding path, and the first network node reaches The shortest path between each of the M network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1.
在一种可能的实现方式中,第二转发路径包括第三网络节点,第三网络节点是第二转 发路径中第二网络节点的下一跳网络节点,确定单元还用于:确定第二网络节点与第三网络节点之间的最小链路开销是否大于第一网络节点与第三网络节点之间的最小链路开销;当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,标签栈还包括第二网络节点与第三网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a third network node, the third network node is a next-hop network node of the second network node in the second forwarding path, and the determining unit is further configured to: determine the second network Whether the minimum link cost between the node and the third network node is greater than the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node is greater than When the link cost between the first network node and the third network node is the smallest, the label stack further includes the link label between the second network node and the third network node.
在一种可能的实现方式中,第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,确定单元还用于:确定第二网络节点与第三网络节点之间的最小链路开销是否小于等于第一网络节点与第三网络节点之间的最小链路开销;当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,标签栈不包括第二网络节点与第三网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a third network node, the third network node is a next-hop network node of the second network node in the second forwarding path, and the determining unit is further configured to: determine the second network Whether the minimum link cost between the node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node When it is less than or equal to the minimum link overhead between the first network node and the third network node, the label stack does not include the link label between the second network node and the third network node.
在一种可能的实现方式中,第二转发路径包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,确定单元还用于:确定第三网络节点与第四网络节点之间的最小链路开销是否大于第一网络节点与第四网络节点之间的最小链路开销;第三网络节点与第四网络节点之间的最小链路开销大于第一网络节点与第四网络节点之间的最小链路开销时,标签栈还包括第三网络节点与第四网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a fourth network node, the fourth network node is a next-hop network node of the third network node in the second forwarding path, and the determining unit is further configured to: determine the third network Whether the minimum link cost between the node and the fourth network node is greater than the minimum link cost between the first network node and the fourth network node; the minimum link cost between the third network node and the fourth network node is greater than the first network node When there is a minimum link cost between a network node and a fourth network node, the label stack also includes a link label between the third network node and the fourth network node.
在一种可能的实现方式中,第二转发路径包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,确定单元还用于:确定第三网络节点与第四网络节点之间的最小链路开销是否小于等于第一网络节点与第四网络节点之间的最小链路开销;第三网络节点与第四网络节点之间的最小链路开销小于等于第一网络节点与第四网络节点之间的最小链路开销时,标签栈不包括第三网络节点与第四网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a fourth network node, the fourth network node is a next-hop network node of the third network node in the second forwarding path, and the determining unit is further configured to: determine the third network Whether the minimum link cost between the node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node; the minimum link cost between the third network node and the fourth network node is less than When equal to the minimum link overhead between the first network node and the fourth network node, the label stack does not include the link label between the third network node and the fourth network node.
在一种可能的实现方式中,当标签栈不包括第二网络节点与第三网络节点之间的链路标签,且标签栈包括第三网络节点与第四网络节点之间的链路标签时,标签栈还包括第三网络节点的节点标签。In a possible implementation, when the label stack does not include the link label between the second network node and the third network node, and the label stack includes the link label between the third network node and the fourth network node , The label stack also includes the node label of the third network node.
第三方面,本申请还提供了一种通信装置,该通信装置可以是第一网络节点或芯片。该通信装置包括处理器,用于实现上述第一方面提供的任意一种方法。该通信装置还可以包括存储器,用于存储程序指令和数据,存储器可以是集成在该通信装置内的存储器,或设置在该通信装置外的片外存储器。该存储器与该处理器耦合,该处理器可以调用并执行该存储器中存储的程序指令,用于实现上述第一方面提供的任意一种方法。该存储器可以设置在处理器中,或该存储器与处理器独立设置。该通信装置还可以包括收发器(通信接口/接口电路),该收发器用于该通信装置与其它设备(例如,第一网络节点的下一跳网络节点)进行通信。In the third aspect, the present application also provides a communication device, which may be a first network node or a chip. The communication device includes a processor, configured to implement any one of the methods provided in the first aspect. The communication device may further include a memory for storing program instructions and data. The memory may be a memory integrated in the communication device or an off-chip memory provided outside the communication device. The memory is coupled with the processor, and the processor can call and execute the program instructions stored in the memory to implement any one of the methods provided in the first aspect. The memory can be provided in the processor, or the memory and the processor can be provided independently. The communication device may further include a transceiver (communication interface/interface circuit), which is used for the communication device to communicate with other devices (for example, a next-hop network node of the first network node).
第四方面,本申请提供一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行上述第一方面提供的任意一种方法。In a fourth aspect, the present application provides a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute any of the methods provided in the first aspect.
第五方面,本申请提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面提供的任意一种方法。In the fifth aspect, this application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the methods provided in the first aspect.
第六方面,本申请提供了一种芯片***,该芯片***包括处理器,还可以包括存储器,用于实现上述第一方面提供的任意一种方法。该芯片***可以由芯片构成,也可以包含芯片和其他分立器件。In a sixth aspect, the present application provides a chip system, which includes a processor and may also include a memory, configured to implement any one of the methods provided in the first aspect. The chip system can be composed of chips, or it can include chips and other discrete devices.
第七方面,本申请提供了一种报文发送的***,包括第一网络节点和第二网络节点,其中:第一网络节点用于确定用于转发报文的第一转发路径不可用;响应于确定第一转发路径不可用,确定用于转发报文的第二转发路径;在报文中添加对应第二转发路径的标签栈;标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的网络节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的网络节点;向第二网络节点发送添加了标签栈的报文;第二网络节点接收添加了标签栈的报文,并根据所述标签栈发送所述报文。In a seventh aspect, the present application provides a message sending system, including a first network node and a second network node, wherein: the first network node is used to determine that the first forwarding path for forwarding the message is unavailable; responding To determine that the first forwarding path is not available, determine the second forwarding path for forwarding the message; add a label stack corresponding to the second forwarding path to the message; the label stack includes the node label of the second network node, and the label stack is not Including the link label of the link between the first network node and the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, the first network node and the second network node The shortest path between network nodes does not include the first forwarding path, and the second network node is a network node on the second forwarding path; sends the packet with the label stack added to the second network node; the second network node receives the label added Stack messages, and send the messages according to the label stack.
附图说明Description of the drawings
图1为现有技术中的一种网络架构的示意图;Figure 1 is a schematic diagram of a network architecture in the prior art;
图2为现有技术中的又一种网络架构的示意图;Figure 2 is a schematic diagram of yet another network architecture in the prior art;
图3为本申请实施例提供的一种网络架构示意图;FIG. 3 is a schematic diagram of a network architecture provided by an embodiment of the application;
图4为本申请实施例提供的一种第一网络节点的结构示意图;FIG. 4 is a schematic structural diagram of a first network node provided by an embodiment of this application;
图5为本申请实施例提供的一种报文发送的方法适用的信号示意图;FIG. 5 is a schematic diagram of signals applicable to a method for sending a message according to an embodiment of the application;
图6为本申请实施例提供的又一种网络架构示意图;FIG. 6 is a schematic diagram of another network architecture provided by an embodiment of this application;
图7为本申请实施例提供的一种RT1的最短路径树的示意图;FIG. 7 is a schematic diagram of a shortest path tree of RT1 provided by an embodiment of this application;
图8为本申请实施例提供的又一种网络架构示意图;FIG. 8 is a schematic diagram of another network architecture provided by an embodiment of this application;
图9为本申请实施例提供的又一种网络架构示意图;FIG. 9 is a schematic diagram of another network architecture provided by an embodiment of this application;
图10为本申请实施例提供的又一种第一网络节点的结构示意图。FIG. 10 is a schematic structural diagram of yet another first network node provided by an embodiment of this application.
具体实施方式Detailed ways
本申请实施例提供一种报文发送的方法,可以应用于自治网络***中,例如应用于IGP网络中。示例性的,可以应用于IGP网络中出现链路故障或拥塞等场景中。The embodiment of the present application provides a method for sending a message, which can be applied in an autonomous network system, for example, in an IGP network. Exemplarily, it can be applied to scenarios such as link failure or congestion in an IGP network.
如图3所示,为本申请实施例提供的一种网络架构示意图。该网络架构可以包括第一网络节点、第六网络节点以及其他网络节点(例如,网络节点1-网络节点5)。As shown in FIG. 3, a schematic diagram of a network architecture provided by an embodiment of this application. The network architecture may include a first network node, a sixth network node, and other network nodes (for example, network node 1-network node 5).
当第一网络节点确定用于转发报文的第一转发路径不可用时,响应于确定第一转发路径不可用,第一网络节点确定用于转发报文的第二转发路径。示例性的,第一转发路径可以包括第一网络节点与第六网络节点之间的链路,当该链路发生故障时,第一网络节点确定用于转发报文的第二转发路径,该第二转发路径可以包括转发节点1-转发节点5之间的链路,即第一网络节点可以通过转发节点1-转发节点5将报文转发到第六网络节点。第一网络节点可以在报文中添加对应第二转发路径的标签栈,以便转发节点1-转发节点5可以根据该标签栈转发报文。When the first network node determines that the first forwarding path for forwarding the message is not available, in response to determining that the first forwarding path is not available, the first network node determines the second forwarding path for forwarding the message. Exemplarily, the first forwarding path may include a link between the first network node and the sixth network node. When the link fails, the first network node determines the second forwarding path for forwarding the packet. The second forwarding path may include a link between forwarding node 1-forwarding node 5, that is, the first network node can forward the message to the sixth network node through forwarding node 1-forwarding node 5. The first network node may add a label stack corresponding to the second forwarding path to the message, so that forwarding node 1-forwarding node 5 can forward the message according to the label stack.
受硬件能力限制,每个网络节点的标签栈能力是有限的,即每个网络节点的标签栈中能够压入的标签的层数是有限制的(比如可压入的标签为2层、3层、6层或10层等,即可压入2个标签,3个标签、6个标签或10个标签等)。转发路径越长时,标签栈就会越长(越深),当标签栈的长度超过网络节点的标签栈能力后,网络节点将无法正确处理包含该标签栈的报文。Limited by the hardware capabilities, the label stack capacity of each network node is limited, that is, the number of labels that can be pushed in the label stack of each network node is limited (for example, the labels that can be pushed are 2 layers, 3 layers). Layer, 6 layers or 10 layers, etc., you can press in 2 labels, 3 labels, 6 labels or 10 labels, etc.). The longer the forwarding path, the longer (deeper) the label stack. When the length of the label stack exceeds the label stack capacity of the network node, the network node will not be able to correctly process the message containing the label stack.
本申请实施例提供一种报文发送的方法,包括:第一网络节点确定用于转发报文的第一转发路径不可用;响应于确定第一转发路径不可用,第一网络节点确定用于转发报文的第二转发路径;第一网络节点在报文中添加对应第二转发路径的标签栈,标签栈包括第二 网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的节点;第一网络节点发送添加了标签栈的报文。An embodiment of the present application provides a method for sending a message, including: a first network node determines that a first forwarding path for forwarding a message is unavailable; in response to determining that the first forwarding path is unavailable, the first network node determines The second forwarding path for forwarding the message; the first network node adds a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network node and the second network node. The link label of the link between the network nodes, or the label stack does not include the node label of the node between the first network node and the second network node, and the shortest path between the first network node and the second network node does not include On the first forwarding path, the second network node is a node on the second forwarding path; the first network node sends the packet with the label stack added.
基于本申请实施例提供的方法,可以根据标签栈中第二网络节点的节点标签将报文转发至第二网络节点,无需在标签栈中添加第一网络节点至第二网络节点之间的一个或多个链路标签或节点标签,可以缩短标签栈的长度,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。Based on the method provided by the embodiments of the present application, the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding one between the first network node and the second network node in the label stack. Or multiple link labels or node labels can shorten the length of the label stack, and can support more scenarios (for example, scenarios where a longer forwarding path can be supported) under the condition that the label stack capability of the network device remains unchanged.
本申请实施例图3中的第一网络节点可以由一个设备实现,也可以是一个设备内的一个功能模块,本申请实施例对此不作具体限定。可以理解的是,上述功能既可以是硬件设备中的网络元件,也可以是在专用硬件上运行的软件功能,或者是平台(例如,云平台)上实例化的虚拟化功能,或者是芯片***。本申请实施例中,芯片***可以由芯片构成,也可以包含芯片和其他分立器件。The first network node in FIG. 3 of the embodiment of the present application may be implemented by a device, or may be a functional module in a device, which is not specifically limited in the embodiment of the present application. It is understandable that the above functions can be network elements in hardware devices, software functions running on dedicated hardware, or virtualization functions instantiated on platforms (for example, cloud platforms), or chip systems . In the embodiments of the present application, the chip system may be composed of chips, or may include chips and other discrete devices.
例如,用于实现本申请实施例提供的第一网络节点的功能的装置可以通过图4中的装置400来实现。图4所示为本申请实施例提供的装置400的硬件结构示意图。该装置400中包括至少一个处理器401,用于实现本申请实施例提供的第一网络节点的功能。装置400中还可以包括总线402以及至少一个通信接口404。装置400中还可以包括存储器403。For example, the apparatus for implementing the function of the first network node provided in the embodiment of the present application may be implemented by the apparatus 400 in FIG. 4. FIG. 4 shows a schematic diagram of the hardware structure of an apparatus 400 provided by an embodiment of the application. The device 400 includes at least one processor 401, configured to implement the function of the first network node provided in the embodiment of the present application. The device 400 may also include a bus 402 and at least one communication interface 404. The device 400 may also include a memory 403.
在本申请实施例中,处理器可以是中央处理器(central processing unit,CPU),通用处理器、网络处理器(network processor,NP)、数字信号处理器(digital signal processing,DSP)、微处理器、微控制器、可编程逻辑器件(programmable logic device,PLD)或它们的任意组合。处理器还可以是其它任意具有处理功能的装置,例如电路、器件或软件模块。In the embodiment of the present application, the processor may be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processing (DSP), or a micro processing unit. Device, microcontroller, programmable logic device (PLD) or any combination of them. The processor may also be any other device with processing functions, such as a circuit, a device, or a software module.
总线402可用于在上述组件之间传送信息。The bus 402 can be used to transfer information between the aforementioned components.
通信接口404,用于与其他设备或通信网络通信,如以太网,无线接入网(radio access network,RAN),无线局域网(wireless local area networks,WLAN)等。通信接口404可以是接口、电路、收发器或者其它能够实现通信的装置,本申请不做限制。通信接口404可以和处理器401耦合。本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。The communication interface 404 is used to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc. The communication interface 404 may be an interface, a circuit, a transceiver or other devices capable of realizing communication, which is not limited in this application. The communication interface 404 may be coupled with the processor 401. The coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, and may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
在本申请实施例中,存储器可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,也可以与处理器耦合,例如通过总线402。存储器也可以和处理器集成在一起。In the embodiments of the present application, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), or storage Other types of dynamic storage devices for information and instructions can also be electrically erasable programmable read-only memory (EEPROM), compact disc (read-only memory, CD-ROM) or Other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired commands or data structures Program code and any other medium that can be accessed by the computer, but not limited to this. The memory may exist independently, or may be coupled with the processor, for example, through the bus 402. The memory can also be integrated with the processor.
其中,存储器403用于存储程序指令,并可以由处理器401来控制执行,从而实现本申请下述实施例提供的方法。处理器401用于调用并执行存储器403中存储的指令,从而实现本申请下述实施例提供的方法。The memory 403 is used to store program instructions, and the processor 401 can control the execution, so as to implement the method provided in the following embodiments of the present application. The processor 401 is configured to call and execute instructions stored in the memory 403, so as to implement the method provided in the following embodiments of the present application.
可选的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
可选地,存储器403可以包括于处理器401中。Optionally, the memory 403 may be included in the processor 401.
在具体实现中,作为一种实施例,处理器401可以包括一个或多个CPU,例如图4中的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 401 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 4.
在具体实现中,作为一种实施例,装置400可以包括多个处理器,例如图4中的处理器401和处理器405。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the apparatus 400 may include multiple processors, such as the processor 401 and the processor 405 in FIG. 4. Each of these processors can be a single-CPU (single-CPU) processor or a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).
上述的装置400可以是一个通用设备或者是一个专用设备。在具体实现中,第一网络节点400可以是路由器、支持路由协议的交换设备(交换机)、网桥、网关或有图4中类似结构的设备。本申请实施例不限定装置400的类型。The above-mentioned apparatus 400 may be a general-purpose device or a special-purpose device. In a specific implementation, the first network node 400 may be a router, a switching device (switch) supporting a routing protocol, a network bridge, a gateway, or a device with a similar structure in FIG. 4. The embodiment of the present application does not limit the type of the device 400.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items that have substantially the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and order of execution, and words such as "first" and "second" do not limit the difference.
为了便于理解,以下结合附图对本申请实施例提供的报文发送的方法进行具体介绍。For ease of understanding, the method for sending a message provided by the embodiment of the present application will be specifically introduced below with reference to the accompanying drawings.
如图5所示,本申请实施例提供一种报文发送的方法,包括:As shown in FIG. 5, an embodiment of the present application provides a method for sending a message, including:
501、第一网络节点确定用于转发报文的第一转发路径不可用。501. The first network node determines that a first forwarding path for forwarding a packet is unavailable.
其中,第一转发路径不可用包括以下至少一种:第一转发路径的最小链路开销大于等于预设阈值;或者,第一转发路径发生故障;或者,第一转发路径发生拥塞。Wherein, the unavailability of the first forwarding path includes at least one of the following: the minimum link cost of the first forwarding path is greater than or equal to a preset threshold; or, the first forwarding path fails; or, the first forwarding path is congested.
502、响应于确定第一转发路径不可用,第一网络节点确定用于转发报文的第二转发路径。502. In response to determining that the first forwarding path is unavailable, the first network node determines a second forwarding path for forwarding the packet.
示例性的,假设第一转发路径包括第一网络节点与第六网络节点之间的直连链路,当第一网络设备确定第一网络节点与第六网络节点之间的直连链路发生故障后,可以进行故障收敛(简称为收敛)。收敛是指第一网络节点发现链路故障后,根据相关算法(例如,Dijkstra算法)更新自身的路由表或最短路径树(short path tree,SPT),以排除故障链路对后续流量转发过程的影响。收敛后的第一网络节点可以为待转发至第六网络节点的报文重新确定转发路径,即第二转发路径。或者,转发路径也可以称为收敛路径,本申请不做限定。上述待发送至第六网络节点的报文可以是第一网络节点从其他网络节点接收到的报文,也可以是第一网络节点生成的报文,本申请不做限定。Exemplarily, assuming that the first forwarding path includes a direct link between the first network node and the sixth network node, when the first network device determines that the direct link between the first network node and the sixth network node occurs After a failure, failure convergence (referred to as convergence for short) can be performed. Convergence means that after the first network node finds a link failure, it updates its routing table or shortest path tree (SPT) according to related algorithms (for example, Dijkstra's algorithm) to eliminate the failure of the link to the subsequent traffic forwarding process. Influence. The first network node after convergence may re-determine the forwarding path, that is, the second forwarding path, for the message to be forwarded to the sixth network node. Alternatively, the forwarding path may also be referred to as a convergence path, which is not limited in this application. The foregoing message to be sent to the sixth network node may be a message received by the first network node from other network nodes, or may be a message generated by the first network node, which is not limited in this application.
示例性的,如图6所示,假设网络中设置有7个路由器(图6中的R1至R7),每个路由器为一个网络节点,以第一网络节点为RT1,第六网络节点为RT7为例,当RT1确定RT1与RT7之间的直连链路发生故障后,可以重新为待转发至RT7的报文(报文)确定转发路径,即第二转发路径。也就是放弃RT1与RT7之间的直连链路,通过其他网络节点将报文转发至RT7。示例性的,RT1确定的第二转发路径可以为RT1->RT2->RT3->RT4->RT5->RT6->RT7。Exemplarily, as shown in Fig. 6, suppose that there are 7 routers (R1 to R7 in Fig. 6) set in the network, and each router is a network node. The first network node is RT1 and the sixth network node is RT7. As an example, when RT1 determines that the direct link between RT1 and RT7 has failed, it can re-determine the forwarding path for the message (packet) to be forwarded to RT7, that is, the second forwarding path. That is, abandon the direct link between RT1 and RT7, and forward the message to RT7 through other network nodes. Exemplarily, the second forwarding path determined by RT1 may be RT1->RT2->RT3->RT4->RT5->RT6->RT7.
另外,第一网络节点确定自身的直连链路以外的链路发生故障后,也可以进行故障收 敛,并为第一网络节点上原本需要经过故障链路的报文确定第二转发路径。示例性的,如图6所示,以第一网络节点为RT2,第六网络节点为RT7,故障链路为RT1与RT7之间的链路为例,当RT2确定RT1与RT7之间的直连链路发生故障后,可以重新为待转发至RT7的报文确定转发路径(第二转发路径)。示例性的,第二转发路径可以为RT2->RT3->RT4->RT5->RT6->RT7。In addition, after the first network node determines that a link other than its direct link fails, it can also perform failure convergence, and determine a second forwarding path for packets on the first network node that originally need to pass through the failed link. Exemplarily, as shown in Figure 6, the first network node is RT2, the sixth network node is RT7, and the faulty link is the link between RT1 and RT7. When RT2 determines the direct link between RT1 and RT7, After the connection link fails, the forwarding path (second forwarding path) can be determined again for the packets to be forwarded to RT7. Exemplarily, the second forwarding path may be RT2->RT3->RT4->RT5->RT6->RT7.
503、第一网络节点在报文中添加对应第二转发路径的标签栈。503. The first network node adds a label stack corresponding to the second forwarding path to the message.
其中,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的节点。Wherein, the label stack includes the node label of the second network node, and the label stack does not include the link label of the link between the first network node and the second network node, or the label stack does not include the first network node and the second network The node label of the node between the nodes, the shortest path between the first network node and the second network node does not include the first forwarding path, and the second network node is a node on the second forwarding path.
在一种可能的设计中,第二网络节点是M个网络节点中与第一网络节点相隔最远的网络节点,M个网络节点分别位于第二转发路径上,且第一网络节点分别到M个网络节点中的每个网络节点之间的最短路径都不包括第一转发路径,M为大于或等于1的整数。In a possible design, the second network node is the network node that is the furthest away from the first network node among the M network nodes, the M network nodes are respectively located on the second forwarding path, and the first network nodes are respectively connected to M The shortest path between each of the network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1.
由于第一网络节点分别与M个网络节点之间的最短路径不包括第一转发路径,因此该M个网络节点是不受不可用的第一转发路径影响的网络节点。第二网络节点是M个网络节点中与第一网络节点距离最远的网络节点,即第二网络节点是M个网络节点中与第一网络节点相隔网络节点跳数最多的网络节点。Since the shortest paths between the first network node and the M network nodes respectively do not include the first forwarding path, the M network nodes are network nodes that are not affected by the unavailable first forwarding path. The second network node is the network node that is the furthest away from the first network node among the M network nodes, that is, the second network node is the network node that has the largest number of hops from the first network node among the M network nodes.
示例性的,仍如图6所示,以第一网络节点为RT1,第六网络节点为RT7,第一转发路径包括RT1与RT7之间的直连链路为例,M个网络节点可以包括RT2、RT3和RT4。这是由于对于RT2来说,无论RT1到RT7的直连链路是否故障,RT1到RT2的最短路径都不受影响,为RT1->RT2。对于RT3来说,无论RT1到RT7的直连链路是否故障,RT1到RT3的最短路径都不受影响,为RT1->RT2->RT3。对于RT4来说,无论RT1到RT7的直连链路是否故障,RT1到RT4的最短路径都不受影响,为RT1->RT2->RT3->RT4。在RT2、RT3和RT4中,RT4距离RT1最远,即RT4与RT1相隔的网络节点跳数最多,为两跳,因此第二网络节点可以是RT4。Exemplarily, as shown in FIG. 6, taking the first network node as RT1, the sixth network node as RT7, and the first forwarding path including the direct link between RT1 and RT7 as an example, the M network nodes may include RT2, RT3 and RT4. This is because for RT2, regardless of whether the direct link between RT1 and RT7 is faulty, the shortest path from RT1 to RT2 is not affected, RT1->RT2. For RT3, regardless of whether the direct link between RT1 and RT7 is faulty, the shortest path from RT1 to RT3 is not affected, which is RT1->RT2->RT3. For RT4, regardless of whether the direct link between RT1 and RT7 is faulty, the shortest path from RT1 to RT4 is not affected, which is RT1->RT2->RT3->RT4. Among RT2, RT3, and RT4, RT4 is the farthest from RT1, that is, the network node separating RT4 and RT1 has the largest number of hops, which is two hops. Therefore, the second network node can be RT4.
或者,也可以认为M个网络节点包括第一网络节点收敛前的最短路径树中不包括故障链路的边上的全部网络节点,第二网络节点是上述不包括故障链路的边的叶子网络节点。示例性的,如图7所示,为RT1在故障收敛前对应的最短路径树,该最短路径树包括两条边,两条边的根网络节点都为RT1,两条边的叶子网络节点分别为RT4和RT5,由于叶子网络节点为RT4的边不包括故障链路,因此RT1可以确定M个网络节点包括RT2、RT3和RT4,第二网络节点是RT4。Alternatively, it can also be considered that the M network nodes include all network nodes on the edges that do not include the faulty link in the shortest path tree before the first network node converges, and the second network node is the leaf network of the above-mentioned edge that does not include the faulty link. node. Exemplarily, as shown in Fig. 7, it is the shortest path tree corresponding to RT1 before the failure convergence. The shortest path tree includes two edges, the root network node of both edges is RT1, and the leaf network nodes of the two edges are respectively For RT4 and RT5, since the edge of the leaf network node RT4 does not include the faulty link, RT1 can determine that the M network nodes include RT2, RT3, and RT4, and the second network node is RT4.
第一网络节点确定第二网络节点之后,可以将第二网络节点的节点标签添加至(即压入)标签栈。这样,可以根据第二网络节点的节点标签将报文转发至第二网络节点,而无需在标签栈中压入第一网络节点与第二网络节点之间的一个或多个链路标签或节点标签,从而可以达到缩短标签栈的目的。After the first network node determines the second network node, the node label of the second network node may be added to (that is, pushed into) the label stack. In this way, the message can be forwarded to the second network node according to the node label of the second network node without pressing one or more link labels or nodes between the first network node and the second network node in the label stack. Labels, which can achieve the purpose of shortening the label stack.
进一步的,若第二转发路径在第二网络节点之后还包括其他网络节点,第一网络节点可以从第二网络节点开始逐跳探测,确定标签栈是否需要包括其他链路标签或节点标签。Further, if the second forwarding path further includes other network nodes after the second network node, the first network node may start hop-by-hop detection from the second network node to determine whether the label stack needs to include other link labels or node labels.
可选的,若第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,第一网络节点可以确定第二网络节点与第三网络节点之间的最 小链路开销是否小于第一网络节点与第三网络节点之间的最小链路开销以及第一网络节点与第二网络节点之间的最小链路开销的和。其中,第二网络节点与第三网络节点之间的最小链路开销是指第二网络节点与第三网络节点之间的直连链路的最小开销,第一网络节点与第三网络节点之间的最小链路开销是指第一网络节点与第三网络节点之间的最短路径所包括的全部链路的开销,第一网络节点与第二网络节点之间的最小链路开销是指第一网络节点与第二网络节点之间的最短路径所包括的全部链路的开销。Optionally, if the second forwarding path includes a third network node, and the third network node is the next-hop network node of the second network node in the second forwarding path, the first network node may determine the second network node and the third network node Whether the minimum link cost between nodes is less than the sum of the minimum link cost between the first network node and the third network node and the minimum link cost between the first network node and the second network node. Among them, the minimum link cost between the second network node and the third network node refers to the minimum cost of the direct link between the second network node and the third network node, and the difference between the first network node and the third network node The minimum link cost between the first network node and the third network node refers to the cost of all links included in the shortest path between the first network node and the third network node, and the minimum link cost between the first network node and the second network node refers to the first network node and the second network node. The cost of all links included in the shortest path between a network node and a second network node.
由于第一网络节点与第二网络节点之间的最小链路开销大于0,因此,第二网络节点与第三网络节点之间的最小链路开销是否小于第一网络节点与第三网络节点之间的最小链路开销以及第一网络节点与第二网络节点之间的最小链路开销的和,可以简化为第二网络节点与第三网络节点之间的最小链路开销是否小于等于第一网络节点与第三网络节点之间的最小链路开销。这样,第一网络节点可以确定第二网络节点与第三网络节点之间的最小链路开销是否小于等于第一网络节点与第三网络节点之间的最小链路开销(或者第一网络节点可以确定第二网络节点与第三网络节点之间的最小链路开销是否大于第一网络节点与第三网络节点之间的最小链路开销),简化了运算过程,节省运算开销。Since the minimum link cost between the first network node and the second network node is greater than 0, whether the minimum link cost between the second network node and the third network node is less than the difference between the first network node and the third network node The sum of the minimum link cost between the first network node and the second network node and the minimum link cost between the first network node and the second network node can be simplified to whether the minimum link cost between the second network node and the third network node is less than or equal to the first The minimum link overhead between the network node and the third network node. In this way, the first network node can determine whether the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node (or the first network node can It is determined whether the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node), which simplifies the calculation process and saves calculation cost.
当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,标签栈不包括第二网络节点与第三网络节点之间的链路标签。这是由于当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,第二网络节点与第三网络节点之间的直连链路是第二网络节点与第三网络节点之间的最短路径,第二网络节点可以自主(即根据自身的路径规划)将报文发送至第三网络节点,因此无需在标签栈中添加第二网络节点与第三网络节点之间的链路标签。When the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node, the label stack does not include the second network node and the third network node The link label between. This is because when the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node, the difference between the second network node and the third network node The direct link between the second network node and the third network node is the shortest path between the second network node and the third network node. The second network node can send packets to the third network node autonomously (that is, according to its own path plan). The link label between the second network node and the third network node is added to the stack.
当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,标签栈还包括第二网络节点与第三网络节点之间的链路标签。这是由于当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,第二网络节点与第三网络节点之间的直连链路并非第二网络节点与第三网络节点之间的最短路径,由于第二网络节点可能还未收敛或还未获知网络中的链路发生了故障,因此第二网络节点自主确定的第二网络节点与第三网络节点之间的最短路径可能包括故障链路,导致环路问题。因此需要在标签栈中添加第二网络节点与第三网络节点之间的链路标签,这样,第二网络节点可以根据第二网络节点与第三网络节点之间的链路标签将报文发送至第三网络节点,避免环路问题。When the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the label stack also includes the difference between the second network node and the third network node The label of the link between. This is because when the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the connection between the second network node and the third network node The direct link of is not the shortest path between the second network node and the third network node. Since the second network node may not have converged or has not known that the link in the network has failed, the second network node determines independently The shortest path between the second network node and the third network node may include a faulty link, causing loop problems. Therefore, it is necessary to add the link label between the second network node and the third network node in the label stack, so that the second network node can send the message according to the link label between the second network node and the third network node To the third network node to avoid loop problems.
示例性的,如图8所示,以第一网络节点为RT1,第二网络节点为RT4,第三网络节点为RT5为例,若RT4与RT5之间的直连链路的链路开销为1000,而RT1与RT5之间的最小链路开销为30(网络收敛前,RT1与RT5之间的最短路径可以是RT1->RT7->RT6->RT5),此时RT4与RT5之间的直连链路并非RT4与RT5之间的最短路径,当报文转发到RT4时,由于RT4可能还未收敛或者还未获知RT1与RT7之间的链路发生故障,因此RT4可能通过RT4->RT3->RT2->RT1->RT7(该转发路径的最小链路开销小于1000)转发报文,这样,在RT3与RT4之间会造成环路,即RT3将报文转发至RT4后,RT4又会将报文转发给RT3。因此需要在标签栈中添加RT4与RT5之间的链路标签,这样,RT4可以根据RT4与RT5之间的链路标签将报文发送至RT5,避免环路问题。Exemplarily, as shown in Figure 8, taking the first network node as RT1, the second network node as RT4, and the third network node as RT5 as an example, if the link overhead of the direct link between RT4 and RT5 is 1000, and the minimum link cost between RT1 and RT5 is 30 (before the network converges, the shortest path between RT1 and RT5 can be RT1->RT7->RT6->RT5). At this time, the minimum link cost between RT4 and RT5 The direct link is not the shortest path between RT4 and RT5. When the packet is forwarded to RT4, because RT4 may not have converged or the link between RT1 and RT7 is not known to be faulty, RT4 may pass RT4-> RT3->RT2->RT1->RT7 (the minimum link cost of the forwarding path is less than 1000) forwards the packet. In this way, a loop will be caused between RT3 and RT4, that is, after RT3 forwards the packet to RT4, RT4 It will forward the message to RT3. Therefore, it is necessary to add the link label between RT4 and RT5 in the label stack, so that RT4 can send packets to RT5 according to the link label between RT4 and RT5 to avoid loop problems.
可选的,若第二转发路径还包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,第一网络节点确定第三网络节点与第四网络节点之间的最小链路开销是否大于第一网络节点与第四网络节点之间的最小链路开销(或者第一网络节点确定第三网络节点与第四网络节点之间的最小链路开销是否小于等于第一网络节点与第四网络节点之间的最小链路开销)。其中,第三网络节点与第四网络节点之间的最小链路开销是指第三网络节点与第四网络节点之间的直连链路的最小开销,第一网络节点与第四网络节点之间的最小链路开销是指第一网络节点与第四网络节点之间的最短路径所包括的全部链路的开销。Optionally, if the second forwarding path further includes a fourth network node, the fourth network node is the next-hop network node of the third network node in the second forwarding path, and the first network node determines the third network node and the fourth network Whether the minimum link cost between nodes is greater than the minimum link cost between the first network node and the fourth network node (or the first network node determines whether the minimum link cost between the third network node and the fourth network node is Less than or equal to the minimum link overhead between the first network node and the fourth network node). Among them, the minimum link cost between the third network node and the fourth network node refers to the minimum cost of the direct link between the third network node and the fourth network node, and the difference between the first network node and the fourth network node The minimum link cost between the first network node and the fourth network node refers to the cost of all links included in the shortest path between the first network node and the fourth network node.
当第三网络节点与第四网络节点之间的最小链路开销小于等于第一网络节点与第四网络节点之间的最小链路开销时,标签栈不包括第三网络节点与第四网络节点之间的链路标签。当第三网络节点与第四网络节点之间的最小链路开销大于第一网络节点与第四网络节点之间的最小链路开销时,标签栈还包括第三网络节点与第四网络节点之间的链路标签。When the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node, the label stack does not include the third network node and the fourth network node The link label between. When the minimum link cost between the third network node and the fourth network node is greater than the minimum link cost between the first network node and the fourth network node, the label stack also includes the difference between the third network node and the fourth network node The label of the link between.
可选的,若标签栈不包括第二网络节点与第三网络节点之间的节点标签,但包括第三网络节点与第四网络节点之间的链路标签,标签栈还可以包括第三网络节点的节点标签。这是由于第二网络节点可能无法识别第三网络节点与第四网络节点之间的链路标签,当报文转发至第二网络节点时,第二网络节点无法根据第三网络节点与第四网络节点之间的链路标签确定如何发送报文。因此需要在标签栈中添加第三网络节点的节点标签,以便第二网络节点将报文发送给第三网络节点,由第三网络节点根据第三网络节点与第四网络节点之间的链路标签将报文转发给第四网络节点。Optionally, if the label stack does not include the node label between the second network node and the third network node, but includes the link label between the third network node and the fourth network node, the label stack may also include the third network node. The node label of the node. This is because the second network node may not be able to identify the link label between the third network node and the fourth network node. When the message is forwarded to the second network node, the second network node cannot identify the link label between the third network node and the fourth network node. The label of the link between network nodes determines how to send the message. Therefore, it is necessary to add the node label of the third network node to the label stack, so that the second network node sends the message to the third network node, and the third network node uses the link between the third network node and the fourth network node The label forwards the message to the fourth network node.
可选的,若存在第五网络节点,第五网络节点是第二转发路径中第四网络节点的下一跳网络节点,可以确定标签栈是否包括第四网络节点与第五网络节点之间的链路标签,以此类推,直到探测到第二转发路径中的最后一跳网络节点(例如,第六网络节点)为止。具体过程可以参考上文中的相关描述,在此不做赘述。Optionally, if there is a fifth network node, the fifth network node is the next-hop network node of the fourth network node in the second forwarding path, and it can be determined whether the label stack includes the connection between the fourth network node and the fifth network node. The link label, and so on, until the last hop network node (for example, the sixth network node) in the second forwarding path is detected. For the specific process, please refer to the relevant description above, which will not be repeated here.
下面结合具体场景对标签栈的生成过程进行说明。The process of generating the label stack will be described below in conjunction with specific scenarios.
在一些实施例中,如图6所示,以第一网络节点为RT1为例,RT1确定第二网络节点为RT4,并可以将RT4的节点标签压入标签栈。而后RT1可以从RT4开始逐跳探测,确定RT4与RT5之间的最小链路开销是否满足公式(1):In some embodiments, as shown in FIG. 6, taking the first network node as RT1 as an example, RT1 determines that the second network node is RT4, and can push the node label of RT4 into the label stack. Then RT1 can start hop-by-hop detection from RT4 to determine whether the minimum link overhead between RT4 and RT5 satisfies formula (1):
RT4->RT5(cost)<RT4->RT1(cost)+RT1->RT5(cost)  (1)RT4->RT5(cost)<RT4->RT1(cost)+RT1->RT5(cost) (1)
其中,RT4->RT5(cost)表示RT4与RT5之间的最小链路开销,即RT4与RT5之间的直连链路的最小开销,该直连链路的最小链路开销可以是RT1基于收敛前的路由信息确定的;RT4->RT1(cost)表示RT4与RT1之间的最小链路开销,即RT4与RT1之间的最短路径包括的链路的开销,且RT4与RT1之间的最小链路开销是RT1基于收敛前的路由信息确定的;RT1->RT5(cost)表示RT1与RT5之间的最小链路开销,即RT1与RT5之间的最短路径包括的链路的开销;且该RT1与RT5之间的最小链路开销是RT1基于收敛前的路由信息确定的。Among them, RT4->RT5 (cost) represents the minimum link cost between RT4 and RT5, that is, the minimum cost of the direct link between RT4 and RT5. The minimum link cost of the direct link can be based on RT1 The routing information before convergence is determined; RT4->RT1(cost) represents the minimum link cost between RT4 and RT1, that is, the cost of the link included in the shortest path between RT4 and RT1, and the cost between RT4 and RT1 The minimum link cost is determined by RT1 based on the routing information before convergence; RT1->RT5 (cost) represents the minimum link cost between RT1 and RT5, that is, the cost of the link included in the shortest path between RT1 and RT5; And the minimum link overhead between RT1 and RT5 is determined by RT1 based on the routing information before convergence.
由于公式(1)中RT4->RT1(cost)大于0,因此公式(1)可以简化公式(2):Since RT4->RT1(cost) in formula (1) is greater than 0, formula (1) can simplify formula (2):
RT4->RT5(cost)<=RT1->RT5(cost)   (2)RT4->RT5(cost)<=RT1->RT5(cost) (2)
若满足公式(2),标签栈中不压入RT4与RT5之间的链路标签。若不满足公式(2),标签栈中压入RT4与RT5之间的链路标签。If formula (2) is satisfied, the link label between RT4 and RT5 is not pressed into the label stack. If formula (2) is not satisfied, the link label between RT4 and RT5 is pushed into the label stack.
如图6所示,RT4与RT5之间的最小链路开销是10,RT1根据收敛前的路径信息确定RT1到RT5之间的最短路径是RT1->RT7->RT6->RT5,即RT1到RT5之间的最小链路开销包括RT1与RT7之间的直连链路的最小开销、RT7与RT6之间的直连链路的最小开销以及RT6与RT5之间的直连链路的最小开销,即RT1到RT5之间的最小链路开销是10+10+10=30,10<=30,满足公式(2),因此RT4与RT5之间的链路标签可以不压入标签栈。As shown in Figure 6, the minimum link overhead between RT4 and RT5 is 10. RT1 determines the shortest path between RT1 and RT5 based on the path information before convergence is RT1->RT7->RT6->RT5, that is, RT1 to RT5. The minimum link overhead between RT5 includes the minimum overhead of the direct link between RT1 and RT7, the minimum overhead of the direct link between RT7 and RT6, and the minimum overhead of the direct link between RT6 and RT5. , That is, the minimum link overhead between RT1 and RT5 is 10+10+10=30, 10<=30, which satisfies formula (2), so the link label between RT4 and RT5 may not be pushed into the label stack.
而后,RT1可以继续探测RT5到RT6,确定是否满足RT5->RT6(cost)<=RT1->RT6(cost),由于10<=20,因此标签栈中可以不压入RT5与RT6之间的链路标签。RT1继续探测RT6到RT7,确定是否满足RT6->RT7(cost)<=RT1->RT7(cost),由于10<=10,因此标签栈中不压入RT6与RT7之间的链路标签。最终,标签栈中只需要压入RT4的节点标签,相比现有技术,标签中需要包括{1001,1002,1003,1004,1005}等五层链路标签,本申请实施例中,标签栈中仅需要一层节点标签,大大缩短了标签栈的长度。Then, RT1 can continue to detect RT5 to RT6 to determine whether RT5->RT6(cost)<=RT1->RT6(cost) is satisfied. Since 10<=20, the label stack may not be pressed between RT5 and RT6. Link label. RT1 continues to detect RT6 to RT7 to determine whether RT6->RT7(cost)<=RT1->RT7(cost) is satisfied. Since 10<=10, the link label between RT6 and RT7 is not pressed into the label stack. Finally, only RT4 node labels need to be pressed into the label stack. Compared with the prior art, the labels need to include five-layer link labels such as {1001, 1002, 1003, 1004, 1005}. In the embodiment of this application, the label stack Only one layer of node labels is required in the middle, which greatly shortens the length of the label stack.
如图8所示,以第一网络节点为RT1为例,RT1确定第二网络节点为RT4,并可以将RT4的节点标签压入标签栈。而后RT1可以探测RT4到RT5,确定是否满足RT4->RT5(cost)<=RT1->RT5(cost);由于RT4->RT5(cost)是1000,RT1->RT5(cost)是30,不满足RT4->RT5(cost)<=RT1->RT5(cost);因此标签栈中压入RT4与RT5之间的链路标签。而后,RT1可以继续探测RT5到RT6,确定是否满足RT5->RT6(cost)<=RT1->RT6(cost),由于10<=20,因此标签栈中不压入RT5与RT6之间的链路标签。继续探测RT6到RT7,确定是否满足RT6->RT7(cost)<=RT1->RT7(cost),由于10<=10,因此标签栈中不压入RT6与RT7之间的链路标签。最终,标签栈中需要压入RT4的节点标签以及RT4与RT5之间的链路标签,相比现有技术,标签中需要包括{1001,1002,1003,1004,1005}等五层链路标签,本申请实施例中,标签栈中仅需要两层标签(一层节点标签和一层链路标签),缩短了标签栈的长度。As shown in FIG. 8, taking the first network node as RT1 as an example, RT1 determines that the second network node is RT4, and can push the node label of RT4 into the label stack. Then RT1 can detect RT4 to RT5 to determine whether RT4->RT5(cost)<=RT1->RT5(cost) is satisfied; since RT4->RT5(cost) is 1000, RT1->RT5(cost) is 30, no It satisfies RT4->RT5(cost)<=RT1->RT5(cost); therefore, the link label between RT4 and RT5 is pressed into the label stack. Then, RT1 can continue to detect RT5 to RT6 to determine whether RT5->RT6(cost)<=RT1->RT6(cost) is satisfied. Since 10<=20, the chain between RT5 and RT6 is not pressed into the label stack Road label. Continue to detect RT6 to RT7 to determine whether RT6->RT7(cost)<=RT1->RT7(cost) is satisfied. Since 10<=10, the link label between RT6 and RT7 is not pressed into the label stack. Finally, the node label of RT4 and the link label between RT4 and RT5 need to be pressed into the label stack. Compared with the prior art, the label needs to include five-layer link labels such as {1001,1002,1003,1004,1005} In the embodiment of the present application, only two layers of labels (one layer of node label and one layer of link label) are required in the label stack, which shortens the length of the label stack.
在另一种可能的设计中,如图9所示,以第一网络节点为RT1为例,RT1可以先生成第二转发路径的完整标签栈,该完整标签栈包括第二转发路径中每条链路的链路标签。例如,该完整标签栈可以包括{1001,1002,1003,1004,1005};其中,1001是RT2和RT3之间的链路标签,1002是RT3和RT4之间的链路标签,1003是RT4和RT5之间的链路标签,1004是RT5和RT6之间的链路标签,1005是RT6和RT7之间的链路标签。In another possible design, as shown in FIG. 9, taking RT1 as the first network node as an example, RT1 may first generate a complete label stack of the second forwarding path, and the complete label stack includes each of the second forwarding paths. The link label of the link. For example, the complete label stack may include {1001, 1002, 1003, 1004, 1005}; among them, 1001 is the link label between RT2 and RT3, 1002 is the link label between RT3 and RT4, and 1003 is the link label between RT4 and RT4. The link label between RT5, 1004 is the link label between RT5 and RT6, and 1005 is the link label between RT6 and RT7.
RT1确定第二网络节点为RT4后,可以将RT1至RT4之间的链路标签替换为RT4的节点标签。例如,可以将标签栈中的1001和1002替换为4000,其中,4000是RT4的节点标签。After RT1 determines that the second network node is RT4, the link label between RT1 and RT4 can be replaced with the node label of RT4. For example, you can replace 1001 and 1002 in the label stack with 4000, where 4000 is the node label of RT4.
相比现有技术的标签栈需要包括转发路径中每个链路的链路标签,本申请通过采用节点标签替代链路标签的方式来压缩标签栈,使得标签栈尽可能短,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。Compared with the label stack of the prior art, which needs to include the link label of each link in the forwarding path, this application compresses the label stack by replacing the link label with the node label, so that the label stack is as short as possible. Under the condition that the label stack capacity remains unchanged, more scenarios can be supported (for example, scenarios where a longer forwarding path can be supported).
而后RT1可以探测RT4到RT5,确定是否满足RT4->RT5(cost)<=RT1->RT5(cost);由于10<=30,因此可以从标签栈中删除RT4与RT5之间的链路标签。而后,RT1可以继续探测RT5到RT6,确定是否满足RT5->RT6(cost)<=RT1->RT6(cost),由于10<=20,因此可以从标签栈中删除RT5与RT6之间的链路标签。继续探测RT6到RT7,确定是否满足RT6->RT7(cost)<=RT1->RT7(cost),由于10<=10,因此可以从标签栈中删除RT6 与RT7之间的链路标签。最终标签栈只包括RT4的节点标签,相比现有技术,标签中需要包括{1001,1002,1003,1004,1005}等五层链路标签,本申请实施例中,标签栈中仅需要一层节点标签,大大缩短了标签栈的长度。Then RT1 can detect RT4 to RT5 to determine whether RT4->RT5(cost)<=RT1->RT5(cost) is satisfied; since 10<=30, the link label between RT4 and RT5 can be deleted from the label stack . Then, RT1 can continue to detect RT5 to RT6 to determine whether RT5->RT6(cost)<=RT1->RT6(cost) is satisfied. Since 10<=20, the link between RT5 and RT6 can be deleted from the label stack Road label. Continue to detect RT6 to RT7 to determine whether RT6->RT7(cost)<=RT1->RT7(cost) is satisfied. Since 10<=10, the link label between RT6 and RT7 can be deleted from the label stack. The final label stack only includes RT4 node labels. Compared with the prior art, the labels need to include five-layer link labels such as {1001, 1002, 1003, 1004, 1005}. In the embodiment of this application, only one label stack is required. The layer node label greatly shortens the length of the label stack.
504、第一网络节点发送添加了标签栈的报文。504. The first network node sends the message with the label stack added.
第一网络节点向第二转发路径中第一网络节点的下一跳网络节点发送报文。该报文携带标签栈,该标签栈即第二转发路径对应的标签栈。The first network node sends the message to the next-hop network node of the first network node in the second forwarding path. The message carries a label stack, which is the label stack corresponding to the second forwarding path.
示例性的,如图6所示,以第一网络节点为RT1为例,RT1可以向第二转发路径中RT1的下一跳网络节点(即RT2)发送报文,报文携带标签栈{4000},4000是第二网络节点(RT4)的节点标签。Exemplarily, as shown in FIG. 6, taking the first network node as RT1 as an example, RT1 can send a message to the next hop network node of RT1 (ie RT2) in the second forwarding path, and the message carries a label stack {4000 }, 4000 is the node label of the second network node (RT4).
RT2接收到报文后,根据标签栈中的节点标签4000确定需要将报文转发至节点标签4000对应的网络节点(即RT4),根据自身的最短路径树,或者通过查找路由表,RT2可以确定下一跳网络节点为RT3,然后向RT3发送报文。After RT2 receives the message, it is determined according to the node label 4000 in the label stack that the message needs to be forwarded to the network node corresponding to the node label 4000 (ie RT4), according to its own shortest path tree, or by looking up the routing table, RT2 can determine The next hop network node is RT3, and then sends a message to RT3.
类似的,RT3接收到报文后,根据标签栈中的节点标签4000确定需要将报文转发至节点标签4000对应的网络节点(即RT4),根据自身的最短路径树,RT3可以确定下一跳网络节点为RT4,然后向RT4发送报文。Similarly, after RT3 receives the message, it determines the need to forward the message to the network node corresponding to the node label 4000 (ie RT4) according to the node label 4000 in the label stack. According to its shortest path tree, RT3 can determine the next hop The network node is RT4, and then sends a message to RT4.
RT4接收到报文后,删除(弹出)节点标签4000,并识别出报文的目的地址(第六网络节点,即RT7),RT4可以根据自身的最短路径树,确定下一跳网络节点为RT5,然后向RT5发送报文。可选的,报文的目的地址可以封装在网络协议(Internet Protocol,IP)层,标签栈可以封装在多协议标签交换(multiprotocol label switching,MPLS)层,当删除MPLS层中的节点标签后,IP层中的目的地址会露出,从而RT4可以识别出报文的目的地址。After RT4 receives the message, it deletes (pops up) the node label 4000, and identifies the destination address of the message (the sixth network node, RT7). RT4 can determine the next hop network node as RT5 according to its shortest path tree , And then send a message to RT5. Optionally, the destination address of the message can be encapsulated at the Internet Protocol (IP) layer, and the label stack can be encapsulated at the multiprotocol label switching (MPLS) layer. When the node label in the MPLS layer is deleted, The destination address in the IP layer will be exposed, so that RT4 can identify the destination address of the message.
RT5接收到报文后,识别出报文的目的地址(RT7),根据自身的最短路径树,RT5可以确定下一跳网络节点为RT6,然后向RT6发送报文。After RT5 receives the message, it recognizes the destination address (RT7) of the message. Based on its shortest path tree, RT5 can determine that the next hop network node is RT6, and then send the message to RT6.
RT6接收到报文后,识别出报文的目的地址(RT7),根据自身的最短路径树,RT6可以确定下一跳网络节点为RT7,然后向RT7发送报文,从而RT7可以接收到报文。After RT6 receives the message, it recognizes the destination address (RT7) of the message. According to its shortest path tree, RT6 can determine that the next hop network node is RT7, and then send the message to RT7 so that RT7 can receive the message .
基于本申请实施例提供的方法,第一网络节点确定用于转发报文的第一转发路径不可用时,可以重新确定用于转发报文的第二转发路径;第一网络节点在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的节点;第一网络节点发送添加了标签栈的报文。这样一来,可以根据标签栈中第二网络节点的节点标签将报文转发至第二网络节点,无需在标签栈中添加第一网络节点至第二网络节点之间的一个或多个链路标签或节点标签,可以缩短标签栈的长度,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。Based on the method provided in the embodiments of the present application, when the first network node determines that the first forwarding path for forwarding the message is unavailable, it can re-determine the second forwarding path for forwarding the message; the first network node adds Corresponding to the label stack of the second forwarding path, the label stack includes the node label of the second network node, and the label stack does not include the link label of the link between the first network node and the second network node, or the label stack does not include the first network node. A node label of a node between a network node and a second network node, the shortest path between the first network node and the second network node does not include the first forwarding path, and the second network node is a node on the second forwarding path; The first network node sends the message with the label stack added. In this way, the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding one or more links between the first network node and the second network node in the label stack Labels or node labels can shorten the length of the label stack, and can support more scenarios (for example, scenarios that can support a longer forwarding path) under the condition that the label stack capability of the network device remains unchanged.
上述本申请提供的实施例中,从第一网络节点,以及第一网络节点与其他网络节点之间交互的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,第一网络节点可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约 束条件。In the above-mentioned embodiments provided in the present application, the method provided in the embodiments of the present application is introduced from the perspective of the first network node and the interaction between the first network node and other network nodes. In order to realize the functions in the methods provided in the above embodiments of the present application, the first network node may include a hardware structure and/or a software module, and realize the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above-mentioned functions is executed by a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
在采用对应各个功能划分各个功能模块的情况下,图10示出了上述实施例中所涉及的装置的一种可能的结构示意图,该装置可以为第一网络节点10,第一网络节点10包括:确定单元1001、处理单元1002和发送单元1003。在本申请实施例中,确定单元1001,用于确定用于转发报文的第一转发路径不可用;确定单元1001,还用于响应于确定第一转发路径不可用,确定用于转发报文的第二转发路径;处理单元1002,用于在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的网络节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的网络节点;发送单元1003,用于发送添加了标签栈的报文。In the case of dividing each functional module corresponding to each function, FIG. 10 shows a possible structural schematic diagram of the device involved in the foregoing embodiment. The device may be the first network node 10, and the first network node 10 includes : The determining unit 1001, the processing unit 1002, and the sending unit 1003. In the embodiment of the present application, the determining unit 1001 is configured to determine that the first forwarding path used to forward the packet is unavailable; the determining unit 1001 is further configured to determine that the first forwarding path is not available in response to determining that the first forwarding path is not available The processing unit 1002 is configured to add a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network node and the second network The link label of the link between nodes, or the label stack does not include the node label of the network node between the first network node and the second network node, and the shortest path between the first network node and the second network node does not include On the first forwarding path, the second network node is a network node on the second forwarding path; the sending unit 1003 is configured to send the packet with the label stack added.
在图5所示的方法实施例中,确定单元1001可以用于支持第一网络节点执行图5中的过程501和502。处理单元1002用于支持第一网络节点执行图5中的过程503。发送单元1003用于支持第一网络节点执行图5中的过程504。In the method embodiment shown in FIG. 5, the determining unit 1001 may be used to support the first network node to perform the processes 501 and 502 in FIG. 5. The processing unit 1002 is configured to support the first network node to perform the process 503 in FIG. 5. The sending unit 1003 is configured to support the first network node to perform the process 504 in FIG. 5.
其中,确定单元1001和处理单元1002可以是图4中的处理器401和/或处理器405。发送单元1003可以是图4中的通信接口404。Wherein, the determining unit 1001 and the processing unit 1002 may be the processor 401 and/or the processor 405 in FIG. 4. The sending unit 1003 may be the communication interface 404 in FIG. 4.
本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。示例性地,在本申请实施例中,接收单元和发送单元可以集成至收发单元中。The division of modules in the embodiments of this application is illustrative, and it is only a logical function division. In actual implementation, there may be other division methods. In addition, the functional modules in the various embodiments of this application can be integrated into one process. In the device, it can also exist alone physically, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. Exemplarily, in the embodiment of the present application, the receiving unit and the sending unit may be integrated into the transceiver unit.
本申请实施例提供的方法中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、用户设备或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机可以存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,固态硬盘(solid state drives,SSD))等。The methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a digital video disc (digital video disc, DVD)), or a semiconductor medium (for example, a solid state drive (solid state drives, SSD)) )Wait.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the scope of the present application. In this way, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.

Claims (18)

  1. 一种报文发送的方法,其特征在于,包括:A method for message transmission, characterized in that it comprises:
    第一网络节点确定用于转发报文的第一转发路径不可用;The first network node determines that the first forwarding path used to forward the packet is unavailable;
    响应于确定所述第一转发路径不可用,所述第一网络节点确定用于转发所述报文的第二转发路径;In response to determining that the first forwarding path is unavailable, the first network node determines a second forwarding path for forwarding the message;
    所述第一网络节点在所述报文中添加对应所述第二转发路径的标签栈,所述标签栈包括第二网络节点的节点标签,且所述标签栈不包括所述第一网络节点与所述第二网络节点之间的链路的链路标签,或所述标签栈不包括所述第一网络节点与所述第二网络节点之间的网络节点的节点标签,所述第一网络节点与所述第二网络节点之间的最短路径不包括所述第一转发路径,所述第二网络节点为所述第二转发路径上的网络节点;The first network node adds a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network node The link label of the link with the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, the first The shortest path between the network node and the second network node does not include the first forwarding path, and the second network node is a network node on the second forwarding path;
    所述第一网络节点发送添加了所述标签栈的所述报文。The first network node sends the message with the label stack added.
  2. 根据权利要求1所述的方法,其特征在于,所述用于转发报文的第一转发路径不可用包括以下至少一种:The method according to claim 1, wherein the unavailability of the first forwarding path for forwarding packets comprises at least one of the following:
    所述第一转发路径的最小链路开销大于等于预设阈值;或者The minimum link overhead of the first forwarding path is greater than or equal to a preset threshold; or
    所述第一转发路径发生故障;或者The first forwarding path fails; or
    所述第一转发路径发生拥塞。Congestion occurs in the first forwarding path.
  3. 根据权利要求1或2所述的方法,其特征在于,The method according to claim 1 or 2, characterized in that:
    所述第二网络节点是M个网络节点中与所述第一网络节点相隔最远的网络节点,所述M个网络节点分别位于所述第二转发路径上,且所述第一网络节点分别到所述M个网络节点中的每个网络节点之间的最短路径都不包括所述第一转发路径,M为大于或等于1的整数。The second network node is the network node farthest from the first network node among the M network nodes, the M network nodes are respectively located on the second forwarding path, and the first network nodes are respectively The shortest path to each of the M network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1.
  4. 根据权利要求1至3任一权利要求所述的方法,其特征在于,所述第二转发路径包括第三网络节点,所述第三网络节点是所述第二转发路径中所述第二网络节点的下一跳网络节点,所述方法还包括:The method according to any one of claims 1 to 3, wherein the second forwarding path includes a third network node, and the third network node is the second network in the second forwarding path The next hop network node of the node, the method further includes:
    所述第一网络节点确定所述第二网络节点与所述第三网络节点之间的最小链路开销是否大于所述第一网络节点与所述第三网络节点之间的最小链路开销;Determining, by the first network node, whether the minimum link overhead between the second network node and the third network node is greater than the minimum link overhead between the first network node and the third network node;
    当所述第二网络节点与所述第三网络节点之间的最小链路开销大于所述第一网络节点与所述第三网络节点之间的最小链路开销时,所述标签栈还包括所述第二网络节点与所述第三网络节点之间的链路标签。When the minimum link overhead between the second network node and the third network node is greater than the minimum link overhead between the first network node and the third network node, the label stack further includes The link label between the second network node and the third network node.
  5. 根据权利要求1至3任一权利要求所述的方法,其特征在于,所述第二转发路径包括第三网络节点,所述第三网络节点是所述第二转发路径中所述第二网络节点的下一跳网络节点,所述方法还包括:The method according to any one of claims 1 to 3, wherein the second forwarding path includes a third network node, and the third network node is the second network in the second forwarding path The next hop network node of the node, the method further includes:
    所述第一网络节点确定所述第二网络节点与所述第三网络节点之间的最小链路开销是否小于等于所述第一网络节点与所述第三网络节点之间的最小链路开销;The first network node determines whether the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node ;
    当所述第二网络节点与所述第三网络节点之间的最小链路开销小于等于所述第一网络节点与所述第三网络节点之间的最小链路开销时,所述标签栈不包括所述第二网络节点与所述第三网络节点之间的链路标签。When the minimum link overhead between the second network node and the third network node is less than or equal to the minimum link overhead between the first network node and the third network node, the label stack is not Including the link label between the second network node and the third network node.
  6. 根据权利要求4或5所述的方法,其特征在于,所述第二转发路径包括第四网络节点,所述第四网络节点是所述第二转发路径中所述第三网络节点的下一跳网络节点, 所述方法还包括:The method according to claim 4 or 5, wherein the second forwarding path includes a fourth network node, and the fourth network node is the next node of the third network node in the second forwarding path. Hopping a network node, the method further includes:
    所述第一网络节点确定所述第三网络节点与所述第四网络节点之间的最小链路开销是否大于所述第一网络节点与所述第四网络节点之间的最小链路开销;Determining, by the first network node, whether the minimum link overhead between the third network node and the fourth network node is greater than the minimum link overhead between the first network node and the fourth network node;
    所述第三网络节点与所述第四网络节点之间的最小链路开销大于所述第一网络节点与所述第四网络节点之间的最小链路开销时,所述标签栈还包括所述第三网络节点与所述第四网络节点之间的链路标签。When the minimum link overhead between the third network node and the fourth network node is greater than the minimum link overhead between the first network node and the fourth network node, the label stack further includes all The link label between the third network node and the fourth network node.
  7. 根据权利要求4或5所述的方法,其特征在于,所述第二转发路径包括第四网络节点,所述第四网络节点是所述第二转发路径中所述第三网络节点的下一跳网络节点,所述方法还包括:The method according to claim 4 or 5, wherein the second forwarding path includes a fourth network node, and the fourth network node is the next node of the third network node in the second forwarding path. Hopping a network node, the method further includes:
    所述第一网络节点确定所述第三网络节点与所述第四网络节点之间的最小链路开销是否小于等于所述第一网络节点与所述第四网络节点之间的最小链路开销;The first network node determines whether the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node ;
    所述第三网络节点与所述第四网络节点之间的最小链路开销小于等于所述第一网络节点与所述第四网络节点之间的最小链路开销时,所述标签栈不包括所述第三网络节点与所述第四网络节点之间的链路标签。When the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node, the label stack does not include The link label between the third network node and the fourth network node.
  8. 根据权利要求6所述的方法,其特征在于,The method of claim 6, wherein:
    当所述标签栈不包括所述第二网络节点与所述第三网络节点之间的链路标签,且所述标签栈包括所述第三网络节点与所述第四网络节点之间的链路标签时,所述标签栈还包括所述第三网络节点的节点标签。When the label stack does not include the link label between the second network node and the third network node, and the label stack includes the link between the third network node and the fourth network node In the case of a road label, the label stack also includes the node label of the third network node.
  9. 一种第一网络节点,其特征在于,包括:A first network node, characterized in that it comprises:
    确定单元,用于确定用于转发报文的第一转发路径不可用;A determining unit, configured to determine that the first forwarding path used for forwarding the message is unavailable;
    所述确定单元,还用于响应于确定所述第一转发路径不可用,确定用于转发所述报文的第二转发路径;The determining unit is further configured to determine a second forwarding path for forwarding the message in response to determining that the first forwarding path is unavailable;
    处理单元,用于在所述报文中添加对应所述第二转发路径的标签栈,所述标签栈包括第二网络节点的节点标签,且所述标签栈不包括所述第一网络节点与所述第二网络节点之间的链路的链路标签,或所述标签栈不包括所述第一网络节点与所述第二网络节点之间的网络节点的节点标签,所述第一网络节点与所述第二网络节点之间的最短路径不包括所述第一转发路径,所述第二网络节点为所述第二转发路径上的网络节点;A processing unit, configured to add a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network node and The link label of the link between the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, the first network The shortest path between the node and the second network node does not include the first forwarding path, and the second network node is a network node on the second forwarding path;
    发送单元,用于发送添加了所述标签栈的所述报文。The sending unit is configured to send the message with the label stack added.
  10. 根据权利要求9所述的第一网络节点,其特征在于,所述用于转发报文的第一转发路径不可用包括以下至少一种:The first network node according to claim 9, wherein the unavailability of the first forwarding path for forwarding packets comprises at least one of the following:
    所述第一转发路径的最小链路开销大于等于预设阈值;或者The minimum link overhead of the first forwarding path is greater than or equal to a preset threshold; or
    所述第一转发路径发生故障;或者The first forwarding path fails; or
    所述第一转发路径发生拥塞。Congestion occurs in the first forwarding path.
  11. 根据权利要求9或10所述的第一网络节点,其特征在于,The first network node according to claim 9 or 10, wherein:
    所述第二网络节点是M个网络节点中与所述第一网络节点相隔最远的网络节点,所述M个网络节点分别位于所述第二转发路径上,且所述第一网络节点分别到所述M个网络节点中的每个网络节点之间的最短路径都不包括所述第一转发路径,M为大于或等于1的整数。The second network node is the network node farthest from the first network node among the M network nodes, the M network nodes are respectively located on the second forwarding path, and the first network nodes are respectively The shortest path to each of the M network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1.
  12. 根据权利要求9至11任一权利要求所述的第一网络节点,其特征在于,所述第二 转发路径包括第三网络节点,所述第三网络节点是所述第二转发路径中所述第二网络节点的下一跳网络节点,所述确定单元还用于:The first network node according to any one of claims 9 to 11, wherein the second forwarding path includes a third network node, and the third network node is the second forwarding path. The next hop network node of the second network node, the determining unit is further configured to:
    确定所述第二网络节点与所述第三网络节点之间的最小链路开销是否大于所述第一网络节点与所述第三网络节点之间的最小链路开销;Determining whether the minimum link overhead between the second network node and the third network node is greater than the minimum link overhead between the first network node and the third network node;
    当所述第二网络节点与所述第三网络节点之间的最小链路开销大于所述第一网络节点与所述第三网络节点之间的最小链路开销时,所述标签栈还包括所述第二网络节点与所述第三网络节点之间的链路标签。When the minimum link overhead between the second network node and the third network node is greater than the minimum link overhead between the first network node and the third network node, the label stack further includes The link label between the second network node and the third network node.
  13. 根据权利要求9至11任一权利要求所述的第一网络节点,其特征在于,所述第二转发路径包括第三网络节点,所述第三网络节点是所述第二转发路径中所述第二网络节点的下一跳网络节点,所述确定单元还用于:The first network node according to any one of claims 9 to 11, wherein the second forwarding path includes a third network node, and the third network node is the second forwarding path. The next hop network node of the second network node, the determining unit is further configured to:
    确定所述第二网络节点与所述第三网络节点之间的最小链路开销是否小于等于所述第一网络节点与所述第三网络节点之间的最小链路开销;Determining whether the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node;
    当所述第二网络节点与所述第三网络节点之间的最小链路开销小于等于所述第一网络节点与所述第三网络节点之间的最小链路开销时,所述标签栈不包括所述第二网络节点与所述第三网络节点之间的链路标签。When the minimum link overhead between the second network node and the third network node is less than or equal to the minimum link overhead between the first network node and the third network node, the label stack is not Including the link label between the second network node and the third network node.
  14. 根据权利要求12或13所述的第一网络节点,其特征在于,所述第二转发路径包括第四网络节点,所述第四网络节点是所述第二转发路径中所述第三网络节点的下一跳网络节点,所述确定单元还用于:The first network node according to claim 12 or 13, wherein the second forwarding path includes a fourth network node, and the fourth network node is the third network node in the second forwarding path The next hop network node of the network node, the determining unit is further configured to:
    确定所述第三网络节点与所述第四网络节点之间的最小链路开销是否大于所述第一网络节点与所述第四网络节点之间的最小链路开销;Determining whether the minimum link overhead between the third network node and the fourth network node is greater than the minimum link overhead between the first network node and the fourth network node;
    所述第三网络节点与所述第四网络节点之间的最小链路开销大于所述第一网络节点与所述第四网络节点之间的最小链路开销时,所述标签栈还包括所述第三网络节点与所述第四网络节点之间的链路标签。When the minimum link overhead between the third network node and the fourth network node is greater than the minimum link overhead between the first network node and the fourth network node, the label stack further includes all The link label between the third network node and the fourth network node.
  15. 根据权利要求12或13所述的第一网络节点,其特征在于,所述第二转发路径包括第四网络节点,所述第四网络节点是所述第二转发路径中所述第三网络节点的下一跳网络节点,所述确定单元还用于:The first network node according to claim 12 or 13, wherein the second forwarding path includes a fourth network node, and the fourth network node is the third network node in the second forwarding path The next hop network node of the network node, the determining unit is further configured to:
    确定所述第三网络节点与所述第四网络节点之间的最小链路开销是否小于等于所述第一网络节点与所述第四网络节点之间的最小链路开销;Determining whether the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node;
    所述第三网络节点与所述第四网络节点之间的最小链路开销小于等于所述第一网络节点与所述第四网络节点之间的最小链路开销时,所述标签栈不包括所述第三网络节点与所述第四网络节点之间的链路标签。When the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node, the label stack does not include The link label between the third network node and the fourth network node.
  16. 根据权利要求14所述的第一网络节点,其特征在于,The first network node according to claim 14, wherein:
    当所述标签栈不包括所述第二网络节点与所述第三网络节点之间的链路标签,且所述标签栈包括所述第三网络节点与所述第四网络节点之间的链路标签时,所述标签栈还包括所述第三网络节点的节点标签。When the label stack does not include the link label between the second network node and the third network node, and the label stack includes the link between the third network node and the fourth network node In the case of a road label, the label stack also includes the node label of the third network node.
  17. 一种报文发送的***,其特征在于,包括第一网络节点和第二网络节点,其中:A message sending system is characterized by comprising a first network node and a second network node, wherein:
    所述第一网络节点用于确定用于转发报文的第一转发路径不可用;响应于确定所述第一转发路径不可用,确定用于转发所述报文的第二转发路径;在所述报文中添加对应所述第二转发路径的标签栈;所述标签栈包括所述第二网络节点的节点标签,且所述标签栈不 包括所述第一网络节点与所述第二网络节点之间的链路的链路标签,或所述标签栈不包括所述第一网络节点与所述第二网络节点之间的网络节点的节点标签,所述第一网络节点与所述第二网络节点之间的最短路径不包括所述第一转发路径,所述第二网络节点为所述第二转发路径上的网络节点;向所述第二网络节点发送添加了所述标签栈的所述报文;The first network node is configured to determine that the first forwarding path for forwarding the message is unavailable; in response to determining that the first forwarding path is unavailable, determine the second forwarding path for forwarding the message; A label stack corresponding to the second forwarding path is added to the message; the label stack includes the node label of the second network node, and the label stack does not include the first network node and the second network The link label of the link between nodes, or the label stack does not include the node label of the network node between the first network node and the second network node, the first network node and the first network node The shortest path between two network nodes does not include the first forwarding path, and the second network node is a network node on the second forwarding path; sending the label stack to the second network node Said message;
    所述第二网络节点接收所述添加了所述标签栈的所述报文,并根据标签栈发送所述报文。The second network node receives the message to which the label stack is added, and sends the message according to the label stack.
  18. 一种可读存储介质,用于存储指令,当所述指令被执行时,使如权利要求1至8中任一项所述的方法被实现。A readable storage medium for storing instructions. When the instructions are executed, the method according to any one of claims 1 to 8 is realized.
PCT/CN2021/093168 2020-05-19 2021-05-11 Method and device for sending packet WO2021233168A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010427453.8A CN113691446B (en) 2020-05-19 2020-05-19 Method and device for sending message
CN202010427453.8 2020-05-19

Publications (1)

Publication Number Publication Date
WO2021233168A1 true WO2021233168A1 (en) 2021-11-25

Family

ID=78576023

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/093168 WO2021233168A1 (en) 2020-05-19 2021-05-11 Method and device for sending packet

Country Status (2)

Country Link
CN (1) CN113691446B (en)
WO (1) WO2021233168A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161246A (en) * 2016-06-15 2016-11-23 杭州华三通信技术有限公司 The implementation method of alternate routing and device
CN107547371A (en) * 2017-09-28 2018-01-05 新华三技术有限公司 A kind of message forwarding method and device
US20190081897A1 (en) * 2017-09-12 2019-03-14 Google Llc Mechanism and apparatus for path protection when using compressed segment routing label stacks
CN109889441A (en) * 2019-03-21 2019-06-14 新华三技术有限公司 A kind of data forwarding method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095422A (en) * 2018-03-29 2022-02-25 华为技术有限公司 Message sending method, network node and system
CN114070782B (en) * 2018-06-30 2023-05-16 华为技术有限公司 Transmission path fault processing method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161246A (en) * 2016-06-15 2016-11-23 杭州华三通信技术有限公司 The implementation method of alternate routing and device
US20190081897A1 (en) * 2017-09-12 2019-03-14 Google Llc Mechanism and apparatus for path protection when using compressed segment routing label stacks
CN107547371A (en) * 2017-09-28 2018-01-05 新华三技术有限公司 A kind of message forwarding method and device
CN109889441A (en) * 2019-03-21 2019-06-14 新华三技术有限公司 A kind of data forwarding method and device

Also Published As

Publication number Publication date
CN113691446A (en) 2021-11-23
CN113691446B (en) 2023-02-10

Similar Documents

Publication Publication Date Title
JP7327876B2 (en) Method and system for determining packet forwarding paths and network nodes
CN108574616B (en) Method, equipment and system for processing route
US9998368B2 (en) Zone routing system
US7957306B2 (en) Providing reachability information in a routing domain of an external destination address in a data communications network
WO2021174985A1 (en) Sr policy issuing method and apparatus and sr policy receiving method and apparatus
JP2021507625A (en) Methods and nodes for packet transmission in networks
WO2020135395A1 (en) Notification method and device for prefix identifier of cross-interior gateway protocol
US11646960B2 (en) Controller provided protection paths
WO2021143279A1 (en) Method and device for segment routing service processing, routing equipment, and storage medium
US10904130B2 (en) Method for scalable computer network partitioning
WO2021057530A1 (en) Method, apparatus and system for determining mapping relationship between routing prefix and segment identification
WO2021088561A1 (en) Method, device, and equipment for load sharing in bit index explicit replication network
WO2020173424A1 (en) Message processing method, and gateway device
WO2022194023A1 (en) Packet processing method, network device, and controller
WO2022121707A1 (en) Packet transmission method, device, and system
WO2022111372A1 (en) Message transmission method and apparatus, device, and computer-readable storage medium
CN107615722B (en) Transport Software Defined Network (SDN) -zero configuration adjacency via packet snooping
WO2015120602A1 (en) Network path computation method, apparatus and system
US10382323B1 (en) Flooding-based routing protocol having label switched path session information
US20240007397A1 (en) Supporting stateful explicit paths
CN112350936B (en) Method and device for optimizing interior gateway protocol flooding and storage medium
WO2021233168A1 (en) Method and device for sending packet
WO2023093513A1 (en) Path sensing method, apparatus and system
WO2017162202A1 (en) Link state information processing
JP6628792B2 (en) Endpoint Identification Method in Computer Network

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21808920

Country of ref document: EP

Kind code of ref document: A1