Message forwarding method and device and electronic equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2024-09-29
- Publication Date
- 2026-05-19
AI Technical Summary
In a ring network, when a node receives a service packet and the route has not converged, it may cause a packet forwarding loop, especially under abnormal ring network conditions, such as node failure or link failure. Existing technologies are difficult to effectively avoid such problems.
Enable ring network protection on the ring network nodes, determine the primary and backup routes, and forward the packets through the backup outgoing interface if the incoming interface is the same as the primary outgoing interface when a packet is received, so as to avoid forwarding loops.
By using a forced split-horizon forwarding mechanism, packet forwarding can be quickly restored when the ring network is abnormal, improving forwarding efficiency, avoiding forwarding loops, and achieving software recovery in the 10-millisecond range and hardware recovery in the sub-millisecond range.
Smart Images

Figure CN122070684A_ABST
Abstract
Description
Message forwarding method, device and electronic equipment TECHNICAL FIELD
[0001] The present application relates to network communication technology, in particular to a message forwarding method, device and electronic equipment. BACKGROUND
[0002] In the ring network, each node calculates an IP route to a destination node according to the shortest path first algorithm. For example, in the ring network composed of nodes A, B, C, D, E, F, G and H as shown in FIG. 1, each node calculates an optimal route to node X according to the shortest path first algorithm. In this way, as shown in FIG. 1, a service message entering the ring network from node G is forwarded to node X according to the following path: node G—>node H—>node A—>node X. A service message entering the ring network from node F is forwarded to node X according to the following path: node F—>node G—>node H—>node A—>node X.
[0003] If an abnormality occurs in the ring network, such as a node failure or a link failure between any two nodes, etc., when the node detects the failure, the node will timely adjust the original route to avoid the above failure. For example, if node A fails, when a service message to node X enters the ring network from node G, node G forwards the service message to node H, node H finds that node A fails, and modifies the original route to send the message to node G. Node G to node C is similar in principle, and finally the service message is forwarded to node X according to the following path: node G—>node F—>node E—>node D—>node C—>node B—>node A—>node X. As shown in FIG. 2.
[0004] However, if the route has not converged when the node on the ring network receives the service message, such as when node G receives the service message returned by node H, the route has not converged, at this time, node G still forwards the service message to node H according to the original route, i.e., the interface connected to node H on node G, which leads to the loop as shown in FIG. 3 when node G and node H forward the service message.
[0005] SUMMARY
[0006] The present application provides a message forwarding method, device and electronic equipment to avoid the loop of message forwarding.
[0007] The present application provides a message forwarding method, which is applied to any node in a ring network, and the method comprises the following steps:
[0008] receiving a message;
[0009] finding a forwarding table entry for forwarding the packet in a local forwarding table; the forwarding table entry comprises: a primary outgoing interface identifier and a backup outgoing interface identifier; the primary outgoing interface identifier indicates a first ring network interface on the node on which a ring network protection function is enabled, and the backup outgoing interface identifier indicates a second ring network interface on the node on which the ring network protection function is enabled; the first ring network interface is different from the second ring network interface;
[0010] if an incoming interface of the packet is the same as the first ring network interface indicated by the primary outgoing interface identifier, forwarding the packet through the second ring network interface indicated by the backup outgoing interface identifier.
[0011] Embodiments of the present application provide a packet forwarding device, which is applied to any node in a ring network, and the device comprises:
[0012] a receiving unit, configured to receive a packet;
[0013] a processing unit, configured to find a forwarding table entry for forwarding the packet in a local forwarding table; the forwarding table entry comprises: a primary outgoing interface identifier and a backup outgoing interface identifier; the primary outgoing interface identifier indicates a first ring network interface on the node on which a ring network protection function is enabled, and the backup outgoing interface identifier indicates a second ring network interface on the node on which the ring network protection function is enabled; the first ring network interface is different from the second ring network interface; and if an incoming interface of the packet is the same as the first ring network interface indicated by the primary outgoing interface identifier, forwarding the packet through the second ring network interface indicated by the backup outgoing interface identifier.
[0014] Embodiments of the present application provide an electronic device, which comprises: a processor and a machine readable storage medium; the machine readable storage medium stores computer instructions, and the computer instructions are executed by the processor to perform steps in the above method.
[0015] As can be seen from the above technical solutions, in the present application, the ring network protection function is enabled for each node on the ring network with respect to a local ring network interface, so that any node determines a primary route from the node to a destination node when an outgoing interface of the determined route to the destination node is a ring network interface on which the ring network protection function is enabled on the node, and determines a backup route of the primary route (an outgoing interface of the backup route is a ring network interface on which the ring network protection function is enabled on the node), and then forwards a packet based on the primary and backup routes, for example, directly forwards the packet through a backup outgoing interface of the backup route when an incoming interface of the received packet is the same as a primary outgoing interface of the primary route, so as to avoid a packet forwarding loop caused by the fact that a node on the ring network has not converged a route after receiving a packet when an abnormality occurs in the ring network, such as a node failure or a link failure between any two nodes, and improve packet forwarding efficiency. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0017] Figures 1 to 3 are schematic diagrams of the existing network topology;
[0018] Figure 4 is a schematic diagram of a multi-ring network provided in an embodiment of this application;
[0019] Figure 5 is a schematic diagram of the primary and backup routes under a single-ring network provided in an embodiment of this application;
[0020] Figure 6 is a schematic diagram of primary and backup routing in a multi-ring network provided in an embodiment of this application;
[0021] Figure 7 is a flowchart of the method provided in an embodiment of this application;
[0022] Figure 8 is a network diagram of the application of the embodiments provided in this application;
[0023] Figure 9 is a network diagram of another embodiment provided in this application;
[0024] Figure 10 is a schematic diagram of the device structure provided in an embodiment of this application;
[0025] Figure 11 is a hardware structure diagram of the device shown in Figure 10 provided in an embodiment of this application. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0027] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0028] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0029] In this embodiment, each node on the ring network enables the ring protection function for the interface (referred to as a ring network interface) that connects to other nodes on the local ring network. Alternatively, the embodiment can input a command line to the configuration interface of each node on the ring network to enable the ring protection function for the ring network interface that connects to other nodes on the local ring network.
[0030] It should be noted that if the same node is on at least two different ring networks, for example, node E in FIG. 4 is on two different ring networks (referred to as Ringl and Ring2, respectively), the node E enables the ring protection function for the ring network interface that connects to each ring network. Node D is similar and will not be described again.
[0031] In this embodiment, each node on the ring network calculates an optimal route (referred to as a first optimal route) from the node to a destination node (such as a destination node or a destination network segment) according to the shortest path first algorithm. Alternatively, the destination node can be set according to actual needs, and the embodiment does not specifically limit it.
[0032] As an example, when the first optimal route calculated by the node includes an out interface that is a ring network interface for which the node has enabled the ring protection function (referred to as a first ring network interface), the node can record this route as a primary route from the node to the destination node. At this time, the first ring network interface is a primary out interface included in the primary route.
[0033] Alternatively, in this embodiment, the node also selects an optimal route (referreded to as a second optimal route) from the remaining routes other than the primary route from the node to the destination node according to the shortest path first algorithm based on the ring protection function that has been enabled for the first ring network interface.
[0034] It should be noted that the primary route can include an out interface (also referred to as a primary out interface) and / or a next hop node (also referred to as a primary next hop node). Taking the example that the primary route includes at least the primary next hop node, the remaining route refers to other routes other than the link between the node and the primary next hop node. Taking the example that the primary route includes at least the primary out interface, the remaining route refers to other routes other than the link connected by the primary out interface.
[0035] If the second optimal route includes an out interface that is a ring network interface for which the node has enabled the ring protection function (different from the first ring network interface, and can be referred to as a second ring network interface), the second optimal route is taken as a backup route of the primary route. Correspondingly, the second ring network interface is a backup out interface included in the backup route.
[0036] Taking the network shown in FIG. 1 as an example, assuming that the destination node is node X, FIG. 5 illustrates an example of the primary route (shown in solid lines in FIG. 5) and the backup route (shown in dashed lines in FIG. 5) from node H to node X. Assuming that the destination node is node X, FIG. 6 illustrates an example of the primary and backup routes determined by node D in the two ring networks (the primary route is shown in solid lines and the backup route is shown in dashed lines).
[0037] As an embodiment, the primary and backup routes from a node in the ring network to a destination node can be determined based on the topology relationships recorded in the link state database and according to the shortest path first algorithm. For example, the primary route from the node to the destination node can be determined by the node from all the topology relationships recorded in the link state database according to the shortest path first algorithm. As an embodiment, the primary route from the node to the destination node can include an outgoing interface (also referred to as a primary outgoing interface) on the node and / or a next-hop node (also referred to as a primary next-hop node).
[0038] For example, assuming that the primary route includes at least a primary next-hop node, the backup route from the node to the destination node determined by the node is determined from the remaining topology relationships recorded in the link state database excluding the link from the node to the primary next-hop node according to the shortest path first algorithm. Alternatively, for example, assuming that the primary route includes at least a primary outgoing interface, the backup route from the node to the destination node determined by the node is determined from the remaining topology relationships recorded in the link state database excluding the link connected by the primary outgoing interface on the node according to the shortest path first algorithm.
[0039] As an embodiment, after any node in the ring network determines the primary and backup routes from the node to the destination node, the node can correspondingly add a corresponding forwarding table entry in a local forwarding table such as a FIB table. Optionally, the forwarding table entry includes at least an identifier of the primary outgoing interface (referred to as a primary outgoing interface identifier) and an identifier of the backup outgoing interface (referred to as a backup outgoing interface identifier). The primary outgoing interface identifier indicates a first ring network interface on the node that has been enabled with the ring network protection function, and the backup outgoing interface identifier indicates a second ring network interface on the node that has been enabled with the ring network protection function.
[0040] It should be noted that if the outgoing interface of the second optimal route selected from the remaining routes excluding the primary route according to the shortest path first algorithm is not any ring network interface on the node that has been enabled with the ring network protection function, an alarm information can be output to indicate that the ring network currently has an abnormality, such as indicating that “the ring network is abnormal, and the reason for the abnormality is that the reverse protection route calculation fails”.
[0041] Based on the above description, a message forwarding method applied to a ring network is provided in the embodiments of the present application.
[0042] Referring to FIG. 7, FIG. 7 is a flowchart of a method provided in the embodiments of the present application. The flowchart can be applied to any node in the ring network.
[0043] As shown in FIG. 7, the flowchart can include the following steps.
[0044] Step 701, receiving a message.
[0045] Step 702, finding a forwarding entry for forwarding the message in a local forwarding table.
[0046] Optionally, if the message herein refers to a message sent to the destination node, the forwarding entry for forwarding the message can be found in the local forwarding table based on the destination address of the message (indicating the destination node). As described above, the forwarding entry includes a primary out-interface identifier and a backup out-interface identifier. The primary out-interface identifier indicates a first ring network interface on the node on which the ring network protection function is enabled, and the backup out-interface identifier indicates a second ring network interface on the node on which the ring network protection function is enabled.
[0047] Step 703, if the incoming interface of the message is the same as the first ring network interface indicated by the primary out-interface identifier, forwarding the message through the second ring network interface indicated by the backup out-interface identifier.
[0048] Of course, if the incoming interface of the message is different from the first ring network interface indicated by the primary out-interface identifier, forwarding the message through the first ring network interface indicated by the primary out-interface identifier when the primary route is a reachable route. Here, whether the primary route is reachable can be implemented based on an existing route reachability detection mechanism, which is not specifically limited in the embodiments.
[0049] And if the incoming interface of the message is different from the first ring network interface indicated by the primary out-interface identifier, forwarding the message through the second ring network interface indicated by the backup out-interface identifier when the primary route is an unreachable route. Here, the primary route is unreachable, for example, due to an abnormality of the first ring network interface, an abnormality of a link connected to the first ring network interface, or an abnormality of a primary next-hop node, which is not specifically limited in the embodiments.
[0050] Thus far, the flowchart shown in FIG. 7 is completed.
[0051] As can be seen from the flow shown in FIG. 7, in this embodiment, each node on the ring network enables the ring protection function for the local ring network interface, so that when any node determines that the out interface of the route to the destination node is the local ring network interface for which the ring protection function has been enabled, the node takes the route as the primary route from the node to the destination node, and determines the backup route of the primary route (the out interface of the backup route is the ring network interface on the node for which the ring protection function has been enabled), and then forwards the packet based on the primary and backup routes. For example, when a packet is received, if the in interface of the received packet is the same as the primary out interface of the primary route, the packet is directly forwarded through the backup out interface of the backup route, so as to avoid the packet forwarding loop caused by the fact that some node on the ring network has not successfully adjusted the route after receiving the packet when the ring network abnormally, such as when a node on the ring network fails or the link between any two nodes fails, and improve the packet forwarding efficiency.
[0052] The above flow is described below through a specific embodiment.
[0053] The packet applied to this embodiment can be a packet carrying underlay encapsulation (denoted as an underlay packet), such as the underlay packet sent from node Y to node X shown in FIG. 1. Of course, the packet applied to this embodiment can also be a packet carrying overlay encapsulation (denoted as an overlay packet), such as the overlay packet sent from node Z to node W shown in FIG. 1. It should be noted that the node (referred to as an in-ring node) through which the overlay packet enters the ring network, such as node E shown in FIG. 1, adds underlay encapsulation to the overlay packet after receiving the packet. The node (referred to as an out-ring node) through which the overlay packet leaves the ring network, such as node C shown in FIG. 1, removes the added underlay encapsulation after receiving the packet. Here, the added underlay encapsulation is, for example, a Virtual Extensible Local Area Network (VXLAN) header, an outer User Datagram Protocol (UDP) header, and an outer IP header. The destination IP address of the outer IP header is the IP address of the node (referred to as an out-ring node) through which the overlay packet leaves the ring network. Alternatively, the underlay encapsulation can also be an SRv6 (Segment Routing IPv6) header and an outer IPv6 header. The destination IP address of the outer IPv6 header is the Segment Identifier (SID) of the out-ring node C.
[0054] Based on the above description, as shown in FIG. 8, the node G in the ring network receives a packet from the node Y, such as a packet carrying an underlay encapsulation.
[0055] The node G queries a local FIB forwarding table to obtain a forwarding table entry for forwarding the packet.
[0056] When the primary route for forwarding the packet is currently a reachable route, the node G forwards the packet through an interface indicated by a primary out-interface identifier in the forwarding table entry, i.e., an interface of the node G connected to the node H. As shown in FIG. 8, a destination MAC in an Ethernet header of the packet is a MAC address MAC H of the node H.
[0057] The node H receives the packet, queries a local FIB forwarding table to obtain a forwarding table entry for forwarding the packet.
[0058] The node H finds that the primary route for forwarding the packet is currently an unreachable route (such as the primary out-interface failure or the link failure to the next-hop node or the next-hop node failure, etc. leading to the unreachable route), and forwards the packet through an interface corresponding to a backup out-interface identifier in the forwarding table entry, i.e., an interface of the node H connected to the node G. As shown in FIG. 8, a destination MAC in an Ethernet header of the packet is a MAC address MAC G of the node G. In combination with the above forwarding, the packet herein substantially enters a loopback stage, and the packet at this time can be referred to as a loopback packet.
[0059] The node G receives the packet, queries a local FIB forwarding table to obtain a forwarding table entry for forwarding the packet.
[0060] The node G finds that the interface indicated by the primary out-interface identifier in the forwarding table entry is the same as the interface receiving the packet, and forwards the packet through an interface indicated by the backup out-interface identifier in the forwarding table entry, i.e., an interface of the node G connected to the node F. As shown in FIG. 8, a destination MAC in an Ethernet header of the packet is a MAC address MAC F of the node F.
[0061] In the above description, when the node G finds that the interface indicated by the primary out-interface identifier in the forwarding table entry is the same as the interface receiving the packet, the node G forwards the packet through the interface indicated by the backup out-interface identifier in the forwarding table entry, i.e., the interface of the node G connected to the node F. This forwarding manner can be referred to as forced horizontal split forwarding.
[0062] By means of the forced horizontal split forwarding, when the abnormality of the ring network such as node failure or link abnormality between any two nodes causes the above primary route to be an unreachable route, the message forwarding loop caused by the time difference of the route re-convergence of each node in the ring network can be avoided. For example, when the node G senses the link failure between the node H and the node A and performs route convergence, the primary route of the node G to the node X includes the out interface (i.e. the primary out interface) of the node G connected to the node F. However, the node F has not adjusted the primary route to the node X, and the primary route includes the out interface (i.e. the primary out interface) of the node F connected to the node G. According to the forced horizontal split forwarding, the message (to the node X) forwarding loop between the node G and the node F can be avoided.
[0063] After the node F and the node E receive the message, the local FIB forwarding table is queried to obtain the forwarding table item for forwarding the message. If it is found that the interface indicated by the primary out interface identifier in the forwarding table item is the same as the interface receiving the message, the message is forwarded through the interface indicated by the backup out interface identifier in the forwarding table item according to the processing manner of the node G, as shown in FIG. 8.
[0064] After the node D receives the message, the local FIB forwarding table is queried to obtain the forwarding table item for forwarding the message. The node D finds that the interface indicated by the primary out interface identifier in the forwarding table item is different from the interface receiving the message, and the primary route is currently a reachable route, and then the message is forwarded through the interface (i.e. the interface of the node D connected to the node C) indicated by the primary out interface identifier in the forwarding table item (this can be referred to as normal forwarding at this time). The processing manner of the node C and the node B is similar to that of the node D. Finally, the underlay message from the node Y is forwarded to the node X.
[0065] According to the same principle, for a multi-ring network such as shown in FIG. 9, the message forwarding loop can also be avoided according to the forced horizontal split forwarding. For example, in FIG. 9, after the node D receives the message, the local FIB forwarding table is queried to obtain the forwarding table item for forwarding the message. When the node D finds that the primary route is currently an unreachable route, the message is forwarded through the interface (i.e. the interface of the node D connected to the node E) indicated by the backup out interface identifier in the forwarding table item. After the node E receives the message, the local FIB forwarding table is queried to obtain the forwarding table item for forwarding the message. If it is found that the interface indicated by the primary out interface identifier in the forwarding table item is the same as the interface receiving the message, the message is forwarded through the interface indicated by the backup out interface identifier in the forwarding table item based on the forced horizontal split forwarding. The node P and the node O will also forward the message through the interface indicated by the backup out interface identifier in the forwarding table item based on the forced horizontal split forwarding. The node N, the node M and the node L forward the message in a manner similar to the normal forwarding. Finally, the underlay message from the node Y is forwarded to the node X.
[0066] In the manner as described above, the ring network protection can be implemented, so that the 10 millisecond level fast recovery can be realized by software such as CPU, etc., the sub-millisecond level, hundred-microsecond level or faster fast recovery can be realized by hardware such as hardware forwarding chip, etc., the ring network protection requirement of the ring network is met. The method is applicable to pure IPv4 and IPv6, and does not depend on the technically complex MPLS SR and SRv6, and TI-LFA technology, is simple to implement, has strong applicability, is easy to implement on the network device which is difficult to support the complex technologies such as MPLS SR TI-LFA, SRv6 TI-LFA but hopes to have the ring network fast switching capability, and also avoids the deployment and operation complexity of the TI-LFA technology.
[0067] The method provided by the embodiments of the present application is described above. The device provided by the embodiments of the present application is described below:
[0068] Referring to FIG. 10, FIG. 10 is a device structure diagram provided by the embodiments of the present application. The device is applied to any node in the ring network, as shown in FIG. 10, the device includes:
[0069] The receiving unit is configured to receive a packet.
[0070] The processing unit is configured to find a forwarding table entry for forwarding the packet in a local forwarding table. The forwarding table entry includes a primary out-interface identifier and a backup out-interface identifier. The primary out-interface identifier indicates a first ring network interface on the node on which the ring network protection function is enabled, and the backup out-interface identifier indicates a second ring network interface on the node on which the ring network protection function is enabled. The first ring network interface is different from the second ring network interface.
[0071] If the incoming interface of the packet is the same as the first ring network interface indicated by the primary out-interface identifier, the packet is forwarded through the second ring network interface indicated by the backup out-interface identifier.
[0072] Optionally, the processing unit is further configured to: start a ring network protection function for the local ring network interface; determine a first optimal route from the local node to the destination node according to a shortest path first algorithm; if an out interface included in the first optimal route is a first ring network interface on the local node for which the ring network protection function has been started, take the first optimal route as a primary route from the local node to the destination node, and take the first ring network interface as a primary out interface included in the primary route; select a second optimal route from the local node to the destination node from remaining routes other than the primary route according to the shortest path first algorithm; if an out interface included in the second optimal route is a second ring network interface on the local node for which the ring network protection function has been started, take the second optimal route as a backup route of the primary route, and take the second ring network interface as a backup out interface included in the backup route; and record a forwarding table entry containing at least an identifier of the primary out interface and an identifier of the backup out interface in the local forwarding table.
[0073] Optionally, the determining of the first optimal route from the local node to the destination node according to the shortest path first algorithm specifically comprises: determining the first optimal route according to the shortest path first algorithm based on a topology relationship between nodes in a network recorded in a link state library.
[0074] The selecting of the second optimal route from the remaining routes other than the primary route according to the shortest path first algorithm specifically comprises: determining the second optimal route according to the shortest path first algorithm based on a remaining topology relationship recorded in the link state library.
[0075] The remaining topology relationship is a topology relationship other than a link connected to the primary out interface included in the primary route in the link state library.
[0076] If the out interface of the second optimal route is not any ring network interface on the local node for which the ring network protection function has been started, the processing unit is further configured to: output an alarm information to indicate that there is an abnormality in the ring network currently through the alarm information.
[0077] Optionally, the primary out interface identifier is an identifier of a primary out interface included in a primary route used to forward the packet. If an in interface of the packet is different from the first ring network interface indicated by the primary out interface identifier, the processing unit is further configured to: when the primary route is currently a reachable route, forward the packet through the first ring network interface indicated by the primary out interface identifier.
[0078] Optionally, the primary out-interface identifier refers to an identifier of a primary out-interface included in a primary route for forwarding the packet; and the backup out-interface identifier refers to an identifier of a primary out-interface included in a backup route for forwarding the packet. If the in-interface of the packet is different from the first ring network interface indicated by the primary out-interface identifier, the processing unit is further configured to: when the primary route is currently an unreachable route, forwarding the packet through the second ring network interface indicated by the backup out-interface identifier.
[0079] So far, the structural description of the apparatus shown in FIG. 10 is completed.
[0080] The embodiment of the present application further provides a hardware structural description of the apparatus shown in FIG. 10. As shown in FIG. 11, the hardware structure can include a processor and a machine readable storage medium.
[0081] The machine readable storage medium stores computer instructions, and the computer instructions are executed by the processor to perform the steps in the above method.
[0082] Based on the same application concept as the above method, the embodiment of the present application further provides a machine readable storage medium, and the machine readable storage medium stores a plurality of computer instructions, and the computer instructions are executed by a processor to implement the method disclosed in the above examples of the present application.
[0083] For example, the machine readable storage medium can be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard disk drive), a solid state disk, any type of storage disk (such as an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
[0084] For the convenience of description, the above apparatus is described in various units in terms of functions. Of course, the functions of the units can be implemented in one or more software and / or hardware in the implementation of the present application.
[0085] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can adopt a computer program product in the form of being implemented on one or more computer readable storage media (including but not limited to a disk memory, a CD-ROM, an optical memory, etc.) containing computer readable program code.
[0086] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart and / or block diagram block or blocks.
[0087] Also, these computer program instructions can be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and / or block diagram block or blocks.
[0088] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart and / or block diagram block or blocks.
[0089] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. A packet forwarding method, characterized by, The method is applied to any node in a ring network, and the method comprises: receiving a packet; finding a forwarding table entry for forwarding the packet in a local forwarding table; the forwarding table entry comprises: a primary outgoing interface identifier and a backup outgoing interface identifier; the primary outgoing interface identifier indicates a first ring network interface on the node on which a ring network protection function is enabled, and the backup outgoing interface identifier indicates a second ring network interface on the node on which the ring network protection function is enabled; the first ring network interface is different from the second ring network interface; if an incoming interface of the packet is the same as the first ring network interface indicated by the primary outgoing interface identifier, forwarding the packet through the second ring network interface indicated by the backup outgoing interface identifier.
2. The method of claim 1, wherein, Before the receiving of the packet, the method further comprises: enabling a ring network protection function for a local ring network interface; determining a first optimal route from the node to a destination node according to a shortest path first algorithm; if an outgoing interface included in the first optimal route is a first ring network interface on the node on which the ring network protection function has been enabled, taking the first optimal route as a primary route from the node to the destination node, and taking the first ring network interface as a primary outgoing interface included in the primary route; selecting a second optimal route from the node to the destination node from remaining routes other than the primary route according to the shortest path first algorithm; if an outgoing interface included in the second optimal route is a second ring network interface on the node on which the ring network protection function has been enabled, taking the second optimal route as a backup route of the primary route, and taking the second ring network interface as a backup outgoing interface included in the backup route; recording a forwarding table entry containing at least the identifier of the primary outgoing interface and the identifier of the backup outgoing interface in the local forwarding table.
3. The method of claim 2, wherein, The determining of the first optimal route from the node to the destination node according to the shortest path first algorithm specifically comprises: determining the first optimal route according to the shortest path first algorithm based on a topology relationship between nodes in a network recorded in a link state library; The selecting of the second optimal route from the remaining routes other than the primary route according to the shortest path first algorithm specifically comprises: determining the second optimal route according to the shortest path first algorithm based on a remaining topology relationship recorded in the link state library; The remaining topology relationship is a topology relationship other than a link connected to the primary outgoing interface included in the primary route in the link state library. The method further comprises:
4. The method of claim 2, wherein, if the outgoing interface of the second optimal route is not any ring network interface on the node on which the ring network protection function has been enabled, outputting an alarm information to indicate that there is an abnormality in the ring network currently through the alarm information. The primary outgoing interface identifier is an identifier of a primary outgoing interface included in a primary route for forwarding the packet; 5. The method of claim 1, wherein, The method further comprises: if the incoming interface of the packet is different from the first ring network interface indicated by the primary outgoing interface identifier, forwarding the packet through the first ring network interface indicated by the primary outgoing interface identifier when the primary route is a reachable route currently. 6. The method of claim 1, wherein, The main-out interface identifier is an identifier of a main-out interface included in a main route used for forwarding the message; and the backup-out interface identifier is an identifier of a main-out interface included in a backup route used for forwarding the message. The method further includes: If an incoming interface of the message is different from the first ring network interface indicated by the main-out interface identifier, the message is forwarded through the second ring network interface indicated by the backup-out interface identifier when the main route is currently an unreachable route.
7. A packet forwarding device, characterized by, The device is applied to any node in a ring network, and the device includes: a receiving unit configured to receive a message; a processing unit configured to find a forwarding table entry used for forwarding the message in a local forwarding table; the forwarding table entry includes a main-out interface identifier and a backup-out interface identifier; the main-out interface identifier indicates a first ring network interface on the node on which a ring network protection function is enabled; the backup-out interface identifier indicates a second ring network interface on the node on which the ring network protection function is enabled; the first ring network interface is different from the second ring network interface; and If an incoming interface of the message is the same as the first ring network interface indicated by the main-out interface identifier, the message is forwarded through the second ring network interface indicated by the backup-out interface identifier.
8. The apparatus of claim 7, wherein, The processing unit is further configured to: enable the ring network protection function for a local ring network interface; determine a first optimal route from the local node to a destination node according to a shortest route first algorithm; if an outgoing interface included in the first optimal route is the first ring network interface on the local node on which the ring network protection function is enabled, take the first optimal route as a main route from the local node to the destination node, and take the first ring network interface as a main-out interface included in the main route; select a second optimal route from the local node to the destination node from remaining routes other than the main route according to the shortest route first algorithm; if an outgoing interface included in the second optimal route is a second ring network interface on the local node on which the ring network protection function is enabled, take the second optimal route as a backup route of the main route, and take the second ring network interface as a backup-out interface included in the backup route; record a forwarding table entry including at least the identifier of the main-out interface and the identifier of the backup-out interface in the local forwarding table.
9. The apparatus of claim 8, wherein, The determination of the first optimal route from the local node to the destination node according to the shortest route first algorithm specifically includes: determine the first optimal route according to the shortest route first algorithm based on a topology relationship between nodes in networking recorded in a link state library; The selection of the second optimal route from the remaining routes other than the main route according to the shortest route first algorithm specifically includes: determine the second optimal route according to the shortest route first algorithm based on a remaining topology relationship recorded in the link state library; The remaining topology relationship is a topology relationship other than a link connected to the main-out interface included in the main route in the link state library.
10. The apparatus of claim 8, wherein, If the outgoing interface of the second optimal route is not any ring network interface on the local node on which the ring network protection function is enabled, the processing unit is further configured to: Output an alarm information to indicate that the ring network currently exists an exception through the alarm information.
11. The apparatus of claim 7, wherein, The main out interface identifier refers to an identifier of a main out interface included in a main route for forwarding the message; If the received in interface of the message is different from the first ring network interface indicated by the main out interface identifier, the processing unit is further configured to: When the main route is currently a reachable route, forwarding the message through the first ring network interface indicated by the main out interface identifier.
12. The apparatus of claim 7, wherein, The main out interface identifier refers to an identifier of a main out interface included in a main route for forwarding the message; and the backup out interface identifier refers to an identifier of a main out interface included in a backup route for forwarding the message. If the received in interface of the message is different from the first ring network interface indicated by the main out interface identifier, the processing unit is further configured to: When the main route is currently an unreachable route, forwarding the message through the second ring network interface indicated by the backup out interface identifier.
13. An electronic device, comprising: The electronic device comprises: a processor and a machine readable storage medium; The machine readable storage medium stores computer instructions, and the computer instructions are executed by the processor to perform the steps in any one of claims 1 to 6.