Method and device for a multi-WAN port CPE to select a primary WAN port

By monitoring packet loss and delay data of the WAN port in real time, measuring and selecting the optimal WAN port as the main WAN port, the problem of not being able to switch to a smooth network in time in the prior art is solved, and the stability and reliability of multi-WAN devices are achieved.

CN116132333BActive Publication Date: 2025-07-25GUANGZHOU TOZED KANGWEI INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310037235.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-06
Publication Date
2025-07-25
Estimated Expiration
2043-01-06

AI Technical Summary

Technical Problem

Existing multi-WAN devices cannot detect the actual network performance of the WAN port in real time, resulting in the inability to switch to a smooth network in time when the network performance is deteriorated, affecting the stability and reliability of the service.

Method used

By monitoring packet loss and delay data of each WAN port within the CPE in real time, determining whether it exceeds the preset threshold, the cyclic switching server re-measures the performance of the degraded WAN port, and selecting the optimal WAN port as the main WAN port according to the priority policy.

Benefits of technology

Real-time network performance monitoring of multiple WAN ports is realized, deteriorated links are discovered in a timely manner and switch to the optimal link, avoid misjudgment, and ensure the stability and reliability of network services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132333B_ABST
    Figure CN116132333B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of network communication technologies, and discloses a method for a multi-WAN-port CPE to select a primary WAN port. This method can obtain the packet loss and latency data of each WAN port inside the CPE in real time. When the packet loss and latency data exceed a preset threshold, it first determines whether the WAN port that exceeds the threshold is the primary WAN port. If so, it switches the server to re-measure the packet loss and latency data of this WAN port until the number of re-measurements also reaches the threshold, and it can be determined that the communication quality of this primary WAN port has deteriorated. It is necessary to select the optimal WAN port from the WAN port list stored inside the CPE and replace the primary WAN port. The present invention can continuously monitor the real-time network performance of multiple WAN ports to timely detect the deterioration of the network performance of the currently used primary WAN link and switch to the optimal WAN link. At the same time, it can avoid misjudgment through a redundancy algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technologies, and particularly to a method and device for a multi-WAN port CPE to select a primary WAN port. Background Art

[0002] Currently, most multi-WAN devices use methods such as sending ping packets, performing DHCP detection, and DNS detection on each WAN port to detect the connectivity of the WAN port, so as to determine whether a certain WAN port is in an available state.

[0003] However, the existing methods can only detect the connectivity of the WAN port and do not detect the actual network performance of the port, including indicators such as round-trip delay, packet loss, and network jitter of data packets in multiple scenarios (such as between the upper-level device and the server remotely carrying actual services), which reflect network congestion and link anomalies. When the network performance deteriorates severely, such as with a large amount of packet loss and long delays, the WAN port link is not switched to a smooth network in a timely manner, and the stable and reliable support for services cannot be well achieved. Summary of the Invention

[0004] The present invention provides a method and device for a multi-WAN port CPE to select a primary WAN port, which can continuously monitor the real-time network performance of multiple WAN ports, timely detect the deterioration of the network performance of the primary WAN link currently in use, and switch to the optimal WAN link.

[0005] To solve the above technical problems, the first embodiment of the present invention provides a method for a multi-WAN port CPE to select a primary WAN port, including:

[0006] Obtaining in real time the packet loss and delay data of each WAN port inside the CPE, and detecting whether the packet loss and delay data of each WAN port exceed a preset data threshold;

[0007] When it is detected that the packet loss and delay data of the first WAN port exceed the preset data threshold, determining whether the first WAN port is the primary WAN port;

[0008] If the first WAN port is the primary WAN port, cycling through the servers to re-measure the packet loss and delay data of the first WAN port until the number of re-measurements reaches a preset measurement threshold, and determining that the communication quality of the first WAN port has deteriorated;

[0009] Selecting the optimal second WAN port from the list of the first WAN ports inside the CPE according to a preset priority policy, and setting the second WAN port as the primary WAN port.

[0010] The present invention can obtain the packet loss and latency data of each WAN port inside the CPE in real time. When the packet loss and latency data exceed the preset threshold, it first determines whether the WAN port with the exceeded threshold is the primary WAN port. If so, it switches the server to re-measure the packet loss and latency data of this WAN port until the number of re-measurements also reaches the threshold, and it can be determined that the communication quality of this primary WAN port has deteriorated. It is necessary to select the optimal WAN port from the list of WAN ports stored inside the CPE and replace the primary WAN port to ensure the actual network performance of the multi-WAN ports.

[0011] Further, detecting whether the packet loss and latency data of each WAN port exceed the preset data threshold specifically includes:

[0012] When it is detected that the packet loss and latency data of the first WAN port do not exceed the preset data threshold, add the first WAN port to the first WAN port list inside the CPE.

[0013] The present invention can detect each WAN port of the CPE in real time. If the detected packet loss and latency data do not exceed the preset threshold, the corresponding WAN port can be added to the WAN port list inside the CPE so that a WAN port meeting the requirements can be found in time to replace it as the primary WAN port.

[0014] Further, determining whether the first WAN port is the primary WAN port specifically includes:

[0015] If the first WAN port is not the primary WAN port, there is no need to switch the server to detect the packet loss and latency data of the first WAN port again.

[0016] When the present invention detects each WAN port of the CPE in real time, if it is detected that the packet loss and latency data of a certain WAN port exceed the threshold, but this WAN port is not the primary WAN port, there is no need to switch the server to detect again, reducing resource consumption.

[0017] Further, the loop of switching the server to re-measure the packet loss and latency data of the first WAN port until the number of re-measurements reaches the preset measurement threshold specifically includes:

[0018] If it is detected during re-measurement that the packet loss and latency data of the first WAN port are less than the preset data threshold, it is determined that the first WAN port has no deteriorated communication quality.

[0019] If the present invention detects during re-measurement that the packet loss and latency data are less than the preset data threshold, it can be determined that the corresponding WAN port has no deteriorated communication quality and can continue to operate with the primary WAN port without subsequent operation of replacing the primary WAN port.

[0020] Further, before obtaining the packet loss and latency data of each WAN port inside the CPE in real time, the following steps are also included:

[0021] Detect the number of WAN ports inside the CPE. If there is only one WAN port inside the CPE, there is no need to obtain the packet loss and latency data of the WAN port.

[0022] When the present invention detects the packet loss and latency data of the WAN port, it will first detect the number of WAN ports. If there is only 1 WAN port in the CPE, since there is no extra WAN port available for replacing the primary WAN port, no further detection is required, thus saving the detection process.

[0023] The present invention provides a method for a multi-WAN-port CPE to select a primary WAN port, which can obtain the packet loss and latency data of each WAN port inside the CPE in real time. When the packet loss and latency data exceed the preset threshold, it first determines whether the WAN port exceeding the threshold is the primary WAN port. If so, it switches the server to re-measure the packet loss and latency data of this WAN port until the number of re-measurements also reaches the threshold, and it can be determined that the communication quality of this primary WAN port has deteriorated. It is necessary to select the optimal WAN port from the WAN port list stored inside the CPE and replace the primary WAN port. The present invention can continuously monitor the real-time network performance of multiple WAN ports to timely detect the deterioration of the network performance of the currently used primary WAN link, switch to the optimal WAN link, and at the same time can avoid misjudgment through a redundancy algorithm.

[0024] Correspondingly, the present invention provides a device for a multi-WAN-port CPE to select a primary WAN port, including: an acquisition module, a judgment module, a loop module, and a setting module;

[0025] The acquisition module is used to obtain the packet loss and latency data of each WAN port inside the CPE in real time and detect whether the packet loss and latency data of each WAN port exceed the preset data threshold;

[0026] The judgment module is used to judge whether the first WAN port is the primary WAN port when it detects that the packet loss and latency data of the first WAN port exceed the preset data threshold;

[0027] The loop module is used to, if the first WAN port is the primary WAN port, loop to switch the server to re-measure the packet loss and latency data of the first WAN port until the number of re-measurements reaches the preset measurement threshold, and determine that the communication quality of the first WAN port has deteriorated;

[0028] The setting module is used to select the optimal second WAN port from the first WAN port list inside the CPE according to the preset priority strategy and set the second WAN port as the primary WAN port.

[0029] Further, the obtaining module includes: a list unit;

[0030] The list unit is configured to add the first WAN port to the first WAN port list inside the CPE when it is detected that the packet loss and latency data of the first WAN port do not exceed a preset data threshold.

[0031] Further, the judging module includes: a switching unit;

[0032] The switching unit is configured to, if the first WAN port is not the primary WAN port, there is no need to switch the server to detect the packet loss and latency data of the first WAN port again.

[0033] Further, the looping module includes: a determining unit;

[0034] The determining unit is configured to, if it is detected that the packet loss and latency data of the first WAN port are less than a preset data threshold during re-measurement, determine that the communication quality of the first WAN port has not deteriorated.

[0035] Further, the obtaining module includes: a detecting unit;

[0036] The detecting unit is configured to detect the number of WAN ports inside the CPE. If there is only one WAN port inside the CPE, there is no need to obtain the packet loss and latency data of the WAN port.

[0037] The present invention provides a device for a multi-WAN-port CPE to select a primary WAN port. Based on the organic combination of modules, the device can continuously monitor the real-time network performance of multiple WAN ports, timely detect the deterioration of the network performance of the currently used primary WAN link, and switch to the optimal WAN link. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic flowchart of an embodiment of the method for a multi-WAN-port CPE to select a primary WAN port provided by the present invention;

[0039] Figure 2 It is a network topology diagram of an embodiment of the method for a multi-WAN-port CPE to select a primary WAN port provided by the present invention;

[0040] Figure 3 It is a flowchart of an embodiment of the method for a multi-WAN-port CPE to select a primary WAN port provided by the present invention;

[0041] Figure 4 It is a schematic structural diagram of an embodiment of the device for a multi-WAN-port CPE to select a primary WAN port provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0042] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0043] As Figure 1 shown, it is a schematic flowchart of an embodiment of a method for a multi-WAN port CPE to select a primary WAN port provided by the present invention. The method includes steps 101 to 104, and the specific steps are as follows:

[0044] Step 101: Real-time obtain the packet loss and delay data of each WAN port inside the CPE, and detect whether the packet loss and delay data of each WAN port exceed a preset data threshold.

[0045] In the embodiments of the present invention, CPE refers to any connection device used to access the Internet or services on the provider network, which can be directly or indirectly connected to the network.

[0046] As an example in the embodiments of the present invention, as Figure 2 shown, it is a network topology diagram of an embodiment of a method for a multi-WAN port CPE to select a primary WAN port provided by the present invention. The CPE has multiple WAN ports, and in actual applications, it can be extended to support multiple core networks or virtual private networks. Figure 2 Taking the two core networks, core network A and core network B, as an example. There are many protocols that can measure network performance, but these protocols also have their own disadvantages. For example, OWAMP can only perform one-way measurement and requires time alignment between the client and the server, and the implementation conditions are harsh; snmp has slow response and sampling speeds, generally in minutes; netperf and netflow are complex to implement, and many companies use private standards. While TWAMP is an RFC public open-source standard, which is relatively simple to implement and occupies less resources, and can monitor the network sending and receiving situations in real time every moment, every minute, and even every second, with prominent advantages. Therefore, the TWAMP protocol can be selected as an example. As Figure 2 shown, the TWAMP protocol client runs inside the CPE and continuously interacts with the servers running the TWAMP protocol server in each core network through the TWAMP protocol. The TWAMP protocol can truly reflect the network conditions every moment, every minute, and even every second, accurately discover network delays and network packet losses, realize real-time monitoring of the network quality of the entire network, and ensure that the WAN port of the primary link always selects the network-optimal link by analyzing the delay and packet loss information.

[0047] As an example of the embodiment of the present invention, to determine whether the communication quality of the WAN port deteriorates, the round-trip delay and packet loss number of network test packets can be obtained by detecting the TWAMP protocol. If these two values exceed the thresholds set by the user, it can be determined that the network performance deteriorates. The thresholds set by the user depend on the usage scenario and user settings. For example, if the communication distance is 2000 km, the thresholds can be set as a round-trip delay of 2 s and a packet loss of 1%. If the detected round-trip delay exceeds 2 s and the packet loss exceeds 1%, it can be determined that the network performance of the WAN port deteriorates.

[0048] In the embodiment of the present invention, before the packet loss and delay data of each WAN port inside the CPE are obtained in real time, it further includes:

[0049] Detect the number of WAN ports inside the CPE. If there is only one WAN port inside the CPE, there is no need to obtain the packet loss and delay data of the WAN port.

[0050] In the embodiment of the present invention, when detecting the packet loss and delay data of the WAN port, the number of WAN ports will be detected first. If there is only 1 WAN port in the CPE, since there is no extra WAN port available for replacing the primary WAN port, further detection can be omitted, saving the detection process.

[0051] In the embodiment of the present invention, detecting whether the packet loss and delay data of each WAN port exceed the preset data thresholds specifically includes:

[0052] When it is detected that the packet loss and delay data of the first WAN port do not exceed the preset data thresholds, add the first WAN port to the first WAN port list inside the CPE.

[0053] In the embodiment of the present invention, during the process of real-time detecting each WAN port of the CPE, if the detected packet loss and delay data do not exceed the preset thresholds, the corresponding WAN port can be added to the WAN port list inside the CPE so as to find a WAN port that meets the requirements in time to replace it as the primary WAN port.

[0054] Step 102: When it is detected that the packet loss and delay data of the first WAN port exceed the preset data thresholds, determine whether the first WAN port is the primary WAN port.

[0055] In the embodiment of the present invention, determining whether the first WAN port is the primary WAN port specifically includes:

[0056] If the first WAN port is not the primary WAN port, there is no need to switch the server to detect the packet loss and delay data of the first WAN port again.

[0057] In an embodiment of the present invention, when each WAN port of the CPE is detected in real time, if the packet loss and latency data of a certain WAN port exceed the threshold, but this WAN port is not the primary WAN port, there is no need to switch the server to detect again, reducing resource consumption.

[0058] Step 103: If the first WAN port is the primary WAN port, cycle through switching the server to re-measure the packet loss and latency data of the first WAN port until the number of re-measurements reaches a preset measurement threshold, and determine that the communication quality of the first WAN port has deteriorated.

[0059] In an embodiment of the present invention, the cycle of switching the server to re-measure the packet loss and latency data of the first WAN port until the number of re-measurements reaches a preset measurement threshold is specifically as follows:

[0060] If the packet loss and latency data of the first WAN port detected during re-measurement are less than the preset data threshold, it is determined that the communication quality of the first WAN port has not deteriorated.

[0061] In an embodiment of the present invention, if the packet loss and latency data detected during re-measurement are less than the preset data threshold, it can be determined that the communication quality of the corresponding WAN port has not deteriorated, and it can continue to operate with the primary WAN port without subsequent operation of replacing the primary WAN port.

[0062] Step 104: In the list of the first WAN ports inside the CPE, select the optimal second WAN port according to a preset priority policy, and set the second WAN port as the primary WAN port.

[0063] In an embodiment of the present invention, when it is determined that the communication quality of the current primary WAN port has deteriorated, according to the packet loss and latency priority avoidance policy set by the user, in the list of the first WAN ports inside the CPE, select the optimal one WAN port according to the packet loss and latency priority avoidance policy set by the user and replace it with the primary WAN port.

[0064] Such as Figure 3As shown in the figure, it is a flowchart of an embodiment of the method for a multi-WAN CPE to select a primary WAN port provided by the present invention. The CPE detects the number of WAN ports and network card information existing inside in real time. Among them, the network card information is mainly used for actual coding implementation. Through the configuration of sockets and routing rules, it is realized that packet measurement is sent from the selected network card (WAN port hardware) and will not go wrong with other network cards or the default path. When it is detected that there is only one WAN port in the CPE, since there is no extra WAN port available for replacing the primary WAN port, no further detection is required. If the number of WAN ports is greater than 1, then the TWAMP measurement is performed on each WAN port in turn and regularly to obtain the packet loss and delay data of each WAN port. When it is detected that the packet loss or delay of a certain WAN port exceeds the threshold, first determine whether this WAN port is the primary WAN link. If so, it is necessary to enter the link degradation confirmation mode, switch to the next candidate TWAMP server, and continue to measure the packet loss and delay data. If the repeated measurement times reach the threshold and the packet loss and delay data of this WAN port both exceed the preset threshold, it is determined that the communication quality of this WAN port has deteriorated, and it is necessary to select the optimal one of the excellent WAN port lists stored in the CPE as the primary WAN port according to the packet loss and delay priority avoidance strategy set by the user.

[0065] Correspondingly, as Figure 4 shown in the figure, it is a schematic structural diagram of an embodiment of the device for a multi-WAN CPE to select a primary WAN port provided by the present invention. The device includes: an acquisition module 201, a judgment module 202, a loop module 203, and a setting module 204;

[0066] The acquisition module 201 is used to obtain the packet loss and delay data of each WAN port inside the CPE in real time, and detect whether the packet loss and delay data of each WAN port exceed the preset data threshold;

[0067] The judgment module 202 is used to judge whether the first WAN port is the primary WAN port when it is detected that the packet loss and delay data of the first WAN port exceed the preset data threshold;

[0068] The loop module 203 is used to, if the first WAN port is the primary WAN port, loop to switch the server to re-measure the packet loss and delay data of the first WAN port until the number of re-measurements reaches the preset measurement threshold, and determine that the communication quality of the first WAN port has deteriorated;

[0069] The setting module 204 is used to select the optimal second WAN port from the first WAN port list inside the CPE according to the preset priority strategy, and set the second WAN port as the primary WAN port.

[0070] In the embodiment of the present invention, the acquisition module 201 includes: a list unit;

[0071] The list unit is used to add the first WAN port to the first WAN port list inside the CPE when it is detected that the packet loss and delay data of the first WAN port do not exceed the preset data threshold.

[0072] In an embodiment of the present invention, the judgment module 202 includes: a switching unit;

[0073] The switching unit is used to, if the first WAN port is not the main WAN port, there is no need to switch the server to detect the packet loss and delay data of the first WAN port again.

[0074] In an embodiment of the present invention, the loop module 203 includes: a determination unit;

[0075] The determination unit is used to, if it is detected that the packet loss and delay data of the first WAN port are less than the preset data threshold during re-measurement, determine that the communication quality of the first WAN port has not deteriorated.

[0076] In an embodiment of the present invention, the acquisition module 201 includes: a detection unit;

[0077] The detection unit is used to detect the number of WAN ports inside the CPE. If there is only one WAN port inside the CPE, there is no need to obtain the packet loss and delay data of the WAN port.

[0078] In summary, the method and device for a multi-WAN-port CPE to select a main WAN port provided by the embodiments of the present invention can obtain the packet loss and delay data of each WAN port inside the CPE in real time. When the packet loss and delay data exceed the preset threshold, first judge whether the WAN port exceeding the threshold is the main WAN port. If so, switch the server to re-measure the packet loss and delay data of this WAN port until the number of re-measurements also reaches the threshold, it can be determined that the communication quality of this main WAN port has deteriorated, and it is necessary to select the optimal one from the WAN port list stored inside the CPE and replace the main WAN port. The present invention can continuously monitor the real-time network performance of multiple WAN ports to timely discover the deterioration of the network performance of the currently used main WAN link, switch to the optimal WAN link, and at the same time can avoid misjudgment through a redundancy algorithm.

[0079] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and replacements can still be made, and these improvements and replacements should also be regarded as the protection scope of the present invention.

Claims

1. A method for a multi-WAN port CPE to select a primary WAN port, characterized in that, Including: Obtain the packet loss and latency data of each WAN port inside the CPE in real time, and detect whether the packet loss and latency data of each WAN port exceed a preset data threshold; When it is detected that the packet loss and latency data of the first WAN port exceed the preset data threshold, determine whether the first WAN port is the primary WAN port; If the first WAN port is the primary WAN port, cycle through switching servers to re-measure the packet loss and latency data of the first WAN port until the number of re-measurements reaches the preset measurement threshold, and determine that the communication quality of the first WAN port has deteriorated; In the first WAN port list inside the CPE, select the optimal second WAN port according to the preset priority strategy, and set the second WAN port as the primary WAN port.

2. The method for a multi-WAN port CPE to select a primary WAN port according to claim 1, wherein The detection of whether the packet loss and latency data of each WAN port exceed the preset data threshold is specifically: When it is detected that the packet loss and latency data of the first WAN port do not exceed the preset data threshold, add the first WAN port to the first WAN port list inside the CPE.

3. The method for a multi-WAN port CPE to select a primary WAN port according to claim 1, wherein The determination of whether the first WAN port is the primary WAN port is specifically: If the first WAN port is not the primary WAN port, there is no need to switch the server to detect the packet loss and latency data of the first WAN port again.

4. The method for a multi-WAN port CPE to select a primary WAN port according to claim 1, wherein, The cycling through switching servers to re-measure the packet loss and latency data of the first WAN port until the number of re-measurements reaches the preset measurement threshold is specifically: If it is detected during re-measurement that the packet loss and latency data of the first WAN port are less than the preset data threshold, determine that the communication quality of the first WAN port has not deteriorated.

5. The method for selecting a primary WAN port of the multi-WAN port CPE according to claim 1, wherein Before the real-time acquisition of the packet loss and latency data of each WAN port inside the CPE, it also includes: Detect the number of WAN ports inside the CPE. If there is only one WAN port inside the CPE, there is no need to acquire the packet loss and latency data of the WAN port.

6. A device for a multi-WAN port CPE to select a primary WAN port, characterized in that, Including: An acquisition module, a judgment module, a cycling module, and a setting module; The acquisition module is used to obtain the packet loss and latency data of each WAN port inside the CPE in real time, and detect whether the packet loss and latency data of each WAN port exceed a preset data threshold; The judgment module is used to determine whether the first WAN port is the primary WAN port when it is detected that the packet loss and latency data of the first WAN port exceed the preset data threshold; The cycling module is used to cycle through switching servers to re-measure the packet loss and latency data of the first WAN port if the first WAN port is the primary WAN port until the number of re-measurements reaches the preset measurement threshold, and determine that the communication quality of the first WAN port has deteriorated; The setting module is used to select the optimal second WAN port according to the preset priority strategy in the first WAN port list inside the CPE, and set the second WAN port as the primary WAN port.

7. The device for selecting a primary WAN port of the multi-WAN-port CPE according to claim 6, wherein The acquisition module includes: a list unit; The list unit is used to add the first WAN port to the first WAN port list inside the CPE when it is detected that the packet loss and latency data of the first WAN port do not exceed the preset data threshold.

8. The apparatus for selecting a primary WAN port of the multi-WAN port CPE according to claim 6, wherein, The judgment module includes: a switching unit; The switching unit is used to, if the first WAN port is not the primary WAN port, there is no need to switch the server to detect the packet loss and latency data of the first WAN port again.

9. The apparatus for selecting a primary WAN port of a multi-WAN port CPE according to claim 6, wherein The loop module includes: a determination unit; The determination unit is used to, if it is detected that the packet loss and latency data of the first WAN port are less than a preset data threshold during re-measurement, determine that the communication quality of the first WAN port has not deteriorated.

10. The apparatus for selecting a primary WAN port of the multi-WAN port CPE according to claim 6, wherein The acquisition module includes: a detection unit; The detection unit is used to detect the number of WAN ports inside the CPE. If there is only one WAN port inside the CPE, there is no need to acquire the packet loss and latency data of the WAN port.

Citation Information

Patent Citations

  • Multi-path networking method and device

    CN113810164A

  • Multipath uplink load balancing method and device, computer equipment and storage medium

    CN113810945A