WO2016124055A1 - 一种环网中mpls报文转发的方法及网络节点 - Google Patents

一种环网中mpls报文转发的方法及网络节点 Download PDF

Info

Publication number
WO2016124055A1
WO2016124055A1 PCT/CN2015/099945 CN2015099945W WO2016124055A1 WO 2016124055 A1 WO2016124055 A1 WO 2016124055A1 CN 2015099945 W CN2015099945 W CN 2015099945W WO 2016124055 A1 WO2016124055 A1 WO 2016124055A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
label
lfib
mpls packet
context
Prior art date
Application number
PCT/CN2015/099945
Other languages
English (en)
French (fr)
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 WO2016124055A1 publication Critical patent/WO2016124055A1/zh

Links

Images

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and a network node for forwarding a message in a multi-protocol label switch (MPLS: MPLS) in a ring network.
  • MPLS multi-protocol label switch
  • Ring network (English: ring network) is a common topology.
  • MPLS technology is usually used to forward MPLS packets.
  • the forwarding mode of the MPLS packet in the ring network is: after receiving the MPLS packet, the network node obtains the matched LFIB from the label forwarding information base (English: Label Forwarding Information Base, LFIB). The entry determines the primary next hop and the alternate next hop according to the LFIB entry. And when the network node determines that the primary next hop is unreachable, forwarding the MPLS packet to the standby next hop, and the network node further sends the primary to the standby next hop The next hop unreachable information is used such that the alternate next hop converges the route according to the unreachable information.
  • LFIB Label Forwarding Information Base
  • the standby next hop since the unreachable information is sent from the network node to the standby next hop, and the standby next hop performs route convergence according to the unreachable information, it takes a certain time, and thus may result in When the standby next hop receives the MPLS packet forwarded by the network node, the standby next hop has not completed the route convergence, so the standby next hop is likely to forward the MPLS packet. Sending to the network node causes the MPLS packet to be forwarded back and forth between the network node and the standby next hop, causing a technical problem of an instantaneous loop.
  • the technical problem to be solved by the embodiments of the present invention is to provide a method for forwarding a message in a ring network and a network node, so as to solve the technical problem of an instantaneous loop occurring in the ring network.
  • the embodiment of the present invention provides a method for forwarding an MPLS packet in a ring network, where the ring network includes a first node, and the method includes:
  • the first node obtains a first MPLS packet
  • the first node obtains a label forwarding information library LFIB entry that matches the top label of the first MPLS packet, where the LFIB entry includes a primary next hop information, an alternate next hop information, and an alternate outgoing label. a first context label, where the first context label is used to indicate a forwarding direction of the first MPLS packet after passing the first node in the ring network;
  • the first node When the first node determines that the primary next hop corresponding to the primary next hop information is unreachable, the first node replaces the top label of the first MPLS packet with the spare outgoing label. And the first context label is pushed into the label stack of the first MPLS packet that is label-replaced to generate a second MPLS packet;
  • the first node sends the second MPLS packet to the standby next hop corresponding to the standby next hop information.
  • the obtaining, by the first node, the first MPLS packet includes:
  • the first node obtains the first MPLS packet sent by the second node to the first node.
  • the first node obtains the LFIB that matches a top label of the first MPLS packet
  • the entries include:
  • the first node obtains, in the first LFIB, the LFIB entry that matches the top label of the first MPLS packet, and the first LFIB is generated based on the best route on the first node.
  • the obtaining, by the first node, the first MPLS packet includes:
  • the first node pops up the second context label of the third MPLS packet to generate the first MPLS packet, where the second context label is used to indicate that the first MPLS packet is in the In the forwarding direction of the ring network after the second node is forwarded, the packet forwarding direction indicated by the second context label is opposite to the packet forwarding direction indicated by the first context label.
  • the first node obtains the LFIB that matches a top label of the first MPLS packet
  • the entries include:
  • the first node obtains, in the LFIB corresponding to the second context label, the LFIB entry that matches the top label of the first MPLS packet.
  • the method further includes:
  • the first node obtains, in the second LFIB or the third LFIB, an LFIB corresponding to the second context label, where the second LFIB is generated based on a route of the first node in a clockwise direction, where The third LFIB is generated based on the routing of the first node in a counterclockwise direction.
  • the embodiment of the present invention provides a method for forwarding an MPLS packet in a ring network, where the ring network includes a first node and a second node, and the method includes:
  • the second node receives the first MPLS packet sent by the first node, where the top label of the first MPLS packet is a first context label, and the first context label is used to indicate the first MPLS packet. a forwarding direction of the packet after passing the first node in the ring network;
  • the second node pops up the first context label of the first MPLS packet to generate a second MPLS packet
  • the second node obtains a first LFIB entry that matches the top label of the second MPLS packet in the label forwarding information base LFIB corresponding to the first context label, where the first LFIB entry includes: a stack top label, a first next hop information, a first outgoing label, and a second context label of the second MPLS packet, where the second context label is used to indicate that the first MPLS packet is in the ring network
  • the packet forwarding direction indicated by the second context label is opposite to the packet forwarding direction indicated by the first context label.
  • the second node replaces the top label of the second MPLS packet with the first outgoing label, and presses the second context label into the label of the second MPLS packet that is replaced by the label.
  • Stack to generate a third MPLS packet
  • the second node sends the third MPLS packet to the first next hop corresponding to the first next hop information.
  • the method further includes:
  • the second node obtains, in the second LFIB or the third LFIB, an LFIB corresponding to the first context label, where the second LFIB is generated based on a route of the second node in a clockwise direction, where The third LFIB is generated based on the routing of the second node in the counterclockwise direction.
  • the first eNB sends the first MPLS sent by the first node
  • the method described before the message further includes:
  • the second node receives a fourth MPLS packet from the third node, where the third node is a node that is connected to the ring network outside the ring network;
  • the second node obtains, in the first LFIB, a second LFIB entry that matches the top label of the fourth MPLS packet, where the second LFIB entry includes: the top of the fourth MPLS packet a label, a second next hop information, a second out label, and a third context label.
  • the third context label is used to indicate that the fourth MPLS packet is forwarded after passing the second node in the ring network. direction;
  • the second node replaces the top label of the fourth MPLS packet with the second out label, and pushes the third context label into the label of the fourth MPLS packet that is replaced by the label.
  • Stack to generate a fifth MPLS packet
  • the second node sends the fifth MPLS packet to the second next hop corresponding to the second next hop information.
  • the first LFIB is generated based on an optimal route on the second node.
  • an embodiment of the present invention provides a network node, where the network node is first. a node, the first node is located in a ring network, and the first node includes: a processing unit and a sending unit;
  • the processing unit is configured to obtain a first multi-protocol label switching MPLS packet, and obtain a label forwarding information library LFIB entry that matches a top-of-stack label of the first MPLS packet, where the LFIB entry includes a primary a hop information, an alternate next hop information, an alternate outgoing label, and an alternate first context label, where the first context label is used to indicate that the first MPLS packet passes through the first node in the ring network Direction of forwarding;
  • the processing unit is further configured to: when determining that the primary next hop corresponding to the primary next hop information is unreachable, replace the top label of the first MPLS packet with the spare outgoing label, and Pressing the first context label into the label stack of the first MPLS packet that has been tag-replaced to generate a second MPLS packet;
  • the sending unit is configured to send the second MPLS packet to the standby next hop corresponding to the standby next hop information.
  • the first node further includes: a receiving unit;
  • the processing unit When the processing unit obtains the first MPLS packet, the processing unit is configured to obtain, by the receiving unit, the first MPLS packet sent by the second node to the first node.
  • the processing unit when the processing unit obtains the LFIB that matches the top label of the first MPLS packet The processing unit is configured to obtain, in the first LFIB, the LFIB entry that matches the top label of the first MPLS packet, where the first LFIB is based on the first node The best route generation.
  • the first node further includes: a receiving unit;
  • the processing unit When the processing unit obtains the first MPLS packet, the processing unit is configured to receive, by the receiving unit, a third MPLS packet sent by the second node, and a top label of the third MPLS packet Deleting the second context label, and the second context label of the third MPLS packet, to generate the first MPLS packet, where the second context label is used to indicate the first MPLS packet a forwarding direction after passing the second node in the ring network, The packet forwarding direction indicated by the second context label is opposite to the packet forwarding direction indicated by the first context label.
  • the processing unit when the processing unit obtains the LFIB that matches the top label of the first MPLS packet The processing unit is configured to obtain, in the LFIB corresponding to the second context label, the LFIB entry that matches the top label of the first MPLS packet.
  • the processing unit is further configured to obtain, in the second LFIB or the third LFIB, The LFIB corresponding to the second context tag, wherein the second LFIB is generated based on a route of the first node in a clockwise direction, and the third LFIB is generated based on a route of the first node in a counterclockwise direction.
  • an embodiment of the present invention provides a network node, where the network node is a second node, the ring network includes a first node and the second node, and the second node includes: a receiving unit, a processing unit And sending unit;
  • the receiving unit is configured to receive a first multi-protocol label switching MPLS packet sent by the first node, where a top-of-stack label of the first MPLS packet is a first context label, and the first context label is used by And indicating a forwarding direction of the first MPLS packet after passing the first node in the ring network;
  • the processing unit is configured to pop the first context label of the first MPLS packet to generate a second MPLS packet, and obtain the same in the label forwarding information base LFIB corresponding to the first context label.
  • the first LFIB entry of the second MPLS packet includes: a top label of the second MPLS packet, a first next hop information, and a first out a label and a second context label, where the second context label is used to indicate a forwarding direction of the first MPLS packet after passing the second node in the ring network, and the second context label indicates a report
  • the forwarding direction of the text is the same as the forwarding direction of the packet indicated by the first context label;
  • the processing unit is further configured to replace the top label of the second MPLS packet with the first outgoing label, and press the second context label into the second MPLS label that is label replaced. a label stack of the text to generate a third MPLS packet;
  • the sending unit is configured to send the third MPLS packet to the first next hop corresponding to the first next hop information.
  • the processing unit is further configured to obtain, in the second LFIB or the third LFIB, an LFIB corresponding to the first context label, where the second The LFIB is generated based on a route of the second node in a clockwise direction, the third LFIB being generated based on a route of the second node in a counterclockwise direction.
  • the receiving, by the receiving unit, the first MPLS packet that is sent by the first node The processing unit is further configured to: receive the fourth MPLS packet from the third node, and obtain, in the first LFIB, a second LFIB entry that matches the top label of the fourth MPLS packet, where
  • the third node is a node that is connected to the ring network outside the ring network, and the second LFIB entry includes: a top label of the fourth MPLS packet, a second next hop information, and a second outgoing label.
  • a third context label where the third context label is used to indicate a forwarding direction of the fourth MPLS packet after passing the second node in the ring network;
  • the processing unit is further configured to replace the top label of the fourth MPLS packet with the second out label, and press the third context label into the fourth MPLS label that is label replaced.
  • the label stack of the text to generate a fifth MPLS packet;
  • the sending unit is further configured to send the fifth MPLS packet to the second next hop corresponding to the second next hop information.
  • the first LFIB is generated based on an optimal route on the second node.
  • the first node on the ring network when determining that the primary next hop is unreachable, the first node is in the label stack of the MPLS packet. Pressing a context label, the context label is used to indicate a forwarding direction of the MPLS packet after passing the first node in the ring network, so that a second node on the ring network receives the first
  • the MPLS packet can be forwarded according to the forwarding direction indicated by the context label, so the second node does not send the MPLS packet to the first node.
  • Figure 1 shows a possible topology of a ring network
  • FIG. 2 is a schematic flowchart of a method embodiment according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart diagram of another method embodiment according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart diagram of another method embodiment according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a network node according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of another network node according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of another network node according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of another network node according to an embodiment of the present invention.
  • FIG. 1 is only an exemplary description, and the specific topology does not limit the embodiment of the present invention.
  • the ring network shown in FIG. 1 includes a network node R1, a network node R2, a network node R3, and a network node R4, wherein each network node has a corresponding LFIB for packet forwarding.
  • the following describes the generation mode of the LFIB of the network node R1 by taking the network node R1 as an example.
  • the network node R2 For a certain prefix (English: prefix) forwarding equivalence class (English: Forwarding Equivalence Class, FEC for short), the network node R2 will assign a label to the prefix FEC, for example, the network node R2 assigns a label 52 to 1.1.1.5/32. And assigning the label 52 to the label distribution protocol (English: Label Distribution Protocol, LDP for short), shortest path first (English: Open Shortest Path First, OSPF for short) or intermediate system - intermediate system (English: Intermediate System to The Intermediate System (ISIS) protocol advertises that all the neighbors of the network node R2, that is, the network node R1, the network node R3, and the network node R6 can obtain the label assigned by the network node R2.
  • the label distribution protocol English: Label Distribution Protocol, LDP for short
  • shortest path first English: Open Shortest Path First, OSPF for short
  • ISIS Intermediate System to The Intermediate System
  • the network node R4 will assign a label to the prefix FEC. For example, the network node R4 allocates the label 54 to 1.1.1.5/32, and advertises the allocated label 54 by means of LDP, OSPF or ISIS protocol, so that all the network node R4 The neighbors, that is, the network node R1, the network node R3, and the network node R5 can all obtain the labels assigned by the network node R4. 1.1.1.5/32 corresponds to network node R5.
  • the network node R1 obtains two neighbor nodes of the network node R1, and the network node R2 and the network node R4 are respectively assigned the label 52 and the label 54 of 1.1.1.5/32. Since the LFIB of the network node R1 is generated based on the best route on the network node R1, after receiving the tag 52 and the tag 54, the network node R1 determines the best route corresponding to the prefix FEC on the network node R1. One hop, and the next hop information corresponding to the next hop and the label allocated by the next hop are saved in the LFIB of the network node R1.
  • the next hop of the best route corresponding to 1.1.1.5/32 is the network node R4, and the network node R1 allocates the information of the network node R4 and the network node R4 to 1.1.1.5/32.
  • the tag 54 is saved to the LFIB of the network node R1.
  • the next hop information refers to information such as an Internet Protocol (English: Internet Protocol, IP address) address or identifier of the next hop.
  • the network node R1 actually uses the network node R4 as the primary next hop, and uses the label allocated by the network node R4 as the primary outgoing label.
  • the LFIB of the network node also indicates the alternate next hop and the spare outgoing label in order to forward the packet to the alternate route by means of Fast Reroute (FRR).
  • FRR Fast Reroute
  • Table 1 shows the LFIB entry corresponding to 1.1.1.5/32 in the LFIB of the network node R1.
  • the incoming label is the label assigned by the network node R1 to 1.1.1.5/32.
  • the network node R1 will use the MPLS. After the stack top label of the packet is replaced with the spare outgoing label, that is, the label 52, the MPLS packet with the label replacement is sent to the network node R2. Moreover, the network node R1 also sends information that the network node R4 is unreachable to the network node R2, so that the network node R2 converges the route according to the unreachable information.
  • the unreachable information is transmitted from the network node R1 to the network node R2, and the network node R2 performs route convergence according to the unreachable information, it takes a certain time, and thus may cause the network node R2 to receive the network node R1.
  • the network node R2 has not completed the route convergence.
  • the current LFIB of the network node R2 is generated based on the best route on the network node R2, that is, the network node R2 receives the MPLS packet.
  • the message is forwarded to the next hop of the best route on the network node R2, so the network node R2 is likely to send the MPLS message to the network node R1, for example, the best route on the network node R2.
  • the next hop is when the network node R1.
  • the MPLS packet is forwarded and forwarded between the network node R2 and the network node R1, which causes technical problems of the instantaneous loop, and further causes resource waste and packet delay caused by technical problems of the instantaneous loop. technical problem.
  • a method for forwarding a message in a ring network and a network node are provided to solve the technical problem of an instantaneous loop occurring in the ring network.
  • an embodiment of the present invention provides an embodiment of a method for forwarding MPLS packets in a ring network.
  • the ring network includes a first node.
  • the first node is a network node R1.
  • the first node obtains a first MPLS packet.
  • the first node may directly use the MPLS packet sent by the other node as the first MPLS packet, and may perform the MPLS packet sent by the other node as a first MPLS packet.
  • the first node obtains a LFIB entry that matches a top label of the first MPLS packet.
  • the stack top label of the first MPLS packet is used to guide the forwarding of the first MPLS packet by using the top label of the first MPLS packet and the LFIB in the LFIB of the first node.
  • the LFIB entry matching the stack top label of the first MPLS packet is obtained in the LFIB of the first node.
  • the first node generally matches each LFIB entry in the LFIB of the first node with a top label of the first MPLS packet, when the first node is in the LFIB.
  • the entry label of an entry is the same as the stack top label of the first MPLS packet, the entry is used as the LFIB entry that matches the top label of the first MPLS packet, and is obtained.
  • the LFIB entry is used to guide the forwarding of the first MPLS packet by using the top label of the first MPLS packet and the LFIB in the LFIB of the first node.
  • the LFIB entry includes primary next hop information, alternate next hop information, alternate outgoing label, and an alternate first context label.
  • the LFIB entry generally includes an inbound label, a primary outgoing label, and a prefix FEC corresponding to the entry, where the prefix FEC is used to indicate a destination end of the first MPLS packet.
  • the top label of the first MPLS packet is the label 51
  • the network node R1 matches the label 51 with the LFIB of the network node R1
  • the LFIB as shown in Table 2 can be obtained.
  • Entry. 1.1.1.5/32 corresponds to the network node R5, that is, the destination end of the first MPLS packet is the network node R5.
  • the LFIB entry includes the spare first context label, where the first context label is used to indicate the first MPLS packet.
  • the first MPLS packet After the first MPLS packet passes through the first node in the ring network, the first MPLS packet is consistent with the first context label in the ring network. The forwarding direction of the indication is forwarded until the ring network or the U-turn is down in the first MPLS packet.
  • the first context label may be used to indicate a clockwise forwarding direction or a counterclockwise forwarding direction, for example, a Clock-Wise Forwarding Indication Label (CWFIL), or a counterclockwise forwarding.
  • CWFIL Clock-Wise Forwarding Indication Label
  • the first context label indicates that the first MPLS packet is in a clockwise direction or a reverse direction after passing through the first node. Forward in the hour hand direction.
  • the first context label is CWFIL, and is used to indicate that the first MPLS packet is forwarded in a clockwise direction after passing the first node.
  • the first context label is an alternate label, that is, the first context label is used when the first MPLS packet needs to be forwarded to the standby next hop.
  • the first node When the first node determines that the primary next hop corresponding to the primary next hop information is unreachable, the first node replaces the top label of the first MPLS packet with the standby The label is sent out, and the first context label is pushed into the label stack of the first MPLS packet that has been label-replaced to generate a second MPLS packet.
  • the first node determines that the primary next hop is unreachable, in addition to replacing the top label of the first MPLS packet with the spare outgoing label,
  • the first context label is pushed into the label stack of the first MPLS packet, and the second MPLS packet is generated, so that the first MPLS packet is displayed in the top label of the second MPLS packet.
  • the standby next hop can follow the second MPLS packet after receiving the second MPLS packet.
  • the forwarding direction indicated by the first context label forwards the second MPLS packet, and the second MPLS packet is not sent to the first node.
  • the first MPLS packet is forwarded to the second MPLS packet, and then forwarded. Therefore, the first context is performed.
  • the forwarding direction of the first MPLS packet after passing the first node in the ring network may actually be considered as the second MPLS generated based on the first MPLS packet.
  • the forwarding direction of the packet after passing through the first node in the ring network may actually be considered as the second MPLS generated based on the first MPLS packet.
  • the embodiment of the present invention may further include: when the first node determines that the primary next hop is reachable, the first node replaces the top label of the first MPLS packet with the primary use And transmitting, to the primary next hop, the first MPLS packet that has been tag-replaced.
  • the first node sends the second MPLS packet to an alternate next hop corresponding to the standby next hop information.
  • the second MPLS packet is forwarded according to the forwarding direction indicated by the first context label.
  • the LFIB entry obtained by the first node includes an alternate first context label, where the first context label is used to indicate the first MPLS report.
  • the forwarding direction after the first node passes in the ring network. Therefore, when the first node forwards the first MPLS packet, when determining that the primary next hop is unreachable, the stack top label of the first MPLS packet is replaced with the spare outgoing label.
  • the first context label is also pushed into the label stack of the first MPLS packet that has been tag-replaced to generate a second MPLS packet and sent to the standby next hop, so that the After receiving the second MPLS packet, the standby next hop can forward the second MPLS packet according to the forwarding direction indicated by the first context label, so that the first MPLS packet passes through the Both the first node and the standby next hop are forwarded in the same direction, so the standby next hop does not send the second MPLS packet to the first node, thereby avoiding the
  • the first node forwards the first MPLS packet, when the primary next hop is unreachable, the technical problem of an instantaneous loop that may occur between the first node and the standby next hop.
  • the problem of resource waste and message delay caused by the technical problem of the instantaneous loop is further solved.
  • the network node R1 determines that the network node R4 is unreachable
  • the network node is The R2 sends the second MPLS packet, where the top label of the second MPLS packet is specifically CWFIL, and is used to indicate that the second MPLS packet is forwarded in a clockwise direction. Therefore, the network node R2 is clockwise. Forwarding the second MPLS packet to the network node R3, and not sending the second MPLS packet to the network node R1, thereby solving an instantaneous loop that may occur between the network node R1 and the network node R2. technical problem.
  • the first context label may be a special purpose label (English: Special Purpose Label, SPL for short) or an extended special purpose label (English: Extended Special Purpose Label (ESPL)).
  • SPL Special Purpose Label
  • ESPL Extended Special Purpose Label
  • the first node may directly use the MPLS packet sent by the other node as the first MPLS packet, and may perform the certain processing on the MPLS packet sent by the other node.
  • the first MPLS packet may further obtain the LFIB entry from the corresponding LFIB according to the top label of the MPLS packet sent by the other node. The following two cases are explained.
  • the first node may directly use the MPLS packet sent by the other node as the first MPLS packet, and the 201 of the embodiment includes the first node.
  • the second node may be a node in the ring network.
  • the network node R1 obtains the first MPLS packet sent by the network node R2, and the second node may also be the A node outside the ring network that is connected to the ring network.
  • the first context label may be added to the LFIB currently generated based on the best route in the embodiment of the present invention.
  • the first node obtains the LFIB entry in the LFIB generated based on the best route.
  • the 202 of this embodiment includes: the first node obtaining, in the first LFIB, the LFIB entry that matches the top label of the first MPLS packet.
  • the first LFIB is generated based on the best route on the first node, that is, the primary next hop of any entry in the first LFIB is the entry for the first node.
  • the next hop of the best route corresponding to the prefix FEC For example, in the entry shown in Table 2, the primary next hop is the next hop of the best route corresponding to 1.1.1.5/32 for the network node R1, that is, the network node R4.
  • the label of the MPLS packet sent by the other node to the first node may be pushed into the context label, and the first node needs to perform the MPLS packet sent by the other node. Certain processing, such as popping up the context label to obtain the first MPLS packet.
  • the 201 of the embodiment may include: the first node receives a third MPLS packet sent by the second node, and the top label of the third MPLS packet is a second context label; The first node pops up the second context label of the third MPLS packet to generate the first MPLS packet.
  • the second context label is used to indicate a forwarding direction of the first MPLS packet after passing the second node in the ring network, and a packet forwarding direction indicated by the second context label
  • the packet forwarding direction indicated by the first context label is reversed.
  • the second context label may be CCWFIL, configured to indicate that the first MPLS packet is forwarded in a counterclockwise direction after passing through the network node R2 in the ring network
  • the first context label is
  • the CWFIL may be used to indicate that the first MPLS packet is forwarded in a clockwise direction after passing through the network node R1 in the ring network.
  • the second context label may be an SPL or an ESPL, or may be a label that is allocated by the second node and advertised by means of LDP, ISIS, or OSPF.
  • the LFIB corresponding to the second context label may be set in the embodiment of the present invention. Adding the first context tag to the LFIB corresponding to the second context tag.
  • the 202 in this embodiment includes: the first node obtaining, in the LFIB corresponding to the second context label, the LFIB entry that matches the top label of the first MPLS packet.
  • the LFIB corresponding to the second context label is generated based on the route of the first node in the forwarding direction indicated by the second context label, that is, any entry in the LFIB corresponding to the second context label.
  • the primary next hop is, the next hop of the first node in the forwarding direction indicated by the second context label, which is actually the second node of the first node on the ring network
  • the neighbor node in the forwarding direction indicated by the context label is obviously different from the first LFIB generated based on the best route on the first node.
  • the primary outgoing label of any entry corresponds to the primary next hop of the entry, that is, the primary next hop of the entry is the label assigned by the prefix FEC of the entry.
  • the embodiment may further include: the first node obtaining the second context from the second LFIB or the third LFIB The LFIB corresponding to the label. For example, if the second context tag is used to indicate a clockwise forwarding direction, the second LFIB is used as the LFIB corresponding to the second context tag.
  • the second LFIB is generated based on the route of the first node in a clockwise direction, that is, the primary next hop of any entry in the second LFIB is, and the first node is in a clockwise direction.
  • the next hop is actually the neighbor node of the first node in the clockwise direction on the ring network.
  • the primary outgoing label of any entry corresponds to the primary next hop of the entry, that is, the primary next hop of the entry is the label assigned by the prefix FEC of the entry.
  • the LFIB entries in the second LFIB that match the top label of the first MPLS packet may be as shown in Table 3.
  • the primary next hop is the next hop of the route of the network node R1 in the clockwise direction, that is, the network node R2, and the primary outgoing label is the network node R2 is 1.1.1.5/ 32 assigned labels.
  • the entry also contains the primary context label CWFIL and the alternate context label CCWFIL.
  • the third LFIB is generated based on the route of the first node in the counterclockwise direction, that is, the primary next hop of any entry in the third LFIB is the first node in the counterclockwise direction.
  • the next hop is actually the neighbor node of the first node in the counterclockwise direction on the ring network, and the primary outgoing label of any entry corresponds to the primary next hop of the entry, that is, The primary next hop of the entry is the label assigned to the prefix FEC of the entry.
  • the LFIB entry in the third LFIB that matches the top label of the first MPLS packet may be as shown in Table 4.
  • the primary next hop is the next hop of the route of the network node R1 in the counterclockwise direction, that is, the network node R4, and the primary outgoing label is the network node R4 is 1.1.1.5/ 32 assigned labels.
  • the entry also contains the primary context tag CCWFIL and the alternate context tag CWFIL.
  • the first LFIB, the second LFIB, and the third LFIB may be saved on the first node, and obtained according to the top label of the received MPLS packet. Corresponding LFIB, and obtaining, from the corresponding LFIB, a LFIB entry that matches the top label of the first MPLS packet. Specifically, when the first MPLS packet is received, that is, the top label of the received MPLS packet is not a context label, the LFIB entry is obtained from the first LFIB; And the third MPLS packet, where the top label of the third MPLS packet is the second context label, and the second context label is obtained from the second LFIB or the third LFIB according to the second context label.
  • the LFIB entry is obtained from the second LFIB, and when the second context label indicates a counterclockwise forwarding direction, The LFIB entry is obtained in the third LFIB.
  • the network node R1 receives the third MPLS packet sent by the network node R2, where the top label of the third MPLS packet is CCWFIL, and the network node R1 corresponds to CCWFIL.
  • the LFIB entry as shown in Table 4 is obtained in the third LFIB.
  • the first node may not obtain the corresponding LFIB according to the second context label, for example, the first node receives the first MPLS sent by the second node. a message, when the first node determines that the second node is a node outside the ring network, obtaining the LFIB entry from the first LFIB; and when the first node determines the second When the node is the upstream node in the clockwise direction on the ring network, the first MPLS packet is forwarded in a clockwise direction, and the first node obtains the LFIB entry from the second LFIB; When the first node determines that the second node is an upstream node in the counterclockwise direction on the ring network, the first MPLS packet is forwarded in a counterclockwise direction. A node obtains the LFIB entry from the third LFIB.
  • the first LFIB, the second LFIB, and the third LFIB may respectively correspond to three different forwarding tables, for example, the first LFIB corresponds to the forwarding table 1, The second LFIB corresponds to the forwarding table 2, and the third LFIB corresponds to the forwarding table 3.
  • the first LFIB, the second LFIB, and the third LFIB may also correspond to the same table, for example, the first A LFIB, the second LFIB, and the third LFIB are all corresponding to the forwarding table 4, wherein the LFIB identifier can be set in the forwarding table 4 for distinguishing the three LFIBs.
  • the next hop in the clockwise direction and the next hop in the counterclockwise direction may be configured on the first node by manual or automatic machine generation, so that the first node can be configured according to the configuration. Generating the first LFIB, the second LFIB, and the third LFIB.
  • the first node is pressed in the label stack of the first MPLS packet when the primary next hop is unreachable. Entering the first context label to indicate the forwarding direction, and from the perspective of the second node, how to refer to the first context label after receiving the MPLS packet with the top-of-stack label as the first context label Forward.
  • an embodiment of the present invention provides another method embodiment of a method for forwarding MPLS packets in a ring network.
  • the ring network includes a first node and a second node.
  • the first node is a network node R1 and the second node is a network node R2.
  • the second node receives the first MPLS packet sent by the first node, where the top label of the first MPLS packet is a first context label.
  • the first context label is used to indicate a forwarding direction of the first MPLS packet after passing the first node in the ring network.
  • the first MPLS packet is generated when the first node determines that the primary next hop of the first node is unreachable. Said by the second node.
  • the second node pops up the first context label of the first MPLS packet, The second MPLS packet is generated.
  • the second node obtains a first LFIB entry that matches the top label of the second MPLS packet in the LFIB corresponding to the first context label.
  • the second node when the matching is performed, the second node generally matches each LFIB entry in the LFIB corresponding to the first context label with a top-of-stack label of the second MPLS packet, where the first context label is
  • the entry is used as the LFIB table that matches the top label of the second MPLS packet. Item, and obtain the LFIB entry.
  • the LFIB corresponding to the first context label is generated based on the route of the second node in the forwarding direction indicated by the first context label, that is, the LFIB corresponding to the first context label.
  • the primary next hop of any of the entries is, the next hop of the second node in the forwarding direction indicated by the first context label, in fact, the second node is on the ring network
  • the neighboring node in the forwarding direction indicated by the first context label is obviously different from the LFIB generated based on the best route on the second node.
  • the first LFIB entry obtained in the LFIB corresponding to the first context label includes: a top label of the second MPLS packet, a first next hop information, a first outgoing label, and a second a context label, where the second context label is used to indicate a forwarding direction of the first MPLS packet after passing the second node in the ring network, and a forwarding direction indicated by the second context label is
  • the forwarding direction indicated by the first context label is the same, that is, the first MPLS packet is forwarded along the same forwarding direction when passing through the first node and the second node. Therefore, the second node does not send the first MPLS packet to the first node. For example, in FIG.
  • the network node R2 receives the first MPLS packet sent by the network node R1, and the top label of the first MPLS packet is CWFIL, which is used to indicate that the first MPLS packet is in accordance with the MPLS packet. Forwarding in the clockwise direction, the network node R2 obtains the second context label CWFIL, and forwards the first MPLS packet to the network node R3 in a clockwise direction, and does not send the first MPLS packet again.
  • the network node R1 solves the technical problem of transient loops that may occur between the network node R1 and the network node R2.
  • the first next hop is specifically at the second node at the first node, because the second node forwards the first MPLS packet along a forwarding direction indicated by the first context label.
  • the next hop in the direction indicated by the context label that is, the second node is on the ring network
  • the first outgoing label corresponds to the first next hop, that is, the first next hop is a label allocated by the prefix FEC corresponding to the LFIB entry.
  • the prefix FEC is used to indicate the destination end of the first MPLS packet. For example, in the ring network shown in FIG.
  • the top label of the first MPLS packet is CWFIL
  • the top label of the second MPLS packet is label 52
  • the network node R2 associates the label 52 with the
  • the LFIB corresponding to the first context label matches, and the LFIB entry as shown in Table 5 is obtained.
  • 1.1.1.5/32 corresponds to the network node R5, that is, the destination end of the first MPLS packet is the network node R5.
  • the first next hop is the next hop of the route of the network node R2 in the clockwise direction, that is, the network node R3, and the first outgoing label is the network node R3 is 1.1.1.5/ 32 assigned labels.
  • the second node replaces the top label of the second MPLS packet with the first outgoing label, and pushes the second context label into the second MPLS packet that is label replaced.
  • the label stack to generate a third MPLS packet.
  • the second node in addition to replacing the top-of-stack label of the second MPLS packet with the first outgoing label, pushes the second context label into the second MPLS packet that has been label-replaced.
  • the label stack of the file is configured to generate a third MPLS packet, so that the network node that receives the third MPLS packet can forward the third MPLS packet according to the forwarding direction indicated by the second context label.
  • the first MPLS packet is forwarded to the third MPLS packet, and then forwarded.
  • the forwarding direction of the first MPLS packet after passing the second node in the ring network may actually be considered as the third generated by the first MPLS packet. Forwarding direction of the MPLS packet after passing the second node in the ring network
  • the second node sends the third MPLS packet to the first next hop corresponding to the first next hop information.
  • the first top hop is forwarded according to the forwarding direction indicated by the second context label, and the third MPLS is forwarded according to the second MPLS packet. Message.
  • the second node after receiving the first MPLS packet, pops up a top label of the first MPLS packet, that is, the first context label, and Obtaining a matching first LFIB entry in the LFIB corresponding to the first context label, where the first LFIB entry includes a second context label, where the first context label is used to indicate the first MPLS label a forwarding direction of the packet in the ring network after the first node is forwarded, where the second context label is used to indicate that the first MPLS packet is forwarded after passing the second node in the ring network.
  • the packet forwarding direction indicated by the second context label is the same as the packet forwarding direction indicated by the first context label, that is, the first MPLS packet passes the first node. And the second node is forwarded along the same forwarding direction. Therefore, the second node does not send the first MPLS packet to the first node. Therefore, when the MPLS packet is forwarded by the certain node, when the primary next hop of the certain node is unreachable, an instantaneous ring may occur between the first node and the second node.
  • the technical problem of the road The problem of resource waste and message delay caused by the technical problem of the instantaneous loop is further solved.
  • the network node R2 receives the first MPLS packet sent by the network node R1, and the top label of the first MPLS packet is specifically a CWFIL, and is used to indicate that the second MPLS packet is in accordance with Forwarding in a clockwise direction, the network node R2 forwards the second MPLS packet to the network node R3 in a clockwise direction, and does not send the second MPLS packet to the network node R1, thereby solving the network node.
  • the first context label may be an SPL or an ESPL, or may be a label that is allocated by the first node and advertised by using an LDP, an ISIS, or an OSPF protocol.
  • the second context label may be an SPL or an ESPL, or may be a label that is allocated by the second node and advertised by means of LDP, ISIS, or OSPF.
  • the first context tag may be used to indicate a clockwise forwarder
  • the direction is forwarded or counterclockwise, such as specifically CWFIL or CCWFIL. Therefore, the second LFIB corresponding to the clockwise forwarding direction and the third LFIB corresponding to the counterclockwise forwarding direction may be respectively set.
  • the embodiment may further include: the second node from the second LFIB or the third LFIB, Obtaining a LFIB corresponding to the first context tag. For example, if the first context tag is used to indicate a clockwise forwarding direction, the second LFIB is used as the LFIB corresponding to the first context tag.
  • the second LFIB is generated based on a route of the second node in a clockwise direction, that is, a next hop of any entry in the second LFIB is, and the second node is in a clockwise direction.
  • One hop in fact, is the neighboring node of the second node in the clockwise direction on the ring network.
  • the outbound label of any entry corresponds to the next hop of the entry, that is, the next hop in the entry is the label assigned to the prefix FEC of the entry.
  • the LFIB entries in the second LFIB that match the top label of the second MPLS packet may be as shown in Table 5.
  • the third LFIB is generated based on the route of the second node in the counterclockwise direction, that is, the next hop of any entry in the third LFIB is the next time in the counterclockwise direction of the second node.
  • the hop is actually the neighboring node of the second node in the counterclockwise direction of the ring network, and the outgoing label of any entry corresponds to the next hop of the entry, that is, the lower part of the entry
  • One hop is the label assigned to the prefix FEC of the entry.
  • the LFIB entry in the third LFIB that matches the top label of the second MPLS packet may be as shown in Table 6.
  • next hop is the next hop of the route of the network node R2 in the counterclockwise direction, that is, the label of the network node R1 is the label assigned by the network node R1 to 1.1.1.5/32.
  • the second node may also receive a network node outside the ring network.
  • the MPLS packet is sent, the MPLS packet does not include a context label for indicating a forwarding direction, and the second node may not press the context label in the MPLS packet, and the first node determines the When the primary hop of the node is unreachable, the context label used to indicate the forwarding direction is pushed in; or the second node may also press the MPLS packet into the MPLS packet after receiving the MPLS packet.
  • a context label indicating the direction of forwarding which is described in detail below.
  • the method further includes: the second node receiving a fourth MPLS packet from the third node, where the third node is a node connected to the ring network outside the ring network; the second node obtains, in the first LFIB, a second LFIB entry that matches the top label of the fourth MPLS packet, the second LFIB
  • the entry includes: a stack top label, a second next hop information, a second out label, and a third context label of the fourth MPLS packet; the third context label is used to indicate that the fourth MPLS packet is in a forwarding direction of the ring network after passing the second node; the second node replacing the top label of the fourth MPLS packet with the second out label, and the third context label Pressing the label stack of the fourth MPLS packet that has been tagged to generate a fifth MPLS packet; the second node sending the second hop corresponding to the second next hop information The fifth MPLS packet.
  • the first LFIB is generated based on the best route on the second node, that is, the next hop of any entry in the first LFIB is, and for the second node, the entry is The next hop of the best route corresponding to the prefix FEC.
  • the third context label may be an SPL or an ESPL, or may be a label that is allocated by the second node and advertised by using an LDP, an ISIS, or an OSPF protocol.
  • the first LFIB, the second LFIB, and the third LFIB may be saved on the second node, and obtained according to the top label of the received MPLS packet. Corresponding LFIB, and obtain a matching LFIB entry from the corresponding LFIB. Specifically, when the second MPLS packet is received by the second node, that is, the top label of the received MPLS packet is not a context label, the second LDPB is obtained from the first LFIB.
  • a LFIB entry when the third MPLS packet is received, where the top label of the third MPLS packet is the first context label, according to the first context label, the second LFIB or Obtaining a corresponding LFIB in the third LFIB, specifically, when the first context label indicates a clockwise forwarding direction, obtaining the first LFIB entry from the second LFIB, where When the first context label indicates a counterclockwise forwarding direction, the first LFIB entry is obtained from the third LFIB.
  • the network node R2 receives the first MPLS packet sent by the network node R1
  • the top label of the first MPLS packet is CWFIL
  • the network node R2 corresponds to the CWFIL.
  • the first LFIB entry as shown in Table 5 is obtained in the two LFIBs.
  • the second node may also obtain the corresponding LFIB according to the first context label, for example, the second node receives the first node from a network node outside the ring network.
  • the second LFIB entry is obtained from the first LFIB; the second node receives the first MPLS packet sent by the first node, when the second node Determining that the first node is an upstream node in a clockwise direction on the ring network, indicating that the first MPLS packet is forwarded in a clockwise direction, and the second node obtains the foregoing from the second LFIB a first LFIB entry, when the second node determines that the first node is an upstream node in a counterclockwise direction on the ring network, indicating that the first MPLS packet is forwarded in a counterclockwise direction, where the The two nodes obtain the first LFIB entry from the third LFIB.
  • the first LFIB, the second LFIB, and the third LFIB may respectively correspond to three different forwarding tables, for example, the first LFIB corresponds to the forwarding table 1, The second LFIB corresponds to the forwarding table 2, and the third LFIB corresponds to the forwarding table 3.
  • the first LFIB, the second LFIB, and the third LFIB may also correspond to the same table, for example, the first A LFIB, the second LFIB, and the third LFIB are all corresponding to the forwarding table 4, wherein the LFIB identifier can be set in the forwarding table 4 for distinguishing the three LFIBs.
  • the next hop in the clockwise direction and the next hop in the counterclockwise direction may be configured on the second node by manual or automatic machine generation, so that the second node can be configured according to the configuration. Generating the first LFIB, the second LFIB, and the third LFIB.
  • the forwarding process of the MPLS packet by the first node and the second node is respectively introduced.
  • the following uses the topology shown in FIG. 1 as an example to introduce MPLS packets in the ring network.
  • the forwarding process for each node is respectively introduced.
  • an embodiment of the present invention provides another method embodiment of a method for forwarding MPLS packets in a ring network.
  • the ring network in this embodiment includes a network node R1.
  • the network node R2 receives the first MPLS packet sent by the network node R6, and the network node R6 is a node that is connected to the ring network outside the ring network, that is, the first MPLS packet is described by the network node R2. Ring.
  • the network node R2 obtains, in the first LFIB of the network node R2, a first LFIB entry that matches the top label of the first MPLS packet.
  • the first LFIB entry may be as shown in Table 7.
  • the first LFIB of network node R2 is generated based on the best route on network node R2. In Table 7, 1.1.1.5/32 corresponds to network node R5.
  • the network node R2 replaces the top label of the first MPLS packet with the outgoing label of the first LFIB entry.
  • the first LFIB entry obtained in 402 may also be as shown in Table 6.
  • the method further includes: performing the first label replacement.
  • the CCWFIL for indicating the counterclockwise forwarding direction is pushed into the label stack of the MPLS packet. That is to say, in the embodiment of the present invention, the context label may be pushed on the ring network on the first MPLS packet, or the context label may be pushed on the network node where the next hop is unreachable.
  • the network node R2 sends the first MPLS packet that has been label-replaced to the network node R1 as the second MPLS packet.
  • the network node R1 receives the second MPLS packet, and obtains, in the first LFIB of the network node R1, a second LFIB entry that matches the top label of the second MPLS packet.
  • the second LFIB entry may be as shown in Table 2.
  • the CWFIL in Table 2 is a context label used to indicate a clockwise forwarding direction.
  • the first LFIB of the network node R1 is generated based on the best route on the network node R1.
  • the network node R1 determines that the network node R4 is unreachable, and the network node R1 replaces the top label of the second MPLS packet with the spare outgoing label in the second LFIB entry shown in Table 2, and The CWFIL pushes the label stack of the second MPLS packet that has been tagged to generate a third MPLS packet.
  • the network node R1 sends the third MPLS packet to the network node R2.
  • the network node R2 receives the third MPLS packet, and pops the top label of the third MPLS packet to generate a fourth MPLS packet.
  • the top label of the third MPLS packet is CWFIL.
  • the network node R2 obtains, according to the stack top label CWFIL of the third MPLS packet, a third LFIB entry that matches the top label of the fourth MPLS packet in the second LFIB of the network node R2.
  • the third LFIB entry may be as shown in Table 5.
  • the second LFIB of the network node R2 is generated based on the routing of the network node R2 in the clockwise direction.
  • the network node R2 replaces the top label of the fourth MPLS packet with the outgoing label in the third LFIB entry shown in Table 5, and pushes the CWFIL in the third LFIB entry. And performing label replacement on the label stack of the fourth MPLS packet to generate a fifth MPLS packet.
  • the network node R2 sends the fifth MPLS message to the network node R3.
  • the network node R3 After receiving the fifth MPLS packet, the network node R3 performs a similar operation with the network node R2 to generate a sixth MPLS packet, and sends the sixth MPLS packet to the network node R4.
  • the sixth MPLS packet is sent from the ring network of the network node R4.
  • the network node R4 pops the stack top label CWFIL in the sixth MPLS packet to generate a seventh MPLS packet, and according to the stack top label CWFIL of the sixth MPLS packet, the second in the network node R4.
  • a fourth LFIB entry matching the top label of the seventh MPLS packet is obtained in the LFIB.
  • the fourth LFIB entry may be as shown in Table 8.
  • the tag 55 is a tag assigned by the network node R5 to 1.1.1.5/32.
  • the network node R4 holds the first LFIB, the second LFIB, and the third LFIB of the network node R4, where the network node R4 is the section of the ring network under the seventh MPLS packet. Therefore, the entries in the three LFIBs on the network node R4 that match the top of the label stack of the seventh MPLS packet are identical in the content of the entry, for example, as shown in Table 8.
  • the network node R4 replaces the top label of the seventh MPLS packet with the outgoing label of the fourth LFIB entry, and sends the seventh MPLS packet that is replaced by the label to the network node R5.
  • an embodiment of the present invention provides a schematic structural diagram of a network node.
  • the network node is the first node 500, and the first node 500 is located in the ring network.
  • the first node 500 is a network node R1.
  • the first node 500 of this embodiment includes a processing unit 501 and a transmitting unit 502. among them,
  • the processing unit 501 is configured to obtain a first MPLS packet.
  • the processing unit 501 can directly use the MPLS packet sent by the other node as the first MPLS packet, and can perform the certain processing on the MPLS packet sent by the other node as the first MPLS packet.
  • the processing unit 501 is further configured to obtain a LFIB entry that matches the top label of the first MPLS packet.
  • the stack top label of the first MPLS packet is used to guide the forwarding of the first MPLS packet, and the processing unit 501 uses the top label of the first MPLS packet and the LFIB of the first node 500.
  • the LFIB entry is matched, and the LFIB entry matching the top label of the first MPLS packet can be obtained in the LFIB of the first node 500.
  • the processing unit 501 generally matches each LFIB entry in the LFIB of the first node 500 with the top label of the first MPLS packet, and is a table in the LFIB of the first node 500.
  • the entry label of the item is the same as the top label of the first MPLS packet, the entry is used as the LFIB entry matching the top label of the first MPLS packet, and the LFIB table is obtained. item.
  • the LFIB entry includes primary next hop information, alternate next hop information, alternate outgoing label, and an alternate first context label.
  • the LFIB entry generally includes an inbound label, a primary outgoing label, and a prefix FEC corresponding to the entry, where the prefix FEC is used to indicate a destination end of the first MPLS packet.
  • the top label of the first MPLS packet is the label 51
  • the processing unit 501 matches the label 51 with the LFIB of the network node R1 to obtain the LFIB entry as shown in Table 2.
  • 1.1.1.5/32 corresponds to the network node R5, that is, the destination end of the first MPLS packet is the network node R5.
  • the LFIB entry includes the spare first context label, where the first context label is used to indicate the first MPLS packet.
  • the first context label is used to indicate the first MPLS packet.
  • the forwarding direction is forwarded until the ring network or the U-turn is down in the first MPLS packet.
  • the first context label may be used to indicate a clockwise forwarding direction or a counterclockwise forwarding direction, such as specifically CWFIL or CCWFIL, so that the first context label indicates that the first MPLS packet is after passing through the first node 500. , always forward in a clockwise or counterclockwise direction.
  • the first context label is CWFIL, and is used to indicate that the first MPLS packet is forwarded in a clockwise direction after passing through the first node 500.
  • the first context label is an alternate label, that is, the first context label is used when the first MPLS packet needs to be forwarded to the standby next hop.
  • the processing unit 501 is further configured to: when determining that the primary next hop corresponding to the primary next hop information is unreachable, replace the top label of the first MPLS packet with the spare outgoing label, and The first context label is pushed into the label stack of the first MPLS packet that has been tag-replaced to generate a second MPLS packet.
  • the processing unit 501 determines that the primary next hop is unreachable, in addition to replacing the top-of-stack label of the first MPLS packet with the spare outgoing label,
  • the first context label is pushed into the label stack of the first MPLS packet that is replaced by the label, to generate a second MPLS packet, so that the label is displayed in the top label of the second MPLS packet.
  • the standby next hop can follow the first context after receiving the second MPLS packet.
  • the forwarding direction indicated by the label forwards the second MPLS packet, and the second MPLS packet is not sent to the first node 500.
  • the processing unit 501 obtains the first MPLS report. After the first MPLS packet is forwarded to the second MPLS packet, the first MPLS packet is forwarded, and the first MPLS packet is in the ring network.
  • the forwarding direction after passing through the first node 500 may actually be considered as the forwarding direction of the second MPLS packet generated by the first MPLS packet after passing through the first node 500 in the ring network.
  • the processing unit 501 is further configured to: when determining that the primary next hop is reachable, replace the top label of the first MPLS packet with the primary outgoing label, and use the next used label The hop sends the first MPLS packet that has been tag-replaced.
  • the sending unit 502 is configured to send the second MPLS packet to the standby next hop corresponding to the standby next hop information.
  • the second MPLS packet is forwarded according to the forwarding direction indicated by the first context label.
  • the LFIB entry obtained by the processing unit 501 includes an alternate first context label, where the first context label is used to indicate that the first MPLS packet is The forwarding direction of the ring network after passing through the first node 500. Therefore, when the first node 500 forwards the first MPLS packet, the processing unit 501 determines that the primary next hop is unreachable, except that the top label of the first MPLS packet is replaced with the standby.
  • the first context label is also pushed into the label stack of the first MPLS packet that has been tag-replaced to generate a second MPLS packet and sent by the sending unit 502 to the standby next
  • the second MPLS packet can be forwarded according to the forwarding direction indicated by the first context label, so that the first The MPLS packet is forwarded in the same direction through the first node 500 and the standby next hop. Therefore, the standby next hop does not send the second MPLS packet to the first node 500.
  • the technical problem of the instantaneous loop that may occur between the first node 500 and the standby next hop when the primary next hop is unreachable when the first node 500 forwards the first MPLS packet is avoided. .
  • the problem of resource waste and message delay caused by the technical problem of the instantaneous loop is further solved.
  • the second MPLS packet is sent to the network node R2, and the top label of the second MPLS packet is specifically CWFIL, which is used to indicate
  • the second MPLS packet is forwarded in a clockwise direction, so the network node R2 follows the sequence.
  • the second MPLS packet is forwarded to the network node R3, and the second MPLS packet is not sent to the network node R1, thereby solving a possible moment between the network node R1 and the network node R2.
  • the first context label may be an SPL or an ESPL, or may be a label that is allocated by the first node 500 and advertised by means of LDP, ISIS, or OSPF.
  • the processing unit 501 may directly use the MPLS packet sent by the other node as the first MPLS packet, and may perform the certain processing on the MPLS packet sent by the other node as the first MPLS packet.
  • the processing unit 501 can also obtain the LFIB entry from the corresponding LFIB according to the top label of the MPLS packet sent by the other node. The following two cases are explained.
  • the processing unit 501 may directly use the MPLS packet sent by the other node as the first MPLS packet.
  • the first node 500 further includes: a receiving unit, when the processing unit 501 When the first MPLS packet is obtained, the processing unit 501 is configured to obtain, by the receiving unit, the first MPLS packet sent by the second node to the first node 500.
  • the second node may be a node in the ring network.
  • the network node R1 obtains the first MPLS packet sent by the network node R2, and the second node may also be the A node outside the ring network that is connected to the ring network.
  • the first context label may be added to the LFIB currently generated based on the best route in the embodiment of the present invention.
  • a node 500 obtains the LFIB entry in the LFIB generated based on the best route.
  • the processing unit 501 obtains the LFIB entry that matches the top-of-rack label of the first MPLS packet
  • the processing unit 501 is configured to obtain the first MPLS packet in the first LFIB.
  • the stack top tag matches the LFIB entry.
  • the first LFIB is generated based on the best route on the first node 500, that is, the primary next hop of any entry in the first LFIB is for the first node 500, in the entry.
  • the next hop of the best route corresponding to the prefix FEC For example, in the entry shown in Table 2, the primary next hop is the next hop of the best route corresponding to 1.1.1.5/32 for the network node R1, that is, the network node R4.
  • the label of the MPLS packet sent by the other node to the first node 500 may be pushed into the context label, and the processing unit 501 needs to send other nodes.
  • the MPLS packet sent is processed in a certain manner, for example, the context label is popped up to obtain the first MPLS packet.
  • the first node 500 further includes: a receiving unit.
  • the processing unit 501 obtains the first MPLS packet, the processing unit 501 is configured to receive, by using the receiving unit, a third MPLS packet sent by the second node, where the top label of the third MPLS packet is And deleting the second context label of the third MPLS packet to generate the first MPLS packet.
  • the second context label is used to indicate a forwarding direction of the first MPLS packet after passing the second node in the ring network, and a packet forwarding direction indicated by the second context label
  • the packet forwarding direction indicated by the first context label is reversed.
  • the second context label may be CCWFIL, configured to indicate that the first MPLS packet is forwarded in a counterclockwise direction after passing through the network node R2 in the ring network
  • the first context label is
  • the CWFIL may be used to indicate that the first MPLS packet is forwarded in a clockwise direction after passing through the network node R1 in the ring network.
  • the second context label may be an SPL or an ESPL, or may be a label that is allocated by the second node and advertised by means of LDP, ISIS, or OSPF.
  • the LFIB corresponding to the second context label may also be set in the embodiment of the present invention.
  • the first context tag is added to the LFIB corresponding to the second context tag.
  • the processing unit 501 when the processing unit 501 obtains the LFIB entry that matches the top label of the first MPLS packet, the processing unit 501 is configured to obtain, in the LFIB corresponding to the second context label, The LFIB entry matched by the top label of the first MPLS packet.
  • the LFIB corresponding to the second context label is generated based on the route of the first node 500 in the forwarding direction indicated by the second context label, that is, the master of any entry in the LFIB corresponding to the second context label.
  • the next hop of the first node 500 in the forwarding direction indicated by the second context label is actually the second context label of the first node 500 on the ring network.
  • the neighbor node in the indicated forwarding direction is obviously different from the first LFIB generated based on the best route on the first node 500.
  • the primary outgoing label of any entry corresponds to the primary next hop of the entry, that is, the primary next hop of the entry is the label assigned by the prefix FEC of the entry.
  • the processing unit 501 is further configured to obtain, in the second LFIB or the third LFIB, the LFIB corresponding to the second context label. For example, if the second context tag is used to indicate a clockwise forwarding direction, the second LFIB is used as the LFIB corresponding to the second context tag.
  • the second LFIB is generated based on the route of the first node 500 in the clockwise direction, that is, the primary next hop of any entry in the second LFIB is, and the first node 500 is in the clockwise direction.
  • One hop in fact, is the neighbor node of the first node 500 in the clockwise direction on the ring network.
  • the primary outgoing label of any entry corresponds to the primary next hop of the entry, that is, the primary next hop of the entry is the label assigned by the prefix FEC of the entry.
  • the LFIB entries in the second LFIB that match the top label of the first MPLS packet may be as shown in Table 3.
  • the primary next hop is the next hop of the route of the network node R1 in the clockwise direction, that is, the network node R2, and the primary outgoing label is the network node R2 is 1.1.1.5/ 32 assigned labels.
  • the entry also contains the primary context label CWFIL and the alternate context label CCWFIL.
  • the third LFIB is generated based on the route of the first node 500 in the counterclockwise direction, that is, the primary next hop of any entry in the third LFIB is the next time in the counterclockwise direction of the first node 500.
  • the hop is actually the neighboring node of the first node 500 in the counterclockwise direction of the ring network, and the primary outgoing label of any entry corresponds to the primary next hop of the entry, that is, the entry
  • the primary next hop is the label assigned to the prefix FEC of the entry.
  • the LFIB entry in the third LFIB that matches the top label of the first MPLS packet may be as shown in Table 4.
  • the primary next hop is the next hop of the route of the network node R1 in the counterclockwise direction, that is, the network node R4, and the primary outgoing label is the network node R4 is 1.1.1.5/ 32 assigned labels.
  • the entry also contains the primary context tag CCWFIL and the alternate context tag CWFIL.
  • the first LFIB, the second LFIB, and the third LFIB may be saved on the first node 500, and the processing unit 501 is configured according to the top label of the received MPLS packet. Obtaining a corresponding LFIB, and obtaining, from the corresponding LFIB, a LFIB entry that matches the top label of the first MPLS packet.
  • the processing unit 501 when the first node 500 is connected When the first MPLS packet is received, that is, the received top label of the MPLS packet is not a context label, the processing unit 501 is configured to obtain the LFIB entry from the first LFIB; The first node 500 receives the third MPLS packet, where the top label of the third MPLS packet is the second context label, and the processing unit 501 is configured to use the second context label according to the second context label.
  • the processing unit 501 configured to obtain the LFIB from the second LFIB when the second context label indicates a clockwise forwarding direction
  • An entry when the second context label indicates a counterclockwise forwarding direction, obtaining the LFIB entry from the third LFIB.
  • the network node R1 receives the third MPLS packet sent by the network node R2, where the top label of the third MPLS packet is CCWFIL, and the processing unit 501 corresponds to CCWFIL.
  • the LFIB entry as shown in Table 4 is obtained in the third LFIB.
  • the processing unit 501 may not obtain the corresponding LFIB according to the second context label, for example, the first node 500 receives the first MPLS packet sent by the second node,
  • the processing unit 501 is configured to: when determining that the second node is a node outside the ring network, obtain the LFIB entry from the first LFIB; and when determining that the second node is on the ring network
  • the first MPLS packet is forwarded in a clockwise direction, and the LFIB entry is obtained from the second LFIB; when it is determined that the second node is the ring network inverse
  • the first MPLS packet is forwarded in a counterclockwise direction, and the LFIB entry is obtained from the third LFIB.
  • the first LFIB, the second LFIB, and the third LFIB may respectively correspond to three different forwarding tables, for example, the first LFIB corresponds to the forwarding table 1, The second LFIB corresponds to the forwarding table 2, and the third LFIB corresponds to the forwarding table 3.
  • the first LFIB, the second LFIB, and the third LFIB may also correspond to the same table, for example, the first A LFIB, the second LFIB, and the third LFIB are all corresponding to the forwarding table 4, wherein the LFIB identifier can be set in the forwarding table 4 for distinguishing the three LFIBs.
  • the next hop in the clockwise direction and the next hop in the counterclockwise direction may be configured on the first node 500 by manual or automatic machine generation, so that the first node 500 can generate according to the configuration.
  • the first LFIB, the second LFIB, and the third LFIB may be configured on the first node 500 by manual or automatic machine generation, so that the first node 500 can generate according to the configuration.
  • the first context label is used to indicate the forwarding direction, and the following describes how to forward the MPLS packet according to the first context label after receiving the MPLS packet with the top-of-stack label as the first context label from the perspective of the second node.
  • an embodiment of the present invention provides a schematic structural diagram of another network node.
  • the network node is a second node 600
  • the ring network includes a first node and a second node 600.
  • the first node is a network node R1
  • the second node 600 is a network node R2.
  • the second node 600 includes a receiving unit 601, a processing unit 602, and a transmitting unit 603. among them,
  • the receiving unit 601 is configured to receive the MPLS packet sent by the first node, where the top label of the first MPLS packet is a first context label.
  • the first context label is used to indicate a forwarding direction of the first MPLS packet after passing the first node in the ring network.
  • the first MPLS packet is generated when the first node determines that the primary next hop of the first node is unreachable. Two nodes 600 sent.
  • the processing unit 602 is configured to pop the first context label of the first MPLS packet to generate a second MPLS packet, and obtain the second MPLS in the LFIB corresponding to the first context label. The first LFIB entry matched by the top label of the packet.
  • the processing unit 602 when the matching is performed, the processing unit 602 generally matches each LFIB entry in the LFIB corresponding to the first context label with a top-of-stack label of the second MPLS packet, where the first context label corresponds to When the inbound label of an entry in the LFIB is the same as the top label of the second MPLS packet, the entry is used as the LFIB entry that matches the top label of the second MPLS packet. And obtaining the LFIB entry.
  • the LFIB corresponding to the first context label is generated based on the route of the second node 600 in the forwarding direction indicated by the first context label, that is, the LFIB corresponding to the first context label.
  • the primary next hop of any entry is, and the second node 600 is
  • the next hop in the forwarding direction indicated by the first context label is actually a neighbor node in the forwarding direction indicated by the first context label of the second node 600 on the ring network, apparently Unlike the LFIB generated based on the best route on the second node 600.
  • the first LFIB entry obtained in the LFIB corresponding to the first context label includes: a top label of the second MPLS packet, a first next hop information, a first outgoing label, and a second a context label, where the second context label is used to indicate a forwarding direction of the first MPLS packet after passing through the second node 600 in the ring network, and a forwarding direction indicated by the second context label is
  • the forwarding direction indicated by a context label is the same, that is, the first MPLS packet is forwarded along the same forwarding direction when passing through the first node and the second node 600. Therefore, the second node 600 does not send the first MPLS packet to the first node. For example, in FIG.
  • the network node R2 receives the first MPLS packet sent by the network node R1, and the top label of the first MPLS packet is CWFIL, which is used to indicate that the first MPLS packet is in accordance with the MPLS packet. Forwarding in the clockwise direction, the network node R2 obtains the second context label CWFIL, and forwards the first MPLS packet to the network node R3 in a clockwise direction, and does not send the first MPLS packet again.
  • the network node R1 solves the technical problem of transient loops that may occur between the network node R1 and the network node R2.
  • the first next hop is specifically at the second node 600 in the first context label, because the second node 600 forwards the first MPLS packet along the forwarding direction indicated by the first context label.
  • the next hop in the indicated direction that is, the neighbor node in the direction indicated by the first context label on the ring network by the second node 600.
  • the first outgoing label corresponds to the first next hop, that is, the first next hop is a label allocated by the prefix FEC corresponding to the LFIB entry.
  • the prefix FEC is used to indicate the destination end of the first MPLS packet. For example, in the ring network shown in FIG.
  • the top label of the first MPLS packet is CWFIL
  • the top label of the second MPLS packet is label 52
  • the network node R2 associates the label 52 with the
  • the LFIB corresponding to the first context label matches, and the LFIB entry as shown in Table 5 is obtained.
  • 1.1.1.5/32 corresponds to the network node R5, that is, the destination end of the first MPLS packet is the network node R5.
  • the first next hop is the next hop of the route of the network node R2 in the clockwise direction, that is, the network node R3, and the first outgoing label is the network node R3 is 1.1.1.5/ 32 assigned labels.
  • the processing unit 602 is further configured to replace the stack top label of the second MPLS packet with the first egress label, and press the second context label into the second MPLS packet that is label replaced.
  • the label stack to generate a third MPLS packet.
  • the processing unit 602 after replacing the top-of-stack label of the second MPLS packet with the first outgoing label, pushes the second context label into the second MPLS packet that has been label-replaced.
  • the label stack is configured to generate a third MPLS packet, so that the network node that receives the third MPLS packet can forward the third MPLS packet according to the forwarding direction indicated by the second context label.
  • the first MPLS packet is forwarded to the third MPLS packet, and then forwarded.
  • the forwarding direction of the first MPLS packet after passing through the second node 600 in the ring network may actually be considered as the third MPLS generated based on the first MPLS packet. Forwarding direction of the packet after passing through the second node 600 in the ring network
  • the sending unit 603 is configured to send the third MPLS packet to the first next hop corresponding to the first next hop information.
  • the first top hop is forwarded according to the forwarding direction indicated by the second context label, and the third MPLS is forwarded according to the second MPLS packet. Message.
  • the processing unit 602 pops up the top label of the first MPLS packet, that is, the first context label. And obtaining a matching first LFIB entry in the LFIB corresponding to the first context label, where the first LFIB entry includes a second context label, where the first context label is used to indicate the first
  • the MPLS packet is forwarded by the first node in the ring network, and the second context label is used to indicate that the first MPLS packet is forwarded after passing through the second node 600 in the ring network.
  • the packet forwarding direction indicated by the second context label is the same as the packet forwarding direction indicated by the first context label, that is, the first MPLS packet passes the first node.
  • the second node 600 When the second node 600 is used, it is forwarded along the same forwarding direction. Therefore, the second node 600 does not send the first MPLS packet to the first node. Therefore, when a certain node forwards the MPLS packet, when the primary next hop of the certain node is unreachable, the first node and the second node are avoided.
  • the technical problem of the instantaneous loop that may occur between points 600. The problem of resource waste and message delay caused by the technical problem of the instantaneous loop is further solved.
  • the network node R2 receives the first MPLS packet sent by the network node R1, and the top label of the first MPLS packet is specifically a CWFIL, and is used to indicate that the second MPLS packet is in accordance with Forwarding in a clockwise direction, the network node R2 forwards the second MPLS packet to the network node R3 in a clockwise direction, and does not send the second MPLS packet to the network node R1, thereby solving the network node.
  • the first context label may be an SPL or an ESPL, or may be a label that is allocated by the first node and advertised by using an LDP, an ISIS, or an OSPF protocol.
  • the second context label may be an SPL or an ESPL, or may be a label that is allocated by the second node 600 and advertised by means of LDP, ISIS, or OSPF.
  • the first context tag may be used to indicate a clockwise forwarding direction or a counterclockwise forwarding direction, such as specifically CWFIL or CCWFIL. Therefore, the second LFIB corresponding to the clockwise forwarding direction and the third LFIB corresponding to the counterclockwise forwarding direction may be respectively set, and the processing unit 602 is further configured to obtain, in the second LFIB or the third LFIB, the first context label. LFIB. For example, if the first context tag is used to indicate a clockwise forwarding direction, the second LFIB is used as the LFIB corresponding to the first context tag.
  • the second LFIB is generated based on the route of the second node 600 in the clockwise direction, that is, the next hop of any entry in the second LFIB is the next hop of the second node 600 in the clockwise direction.
  • the second node 600 is a neighbor node in the clockwise direction on the ring network.
  • the outbound label of any entry corresponds to the next hop of the entry, that is, the next hop in the entry is the label assigned to the prefix FEC of the entry.
  • the LFIB entries in the second LFIB that match the top label of the second MPLS packet may be as shown in Table 5.
  • the third LFIB is generated based on the route of the second node 600 in the counterclockwise direction, that is, the next hop of any entry in the third LFIB is the next hop of the second node 600 in the counterclockwise direction.
  • the second node 600 is a neighboring node in the counterclockwise direction of the ring network, and the outgoing label of any entry corresponds to the next hop of the entry, that is, the next hop in the entry is The prefix assigned by the prefix FEC of this entry.
  • the The LFIB entry in the third LFIB that matches the top label of the second MPLS packet may be as shown in Table 6.
  • next hop is the next hop of the route of the network node R2 in the counterclockwise direction, that is, the label of the network node R1 is the label assigned by the network node R1 to 1.1.1.5/32.
  • the receiving unit 601 may further receive an MPLS packet sent by a network node outside the ring network, where the MPLS packet does not include a context for indicating a forwarding direction.
  • the labeling, processing unit 602 may not push the context label into the MPLS packet, and when the first node determines that the primary next hop of the first node is unreachable, push the context label for indicating the forwarding direction.
  • the processing unit 602 may also inject a context label indicating the forwarding direction in the MPLS packet after receiving the MPLS packet, and the manner is specifically described below.
  • the processing unit 602 is further configured to receive the fourth MPLS packet from the third node, and obtain the first MPLS packet in the first LFIB.
  • a second LFIB entry that is matched by the top label of the MPLS packet, where the third node is a node that is connected to the ring network outside the ring network, and the second LFIB entry includes: the fourth MPLS a stack top label, a second next hop information, a second out label, and a third context label of the packet; the third context label is used to indicate that the fourth MPLS packet passes the first in the ring network a forwarding direction of the second node; the processing unit 602 is further configured to replace the top label of the fourth MPLS packet with the second outgoing label, and press the third context label into the label replacement
  • the labeling stack of the fourth MPLS packet is configured to generate a fifth MPLS packet, and the sending unit 602 is further configured to send the fifth MPLS packet to the second next hop corresponding
  • the first LFIB is generated based on the best route on the second node 600, that is, the next hop of any entry in the first LFIB is, for the second node 600, in the entry The next hop of the best route corresponding to the prefix FEC.
  • the third context label may be an SPL or an ESPL, or may be a label that is allocated by the second node 600 and advertised by means of LDP, ISIS, or OSPF.
  • the first LFIB, the second LFIB, and the third LFIB may be saved on the second node 600, and the processing unit 602 is configured according to the received MPLS.
  • the stack top label of the message obtains the corresponding LFIB and obtains a matching LFIB entry from the corresponding LFIB.
  • the processing unit 602 is configured to use the first LFIB. Obtaining the second LFIB entry.
  • the processing unit 602 is configured according to the first context.
  • the tag obtains a corresponding LFIB from the second LFIB or the third LFIB, specifically, the processing unit 602, configured to obtain, from the second LFIB, when the first context tag indicates a clockwise forwarding direction And the first LFIB entry, when the first context label indicates a counterclockwise forwarding direction, obtaining the first LFIB entry from the third LFIB.
  • the processing unit 602 corresponds to the first part of the CWFIL.
  • the first LFIB entry as shown in Table 5 is obtained in the two LFIBs.
  • the processing unit 602 may not obtain the corresponding LFIB according to the first context label.
  • the receiving unit 601 receives the fourth MPLS packet from a network node outside the ring network.
  • the processing unit 602 is configured to obtain the second LFIB entry from the first LFIB, and the receiving unit 601 receives the first MPLS packet sent by the first node, and the processing unit 602 is configured to:
  • the first MPLS packet is forwarded in a clockwise direction
  • the first LFIB table is obtained from the second LFIB.
  • the first MPLS packet is forwarded in a counterclockwise direction, and the first is obtained from the third LFIB. LFIB entry.
  • the first LFIB, the second LFIB, and the third LFIB may respectively correspond to three different forwarding tables, for example, the first LFIB corresponds to the forwarding table 1, The second LFIB corresponds to the forwarding table 2, and the third LFIB corresponds to the forwarding table 3.
  • the first LFIB, the second LFIB, and the third LFIB may also correspond to the same table, for example, the first A LFIB, the second LFIB, and the third LFIB are all corresponding to the forwarding table 4, wherein the LFIB identifier can be set in the forwarding table 4 for distinguishing the three LFIBs.
  • the next hop in the clockwise direction and the next hop in the counterclockwise direction may be configured on the second node 600 by manual or machine automatic generation, etc., so that the second node 600 can generate the first according to the configuration.
  • LFIB, the second LFIB, and the third LFIB when generating the first LFIB, the second LFIB, and the third LFIB, it is necessary to specify a clockwise direction and a counterclockwise direction on the ring network.
  • the next hop in the clockwise direction and the next hop in the counterclockwise direction may be configured on the second node 600 by manual or machine automatic generation, etc., so that the second node 600 can generate the first according to the configuration.
  • LFIB, the second LFIB, and the third LFIB when generating the first LFIB, the second LFIB, and the third LFIB.
  • the embodiment of the network node in the embodiment of the present invention is described above from the perspective of a modular functional entity.
  • the embodiment of the network node in the embodiment of the present invention will be described below from the perspective of hardware processing.
  • FIG. 7 is a schematic structural diagram of another network node according to an embodiment of the present invention.
  • the network node is a first node 700, and the first node 700 is located in a ring network.
  • the first node 700 of this embodiment specifically includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704.
  • the processor 701, the communication interface 702, and the memory 703 complete communication with each other via the bus 704.
  • the processor 701 is configured to execute the program 705.
  • program 705 can include program code, the program code including computer operating instructions.
  • the processor 701 may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the memory 703 is configured to store the program 705.
  • the memory 703 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • the program 705 is used to perform the following steps:
  • LFIB entry that matches the top label of the first MPLS packet, where the LFIB entry includes primary next hop information, alternate next hop information, alternate outgoing label, and alternate first a context label, where the first context label is used to indicate a forwarding direction of the first MPLS packet after passing the first node in the ring network;
  • the first node When determining that the primary next hop corresponding to the primary next hop information is unreachable, the first node replaces the top label of the first MPLS packet with the spare outgoing label, and the The first context label is pushed into the label stack of the first MPLS packet that has been label-replaced to generate a second MPLS packet;
  • Each functional unit of the first node 700 provided in this embodiment may be a specific implementation based on the method embodiment shown in FIG. 2 and the device embodiment shown in FIG. 5, and the definition and description of the term and FIG. The illustrated method embodiment is consistent with the device embodiment shown in FIG. 5 and will not be described again here.
  • an embodiment of the present invention provides a schematic structural diagram of another network node.
  • the network node is a second node 800
  • the ring network includes a first node and a second node 800.
  • the second node 800 of this embodiment specifically includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804.
  • the processor 801, the communication interface 802, and the memory 803 complete communication with each other via the bus 804.
  • the processor 801 is configured to execute the program 805.
  • program 805 can include program code, the program code including computer operating instructions.
  • the processor 801 may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the memory 803 is configured to store the program 805.
  • the memory 803 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • the program 805 is used to perform the following steps:
  • the first node Receiving, by the first node, the first MPLS packet, where the top label of the first MPLS packet is a first context label, and the first context label is used to indicate that the first MPLS packet is in the a forwarding direction after passing the first node in the ring network;
  • the label forwarding information base LFIB corresponding to the first context label Obtaining, in the label forwarding information base LFIB corresponding to the first context label, a first LFIB entry that matches the top label of the second MPLS packet, where the first LFIB entry includes: a stack top label, a first next hop information, a first outgoing label, and a second context label of the second MPLS packet, where the second context label is used to indicate that the first MPLS packet is in the ring network
  • the forwarding direction of the packet indicated by the second context label is the same as the forwarding direction of the packet indicated by the first context label;
  • Each functional unit of the second node 800 provided in this embodiment may be a specific implementation based on the method embodiment shown in FIG. 3 and the device embodiment shown in FIG. 6, and the definition and description of the term and FIG. The illustrated method embodiment is consistent with the device embodiment shown in FIG. 6, and details are not described herein again.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in various embodiments of the present invention may be integrated in one processing unit. It is also possible that each unit physically exists alone, or two or more units may be integrated in one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Abstract

本发明实施例提供了一种环网中多协议标签交换(MPLS)报文转发的方法及网络节点,所述方法包括:第一节点获得第一MPLS报文;获得与所述第一MPLS报文的栈顶标签匹配的标签转发信息库(LFIB)表项,所述LFIB表项包含备用的第一上下文标签;当确定主用下一跳不可达时,将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文;向备用下一跳发送所述第二MPLS报文。可见,本发明实施例中在进行了标签替换的所述第一MPLS报文的标签栈中压入所述第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向,从而避免了所述第一节点转发所述MPLS报文时,当所述主用下一跳不可达时在所述第一节点和第二节点之间可能出现的瞬间环路问题。

Description

一种环网中MPLS报文转发的方法及网络节点
本申请要求于2015年2月5日提交中国专利局、申请号为CN 201510060726.9、发明名称为“一种环网中MPLS报文转发的方法及网络节点”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信领域,尤其是涉及一种环网中多协议标签交换(英文:Multi-Protocol Label Switch,简称:MPLS)报文转发的方法及网络节点。
背景技术
环网(英文:ring network)是一种常见的拓扑结构。在环网中,通常利用MPLS技术实现MPLS报文的转发。
目前MPLS报文在环网中的转发方式是,网络节点接收到MPLS报文后,会从所述网络节点的标签转发信息库(英文:Label Forwarding Information Base,简称:LFIB)中获得匹配的LFIB表项,根据所述LFIB表项确定主用下一跳和备用下一跳。当所述网络节点确定所述主用下一跳不可达时,将所述MPLS报文转发至所述备用下一跳,并且所述网络节点还会向所述备用下一跳发送所述主用下一跳不可达的信息,以使得所述备用下一跳根据该不可达信息收敛路由。
然而,由于该不可达信息从所述网络节点发送至所述备用下一跳,以及所述备用下一跳根据该不可达信息进行路由收敛都需要花费一定的时间,因此可能会导致,当所述备用下一跳接收到所述网络节点转发的所述MPLS报文时,所述备用下一跳还未完成路由收敛,因此所述备用下一跳很有可能会将所述MPLS报文又发送至所述网络节点,导致所述MPLS报文在所述网络节点和所述备用下一跳之间来回转发,造成了瞬间环路的技术问题。
发明内容
本发明实施例解决的技术问题在于提供一种环网中报文转发的方法及网络节点,以解决环网中出现的瞬间环路的技术问题。
为此,本发明实施例解决技术问题的技术方案是:
第一方面,本发明实施例提供了一种环网中MPLS报文转发的方法,所述环网中包括第一节点,所述方法包括:
所述第一节点获得第一MPLS报文;
所述第一节点获得与所述第一MPLS报文的栈顶标签匹配的标签转发信息库LFIB表项,所述LFIB表项包含主用下一跳信息、备用下一跳信息、备用出标签和备用的第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
当所述第一节点确定所述主用下一跳信息对应的主用下一跳不可达时,所述第一节点将所述第一MPLS报文的栈顶标签替换为所述备用出标签,并将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文;
所述第一节点向所述备用下一跳信息对应的备用下一跳发送所述第二MPLS报文。
在第一方面的第一种可能的实现方式中,所述第一节点获得所述第一MPLS报文包括:
所述第一节点获得第二节点向所述第一节点发送的所述第一MPLS报文。
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述第一节点获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项包括:
所述第一节点在第一LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项,所述第一LFIB基于所述第一节点上的最佳路由生成。
在第一方面的第三种可能的实现方式中,所述第一节点获得所述第一MPLS报文包括:
所述第一节点接收第二节点发送的第三MPLS报文,所述第三MPLS报 文的栈顶标签为第二上下文标签;
所述第一节点将所述第三MPLS报文的所述第二上下文标签弹出,以生成所述第一MPLS报文,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相反。
结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,所述第一节点获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项包括:
所述第一节点在所述第二上下文标签对应的LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。
结合第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现方式中,还包括:
所述第一节点在第二LFIB或者第三LFIB中,获得与所述第二上下文标签对应的LFIB,其中,所述第二LFIB基于所述第一节点在顺时针方向上的路由生成,所述第三LFIB基于所述第一节点在逆时针方向上的路由生成。
第二方面,本发明实施例提供了一种环网中MPLS报文转发的方法,所述环网中包括第一节点和第二节点,所述方法包括:
所述第二节点接收所述第一节点发送的第一MPLS报文,所述第一MPLS报文的栈顶标签为第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
所述第二节点将所述第一MPLS报文的所述第一上下文标签弹出,以生成第二MPLS报文;
所述第二节点在所述第一上下文标签对应的标签转发信息库LFIB中获得与所述第二MPLS报文的栈顶标签匹配的第一LFIB表项,所述第一LFIB表项包含:所述第二MPLS报文的栈顶标签、第一下一跳信息、第一出标签和第二上下文标签,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相 同;
所述第二节点将所述第二MPLS报文的栈顶标签替换为所述第一出标签,并将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文;
所述第二节点向所述第一下一跳信息对应的第一下一跳发送所述第三MPLS报文。
在第二方面的第一种可能的实现方式中,还包括:
所述第二节点在第二LFIB或者第三LFIB中,获得与所述第一上下文标签对应的LFIB,其中,所述第二LFIB基于所述第二节点在顺时针方向上的路由生成,所述第三LFIB基于所述第二节点在逆时针方向上的路由生成。
结合第二方面或者第二方面的第一种可能的实现方式,在第二方面的第三种可能的实现方式中,在所述第二节点接收所述第一节点发送的所述第一MPLS报文之前所述方法还包括:
所述第二节点从第三节点接收第四MPLS报文,所述第三节点为所述环网外与所述环网连接的节点;
所述第二节点在第一LFIB中获得与所述第四MPLS报文的栈顶标签匹配的第二LFIB表项,所述第二LFIB表项包括:所述第四MPLS报文的栈顶标签、第二下一跳信息、第二出标签和第三上下文标签;所述第三上下文标签用于指示所述第四MPLS报文在所述环网中经过所述第二节点后的转发方向;
所述第二节点将所述第四MPLS报文的栈顶标签替换为所述第二出标签,并将所述第三上下文标签压入进行了标签替换的所述第四MPLS报文的标签栈,以生成第五MPLS报文;
所述第二节点向所述第二下一跳信息对应的第二下一跳发送所述第五MPLS报文。
结合第二方面的第三种可能的实现方式,在第二方面的第四种可能的实现方式中,所述第一LFIB基于所述第二节点上的最佳路由生成。
第三方面,本发明实施例提供了一种网络节点,所述网络节点为第一 节点,所述第一节点位于环网中,所述第一节点包括:处理单元和发送单元;其中,
所述处理单元,用于获得第一多协议标签交换MPLS报文和获得与所述第一MPLS报文的栈顶标签匹配的标签转发信息库LFIB表项,所述LFIB表项包含主用下一跳信息、备用下一跳信息、备用出标签和备用的第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
所述处理单元,还用于当确定所述主用下一跳信息对应的主用下一跳不可达时,将所述第一MPLS报文的栈顶标签替换为所述备用出标签,并将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文;
所述发送单元,用于向所述备用下一跳信息对应的备用下一跳发送所述第二MPLS报文。
在第三方面的第一种可能的实现方式中,所述第一节点还包括:接收单元;
当所述处理单元获得所述第一MPLS报文时,所述处理单元,用于通过所述接收单元获得第二节点向所述第一节点发送的所述第一MPLS报文。
结合第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,当所述处理单元获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项时,所述处理单元,用于在第一LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项,所述第一LFIB基于所述第一节点上的最佳路由生成。
在第三方面的第三种可能的实现方式中,所述第一节点还包括:接收单元;
当所述处理单元获得所述第一MPLS报文时,所述处理单元,用于通过所述接收单元接收第二节点发送的第三MPLS报文,所述第三MPLS报文的栈顶标签为第二上下文标签,以及将所述第三MPLS报文的所述第二上下文标签弹出,以生成所述第一MPLS报文,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所 述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相反。
结合第三方面的第三种可能的实现方式,在第三方面的第四种可能的实现方式中,当所述处理单元获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项时,所述处理单元,用于在所述第二上下文标签对应的LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。
结合第三方面的第四种可能的实现方式,在第三方面的第五种可能的实现方式中,所述处理单元,还用于在第二LFIB或者第三LFIB中,获得与所述第二上下文标签对应的LFIB,其中,所述第二LFIB基于所述第一节点在顺时针方向上的路由生成,所述第三LFIB基于所述第一节点在逆时针方向上的路由生成。
第四方面,本发明实施例提供了一种网络节点,所述网络节点为第二节点,环网中包括第一节点和所述第二节点,所述第二节点包括:接收单元、处理单元和发送单元;其中,
所述接收单元,用于接收所述第一节点发送的第一多协议标签交换MPLS报文,所述第一MPLS报文的栈顶标签为第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
所述处理单元,用于将所述第一MPLS报文的所述第一上下文标签弹出,以生成第二MPLS报文,以及在所述第一上下文标签对应的标签转发信息库LFIB中获得与所述第二MPLS报文的栈顶标签匹配的第一LFIB表项,所述第一LFIB表项包含:所述第二MPLS报文的栈顶标签、第一下一跳信息、第一出标签和第二上下文标签,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相同;
所述处理单元,还用于将所述第二MPLS报文的栈顶标签替换为所述第一出标签,并将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文;
所述发送单元,用于向所述第一下一跳信息对应的第一下一跳发送所述第三MPLS报文。
在第四方面的第一种可能的实现方式中,所述处理单元,还用于在第二LFIB或者第三LFIB中,获得与所述第一上下文标签对应的LFIB,其中,所述第二LFIB基于所述第二节点在顺时针方向上的路由生成,所述第三LFIB基于所述第二节点在逆时针方向上的路由生成。
结合第四方面或者第四方面的第一种可能的实现方式,在第四方面的第三种可能的实现方式中,在所述接收单元接收所述第一节点发送的所述第一MPLS报文之前,所述处理单元还用于从第三节点接收第四MPLS报文、以及在第一LFIB中获得与所述第四MPLS报文的栈顶标签匹配的第二LFIB表项,所述第三节点为所述环网外与所述环网连接的节点,所述第二LFIB表项包括:所述第四MPLS报文的栈顶标签、第二下一跳信息、第二出标签和第三上下文标签;所述第三上下文标签用于指示所述第四MPLS报文在所述环网中经过所述第二节点后的转发方向;
所述处理单元,还用于将所述第四MPLS报文的栈顶标签替换为所述第二出标签,并将所述第三上下文标签压入进行了标签替换的所述第四MPLS报文的标签栈,以生成第五MPLS报文;
所述发送单元,还用于向所述第二下一跳信息对应的第二下一跳发送所述第五MPLS报文。
结合第四方面的第三种可能的实现方式,在第四方面的第四种可能的实现方式中,所述第一LFIB基于所述第二节点上的最佳路由生成。
通过上述技术方案可知,本发明实施例中当环网上的第一节点转发MPLS报文时,在确定主用下一跳不可达时,所述第一节点在所述MPLS报文的标签栈中压入上下文标签,所述上下文标签用于指示所述MPLS报文在所述环网中经过所述第一节点后的转发方向,从而使得所述环网上的第二节点接收到所述第一节点转发的所述MPLS报文后,能够根据所述上下文标签所指示的转发方向转发所述MPLS报文,因此所述第二节点不会再将所述MPLS报文发送至所述第一节点,从而避免了所述第一节点转发所述MPLS报文时,当所述主用下一跳不可达时,所述第一节点和所述第二节点之间可能出现的瞬间环路的技术问题。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为环网的一种可能的拓扑结构;
图2为本发明实施例提供的一种方法实施例的流程示意图;
图3为本发明实施例提供的另一种方法实施例的流程示意图;
图4为本发明实施例提供的另一种方法实施例的流程示意图;
图5为本发明实施例提供的一种网络节点的结构示意图;
图6为本发明实施例提供的另一种网络节点的结构示意图;
图7为本发明实施例提供的另一种网络节点的结构示意图;
图8为本发明实施例提供的另一种网络节点的结构示意图。
具体实施方式
为了更好的理解本发明实施例,下面通过图1介绍MPLS报文在环网中的转发方式。需要说明的是,图1仅为一种示例性的说明,其具体拓扑并不会对本发明实施例起到限制作用。
图1所示的环网中包括网络节点R1、网络节点R2、网络节点R3和网络节点R4,其中每个网络节点上都有对应的LFIB,以用于实现报文转发。下面首先以网络节点R1为例说明网络节点R1的LFIB的生成方式。
针对某一个前缀(英文:prefix)转发等价类(英文:Forwarding Equivalence Class,简称:FEC),网络节点R2会向所述prefix FEC分配标签,例如网络节点R2向1.1.1.5/32分配标签52,并将分配的标签52通过标签分发协议(英文:Label Distribution Protocol,简称:LDP)、最短路径优先(英文:Open Shortest Path First,简称:OSPF)或中间系统-中间系统(英文:Intermediate System to Intermediate System,简称:ISIS)协议等方式通告,使得网络节点R2的所有邻居,即网络节点R1、网络节点R3和网络节点R6都能获得网络节点R2分配的标签,同 样网络节点R4会向所述prefix FEC分配标签,例如网络节点R4向1.1.1.5/32分配标签54,并将分配的标签54通过LDP、OSPF或ISIS协议等方式通告,使得网络节点R4的所有邻居,即网络节点R1、网络节点R3和网络节点R5都能获得网络节点R4分配的标签。其中1.1.1.5/32对应网络节点R5。
因此,网络节点R1会获得网络节点R1的两个邻居节点,网络节点R2和网络节点R4分别为1.1.1.5/32分配的标签52和标签54。由于网络节点R1的LFIB基于网络节点R1上的最佳路由生成,因此网络节点R1在接收到标签52和标签54之后,会确定出在网络节点R1上所述prefix FEC对应的最佳路由的下一跳,并将所述下一跳对应的下一跳信息和所述下一跳所分配的标签保存到网络节点R1的LFIB中。例如,在网络节点R1上,1.1.1.5/32对应的最佳路由的下一跳是网络节点R4,则网络节点R1将网络节点R4的信息和网络节点R4为1.1.1.5/32所分配的标签54保存到网络节点R1的LFIB中。其中所述下一跳信息指的是下一跳的互联网协议(英文:Internet Protocol,简称:IP)地址或者标识等信息。
其中需要说明的是,网络节点R1实际上是将网络节点R4作为主用下一跳,并将网络节点R4所分配的标签作为主用出标签。当主用下一跳不可达时,为了利用快速重路由(英文:Fast ReRoute,简称:FRR)等方式向备用路由转发报文,网络节点的LFIB中还会指示出备用下一跳和备用出标签,例如表1显示出了网络节点R1的LFIB中1.1.1.5/32对应的LFIB表项。其中入标签为网络节点R1为1.1.1.5/32分配的标签。
表1
Figure PCTCN2015099945-appb-000001
下面以网络节点R1为例,说明环网中的一个网络节点对MPLS报文的转发方式:网络节点R1接收到网络节点R2发送的MPLS报文后,根据所述MPLS报文的栈顶标签51匹配到表1所示的LFIB表项,根据所述LFIB表项确定主用下一跳为网络节点R4,当网络节点R1确定出网络节点R4 不可达时,例如当网络节点R1至网络节点R4的链路失效或者网络节点R4失效时,网络节点R1根据备用下一跳,即网络节点R2进行转发,具体地,网络节点R1将所述MPLS报文的栈顶标签替换为备用出标签即标签52后,将进行了标签替换的所述MPLS报文发送到网络节点R2。并且,网络节点R1还会向网络节点R2发送网络节点R4不可达的信息,从而使得网络节点R2根据该不可达信息收敛路由。
然而,由于该不可达信息从网络节点R1发送至网络节点R2,以及网络节点R2根据该不可达信息进行路由收敛都需要花费一定的时间,因此可能会导致,当网络节点R2接收到网络节点R1发送的所述MPLS报文时,网络节点R2还未完成路由收敛,由于目前网络节点R2的LFIB基于网络节点R2上的最佳路由生成,也就是说网络节点R2在接收到所述MPLS报文后,向网络节点R2上的最佳路由的下一跳转发报文,因此网络节点R2很有可能会将所述MPLS报文发送至网络节点R1,例如当网络节点R2上的最佳路由的下一跳为网络节点R1时。此时将导致所述MPLS报文在网络节点R2和网络节点R1之间来回转发,造成了瞬间环路的技术问题,进一步导致由瞬间环路的技术问题引起的资源浪费和报文时延等技术问题。
而在本发明实施例中,提供了一种环网中报文转发的方法及网络节点,以解决环网中出现的瞬间环路的技术问题。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”或“第四”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的 或对于这些过程、方法、产品或设备固有的其它步骤或单元。
请参阅图2,本发明实施例提供了环网中MPLS报文转发的方法的一种方法实施例。在本实施例中,所述环网中包括第一节点。例如在图1中,所述第一节点为网络节点R1。
本实施例的所述方法包括:
201:所述第一节点获得第一MPLS报文。
所述第一节点可以将其他节点发送的MPLS报文直接作为所述第一MPLS报文,也可以将其他节点发送的MPLS报文进行一定的处理后,作为所述第一MPLS报文。
202:所述第一节点获得与所述第一MPLS报文的栈顶标签匹配的LFIB表项。
其中,所述第一MPLS报文的栈顶标签用于指导所述第一MPLS报文的转发,通过将所述第一MPLS报文的栈顶标签与所述第一节点的LFIB中的LFIB表项进行匹配,能够在所述第一节点的LFIB中获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。其中在进行匹配时,所述第一节点一般是将所述第一节点的LFIB中的各个LFIB表项与所述第一MPLS报文的栈顶标签匹配,当所述第一节点的LFIB中的某个表项的入标签与所述第一MPLS报文的栈顶标签相同时,将该表项作为与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项,并获得所述LFIB表项。
在本发明实施例中,所述LFIB表项包含主用下一跳信息、备用下一跳信息、备用出标签和备用的第一上下文标签。除了上述信息之外,所述LFIB表项一般还包含入标签、主用出标签和所述表项对应的prefix FEC,所述prefix FEC用于指示所述第一MPLS报文的目的端。例如在图1中所示的环网中,所述第一MPLS报文的栈顶标签为标签51,网络节点R1将标签51与网络节点R1的LFIB匹配,可以获得如表2所示的LFIB表项。其中1.1.1.5/32对应网络节点R5,也就是说所述第一MPLS报文的目的端为网络节点R5。
表2
Figure PCTCN2015099945-appb-000002
在本发明实施例中,为了解决瞬间环路的技术问题,所述LFIB表项中包含了备用的所述第一上下文标签,其中所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向,从而能够使得所述第一MPLS报文在所述环网中经过所述第一节点后,一直按照所述第一上下文标签所指示的所述转发方向转发,直至所述第一MPLS报文下所述环网或者掉头。其中所述第一上下文标签可以用于指示顺时针转发方向或者逆时针转发方向,例如具体为顺时针方向转发指示标签(英文:Clock-Wise Forwarding Indication Label,简称:CWFIL),或者逆时针方向转发指示标签(英文:Counter-Clock-Wise Forwarding Indication Label,简称:CCWFIL),从而所述第一上下文标签指示所述第一MPLS报文在经过所述第一节点后,一直按照顺时针方向或者逆时针方向转发。例如表2所示的所述LFIB表项中,所述第一上下文标签为CWFIL,用于指示所述第一MPLS报文在经过所述第一节点后,一直按照顺时针方向转发。其中所述第一上下文标签为备用的标签,即表示所述第一上下文标签在所述第一MPLS报文需要向所述备用下一跳转发时使用。
203:当所述第一节点确定所述主用下一跳信息对应的主用下一跳不可达时,所述第一节点将所述第一MPLS报文的栈顶标签替换为所述备用出标签,并将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文。
在本发明实施例中,当所述第一节点确定所述主用下一跳不可达时,除了将所述第一MPLS报文的栈顶标签替换为所述备用出标签外,还会将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文,从而实现了在所述第二MPLS报文的栈顶标签中指示出,所述第一MPLS报文在所述环网中经过所述第一节点后的所述转发方向,使得所述备用下一跳在接收到所述第二MPLS报文后,能够按照所 述第一上下文标签指示的转发方向转发所述第二MPLS报文,而不会再将所述第二MPLS报文发送至所述第一节点。
需要说明的是,本发明实施例在获得所述第一MPLS报文后,会将所述第一MPLS报文转换为所述第二MPLS报文后再进行转发,因此,所述第一上下文标签所指示的,所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向,实际上也可以认为是基于所述第一MPLS报文生成的所述第二MPLS报文在所述环网中经过所述第一节点后的转发方向。
本发明实施例还可以包括,当所述第一节点确定所述主用下一跳可达时,所述第一节点将所述第一MPLS报文的栈顶标签替换为所述主用出标签,并向所述主用下一跳发送进行了标签替换的所述第一MPLS报文。
204:所述第一节点向所述备用下一跳信息对应的备用下一跳发送所述第二MPLS报文。
由于所述第二MPLS报文的栈顶标签为所述第一上下文标签,从而能够指示所述备用下一跳按照所述第一上下文标签所指示的转发方向转发所述第二MPLS报文。
通过上述技术方案可知,本发明实施例中,所述第一节点获得的所述LFIB表项中,包含了备用的第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向。因此当所述第一节点转发所述第一MPLS报文时,在确定所述主用下一跳不可达时,除了将所述第一MPLS报文的栈顶标签替换为所述备用出标签之外,还将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文并发送至所述备用下一跳,从而使得所述备用下一跳接收到所述第二MPLS报文后,能够按照所述第一上下文标签指示的所述转发方向转发所述第二MPLS报文,从而使得所述第一MPLS报文在经过所述第一节点和所述备用下一跳时都沿着同一方向转发,因此所述备用下一跳不会再将所述第二MPLS报文发送至所述第一节点,从而避免了所述第一节点转发所述第一MPLS报文时,当所述主用下一跳不可达时,所述第一节点和所述备用下一跳之间可能出现的瞬间环路的技术问题。进一步解决了由瞬间环路的技术问题导致的资源浪费和报文延时等问题。
例如在图1中,当网络节点R1确定网络节点R4不可达时,向网络节点 R2发送所述第二MPLS报文,所述第二MPLS报文的栈顶标签具体为CWFIL,用于指示所述第二MPLS报文按照顺时针方向转发,因此网络节点R2按照顺时针方向即向网络节点R3转发所述第二MPLS报文,而不会再将所述第二MPLS报文发送至网络节点R1,从而解决了网络节点R1和网络节点R2之间可能出现的瞬间环路的技术问题。
在本实施例中,所述第一上下文标签可以为特殊用途标签(英文:Special Purpose Label,简称:SPL)或者扩展的特殊用途标签(英文:Extended Special Purpose Label,简称:ESPL),也可以是由所述第一节点分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。
在本发明实施例中,所述第一节点可以将其他节点发送的MPLS报文直接作为所述第一MPLS报文,也可以将其他节点发送的MPLS报文进行一定的处理后,作为所述第一MPLS报文。其中,所述第一节点还可以根据其他节点发送的MPLS报文的栈顶标签,从对应的LFIB中获得所述LFIB表项。下面分两种情况进行说明。
(一)在本发明实施例中,所述第一节点可以将其他节点发送的MPLS报文直接作为所述第一MPLS报文,具体实现时,本实施例的201包括所述第一节点获得第二节点向所述第一节点发送的所述第一MPLS报文。其中,所述第二节点可以是所述环网中的节点,例如图1所示,网络节点R1获得网络节点R2发送的所述第一MPLS报文;所述第二节点也可以是所述环网外与所述环网连接的节点。
若所述第一节点将其他节点发送的MPLS报文直接作为所述第一MPLS报文,本发明实施例中可以在目前基于最佳路由生成的LFIB中,添加所述第一上下文标签,由所述第一节点在所述基于最佳路由生成的LFIB中获得所述LFIB表项。具体地,本实施例的202包括:所述第一节点在第一LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。其中,所述第一LFIB基于所述第一节点上的最佳路由生成,即,所述第一LFIB中任意表项的主用下一跳为对于所述第一节点来说,该表项中的prefix FEC所对应的最佳路由的下一跳。例如在表2所示的表项中,主用下一跳为对于网络节点R1来说,1.1.1.5/32所对应的最佳路由的下一跳,即网络节点R4。
(二)在本发明实施例中,其他节点发送至所述第一节点的MPLS报文的标签栈中,可能压入了上下文标签,所述第一节点需要将其他节点发送的MPLS报文进行一定的处理,比如弹出所述上下文标签,以获得所述第一MPLS报文。具体实现时,本实施例的201可以包括:所述第一节点接收所述第二节点发送的第三MPLS报文,所述第三MPLS报文的栈顶标签为第二上下文标签;所述第一节点将所述第三MPLS报文的所述第二上下文标签弹出,以生成所述第一MPLS报文。其中,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相反。例如在图1中,所述第二上下文标签可以为CCWFIL,用于指示所述第一MPLS报文在所述环网中经过网络节点R2后按照逆时针方向转发,而所述第一上下文标签可以为CWFIL,用于指示所述第一MPLS报文在所述环网中经过网络节点R1后按照顺时针方向转发。在本实施例中,所述第二上下文标签可以为SPL或者ESPL,也可以是由所述第二节点分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。
若所述第一节点接收到的所述第三MPLS报文的栈顶标签为所述第二上下文标签,本发明实施例中还可以设置与所述第二上下文标签对应的LFIB,在与所述第二上下文标签对应的LFIB中添加所述第一上下文标签。具体实现时,本实施例的202包括:所述第一节点在所述第二上下文标签对应的LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。其中,所述第二上下文标签对应的LFIB基于所述第一节点在所述第二上下文标签所指示的转发方向上的路由生成,即,所述第二上下文标签对应的LFIB中任意表项的主用下一跳为,所述第一节点在所述第二上下文标签所指示的转发方向上的下一跳,实际上即为,所述第一节点在所述环网上的所述第二上下文标签所指示的转发方向上的邻居节点,显然其不同于基于所述第一节点上的最佳路由生成的所述第一LFIB。而任意表项的主用出标签与该表项的主用下一跳对应,即为该表项的主用下一跳为该表项的prefix FEC分配的标签。
由于所述第二上下文标签可以用于指示顺时针转发方向或者逆时针转发方向,例如具体为CWFIL或者CCWFIL。因此可以分别设置对应顺时针 转发方向的第二LFIB和对应逆时针转发方向的第三LFIB,本实施例还可以包括:所述第一节点从所述第二LFIB或者所述第三LFIB中,获得与所述第二上下文标签对应的LFIB。例如,若所述第二上下文标签用于指示顺时针转发方向,则将所述第二LFIB作为所述第二上下文标签对应的LFIB。
其中所述第二LFIB基于所述第一节点在顺时针方向上的路由生成,即所述第二LFIB中的任意表项的主用下一跳为,所述第一节点在顺时针方向上的下一跳,实际上即为,所述第一节点在所述环网上的顺时针方向上的邻居节点。而任意表项的主用出标签与该表项的主用下一跳对应,即为该表项的主用下一跳为该表项的prefix FEC分配的标签。例如在图1所示的环网中,所述第二LFIB中与所述第一MPLS报文的栈顶标签匹配的LFIB表项可以如表3所示。
表3
Figure PCTCN2015099945-appb-000003
在表3所示的LFIB表项中,主用下一跳为网络节点R1在顺时针方向上的路由的下一跳,即网络节点R2,主用出标签为网络节点R2为1.1.1.5/32分配的标签。该表项中,还包含主用的上下文标签CWFIL,以及备用的上下文标签CCWFIL。
其中所述第三LFIB基于所述第一节点在逆时针方向上的路由生成,即所述第三LFIB中的任意表项的主用下一跳为所述第一节点在逆时针方向上的下一跳,实际上即为所述第一节点在所述环网上的逆时针方向上的邻居节点,而任意表项的主用出标签与该表项的主用下一跳对应,即为该表项的主用下一跳为该表项的prefix FEC分配的标签。例如在图1所示的环网中,所述第三LFIB中与所述第一MPLS报文的栈顶标签匹配的LFIB表项可以如表4所示。
表4
Figure PCTCN2015099945-appb-000004
在表4所示的LFIB表项中,主用下一跳为网络节点R1在逆时针方向上的路由的下一跳,即网络节点R4,主用出标签为网络节点R4为1.1.1.5/32分配的标签。该表项中,还包含主用的上下文标签CCWFIL,以及备用的上下文标签CWFIL。
在一种较优的实施方式中,可以在所述第一节点上保存所述第一LFIB、所述第二LFIB和所述第三LFIB,根据接收到的MPLS报文的栈顶标签,获得对应的LFIB,并从所述对应的LFIB中获取与所述第一MPLS报文的栈顶标签匹配的LFIB表项。具体地,当接收到所述第一MPLS报文,也就是说接收到的MPLS报文的栈顶标签不为上下文标签时,从所述第一LFIB中获得所述LFIB表项;当接收到所述第三MPLS报文,其中所述第三MPLS报文的栈顶标签为所述第二上下文标签,则根据所述第二上下文标签从所述第二LFIB或所述第三LFIB中获得对应的LFIB,具体地,当所述第二上下文标签指示顺时针转发方向时,从所述第二LFIB中获得所述LFIB表项,当所述第二上下文标签指示逆时针转发方向时,从所述第三LFIB中获得所述LFIB表项。例如在图1所示的环网中,网络节点R1接收到网络节点R2发送的所述第三MPLS报文,其中所述第三MPLS报文的栈顶标签为CCWFIL,网络节点R1从CCWFIL对应的所述第三LFIB中获得如表4所示的LFIB表项。
在本发明实施例中,所述第一节点也可以不根据所述第二上下文标签获得所述对应的LFIB,例如,所述第一节点接收到所述第二节点发送的所述第一MPLS报文,当所述第一节点确定所述第二节点是所述环网外的节点时,从所述第一LFIB中获得所述LFIB表项;当所述第一节点确定所述第二节点是所述环网上顺时针方向的上游节点时,说明此时所述第一MPLS报文按照顺时针方向转发,所述第一节点从所述第二LFIB中获得所述LFIB表项;当所述第一节点确定所述第二节点是所述环网上逆时针方向的上游节点时,说明此时所述第一MPLS报文按照逆时针方向转发,所述第 一节点从所述第三LFIB中获得所述LFIB表项。
需要说明的是,在本发明实施例中,所述第一LFIB、所述第二LFIB和所述第三LFIB可以分别对应三种不同的转发表,例如所述第一LFIB对应转发表1,所述第二LFIB对应转发表2,所述第三LFIB对应转发表3,当然,所述第一LFIB、所述第二LFIB和所述第三LFIB也可以对应同一张表,例如所述第一LFIB、所述第二LFIB和所述第三LFIB都对应转发表4,其中可以在转发表4中设置LFIB标识,用于区分上述三个LFIB。
在本发明实施例中,在生成所述第一LFIB、所述第二LFIB和所述第三LFIB时,需要在所述环网上规定出顺时针方向和逆时针方向。具体实现时,可以通过手动或者机器自动生成等方式,在所述第一节点上配置出顺时针方向的下一跳和逆时针方向的下一跳,从而使得所述第一节点能够根据该配置,生成所述第一LFIB、所述第二LFIB和所述第三LFIB。
在上述方法实施例中,主要从所述第一节点的角度,介绍了当所述主用下一跳不可达时,所述第一节点如何在所述第一MPLS报文的标签栈中压入所述第一上下文标签以指示转发方向,而下面将从第二节点的角度,介绍当接收到栈顶标签为所述第一上下文标签的MPLS报文后,如何根据所述第一上下文标签进行转发。
请参阅图3,本发明实施例提供了环网中MPLS报文转发的方法的另一种方法实施例。在本实施例中,所述环网中包括第一节点和第二节点。例如在图1中,所述第一节点为网络节点R1,所述第二节点为网络节点R2。
本实施例的所述方法包括:
301:所述第二节点接收所述第一节点发送的第一MPLS报文,所述第一MPLS报文的栈顶标签为第一上下文标签。
其中,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向。
在本发明实施例中一种较优的实施方式中,所述第一MPLS报文,是当所述第一节点确定所述第一节点的主用下一跳不可达时,生成并向所述第二节点发送的。
302:所述第二节点将所述第一MPLS报文的所述第一上下文标签弹出, 以生成第二MPLS报文。
303:所述第二节点在所述第一上下文标签对应的LFIB中获得与所述第二MPLS报文的栈顶标签匹配的第一LFIB表项。
具体在进行匹配时,所述第二节点一般是将所述第一上下文标签对应的LFIB中的各个LFIB表项与所述第二MPLS报文的栈顶标签匹配,当所述第一上下文标签对应的LFIB中的某个表项的入标签与所述第二MPLS报文的栈顶标签相同时,将该表项作为与所述第二MPLS报文的栈顶标签匹配的所述LFIB表项,并获得所述LFIB表项。
在本发明实施例中,所述第一上下文标签对应的LFIB基于所述第二节点在所述第一上下文标签所指示的转发方向上的路由生成,即,所述第一上下文标签对应的LFIB中任意表项的主用下一跳为,所述第二节点在所述第一上下文标签所指示的转发方向上的下一跳,实际上即为,所述第二节点在所述环网上的所述第一上下文标签所指示的转发方向上的邻居节点,显然其不同于基于所述第二节点上的最佳路由生成的LFIB。
其中,在所述第一上下文标签对应的LFIB中获得的所述第一LFIB表项包含:所述第二MPLS报文的栈顶标签、第一下一跳信息、第一出标签和第二上下文标签,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的转发方向与所述第一上下文标签所指示的转发方向相同,也就是说,所述第一MPLS报文在经过所述第一节点和所述第二节点时,沿着相同的转发方向转发。从而使得所述第二节点不会再将所述第一MPLS报文发送至所述第一节点。例如在图1中,网络节点R2接收到网络节点R1发送的所述第一MPLS报文,所述第一MPLS报文的栈顶标签为CWFIL,用于指示所述第一MPLS报文按照顺时针方向转发,因此网络节点R2获得所述第二上下文标签CWFIL,并且按照顺时针方向即向网络节点R3转发所述第一MPLS报文,而不会再将所述第一MPLS报文发送至网络节点R1,从而解决了网络节点R1和网络节点R2之间可能出现的瞬间环路的技术问题。
其中,由于所述第二节点沿着所述第一上下文标签指示的转发方向转发所述第一MPLS报文,因此所述第一下一跳具体为在所述第二节点在所述第一上下文标签指示的方向上的下一跳,即所述第二节点在所述环网上 的所述第一上下文标签指示的方向上的邻居节点。所述第一出标签与所述第一下一跳对应,即为所述第一下一跳为所述LFIB表项对应的prefix FEC分配的标签。其中所述prefix FEC用于指示所述第一MPLS报文的目的端。例如在图1中所示的环网中,所述第一MPLS报文的栈顶标签为CWFIL,所述第二MPLS报文的栈顶标签为标签52,网络节点R2将标签52与所述第一上下文标签对应的LFIB匹配,获得如表5所示的LFIB表项。其中1.1.1.5/32对应网络节点R5,也就是说所述第一MPLS报文的目的端为网络节点R5。
表5
Figure PCTCN2015099945-appb-000005
在表5所示的LFIB表项中,第一下一跳为网络节点R2在顺时针方向上的路由的下一跳,即网络节点R3,第一出标签为网络节点R3为1.1.1.5/32分配的标签。
304:所述第二节点将所述第二MPLS报文的栈顶标签替换为所述第一出标签,并将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文。
所述第二节点除了将所述第二MPLS报文的栈顶标签替换为所述第一出标签外,还会将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文,使得接收到所述第三MPLS报文的网络节点,能够按照所述第二上下文标签指示的转发方向转发所述第三MPLS报文。
需要说明的是,本发明实施例在获得所述第一MPLS报文后,会将所述第一MPLS报文转换为所述第三MPLS报文后再进行转发,因此,所述第二上下文标签所指示的,所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,实际上也可以认为是,基于所述第一MPLS报文生成的所述第三MPLS报文在所述环网中经过所述第二节点后的转发方向
305:所述第二节点向所述第一下一跳信息对应的第一下一跳发送所述第三MPLS报文。
由于所述第三MPLS报文的栈顶标签为所述第二上下文标签,从而能够指示所述第一下一跳按照所述第二上下文标签所指示的所述转发方向转发所述第三MPLS报文。
通过上述技术方案可知,本发明实施例中,所述第二节点接收所述第一MPLS报文后,将所述第一MPLS报文的栈顶标签,即所述第一上下文标签弹出,并且在所述第一上下文标签对应的LFIB中获得匹配的第一LFIB表项,其中所述第一LFIB表项中包含第二上下文标签,由于所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,并且所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相同,也就是说,所述第一MPLS报文在经过所述第一节点和所述第二节点时,沿着相同的转发方向转发。从而使得所述第二节点不会再将所述第一MPLS报文发送至所述第一节点。从而避免了所述某一节点转发所述MPLS报文时,当所述某一节点的主用下一跳不可达时,所述第一节点和所述第二节点之间可能出现的瞬间环路的技术问题。进一步解决了由瞬间环路的技术问题导致的资源浪费和报文延时等问题。
例如在图1中,网络节点R2接收到网络节点R1发送的所述第一MPLS报文,所述第一MPLS报文的栈顶标签具体为CWFIL,用于指示所述第二MPLS报文按照顺时针方向转发,因此网络节点R2按照顺时针方向即向网络节点R3转发所述第二MPLS报文,而不会再将所述第二MPLS报文发送至网络节点R1,从而解决了网络节点R1和网络节点R2之间可能出现的瞬间环路的技术问题。
在本实施例中,所述第一上下文标签可以为SPL或者ESPL,也可以是所述第一节点分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。所述第二上下文标签可以为SPL或者ESPL,也可以是所述第二节点分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。
在本发明实施例中,所述第一上下文标签可以用于指示顺时针转发方 向或者逆时针转发方向,例如具体为CWFIL或者CCWFIL。因此可以分别设置对应顺时针转发方向的第二LFIB和对应逆时针转发方向的第三LFIB,本实施例还可以包括:所述第二节点从所述第二LFIB或者所述第三LFIB中,获得与所述第一上下文标签对应的LFIB。例如,若所述第一上下文标签用于指示顺时针转发方向,则将所述第二LFIB作为所述第一上下文标签对应的LFIB。
其中所述第二LFIB基于所述第二节点在顺时针方向上的路由生成,即所述第二LFIB中的任意表项的下一跳为,所述第二节点在顺时针方向上的下一跳,实际上即为,所述第二节点在所述环网上的顺时针方向上的邻居节点。而任意表项的出标签与该表项的下一跳对应,即为该表项中的下一跳为该表项的prefix FEC分配的标签。例如在图1所示的环网中,所述第二LFIB中与所述第二MPLS报文的栈顶标签匹配的LFIB表项可以如表5所示。
其中所述第三LFIB基于所述第二节点在逆时针方向上的路由生成,即所述第三LFIB中的任意表项的下一跳为所述第二节点在逆时针方向上的下一跳,实际上即为所述第二节点在所述环网上的逆时针方向上的邻居节点,而任意表项的出标签与该表项的下一跳对应,即为该表项中的下一跳为该表项的prefix FEC分配的标签。例如在图1所示的环网中,所述第三LFIB中与所述第二MPLS报文的栈顶标签匹配的LFIB表项可以如表6所示。
表6
Figure PCTCN2015099945-appb-000006
在表6所示的LFIB表项中,下一跳为网络节点R2在逆时针方向上的路由的下一跳,即网络节点R1出标签为网络节点R1为1.1.1.5/32分配的标签。
在本实施例的301之前,所述第二节点还可以接收环网外的网络节点 发送的MPLS报文,该MPLS报文中不包括用于指示转发方向的上下文标签,所述第二节点可以不在该MPLS报文中压入上下文标签,由所述第一节点确定出所述第一节点的主用下一跳不可达时,压入用于指示转发方向的上下文标签;或者所述第二节点也可以在接收到该MPLS报文后,在该MPLS报文中压入用于指示转发方向的上下文标签,下面具体说明这种方式。
在所述第二节点接收所述第一节点发送的所述第一MPLS报文之前所述方法还包括:所述第二节点从第三节点接收第四MPLS报文,所述第三节点为所述环网外与所述环网连接的节点;所述第二节点在第一LFIB中获得与所述第四MPLS报文的栈顶标签匹配的第二LFIB表项,所述第二LFIB表项包括:所述第四MPLS报文的栈顶标签、第二下一跳信息、第二出标签和第三上下文标签;所述第三上下文标签用于指示所述第四MPLS报文在所述环网中经过所述第二节点后的转发方向;所述第二节点将所述第四MPLS报文的栈顶标签替换为所述第二出标签,并将所述第三上下文标签压入进行了标签替换的所述第四MPLS报文的标签栈,以生成第五MPLS报文;所述第二节点向所述第二下一跳信息对应的第二下一跳发送所述第五MPLS报文。
其中,所述第一LFIB基于所述第二节点上的最佳路由生成,即,所述第一LFIB中任意表项的下一跳为,对于所述第二节点来说,在该表项中的prefix FEC所对应的最佳路由的下一跳。
在本实施例中,所述第三上下文标签可以为SPL或者ESPL,也可以是所述第二节点分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。
在一种较优的实施方式中,可以在所述第二节点上保存所述第一LFIB、所述第二LFIB和所述第三LFIB,根据接收到的MPLS报文的栈顶标签,获得对应的LFIB,并从所述对应的LFIB中获得匹配的LFIB表项。具体地,当所述第二节点接收到所述第四MPLS报文,也就是说接收到的MPLS报文的栈顶标签不为上下文标签时,从所述第一LFIB中获得所述第二LFIB表项;当接收到所述第三MPLS报文,其中所述第三MPLS报文的栈顶标签为所述第一上下文标签,则根据所述第一上下文标签从所述第二LFIB或所述第三LFIB中获得对应的LFIB,具体地,当所述第一上下文标签指示顺时针转发方向时,从所述第二LFIB中获得所述第一LFIB表项,当所 述第一上下文标签指示逆时针转发方向时,从所述第三LFIB中获得所述第一LFIB表项。例如在图1中,网络节点R2接收到网络节点R1发送的所述第一MPLS报文后,其中所述第一MPLS报文的栈顶标签为CWFIL,网络节点R2从CWFIL对应的所述第二LFIB中获得如表5所示的所述第一LFIB表项。
在本发明实施例中,所述第二节点也可以不根据所述第一上下文标签获得所述对应的LFIB,例如,所述第二节点从所述环网外的网络节点接收到所述第四MPLS报文后,从所述第一LFIB中获得所述第二LFIB表项;所述第二节点接收到所述第一节点发送的所述第一MPLS报文,当所述第二节点确定所述第一节点是所述环网上顺时针方向的上游节点时,说明此时所述第一MPLS报文按照顺时针方向转发,所述第二节点从所述第二LFIB中获得所述第一LFIB表项;当所述第二节点确定所述第一节点是所述环网上逆时针方向的上游节点时,说明此时所述第一MPLS报文按照逆时针方向转发,所述第二节点从所述第三LFIB中获得所述第一LFIB表项。
需要说明的是,在本发明实施例中,所述第一LFIB、所述第二LFIB和所述第三LFIB可以分别对应三种不同的转发表,例如所述第一LFIB对应转发表1,所述第二LFIB对应转发表2,所述第三LFIB对应转发表3,当然,所述第一LFIB、所述第二LFIB和所述第三LFIB也可以对应同一张表,例如所述第一LFIB、所述第二LFIB和所述第三LFIB都对应转发表4,其中可以在转发表4中设置LFIB标识,用于区分上述三个LFIB。
在本发明实施例中,在生成所述第一LFIB、所述第二LFIB和所述第三LFIB时,需要在所述环网上规定出顺时针方向和逆时针方向。具体实现时,可以通过手动或者机器自动生成等方式,在所述第二节点上配置出顺时针方向的下一跳和逆时针方向的下一跳,从而使得所述第二节点能够根据该配置,生成所述第一LFIB、所述第二LFIB和所述第三LFIB。
在上述方法实施例中,分别介绍了所述第一节点和所述第二节点对MPLS报文的转发过程,下面以图1所示的拓扑为例,介绍MPLS报文在所述环网中每个节点的转发过程。
请参阅图4,本发明实施例提供了环网中MPLS报文转发的方法的另一种方法实施例。如图1所示,本实施例中的所述环网中包括网络节点R1、 网络节点R2、网络节点R3和网络节点R4。
401:网络节点R2接收网络节点R6发送的第一MPLS报文,网络节点R6为所述环网外与所述环网连接的节点,即所述第一MPLS报文从网络节点R2上所述环网。
402:网络节点R2在网络节点R2的第一LFIB中获得与所述第一MPLS报文的栈顶标签匹配的第一LFIB表项。其中,所述第一LFIB表项可以如表7所示。网络节点R2的第一LFIB基于网络节点R2上的最佳路由生成。在表7中,1.1.1.5/32对应网络节点R5。
表7
Figure PCTCN2015099945-appb-000007
403:网络节点R2将所述第一MPLS报文的栈顶标签替换为所述第一LFIB表项中的出标签。
需要说明的是,在本发明实施例中,402中获得的所述第一LFIB表项还可以如表6所示,此时本实施例中还包括:在进行了标签替换的所述第一MPLS报文的标签栈中压入用于指示逆时针转发方向的CCWFIL。也就是说,本发明实施例中既可以在所述第一MPLS报文上所述环网上,压入上下文标签,也可以在发生下一跳不可达的网络节点上压入上下文标签。
404:网络节点R2将进行了标签替换后的所述第一MPLS报文,作为第二MPLS报文发送至网络节点R1。
405:网络节点R1接收所述第二MPLS报文,在网络节点R1的第一LFIB中获得与所述第二MPLS报文的栈顶标签匹配的第二LFIB表项。其中,所述第二LFIB表项可以如表2所示,表2中的CWFIL为用于指示顺时针转发方向的上下文标签。其中,网络节点R1的第一LFIB基于网络节点R1上的最佳路由生成。
406:网络节点R1确定网络节点R4不可达,网络节点R1将所述第二MPLS报文的栈顶标签替换为表2所示的所述第二LFIB表项中的备用出标签,并将 CWFIL压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文。
407:网络节点R1向网络节点R2发送所述第三MPLS报文。
408:网络节点R2接收所述第三MPLS报文,弹出所述第三MPLS报文的栈顶标签,以生成第四MPLS报文。其中,所述第三MPLS报文的栈顶标签为CWFIL。
409:网络节点R2根据所述第三MPLS报文的栈顶标签CWFIL,在网络节点R2的第二LFIB中获得与所述第四MPLS报文的栈顶标签匹配的第三LFIB表项。其中,所述第三LFIB表项可以如表5所示。网络节点R2的第二LFIB基于网络节点R2在顺时针方向上的路由生成。
410:网络节点R2将所述第四MPLS报文的栈顶标签替换为表5所示的所述第三LFIB表项中的出标签,并将所述第三LFIB表项中的CWFIL压入进行了标签替换的所述第四MPLS报文的标签栈,以生成第五MPLS报文。网络节点R2将所述第五MPLS报文发送至网络节点R3。
411:网络节点R3接收到所述第五MPLS报文后,与网络节点R2执行类似的操作以生成第六MPLS报文,并将所述第六MPLS报文发送至网络节点R4。所述第六MPLS报文从网络节点R4下所述环网。
412:网络节点R4弹出所述第六MPLS报文中的栈顶标签CWFIL,以生成第七MPLS报文,并根据所述第六MPLS报文的栈顶标签CWFIL,在网络节点R4的第二LFIB中获得与所述第七MPLS报文的栈顶标签匹配的第四LFIB表项。其中,所述第四LFIB表项可以如表8所示。
表8
Figure PCTCN2015099945-appb-000008
在表8中,标签55为网络节点R5为1.1.1.5/32分配的标签。
需要说明的是,网络节点R4上保存了网络节点R4的第一LFIB、第二LFIB和第三LFIB,其中,由于网络节点R4是所述第七MPLS报文下所述环网的节 点,因此网络节点R4上这三个LFIB中与所述第七MPLS报文的标签栈顶匹配的表项,在表项内容上完全相同,例如可以均如表8所示。
413:网络节点R4将所述第七MPLS报文的栈顶标签替换为所述第四LFIB表项的出标签,并将经过标签替换的所述第七MPLS报文发送至网络节点R5。
上面对本发明实施例中的环网中MPLS报文转发的方法的实施例进行了描述,下面将从模块化功能实体的角度对本发明实施例中的网络节点进行描述。
请参阅图5,本发明实施例提供了一种网络节点的结构示意图。在本实施例中,所述网络节点为第一节点500,第一节点500位于环网中。例如在图1中,第一节点500为网络节点R1。
本实施例的第一节点500包括处理单元501和发送单元502。其中,
处理单元501,用于获得第一MPLS报文。
其中,处理单元501可以将其他节点发送的MPLS报文直接作为所述第一MPLS报文,也可以将其他节点发送的MPLS报文进行一定的处理后,作为所述第一MPLS报文。
处理单元501,还用于获得与所述第一MPLS报文的栈顶标签匹配的LFIB表项。
其中,所述第一MPLS报文的栈顶标签用于指导所述第一MPLS报文的转发,处理单元501通过将所述第一MPLS报文的栈顶标签与第一节点500的LFIB中的LFIB表项进行匹配,能够在第一节点500的LFIB中获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。其中在进行匹配时,处理单元501一般是将第一节点500的LFIB中的各个LFIB表项与所述第一MPLS报文的栈顶标签匹配,当第一节点500的LFIB中的某个表项的入标签与所述第一MPLS报文的栈顶标签相同时,将该表项作为与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项,并获得所述LFIB表项。
在本发明实施例中,所述LFIB表项包含主用下一跳信息、备用下一跳信息、备用出标签和备用的第一上下文标签。除了上述信息之外,所述LFIB表项一般还包含入标签、主用出标签和所述表项对应的prefix FEC,所述prefix FEC用于指示所述第一MPLS报文的目的端。例如在图1中所 示的环网中,所述第一MPLS报文的栈顶标签为标签51,处理单元501将标签51与网络节点R1的LFIB匹配,可以获得如表2所示的LFIB表项。其中1.1.1.5/32对应网络节点R5,也就是说所述第一MPLS报文的目的端为网络节点R5。
在本发明实施例中,为了解决瞬间环路的技术问题,所述LFIB表项中包含了备用的所述第一上下文标签,其中所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过第一节点500后的转发方向,从而能够使得所述第一MPLS报文在所述环网中经过第一节点500后,一直按照所述第一上下文标签所指示的所述转发方向转发,直至所述第一MPLS报文下所述环网或者掉头。其中所述第一上下文标签可以用于指示顺时针转发方向或者逆时针转发方向,例如具体为CWFIL或者CCWFIL,从而所述第一上下文标签指示所述第一MPLS报文在经过第一节点500后,一直按照顺时针方向或者逆时针方向转发。例如表2所示的所述LFIB表项中,所述第一上下文标签为CWFIL,用于指示所述第一MPLS报文在经过第一节点500后,一直按照顺时针方向转发。其中所述第一上下文标签为备用的标签,即表示所述第一上下文标签在所述第一MPLS报文需要向所述备用下一跳转发时使用。
处理单元501,还用于当确定所述主用下一跳信息对应的主用下一跳不可达时,将所述第一MPLS报文的栈顶标签替换为所述备用出标签,并将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文。
在本发明实施例中,当处理单元501确定所述主用下一跳不可达时,除了将所述第一MPLS报文的栈顶标签替换为所述备用出标签外,还会将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文,从而实现了在所述第二MPLS报文的栈顶标签中指示出,所述第一MPLS报文在所述环网中经过第一节点500后的所述转发方向,使得所述备用下一跳在接收到所述第二MPLS报文后,能够按照所述第一上下文标签指示的转发方向转发所述第二MPLS报文,而不会再将所述第二MPLS报文发送至第一节点500。
需要说明的是,本发明实施例处理单元501在获得所述第一MPLS报 文后,会将所述第一MPLS报文转换为所述第二MPLS报文后再进行转发,因此,所述第一上下文标签所指示的,所述第一MPLS报文在所述环网中经过第一节点500后的转发方向,实际上也可以认为是基于所述第一MPLS报文生成的所述第二MPLS报文在所述环网中经过第一节点500后的转发方向。
处理单元501,还可以用于当确定所述主用下一跳可达时,将所述第一MPLS报文的栈顶标签替换为所述主用出标签,并向所述主用下一跳发送进行了标签替换的所述第一MPLS报文。
发送单元502,用于向所述备用下一跳信息对应的备用下一跳发送所述第二MPLS报文。
由于所述第二MPLS报文的栈顶标签为所述第一上下文标签,从而能够指示所述备用下一跳按照所述第一上下文标签所指示的转发方向转发所述第二MPLS报文。
通过上述技术方案可知,本发明实施例中,处理单元501获得的所述LFIB表项中,包含了备用的第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过第一节点500后的转发方向。因此当第一节点500转发所述第一MPLS报文时,在处理单元501确定所述主用下一跳不可达时,除了将所述第一MPLS报文的栈顶标签替换为所述备用出标签之外,还将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文并由发送单元502发送至所述备用下一跳,从而使得所述备用下一跳接收到所述第二MPLS报文后,能够按照所述第一上下文标签指示的所述转发方向转发所述第二MPLS报文,从而使得所述第一MPLS报文在经过第一节点500和所述备用下一跳时都沿着同一方向转发,因此所述备用下一跳不会再将所述第二MPLS报文发送至第一节点500,从而避免了第一节点500转发所述第一MPLS报文时,当所述主用下一跳不可达时,第一节点500和所述备用下一跳之间可能出现的瞬间环路的技术问题。进一步解决了由瞬间环路的技术问题导致的资源浪费和报文延时等问题。
例如在图1中,当网络节点R1确定网络节点R4不可达时,向网络节点R2发送所述第二MPLS报文,所述第二MPLS报文的栈顶标签具体为CWFIL,用于指示所述第二MPLS报文按照顺时针方向转发,因此网络节点R2按照顺 时针方向即向网络节点R3转发所述第二MPLS报文,而不会再将所述第二MPLS报文发送至网络节点R1,从而解决了网络节点R1和网络节点R2之间可能出现的瞬间环路的技术问题。
在本实施例中,所述第一上下文标签可以为SPL或者ESPL,也可以是由第一节点500分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。
在本发明实施例中,处理单元501可以将其他节点发送的MPLS报文直接作为所述第一MPLS报文,也可以将其他节点发送的MPLS报文进行一定的处理后,作为所述第一MPLS报文。其中,处理单元501还可以根据其他节点发送的MPLS报文的栈顶标签,从对应的LFIB中获得所述LFIB表项。下面分两种情况进行说明。
(一)在本发明实施例中,处理单元501可以将其他节点发送的MPLS报文直接作为所述第一MPLS报文,具体实现时,第一节点500还包括:接收单元,当处理单元501获得所述第一MPLS报文时,处理单元501,用于通过接收单元获得第二节点向第一节点500发送的所述第一MPLS报文。其中,所述第二节点可以是所述环网中的节点,例如图1所示,网络节点R1获得网络节点R2发送的所述第一MPLS报文;所述第二节点也可以是所述环网外与所述环网连接的节点。
若第一节点500将其他节点发送的MPLS报文直接作为所述第一MPLS报文,本发明实施例中可以在目前基于最佳路由生成的LFIB中,添加所述第一上下文标签,由第一节点500在所述基于最佳路由生成的LFIB中获得所述LFIB表项。具体地,当处理单元501获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项时,处理单元501,用于在第一LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。其中,所述第一LFIB基于第一节点500上的最佳路由生成,即,所述第一LFIB中任意表项的主用下一跳为对于第一节点500来说,该表项中的prefix FEC所对应的最佳路由的下一跳。例如在表2所示的表项中,主用下一跳为对于网络节点R1来说,1.1.1.5/32所对应的最佳路由的下一跳,即网络节点R4。
(二)在本发明实施例中,其他节点发送至第一节点500的MPLS报文的标签栈中,可能压入了上下文标签,处理单元501需要将其他节点发 送的MPLS报文进行一定的处理,比如弹出所述上下文标签,以获得所述第一MPLS报文。具体实现时,第一节点500还包括:接收单元。当处理单元501获得所述第一MPLS报文时,处理单元501,用于通过所述接收单元接收第二节点发送的第三MPLS报文,所述第三MPLS报文的栈顶标签为第二上下文标签,以及将所述第三MPLS报文的所述第二上下文标签弹出,以生成所述第一MPLS报文。其中,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相反。例如在图1中,所述第二上下文标签可以为CCWFIL,用于指示所述第一MPLS报文在所述环网中经过网络节点R2后按照逆时针方向转发,而所述第一上下文标签可以为CWFIL,用于指示所述第一MPLS报文在所述环网中经过网络节点R1后按照顺时针方向转发。在本实施例中,所述第二上下文标签可以为SPL或者ESPL,也可以是由所述第二节点分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。
若第一节点500接收到的所述第三MPLS报文的栈顶标签为所述第二上下文标签,本发明实施例中还可以设置与所述第二上下文标签对应的LFIB,在与所述第二上下文标签对应的LFIB中添加所述第一上下文标签。具体实现时,当处理单元501获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项时,处理单元501,用于在所述第二上下文标签对应的LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。其中,所述第二上下文标签对应的LFIB基于第一节点500在所述第二上下文标签所指示的转发方向上的路由生成,即,所述第二上下文标签对应的LFIB中任意表项的主用下一跳为,第一节点500在所述第二上下文标签所指示的转发方向上的下一跳,实际上即为,第一节点500在所述环网上的所述第二上下文标签所指示的转发方向上的邻居节点,显然其不同于基于第一节点500上的最佳路由生成的所述第一LFIB。而任意表项的主用出标签与该表项的主用下一跳对应,即为该表项的主用下一跳为该表项的prefix FEC分配的标签。
由于所述第二上下文标签可以用于指示顺时针转发方向或者逆时针转发方向,例如具体为CWFIL或者CCWFIL。因此可以分别设置对应顺时针 转发方向的第二LFIB和对应逆时针转发方向的第三LFIB,处理单元501,还可以用于在第二LFIB或者第三LFIB中,获得与所述第二上下文标签对应的LFIB。例如,若所述第二上下文标签用于指示顺时针转发方向,则将所述第二LFIB作为所述第二上下文标签对应的LFIB。
其中所述第二LFIB基于第一节点500在顺时针方向上的路由生成,即所述第二LFIB中的任意表项的主用下一跳为,第一节点500在顺时针方向上的下一跳,实际上即为,第一节点500在所述环网上的顺时针方向上的邻居节点。而任意表项的主用出标签与该表项的主用下一跳对应,即为该表项的主用下一跳为该表项的prefix FEC分配的标签。例如在图1所示的环网中,所述第二LFIB中与所述第一MPLS报文的栈顶标签匹配的LFIB表项可以如表3所示。
在表3所示的LFIB表项中,主用下一跳为网络节点R1在顺时针方向上的路由的下一跳,即网络节点R2,主用出标签为网络节点R2为1.1.1.5/32分配的标签。该表项中,还包含主用的上下文标签CWFIL,以及备用的上下文标签CCWFIL。
其中所述第三LFIB基于第一节点500在逆时针方向上的路由生成,即所述第三LFIB中的任意表项的主用下一跳为第一节点500在逆时针方向上的下一跳,实际上即为第一节点500在所述环网上的逆时针方向上的邻居节点,而任意表项的主用出标签与该表项的主用下一跳对应,即为该表项的主用下一跳为该表项的prefix FEC分配的标签。例如在图1所示的环网中,所述第三LFIB中与所述第一MPLS报文的栈顶标签匹配的LFIB表项可以如表4所示。
在表4所示的LFIB表项中,主用下一跳为网络节点R1在逆时针方向上的路由的下一跳,即网络节点R4,主用出标签为网络节点R4为1.1.1.5/32分配的标签。该表项中,还包含主用的上下文标签CCWFIL,以及备用的上下文标签CWFIL。
在一种较优的实施方式中,可以在第一节点500上保存所述第一LFIB、所述第二LFIB和所述第三LFIB,处理单元501根据接收到的MPLS报文的栈顶标签,获得对应的LFIB,并从所述对应的LFIB中获取与所述第一MPLS报文的栈顶标签匹配的LFIB表项。具体地,当第一节点500接 收到所述第一MPLS报文,也就是说接收到的MPLS报文的栈顶标签不为上下文标签时,处理单元501,用于从所述第一LFIB中获得所述LFIB表项;当第一节点500接收到所述第三MPLS报文,其中所述第三MPLS报文的栈顶标签为所述第二上下文标签,则处理单元501,用于根据所述第二上下文标签从所述第二LFIB或所述第三LFIB中获得对应的LFIB,具体地,处理单元501,用于当所述第二上下文标签指示顺时针转发方向时,从所述第二LFIB中获得所述LFIB表项,当所述第二上下文标签指示逆时针转发方向时,从所述第三LFIB中获得所述LFIB表项。例如在图1所示的环网中,网络节点R1接收到网络节点R2发送的所述第三MPLS报文,其中所述第三MPLS报文的栈顶标签为CCWFIL,处理单元501从CCWFIL对应的所述第三LFIB中获得如表4所示的LFIB表项。
在本发明实施例中,处理单元501也可以不根据所述第二上下文标签获得所述对应的LFIB,例如,第一节点500接收到所述第二节点发送的所述第一MPLS报文,处理单元501,用于当确定所述第二节点是所述环网外的节点时,从所述第一LFIB中获得所述LFIB表项;当确定所述第二节点是所述环网上顺时针方向的上游节点时,说明此时所述第一MPLS报文按照顺时针方向转发,从所述第二LFIB中获得所述LFIB表项;当确定所述第二节点是所述环网上逆时针方向的上游节点时,说明此时所述第一MPLS报文按照逆时针方向转发,从所述第三LFIB中获得所述LFIB表项。
需要说明的是,在本发明实施例中,所述第一LFIB、所述第二LFIB和所述第三LFIB可以分别对应三种不同的转发表,例如所述第一LFIB对应转发表1,所述第二LFIB对应转发表2,所述第三LFIB对应转发表3,当然,所述第一LFIB、所述第二LFIB和所述第三LFIB也可以对应同一张表,例如所述第一LFIB、所述第二LFIB和所述第三LFIB都对应转发表4,其中可以在转发表4中设置LFIB标识,用于区分上述三个LFIB。
在本发明实施例中,在生成所述第一LFIB、所述第二LFIB和所述第三LFIB时,需要在所述环网上规定出顺时针方向和逆时针方向。具体实现时,可以通过手动或者机器自动生成等方式,在第一节点500上配置出顺时针方向的下一跳和逆时针方向的下一跳,从而使得第一节点500能够根据该配置,生成所述第一LFIB、所述第二LFIB和所述第三LFIB。
在上述装置实施例中,主要从第一节点500的角度,介绍了当所述主用下一跳不可达时,第一节点500如何在所述第一MPLS报文的标签栈中压入所述第一上下文标签以指示转发方向,而下面将从第二节点的角度,介绍当接收到栈顶标签为所述第一上下文标签的MPLS报文后,如何根据所述第一上下文标签进行转发。
请参阅图6,本发明实施例提供了另一种网络节点的结构示意图。在本实施例中,所述网络节点为第二节点600,环网中包括第一节点和第二节点600。例如在图1中,所述第一节点为网络节点R1,第二节点600为网络节点R2。
第二节点600包括:接收单元601、处理单元602和发送单元603。其中,
接收单元601,用于接收所述第一节点发送的MPLS报文,所述第一MPLS报文的栈顶标签为第一上下文标签。
其中,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向。
在本发明实施例中一种较优的实施方式中,所述第一MPLS报文,是当所述第一节点确定所述第一节点的主用下一跳不可达时,生成并向第二节点600发送的。
处理单元602,用于将所述第一MPLS报文的所述第一上下文标签弹出,以生成第二MPLS报文,以及在所述第一上下文标签对应的LFIB中获得与所述第二MPLS报文的栈顶标签匹配的第一LFIB表项。
具体在进行匹配时,处理单元602一般是将所述第一上下文标签对应的LFIB中的各个LFIB表项与所述第二MPLS报文的栈顶标签匹配,当所述第一上下文标签对应的LFIB中的某个表项的入标签与所述第二MPLS报文的栈顶标签相同时,将该表项作为与所述第二MPLS报文的栈顶标签匹配的所述LFIB表项,并获得所述LFIB表项。
在本发明实施例中,所述第一上下文标签对应的LFIB基于第二节点600在所述第一上下文标签所指示的转发方向上的路由生成,即,所述第一上下文标签对应的LFIB中任意表项的主用下一跳为,第二节点600在 所述第一上下文标签所指示的转发方向上的下一跳,实际上即为,第二节点600在所述环网上的所述第一上下文标签所指示的转发方向上的邻居节点,显然其不同于基于第二节点600上的最佳路由生成的LFIB。
其中,在所述第一上下文标签对应的LFIB中获得的所述第一LFIB表项包含:所述第二MPLS报文的栈顶标签、第一下一跳信息、第一出标签和第二上下文标签,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过第二节点600后的转发方向,所述第二上下文标签所指示的转发方向与所述第一上下文标签所指示的转发方向相同,也就是说,所述第一MPLS报文在经过所述第一节点和第二节点600时,沿着相同的转发方向转发。从而使得第二节点600不会再将所述第一MPLS报文发送至所述第一节点。例如在图1中,网络节点R2接收到网络节点R1发送的所述第一MPLS报文,所述第一MPLS报文的栈顶标签为CWFIL,用于指示所述第一MPLS报文按照顺时针方向转发,因此网络节点R2获得所述第二上下文标签CWFIL,并且按照顺时针方向即向网络节点R3转发所述第一MPLS报文,而不会再将所述第一MPLS报文发送至网络节点R1,从而解决了网络节点R1和网络节点R2之间可能出现的瞬间环路的技术问题。
其中,由于第二节点600沿着所述第一上下文标签指示的转发方向转发所述第一MPLS报文,因此所述第一下一跳具体为在第二节点600在所述第一上下文标签指示的方向上的下一跳,即第二节点600在所述环网上的所述第一上下文标签指示的方向上的邻居节点。所述第一出标签与所述第一下一跳对应,即为所述第一下一跳为所述LFIB表项对应的prefix FEC分配的标签。其中所述prefix FEC用于指示所述第一MPLS报文的目的端。例如在图1中所示的环网中,所述第一MPLS报文的栈顶标签为CWFIL,所述第二MPLS报文的栈顶标签为标签52,网络节点R2将标签52与所述第一上下文标签对应的LFIB匹配,获得如表5所示的LFIB表项。其中1.1.1.5/32对应网络节点R5,也就是说所述第一MPLS报文的目的端为网络节点R5。
在表5所示的LFIB表项中,第一下一跳为网络节点R2在顺时针方向上的路由的下一跳,即网络节点R3,第一出标签为网络节点R3为1.1.1.5/32分配的标签。
处理单元602,还用于将所述第二MPLS报文的栈顶标签替换为所述第一出标签,并将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文。
处理单元602除了将所述第二MPLS报文的栈顶标签替换为所述第一出标签外,还会将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文,使得接收到所述第三MPLS报文的网络节点,能够按照所述第二上下文标签指示的转发方向转发所述第三MPLS报文。
需要说明的是,本发明实施例在获得所述第一MPLS报文后,会将所述第一MPLS报文转换为所述第三MPLS报文后再进行转发,因此,所述第二上下文标签所指示的,所述第一MPLS报文在所述环网中经过第二节点600后的转发方向,实际上也可以认为是,基于所述第一MPLS报文生成的所述第三MPLS报文在所述环网中经过第二节点600后的转发方向
发送单元603,用于向所述第一下一跳信息对应的第一下一跳发送所述第三MPLS报文。
由于所述第三MPLS报文的栈顶标签为所述第二上下文标签,从而能够指示所述第一下一跳按照所述第二上下文标签所指示的所述转发方向转发所述第三MPLS报文。
通过上述技术方案可知,本发明实施例中,接收单元601接收所述第一MPLS报文后,处理单元602将所述第一MPLS报文的栈顶标签,即所述第一上下文标签弹出,并且在所述第一上下文标签对应的LFIB中获得匹配的第一LFIB表项,其中所述第一LFIB表项中包含第二上下文标签,由于所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过第二节点600后的转发方向,并且所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相同,也就是说,所述第一MPLS报文在经过所述第一节点和第二节点600时,沿着相同的转发方向转发。从而使得第二节点600不会再将所述第一MPLS报文发送至所述第一节点。从而避免了某一节点转发所述MPLS报文时,当所述某一节点的主用下一跳不可达时,所述第一节点和第二节 点600之间可能出现的瞬间环路的技术问题。进一步解决了由瞬间环路的技术问题导致的资源浪费和报文延时等问题。
例如在图1中,网络节点R2接收到网络节点R1发送的所述第一MPLS报文,所述第一MPLS报文的栈顶标签具体为CWFIL,用于指示所述第二MPLS报文按照顺时针方向转发,因此网络节点R2按照顺时针方向即向网络节点R3转发所述第二MPLS报文,而不会再将所述第二MPLS报文发送至网络节点R1,从而解决了网络节点R1和网络节点R2之间可能出现的瞬间环路的技术问题。
在本实施例中,所述第一上下文标签可以为SPL或者ESPL,也可以是所述第一节点分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。所述第二上下文标签可以为SPL或者ESPL,也可以是第二节点600分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。
在本发明实施例中,所述第一上下文标签可以用于指示顺时针转发方向或者逆时针转发方向,例如具体为CWFIL或者CCWFIL。因此可以分别设置对应顺时针转发方向的第二LFIB和对应逆时针转发方向的第三LFIB,处理单元602,还用于在第二LFIB或者第三LFIB中,获得与所述第一上下文标签对应的LFIB。例如,若所述第一上下文标签用于指示顺时针转发方向,则将所述第二LFIB作为所述第一上下文标签对应的LFIB。
其中所述第二LFIB基于第二节点600在顺时针方向上的路由生成,即所述第二LFIB中的任意表项的下一跳为,第二节点600在顺时针方向上的下一跳,实际上即为,第二节点600在所述环网上的顺时针方向上的邻居节点。而任意表项的出标签与该表项的下一跳对应,即为该表项中的下一跳为该表项的prefix FEC分配的标签。例如在图1所示的环网中,所述第二LFIB中与所述第二MPLS报文的栈顶标签匹配的LFIB表项可以如表5所示。
其中所述第三LFIB基于第二节点600在逆时针方向上的路由生成,即所述第三LFIB中的任意表项的下一跳为第二节点600在逆时针方向上的下一跳,实际上即为第二节点600在所述环网上的逆时针方向上的邻居节点,而任意表项的出标签与该表项的下一跳对应,即为该表项中的下一跳为该表项的prefix FEC分配的标签。例如在图1所示的环网中,所述 第三LFIB中与所述第二MPLS报文的栈顶标签匹配的LFIB表项可以如表6所示。
在表6所示的LFIB表项中,下一跳为网络节点R2在逆时针方向上的路由的下一跳,即网络节点R1出标签为网络节点R1为1.1.1.5/32分配的标签。
接收单元601在接收所述第一节点发送的所述第一MPLS报文之前,还可以接收环网外的网络节点发送的MPLS报文,该MPLS报文中不包括用于指示转发方向的上下文标签,处理单元602可以不在该MPLS报文中压入上下文标签,由所述第一节点确定出所述第一节点的主用下一跳不可达时,压入用于指示转发方向的上下文标签;或者处理单元602也可以在接收单元601接收到该MPLS报文后,在该MPLS报文中压入用于指示转发方向的上下文标签,下面具体说明这种方式。
在接收单元601接收所述第一节点发送的所述第一MPLS报文之前,处理单元602,还用于从第三节点接收第四MPLS报文、以及在第一LFIB中获得与所述第四MPLS报文的栈顶标签匹配的第二LFIB表项,所述第三节点为所述环网外与所述环网连接的节点,所述第二LFIB表项包括:所述第四MPLS报文的栈顶标签、第二下一跳信息、第二出标签和第三上下文标签;所述第三上下文标签用于指示所述第四MPLS报文在所述环网中经过所述第二节点后的转发方向;处理单元602,还用于将所述第四MPLS报文的栈顶标签替换为所述第二出标签,并将所述第三上下文标签压入进行了标签替换的所述第四MPLS报文的标签栈,以生成第五MPLS报文;发送单元602,还用于向所述第二下一跳信息对应的第二下一跳发送所述第五MPLS报文。
其中,所述第一LFIB基于第二节点600上的最佳路由生成,即,所述第一LFIB中任意表项的下一跳为,对于第二节点600来说,在该表项中的prefix FEC所对应的最佳路由的下一跳。
在本实施例中,所述第三上下文标签可以为SPL或者ESPL,也可以是第二节点600分配并且通过LDP、ISIS或者OSPF协议等方式通告的标签。
在一种较优的实施方式中,可以在第二节点600上保存所述第一LFIB、所述第二LFIB和所述第三LFIB,处理单元602根据接收到的MPLS 报文的栈顶标签,获得对应的LFIB,并从所述对应的LFIB中获得匹配的LFIB表项。具体地,当第二节点600接收到所述第四MPLS报文,也就是说接收到的MPLS报文的栈顶标签不为上下文标签时,处理单元602,用于从所述第一LFIB中获得所述第二LFIB表项;当接收到所述第三MPLS报文,其中所述第三MPLS报文的栈顶标签为所述第一上下文标签,则处理单元602根据所述第一上下文标签从所述第二LFIB或所述第三LFIB中获得对应的LFIB,具体地,处理单元602,用于当所述第一上下文标签指示顺时针转发方向时,从所述第二LFIB中获得所述第一LFIB表项,当所述第一上下文标签指示逆时针转发方向时,从所述第三LFIB中获得所述第一LFIB表项。例如在图1中,网络节点R2接收到网络节点R1发送的所述第一MPLS报文后,其中所述第一MPLS报文的栈顶标签为CWFIL,处理单元602从CWFIL对应的所述第二LFIB中获得如表5所示的所述第一LFIB表项。
在本发明实施例中,处理单元602也可以不根据所述第一上下文标签获得所述对应的LFIB,例如,接收单元601从所述环网外的网络节点接收到所述第四MPLS报文后,处理单元602,用于从所述第一LFIB中获得所述第二LFIB表项;接收单元601接收到所述第一节点发送的所述第一MPLS报文,处理单元602,用于当确定所述第一节点是所述环网上顺时针方向的上游节点时,说明此时所述第一MPLS报文按照顺时针方向转发,从所述第二LFIB中获得所述第一LFIB表项;当确定所述第一节点是所述环网上逆时针方向的上游节点时,说明此时所述第一MPLS报文按照逆时针方向转发,从所述第三LFIB中获得所述第一LFIB表项。
需要说明的是,在本发明实施例中,所述第一LFIB、所述第二LFIB和所述第三LFIB可以分别对应三种不同的转发表,例如所述第一LFIB对应转发表1,所述第二LFIB对应转发表2,所述第三LFIB对应转发表3,当然,所述第一LFIB、所述第二LFIB和所述第三LFIB也可以对应同一张表,例如所述第一LFIB、所述第二LFIB和所述第三LFIB都对应转发表4,其中可以在转发表4中设置LFIB标识,用于区分上述三个LFIB。
在本发明实施例中,在生成所述第一LFIB、所述第二LFIB和所述第三LFIB时,需要在所述环网上规定出顺时针方向和逆时针方向。具体实现时, 可以通过手动或者机器自动生成等方式,在第二节点600上配置出顺时针方向的下一跳和逆时针方向的下一跳,从而使得第二节点600能够根据该配置,生成所述第一LFIB、所述第二LFIB和所述第三LFIB。
上面从模块化功能实体的角度对本发明实施例中的网络节点的实施例进行描述。下面将从硬件处理的角度对本发明实施例中的网络节点的实施例进行描述。
请参阅图7,本发明实施例提供的另一种网络节点的结构示意图,本实施例中,所述网络节点为第一节点700,第一节点700位于环网中。
本实施例的第一节点700具体包括:处理器(processor)701、通信接口(Communications Interface)702、存储器(memory)703和通信总线704。
处理器701,通信接口702,存储器703通过总线704完成相互间的通信。
处理器701,用于执行程序705。
具体地,程序705可以包括程序代码,所述程序代码包括计算机操作指令。
处理器701可能是一个中央处理器CPU,或者是专用集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。
存储器703,用于存放程序705。存储器703可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。程序705用于执行以下步骤:
获得第一MPLS报文;
获得与所述第一MPLS报文的栈顶标签匹配的标签转发信息库LFIB表项,所述LFIB表项包含主用下一跳信息、备用下一跳信息、备用出标签和备用的第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
当确定所述主用下一跳信息对应的主用下一跳不可达时,所述第一节点将所述第一MPLS报文的栈顶标签替换为所述备用出标签,并将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文;
向所述备用下一跳信息对应的备用下一跳发送所述第二MPLS报文。
程序705中各步骤的具体实现参见图2或图4所示实施例中的相应步骤的实现方式,在此不赘述。
本实施例提供的第一节点700的各功能单元,可以是基于图2所示的方法实施例和图5所示的装置实施例所具备的功能的具体实现,术语的定义和说明与图2所示的方法实施例和图5所示的装置实施例保持一致,此处不再赘述。
请参阅图8,本发明实施例提供了另一种网络节点的结构示意图。在本实施例中,所述网络节点为第二节点800,环网中包括第一节点和第二节点800。
本实施例的第二节点800具体包括:处理器(processor)801、通信接口(Communications Interface)802、存储器(memory)803和通信总线804。
处理器801,通信接口802,存储器803通过总线804完成相互间的通信。
处理器801,用于执行程序805。
具体地,程序805可以包括程序代码,所述程序代码包括计算机操作指令。
处理器801可能是一个中央处理器CPU,或者是专用集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。
存储器803,用于存放程序805。存储器803可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。程序805用于执行以下步骤:
接收所述第一节点发送的第一MPLS报文,所述第一MPLS报文的栈顶标签为第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
将所述第一MPLS报文的所述第一上下文标签弹出,以生成第二MPLS报文;
在所述第一上下文标签对应的标签转发信息库LFIB中获得与所述第二MPLS报文的栈顶标签匹配的第一LFIB表项,所述第一LFIB表项包含: 所述第二MPLS报文的栈顶标签、第一下一跳信息、第一出标签和第二上下文标签,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相同;
将所述第二MPLS报文的栈顶标签替换为所述第一出标签,并将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文;
向所述第一下一跳信息对应的第一下一跳发送所述第三MPLS报文。
程序805中各步骤的具体实现参见图3或图4所示实施例中的相应步骤的实现方式,在此不赘述。
本实施例提供的第二节点800的各功能单元,可以是基于图3所示的方法实施例和图6所示的装置实施例所具备的功能的具体实现,术语的定义和说明与图3所示的方法实施例和图6所示的装置实施例保持一致,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (20)

  1. 一种环网中多协议标签交换MPLS报文转发的方法,其特征在于,所述环网中包括第一节点,所述方法包括:
    所述第一节点获得第一MPLS报文;
    所述第一节点获得与所述第一MPLS报文的栈顶标签匹配的标签转发信息库LFIB表项,所述LFIB表项包含主用下一跳信息、备用下一跳信息、备用出标签和备用的第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
    当所述第一节点确定所述主用下一跳信息对应的主用下一跳不可达时,所述第一节点将所述第一MPLS报文的栈顶标签替换为所述备用出标签,并将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文;
    所述第一节点向所述备用下一跳信息对应的备用下一跳发送所述第二MPLS报文。
  2. 根据权利要求1所述的方法,其特征在于,所述第一节点获得所述第一MPLS报文包括:
    所述第一节点获得第二节点向所述第一节点发送的所述第一MPLS报文。
  3. 根据权利要求2所述的方法,其特征在于,所述第一节点获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项包括:
    所述第一节点在第一LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项,所述第一LFIB基于所述第一节点上的最佳路由生成。
  4. 根据权利要求1所述的方法,其特征在于,所述第一节点获得所述第一MPLS报文包括:
    所述第一节点接收第二节点发送的第三MPLS报文,所述第三MPLS报文的栈顶标签为第二上下文标签;
    所述第一节点将所述第三MPLS报文的所述第二上下文标签弹出,以生成所述第一MPLS报文,所述第二上下文标签用于指示所述第一MPLS报 文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相反。
  5. 根据权利要求4所述的方法,其特征在于,所述第一节点获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项包括:
    所述第一节点在所述第二上下文标签对应的LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。
  6. 根据权利要求5所述的方法,其特征在于,还包括:
    所述第一节点在第二LFIB或者第三LFIB中,获得与所述第二上下文标签对应的LFIB,其中,所述第二LFIB基于所述第一节点在顺时针方向上的路由生成,所述第三LFIB基于所述第一节点在逆时针方向上的路由生成。
  7. 一种环网中多协议标签交换MPLS报文转发的方法,其特征在于,所述环网中包括第一节点和第二节点,所述方法包括:
    所述第二节点接收所述第一节点发送的第一MPLS报文,所述第一MPLS报文的栈顶标签为第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
    所述第二节点将所述第一MPLS报文的所述第一上下文标签弹出,以生成第二MPLS报文;
    所述第二节点在所述第一上下文标签对应的标签转发信息库LFIB中获得与所述第二MPLS报文的栈顶标签匹配的第一LFIB表项,所述第一LFIB表项包含:所述第二MPLS报文的栈顶标签、第一下一跳信息、第一出标签和第二上下文标签,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相同;
    所述第二节点将所述第二MPLS报文的栈顶标签替换为所述第一出标签,并将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文;
    所述第二节点向所述第一下一跳信息对应的第一下一跳发送所述第 三MPLS报文。
  8. 根据权利要求7所述的方法,其特征在于,还包括:
    所述第二节点在第二LFIB或者第三LFIB中,获得与所述第一上下文标签对应的LFIB,其中,所述第二LFIB基于所述第二节点在顺时针方向上的路由生成,所述第三LFIB基于所述第二节点在逆时针方向上的路由生成。
  9. 根据权利要求7或8所述的方法,其特征在于,在所述第二节点接收所述第一节点发送的所述第一MPLS报文之前所述方法还包括:
    所述第二节点从第三节点接收第四MPLS报文,所述第三节点为所述环网外与所述环网连接的节点;
    所述第二节点在第一LFIB中获得与所述第四MPLS报文的栈顶标签匹配的第二LFIB表项,所述第二LFIB表项包括:所述第四MPLS报文的栈顶标签、第二下一跳信息、第二出标签和第三上下文标签;所述第三上下文标签用于指示所述第四MPLS报文在所述环网中经过所述第二节点后的转发方向;
    所述第二节点将所述第四MPLS报文的栈顶标签替换为所述第二出标签,并将所述第三上下文标签压入进行了标签替换的所述第四MPLS报文的标签栈,以生成第五MPLS报文;
    所述第二节点向所述第二下一跳信息对应的第二下一跳发送所述第五MPLS报文。
  10. 根据权利要求9所述的方法,其特征在于,所述第一LFIB基于所述第二节点上的最佳路由生成。
  11. 一种网络节点,其特征在于,所述网络节点为第一节点,所述第一节点位于环网中,所述第一节点包括:处理单元和发送单元;其中,
    所述处理单元,用于获得第一多协议标签交换MPLS报文和获得与所述第一MPLS报文的栈顶标签匹配的标签转发信息库LFIB表项,所述LFIB表项包含主用下一跳信息、备用下一跳信息、备用出标签和备用的第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
    所述处理单元,还用于当确定所述主用下一跳信息对应的主用下一跳不可达时,将所述第一MPLS报文的栈顶标签替换为所述备用出标签,并将所述第一上下文标签压入进行了标签替换的所述第一MPLS报文的标签栈,以生成第二MPLS报文;
    所述发送单元,用于向所述备用下一跳信息对应的备用下一跳发送所述第二MPLS报文。
  12. 根据权利要求11所述的网络节点,其特征在于,所述第一节点还包括:接收单元;
    当所述处理单元获得所述第一MPLS报文时,所述处理单元,用于通过所述接收单元获得第二节点向所述第一节点发送的所述第一MPLS报文。
  13. 根据权利要求12所述的网络节点,其特征在于,当所述处理单元获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项时,所述处理单元,用于在第一LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项,所述第一LFIB基于所述第一节点上的最佳路由生成。
  14. 根据权利要求11所述的网络节点,其特征在于,所述第一节点还包括:接收单元;
    当所述处理单元获得所述第一MPLS报文时,所述处理单元,用于通过所述接收单元接收第二节点发送的第三MPLS报文,所述第三MPLS报文的栈顶标签为第二上下文标签,以及将所述第三MPLS报文的所述第二上下文标签弹出,以生成所述第一MPLS报文,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相反。
  15. 根据权利要求14所述的网络节点,其特征在于,当所述处理单元获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项时,所述处理单元,用于在所述第二上下文标签对应的LFIB中,获得与所述第一MPLS报文的栈顶标签匹配的所述LFIB表项。
  16. 根据权利要求15所述的网络节点,其特征在于,所述处理单元,还用于在第二LFIB或者第三LFIB中,获得与所述第二上下文标签对应的 LFIB,其中,所述第二LFIB基于所述第一节点在顺时针方向上的路由生成,所述第三LFIB基于所述第一节点在逆时针方向上的路由生成。
  17. 一种网络节点,其特征在于,所述网络节点为第二节点,环网中包括第一节点和所述第二节点,所述第二节点包括:接收单元、处理单元和发送单元;其中,
    所述接收单元,用于接收所述第一节点发送的第一多协议标签交换MPLS报文,所述第一MPLS报文的栈顶标签为第一上下文标签,所述第一上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第一节点后的转发方向;
    所述处理单元,用于将所述第一MPLS报文的所述第一上下文标签弹出,以生成第二MPLS报文,以及在所述第一上下文标签对应的标签转发信息库LFIB中获得与所述第二MPLS报文的栈顶标签匹配的第一LFIB表项,所述第一LFIB表项包含:所述第二MPLS报文的栈顶标签、第一下一跳信息、第一出标签和第二上下文标签,所述第二上下文标签用于指示所述第一MPLS报文在所述环网中经过所述第二节点后的转发方向,所述第二上下文标签所指示的报文转发方向与所述第一上下文标签所指示的报文转发方向相同;
    所述处理单元,还用于将所述第二MPLS报文的栈顶标签替换为所述第一出标签,并将所述第二上下文标签压入进行了标签替换的所述第二MPLS报文的标签栈,以生成第三MPLS报文;
    所述发送单元,用于向所述第一下一跳信息对应的第一下一跳发送所述第三MPLS报文。
  18. 根据权利要求17所述的网络节点,其特征在于,所述处理单元,还用于在第二LFIB或者第三LFIB中,获得与所述第一上下文标签对应的LFIB,其中,所述第二LFIB基于所述第二节点在顺时针方向上的路由生成,所述第三LFIB基于所述第二节点在逆时针方向上的路由生成。
  19. 根据权利要求17或18所述的网络节点,其特征在于,在所述接收单元接收所述第一节点发送的所述第一MPLS报文之前,所述处理单元还用于从第三节点接收第四MPLS报文、以及在第一LFIB中获得与所述第 四MPLS报文的栈顶标签匹配的第二LFIB表项,所述第三节点为所述环网外与所述环网连接的节点,所述第二LFIB表项包括:所述第四MPLS报文的栈顶标签、第二下一跳信息、第二出标签和第三上下文标签;所述第三上下文标签用于指示所述第四MPLS报文在所述环网中经过所述第二节点后的转发方向;
    所述处理单元,还用于将所述第四MPLS报文的栈顶标签替换为所述第二出标签,并将所述第三上下文标签压入进行了标签替换的所述第四MPLS报文的标签栈,以生成第五MPLS报文;
    所述发送单元,还用于向所述第二下一跳信息对应的第二下一跳发送所述第五MPLS报文。
  20. 根据权利要求19所述的网络节点,其特征在于,所述第一LFIB基于所述第二节点上的最佳路由生成。
PCT/CN2015/099945 2015-02-05 2015-12-30 一种环网中mpls报文转发的方法及网络节点 WO2016124055A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510060726.9 2015-02-05
CN201510060726.9A CN105991434B (zh) 2015-02-05 2015-02-05 一种环网中mpls报文转发的方法及网络节点

Publications (1)

Publication Number Publication Date
WO2016124055A1 true WO2016124055A1 (zh) 2016-08-11

Family

ID=56563425

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/099945 WO2016124055A1 (zh) 2015-02-05 2015-12-30 一种环网中mpls报文转发的方法及网络节点

Country Status (2)

Country Link
CN (1) CN105991434B (zh)
WO (1) WO2016124055A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10476811B2 (en) * 2017-03-10 2019-11-12 Juniper Networks, Inc Apparatus, system, and method for providing node protection across label-switched paths that share labels
CN107547371A (zh) * 2017-09-28 2018-01-05 新华三技术有限公司 一种报文转发方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174483A1 (en) * 2006-01-20 2007-07-26 Raj Alex E Methods and apparatus for implementing protection for multicast services
US20070253416A1 (en) * 2006-04-28 2007-11-01 Raj Alex E Method and apparatus for forwarding label distribution protocol multicast traffic during fast reroute
US20100238795A1 (en) * 2009-03-23 2010-09-23 Cisco Technology, Inc. Restoring multi-segment pseudowires following failure of a switching PE device
US20120051212A1 (en) * 2010-08-26 2012-03-01 Verizon Patent And Licensing Inc. System and method for fast network restoration
CN102474446A (zh) * 2009-07-16 2012-05-23 瑞典爱立信有限公司 用于点对多点业务的恢复机制

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100518135C (zh) * 2004-08-17 2009-07-22 华为技术有限公司 一种多协议标签交换网络中重新路由的方法
CN103209088B (zh) * 2012-01-17 2016-12-28 华为技术有限公司 环网标签交换路径创建方法及相关设备和通信系统
US9178798B2 (en) * 2012-05-09 2015-11-03 Juniper Networks, Inc. Fast reroute using loop free alternate next hops for multipoint label switched paths

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174483A1 (en) * 2006-01-20 2007-07-26 Raj Alex E Methods and apparatus for implementing protection for multicast services
US20070253416A1 (en) * 2006-04-28 2007-11-01 Raj Alex E Method and apparatus for forwarding label distribution protocol multicast traffic during fast reroute
US20100238795A1 (en) * 2009-03-23 2010-09-23 Cisco Technology, Inc. Restoring multi-segment pseudowires following failure of a switching PE device
CN102474446A (zh) * 2009-07-16 2012-05-23 瑞典爱立信有限公司 用于点对多点业务的恢复机制
US20120051212A1 (en) * 2010-08-26 2012-03-01 Verizon Patent And Licensing Inc. System and method for fast network restoration

Also Published As

Publication number Publication date
CN105991434B (zh) 2019-12-06
CN105991434A (zh) 2016-10-05

Similar Documents

Publication Publication Date Title
US20210084009A1 (en) Route generation method and device
US11431633B2 (en) Label forwarding entry generation method and apparatus, packet sending method and apparatus, and device
US8982881B2 (en) Upstream label allocation on ethernets for MP2MP LSPS
JP2006197613A (ja) Mplsマルチキャストの高速再経路設定装置及び方法
US20150009803A1 (en) Scalable bgp protection from edge node failure using dynamically assigned labels in data packets
WO2020135395A1 (zh) 一种跨内部网关协议的前缀标识通告方法和装置
US20120069745A1 (en) Method and apparatus to improve ldp convergence using hierarchical label stacking
WO2021164249A1 (zh) 一种发送报文的方法、设备及系统
CN112118182A (zh) 发送流量工程的ip路径隧道
WO2020119644A1 (zh) 一种转发表项生成方法、装置及设备
US11895014B2 (en) Aggregated route communication method and apparatus
US20120124238A1 (en) Prioritization of routing information updates
JP6098192B2 (ja) アドレス生成装置
CN113055295A (zh) 通信方法、通信设备和通信系统
WO2022068436A1 (zh) 业务处理方法以及相关设备
EP4024774A1 (en) Reverse path forwarding (rpf) check method and apparatus
US20170111260A1 (en) Trill isis-based route calculation method and device
WO2016124055A1 (zh) 一种环网中mpls报文转发的方法及网络节点
JP7273125B2 (ja) BIERv6パケットを送信するための方法および第1のネットワークデバイス
WO2022062956A1 (zh) 一种流量处理方法、装置和网络设备
CN103973576B (zh) 一种链路本地组播报文的处理方法和网络设备
WO2015100551A1 (zh) 发送信息的方法、装置及系统
WO2021017985A1 (zh) 一种处理bier报文的方法、网络设备及系统
US11070468B1 (en) Serverless segment routing (SR)-label distribution protocol (LDP) stitching
JP2023547485A (ja) 次ホップ決定方法および装置

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

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

Country of ref document: EP

Kind code of ref document: A1