Traffic forwarding method, electronic equipment and readable storage medium

In the traffic forwarding method, selecting the first link from the current node to the next node for traffic forwarding, the link flow outage problem caused by all candidate link exceptions is solved, and the continuity of services is achieved.

CN119697082APending Publication Date: 2025-03-25ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411969624.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When all links between two nodes have abnormalities, the link will be cut off, affecting the normal operation of the service and making it difficult to ensure the continuity of the service.

Method used

A traffic forwarding method is provided, in response to the state of each candidate link from the current node to the next node being an abnormal state, a first link is selected from each candidate link, and then forward the received traffic through the first link.

Benefits of technology

Even if the states of all candidate links are abnormal, it can ensure that the traffic between the current node and the next node can be transmitted normally, avoiding the link being disconnected due to the abnormal state that the link cannot be forwarded normally, affecting the continuity of services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697082A_ABST
    Figure CN119697082A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic forwarding method, electronic equipment and a readable storage medium, and belongs to the technical field of computers. The method comprises the following steps: in response to the fact that the state of each candidate link from a current node to a next node is an abnormal state, selecting a first link from each candidate link; and forwarding the received traffic through the first link.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a traffic forwarding method, an electronic device, and a readable storage medium. Background Art

[0002] Currently, when all links between two nodes are abnormal, the links will be disconnected, that is, traffic will be prohibited from passing, which will directly affect the normal operation of the business, making it difficult to ensure business continuity. Summary of the invention

[0003] The embodiments of the present application provide a traffic forwarding method, an electronic device, and a readable storage medium, which can solve the problem of difficulty in ensuring business continuity when a link is disconnected.

[0004] In order to solve the above technical problems, this application is implemented as follows: In a first aspect, a traffic forwarding method is provided, the method comprising: in response to the state of each candidate link from a current node to a next node being an abnormal state, selecting a first link from each candidate link; and forwarding received traffic through the first link.

[0005] In a second aspect, an electronic device is provided, comprising a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.

[0006] According to a third aspect, a readable storage medium is provided, wherein at least one computer program is stored in the readable storage medium, and when the computer program is loaded and executed by a processor, the steps of the method described in the first aspect are implemented.

[0007] According to a fourth aspect, a computer program product is provided, the computer program product comprising at least one computer program, and when the computer program is loaded and executed by a processor, the steps of the method described in the first aspect are implemented.

[0008] In an embodiment of the present application, in response to the state of each candidate link from the current node to the next node being an abnormal state, a first link is selected from each candidate link, and then the received traffic is forwarded through the first link. This ensures that even if the states of all candidate links are abnormal, the traffic between the current node and the next node can be transmitted normally, and can avoid the problem of link disconnection due to all candidate links being in an abnormal state, which makes it impossible to forward traffic normally and affects business continuity.

[0009] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0011] Figure 1 A flow chart of a traffic forwarding method provided by an exemplary embodiment of the present application is shown; Figure 2 A link schematic diagram of traffic forwarding provided by an exemplary embodiment of the present application is shown; Figure 3 Another link schematic diagram of traffic forwarding provided by an exemplary embodiment of the present application is shown; Figure 4 Another link schematic diagram of traffic forwarding provided by an exemplary embodiment of the present application is shown; Figure 5 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION

[0012] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0013] Figure 1 A flow chart of a traffic forwarding method provided by an exemplary embodiment of the present application is shown, and the method may include the following steps: S110: In response to the state of each candidate link from the current node to the next node being an abnormal state, select a first link from each candidate link.

[0014] S120: Forward the received traffic through the first link.

[0015] It is understandable that if the status of each candidate link from the current node to the next node is abnormal, then the first link is selected from each candidate link, and then the received traffic is forwarded through the first link. This can avoid the problem of affecting business continuity due to no link for traffic forwarding when all candidate links are abnormal. In other words, even if all candidate links are abnormal, there will be no problem of broken links, so as to ensure business continuity. For example, if Figure 2As shown, the traffic goes from the starting node P1 to the end node P4, where the candidate links between the current node P2 and the next node P3 may include L1, L2, L3, and L4. If L1, L2, L3, and L4 are all in abnormal states, then the first link is selected from L1, L2, L3, and L4, and then the traffic is forwarded through the first link. This ensures that even if all candidate links between P2 and P3 are abnormal, there is still a candidate link that can transmit the service.

[0016] In an exemplary embodiment, the abnormal state of the link may mean that the link cannot transmit data normally or has some faults, resulting in communication obstruction or quality degradation. In an exemplary embodiment, the abnormal state may include: insufficient bandwidth, high latency, high packet loss rate, link congestion, etc.

[0017] In an exemplary embodiment, the candidate links between the current node and the next node may include direct links and indirect links. A direct link refers to a link between two nodes that is composed of at least one direct connection. Figure 2 In the example, nodes P2 and P3 are directly connected, so the direct links from P2 to P3 include L1, L2, L3, and L4. An indirect link is a path between two nodes connected by at least one intermediate node. For example, Figure 2 In the example, both node P1 and node P3 are connected to node P2, so the link from P1 to P3: P1→P2→P3 is an indirect link.

[0018] In an exemplary embodiment, the link anomaly detection function can be enabled for each candidate link. If the status of each candidate link is abnormal, only some of the candidate links can be blocked according to the conditions, and there is a candidate link that will not be blocked immediately even if the link is also abnormal, so as to avoid the risk of all candidate links being disconnected due to abnormalities, resulting in a complete interruption of business.

[0019] In an embodiment of the present application, in response to the state of each candidate link from the current node to the next node being an abnormal state, a first link is selected from each candidate link, and then the received traffic is forwarded through the first link. This ensures that even if the states of all candidate links are abnormal, the traffic between the current node and the next node can be transmitted normally, and can avoid the problem of link disconnection due to all candidate links being in an abnormal state, which makes it impossible to forward traffic normally and affects business continuity.

[0020] In an exemplary embodiment, before selecting the first link from each candidate link, the method further includes: in response to a state of a second link in each candidate link becoming an abnormal state and traffic forwarding existing in the second link, forwarding the received traffic through the second link, wherein the second link is the last candidate link in each candidate link to become an abnormal state.

[0021] It is understandable that before selecting the first link from each candidate link, if the status of each candidate link becomes abnormal, and the last candidate link that becomes abnormal still has traffic forwarding, then the second link will first forward the received traffic normally until there is no traffic forwarding in the second link, and then the first link will be selected from each candidate link, which can avoid data loss. Because, during the forwarding process of the second link, if the traffic is immediately forwarded through the first link, it may cause the traffic forwarded by the second link to be lost or the transmission to be interrupted. By waiting for the traffic forwarding in the second link to be completed and then selecting the first link, data loss or communication interruption caused by link replacement can be avoided. In addition, during the forwarding process of the second link, if the traffic is forwarded through the first link, then the first link may re-forward the traffic existing in the second link, which will cause the traffic to be sent repeatedly.

[0022] In another exemplary embodiment, the method further includes: in response to no traffic forwarding in the second link, executing the step of selecting the first link from each candidate link.

[0023] That is to say, when there is no traffic forwarding on the second link, the first link is selected from each candidate link and the traffic is forwarded by the first link. In this way, both traffic loss in the second link and repeated forwarding can be avoided.

[0024] In an exemplary embodiment, no traffic is forwarded in the second link may mean that the state of the second link becomes an abnormal state and no traffic is forwarded in the second link, or the second link completes forwarding of received traffic.

[0025] In an exemplary embodiment, selecting a first link from each candidate link may include: obtaining a target parameter value corresponding to each candidate link within a preset statistical time, wherein the target parameter value is used to represent the transmission capacity of the candidate link; and determining, based on the target parameter value, that the candidate link with the best transmission capacity is the first link.

[0026] It is understandable that as the network environment changes, the performance of each candidate link may vary. Therefore, it is necessary to determine the candidate link with the best transmission capacity as the first link based on the target parameter value corresponding to each candidate link to improve the efficiency and stability of traffic forwarding.

[0027] In one exemplary embodiment, the target parameter value may include at least one of the following: a delay value, a number of cyclic redundancy check (CRC) error packets; wherein, the smaller the delay value of the candidate link, the better the transmission capacity of the candidate link; the smaller the number of cyclic redundancy check (CRC) error packets, the better the transmission capacity of the candidate link. When the target parameter value includes more than two parameters, the candidate link with the best transmission performance can be determined based on the preset influence weight of each parameter on the transmission capacity and each target parameter value; the candidate link with the best transmission performance can also be determined based on the order of the priority of each target parameter value from high to low.

[0028] It is understandable that the delay value refers to the time required to reach the next node from the current node. A smaller delay means that the forwarding time of the traffic from the current node to the next node is shorter, or the probability of network blocking or congestion is lower, so the smaller the delay value of the candidate link, the better the transmission capacity of the candidate link. The number of CRC error packets refers to the number of CRC error packets caused by data forwarding errors, wherein the CRC error packet refers to the byte in which the data is wrong during the forwarding process. Exemplarily, in the process of forwarding the target traffic from the current node to the next node in the target link, the current node will calculate the CRC code of the target traffic, and the next node will also calculate the CRC code of the received target traffic. If the CRC codes of the two do not match, it means that there is an error, and the number of CRC error packets records the number of error bytes found by the next node during the verification process. Therefore, the fewer the number of CRC error packets, the better the transmission capacity of the candidate link.

[0029] In another exemplary embodiment, the target parameter value may also include: bandwidth, packet loss rate, load, throughput, etc. Bandwidth refers to the maximum amount of data that can be forwarded in a unit time. The larger the bandwidth, the better the transmission capacity of the candidate link; packet loss rate refers to the proportion of data packets lost during the forwarding process to the total data packets. The lower the packet loss rate, the better the transmission capacity of the candidate link; load refers to the current traffic volume on the link. The lower the load, the better the transmission capacity of the candidate link.

[0030] In an exemplary embodiment, forwarding received traffic through the first link includes: obtaining a working time for forwarding traffic through the first link; and in response to the working time being greater than a preset duration, disabling a forwarding function of the first link.

[0031] It is understandable that since the network environment is dynamically changing, the bandwidth, latency, congestion, load and other parameters in the candidate links may change over time. If the first link changes from the optimal link to a non-optimal link during working hours, if the received traffic continues to be forwarded through the first link for a long time, it will affect the efficiency and stability of traffic forwarding. Therefore, when the working time of forwarding traffic through the first link is greater than the preset time, the forwarding function of the first link can be disabled, that is, the first link is prohibited from forwarding the received traffic.

[0032] In another exemplary embodiment, before deactivating the forwarding function of the first link, the method further includes: selecting a third link from each candidate link, and forwarding the received traffic through the third link.

[0033] It is understandable that in order to avoid the situation where the traffic received by the current node has no link to forward due to disabling the forwarding function of the first link, the optimal link, i.e., the third link, can be reselected before disabling the forwarding function of the first link. In another exemplary embodiment, the selection method of the third link can adopt the selection method of the first link.

[0034] In an exemplary embodiment, the method also includes: in response to the existence of a fourth link between the current node and the next node, forwarding the received traffic through the fourth link, and deactivating the forwarding function of the first link, wherein the fourth link is a newly added link in a non-abnormal state or any candidate link that changes from an abnormal state to a non-abnormal state.

[0035] It is understandable that, when it is detected that there is a fourth link in a normal state between the current node and the next node, that is, a fourth link in a non-abnormal state, then the received traffic can be forwarded through the fourth link, and the forwarding function of the first link can be disabled. Because the state of the first link itself is an abnormal state, switching to the fourth link for forwarding can avoid forwarding delays or failures caused by the abnormal state of the first link, thereby achieving more stable and smoother forwarding. Among them, the fourth link is a newly added link in a non-abnormal state or any candidate link that changes from an abnormal state to a non-abnormal state, that is, when there is a newly added link in a non-abnormal state or the abnormality of the original abnormal state link is eliminated, traffic forwarding can be performed.

[0036] The above traffic forwarding method is further described below through two exemplary embodiments.

[0037] Embodiment 1 like Figure 3As shown, the traffic flows from the starting node PE1 to the end node PE2, and the links between the P1 node and the P3 node in the intermediate link may include the links P1→P3 and P1→P2→P3. Among them, in an exemplary embodiment, P1→P3 can be the main link, and P1→P2→P3 can be the backup link. Among them, link anomaly detection is enabled between link ① (P1→P2→P3) and link ② (P1→P3), and the detection link maintenance strategy is configured on node P1, and the maintenance time is T, then: 1) Among the primary and backup links ① and ② from P1 to P3, link ① is disconnected due to a link abnormality. At this time, only link ② remains from P1 to P3. When the status of link ② is also abnormal, it is necessary to first check whether link ② has traffic forwarding; if traffic is forwarding, wait until there is no traffic from P1 to P3 and enter the hold time.

[0038] 2) When the hold time is reached, the P1 device compares the link status of link ① and link ②, selects the link with better link status (transmission capacity), and switches the original forwarding link between P1→P3 to the selected link. After the hold time T is reached, the forwarding function of the selected link is stopped.

[0039] In an exemplary embodiment, judging the link status includes but is not limited to the following methods: (1) judging the link status based on the CRC value, comparing the calculated CRC check code with the received CRC check code, and less inconsistent data within a period of time indicates that the link performance is better; (2) judging the link status based on the delay value, and a smaller delay value indicates that the link performance is better.

[0040] 3) When the abnormality of any one of the primary and backup links ① and ② is eliminated or a new normal link is added between the P1 node and the P3 node, the link can be switched to the normal link.

[0041] Embodiment 2 like Figure 4 As shown in the figure, traffic flows from the starting node PE1 to the end node PE2. The link between the P1 node and the P2 node in the intermediate link forms equal-cost multi-path routing (ECMP). Link anomaly detection is enabled for link ③ and link ④ respectively. The detection link holding policy is configured on node P1, and the holding time is T. Then: 1) Link ③ between P1 and P2 is disconnected due to link abnormality. At this time, only link ④ remains from P1 to P2. When link ④ also reports link abnormality, you need to first check whether link ④ has traffic forwarding. If there is traffic forwarding, you need to wait until there is no traffic from P1 to P2 and enter the hold time. 2) When the hold time is reached, the P1 device compares the link status of links ③ and ④, selects the link with better link status, and switches the original forwarding link between P1→P2 to the selected link. After the hold time T is reached, the forwarding function of the selected link is stopped.

[0042] 3) When the abnormality of any link among links ③ and ④ is eliminated or a new link without abnormality is added between the links of node P1 and node P2, the link without abnormality can be switched to.

[0043] In the above-mentioned first and second embodiments, the link anomaly detection function is enabled for each link. If the status of each link is abnormal and reaches the disconnection condition, only some links can be blocked according to the conditions, but one link is retained so that it is not blocked, even if the link has problems. The above-mentioned conditions may include: when traffic is forwarded through an abnormal link and only one link is left, it is necessary to confirm that there is no traffic in the link before blocking the link; when only one link is left and no traffic is forwarded in the link, a link with better reliability and stability will be selected from all links, and traffic will be forwarded through the selected link.

[0044] like Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 510 and a memory 520, wherein the memory 520 stores programs or instructions that can be executed on the processor 510, and when the program or instructions are executed by the processor 510, the various processes of the embodiment shown in the above-mentioned traffic forwarding method are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0045] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the embodiment shown in the above-mentioned traffic forwarding method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0046] The processor is the processor in the terminal described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk. In some examples, the readable storage medium may be a non-transient readable storage medium.

[0047] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the embodiment shown in the above-mentioned traffic forwarding method, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0048] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0049] The embodiments of the present application further provide a computer program / program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the embodiments shown in the above-mentioned traffic forwarding method, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0050] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0051] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of a computer software product plus a necessary general hardware platform, and of course, can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, disk, CD, etc.), including several instructions to enable the terminal or network side device to execute the methods described in each embodiment of the present application.

[0052] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms of implementation methods without departing from the purpose of the present application and the scope of protection of the claims, and these implementation methods are all within the protection of the present application.

Claims

1. A traffic forwarding method, characterized in that: include: In response to the state of each candidate link from the current node to the next node being an abnormal state, selecting a first link from each candidate link; The received traffic is forwarded via the first link.

2. The method according to claim 1, characterized in that Before selecting the first link from each of the candidate links, the method further includes: In response to a state of a second link in each of the candidate links becoming an abnormal state and traffic forwarding existing in the second link, forwarding the received traffic through the second link, wherein the second link is the last candidate link in each of the candidate links that becomes the abnormal state.

3. The method according to claim 2, characterized in that The method further comprises: In response to no traffic being forwarded in the second link, a step of selecting a first link from each of the candidate links is performed.

4. The method according to claim 1, characterized in that The selecting the first link from each of the candidate links comprises: Obtaining a target parameter value corresponding to each of the candidate links within a preset statistical time, wherein the target parameter value is used to represent the transmission capacity of the candidate link; The candidate link with the best transmission capability is determined according to the target parameter value as the first link.

5. The method according to claim 4, characterized in that The target parameter value includes at least one of the following: delay value, number of cyclic redundancy check CRC error packets; wherein, the smaller the delay value of the candidate link, the better the transmission capacity of the candidate link; the smaller the number of cyclic redundancy check CRC error packets, the better the transmission capacity of the candidate link.

6. The method according to claim 1, characterized in that The forwarding of the received traffic through the first link includes: Obtaining a working time for forwarding traffic through the first link; In response to the working time being greater than a preset duration, the forwarding function of the first link is disabled.

7. The method according to claim 6, characterized in that Before deactivating the forwarding function of the first link, the method further includes: A third link is selected from each of the candidate links, and the received traffic is forwarded through the third link.

8. The method according to claim 1, characterized in that: The method further comprises: In response to the existence of a fourth link between the current node and the next node, the received traffic is forwarded through the fourth link, and the forwarding function of the first link is disabled, wherein the fourth link is a newly added link in a non-abnormal state or any of the candidate links that changes from the abnormal state to the non-abnormal state.

9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the traffic forwarding method as described in any one of claims 1 to 8.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the traffic forwarding method according to any one of claims 1 to 8 are implemented.

11. A computer program product, characterized in that The computer program product includes program instructions, and when the program instructions are executed by a computer, the computer implements the steps of the traffic forwarding method according to any one of claims 1 to 8.