Packet processing method and related apparatus
By having network devices announce link status to each other and select the path with better status to transmit data in dual-homed protection scenarios, the problem of service interruption caused by path abnormalities in dual-homed protection scenarios is solved, and best-effort data transmission is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2026-04-02
AI Technical Summary
In a dual-homed protection scenario, when both the primary and backup paths fail, network devices in the bearer network cannot continue to forward service data, resulting in service interruption.
The first and second network devices communicate with each other about the link status on different paths to the same destination address, specifically whether it is in a normal state, a performance degradation state, or an interrupted state. The target forwarding path is determined based on the link status to ensure that data can still be transmitted through the link in the performance degradation state when all paths are abnormal.
It achieves best-effort forwarding of business data, avoids business interruption, and improves the accuracy of network devices' path selection decisions and the quality of data transmission.
Smart Images

Figure CN2025104360_02042026_PF_FP_ABST
Abstract
Description
A message processing method and related device
[0001] The present application claims priority from the Chinese patent application No. 202411393396.0 filed on September 29, 2024, and entitled "A message processing method and related device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the field of communication technology, and in particular to a message processing method and related device. BACKGROUND
[0003] In the field of communication technology, a bearer network is a network used for transmitting service data, and a large number of network devices are usually deployed in the bearer network. The network devices in the bearer network perform data forwarding according to pre-deployed routes, thereby realizing the transmission of service data in the bearer network.
[0004] In order to ensure the reliability of data transmission, the network devices in the bearer network can perceive the abnormality of the data forwarding path, thereby quickly switching the data flow from the abnormal path to the normal path to reduce the service interruption time. For example, in a Layer 3 virtual private network (L3VPN), by using the fast reroute (FRR) technology, a backup path can be established for the main path, and when the main path is abnormal, the data flow can be quickly switched to the backup path, thereby realizing dual-homing protection.
[0005] However, in the dual-homing protection scenario, when both the main path and the backup path are abnormal, the network devices in the bearer network usually do not continue to forward service data, thereby causing service interruption. SUMMARY
[0006] The present application provides a message processing method, which realizes the best-effort forwarding of service data and avoids service interruption.
[0007] In a first aspect, a message processing method is provided, applied to a first network device. The message processing method comprises: sending, by the first network device, a first state advertisement message to a second network device. The first state advertisement message comprises a target address and a first state, and the first state advertisement message is used to indicate that the state of a first link is the first state, the first link is a link connected to the first network device on a first path, the first path is a path from the first network device to the target address, and the first path does not include the second network device.
[0008] The first network device receives a second state advertisement message sent by the second network device, the second state advertisement message including a target address and a second state, the second state advertisement message being used to indicate that the state of a second link is the second state, the second link being a link connected to the second network device on a second path, the second path being a path from the second network device to the target address, and the second path not including the first network device.
[0009] The first state and the second state are used by the first network device to determine a target forwarding path of a message with the target address on the first path and the second path. The first state and the second state are one of a normal state, a performance degradation state, or an interruption state, and a link in the performance degradation state has a transmission performance worse than a link in the normal state.
[0010] In this solution, for the first network device and the second network device in a dual-homing protection scenario, the first network device and the second network device mutually advertise the states of links on different paths to the same target address, and the state of a link is one of a normal state, a performance degradation state, and an interruption state, so that the network device can determine to use a path with the best state to transmit data according to the states of links on different paths, and ensure that the network device can make a decision according to more link states when selecting a path. In addition, the abnormal state of a link is specifically divided into a performance degradation state that can still transmit data and an interruption state that cannot transmit data, so that when the links on the two paths are abnormal, the first network device can still transmit data through the link in the performance degradation state, thereby realizing best-effort forwarding of service data and avoiding service interruption.
[0011] In a possible implementation, the first state advertisement message and the second state advertisement message are extended Multi-Protocol Label Switching (MPLS) messages or extended Internet Control Message Protocol (ICMP) messages.
[0012] That is, the first state advertisement message and the second state advertisement message can be obtained by extending existing MPLS messages or ICMP messages, so as to realize advertisement of the state of a link based on existing messages and reduce modification of existing technologies.
[0013] In a possible implementation, the first state advertisement message carries the target address and the first state through an extension field, and the second state advertisement message carries the target address and the second state through an extension field. For example, an extension field is added to an MPLS message or an ICMP message, and the added extension field is used to carry the target address and the first state, so as to obtain the first state advertisement message.
[0014] In a possible implementation, the first path and the second path are L3VPN paths, and the first state notification message and the second state notification message further comprise an L3VPN private network label, the L3VPN private network label being used to indicate an L3VPN to which the target address belongs.
[0015] In a possible implementation, the forwarding priority of the path comprising the link in the normal state is higher than that of the path comprising the link in the performance degradation state, and the forwarding priority of the path comprising the link in the performance degradation state is higher than that of the path comprising the link in the interruption state. Therefore, based on the state of the first link and the state of the second link, the first network device can determine the forwarding priorities of the first path comprising the first link and the second path comprising the second link respectively.
[0016] The message processing method further comprises: determining, by the first network device, a path with the highest forwarding priority as a target forwarding path based on the first state and the second state.
[0017] In this scheme, the forwarding priority of a path is defined based on the state of a link on the path, which can enable the network device to preferentially select a path with a better state when selecting a forwarding path, thereby ensuring the quality of message forwarding and improving the realizability of the scheme.
[0018] In a possible implementation, the first path is a primary path, and the second path is a backup path. When the forwarding priorities of the first path and the second path are the same, the first network device determines the first path as the target forwarding path.
[0019] In a possible implementation, the message processing method further comprises: receiving, by the first network device, a first message, the destination address of the first message being the same as the target address.
[0020] In a case where the target forwarding path is the first path, the first network device forwards the first message to a third network device on the first path; or in a case where the target forwarding path is the second path, the first network device forwards the first message to the second network device.
[0021] In a possible implementation, the first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path.
[0022] Then, after the state of the second link changes from the normal state to the interruption state, the first network device receives a third state notification message sent by the second network device, the third state notification message being used to indicate that the state of the second link is the interruption state. Then, the first network device switches the target forwarding path from the second path to the first path.
[0023] That is, when the state of the link on the path changes, the forwarding priority of the path also changes, which may cause the size relationship between the forwarding priorities of the two paths to change, and thus the forwarding path determined by the network device may also change.
[0024] In a possible implementation, the first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path. After obtaining the first state and the second state, the first network device stops sending Bidirectional Forwarding Detection (BFD) packets to the destination network device, to instruct the destination network device to send packets through the second path. The address of the destination network device is the target address.
[0025] In this scheme, in order to ensure that the forwarding paths of the uplink packet and the downlink packet are the same, the network devices implement route linkage based on Bidirectional Forwarding Detection (BFD), thereby ensuring that the packet going to the destination network device and the packet coming from the destination network device maintain the same forwarding path as much as possible.
[0026] In a possible implementation, the first network device receives a notification message sent by the third network device, and the notification message is used to indicate that the data received by the third network device through the first link does not meet a preset performance requirement. Based on the notification message, the first network device determines that the first state is a performance degradation state.
[0027] That is, the first network device can determine the state of the first link by receiving the notification message sent by other network devices on the first link, thereby ensuring the diversification of the manner in which the first network device obtains the state of the first link.
[0028] In a second aspect, a packet processing apparatus is provided. The packet processing apparatus is deployed on a first network device, and includes: a sending module configured to send a first state advertisement packet to a second network device, the first state advertisement packet including a destination address and a first state, the first state advertisement packet being used to indicate that a first link is in the first state, the first link being a link connected to the first network device on a first path, the first path being a path from the first network device to the destination address, and the first path not including the second network device; and a receiving module configured to receive a second state advertisement packet sent by the second network device, the second state advertisement packet including the destination address and a second state, the second state advertisement packet being used to indicate that a second link is in the second state, the second link being a link connected to the second network device on a second path, the second path being a path from the second network device to the destination address, and the second path not including the first network device; wherein the first state and the second state are used by the first network device to determine a target forwarding path of a packet with the destination address in the first path and the second path, and the first state and the second state are one of a normal state, a performance degradation state, and an interruption state, and a link in the performance degradation state has a transmission performance worse than a link in the normal state.
[0029] In a possible implementation, the first state advertisement packet and the second state advertisement packet are extended MPLS packets or extended ICMP packets.
[0030] In a possible implementation, the first state advertisement packet carries the destination address and the first state through an extension field, and the second state advertisement packet carries the destination address and the second state through an extension field.
[0031] In a possible implementation, the first path and the second path are L3VPN paths, and the first state advertisement packet and the second state advertisement packet further include an L3VPN private network label, the L3VPN private network label being used to indicate an L3VPN to which the destination address belongs.
[0032] In a possible implementation, a path including a link in the normal state has a higher forwarding priority than a path including a link in the performance degradation state, and the path including the link in the performance degradation state has a higher forwarding priority than a path including a link in the interruption state. The packet processing apparatus further includes a processing module configured to determine, according to the first state and the second state, a path with the highest forwarding priority as the target forwarding path in the first path and the second path.
[0033] In a possible implementation, the first path is a primary path, and the second path is a backup path. The processing module is further configured to determine the first path as the target forwarding path when the first path and the second path have the same forwarding priority.
[0034] In a possible implementation, the receiving module is further configured to receive a first packet, the destination address of the first packet being the same as the target address; the sending module is further configured to, in a case where the target forwarding path is the first path, forward the first packet to a third network device on the first path; or the sending module is further configured to, in a case where the target forwarding path is the second path, forward the first packet to the second network device.
[0035] In a possible implementation, the first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path; the receiving module is further configured to, after the state of the second link changes from the normal state to the interruption state, receive a third state advertisement packet sent by the second network device, the third state advertisement packet being used to indicate that the state of the second link is the interruption state; and the packet processing apparatus further includes a processing module configured to switch the target forwarding path from the second path to the first path.
[0036] In a possible implementation, the first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path; the sending module is further configured to stop sending the BFD packet to the destination network device, so as to instruct the destination network device to send the packet through the second path; and the address of the destination network device is the target address.
[0037] In a possible implementation, the receiving module is further configured to receive a notification message sent by the third network device, the notification message being used to indicate that data received by the third network device through the first link does not meet a preset performance requirement; and the packet processing apparatus further includes a processing module configured to determine, based on the notification message, that the first state is the performance degradation state.
[0038] The third aspect of the present application provides a network device including a processor and a memory. The memory is configured to store program code, and the processor is configured to invoke the program code in the memory to enable the network device to perform the method according to any of the implementation modes of the first aspect.
[0039] The fourth aspect of the present application provides a computer readable storage medium storing instructions, which, when executed on a computer, enable the computer to perform the method according to any of the implementation modes of the first aspect.
[0040] The fifth aspect of the present application provides a computer program product, which, when executed on a computer, enables the computer to perform the method according to any of the implementation modes of the first aspect.
[0041] The sixth aspect of the present application provides a chip comprising one or more processors. Part or all of the processors are configured to read and execute computer instructions stored in a memory to perform the method in any possible implementation of any of the above aspects. Optionally, the chip further comprises the memory. Optionally, the chip further comprises a communication interface, and the processor is connected with the communication interface. The communication interface is configured to receive data and / or information to be processed, and the processor obtains the data and / or information from the communication interface, processes the data and / or information, and outputs the processing result through the communication interface. Optionally, the communication interface is an input / output interface or a bus interface. The method provided by the present application is implemented by one chip or by multiple chips in cooperation.
[0042] The solutions provided by the second aspect to the sixth aspect above are used to implement or cooperate to implement the method provided by the first aspect, and thus can achieve the same or corresponding beneficial effects as the first aspect. Therefore, no further description is given here. BRIEF DESCRIPTION OF DRAWINGS
[0043] FIG. 1 is a schematic diagram of a dual-homing protection scenario in the related art;
[0044] FIG. 2 is a flowchart of a packet processing method provided by an embodiment of the present application;
[0045] FIG. 3 is a schematic diagram of a format of an MPLS Ping packet provided by an embodiment of the present application;
[0046] FIG. 4 is a schematic diagram of a format of an ICMP packet provided by an embodiment of the present application;
[0047] FIG. 5 is a schematic diagram of forwarding packets when two links are in a performance degradation state and a normal state, respectively, provided by an embodiment of the present application;
[0048] FIG. 6 is a schematic diagram of forwarding packets when two paths are in a performance degradation state and a failure state, respectively, provided by an embodiment of the present application;
[0049] FIG. 7 is a schematic diagram of forwarding packets when both of two paths are in a performance degradation state, provided by an embodiment of the present application;
[0050] FIG. 8 is a schematic diagram of determining a packet forwarding path based on BFD linkage provided by an embodiment of the present application;
[0051] FIG. 9 is a schematic diagram of determining a forwarding path by a PE based on a path state between the PE and a core device, provided by an embodiment of the present application;
[0052] FIG. 10 is a schematic diagram of same-side multi-point abnormality in a square-shaped dual-homing scenario, provided by an embodiment of the present application;
[0053] FIG. 11 is a schematic diagram of a mouth-shaped dual-homing scenario abnormality of different sides according to an embodiment of the present application;
[0054] FIG. 12 is a schematic diagram of a structure of a packet processing device according to an embodiment of the present application;
[0055] FIG. 13 is a schematic diagram of a structure of a network device according to an embodiment of the present application. DETAILED DESCRIPTION
[0056] The embodiments of the present application will be described below in conjunction with the accompanying drawings. It is obvious that the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. It is obvious for those skilled in the art that, with the development of technology and the appearance of new scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0057] The terms "first", "second", and the like in the specification and claims of the present application and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. The term "at least one" in the embodiments of the present application means one or more, and the term "multiple" means two or two or more.
[0058] The term "exemplary" herein means "serving as an example, an implementation, or an illustration". Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
[0059] Referring to FIG. 1, FIG. 1 is a schematic diagram of a dual-homing protection scenario in the related art. As shown in FIG. 1, in the dual-homing protection scenario, a provider edge (PE) 1 and a PE 2 are configured as dual-homing devices, and a path 1 between the PE 1 and a core device and a path 2 between the PE 2 and the core device can constitute a primary and backup path. For example, on the PE 1, the path 1 is configured as the primary path, and the path 2 is configured as the backup path. Generally, when the primary path (i.e., the path 1) is abnormal, the PE 1 can forward a packet to the PE 2, and the PE 2 forwards the packet to the core device through the backup path (i.e., the path 2). However, if both the primary path and the backup path are abnormal, after the PE 1 forwards the packet to the PE 2, since the PE 2 senses that the path 2 is abnormal, the PE 2 continues to forward the packet to the PE 1, so that the packet is always forwarded between the PE 1 and the PE 2, forming a routing loop.
[0060] However, the applicant finds that the path abnormality actually includes two cases: one case is that the path is interrupted (such as port failure or link interruption); the other case is that the data transmitted on the path is in performance degradation (such as the data transmitted on the path is in error code, packet loss or large delay). Among them, the error code means that the transmitted data is in error in the optical transmission process. For example, in optical communication between both sides, assuming that the data transmitted by the data sender is 1010, and the data received by the data receiver is 1011, then the last digit 1 is the error digit (which should be 0), that is, the data transmission is in error code. Packet loss means that the data packet is lost in the transmission process and cannot be normally transmitted to the destination.
[0061] In the case of path interruption, the network device cannot continue to transmit data through the path. However, in the case of performance degradation of data transmitted on the path, the network device can actually continue to transmit data through the path, but the transmission quality of the data is degraded.
[0062] However, in the related art, as long as the network device finds that the path used by itself is abnormal, the data is switched to another path for forwarding, so that when both paths are abnormal, the transmission of the data cannot be realized, resulting in service interruption.
[0063] Therefore, the present application provides a packet processing method. The first network device and the second network device in the dual-homing protection scenario mutually advertise the states of the links on different paths to the same destination address, and the state of the link is one of the normal state, the performance degradation state and the interruption state, so that the network device can determine to use the path with the best state to transmit data according to the state of the different links. Moreover, the abnormal state of the link is specifically divided into the performance degradation state which can still transmit data and the interruption state which cannot transmit data, so as to ensure that when the links on both paths are abnormal, the first network device can still transmit data through the link in the performance degradation state, thereby realizing the best-effort forwarding of service data and avoiding service interruption.
[0064] Please refer to FIG. 2, which is a flowchart of a packet processing method provided by an embodiment of the present application. As shown in FIG. 2, the packet processing method includes the following steps 201-205.
[0065] Step 201, the first network device sends a first state advertisement packet to the second network device, the first state advertisement packet including a target address and a first state, the first state advertisement packet being used to indicate that the state of the first link is the first state, the first link being a link connected to the first network device on the first path, the first path being a path from the first network device to the target address, and the first path not including the second network device.
[0066] In the present application, the first network device and the second network device are configured as dual-homing devices, so that a message in the network can reach a target address through different paths, such as a path from the first network device to the target address and a path from the second network device to the target address.
[0067] Among them, the path from the first network device to the target address is the first path, and the path from the second network device to the target address is the second path. Since the first network device and the second network device are configured as dual-homing devices, the second network device is not included in the first path, and the first network device is not included in the second path. Assuming that the network device with the address as the target address is a destination network device, then the path between the first network device and the destination network device is the first path, and the path between the second network device and the destination network device is the second path.
[0068] For the first network device, since the first network device is on the first path, the first network device can perceive the state of the first link connected to the first network device on the first path, and therefore the first network device can notify the second network device of the perceived state of the first link (i.e., the first state) through a first state advertisement message including the target address and the first state, so that the second network device can learn the state of the first link. Based on the target address in the first state advertisement message, the second network device can determine that the first state actually indicates the state of the first link connected to the first network device on the first path from the first network device to the target address.
[0069] It should be noted that the first path can include one or more links. In the case where other network devices are connected between the first network device and the destination network device, the first path includes the first link and other links; in the case where no other network devices are connected between the first network device and the destination network device (i.e., the first network device and the destination network device are directly connected), the first path only includes the first link.
[0070] In addition, the first link can be a physical link connected to the first network device, or a virtual private network (VPN) tunnel connected to the first network device (i.e., the first link includes one or more physical links constituting the VPN tunnel), which is not limited in the present application.
[0071] The first network device can perceive the state of the first link in various manners. For example, assuming that the first network device is connected to one side of the first link, the first network device and a network device connected to the other side of the first link can be deployed with a link detection protocol, so that the first network device and the network device connected to the other side of the first link can periodically send messages to each other, and determine the state of the first link by monitoring the reception of the messages. For example, when the first network device can normally and periodically receive the messages sent by the network device connected to the other side of the first link, the first network device determines that the first link is in a normal state; when the messages received by the first network device have errors, are lost, or have high latency, the first network device determines that the first link is in a performance state; and when the first network device cannot normally receive the messages sent by the other network device, the first network device determines that the first link is in an interruption state.
[0072] For another example, the first network device can obtain the state of the first path by monitoring the state of a port on the first network device connected to the other network devices on the first path (e.g., whether the port is in a down state).
[0073] For yet another example, the first network device can determine the state of the first link by receiving a notification message actively sent by the other network device on the first link. For example, the first network device receives a notification message sent by the third network device, and the notification message indicates that data received by the third network device through the first link does not meet a preset performance requirement. Based on the notification message, the first network device determines that the first state is a performance degradation state. The data received through the first link does not meet the preset performance requirement can mean that the error rate of the data is greater than or equal to a preset error rate, or the packet loss rate of the data is greater than or equal to a preset packet loss rate, or the latency of the received data is greater than or equal to a preset latency.
[0074] In general, the first network device can determine the state of the first path based on the state of the port of the network device on the first path and the state of the link on the first path, and the application does not limit the manner in which the first network device perceives the state of the first path.
[0075] Optionally, the first state advertisement message specifically includes a target address, a mask, and the first state. The target address and the mask can constitute a routing prefix, and the target address is specifically a destination Internet Protocol (IP) address. For example, as a possible example, the routing prefix can be specifically 192.168.1.0 / 24.
[0076] Optionally, in the case that the first network device and the second network device belong to network devices in a Layer 3 virtual private network (L3VPN), the first state notification message further includes an L3VPN private network label, which is used to indicate the L3VPN to which the target address belongs. In this way, based on the L3VPN private network label in the first state notification message, the second network device can uniquely match the corresponding L3VPN, and then match the destination address or the routing prefix stored in the second network device through the target address or the routing prefix in the first state notification message in the L3VPN, so that the second network device can determine that the path indicated in the first state notification message is the first path.
[0077] In step 202, the first network device receives a second state notification message sent by the second network device, the second state notification message including a target address and a second state, the second state notification message being used to indicate that the state of a second link is the second state, the second link being a link connected by the second network device on a second path, the second path being a path from the second network device to the target address, and the second path not including the first network device.
[0078] Similarly, for the second network device, since the second network device is on the second path, the second network device can also perceive the state of the second link connected by the second network device on the second path. Therefore, the second network device also notifies the perceived state (i.e., the second state) of the second link to the first network device through the second state notification message, so that the first network device can learn the state of the second link on the second path.
[0079] The first link can be a physical link connected by the second network device, or a VPN tunnel connected by the second network device (i.e., the second link includes one or more physical links constituting the VPN tunnel), which is not limited in the present application.
[0080] In the present application, the first state and the second state are used by the first network device to determine the target forwarding path of a packet with the target address on the first path and the second path. The first state and the second state are one of a normal state, a performance degradation state, or an interruption state. The normal state is used to indicate that the path is normal and can normally transmit data. The performance degradation state is used to indicate that the data transmitted on the path has performance degradation (such as the case that the data transmitted on the path has errors, packet loss, or large delay). Therefore, the transmission performance of the link in the performance degradation state is worse than that of the link in the normal state. The interruption state is used to indicate that the link is interrupted (such as the interruption of the link itself or the failure of the port of the network device connected by the link), and cannot continue to transmit data.
[0081] In general, by sending information to each other to announce the status of the path where the first network device and the second network device are located, the first network device and the second network device can learn the status of the path where the other party is located, and then learn the status of the two paths (i.e., the first path and the second path) to the destination address at the same time.
[0082] In step 203, the first network device determines to forward the packet whose destination address is the same as the target address through the target forwarding path, which is one of the first path and the second path, according to the first status and the second status.
[0083] After obtaining the first status corresponding to the first link on the first path and the second status corresponding to the second link on the second path, the first network device can select one path from the first path and the second path as the target forwarding path by comparing the two statuses, so as to subsequently forward the packet whose destination address is the target address through the target forwarding path.
[0084] Specifically, the first network device can select a path with the best status from the first path and the second path as the target forwarding path, so as to ensure the quality of forwarding the packet based on the target forwarding path.
[0085] Optionally, in the case where the first network device and the second network device implement the forwarding path switching through FRR, the first network device can be an FRR enabled FRR state machine. The FRR state machine is used to record the switching state of the FRR, i.e., the path required by the first network device to forward the packet to the target address. The first status corresponding to the first link and the second status corresponding to the second link can be input to the FRR state machine, and the FRR state machine arbitrates based on the statuses of the two links to determine which path to use to perform packet forwarding, and then records the switching state of the FRR on the FRR state machine.
[0086] In step 204, the first network device receives a first packet, and the destination address of the first packet is the same as the target address.
[0087] In this step, the first packet is received after the first network device has determined to use the target forwarding path to forward the packet to the target address. Moreover, the destination address of the first packet is the same as the target address, i.e., the first packet is a packet to the target address. Therefore, based on the determined target forwarding path, the first network device can forward the first packet.
[0088] In step 205, the first network device forwards the first packet to the target forwarding path.
[0089] Based on the target forwarding path determined by the first state and the second state, the first network device forwards the received first packet to the target forwarding path, so that the first packet can be forwarded to the destination address through the target forwarding path.
[0090] For example, in the case that the target forwarding path is the first path, the first network device forwards the first packet to a third network device on the first path. The third network device is a next-hop device of the first network device on the first path, and the first network device forwards the first packet to the first path by forwarding the first packet to the third network device. The third network device may, for example, be the destination network device of the first packet (i.e., the address of the third network device is the target address of the first packet); or the third network device may be a network device between the first network device and the destination network device of the first packet, which is not limited herein.
[0091] Alternatively, in the case that the target forwarding path is the second path, the first network device forwards the first packet to the second network device, and the second network device continues to forward the first packet.
[0092] It should be noted that the above describes the process of determining the target forwarding path of the first network device for forwarding the packet based on the first state and the second state. In actual application, the second network device can also determine the target forwarding path of the packet based on the obtained first state and second state, so that the first network device and the second network device can reach a unified message forwarding, and avoid the continuous forwarding of the packet between the first network device and the second network device.
[0093] For ease of understanding, how to implement state advertisement through the first state advertisement packet and the second state advertisement packet will be described in detail below.
[0094] For example, the first state advertisement packet and the second state advertisement packet can be extended Multi-Protocol Label Switching (MPLS) packets or extended Internet Control Message Protocol (ICMP) packets. That is, the first state advertisement packet and the second state advertisement packet can be obtained by extending the existing MPLS packet or ICMP packet, so as to realize the state advertisement of the link based on the existing packet, and reduce the modification of the existing technology.
[0095] Of course, in addition to extending the MPLS packet and the ICMP packet, the first state advertisement packet and the second state advertisement packet can also be obtained by extending other types of packets, which are not limited herein.
[0096] Optionally, the first state notification message carries the target address and the first state through an extension field. The second state notification message carries the target address and the second state through an extension field. For example, the first state notification message is obtained by adding an extension field in an MPLS message or an ICMP message, and the added extension field is used to carry the target address and the first state.
[0097] Of course, in addition to carrying the target address and the first state through the extension field, the first state notification message can also be obtained by adding the function of some original fields in the message to carry the target address and the first state through the original fields in the message. Similarly, the second state notification message can also be obtained by adding the function of some original fields in the message to carry the target address and the second state through the original fields in the message. For example, the first state notification message can be obtained by carrying the target address and the first state through the original reserved field in the message, and the present application does not make a specific limitation in this regard.
[0098] Exemplarily, refer to FIG. 3, which is a format diagram of an MPLS Ping message provided by an embodiment of the present application. As shown in FIG. 3, the present application extends the existing MPLS Ping message, so as to realize the extended MPLS Ping message as the first state notification message or the second state notification message. The MPLS Ping message is one of MPLS messages, and is mainly used to check whether the network connection and the host are reachable. As shown in FIG. 3, the MPLS Ping message includes an MPLS label (MPLS Label), an IP header (IP Header, IP Hdr), a user datagram protocol header (Open Systems Interconnection, UDP Hdr), and an MPLS Ping Echo message. In the present application, an extension field is added in the MPLS Ping Echo message, and the state notification is realized through the content carried by the extension field. Specifically, the fields included in the MPLS Ping Echo message are shown in Table 1.
[0099] Table 1
[0100] As can be seen from Table 1, five extension fields are added in the MPLS Ping Echo message in the present application, and different contents (such as the destination address and the link state) are carried based on the five extension fields, so as to realize the state notification between network devices based on the five extension fields.
[0101] Exemplarily, refer to FIG. 4, which is a format diagram of an ICMP packet provided by an embodiment of the present application. As shown in FIG. 4, the ICMP packet in the present application is extended from the existing ICMP packet, so as to realize the first state notification packet or the second state notification packet based on the extended ICMP packet. The ICMP packet is used to transmit control messages between network devices such as hosts, routers or switches. The control messages are messages of the network itself, such as whether the network is available, whether the host is reachable, whether the route is available, etc. These control messages do not transmit user data, but play an important role in the transmission of user data. As shown in FIG. 4, the fields included in the ICMP packet are shown in Table 2.
[0102] Table 2
[0103] In the present application, in order to determine the path for performing packet forwarding based on the states of the two links, the first network device can determine the forwarding priority of the path based on the state of the link of the path, and then determine the target forwarding path by comparing the forwarding priorities of the paths.
[0104] Exemplarily, the forwarding priority of the path including the link in the normal state is higher than that of the path including the link in the performance degradation state, and the forwarding priority of the path including the link in the performance degradation state is higher than that of the path including the link in the interruption state. That is, if the link on the path 1 is in the normal state and the link on the path 2 is in the performance degradation state, the forwarding priority of the path 1 is higher than that of the path 2. If the link on the path 1 is in the performance degradation state and the link on the path 2 is in the interruption state, the forwarding priority of the path 1 is higher than that of the path 2.
[0105] That is, the lower the failure degree of the link on the path, the better the state of the path, and the higher the forwarding priority of the path; the higher the failure degree of the link on the path, the worse the state of the path, and the lower the forwarding priority of the path.
[0106] In the process of determining the target forwarding path by the first network device, the first network device determines the path with the highest forwarding priority in the first path and the second path as the target forwarding path according to the first state and the second state.
[0107] In the present scheme, the forwarding priority of the path is defined based on the state of the link on the path, so that the network device can preferentially select the path with a better state when selecting the forwarding path, thereby ensuring the quality of packet forwarding and improving the realizability of the scheme.
[0108] Exemplarily, refer to FIG. 5, which is a schematic diagram of forwarding a packet in a case where two links are in a performance degradation state and a normal state respectively according to an embodiment of the present application. As shown in FIG. 5, the first network device and the second network device are both directly connected with the destination network device, the link between the first network device and the destination network device is the first path, and the link between the second network device and the destination network device is the second path. The first path between the first network device and the destination network device is in the performance degradation state, and the second path between the second network device and the destination network device is in the normal state. After the first network device and the second network device exchange the link states with each other (i.e., the first state advertisement packet and the second state advertisement packet), the first network device and the second network device can both learn the states of the first path and the second path. Based on the fact that the first path is in the performance degradation state and the second path is in the normal state, the first network device can determine that the forwarding priority of the second path is higher, and then select to use the second path to forward the packet to the destination network device. Therefore, when receiving a packet with the destination address being the destination network device, the first network device forwards the packet to the second network device, and the second network device forwards the packet to the destination network device through the second path.
[0109] In addition, since the states of the links on the paths can change during the operation of the network, the target forwarding path determined by the first network device based on the states of the links can also change.
[0110] Exemplarily, in a case where the first state corresponding to the first link is the performance degradation state and the second state corresponding to the second link is the normal state, the target forwarding path determined by the first network device is the second path.
[0111] After the state of the second link changes from the normal state to the fault state, the first network device receives the third state advertisement packet sent by the second network device, and the third state advertisement packet is used to indicate that the state of the second path is the fault state.
[0112] Since the state of the first link is the performance degradation state and the state of the second link is the fault state, the first network device determines that the forwarding priority of the first path is higher than the forwarding priority of the second path, and the first network device switches the target forwarding path from the second path to the first path, where the target forwarding path is the path used to forward the packet with the destination address being the target address.
[0113] That is, when the states of the links on the paths change, the forwarding priorities of the paths also change, which can cause the size relationship between the forwarding priorities of the two paths to change, and then cause the forwarding path determined by the network device to change.
[0114] Exemplarily, refer to FIG. 6, which is a schematic diagram of forwarding a packet in a case where two paths are in a performance degradation state and a failure state respectively, according to an embodiment of the present application. As shown in FIG. 6, compared with FIG. 5, the first path between the first network device and the destination network device is still in the performance degradation state, but the second path between the second network device and the destination network device changes to the failure state. After the first network device receives the third state advertisement packet sent by the second network device, the first network device can learn that the state of the second path changes to the failure state. Based on the fact that the first path is in the performance degradation state and the second path is in the failure state, the first network device can determine that the forwarding priority of the first path is higher at this time, and then select to use the first path to forward the packet to the destination network device. Therefore, when receiving the packet with the destination address being the destination network device, the first network device directly forwards the packet to the destination network device, instead of forwarding the packet to the second network device.
[0115] The above introduces the process in which the first network device uses the path with the higher forwarding priority as the target forwarding path of the packet. However, in some cases, the state of the first link on the first path and the state of the second link on the second path can be the same, so that the forwarding priorities of the first path and the second path are also the same. In this case, the first network device needs to select one of the first path and the second path as the target forwarding path of the packet based on other manners.
[0116] In a possible implementation, for the first network device, the first path is configured as a primary path, and the second path is configured as a backup path.
[0117] When the forwarding priorities of the first path and the second path are the same, the first network device determines that the first path is the target forwarding path. That is, when the forwarding priorities of the two paths are the same, the first network device determines to use the primary path as the target forwarding path, so that the packet is forwarded on the primary path. When the state of the first link on the first path and the state of the second link on the second path are the same (for example, the states of the first link and the second link are all in the normal state, the performance degradation state or the failure state), the forwarding priorities of the first path and the second path are also the same.
[0118] Exemplarily, refer to FIG. 7, which is a schematic diagram of forwarding a packet when both the first path and the second path are in the performance degradation state according to an embodiment of the present application. As shown in FIG. 7, the first path between the first network device and the destination network device and the second path between the second network device and the destination network device are both direct links. The first path between the first network device and the destination network device is in the performance degradation state, and the second path between the second network device and the destination network device is also in the performance degradation state. Based on the fact that both the first path and the second path are in the performance degradation state, the first network device can determine that the forwarding priorities of the first path and the second path are the same at this time, and then select to use the first path configured as the primary path to forward the packet to the destination network device. Therefore, when receiving the packet with the destination address being the destination network device, the first network device directly forwards the packet to the destination network device, and no longer forwards the packet to the second network device.
[0119] In addition, for the second network device, the second network device can configure the second path as the primary path and the first path as the backup path. Alternatively, the second network device can configure the first path as the primary path and the second path as the backup path. In this way, when the second network device determines that the forwarding priorities of the first path and the second path are the same, the second network device can also determine to use the primary path as the target forwarding path of the packet.
[0120] In another possible implementation, the first network device and the second network device can be pre-configured with a default path, and the default path is one of the first path and the second path. When the forwarding priorities of the first path and the second path are the same, the first network device and the second network device determine to use the default path as the target forwarding path of the packet.
[0121] For example, the first network device and the second network device both configure the first path as the default path. Then, when the forwarding priorities of the first path and the second path are the same, the first network device and the second network device both use the first path to forward the packet to the destination network device.
[0122] Of course, when the forwarding priorities of the first path and the second path are the same, the first network device and the second network device can also use other ways to determine the target forwarding path of the packet, which is not limited in the present application.
[0123] Generally, in the data transmission network, in addition to the need to transmit the packet to the target address through the first path or the second path as described above, the destination network device with the address as the target address can also need to transmit the packet through the first path or the second path. For example, after the destination network device receives an uplink packet through the first path or the second path, the destination network device returns a downlink packet to the source address through the first path or the second path. In order to ensure that the forwarding paths of the uplink packet and the downlink packet are the same, the present application can implement route linkage based on bidirectional forwarding detection (BFD) to ensure that the packet going to the destination network device and the packet coming out of the destination network device maintain the same forwarding path as much as possible.
[0124] Exemplarily, in the case that the first state corresponding to the first link is the performance degradation state and the second state corresponding to the second link is the normal state, the target forwarding path determined by the first network device is the second path.
[0125] Based on the first state and the second state, the first network device stops sending the BFD packet to the destination network device to instruct the destination network device to send the packet through the second path. The address of the destination network device is the target address.
[0126] Generally, the first network device and the destination network device will periodically send BFD packets to each other to determine whether the path between the first network device and the destination network device is reachable. Based on the first state and the second state, the first network device determines that the packet going to the destination network device needs to be sent through the second path. Therefore, although the first network device can still normally send the BFD packet to the destination network device at this time, the first network device can actively stop sending the BFD packet to the destination network device. In this way, when the destination network device cannot receive the BFD packet from the first network device, the destination network device can know that the packet needs to be forwarded through the second path, so that the packet forwarded from the destination network device is forwarded through the second path and will not be forwarded through the first path.
[0127] Please refer to Fig. 8, which is a schematic diagram of determining a message forwarding path based on BFD linkage provided by an embodiment of the present application. As shown in Fig. 8, the first network device and the second network device are both directly connected with the destination network device, the link between the first network device and the destination network device is the first path, and the link between the second network device and the destination network device is the second path. The first path between the first network device and the destination network device is in a performance degradation state, and the second path between the second network device and the destination network device is in a normal state. Based on the states of the first path and the second path, the first network device determines that the message to the destination network device is forwarded through the second path. In order to ensure that the message sent by the destination network device is also forwarded through the second path and not through the first path, the first network device can actively stop sending BFD messages to the destination network device, so that the destination network device regards the first path as a fault. Based on BFD linkage, when the destination network device needs to send a message, the message can be forwarded through the second path, so as to ensure that the round trip path of the message is as same as possible.
[0128] In order to facilitate understanding, the application process of the message processing method provided by the present application in the actual application scenario will be introduced in detail below in combination with specific examples.
[0129] Please refer to Fig. 9, which is a schematic diagram of determining a forwarding path based on the link state between a PE and a core device provided by an embodiment of the present application. As shown in Fig. 9, PE1 and PE2 are both directly connected with the core device, the link between PE1 and the core device constitutes path 1, and the link between PE2 and the core device constitutes path 2. PE1 and PE2 constitute dual-homing devices, and the configurations of PE1 and PE2 are shown in Table 3.
[0130] Table 3
[0131] In addition, the FRR state machine is also maintained in PE1 and PE2, which can arbitrate based on the input state of the primary and backup paths, so as to determine which path to use for message forwarding.
[0132] Exemplarily, the states defined in the FRR state machine are shown in Table 4.
[0133] Table 4
[0134] In addition, the FRR state machine performs arbitration based on the input state of the primary and backup paths, and the arbitration result is shown in Table 5.
[0135] Table 5
[0136] During the running, PE1 notifies PE2 that the state of path 1 is state 1 through state notification message 1 (such as an extended MPLS message or an ICMP message). Meanwhile, PE2 notifies PE1 that the state of path 2 is state 2 through state notification message 2 (such as an extended MPLS message or an ICMP message).
[0137] After receiving state notification message 2, PE1 analyzes the message, matches FRR 1 through the route prefix, and matches the L3VPN through the L3VPN private network label, and obtains state 2 carried by state notification message 2. Then, PE1 takes state 2 as the input of the FRR backup path in PE1, and takes state 1 as the input of the FRR main path, obtains the arbitration result of the FRR state machine, and thus determines the forwarding path of the uplink message (i.e., the message with the core device as the destination address). For example, assuming that the input state of the main path is SD_W and the input state of the backup path is SF_P in the FRR state machine of PE1, the arbitration result of the FRR state machine is that the FRR of PE1 does not invert, and the uplink service forwarding path is PE1→core device.
[0138] Similarly, after receiving state notification message 1, PE2 analyzes the message, matches FRR 2 through the route prefix, and matches the L3VPN through the L3VPN private network label, and obtains state 1 carried by state notification message 1. Then, PE2 takes state 1 as the input of the FRR backup path in PE2, and takes state 2 as the input of the FRR main path, obtains the arbitration result of the FRR state machine, and thus determines the forwarding path of the uplink message (i.e., the message with the core device as the destination address). For example, assuming that the input state of the main path is SD_P and the input state of the backup path is SF_W in the FRR state machine of PE2, the arbitration result of the FRR state machine is that the FRR of PE2 inverts, and the uplink service forwarding path is PE2→PE1→core device. In addition, if PE1 and PE2 are deployed with route tracking BFD between PE1 and PE2 and the core device, the FRR of the core device does not invert at this time, and the core device forwards the downlink message by sending a message to PE1.
[0139] Please refer to FIG. 10, which is a schematic diagram of a same-side multi-point exception in a Hengxingshun double-homing scenario according to an embodiment of the present application. As shown in FIG. 10, PE1 is connected to the core device through PE3, and PE2 is connected to the core device through PE4, PE1 and PE2 constitute double-homing devices, and PE3 and PE4 also constitute double-homing devices, thereby forming a Hengxingshun double-homing scenario. Assuming that the port of PE1 is in a performance degradation state, and the port of PE2 is in an interruption state. PE1 and PE2 interact with state notification messages, thereby notifying PE2 that the link state between PE1 and PE3 is in a performance degradation state, and notifying PE1 that the link state between PE2 and PE4 is in an interruption state.
[0140] After receiving the state notification message, PE1 takes the link state SD_W between PE1 and PE3 as the input of the FRR primary path in PE1 and takes the link state SF_P between PE2 and PE4 as the input of the FRR backup path in PE1, and the arbitration result of the FRR state machine is that the FRR of PE1 does not switch and the uplink service forwarding path is PE1→PE3.
[0141] Similarly, after receiving the state notification message, PE2 takes the link state SD_P between PE1 and PE3 as the input of the FRR backup path in PE1 and takes the link state SF_W between PE2 and PE4 as the input of the FRR primary path in PE1, and the arbitration result of the FRR state machine is that the FRR of PE2 switches and the uplink service forwarding path is PE2→PE1→PE3.
[0142] For PE3, the FRR of PE3 does not switch and the downlink service forwarding path is PE3→PE1. For PE4, the FRR of PE4 switches and the downlink service forwarding path is PE4→PE3→PE1.
[0143] Please refer to FIG. 11, which is a schematic diagram of abnormality of a Hengxi-type dual-homing scenario of different sides. As shown in FIG. 11, PE1 is connected to a core device through PE3, and PE2 is connected to the core device through PE4, PE1 and PE2 constitute dual-homing devices, and PE3 and PE4 also constitute dual-homing devices, thereby forming a Hengxi-type dual-homing scenario. It is assumed that the port of PE3 is in a performance degradation state and the port of PE2 is in an interruption state. At this time, PE3 can send a notification message to PE1 to indicate that the port connected by PE3 and PE1 is in a performance degradation state. For example, when PE3 receives data from PE1 through the port and the data has errors, PE3 can send a notification message to PE1 to indicate that the data received by PE3 has errors.
[0144] Based on the received notification message, PE1 can determine that the link state between PE1 and PE3 is in a performance degradation state, and therefore PE1 and PE2 can interact with state notification messages, thereby realizing the notification of the link state between PE1 and PE3 to PE2 in a performance degradation state and the notification of the link state between PE2 and PE4 to PE1 in an interruption state.
[0145] After receiving the state notification message, the way in which PE1, PE2, PE3 and PE4 select the message forwarding path can refer to the introduction of the embodiment shown in FIG. 10, which will not be described here.
[0146] The above describes in detail the message processing method provided by the present application, and the following describes the device for executing the message processing method.
[0147] Referring to FIG. 12, FIG. 12 is a structural schematic diagram of a packet processing apparatus provided by an embodiment of the present application. As shown in FIG. 12, the packet processing apparatus is applied to a first network device, and the packet processing apparatus comprises: a sending module 1201 configured to send a first state notification packet to a second network device, the first state notification packet comprising a target address and a first state, the first state notification packet being used to indicate that a state of a first link is the first state, the first link being a link connected to the first network device on a first path, the first path being a path from the first network device to the target address, and the first path not comprising the second network device; and a receiving module 1202 configured to receive a second state notification packet sent by the second network device, the second state notification packet comprising the target address and a second state, the second state notification packet being used to indicate that a state of a second link is the second state, the second link being a link connected to the second network device on a second path, the second path being a path from the second network device to the target address, and the second path not comprising the first network device; wherein the first state and the second state are used by the first network device to determine a target forwarding path of a packet with the target address in the first path and the second path, and the first state and the second state are one of a normal state, a performance degradation state, and an interruption state, and a link in the performance degradation state has a transmission performance worse than a link in the normal state.
[0148] In a possible implementation, the first state notification packet and the second state notification packet are extended MPLS packets or extended ICMP packets.
[0149] In a possible implementation, the first state notification packet carries the target address and the first state through an extension field, and the second state notification packet carries the target address and the second state through an extension field.
[0150] In a possible implementation, the first path and the second path are L3VPN paths, and the first state notification packet and the second state notification packet further comprise an L3VPN private network label, the L3VPN private network label being used to indicate an L3VPN to which the target address belongs.
[0151] In a possible implementation, a path comprising a link in the normal state has a higher forwarding priority than a path comprising a link in the performance degradation state, and the path comprising the link in the performance degradation state has a higher forwarding priority than a path comprising a link in the interruption state. The packet processing apparatus further comprises a processing module 1203 configured to determine, according to the first state and the second state, a path with the highest forwarding priority as the target forwarding path in the first path and the second path.
[0152] In a possible implementation, the first path is a main path, and the second path is a backup path; the processing module 1203 is further configured to determine the first path as the target forwarding path when the forwarding priorities of the first path and the second path are the same.
[0153] In a possible implementation, the receiving module 1202 is further configured to receive a first packet, and a destination address of the first packet is the same as the target address; the sending module 1201 is further configured to forward the first packet to the third network device on the first path when the target forwarding path is the first path; or the sending module 1201 is further configured to forward the first packet to the second network device when the target forwarding path is the second path.
[0154] In a possible implementation, the first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path; the receiving module 1202 is further configured to receive a third state advertisement packet sent by the second network device after the state of the second link changes from the normal state to the interruption state, where the third state advertisement packet is used to indicate that the state of the second link is the interruption state; and the packet processing apparatus further includes a processing module 1203 configured to switch the target forwarding path from the second path to the first path.
[0155] In a possible implementation, the first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path; the sending module 1201 is further configured to stop sending the BFD packet to the destination network device, so as to instruct the destination network device to send the packet through the second path; and the address of the destination network device is the target address.
[0156] In a possible implementation, the receiving module 1202 is further configured to receive a notification message sent by the third network device, where the notification message is used to indicate that data received by the third network device through the first link does not meet a preset performance requirement; and the packet processing apparatus further includes a processing module 1203 configured to determine, based on the notification message, the first network device to determine that the first state is the performance degradation state.
[0157] Referring to FIG. 13, FIG. 13 is a structural schematic diagram of a network device provided by an embodiment of the present application. The network device is equipped with the packet processing apparatus shown in FIG. 12, and the network device is implemented by a general bus architecture.
[0158] The network device includes at least one processor 1301, a communication bus 1302, a memory 1303, and at least one communication interface 1304.
[0159] Optionally, the processor 1301 is a general purpose CPU, NP, microprocessor, or one or more integrated circuits utilized to implement one or more embodiments of the application such as an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination of such a device and a processor. The PLD is a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0160] The communication bus 1302 serves to communicate information between above-mentioned components over a communication bus. The communication bus 1302 is divided into an address bus, a data bus, a control bus, and the like. For the convenience of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or only one type of bus.
[0161] Optionally, the memory 1303 is a read-only memory (ROM) or other type of static storage device that can store static information and instructions. Alternatively, the memory 1303 is a random access memory (RAM) or other type of dynamic storage device that can store information and instructions. Alternatively, the memory 1303 is an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, a magnetic disk storage or other magnetic storage devices, or any other medium capable of storing desired program code in the form of instructions or data structures and that can be accessed by a computer, but not limited to. Optionally, the memory 1303 is independent and connected to the processor 1301 through the communication bus 1302. Alternatively, the memory 1303 and the processor 1301 are integrated together.
[0162] The communication interface 1304 is configured to communicate with other devices or communication networks using any transceiver-like mechanism. The communication interface 1304 includes a wired communication interface. Optionally, the communication interface 1304 also includes a wireless communication interface. The wired communication interface is, for example, an Ethernet interface. The Ethernet interface is an optical interface, an electrical interface, or a combination thereof. The wireless communication interface is, for example, a wireless local area networks (WLAN) interface, a cellular network communication interface, or a combination thereof.
[0163] In some embodiments, the processor 1301 includes one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 13.
[0164] In some embodiments, the network device includes a plurality of processors, such as the processor 1301 and the processor 1305 as shown in FIG. 13. Each of the processors is a single-CPU or a multi-CPU. The processor herein refers to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0165] In some embodiments, the memory 1303 is configured to store program code 1306 for implementing the solutions of the present application, and the processor 1301 is configured to execute the program code 1306 stored in the memory 1303. That is, the network device implements the above-mentioned method embodiments through the processor 1301 and the program code 1306 in the memory 1303.
[0166] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts of each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. Wherein, A refers to B, which means that A is the same as B or a simple modification of B.
[0167] The terms “first” and “second” and the like in the specification and claims of the embodiments of the present application are used to distinguish different objects, and are not used to describe a specific order of the objects, nor can be understood as indicating or implying relative importance. For example, the first speed limiting channel and the second speed limiting channel are used to distinguish different speed limiting channels, and are not used to describe a specific order of the speed limiting channels, nor can be understood as the first speed limiting channel being more important than the second speed limiting channel.
[0168] In the embodiments of the present application, unless otherwise specified, “at least one” means one or more, and “a plurality of” means two or more.
[0169] The above-described embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, the embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are wholly or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as solid state disk (SSD)), etc.
[0170] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of processing a packet, the method comprising: The method comprises: a first network device sends a first state notification message to a second network device, the first state notification message comprising a target address and a first state, the first state notification message being used to indicate that a state of a first link is the first state, the first link being a link connected to the first network device on a first path, the first path being a path from the first network device to the target address, the first path not comprising the second network device; the first network device receives a second state notification message sent by the second network device, the second state notification message comprising the target address and a second state, the second state notification message being used to indicate that a state of a second link is the second state, the second link being a link connected to the second network device on a second path, the second path being a path from the second network device to the target address, the second path not comprising the first network device; wherein the first state and the second state are used by the first network device to determine a target forwarding path of a message whose destination address is the target address in the first path and the second path, the first state and the second state being one of a normal state, a performance degradation state, or an interruption state, a transmission performance of a path in the performance degradation state being worse than a path in the normal state.
2. The method of claim 1, wherein, The first state notification message and the second state notification message are extended Multiprotocol Label Switching (MPLS) messages or extended Internet Control Message Protocol (ICMP) messages.
3. The method of claim 2, wherein, The first state notification message carries the target address and the first state through an extension field, and the second state notification message carries the target address and the second state through an extension field.
4. The method according to any one of claims 1 to 3, characterized in that, The first path and the second path are Layer 3 Virtual Private Network (L3VPN) paths, and the first state notification message and the second state notification message further comprise an L3VPN private network label, the L3VPN private network label being used to indicate an L3VPN to which the target address belongs.
5. The method according to any one of claims 1 to 4, characterized in that, A path comprising a link in the normal state has a higher forwarding priority than a path comprising a link in the performance degradation state, and a path comprising a link in the performance degradation state has a higher forwarding priority than a path comprising a link in the interruption state. The method further comprises: According to the first state and the second state, the first network device determines a path with the highest forwarding priority in the first path and the second path as the target forwarding path.
6. The method of claim 5, wherein, The first path is a primary path, and the second path is a backup path. The first network device determines a path with the highest forwarding priority in the first path and the second path as the target forwarding path, comprising: When the forwarding priorities of the first path and the second path are the same, the first network device determines the first path as the target forwarding path.
7. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: The first network device receives a first message, the first message having a destination address same as the target address. In a case where the target forwarding path is the first path, the first network device forwards the first packet to a third network device on the first path; Or, in a case where the target forwarding path is the second path, the first network device forwards the first packet to the second network device.
8. The method according to any one of claims 1 to 7, characterized in that, The first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path. The method further includes: After the state of the second link changes from the normal state to the interruption state, the first network device receives a third state advertisement packet sent by the second network device, the third state advertisement packet being used to indicate that the state of the second link is the interruption state. The first network device switches the target forwarding path from the second path to the first path.
9. The method according to any one of claims 1 to 8, characterized in that, The first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path. The method further includes: The first network device stops sending a bidirectional forwarding detection (BFD) packet to a destination network device, to instruct the destination network device to send a packet through the second path. The address of the destination network device is the target address.
10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: The first network device receives a notification message sent by a third network device, the notification message being used to indicate that data received by the third network device through the first link does not meet a preset performance requirement. Based on the notification message, the first network device determines that the first state is a performance degradation state.
11. A packet processing device, characterized by, The apparatus is deployed on a first network device, and the apparatus includes: a sending module, configured to send a first state advertisement packet to a second network device, the first state advertisement packet including a target address and a first state, the first state advertisement packet being used to indicate that a state of a first link is the first state, the first link being a link connected to the first network device on a first path, the first path being a path from the first network device to the target address, and the first path not including the second network device; a receiving module, configured to receive a second state advertisement packet sent by the second network device, the second state advertisement packet including the target address and a second state, the second state advertisement packet being used to indicate that a state of a second link is the second state, the second link being a link connected to the second network device on a second path, the second path being a path from the second network device to the target address, and the second path not including the first network device; The first state and the second state are used by the first network device to determine a target forwarding path of a packet with the target address in the first path and the second path, the first state and the second state are one of a normal state, a performance degradation state, or an interruption state, and a link in the performance degradation state has a transmission performance worse than a link in the normal state.
12. The apparatus of claim 11, wherein, The first state notification message and the second state notification message are extended MPLS messages or extended ICMP messages.
13. The apparatus of claim 12, wherein, The first state notification message carries the target address and the first state through an extended field, and the second state notification message carries the target address and the second state through an extended field.
14. The apparatus of any one of claims 11-13, wherein, The first path and the second path are L3VPN paths, and the first state notification message and the second state notification message further comprise an L3VPN private network label, which is used to indicate an L3VPN to which the target address belongs.
15. The apparatus of any of claims 11-14, wherein, The forwarding priority of a path comprising a link in the normal state is higher than that of a path comprising a link in the performance degradation state, and the forwarding priority of a path comprising a link in the performance degradation state is higher than that of a path comprising a link in the interruption state. The device further comprises: The processing module is configured to determine, according to the first state and the second state, a path with the highest forwarding priority in the first path and the second path as the target forwarding path.
16. The apparatus of claim 15, wherein, The first path is a primary path, and the second path is a backup path. The processing module is further configured to determine the first path as the target forwarding path when the forwarding priorities of the first path and the second path are the same.
17. The device of any of claims 11-16, wherein The receiving module is further configured to receive a first message, a destination address of the first message being the same as the target address. The sending module is further configured to forward the first message to a third network device on the first path when the target forwarding path is the first path. Alternatively, the sending module is further configured to forward the first message to the second network device when the target forwarding path is the second path.
18. The apparatus of any of claims 11-17, wherein, The first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path. The receiving module is further configured to receive a third state notification message sent by the second network device after the state of the second link changes from the normal state to the interruption state, the third state notification message being used to indicate that the state of the second link is the interruption state. The device further comprises a processing module configured to switch the target forwarding path from the second path to the first path.
19. The apparatus of any of claims 11-18, wherein, The first state is a performance degradation state, the second state is a normal state, and the target forwarding path is the second path. The sending module is further configured to stop sending a BFD message to a destination network device to instruct the destination network device to send a message through the second path. The address of the destination network device is the target address.
20. The device of any of claims 11-19, wherein The receiving module is further configured to receive, by the first network device, a notification message sent by a third network device, the notification message being used to indicate that data received by the third network device through the first link does not meet a preset performance requirement. The apparatus further includes a processing module configured to determine, based on the notification message, that the first state is a performance degradation state.
21. A network device, comprising: A network device comprising a processor and a memory storing program code, the processor configured to invoke the program code in the memory to cause the network device to perform the method of any of claims 1-10.
22. A computer-readable storage medium, characterized in that, A computer program product having instructions stored therein, which, when executed on a computer, cause the computer to perform the method of any of claims 1-10.
23. A computer program product, characterised in that, A computer program product having program code, which, when executed on a computer, cause the computer to perform the method of any of claims 1-10.
Citation Information
Patent Citations
Link fault detection method, device and system
CN109787797A
Method and equipment for selecting port switched to working state during dual-homing access
CN112751754A
Multi-path reliable transmission method and system for satellite network local area sensing
CN118473503A
Method and Apparatus for the Fast Detection of Connectivity Loss Between Devices in a Network
US20140211604A1
Network path selection for multi-homed edges to ensure end-to-end resiliency
US8724456B1