CN114629822A - Link detection method and device, electronic equipment and storage medium - Google Patents

Link detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114629822A
CN114629822A CN202210406869.0A CN202210406869A CN114629822A CN 114629822 A CN114629822 A CN 114629822A CN 202210406869 A CN202210406869 A CN 202210406869A CN 114629822 A CN114629822 A CN 114629822A
Authority
CN
China
Prior art keywords
link
target
normal
dns
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210406869.0A
Other languages
Chinese (zh)
Inventor
田娜
郭韶龙
刘涛
杨凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202210406869.0A priority Critical patent/CN114629822A/en
Publication of CN114629822A publication Critical patent/CN114629822A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results

Abstract

The present disclosure relates to a link detection method, an apparatus, an electronic device and a storage medium, which relate to the field of communication technology and are applied to a router, wherein the router corresponds to one or more links, and the method includes: sending a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any one of one or more links. And monitoring a DNS response message sent by the domain name server according to the DNS request message. And sending a link detection request message to the target server under the condition that the monitoring result of the DNS response message meets a preset abnormal condition. And determining whether the target link is normal or not according to the response of the target server to the link detection request message. The method and the device can ensure the normal communication function of the link and improve the accuracy of the link detection in the process of detecting the link.

Description

Link detection method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a link detection method and apparatus, an electronic device, and a storage medium.
Background
The router is a common household internet device, and along with the development of bandwidth and technology, the router can not only surf the internet by using a single link, but also can connect the internet by using multiple links, so that the bandwidth is doubled, and more convenient and faster experience is brought to users. Currently, the link status is usually determined by sending an ICMP (Internet Control Message Protocol) Message. However, if the ICMP message is sent for a long time and at a high frequency, the server may regard the action of the router as an "attack" action, and take actions such as no response and denial of service, which affect the normal network communication function. Moreover, when the detection result obtained by sending the ICMP message is normal, the link is not necessarily normal, which may cause erroneous determination and affect the accuracy of link detection.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a link detection method, an apparatus, an electronic device, and a storage medium.
According to a first aspect of the embodiments of the present disclosure, a link detection method is provided, which is applied to a router, where the router corresponds to one or more links; the method comprises the following steps:
sending a Domain Name System (DNS) request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any one of the one or more links;
monitoring a DNS response message sent by the domain name server according to the DNS request message;
under the condition that the monitoring result of the DNS response message meets a preset abnormal condition, a link detection request message is sent to a target server;
and determining whether the target link is normal or not according to the response of the target server to the link detection request message.
Optionally, the one or more links include a link, and the preset exception condition includes:
after a first preset time period is reached, the number of the received DNS response messages is less than or equal to a first preset number threshold; alternatively, the first and second liquid crystal display panels may be,
and receiving the DNS response messages in the first preset time period, wherein the number of the abnormal response messages in the received DNS response messages is greater than or equal to a second preset number threshold.
Optionally, the method further comprises:
and determining that the target link is normal when the DNS response message is received in the first preset time period and the number of normal response messages in the received DNS response message is greater than or equal to a third preset number threshold.
Optionally, the one or more links include a plurality of links, and the preset exception condition includes:
and receiving the DNS response messages in a second preset time period, wherein the number of the abnormal response messages in the received DNS response messages is greater than or equal to a fourth preset number threshold.
Optionally, the method further comprises:
determining that the target link is normal when the DNS response message is received in the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to a fifth preset number threshold; alternatively, the first and second liquid crystal display panels may be,
and determining that the target link is abnormal under the condition that the number of the received DNS response messages in the second preset time period is less than or equal to a sixth preset number threshold.
Optionally, the method further comprises:
and under the condition that the target link is abnormal, determining a normal link from the plurality of links, and transferring target traffic on the target link to the normal link so as to stop the data transmission of the target link.
Optionally, the method further comprises:
and under the condition that the target link is switched from abnormal to normal, transferring the target flow on the normal link to the target link so as to enable the target link to carry out data transmission according to the target flow.
Optionally, the determining, according to the response of the target server to the link detection request packet, whether the target link is normal includes:
determining that the target link is normal under the condition that a link detection response message sent by the target server according to the link detection request message is received within a third preset time period; alternatively, the first and second electrodes may be,
and after the third preset time period is reached, determining that the target link is abnormal under the condition that the link detection response message sent by the target server is not received.
According to a second aspect of the embodiments of the present disclosure, there is provided a link detection apparatus, which is applied to a router, where the router corresponds to one or more links; the device comprises:
the domain name system domain name server domain name;
the monitoring module is configured to monitor a DNS response message sent by the domain name server according to the DNS request message;
the second sending module is configured to send a link detection request message to a target server under the condition that the monitoring result of the DNS response message meets a preset abnormal condition;
and the first determining module is configured to determine whether the target link is normal according to the response of the target server to the link detection request message.
Optionally, the one or more links include a link, and the preset exception condition includes:
after a first preset time period is reached, the number of the received DNS response messages is less than or equal to a first preset number threshold; alternatively, the first and second liquid crystal display panels may be,
and receiving the DNS response messages in the first preset time period, wherein the number of the abnormal response messages in the received DNS response messages is greater than or equal to a second preset number threshold.
Optionally, the apparatus further comprises:
the second determining module is configured to determine that the target link is normal when the DNS response packet is received within the first preset time period and the number of normal response packets in the received DNS response packet is greater than or equal to a third preset number threshold.
Optionally, the one or more links include a plurality of links, and the preset exception condition includes:
and receiving the DNS response messages in a second preset time period, wherein the number of the abnormal response messages in the received DNS response messages is greater than or equal to a fourth preset number threshold.
Optionally, the second determining module is further configured to:
determining that the target link is normal when the DNS response message is received in the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to a fifth preset number threshold; alternatively, the first and second electrodes may be,
and determining that the target link is abnormal under the condition that the number of the received DNS response messages in the second preset time period is less than or equal to a sixth preset number threshold.
Optionally, the apparatus further comprises:
a transfer module configured to determine a normal link from the plurality of links and transfer target traffic on the target link to the normal link so as to stop data transmission of the target link when the target link is abnormal.
Optionally, the transfer module is further configured to:
and under the condition that the target link is switched from abnormal to normal, transferring the target flow on the normal link to the target link so as to enable the target link to carry out data transmission according to the target flow.
Optionally, the first determining module is configured to:
determining that the target link is normal under the condition that a link detection response message sent by the target server according to the link detection request message is received within a third preset time period; alternatively, the first and second electrodes may be,
and after the third preset time period is reached, determining that the target link is abnormal under the condition that the link detection response message sent by the target server is not received.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device applied to a router, where the router corresponds to one or more links; the method comprises the following steps:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
sending a Domain Name System (DNS) request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any one of the one or more links;
monitoring a DNS response message sent by the domain name server according to the DNS request message;
under the condition that the monitoring result of the DNS response message meets a preset abnormal condition, a link detection request message is sent to a target server;
and determining whether the target link is normal or not according to the response of the target server to the link detection request message.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the steps of the link detection method provided by the first aspect of the present disclosure.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the method is applied to a router, the router corresponds to one or more links, and the method firstly sends a domain name system DNS request message to a domain name server corresponding to a target domain name through a target link to be detected, wherein the target link is any link in the one or more links. And then monitoring a DNS response message sent by the domain name server according to the DNS request message. And under the condition that the monitoring result of the DNS response message meets a preset abnormal condition, sending a link detection request message to a target server, and determining whether the target link is normal or not according to the response of the target server to the link detection request message. According to the method, the DNS request message is sent through the target link to be detected, and the link detection request message is sent to the target server under the condition that the monitoring result of the DNS response message meets the preset abnormal condition, so that whether the target link is normal or not is determined, the normal communication function of the link can be ensured in the link detection process, and the accuracy of link detection is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of link detection according to an exemplary embodiment;
FIG. 2 is a flow diagram illustrating another method of link detection in accordance with an exemplary embodiment;
FIG. 3 is a flow chart illustrating another method of link detection in accordance with an exemplary embodiment;
FIG. 4 is a flow chart illustrating another method of link detection in accordance with an exemplary embodiment;
FIG. 5 is a flow chart illustrating another method of link detection in accordance with an exemplary embodiment;
FIG. 6 is a flow chart illustrating another method of link detection in accordance with an exemplary embodiment;
FIG. 7 is a block diagram illustrating a link detection apparatus in accordance with an exemplary embodiment;
FIG. 8 is a block diagram illustrating another link detection apparatus in accordance with an exemplary embodiment;
FIG. 9 is a block diagram illustrating another link detection apparatus in accordance with an exemplary embodiment;
FIG. 10 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should be noted that all the actions of acquiring signals, information or data in the present application are performed under the premise of complying with the corresponding data protection regulation policy of the country of the location and obtaining the authorization given by the owner of the corresponding device.
Before introducing a link detection method, an apparatus, an electronic device, and a storage medium shown in the present disclosure, an application scenario of the present disclosure is first introduced.
The application scenario of the present disclosure may be a link detection process of a router, and since the server may regard the action of the router as an "attack" action under the condition of sending an ICMP message for a long time and at a high frequency, actions such as no response and denial of service are taken, which affects the normal network communication function. In addition, when the domain name server is abnormal, even if the network is normal, the user cannot normally use the network, and cannot open a common service such as a web page. Therefore, when the detection result obtained by sending the ICMP message is normal, the network is not always normal, and therefore, the false determination may be caused, which affects the accuracy of the link detection.
Fig. 1 is a flowchart illustrating a link detection method according to an exemplary embodiment, where the method is applied to a router, and the router corresponds to one or more links, and may include the following steps:
in step S101, a Domain Name System (DNS) request message is sent to a Domain Name server corresponding to one or more target Domain names through a target link to be detected, where the target link is any one of the one or more links.
For example, a router may include one or more ports, for example, a WAN (Wide Area Network) port, each port may correspond to a link, and each link may be connected to a Network. When the router corresponds to one link, the detection of each link may be repeated, and when the router corresponds to a plurality of links, all the links of the router or a designated plurality of links may be periodically detected. Firstly, one or more target domain names can be determined in a preset domain name list, and a DNS request message is sent to a domain name server corresponding to the one or more target domain names through a target link to be detected, wherein the target link is any one of the one or more links. If the target domain name is one, the DNS request message can be repeatedly sent to the domain name server corresponding to the target domain name. If the target domain name is multiple, the DNS request packet may be sequentially sent to domain name servers corresponding to multiple target domain names, where the domain name server corresponding to each target domain name may be the same or different, that is, one domain name server corresponding to multiple target domain names may also correspond to multiple domain name servers, and this disclosure is not limited specifically.
In step S102, a DNS response message sent by the domain name server according to the DNS request message is monitored.
In step S103, when the monitoring result of the DNS response packet satisfies a preset abnormal condition, a link detection request packet is sent to the target server.
For example, after sending the DNS request message to the domain name server corresponding to each target domain name, the DNS response message sent by the domain name server according to the DNS request message may be monitored. Because the domain name server can generate the DNS response message according to the DNS request message and the DNS protocol, whether the target link is normal can be determined according to whether the DNS response message is normal. If the monitoring result of the DNS response message meets the preset abnormal condition, which indicates that the router cannot normally communicate with the domain name server through the target link and the target link is abnormal, the link detection request message can be sent to the target server to detect the state of the target link again.
In the case that the router includes one link, the preset abnormal condition may be that the number of received DNS response messages is less than or equal to a first preset number threshold after reaching a first preset time period. The preset abnormal condition may also be that the DNS response messages are received within a first preset time period, and the number of the abnormal response messages in the received DNS response messages is greater than or equal to a second preset number threshold. The preset abnormal condition may be a combination of the above two conditions, and the disclosure is not particularly limited thereto. If the monitoring result of the DNS response message does not satisfy the preset abnormal condition, for example, the DNS response message is received within the first preset time period, and the number of normal response messages in the received DNS response message is greater than or equal to the third preset number threshold, it may be determined that the target link is normal.
In a case that the router includes a plurality of links, the preset abnormal condition may be that the DNS response packet is received within a second preset time period, and the number of abnormal response packets in the received DNS response packet is greater than or equal to a fourth preset number threshold. And if the monitoring result of the DNS response message does not meet the preset abnormal condition, for example, the DNS response message is received in a second preset time period, and the number of the normal response messages in the DNS response message is greater than or equal to a fifth preset number threshold, determining that the target link is normal. For another example, if the number of received DNS response messages in the second preset time period is less than or equal to the sixth preset number threshold, it may be determined that the target link is abnormal.
In step S104, it is determined whether the target link is normal according to the response of the target server to the link detection request packet.
For example, after the link detection request message is sent to the target server, whether the target link is normal may be determined according to a response of the target server to the link detection request message. Specifically, if a link sent by the target server is received within a third preset time period, which indicates that the network between the router and the target server is smooth, it may be determined that the target link is normal, where the link detection response message may be understood as a response message corresponding to the link detection request message. And if the link detection response message is not received after the third preset time period is reached, the network between the router and the target server is not passed, and the target link is determined to be abnormal.
It should be noted that, if the link detection response packet sent by the target server according to the link detection request packet is received within the third preset time period and indicates that the network communication function of the target link is normal, it may be determined that the domain name server corresponding to the target domain name is abnormal, so that the domain name server cannot receive the DNS response packet or the received DNS response packet is abnormal.
Therefore, the DNS request message is sent to the domain name server corresponding to the target domain name, and the link detection request message is sent to the target server under the condition that the monitoring result of the DNS response message meets the preset abnormal condition, so that whether the target link is normal or not is determined, the problems of server non-response and service rejection caused by long-term and high-frequency ICMP message sending can be avoided, and the normal communication function of the link can be ensured in the link detection process. And the link is detected by two detection modes of sending a DNS request message and sending an ICMP message, so that the accuracy of the link detection can be improved.
In summary, the present disclosure is applied to a router, where the router corresponds to one or more links, and the method first sends a domain name system DNS request packet to a domain name server corresponding to a target domain name through a target link to be detected, where the target link is any one of the one or more links. And then monitoring a DNS response message sent by the domain name server according to the DNS request message. And under the condition that the monitoring result of the DNS response message meets a preset abnormal condition, sending a link detection request message to a target server, and determining whether the target link is normal or not according to the response of the target server to the link detection request message. According to the method, the DNS request message is sent through the target link to be detected, and the link detection request message is sent to the target server under the condition that the monitoring result of the DNS response message meets the preset abnormal condition, so that whether the target link is normal or not is determined, the normal communication function of the link can be ensured in the link detection process, and the accuracy of link detection is improved.
In one application scenario, the one or more links include a link, and the preset exception condition includes:
and after the first preset time period is reached, the number of the received DNS response messages is less than or equal to a first preset number threshold. Alternatively, the first and second electrodes may be,
receiving DNS response messages in a first preset time period, wherein the number of abnormal response messages in the received DNS response messages is larger than or equal to a second preset number threshold.
For example, the router may include a link, and if the number of received DNS response packets is less than or equal to a first preset number threshold after reaching a first preset time period, it may be determined that a preset exception condition is satisfied. Taking target domain names as 1 as an example, the first preset number threshold may be 1, and after the first preset time period is reached, if the DNS response packet is not received, that is, the number of received DNS response packets is 0, it may be determined that the preset abnormal condition is satisfied, and if 1 DNS response packet is received, it may be determined that the preset abnormal condition is not satisfied. Taking 10 target domain names as an example, the first preset number threshold may be, for example, 8, after the first preset time period is reached, if the number of the received DNS response packets is less than or equal to 8, it may be determined that the preset exception condition is satisfied, and if the number of the received DNS response packets is greater than 8, it may be determined that the preset exception condition is not satisfied.
Or, if the DNS response message is received within the first preset time period and the number of abnormal response messages in the received DNS response message is greater than or equal to the second preset number threshold, it may also be determined that the preset abnormal condition is satisfied, where the abnormal response message may be understood as a DNS response message that does not conform to the DNS protocol. Taking 1 target domain name as an example, the second preset number threshold may be 1, and if 1 abnormal response packet is received within the first preset time period, it may be determined that the preset abnormal condition is satisfied, and if the abnormal response packet is not received within the first preset time period, that is, the number of the received abnormal response packets is 0, it may be determined that the preset abnormal condition is not satisfied. Taking 20 target domain names as an example, the second preset number threshold may be, for example, 3, after the first preset time period is reached, if the number of received abnormal response packets is greater than or equal to 3, it may be determined that the preset abnormal condition is satisfied, and if the number of received abnormal response packets is less than 3, it may be determined that the preset abnormal condition is not satisfied. For example, if 5 abnormal response messages are received, it may be determined that the preset abnormal condition is satisfied, and if 1 abnormal response message is received, it may be determined that the preset abnormal condition is not satisfied.
Fig. 2 is a flow chart illustrating another link detection method according to an example embodiment, as shown in fig. 2, the method may further include:
in step S105, when the DNS response packet is received within the first preset time period and the number of normal response packets in the received DNS response packet is greater than or equal to the third preset number threshold, it is determined that the target link is normal.
For example, in a case that the router includes one link, if the DNS response message is received within the first preset time period and the number of normal response messages in the received DNS response message is greater than or equal to the third preset number threshold, it may be determined that the target link is normal, where the normal response message may be understood as a DNS response message conforming to the DNS protocol. Taking target domain names as 1 as an example, the third preset number threshold may be 1, and if 1 normal response message is received within the first preset time period, it may be determined that the target link is normal. Taking 20 target domain names as an example, the third preset number threshold may be 18, for example, and after the first preset time period is reached, if the number of received normal response messages is greater than or equal to 18, it may be determined that the target link is normal. For example, if 19 normal response messages are received, the target link may be determined to be normal.
In another application scenario, the one or more links include a plurality of links, and the preset exception condition includes:
and receiving DNS response messages in a second preset time period, wherein the number of abnormal response messages in the received DNS response messages is greater than or equal to a fourth preset number threshold.
For example, the router may include a plurality of links, and in a case that the router includes a plurality of links, if the DNS response packet is received within the second preset time period and the number of abnormal response packets in the received DNS response packet is greater than or equal to the fourth preset number threshold, it may be determined that the preset abnormal condition is satisfied. Taking 1 target domain name as an example, the second preset number threshold may be 1, and if 1 abnormal response packet is received within the second preset time period, it may be determined that the preset abnormal condition is satisfied, and if no abnormal response packet is received within the second preset time period, it may be determined that the preset abnormal condition is not satisfied. Taking 15 target domain names as an example, the second preset number threshold may be 2, for example, after the first preset time period is reached, if the received abnormal response packet is greater than or equal to 2, it may be determined that the preset abnormal condition is satisfied, and if the received abnormal response packet is less than 2, it may be determined that the preset abnormal condition is not satisfied. For example, if 3 abnormal response messages are received, it may be determined that the preset abnormal condition is satisfied, and if 1 abnormal response message is received, it may be determined that the preset abnormal condition is not satisfied.
Fig. 3 is a flow chart illustrating another link detection method according to an example embodiment, as shown in fig. 3, the method may further include:
in step S106, when the DNS response message is received within the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to the fifth preset number threshold, it is determined that the target link is normal. Alternatively, the first and second electrodes may be,
in step S107, when the number of received DNS response messages in the second preset time period is less than or equal to the sixth preset number threshold, it is determined that the target link is abnormal.
For example, in a case that the router includes a plurality of links, if the DNS response message is received within the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to the fifth preset number threshold, it is determined that the target link is normal. Taking 1 target domain name as an example, the fifth preset number threshold may be 1, and if 1 normal response message is received within the second preset time period, it may be determined that the target link is normal. Taking the target domain names as 18 as an example, the fifth preset number threshold may be 16, for example, and after the second preset time period is reached, if the received normal response message is greater than or equal to 16, it may be determined that the target link is normal. For example, after the second preset time period is reached, if 17 normal response messages are received, it may be determined that the target link is normal.
If the number of the received DNS response messages in the second preset time period is less than or equal to the sixth preset number threshold, it indicates that the target link cannot normally perform data transmission, and because the router includes multiple links, if one link cannot normally perform data transmission, network congestion or data loss may be caused, the target link may be directly determined to be abnormal. Taking 1 target domain name as an example, the sixth preset number threshold may be 1, and after the second preset time period is reached, if the DNS response packet is not received, it may be determined that the target link is abnormal. Taking 12 target domain names as an example, the sixth preset number threshold may be, for example, 10, and after the second preset time period is reached, if the number of received DNS response messages is less than or equal to 10, it may be determined that the target link is abnormal. For example, after reaching the second preset time period, if 8 normal response messages are received, it may be determined that the target link is abnormal.
Fig. 4 is a flow chart illustrating another link detection method according to an example embodiment, as shown in fig. 4, the method may further include:
in step S108, in the case where the target link is abnormal, a normal link is determined from the plurality of links, and the target traffic on the target link is transferred to the normal link to stop the data transmission of the target link.
For example, in a case where the router includes multiple links, if it is determined that the target link is abnormal, it indicates that the target link cannot perform data transmission, and in the process of multilink transmission, a problem may occur that data is lost and normal use of the network by the user is affected, so that a normal link may be determined from the multiple links, and target traffic on the target link is transferred to the normal link, so that the target link stops performing data transmission, and other normal links of the router may transmit data originally transmitted on the target link, and it is ensured that the user can still normally use the network when the target link is abnormal, and a situation of network congestion or data loss is avoided. The target traffic on the target link may be averagely allocated to multiple normal links, and for example, the target traffic is W, and the normal links are 3, each normal link may be allocated with W/3 of traffic. The proportion allocated to each normal link may also be specified in advance, and the target traffic may be allocated to each normal link according to the specified proportion, which is not specifically limited by the present disclosure.
It should be noted that, a plurality of links of the router may be periodically detected, and in each detection period, all links may be sequentially detected, or a designated link may be detected. The traffic on the target link may be transferred to a normal link immediately after the target link is determined to be abnormal, where the normal link is a link whose detection result is normal last before the current time. Or after each detection period is finished, transferring the traffic on the abnormal link detected in the current detection period to a normal link, wherein the normal link is a link whose detection result in the current detection period is normal. The present disclosure does not specifically limit this.
Fig. 5 is a flow chart illustrating another link detection method according to an example embodiment, as shown in fig. 5, the method may further include:
in step S109, when the target link is switched from abnormal to normal, the target traffic on the normal link is transferred to the target link, so that the target link performs data transmission according to the target traffic.
For example, in a case that the target link is determined to be normal, a last detection result of the target link is obtained. If the last detection result of the target link is abnormal, which indicates that the route of the target link is switched to be normal abnormally, the target traffic which is transferred to the normal link before can be transferred back to the target link, so that the target link can perform data transmission again according to the target traffic. Therefore, after the target link is switched to be normal due to the abnormity, the target traffic corresponding to the target link can be automatically transferred to the target link, so that the target link can automatically recover normal communication.
Fig. 6 is a flow chart illustrating another link detection method according to an example embodiment, and as shown in fig. 6, step 104 may be implemented by:
in step S1041, it is determined that the target link is normal when a link detection response message sent by the target server according to the link detection request message is received within a third preset time period. Alternatively, the first and second electrodes may be,
in step S1042, after the third preset time period is reached, if the link detection response packet sent by the target server is not received, it is determined that the target link is abnormal.
For example, after the link detection request message is sent to the target server, it may be determined whether a link detection response message sent by the target server according to the link detection request message is received within a third preset time period. And if the link detection response message is received within the third preset time period and indicates that the network between the router and the target server is smooth, determining that the target link is normal. And if the link detection response message is not received after the third preset time period is reached, the network between the router and the target server is not passed, and the target link is determined to be abnormal.
The target server is a server designated in advance, and there may be one or a plurality of target servers. If the number of the target servers is multiple, it may be determined that the target link is normal under the condition that the number of the link detection response messages received in the third preset time period is greater than or equal to the seventh preset number threshold. And determining that the target link is abnormal under the condition that the number of the received link detection response messages in the third preset time period is less than a seventh preset number threshold. Taking the number of the target servers as 10 and the seventh preset number threshold as 8 as an example, if the number of the link detection response messages received in the third preset time period is greater than or equal to 8, it may be determined that the target link is normal. If the number of the received link detection response messages in the third preset time period is less than 8, the target link may be determined to be abnormal.
In summary, the present disclosure is applied to a router, where the router corresponds to one or more links, and the method first sends a domain name system DNS request packet to a domain name server corresponding to a target domain name through a target link to be detected, where the target link is any one of the one or more links. And then monitoring a DNS response message sent by the domain name server according to the DNS request message. And under the condition that the monitoring result of the DNS response message meets a preset abnormal condition, sending a link detection request message to a target server, and determining whether the target link is normal or not according to the response of the target server to the link detection request message. According to the method, the DNS request message is sent through the target link to be detected, and the link detection request message is sent to the target server under the condition that the monitoring result of the DNS response message meets the preset abnormal condition, so that whether the target link is normal or not is determined, the normal communication function of the link can be ensured in the link detection process, and the accuracy of link detection is improved.
Fig. 7 is a block diagram illustrating a link detection apparatus according to an exemplary embodiment, and is applied to a router, where the router corresponds to one or more links, as shown in fig. 7. The apparatus 200 comprises:
the first sending module 201 is configured to send a domain name system DNS request packet to a domain name server corresponding to one or more target domain names through a target link to be detected, where the target link is any one of the one or more links.
The monitoring module 202 is configured to monitor a DNS response message sent by the domain name server according to the DNS request message.
The second sending module 203 is configured to send the link detection request message to the target server when the monitoring result of the DNS response message meets a preset abnormal condition.
The first determining module 204 is configured to determine whether the target link is normal according to the response of the target server to the link detection request message.
In one application scenario, the one or more links include a link, and the preset exception condition includes:
and after the first preset time period is reached, the number of the received DNS response messages is less than or equal to a first preset number threshold. Alternatively, the first and second electrodes may be,
and receiving DNS response messages in a first preset time period, wherein the number of abnormal response messages in the received DNS response messages is greater than or equal to a second preset number threshold.
Fig. 8 is a block diagram illustrating another link detection apparatus according to an example embodiment, and as shown in fig. 8, the apparatus 200 further includes:
the second determining module 205 is configured to determine that the target link is normal when the DNS response packet is received within the first preset time period and the number of normal response packets in the received DNS response packet is greater than or equal to a third preset number threshold.
In another application scenario, the one or more links include a plurality of links, and the preset exception condition includes:
and receiving the DNS response messages in a second preset time period, wherein the number of the abnormal response messages in the received DNS response messages is greater than or equal to a fourth preset number threshold.
In another application scenario, the second determining module 205 is further configured to:
and determining that the target link is normal under the condition that the DNS response messages are received in the second preset time period and the number of the normal response messages in the DNS response messages is larger than or equal to a fifth preset number threshold. Alternatively, the first and second electrodes may be,
and determining that the target link is abnormal under the condition that the number of the received DNS response messages in the second preset time period is less than or equal to a sixth preset number threshold.
Fig. 9 is a block diagram illustrating another link detection apparatus according to an exemplary embodiment, and as shown in fig. 9, the apparatus 200 further includes:
the transferring module 206 is configured to determine a normal link from the multiple links and transfer the target traffic on the target link to the normal link to stop the target link from performing data transmission when the target link is abnormal.
In another application scenario, the transfer module 206 is further configured to:
and under the condition that the target link is switched from abnormal to normal, transferring the target flow on the normal link to the target link so as to enable the target link to transmit data according to the target flow.
In another application scenario, the first determination module 204 is configured to:
and determining that the target link is normal under the condition that a link detection response message sent by the target server according to the link detection request message is received in a third preset time period. Alternatively, the first and second electrodes may be,
and after the third preset time period is reached, determining that the target link is abnormal under the condition that the link detection response message sent by the target server is not received.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In summary, the present disclosure is applied to a router, where the router corresponds to one or more links, and the method first sends a domain name system DNS request packet to a domain name server corresponding to a target domain name through a target link to be detected, where the target link is any one of the one or more links. And then monitoring a DNS response message sent by the domain name server according to the DNS request message. And under the condition that the monitoring result of the DNS response message meets a preset abnormal condition, sending a link detection request message to a target server, and determining whether the target link is normal or not according to the response of the target server to the link detection request message. According to the method, the DNS request message is sent through the target link to be detected, and the link detection request message is sent to the target server under the condition that the monitoring result of the DNS response message meets the preset abnormal condition, so that whether the target link is normal or not is determined, the normal communication function of the link can be ensured in the link detection process, and the accuracy of link detection is improved.
The present disclosure also provides a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the link detection method provided by the present disclosure.
Fig. 10 is a block diagram illustrating an electronic device 300 in accordance with an example embodiment. For example, the electronic device 300 may be provided as a server. Referring to FIG. 10, electronic device 300 includes a processing component 322 that further includes one or more processors and memory resources, represented by memory 332, for storing instructions, such as applications, that are executable by processing component 322. The application programs stored in memory 332 may include one or more modules that each correspond to a set of instructions. Further, the processing component 322 is configured to execute instructions to perform the above-described link detection method.
The electronic device 300 may also include a power component 326 configured to perform power management of the electronic device 300, a wired or wireless network interface 350 configured toFor connecting the electronic device 300 to a network, and an input/output (I/O) interface 358. The electronic device 300 may operate based on an operating system, such as Windows Server, stored in the memory 332TM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTMOr the like.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-mentioned link detection method when executed by the programmable apparatus.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. A link detection method is applied to a router, wherein the router corresponds to one or more links; the method comprises the following steps:
sending a Domain Name System (DNS) request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any one of the one or more links;
monitoring a DNS response message sent by the domain name server according to the DNS request message;
under the condition that the monitoring result of the DNS response message meets a preset abnormal condition, a link detection request message is sent to a target server;
and determining whether the target link is normal or not according to the response of the target server to the link detection request message.
2. The method of claim 1, wherein the one or more links comprise a link, and wherein the preset exception condition comprises:
after a first preset time period is reached, the number of the received DNS response messages is less than or equal to a first preset number threshold; alternatively, the first and second electrodes may be,
and receiving the DNS response messages in the first preset time period, wherein the number of the abnormal response messages in the received DNS response messages is greater than or equal to a second preset number threshold.
3. The method of claim 2, further comprising:
and determining that the target link is normal when the DNS response message is received in the first preset time period and the number of normal response messages in the received DNS response message is greater than or equal to a third preset number threshold.
4. The method of claim 1, wherein the one or more links comprise a plurality of links, and wherein the preset exception condition comprises:
and receiving the DNS response messages in a second preset time period, wherein the number of the abnormal response messages in the received DNS response messages is greater than or equal to a fourth preset number threshold.
5. The method of claim 4, further comprising:
determining that the target link is normal when the DNS response message is received in the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to a fifth preset number threshold; alternatively, the first and second electrodes may be,
and determining that the target link is abnormal under the condition that the number of the received DNS response messages in the second preset time period is less than or equal to a sixth preset number threshold.
6. The method of claim 4, further comprising:
and under the condition that the target link is abnormal, determining a normal link from the plurality of links, and transferring target traffic on the target link to the normal link so as to stop the data transmission of the target link.
7. The method of claim 6, further comprising:
and under the condition that the target link is switched from abnormal to normal, transferring the target flow on the normal link to the target link so as to enable the target link to carry out data transmission according to the target flow.
8. The method according to any one of claims 1 to 7, wherein said determining whether the target link is normal according to the response of the target server to the link detection request message comprises:
determining that the target link is normal under the condition that a link detection response message sent by the target server according to the link detection request message is received within a third preset time period; alternatively, the first and second liquid crystal display panels may be,
and after the third preset time period is reached, determining that the target link is abnormal under the condition that the link detection response message sent by the target server is not received.
9. The link detection device is applied to a router, wherein the router corresponds to one or more links; the device comprises:
a first sending module, configured to send a domain name system DNS request packet to a domain name server corresponding to one or more target domain names through a target link to be detected, where the target link is any link in the one or more links;
the monitoring module is configured to monitor a DNS response message sent by the domain name server according to the DNS request message;
the second sending module is configured to send a link detection request message to a target server under the condition that the monitoring result of the DNS response message meets a preset abnormal condition;
and the first determining module is configured to determine whether the target link is normal according to the response of the target server to the link detection request message.
10. An electronic device is applied to a router, wherein the router corresponds to one or more links; the method comprises the following steps:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
sending a Domain Name System (DNS) request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any one of the one or more links;
monitoring a DNS response message sent by the domain name server according to the DNS request message;
under the condition that the monitoring result of the DNS response message meets a preset abnormal condition, a link detection request message is sent to a target server;
and determining whether the target link is normal or not according to the response of the target server to the link detection request message.
11. A computer-readable storage medium, on which computer program instructions are stored, which program instructions, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 8.
CN202210406869.0A 2022-04-18 2022-04-18 Link detection method and device, electronic equipment and storage medium Pending CN114629822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210406869.0A CN114629822A (en) 2022-04-18 2022-04-18 Link detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210406869.0A CN114629822A (en) 2022-04-18 2022-04-18 Link detection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114629822A true CN114629822A (en) 2022-06-14

Family

ID=81905314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210406869.0A Pending CN114629822A (en) 2022-04-18 2022-04-18 Link detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114629822A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115051942A (en) * 2022-06-23 2022-09-13 北京小米移动软件有限公司 Link detection method, device, network equipment, storage medium and chip
CN115242615A (en) * 2022-06-29 2022-10-25 北京聚通达科技股份有限公司 Server operation management method and device, electronic equipment and storage medium
CN117354196A (en) * 2023-12-06 2024-01-05 广州通则康威科技股份有限公司 Link detection method and device based on network interface

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1808998A (en) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 Method of detection and maintenance of PPP link
WO2016082588A1 (en) * 2014-11-26 2016-06-02 中兴通讯股份有限公司 Link connectivity checking method and apparatus
CN106790340A (en) * 2016-04-25 2017-05-31 新华三技术有限公司 A kind of link scheduling method and device
CN107743079A (en) * 2017-09-29 2018-02-27 网宿科技股份有限公司 Line sniffing method, equipment and computer-readable recording medium
US20180278633A1 (en) * 2017-03-22 2018-09-27 Microsoft Technology Licensing, Llc Detecting domain name system (dns) tunneling based on dns logs and network data
CN109842566A (en) * 2019-01-10 2019-06-04 杭州迪普科技股份有限公司 A kind of dns resolution method and device
CN109889499A (en) * 2019-01-17 2019-06-14 Oppo广东移动通信有限公司 File transmitting method and relevant apparatus
WO2019161541A1 (en) * 2018-02-23 2019-08-29 Nokia Technologies Oy Network security
WO2020103159A1 (en) * 2018-11-23 2020-05-28 华为技术有限公司 Message transmitting and receiving method and apparatus
CN111586085A (en) * 2019-02-15 2020-08-25 丛林网络公司 Load balancing endpoint selection for client devices accessing endpoints via a network
CN112260903A (en) * 2020-10-29 2021-01-22 杭州迪普科技股份有限公司 Link monitoring method and device
CN112468474A (en) * 2020-11-19 2021-03-09 哈尔滨工业大学(威海) Active detection method for resolution abnormity of recursive domain name server
CN112751728A (en) * 2020-12-29 2021-05-04 杭州迪普科技股份有限公司 Link health state monitoring method and device
CN114363288A (en) * 2021-12-16 2022-04-15 北京华耀科技有限公司 Message processing method and device, link load balancing equipment and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1808998A (en) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 Method of detection and maintenance of PPP link
WO2016082588A1 (en) * 2014-11-26 2016-06-02 中兴通讯股份有限公司 Link connectivity checking method and apparatus
CN106790340A (en) * 2016-04-25 2017-05-31 新华三技术有限公司 A kind of link scheduling method and device
US20180278633A1 (en) * 2017-03-22 2018-09-27 Microsoft Technology Licensing, Llc Detecting domain name system (dns) tunneling based on dns logs and network data
CN107743079A (en) * 2017-09-29 2018-02-27 网宿科技股份有限公司 Line sniffing method, equipment and computer-readable recording medium
WO2019161541A1 (en) * 2018-02-23 2019-08-29 Nokia Technologies Oy Network security
WO2020103159A1 (en) * 2018-11-23 2020-05-28 华为技术有限公司 Message transmitting and receiving method and apparatus
CN109842566A (en) * 2019-01-10 2019-06-04 杭州迪普科技股份有限公司 A kind of dns resolution method and device
CN109889499A (en) * 2019-01-17 2019-06-14 Oppo广东移动通信有限公司 File transmitting method and relevant apparatus
CN111586085A (en) * 2019-02-15 2020-08-25 丛林网络公司 Load balancing endpoint selection for client devices accessing endpoints via a network
CN112260903A (en) * 2020-10-29 2021-01-22 杭州迪普科技股份有限公司 Link monitoring method and device
CN112468474A (en) * 2020-11-19 2021-03-09 哈尔滨工业大学(威海) Active detection method for resolution abnormity of recursive domain name server
CN112751728A (en) * 2020-12-29 2021-05-04 杭州迪普科技股份有限公司 Link health state monitoring method and device
CN114363288A (en) * 2021-12-16 2022-04-15 北京华耀科技有限公司 Message processing method and device, link load balancing equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
严芬;丁超;殷新春;: "基于信息熵的DNS拒绝服务攻击的检测研究", 计算机科学, no. 03, 15 March 2015 (2015-03-15) *
井浩;张;李军怀;: "链路跟踪在多出口网络链路互备中的应用研究", 计算机工程, no. 14, 20 July 2007 (2007-07-20) *
罗友强;刘胜利;颜猛;武东英;: "基于通信行为分析的DNS隧道木马检测方法", 浙江大学学报(工学版), no. 09, 15 September 2017 (2017-09-15) *
鞠洪尧;: "基于链路响应的负载均衡网络实现", 齐齐哈尔大学学报(自然科学版), no. 03, 15 May 2009 (2009-05-15) *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115051942A (en) * 2022-06-23 2022-09-13 北京小米移动软件有限公司 Link detection method, device, network equipment, storage medium and chip
CN115242615A (en) * 2022-06-29 2022-10-25 北京聚通达科技股份有限公司 Server operation management method and device, electronic equipment and storage medium
CN117354196A (en) * 2023-12-06 2024-01-05 广州通则康威科技股份有限公司 Link detection method and device based on network interface
CN117354196B (en) * 2023-12-06 2024-03-12 广州通则康威科技股份有限公司 Link detection method and device based on network interface

Similar Documents

Publication Publication Date Title
CN114629822A (en) Link detection method and device, electronic equipment and storage medium
CN113472606B (en) Heartbeat overtime detection method, server and electronic equipment
US7991877B2 (en) Rogue router hunter
US8605720B2 (en) Analyzing a network with a cache advance proxy
CN108471369B (en) Network dialing method, device and storage medium
US10355961B2 (en) Network traffic capture analysis
CN106789717B (en) The method, apparatus and terminal of the MTU of dynamic adjustment communication protocol data message transmission
US9800593B2 (en) Controller for software defined networking and method of detecting attacker
CN106603261B (en) Hot backup method, first main device, standby device and communication system
JP4503934B2 (en) Server computer protection device, server computer protection method, server computer protection program, and server computer
WO2019052897A1 (en) Obtaining local area network diagnostic test results
KR20100057885A (en) Method and system for checking automatically connectivity status of an ip link on ip network
US20230087446A1 (en) Network monitoring method, electronic device and storage medium
US11310098B2 (en) Diagnosing intermediary network nodes
US20040205762A1 (en) Communication control apparatus, communication control method and communication control program product
US8693483B2 (en) Adjusting MSS of packets sent to a bridge device positioned between virtual and physical LANS
CN109428814B (en) Multicast traffic transmission method, related equipment and computer readable storage medium
CN113691591B (en) Data transmission method, device and computer readable storage medium
CN113259490B (en) Multi-level node network data transmission method based on UDP transmission protocol
CN112463204A (en) Pile service program gray level release method without sensing of direct connection charging pile
JP2001067291A (en) Network monitor system
CN107508762A (en) Network traffics transmission method and source device
CN111813615B (en) Transaction exception processing method for application system
CN113206795B (en) Transmission strategy adjusting method, device, equipment and readable storage medium
CN113098704B (en) Network topology structure determination method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination