A link detection method, device and storage medium

CN116915674BActive Publication Date: 2026-09-11BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311005788.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-10
Publication Date
2026-09-11
Estimated Expiration
2043-08-10

AI Technical Summary

Technical Problem

假设源网际互连协议选择正确的情况下,就会造成探测请求报文在另外一条链路上发送,这样计算的数据就不能真实反应该链路的质量

Benefits of technology

[0036] The link detection method in this application determines the source Internet Protocol (IP) address of the probe packet by using the configuration parameters of the link to be detected. When the source IP address and the next hop IP address recorded in the routing table belong to the same network segment, the next hop is determined as the target next hop. Then, based on the target next hop, the probe packet is sent to ensure that the probe packet can use the correct source IP address during link detection, and to ensure that the probe response packet can be received on the correct link, so that the calculated link quality is real and usable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116915674B_ABST
    Figure CN116915674B_ABST
Patent Text Reader

Abstract

The application provides a link detection method, device and storage medium. The method comprises: configuring a configuration parameter of a link to be detected; the configuration parameter at least comprises a gateway address corresponding to the link to be detected and an out interface; determining a source Internet Protocol address of a detection packet according to the gateway address and the out interface; detecting whether the source Internet Protocol address and an Internet Protocol address of a next hop recorded in a routing table belong to a same network segment; when they belong to the same network segment, determining a target next hop; and sending the detection packet based on an Internet Protocol address of the target next hop. The link detection method of the application embodiment can ensure that the detection packet can use a correct source Internet Protocol address when link detection is performed, and ensure that a detection response packet can be received on a correct link, so that the calculated link quality is real and available.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network security monitoring technology, and in particular to a link detection method, device and storage medium. Background Technology

[0002] Since the link probe messages are sent locally, a source Internet Protocol (IP) needs to be selected for the probe messages. Currently, the system can only select the source IP based on the interface and next hop, which are obtained by looking up routes. However, since there are two equal-cost routes in the system, regardless of the algorithm used, the selected route may not match the gateway configured on the link. This will cause the selected source IP to not correspond to the link, resulting in the probe response message from one link returning from the other link. As a result, the calculated data cannot accurately reflect the quality of the link.

[0003] When selecting the next hop, the route is searched only based on the destination address and the specified interface, and a weighted round-robin algorithm is used to select the next hop. This means the selected next hop may not correspond to the source Internet Protocol (IP). Assuming the source IP is correctly selected, this could cause probe request packets to be sent on a different link, resulting in calculated data that does not accurately reflect the quality of that link. Summary of the Invention

[0004] This application is made in view of at least one of the aforementioned technical problems existing in the prior art. According to one aspect of this application, a link detection method is provided, the method comprising:

[0005] Configure the configuration parameters of the link to be probed; wherein the configuration parameters include at least: the gateway address, destination port address, outgoing interface and service level protocol corresponding to the link to be probed;

[0006] The source Internet Protocol address of the probe packet is determined based on the gateway address corresponding to the link to be probed and the outgoing interface.

[0007] Detect whether the source Internet Protocol address belongs to the same network segment as the next-hop Internet Protocol address recorded in the routing table;

[0008] When the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, the next hop recorded in the routing table is determined as the target next hop;

[0009] The probe message is sent based on the Internet Protocol address of the next hop of the target.

[0010] In some embodiments, the method further includes:

[0011] When there are multiple next hops in the routing table, the next hop that belongs to the same network segment as the source Internet Protocol address is selected from the multiple next hops as the target next hop.

[0012] In some embodiments, when the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, determining the next hop recorded in the routing table as the target next hop includes:

[0013] The target route is found based on the destination port address; wherein the target route stores the routing table.

[0014] When the target route is found, the number of next hops is checked according to the routing table to see if there are multiple hops.

[0015] When there are multiple next hops, the multiple next hops are polled to determine the target next hop that belongs to the same network segment as the source Internet Protocol address.

[0016] In some embodiments, when the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, determining the next hop recorded in the routing table as the target next hop includes:

[0017] When polling the plurality of next hops, if it is impossible to determine a next hop that belongs to the same network segment as the source Internet Protocol address, a weight is configured for each next hop, and a weighted round-robin algorithm is used to determine the target next hop.

[0018] In some embodiments, the method further includes:

[0019] If the target route is not found, an error message indicating that the destination port is unreachable is returned.

[0020] In some embodiments, the method further includes:

[0021] When the number of next hops recorded in the routing table is unique, then the unique next hop is the target next hop.

[0022] In some embodiments, the method further includes:

[0023] Detect whether there is an event that triggers the update of the source Internet Protocol address;

[0024] When an event triggers an update of the source Internet Protocol (IP) address, the source IP address of the link to be probed is updated.

[0025] In some embodiments, updating the source Internet Protocol address of the link to be probed includes:

[0026] When the link to be probed has a next hop, the source Internet Protocol address is determined based on the Internet Protocol address of the next hop and the already bound destination gateway port address, and then the source Internet Protocol address is updated.

[0027] If the link to be probed does not have a next hop, then if the link to be probed has a source Internet Protocol (IP) address, the source IP address is cleared and the source IP address is configured.

[0028] In some embodiments, the event that triggers the source Internet Protocol address update includes at least one of the following:

[0029] The destination gateway port address of the link to be probed has changed;

[0030] The destination gateway Internet Protocol address of the link to be probed has changed;

[0031] The destination gateway port address that was bound to the link to be probed has changed;

[0032] New links to be detected have been added.

[0033] Another embodiment of this application provides a link detection device, the device comprising:

[0034] The system includes a memory and a processor, wherein the memory stores a computer program that is executed by the processor, and the computer program, when executed by the processor, causes the processor to perform the link detection method as described above.

[0035] In another aspect, this application provides a storage medium storing a computer program that, when run by a processor, causes the processor to execute the link detection method described above.

[0036] The link detection method in this application determines the source Internet Protocol (IP) address of the probe packet by using the configuration parameters of the link to be detected. When the source IP address and the next hop IP address recorded in the routing table belong to the same network segment, the next hop is determined as the target next hop. Then, based on the target next hop, the probe packet is sent to ensure that the probe packet can use the correct source IP address during link detection, and to ensure that the probe response packet can be received on the correct link, so that the calculated link quality is real and usable. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This diagram illustrates a topology used in SD-WAN applications.

[0039] Figure 2 This is a schematic flowchart illustrating the process of selecting the source IP address for local outgoing data packets in a Linux system in traditional techniques.

[0040] Figure 3 This diagram illustrates a schematic flowchart of the process 300 in which the Test Operating System (TOS) selects the next hop in conventional techniques.

[0041] Figure 4 A schematic flowchart of a link detection method according to an embodiment of this application is shown;

[0042] Figure 5 A schematic flowchart illustrating step S404 according to an embodiment of this application is shown;

[0043] Figure 6 A schematic flowchart illustrating step S404 according to another embodiment of this application is shown;

[0044] Figure 7 A schematic flowchart illustrating step C1 according to an embodiment of this application is shown;

[0045] Figure 8 A schematic flowchart illustrating step D1 according to an embodiment of this application is shown;

[0046] Figure 9 A schematic flowchart illustrating the process 900 of selecting the next hop according to an embodiment of this application is shown.

[0047] Figure 10 A schematic diagram of a test topology for probing the link to be probed according to an embodiment of this application is shown;

[0048] Figure 11 A schematic flowchart illustrating the updating of the source IP address of the link to be probed according to an embodiment of this application;

[0049] Figure 12 A schematic flowchart illustrating the process of determining the source IP of a link to be probed according to an embodiment of this application;

[0050] Figure 13 A schematic flowchart illustrating the process of updating the source IP according to an embodiment of this application is shown;

[0051] Figure 14 A schematic flowchart illustrating step E1 according to an embodiment of this application is shown;

[0052] Figure 15 A schematic block diagram of a link detection device according to an embodiment of this application is shown. Detailed Implementation

[0053] To enable those skilled in the art to better understand the technical solutions of the embodiments of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] Currently, in software-defined wide area network (SD-WAN) services, most operations are based on link quality, making link quality detection particularly important. For example... Figure 1 The diagram illustrates a topology in an SD-WAN use case. The first customer pre-installed equipment (CPE) 101 has two links connected via a switch (SW) 103 to the ETH1 and ETH2 links of the second customer pre-installed equipment 103, respectively. For example, the CPE could be a gateway. Before probing the two links, they need to be configured:

[0055] a) Configure two Internet Protocol (IP) addresses for links L1 and L2 on the ETH1 interface of the first customer front-end device 101, where IP address (1.1.1.1) corresponds to link L1 and IP address (2.2.2.1) corresponds to link L2;

[0056] b) Configure the addresses of two links L1 and L2 on the ETH1 and ETH2 interfaces of the second client front-end device 102, wherein the IP address (1.1.1.2) of the ETH1 interface of the second client front-end device corresponds to link L1, and the IP address (2.2.2.2) of the ETH2 interface of the second client front-end device corresponds to link L2.

[0057] c) Configure two equal-cost routes with the destination address being the address of server 104 (3.3.3.2), the outgoing interface ETH0 address being (3.3.3.1), and the gateways being the interface addresses of the second client front-end device 102's ETH1 interface (1.1.1.2) and ETH2 interface (2.2.2.2).

[0058] d) Configure a Service-Level Agreement (SLA) with the Server address (3.3.3.2) as the probe address, referencing the two links configured in step b), and configure other probe parameters.

[0059] Once configured, quality testing can be performed on both links.

[0060] Traditional SD-WAN products typically employ two steps for link detection: first, selecting the source IP address; and second, selecting the next hop. These steps will be briefly described below.

[0061] like Figure 2 The diagram shows a schematic flowchart of the process 200 for selecting the source IP address of outgoing data packets in a Linux system. The process 200 includes steps S201, S202, S203, and S204.

[0062] In step S201, a route is found based on the destination address and the specified outgoing interface.

[0063] When selecting the source IP address, the system first considers the destination address (i.e., the address being probed). Figure 1 The routing table is looked up using the address of the server and the specified outgoing interface (i.e., the interface bound to the link, which is the ETH1 interface of the first client's front-end device).

[0064] In step S202, determine whether a route has been found; if so, proceed to step S203; otherwise, proceed to step S204.

[0065] In step S203, the address of the source IP is selected based on the next hop and the outgoing interface.

[0066] In step S204, an error message indicating that the destination address is unreachable is returned.

[0067] If no route is found, a destination unreachable error can be returned, which means the process ends.

[0068] like Figure 3The diagram shown is a schematic flowchart of the process 300 for selecting the next hop in the Test Operating System (TOS). The process 300 for selecting the next hop in the Test Operating System (TOS) includes steps S301, S302, S303, S304, S305, and S306.

[0069] In step S301, a route is found based on the destination address and the specified outgoing interface.

[0070] When selecting the next hop, the system first considers the destination address (i.e., the address being probed, i.e.) Figure 1 The routing table is looked up using the address of the server and the specified outgoing interface (the link-bound interface, which is the ETH1 interface of the first client's front-end device).

[0071] In step S302, determine whether a route has been found; if so, proceed to step S303; otherwise, proceed to step S304.

[0072] In step S303, determine whether the number of next hops is greater than 1; if yes, proceed to step S305; otherwise, proceed to step S306.

[0073] In step S304, an error message indicating that the destination address is unreachable is returned.

[0074] If no route is found, a destination unreachable error can be returned, which means the process ends.

[0075] In step S305, a weighted round-robin algorithm is used to select a next hop based on the weight of each next hop configuration.

[0076] If there are multiple next hops, a weighted round-robin algorithm is used to select one next hop based on the weights configured for each next hop. This example configures two next hops, thus satisfying this condition.

[0077] In step S306, return to the next hop.

[0078] If a route is found, determine if there are multiple next hops. If there is only one, return that next hop and end the process.

[0079] Based on the example of the link probing method of the SD-WAN product in the above traditional technology, it can be seen that: (1) Since the link probing message is sent locally, it is necessary to select the source IP for the probing message. At present, the source IP can only be selected based on the interface and the next hop. The interface and the next hop are obtained by querying the route. However, since there are two equal-cost routes in the system, no matter what algorithm is used, the selected route may be inconsistent with the gateway configured on the link. This will cause the selected source IP and the link to not correspond when the message is answered, so that the probing response message sent by one link returns from the other link. Thus, the calculated data cannot truly reflect the quality of the link. (2) When selecting the next hop, only the destination address and the specified interface are used to search for the route, and the weighted round-robin algorithm is used to select the next hop. Thus, the selected next hop may not correspond to the source IP. Assuming that the source IP is selected correctly, the probing request message will be sent on another link.

[0080] To address at least one of the aforementioned technical problems, this application provides a link detection method, comprising: configuring configuration parameters of the link to be detected; wherein the configuration parameters include at least: the gateway address, destination port address, outgoing interface, and service level protocol corresponding to the link to be detected; determining the source Internet Protocol address of the probe packet based on the gateway address and the outgoing interface corresponding to the link to be detected; detecting whether the source Internet Protocol address belongs to the same network segment as the Internet Protocol address of the next hop recorded in the routing table; when the source Internet Protocol address belongs to the same network segment as the Internet Protocol address of the next hop recorded in the routing table, determining the next hop recorded in the routing table as the target next hop; and sending the probe packet based on the Internet Protocol address of the target next hop. The link detection method in this application determines the source Internet Protocol (IP) address of the probe packet by using the configuration parameters of the link to be detected. When the source IP address and the next hop IP address recorded in the routing table belong to the same network segment, the next hop is determined as the target next hop. Then, based on the target next hop, the probe packet is sent to ensure that the probe packet can use the correct source IP address during link detection, and to ensure that the probe response packet can be received on the correct link, so that the calculated link quality is real and usable.

[0081] Figure 4 A schematic flowchart of a link detection method according to an embodiment of this application is shown; as follows: Figure 4 As shown, the link detection method 400 according to an embodiment of this application may include the following steps S401, S402, S403, S404 and S405:

[0082] In step S401, the configuration parameters of the link to be detected are configured.

[0083] The configuration parameters include at least the gateway address, destination port address, outgoing interface, and service level protocol corresponding to the link to be probed.

[0084] The system allows direct configuration of parameters such as protocol type, destination gateway IP address, and destination gateway port address. Based on these configuration parameters, the source IP address of the probe packet can be determined.

[0085] In step S402, the source Internet Protocol address of the probe packet is determined based on the gateway address corresponding to the link to be probed and the outgoing interface.

[0086] Due to the existence of equal-cost routing, there may be multiple links to be probed, and the gateway address corresponding to each link to be probed needs to be configured.

[0087] For example, there are two links to be probed, L1 and L2, and correspondingly, there is a first client front-end device and a second client front-end device. First, the first client front-end device is configured with two gateway addresses: (1.1.1.1) and (2.2.2.1), where (1.1.1.1) corresponds to link L1 and (2.2.2.1) corresponds to link L2. Next, the second client front-end device is configured with two gateway addresses: (1.1.1.2) and (2.2.2.2), where (1.1.1.2) corresponds to link L1 and (2.2.2.2) corresponds to link L2. Then, two equal-cost routes are configured, with the destination address being the Server address, the outgoing interface being ETH0 (3.3.3.1), and the gateways being the interface addresses of CPEB's ETH1 (1.1.1.2) and ETH2 (2.2.2.2), respectively. Finally, configure the SLA, setting the probe address to the Server address (3.3.3.2). Then configure other probe parameters. These will not be elaborated upon here.

[0088] When determining the next hop of link L1, since the interface address corresponding to L1 on the first client front-end device is (1.1.1.1), and the address corresponding to link L1 on the second client front-end device is (1.1.1.2), the next hop for the source IP address (1.1.1.1) of the first client front-end device is the interface corresponding to (1.1.1.2). Similarly, when determining the next hop of link L2, since the interface address corresponding to L2 on the first client front-end device is (2.2.2.1), and the address corresponding to link L2 on the second client front-end device is (2.2.2.2), the next hop for the source IP address (2.2.2.1) of the first client front-end device is the interface corresponding to (2.2.2.2).

[0089] In one example of this application, the step of assembling a probe message based on the data to be sent is also included. The probe message is assembled from the gateway address, destination address, outgoing interface, and service level protocol corresponding to the link to be probed, and the data group to be sent, as configured in advance, for use in probing the link to be probed.

[0090] In step S403, it is detected whether the source Internet Protocol address belongs to the same network segment as the next-hop Internet Protocol address recorded in the routing table.

[0091] When an equal-cost route exists, the source IP address may have more than one next hop. Therefore, it is necessary to select the next hop based on the link to be probed so that probe packets can be sent according to the selected target next hop.

[0092] In step S404, when the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, the next hop recorded in the routing table is determined to be the target next hop.

[0093] In one embodiment of this application, the method further includes: when there are multiple next hops in the routing table, selecting a next hop that belongs to the same network segment as the source Internet Protocol address from the multiple next hops as the target next hop.

[0094] In one example, such as Figure 5 As shown, in step S404, when the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, the next hop recorded in the routing table is determined as the target next hop, including steps A1, A2, and A3:

[0095] In step A1, the target route is found based on the destination port address; wherein the target route stores the routing table.

[0096] In step A2, when the target route is found, the number of next hops is checked according to the routing table to see if there are multiple hops.

[0097] In step A3, when there are multiple next hops, the multiple next hops are polled to determine the target next hop that belongs to the same network segment as the source Internet Protocol address.

[0098] In this embodiment of the application, if the probe packet has multiple next hops, the next hop with the same source IP network segment as the probe packet is selected to send the probe packet, so as to ensure that the probe request packet can be sent on the correct link when the link is probed.

[0099] In one example, such as Figure 6As shown, in step S404, when the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, the next hop recorded in the routing table is determined as the target next hop, including step B1:

[0100] In step B1, when polling the plurality of next hops and it is impossible to determine the next hop that belongs to the same network segment as the source Internet Protocol address, a weight is configured for each next hop, and a weighted round-robin algorithm is used to determine the target next hop.

[0101] In this embodiment, if multiple next hops exist, and the correct next hop is not found after polling all the next hops, a weighted polling algorithm is used to determine the target next hop. For example, if there are two links L1 and L2, and link L1 is assigned a weight of 1 and link L2 is assigned a weight of 2, then when sending a probe message, one data packet is sent to link L1 with the smaller weight value, and two data packets are sent to link L2 with the larger weight value.

[0102] In one example, such as Figure 7 As shown, the method further includes step C1:

[0103] In step C1, if the target route is not found, an error message indicating that the destination port is unreachable is returned.

[0104] In another embodiment of this application, such as Figure 8 As shown, the method further includes step D1:

[0105] In step D1, when the number of next hops is unique, then the next hop is the target next hop.

[0106] In the current system, the next hop is selected based solely on the destination gateway IP address and destination gateway port address. Since there are two equal-cost routes and their outgoing interfaces are the same (both probe links are bound to the same interface, only the next hop is different), the selected next hop may not be what the probe packet wants. Therefore, it is necessary to obtain the correct next hop to ensure that the probe link is correctly probed for quality.

[0107] In one embodiment of this application, such as Figure 9 The diagram shown is a schematic flowchart of the next-hop selection process 900 according to an embodiment of this application. The next-hop selection process 900 according to an embodiment of this application may include steps S901, S902, S903, S904, S905, S906, S907, and S908:

[0108] In step S901, a route is found based on the destination address and the specified outgoing interface.

[0109] In step S902, determine whether a route has been found; if so, proceed to step S903; otherwise, proceed to step S907.

[0110] In step S903, determine whether the number of next hops is greater than 1; if yes, proceed to step S904; otherwise, proceed to step S908.

[0111] In step S904, multiple next hops are polled.

[0112] In step S905, it is determined whether the next hop and the source IP belong to the same network segment. If they do, step S908 is executed; otherwise, step S904 is returned to be executed.

[0113] In step S906, if the next hop cannot be determined after the polling is completed, the next hop is selected by weighted polling algorithm according to the weight of each next hop, and then step S908 is executed.

[0114] If there are multiple next hops, a weighted round-robin algorithm is used to select one next hop based on the weights configured for each next hop. This example configures two next hops, thus satisfying this condition.

[0115] In step S907, an error message indicating that the destination address is unreachable is returned.

[0116] If no route is found, a destination unreachable error can be returned, which means the process ends.

[0117] In step S908, return to the next hop.

[0118] In this embodiment, when multiple next hops exist, a round-robin algorithm can be used to determine the target next hop. If the round-robin algorithm still cannot determine the target next hop, a weighted round-robin algorithm can be used. For details, refer to the weighted round-robin algorithm in traditional techniques; it will not be elaborated here. Using the above round-robin algorithm, a next hop with the same IP network segment as the source IP of the probe packet can be selected to send the probe packet, thus ensuring that the probe request packet is sent on the correct link during link probing.

[0119] In step S405, the probe message is sent based on the Internet Protocol address of the next hop of the target.

[0120] In this embodiment of the application, a probe message is sent according to the Internet Protocol address of the target next hop determined in the above steps, so as to facilitate the probe of the link to be probed.

[0121] In one example of this application, such as Figure 10The diagram shows a test topology for probing the links to be probed. This test is based on an SD-WAN CPE and illustrates the use of the link probing method provided in this application to probe links L1 and L2 on a CPE-A 1001 device, checking whether the probe results are correct and whether the probe packets are all sent to the correct links.

[0122] Figure 10 The network devices in the system are configured as follows:

[0123] CPE-A 1001:

[0124] ETH1: 1.1.1.2 / 24, 2.2.2.2 / 24

[0125] Router: dst 5.5.5.0 / 24gw 1.1.1.1

[0126] dst 5.5.5.0 / 24gw 2.2.2.1

[0127] CPE-B 1002:

[0128] ETH0:5.5.5.1 / 24

[0129] ETH1:1.1.1.1 / 24

[0130] ETH2:2.2.2.1 / 24

[0131] Server: 5.5.5.2

[0132] The testing methods for this application are described in detail below:

[0133] 1. After CPE-A starts, log in to the World Wide Web (WEB) page (you can also configure it via command line; here we take WEB configuration as an example), select "Network Management > SD-WAN" to activate the "Link Management" tab.

[0134] 2. Configure each link. First, add link L1, configure the gateway as the interface address of CPE-B's ETH1 (1.1.1.1), and bind the interface to ETH1; add link L2, configure the gateway as the interface address of CPE-B's ETH2 (2.2.2.1), and bind the interface to ETH1.

[0135] 3. Configure link health checks. Go to the "Link Health Check" tab, add a link health check entry SLA, set the probe address to the address of Server 1003 (5.5.5.2), the probe period to 5 seconds, and the probe links to L1 and L2.

[0136] 4. Capture data packets on CPE-B to check if the source IP of the probe packets is correct, and whether the probe request and response packets are sent to the wrong link.

[0137] In practice, based on actual test data, it was confirmed that the source IP was correct and that the probe request and response packets also indicated a correct link.

[0138] The link detection method in this application determines the source Internet Protocol (IP) address of the probe packet by using the configuration parameters of the link to be detected. When the source IP address and the next hop IP address recorded in the routing table belong to the same network segment, the next hop is determined as the target next hop. Then, based on the target next hop, the probe packet is sent to ensure that the probe packet can use the correct source IP address during link detection, and to ensure that the probe response packet can be received on the correct link, so that the calculated link quality is real and usable.

[0139] In yet another embodiment of this application, as Figure 11 The diagram shown is a schematic flowchart of the process 1100 for updating the source IP address of the link to be probed. Figure 11 As shown, the process 1100 of updating the source IP address of the link to be probed includes steps 1101 and 1102:

[0140] In step 1101, the source IP address of the link to be probed is updated.

[0141] In step 1102, during the probe, the source IP address of the link to be probed is bound to the socket so as to send the probe packet corresponding to the source IP address.

[0142] In one example, such as Figure 12 The diagram shown is a schematic flowchart of process 12 for determining the source IP of the link to be probed, according to an embodiment of this application. Figure 12 As shown, determining the source IP for the link to be probed includes steps S1201, S1202, S1203, S1204, S1205, S1206, and S1207:

[0143] In step S1201, it is determined whether the link to be detected has a next hop; if so, step S1202 is executed; otherwise, step S1205 is executed.

[0144] In step S1202, the source IP is selected based on the next hop and the bound outgoing interface; then step S1203 is executed.

[0145] In step S1203, determine whether a source IP address has been selected; if yes, proceed to step S1204; otherwise, proceed to step S1207.

[0146] In step S1204, update the source IP of the link to be probed; then proceed to step S1207.

[0147] In step S1205, determine whether the link to be probed has been configured with a source IP; if yes, proceed to step S1206; otherwise, proceed to step S1207.

[0148] In step S1206, the source IP of the link to be probed is cleared; then step S1207 is executed.

[0149] In step S1207, the current process ends.

[0150] In this embodiment, if the link to be probed is not configured with a next hop, it checks whether the link to be probed has a configured source IP. If a source IP is configured, it needs to be cleared from the link to be probed, because the source IP may be incorrect at this time. As for the selection of the source IP, it can be handled by an operating system such as Linux after the source IP on the link to be probed is cleared.

[0151] Additionally, if the source IP has already been configured, when probing the link to be probed, the source IP of the link to be probed can be bound to the corresponding socket. In this way, the Linux protocol stack will determine that the source IP of the packet has been specified, and there is no need to select the source IP again.

[0152] In another example, such as Figure 13 As shown, the method further includes steps E1 and A2:

[0153] In step A1, it is detected whether there is an event that triggers the update of the source IP address.

[0154] In step A2, if an event triggers the update of the source IP address, the source IP address of the link to be probed is updated.

[0155] In this embodiment, the correct source IP for probe packets is selected for the link to be probed based on the gateway configured on the link and the bound outgoing interface. A passive update method is used when selecting the source IP; the source IP is only updated when an event that might cause a change occurs, thus avoiding the performance overhead of obtaining the source IP for each probe.

[0156] In one example, the event that triggers the source IP address update includes at least one of the following:

[0157] (1) The destination gateway port address of the link to be detected has changed.

[0158] In the embodiments of this application, adding or deleting the interface address of the link to be probed will affect the selection of the source IP of the link to be probed. Therefore, when the event of adding or deleting the interface address of the link to be probed is received, the link source IP needs to be updated.

[0159] (2) The destination gateway IP address of the link to be probed has changed.

[0160] In the embodiments of this application, since changes to the destination gateway of the link to be probed will also affect the selection of the link source IP, the link source IP also needs to be updated after a change in the gateway of the link to be probed is received.

[0161] (3) The address of the destination gateway port that is bound to the link to be probed changes.

[0162] In the embodiments of this application, since the source IP of the link to be probed needs to be selected from the gateway port address bound to the link to be probed in advance, if the gateway port address bound to the link to be probed changes, the link source IP needs to be updated.

[0163] (4) Added new links to be detected.

[0164] In the embodiments of this application, since the source IP is selected first when adding a new link to be probed, the link source IP also needs to be updated.

[0165] In one embodiment of this application, such as Figure 14 As shown, in step E1, the source IP address of the link to be probed is updated, including steps F1 and F2:

[0166] In step F1, when the link to be probed has a next hop, the source IP address is determined based on the IP address of the next hop and the bound destination gateway port address, and then the source IP address is updated.

[0167] In step F2, if the link to be probed does not have a next hop, then if the link to be probed has a source IP address, then the source IP address is cleared and the source IP address is configured.

[0168] In this embodiment, the source IP of the probe packet is first determined based on the gateway port address bound to the link to be probed and the gateway configured for the link to be probed. Then, the source IP is passively updated when an event that may cause the source IP to change occurs. This ensures that the probe packet can use the correct source IP when the link to be probed is being probed for quality testing.

[0169] This application addresses the problem that current link probing cannot select the correct source IP address and the correct target next hop for probe packets, leading to unreliable calculated link quality. This application provides a method for specifying the source IP address of probe packets and selecting the next hop, ensuring that probe request packets and response packets are sent and received on the correct link. This ensures that the calculated link quality is accurate and usable, making SD-WAN routing based on link quality more accurate and reliable.

[0170] The following is combined with Figure 15 The link detection device of this application is described, wherein, Figure 15 A schematic block diagram of a link detection device according to an embodiment of this application is shown.

[0171] like Figure 15 As shown, the link detection device 1500 includes: one or more memories 1501 and one or more processors 1502. The memories 1501 store a computer program that is executed by the processors 1502. When the computer program is executed by the processors 1502, the processors 1502 perform the link detection method described above.

[0172] The link detection device 1500 can be part or all of a computer device that can implement the link detection method through software, hardware, or a combination of software and hardware.

[0173] like Figure 15 As shown, the link detection device 1500 includes one or more memories 1501, one or more processors 1502, a display (not shown), and a communication interface, etc., which are interconnected via a bus system and / or other forms of connection mechanisms (not shown). It should be noted that... Figure 15 The components and structures of the base link detection device 1500 shown are merely exemplary and not limiting. The base link detection device 1500 may also have other components and structures as needed.

[0174] Memory 1501 is used to store various data and executable program instructions generated during operation, such as algorithms for storing various applications or implementing various specific functions. It may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.

[0175] The processor 1502 may be a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other processing units with data processing capabilities and / or instruction execution capabilities, and may be other components in the data management device 1500 based on data fusion to perform the desired functions.

[0176] In one example, the link detection device 1500 also includes an output device that can output various information (such as images or sounds) to the outside (e.g., a user), and may include one or more of a display device, a speaker, etc.

[0177] The communication interface can be any known communication protocol interface, such as a wired interface or a wireless interface. The communication interface may include one or more serial ports, USB interfaces, Ethernet ports, WiFi, wired networks, DVI interfaces, device integrated interconnect modules, or other suitable ports, interfaces, or connections.

[0178] Furthermore, according to embodiments of this application, a storage medium is also provided, on which program instructions are stored. When executed by a computer or processor, these program instructions are used to perform corresponding steps of the link detection method of this application. The storage medium may, for example, include a memory card of a smartphone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media.

[0179] The link detection device and storage medium of this application embodiment have the same advantages as the aforementioned link detection method because they can implement the aforementioned link detection method.

[0180] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of this application. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of this application. All such changes and modifications are intended to be included within the scope of this application as claimed in the appended claims.

[0181] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0182] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.

[0183] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0184] Similarly, it should be understood that, in order to streamline this application and aid in understanding one or more of the various inventive aspects, features of this application may sometimes be grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of this application. However, this approach should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, its inventive point lies in solving the corresponding technical problem with features fewer than all features of a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.

[0185] Those skilled in the art will understand that, apart from the mutual exclusion of features, all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or apparatus so disclosed can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0186] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.

[0187] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules according to the embodiments of this application. This application can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0188] It should be noted that the above embodiments are illustrative of this application and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0189] The above description is merely a specific embodiment or illustration of the embodiments of this application. The scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. The scope of protection of this application shall be determined by the scope of the claims.

Claims

1. A method of link probing, the method comprising: The method includes: Configure the configuration parameters of the link to be probed; wherein the configuration parameters include at least: the gateway address, destination port address, outgoing interface and service level protocol corresponding to the link to be probed; The source Internet Protocol address of the probe packet is determined based on the gateway address corresponding to the link to be probed and the outgoing interface. Detect whether the source Internet Protocol address belongs to the same network segment as the next-hop Internet Protocol address recorded in the routing table; When the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, the next hop recorded in the routing table is determined as the target next hop; The probe message is sent based on the Internet Protocol address of the next hop of the target.

2. The method of claim 1, wherein, The method further includes: When there are multiple next hops in the routing table, the next hop that belongs to the same network segment as the source Internet Protocol address is selected from the multiple next hops as the target next hop.

3. The method of claim 2, wherein, When the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, determining the next hop recorded in the routing table as the target next hop includes: The target route is found based on the destination port address; wherein the target route stores the routing table. When the target route is found, the number of next hops is checked according to the routing table to see if there are multiple hops. When there are multiple next hops, the multiple next hops are polled to determine the target next hop that belongs to the same network segment as the source Internet Protocol address.

4. The method of claim 3, wherein, When the source Internet Protocol address and the Internet Protocol address of the next hop recorded in the routing table belong to the same network segment, determining the next hop recorded in the routing table as the target next hop includes: When polling the plurality of next hops, if it is impossible to determine a next hop that belongs to the same network segment as the source Internet Protocol address, a weight is configured for each next hop, and a weighted round-robin algorithm is used to determine the target next hop.

5. The method of claim 3, wherein, The method further includes: If the target route is not found, an error message indicating that the destination port is unreachable is returned.

6. The method of claim 1, wherein, The method further includes: When the number of next hops recorded in the routing table is unique, then the unique next hop is the target next hop.

7. The method of claim 1, wherein, The method further includes: Detect whether there is an event that triggers the update of the source Internet Protocol address; When an event triggers an update of the source Internet Protocol (IP) address, the source IP address of the link to be probed is updated.

8. The method of claim 7, wherein, Updating the source Internet Protocol address of the link to be probed includes: When the link to be probed has a next hop, the source Internet Protocol address is determined based on the Internet Protocol address of the next hop and the already bound destination gateway port address, and then the source Internet Protocol address is updated. If the link to be probed does not have a next hop, then if the link to be probed has a source Internet Protocol (IP) address, the source IP address is cleared and the source IP address is configured.

9. The method of claim 8, wherein, The event that triggers the source Internet Protocol address update includes at least one of the following: The destination gateway port address of the link to be probed has changed; The destination gateway Internet Protocol address of the link to be probed has changed; The destination gateway port address that was bound to the link to be probed has changed; New links to be detected have been added.

10. A link discovery apparatus, characterized by comprising: The device includes: A memory and a processor, wherein the memory stores a computer program that is executed by the processor, the computer program, when executed by the processor, causes the processor to perform the link detection method as described in any one of claims 1 to 9.

11. A storage medium, characterized by The storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the link detection method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Monitoring network fault method and device

    CN105959129A

  • Adaptive source address rewrite

    US20220294758A1