CN106533826A - Network state detection method and system - Google Patents
Network state detection method and system Download PDFInfo
- Publication number
- CN106533826A CN106533826A CN201610935098.9A CN201610935098A CN106533826A CN 106533826 A CN106533826 A CN 106533826A CN 201610935098 A CN201610935098 A CN 201610935098A CN 106533826 A CN106533826 A CN 106533826A
- Authority
- CN
- China
- Prior art keywords
- packet
- node
- sending
- time
- probe
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 114
- 238000000034 method Methods 0.000 claims abstract description 92
- 230000004044 response Effects 0.000 claims abstract description 82
- 238000009826 distribution Methods 0.000 claims abstract description 21
- 239000000523 sample Substances 0.000 claims description 140
- 230000008569 process Effects 0.000 claims description 35
- 230000005540 biological transmission Effects 0.000 claims description 12
- 238000011156 evaluation Methods 0.000 claims description 7
- 230000000977 initiatory effect Effects 0.000 claims description 6
- 238000003860 storage Methods 0.000 description 21
- 238000010586 diagram Methods 0.000 description 16
- 238000004590 computer program Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000010295 mobile communication Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0823—Errors, e.g. transmission errors
- H04L43/0829—Packet loss
- H04L43/0841—Round trip packet loss
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0852—Delays
- H04L43/0864—Round trip delays
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiments of the invention provide a network state detection method and system. The method comprises the following steps: starting at least one sending coroutine to send a detection packet to at least one node in a content distribution network; starting a single receiving coroutine so as to receive a detection response packet associated with the detection packet from the at least one node; and at least according to sending information corresponding to the detection packet of each node and receiving information of the detection response packet, determining a network state of each node. According to the embodiments of the invention, the time consumed for detecting the network state and the load of a CPU can be reduced, and the detection efficiency is improved.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and a system for detecting a network state.
Background
A CDN (Content Delivery Network) technology is a method for delivering Content from a central server to a node edge near a user, thereby realizing distributed near access to the Content. The CDN technology effectively improves the service quality of content access and can support large-scale concurrent access.
For a content delivery network such as a CDN (content delivery network) and the like, in the process of realizing near access, if the network can be detected correspondingly later, the network state of an adjacent node in the network is further obtained, and the request is guided to be forwarded reasonably according to the network state, so that the response speed of the whole system can be improved, and the user experience is improved.
In the process of implementing the present application, the inventors found that at least the following problems exist in the related art: the asynchronous receiving and transmitting detection realized by the process or thread technology is often used in the prior art, because more than one adjacent node is often used, sometimes hundreds of nodes are available, when a large number of nodes are detected simultaneously, if a large number of threads or processes are started to detect a large number of nodes simultaneously, the occupation of resources is excessive, the load of a CPU is overweight, so in order to save the consumption of system resources, a small number of threads or processes are often started to detect, namely, after the detection of one node is finished, the next node is detected, and therefore, the problem of untimely detection often exists.
Disclosure of Invention
The embodiment of the invention provides a method and a system for detecting a network state, which are used for solving the defects of untimely detection caused by more time consumption in a detection process and excessive CPU load caused by simultaneous detection of a large number of nodes in the prior art, reducing the detection time consumption and the CPU load and improving the detection efficiency.
In a first aspect, an embodiment of the present invention provides a method for detecting a network state, including:
starting at least one sending protocol to send a detection packet to at least one node in the content distribution network;
initiating a single receive routine to receive probe response packets associated with the probe packets from the at least one node;
and determining the network state of each node at least according to the sending information of the detection packet corresponding to each node and the receiving information of the detection response packet.
In a second aspect, an embodiment of the present invention further provides a system for detecting a network state, where the system includes:
a sending module, configured to start at least one sending coroutine to send a probe packet to at least one node in the content distribution network;
a receiving module configured to initiate a single receive routine to receive probe response packets associated with the probe packets from the at least one node;
and the evaluation module is used for determining the network state of each node at least according to the sending information of the detection packet corresponding to each node and the receiving information of the detection response packet.
In a third aspect, an embodiment of the present application further provides a non-volatile computer storage medium, which stores computer-executable instructions, where the computer-executable instructions are used to execute any one of the methods for detecting a network state in the present application.
In a fourth aspect, an embodiment of the present application further provides an electronic device, including: at least one processor; and a memory; wherein the memory stores a program executable by the at least one processor, and the instructions are executable by the at least one processor to enable the at least one processor to perform any of the network state detection methods described above.
In a fifth aspect, the embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the above methods for detecting a network state.
In the method and system for detecting a network state according to the embodiments of the present invention, at least one sending coroutine is started to send a probe packet to at least one node to detect a network state of an adjacent node, when a plurality of adjacent nodes exist, a plurality of sending coroutines can be started, that is, when a network probing task is executed, a plurality of sending coroutines are started to send probe packets to a plurality of nodes, for the reason that the prior art sends probe packets to probing nodes sequentially through threads and processes, because the processes of sending probe packets by a plurality of sending coroutines in the embodiments of the present invention are executed concurrently, time occupied by network probing can be saved, when there are a plurality of probing nodes, it can be ensured that the probing tasks can be completed within a specified time, and because the coroutines are lightweight threads, the coroutines are relatively independent, switching is controlled by themselves and is scheduled in a user space, compared with task switching of a process and a thread, the method has the advantages that the overhead of coroutine is very small, and the occupation of resources is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a first step of a method for detecting a network status according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating steps of a second method for detecting a network status according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a third step of a method for detecting a network status according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a fourth step of a method for detecting a network status according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a fifth step of a method for detecting a network status according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a first embodiment of a system for detecting a network state according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a second embodiment of a system for detecting a network state according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a network status detection system according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Method embodiment one
Referring to fig. 1, a flowchart illustrating a first step of a method for detecting a network state according to a first embodiment of the present invention is shown, where the method specifically includes:
step 101, starting at least one sending coroutine to send a detection packet to at least one adjacent node in the content distribution network;
the embodiment of the invention can be applied to various network systems needing load balancing, such as: the CDN network system is used for detecting network states corresponding to nodes in a network so as to reduce occupied time in a detection process, so that the detection process can be completed within specified time, the detection efficiency is improved, and the occupation of resources in the detection process is reduced. In the embodiment of the present invention, a CDN network is taken as an example for description, and other networks may be referred to each other.
In the embodiment of the present invention, when the CDN network receives a request for content delivery, a network state needs to be detected, and at this time, information of an adjacent node may be read from a configuration file or information of an adjacent node sent by a network node management system is received, where the information of the adjacent node may specifically include IP information and quantity information.
After the probing of the CDN network is started, at least one sending protocol may be started to send probe packets to neighboring nodes in the content distribution network, for example: if there are 50 current adjacent nodes, 2 coroutines may be started to send probe packets to the 50 nodes, or 10 coroutines may be started to send probe packets to the 50 nodes, where it may be understood that the starting of 2 coroutines and 10 coroutines is only one example of the number of the coroutines to be sent in the embodiment of the present invention, and is not understood as a limitation on the number of the coroutines to be sent, and actually, the number of the coroutines to be sent is not less than 1, for example: 9, 12, 15, etc., and the number of the transmission protocol is not specifically limited in the embodiment of the present invention.
In an alternative embodiment of the invention, the number of transmission protocols corresponds to the number of nodes.
In the embodiment of the present invention, the number of the started transmission schedules may be determined according to the number of the neighboring nodes, for example: presetting a protocol corresponding to the detection of the network states of K adjacent nodes, wherein K is an integer greater than 0; the number of the sending protocols at this time may be a ratio of the number of the neighboring nodes to K, for example: k is 3, the number of adjacent nodes is 120, and the number of the started sending coroutines is 40; at this time, the detection processes performed on 120 neighboring nodes through 40 coroutines are partially concurrent, so that the time for network detection can be reduced, and the efficiency of network detection can be improved.
When K is 1, i.e. how many neighboring nodes and how many transmission protocols are started, for example: if there are 120 adjacent nodes, 120 sending protocols are started to respectively send detection packets to the 120 adjacent nodes, so as to detect the network states of the 120 adjacent nodes, and at this time, the detection processes of the 120 adjacent nodes through the 120 sending protocols are concurrent, so that the time consumed by network detection can be greatly reduced, and the efficiency of network detection is greatly improved.
In this embodiment of the present invention, multiple coroutines may be allocated to multiple cores of a CPU to execute simultaneously, for example: when the number of coroutines is 8, the 8 coroutines can be distributed to 8 kernels of the CPU to be executed at the same time, and the embodiment of the invention can realize the full utilization of the resources of the CPU.
Step 102, starting a single receiving routine to receive a probe response packet associated with the probe packet from the at least one node;
in the embodiment of the present invention, a single receiving protocol receives probe response packets of a plurality of neighboring nodes for probe, where the probe response packets may specifically carry identification information of corresponding probe packets and information of corresponding neighboring nodes.
And 103, determining the network state of each node at least according to the sending information of the detection packet corresponding to each node and the receiving information of the detection response packet.
In the embodiment of the present invention, the sending information of the probe packet may specifically include sending time, and the receiving information of the probe response packet may specifically include receiving information, so that the round trip time of the probe may be determined according to the sending time and the receiving time, and specifically, the network state may be determined according to the round trip time.
To sum up, the method for detecting a network state according to the embodiments of the present invention detects a network state of an adjacent node by starting at least one sending coroutine to send a probe packet to at least one adjacent node, and when there are a plurality of adjacent nodes, a plurality of sending coroutines can be started, and when a network probing task is executed, a plurality of sending coroutines are started to send probe packets to a plurality of adjacent nodes, for the existing method for sending probe packets to probing nodes sequentially by a thread and a process, because the process of sending probe packets by a plurality of sending coroutines in the embodiments of the present invention is executed concurrently, it is possible to save time occupied by network probing, and when there are a plurality of probing nodes, it is possible to ensure that a probing task can be completed within a specified time, and because coroutines are lightweight threads, protocols are relatively independent, switching is controlled by themselves, and scheduling is implemented in a user space, compared with task switching of a process and a thread, the method has the advantages that the overhead of coroutine is very small, and the occupation of resources is reduced.
Method embodiment two
Referring to fig. 2, a flowchart illustrating steps of a second embodiment of a method for detecting a network state in the present invention is shown, which may specifically include:
step 201, starting at least one sending protocol to send a detection packet to at least one node in the content distribution network;
step 202, starting a single receiving routine to receive a probe response packet associated with the probe packet from the at least one node;
in the embodiment of the present invention, steps 201 and 202 are similar to steps 101 and 102, and are not described again here.
Step 203, determining the time difference between the packet receiving time of each probe response packet and the packet sending time of each associated probe packet as the round trip time;
with respect to the first method embodiment, in the first method embodiment, step 203 to step 206 are performed to refine step 103 (at least, the network status of each node is determined according to the sending information of the probe packet and the receiving information of the probe response packet corresponding to each node), and probe response packets with round trip time greater than a predetermined threshold are discarded, that is, when the network status is determined, the network status is determined according to the number of the probe response packets that are not discarded and the number of the probe packets that are sent.
In the embodiment of the present invention, the sending information of the probe packet at least includes the packet sending number of the probe packet and the packet sending time of each probe packet, and the receiving information of the probe response packet at least includes the receiving number of the probe response packet and the packet receiving time of each probe response packet.
In the embodiment of the present invention, the probe response packet may carry an identifier of a corresponding probe packet, for example: if the probe packet has a sequence number, the probe response packet may specifically carry the sequence number to identify the probe packet corresponding to the probe packet, and determine that the time difference between the packet receiving time of the probe response packet and the packet sending time of the corresponding probe packet is the round trip time of the probe.
Step 204, discarding the probe response packet whose round trip time is greater than a predetermined threshold;
in the embodiment of the present invention, the predetermined threshold may be valid time of the probe response packet preset by a person skilled in the art, that is, the probe response packet whose round trip time is within the predetermined threshold may be determined as a valid probe response packet, and the round trip time is outside the predetermined threshold, which indicates that the time consumed by the probe of the node exceeds a specified time range, and the probe response packet may be discarded, so that it is avoided that the probe response packet sent within the specified time of the previous round receives the probe response packet corresponding to the probe packet of the previous round in the process of the next round of probe due to other reasons such as network jitter, which affects the next round of probe process.
Step 205, determining the network status of each node according to at least the number of the packets sent corresponding to each node and the number of the packets received without discarding.
In the embodiment of the invention, the packet receiving rate of each node can be determined according to the packet sending number of each node and the receiving number of the undiscarded detection response packets, when the packet receiving rate is greater than a preset packet receiving rate threshold value, the network state of the node corresponding to the packet receiving rate is determined to be a stable state, and when the packet receiving rate is less than the preset packet receiving rate threshold value, the network state of the node corresponding to the packet receiving rate is determined to be an unstable state;
or, the total packet loss number of each node may be determined according to the number of received detection response packets and the number of transmitted packets that are not discarded, and then the packet loss rate is determined according to the total packet loss number and the number of transmitted packets, when the packet loss rate is greater than a preset packet loss rate threshold, the network state of the node corresponding to the packet loss rate is determined to be in an unstable state, and when the packet loss rate is less than the preset packet loss rate threshold, the network state of the node corresponding to the packet loss rate is determined to be in a stable state.
To sum up, the method for detecting a network state according to the embodiments of the present invention may detect a network state of a plurality of neighboring nodes by starting a plurality of protocols, determine a round trip time of each node according to a packet receiving time of a received probe response packet and a packet sending time of a probe packet corresponding to the probe response packet, and discard the probe response packet whose round trip time is greater than a predetermined threshold, thereby avoiding that a probe response packet of a probe packet sent within a specified time of a previous round of probe task is fed back during a next round of probe task due to other reasons such as network jitter, which affects detection of a network state of the next round of probe task, so that a detection result of the network state is more accurate.
Method embodiment three
Referring to fig. 3, a flowchart illustrating a third step of the method for detecting a network state according to the third embodiment of the present invention is shown, and the method specifically includes:
step 301, starting at least one sending coroutine to send a detection packet to at least one node in the content distribution network;
step 302, starting a single receiving routine to receive a probe response packet associated with the probe packet from the at least one node;
step 303, determining a time difference between the packet receiving time of each probe response packet and the packet sending time of each associated probe packet as a round trip time;
step 304, discarding the probe response packet whose round trip time is greater than a predetermined threshold;
in the embodiment of the present invention, the steps 301 to 304 are similar to the steps 201 to 204, and are not described herein again.
Step 305, obtaining round trip time between the receiving time of each probe response packet which is not discarded and the packet sending time of each associated probe packet, and determining a time extreme value between the maximum round trip time and the minimum round trip time;
in an embodiment of the present invention, the maximum round trip time and the minimum round trip time are specifically the maximum value and the minimum value of the detection round trip time corresponding to each node, for example: there are 8 currently probed neighbor nodes that receive the probe response packets that are not discarded, and the round trip times corresponding to the 8 probe response packets are: 1ms, 4ms, 3ms, 7ms, 4ms, 3ms, 6ms, 1ms, then the maximum round trip time is determined to be 7ms, and the minimum round trip time is 1 ms; the time extremum is a difference value between the maximum round trip time and the minimum round trip time, and it can be understood that the smaller the time extremum is, that is, the smaller the difference value between the maximum round trip time and the minimum round trip time is, the smaller the fluctuation of the probing round trip time of each probing packet corresponding to the node is, and the more stable the network state of the node is, whereas, the larger the time extremum is, that is, the larger the difference value between the maximum round trip time and the minimum round trip time is, the larger the fluctuation of the probing round trip time of each probing packet corresponding to the node is, and the more unstable the network state of the node is.
Step 306, determining the network state of each node according to at least the number of the transmitted packets corresponding to each node, the number of the received probe response packets which are not received, and the time limit value.
In the embodiment of the present invention, the network state of the node may be determined according to the packet receiving rate and the time threshold corresponding to the node, for example: when the packet receiving rate is greater than a preset packet receiving rate threshold and the time extreme value is less than a preset time threshold, determining that the network state of the node is a stable state, otherwise, when the packet receiving rate is less than the preset packet receiving rate threshold and/or the time extreme value is greater than the preset time extreme value, determining that the network state of the node is an unstable state;
or, the network state of the node may be determined according to the packet loss rate and the time limit corresponding to the node, for example: when the packet loss rate is less than the preset packet loss rate threshold and the time extreme value is less than the preset time threshold, the network state of the node can be determined to be a stable state, otherwise, when the packet loss rate is greater than the preset packet loss rate threshold and/or the time extreme value is greater than the preset time extreme value, the network state of the node can be determined to be an unstable state.
To sum up, the method for detecting a network state according to the embodiments of the present invention may detect a network state of a plurality of neighboring nodes by starting a plurality of coroutines, and determine the network state of each node according to the number of the packets corresponding to each node, the number of the discarded detection response packets received, and the time limit value.
Method example four
Referring to fig. 4, a flowchart illustrating a fourth step of the method for detecting a network state according to the embodiment of the present invention is shown, which may specifically include:
step 401, determining the number of sending coroutines to be started;
in the embodiment of the present invention, the number of the started transmission coroutines may be specifically determined according to the number of the neighboring nodes, for example: the number of transmission schedules may be the same as the number of neighboring nodes.
Step 402, when the number of the sending coroutines to be started is larger than a preset number threshold, starting the sending coroutines of the number for multiple times, wherein at least one sending coroutine of which the number is smaller than the preset number threshold is started each time sends a detection packet to at least one node;
in the embodiment of the present invention, the predetermined number threshold may specifically be a maximum value of the number of protocols that can be carried by the CPU, and when the number of protocols is greater than the predetermined number threshold, the CPU load is too heavy, and the performance is affected.
In the embodiment of the invention, the protocol transmission program is specifically divided into several times of starting and can be determined according to the threshold value of the preset number, and when the number of the protocol transmission programs is K times of the threshold value of the preset number, K times of starting are carried out when K is an integer; when K is a non-integer, K +1 times is started.
In this embodiment of the present invention, the time interval between the kth time and the K +1 th time may be specifically calculated according to historical reference data, for example: the total time of a group of detection processes of the network state is 1000ms, 100 nodes are detected, the average time consumed for detecting one node is 10ms, and the time interval between the Kth time and the K +1 th time is determined to be 10 ms.
Step 403, starting a single receiving routine for receiving a probe response packet associated with the probe packet from the at least one node;
step 404, determining the network status of each node at least according to the sending information of the probe packet corresponding to each node and the receiving information of the probe response packet.
In the embodiment of the present invention, the steps 403 and 404 are similar to the steps 102 and 103, and the embodiment of the present invention is not described herein again.
To sum up, the method for detecting a network state according to the embodiment of the present invention may start a plurality of sending coordination processes to send a detection packet to a plurality of adjacent nodes, respectively, so as to detect the network state of the adjacent nodes, and under the condition that there are many adjacent nodes and there are many started sending coordination processes, a high concurrency condition caused by simultaneous starting of a large number of coordination processes may be avoided by starting the sending coordination processes for multiple times, so as to reduce the pressure of the CPU load.
Method example five
Referring to fig. 5, a flowchart illustrating a fifth step of the method for detecting a network state according to the embodiment of the present invention is shown, which may specifically include:
step 501, determining the packet sending quantity and/or the packet sending frequency of the detection packets corresponding to each node according to the historical network state of each node in the content distribution network;
compared with the first method embodiment, step 501 is added in the embodiment of the present invention to evaluate the trust level of the current network state according to the historical network state of the node, for example: when the historical network state is a stable state, determining that the current network state is a trusted state, and reducing the packet sending number of the detection packets sent to each node to a first preset number and/or reducing the packet sending frequency to a first preset frequency in the current network state detection process; when the historical network state is an unstable state, determining that the current network state is an unstable state, in the current network state detection process, maintaining the packet sending number of the detection packets which can be sent to each node unchanged, and/or maintaining the packet sending frequency unchanged, or increasing the packet sending number of the detection packets which are sent to each node to a second preset number, and/or increasing the packet sending frequency to a second preset frequency. Therefore, the resource occupation in the network state detection process can be reduced, and the time used in the network state detection process is saved.
In this embodiment of the present invention, the process of determining the packet sending number and/or the packet sending frequency of the corresponding probe packet according to the historical network state of each node in at least one node adjacent to the content distribution network specifically may include: acquiring a historical detection time extreme value of the node to be detected and a historical packet loss rate of the detection packet;
and when the historical detection time extreme value is greater than a first time threshold value and the packet loss rate is less than a first preset packet loss rate, in the current network detection process, reducing the packet sending number of the detection packets sent to each node to a first preset number, and reducing the packet sending frequency of the detection packets to the first preset frequency.
And when the historical detection time extreme value is smaller than a second time threshold value and/or the historical packet loss rate is larger than a second preset packet loss rate, recovering the packet sending number of the detection packets from the preset number to the initial number, and recovering the packet sending frequency of the detection packets from the preset frequency to the initial frequency.
When the historical detection time extreme value is greater than the first time threshold value and the historical packet loss rate is less than the first preset packet loss rate, the network state of the node can be considered to be stable, and the node can be trusted, so that the packet sending quantity of the detection packets sent to the node can be reduced, the packet sending frequency of the detection packets is reduced, and the utilization rate of the cpu and the memory is reduced.
When the historical detection time extreme value is smaller than a second time threshold value and/or the historical packet loss rate is larger than a second preset packet loss rate, the network state of the node is considered to be changed from stable to unstable, so that the node is not trusted any more, and the packet sending quantity and the packet sending frequency of the sent detection packets are restored to the initial values, so that the accuracy of the detection of the network state is ensured.
In this embodiment of the present invention, the step of determining the historical exploration time extremum may specifically include:
acquiring the sending time of a historical detection packet; acquiring the receiving time of a detection response packet fed back by the node; determining the maximum value and the minimum value of the time interval between the sending time of the detection packet and the receiving time of the corresponding detection response packet; and determining the difference value between the maximum value and the minimum value as the detection time extreme value.
Step 502, starting at least one sending protocol to send a detection packet to at least one node in the content distribution network;
in the embodiment of the present invention, step 502, step 503 and step 504 are similar to step 101, step 102 and step 103, and are not described herein again in the embodiment of the present invention.
Step 503, starting a single receiving routine to receive a probe response packet associated with the probe packet from the at least one node;
step 504, determining the network state of each node at least according to the sending information of the probe packet corresponding to each node and the receiving information of the probe response packet.
To sum up, the method for detecting a network state provided in the embodiments of the present invention can determine the packet sending number and the packet sending frequency of the detection packets in the current detection process according to the historical network state, so as to appropriately reduce the packet sending number and/or the packet sending frequency of the detection packets when the historical network state is stable, so as to reduce the occupation of resources; when the historical network state is unstable, the packet sending quantity and/or the packet sending frequency of the detection packets are/is appropriately increased so as to ensure the accuracy of the detection of the network state.
Apparatus embodiment one
Referring to fig. 6, a schematic structural diagram of a first embodiment of a system for detecting a network state provided by the present invention is shown, which may specifically include: a sending module 601, a receiving module 602, a determining module 603, wherein,
a sending module 601, configured to start at least one sending routine to send a probe packet to at least one node in the content distribution network;
a receiving module 602, configured to initiate a single receive routine to receive probe response packets associated with the probe packets from the at least one node;
the evaluating module 603 may be configured to determine a network status of each node according to at least transmission information of the probe packet and reception information of the probe response packet corresponding to each node.
In an alternative embodiment of the present invention, the number of the transmission schedules may correspond to the number of the nodes.
In an optional embodiment of the present invention, the system may further include: and the service module can be used for providing services for the application program needing to acquire the node network state according to the detection result.
Device embodiment II
Referring to fig. 7, a schematic structural diagram of a second embodiment of the method for detecting a network state in the present invention is shown, which may specifically include: a sending module 701, a receiving module 702 and a determining module 703; wherein,
a sending module 701, configured to start at least one sending protocol to send a probe packet to at least one node in the content distribution network;
a receiving module 702, configured to initiate a single receive routine to receive probe response packets associated with the probe packets from the at least one node;
the evaluating module 703 may be configured to determine a network status of each node according to at least the sending information of the probe packet and the receiving information of the probe response packet corresponding to each node.
The sending information of the detection packets at least comprises the packet sending quantity of the detection packets and the packet sending time of each detection packet, and the receiving information of the detection response packets at least comprises the receiving quantity of the detection response packets and the packet receiving time of each detection response packet; the evaluation module 703 may specifically include:
a round trip time determining unit 7031, configured to determine a round trip time as a time difference between a packet receiving time of each probe response packet and a packet sending time of each associated probe packet;
a discard number determining unit 7032, configured to discard the probe response packet whose round trip time is greater than a predetermined threshold;
a network status determining unit 7033 may be configured to determine a network status of each node according to at least the number of the packets sent to each node and the number of the packets received without discarding.
In an optional embodiment of the present invention, the evaluation module 703 may further include:
an extremum determining unit 7034, configured to obtain round trip times between packet receiving times of each probe response packet that is not discarded and packet sending times of each associated probe packet, and determine a time extremum between a maximum round trip time and a minimum round trip time;
the network status determining unit 7033 may be further configured to determine the network status of each node according to at least the number of packets sent and the number of packets received corresponding to each node and the time limit.
In an optional embodiment of the present invention, the sending module 701 may specifically include:
a send protocol quantity determining unit 7011, configured to determine the quantity of the send protocols to be started;
the multiple starting unit 7012 may be configured to start the number of sending schedules in multiple times when the number of sending schedules to be started is greater than a predetermined number threshold, where at least one sending schedule that is smaller than the predetermined number threshold is started each time and sends a probe packet to at least one node respectively.
In an optional embodiment of the present invention, the system may further include: the probe packet determining module 704 may be configured to determine, according to the historical network states of the nodes in the content distribution network, the packet sending number and/or the packet sending frequency of the probe packets corresponding to the nodes.
Fig. 8 is a schematic structural diagram of a network status detection apparatus according to an embodiment of the present invention, and the embodiment of the present invention does not limit the specific implementation of the network status detection system. As shown in fig. 8, the system for detecting a network state may specifically include:
at least one central processor (processor)810, a memory (memory)820, and a communication bus 830. The memory 820 and the at least one central processor 810 are connected by a bus, the memory 820 is used for storing computer instructions, and when the device runs, the at least one central processor 810 executes the computer instructions stored in the memory, so that the device executes the method flows shown in fig. 1 to 5.
The embodiment of the application provides a nonvolatile computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the detection method of the network state in any method embodiment;
as one embodiment, a non-volatile computer storage medium of the present invention stores computer-executable instructions configured to:
starting at least one sending protocol to send a detection packet to at least one node in the content distribution network;
initiating a single receive routine to receive probe response packets associated with the probe packets from the at least one node;
and determining the network state of each node at least according to the sending information of the detection packet corresponding to each node and the receiving information of the detection response packet.
As a non-volatile computer-readable storage medium, it can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the network state detection method in the embodiment of the present application (for example, the sending module 601, the receiving module 602, and the evaluation module 603 shown in fig. 6). The one or more modules are stored in the non-transitory computer-readable storage medium and when executed by a processor perform the method of detecting network status in any of the method embodiments described above.
The non-volatile computer-readable storage medium may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of a storage optimization device of the memory, and the like. Further, the non-volatile computer-readable storage medium may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the non-transitory computer readable storage medium optionally includes a memory remotely located from the processor, and the remote memory may be connected to the means for detecting the network status of the memory over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 9, the electronic device includes:
one or more processors 910 and a memory 920, one processor 910 being illustrated in fig. 9.
The apparatus for detecting a network state of the memory may further include: an input device 930 and an output device 940.
The processor 910, the memory 920, the input device 930, and the output device 940 may be connected by a bus or other means, and fig. 9 illustrates an example of a connection by a bus.
The memory 920 is a non-volatile computer-readable storage medium as described above. The processor 910 executes various functional applications and data processing of the server by running nonvolatile software programs, instructions and modules stored in the memory 920, that is, the method for detecting the network state of the above-described method embodiments is implemented.
The input device 930 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the detection system of the network state. The output device 970 may include a display device such as a display screen.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in the embodiments of the present application.
As an embodiment, the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to:
starting at least one sending protocol to send a detection packet to at least one node in the content distribution network;
initiating a single receive routine to receive probe response packets associated with the probe packets from the at least one node;
and determining the network state of each node at least according to the sending information of the detection packet corresponding to each node and the receiving information of the detection response packet.
Embodiments of the present invention also provide a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, where the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the above methods for detecting a network state.
The electronic device of the embodiments of the present application exists in various forms, including but not limited to:
(1) mobile communication devices, which are characterized by mobile communication capabilities and are primarily targeted at providing voice and data communications. Such terminals include smart phones (e.g., iphones) and the like.
(2) The ultra-mobile personal computer equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include PDA, MID, and UMPC devices, such as ipads.
(3) The server is similar to a general computer architecture, but has higher requirements on processing capability, stability, reliability, safety, expandability, manageability and the like because of the need of providing highly reliable services.
(4) And other electronic devices with data interaction functions.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as methods, electronic devices, or computer program products. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (11)
1. A method for detecting a network state, comprising:
starting at least one sending protocol to send a detection packet to at least one node in the content distribution network;
initiating a single receive routine to receive probe response packets associated with the probe packets from the at least one node;
and determining the network state of each node at least according to the sending information of the detection packet corresponding to each node and the receiving information of the detection response packet.
2. The method according to claim 1, wherein the sending information of the probe packets at least includes the number of sending probe packets and the sending time of each probe packet, and the receiving information of the probe response packets at least includes the receiving number of probe response packets and the receiving time of each probe response packet;
the determining the network state of each node at least according to the sending information of the probe packet and the receiving information of the probe response packet corresponding to each node comprises:
determining the time difference between the packet receiving time of each probe response packet and the packet sending time of each associated probe packet as the round trip time;
discarding the probe response packet with the round trip time larger than a preset threshold;
determining a network state of each node based at least on the number of packets sent and the number of packets received that were not discarded corresponding to each node.
3. The method of claim 2, wherein after discarding probe response packets having a round trip time greater than a predetermined threshold and determining a number of discards, further comprising:
obtaining round trip time between the packet receiving time of each undiscarded detection response packet and the packet sending time of each associated detection packet, and determining a time extreme value between the maximum round trip time and the minimum round trip time;
the determining the network state of each node at least according to the number of the packets sent corresponding to each node and the number of the packets received without being discarded comprises:
and determining the network state of each node at least according to the packet sending number, the receiving number and the time extreme value corresponding to each node.
4. The method of claim 1, wherein the initiating at least one transmission protocol to send probe packets to at least one node in the content distribution network comprises:
determining the number of sending coroutines to be started;
and when the number of the sending coroutines to be started is larger than a preset number threshold, starting the sending coroutines in the number for multiple times, wherein at least one sending coroutine which is smaller than the preset number threshold is started each time, and sending a detection packet to at least one node.
5. The method of any of claims 1-4, wherein prior to initiating at least one transmission protocol to transmit probe packets to at least one node in the content distribution network, the method further comprises:
and determining the packet sending quantity and/or the packet sending frequency of the detection packets corresponding to each node according to the historical network state of each node in the content distribution network.
6. A system for detecting a network condition, comprising:
a sending module, configured to start at least one sending coroutine to send a probe packet to at least one node in the content distribution network;
a receiving module configured to initiate a single receive routine to receive probe response packets associated with the probe packets from the at least one node;
and the evaluation module is used for determining the network state of each node at least according to the sending information of the detection packet corresponding to each node and the receiving information of the detection response packet.
7. The system according to claim 6, wherein the sending information of the probe packets at least includes the number of sending probe packets and the sending time of each probe packet, and the receiving information of the probe response packets at least includes the receiving number of probe response packets and the receiving time of each probe response packet;
the evaluation module comprises:
a round trip time determining unit, configured to determine a round trip time as a time difference between a packet receiving time of each probe response packet and a packet sending time of each associated probe packet;
a discarding number determining unit, configured to discard the probe response packet whose round trip time is greater than a predetermined threshold;
a network state determining unit, configured to determine a network state of each node at least according to the number of the packets sent to each node and the number of the packets received without discarding.
8. The system of claim 7, wherein the evaluation module further comprises: an extreme value determining unit, configured to obtain round-trip time between packet receiving time of each probe response packet that is not discarded and packet sending time of each associated probe packet, and determine a time extreme value between a maximum round-trip time and a minimum round-trip time;
the network state determining unit is further configured to determine a network state of each node at least according to the packet sending number and the receiving number corresponding to each node and the time extreme value.
9. The system of claim 6, wherein the sending module comprises:
a sending protocol quantity determining unit used for determining the quantity of sending protocols to be started;
and the multiple starting unit is used for starting the number of the sending protocol processes to be started for multiple times when the number of the sending protocol processes to be started is larger than a preset number threshold, wherein at least one sending protocol process which is smaller than the preset number threshold is started each time, and a detection packet is sent to at least one node.
10. The system according to any one of claims 6 to 9, further comprising:
and the detection packet determining module is used for determining the packet sending quantity and/or the packet sending frequency of the detection packets corresponding to each node according to the historical network state of each node in the content distribution network.
11. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610935098.9A CN106533826A (en) | 2016-10-25 | 2016-10-25 | Network state detection method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610935098.9A CN106533826A (en) | 2016-10-25 | 2016-10-25 | Network state detection method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106533826A true CN106533826A (en) | 2017-03-22 |
Family
ID=58291877
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610935098.9A Pending CN106533826A (en) | 2016-10-25 | 2016-10-25 | Network state detection method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106533826A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107317728A (en) * | 2017-07-04 | 2017-11-03 | 西安万像电子科技有限公司 | Bandwidth measurement method and device |
CN107995036A (en) * | 2017-11-30 | 2018-05-04 | 杭州电魂网络科技股份有限公司 | Data transmission method, device, server and readable storage medium storing program for executing |
CN108063696A (en) * | 2017-12-14 | 2018-05-22 | 北京云端智度科技有限公司 | A kind of meshed network method for evaluating quality |
CN111106976A (en) * | 2018-10-26 | 2020-05-05 | 北京金山云网络技术有限公司 | Detection method and device for CDN network, electronic equipment and readable storage medium |
CN113179193A (en) * | 2021-04-22 | 2021-07-27 | 北京汉希工业科技有限公司 | AEI communication monitoring system |
CN115150283A (en) * | 2022-09-05 | 2022-10-04 | 腾讯科技(深圳)有限公司 | Network bandwidth detection method and device, computer equipment and storage medium |
CN115348196A (en) * | 2022-08-05 | 2022-11-15 | 上海久尺网络科技有限公司 | Bandwidth detection method and device, electronic equipment and storage medium |
CN116155918A (en) * | 2023-02-15 | 2023-05-23 | 讯芸电子科技(中山)有限公司 | Device connection method and device for carrying optoelectronic module |
-
2016
- 2016-10-25 CN CN201610935098.9A patent/CN106533826A/en active Pending
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107317728B (en) * | 2017-07-04 | 2021-03-02 | 西安万像电子科技有限公司 | Bandwidth measuring method and device |
CN107317728A (en) * | 2017-07-04 | 2017-11-03 | 西安万像电子科技有限公司 | Bandwidth measurement method and device |
CN107995036A (en) * | 2017-11-30 | 2018-05-04 | 杭州电魂网络科技股份有限公司 | Data transmission method, device, server and readable storage medium storing program for executing |
CN107995036B (en) * | 2017-11-30 | 2021-04-20 | 杭州电魂网络科技股份有限公司 | Data transmission method, device, server and readable storage medium |
CN108063696A (en) * | 2017-12-14 | 2018-05-22 | 北京云端智度科技有限公司 | A kind of meshed network method for evaluating quality |
CN111106976B (en) * | 2018-10-26 | 2022-09-02 | 北京金山云网络技术有限公司 | Detection method and device for CDN network, electronic equipment and readable storage medium |
CN111106976A (en) * | 2018-10-26 | 2020-05-05 | 北京金山云网络技术有限公司 | Detection method and device for CDN network, electronic equipment and readable storage medium |
CN113179193A (en) * | 2021-04-22 | 2021-07-27 | 北京汉希工业科技有限公司 | AEI communication monitoring system |
CN115348196A (en) * | 2022-08-05 | 2022-11-15 | 上海久尺网络科技有限公司 | Bandwidth detection method and device, electronic equipment and storage medium |
CN115150283A (en) * | 2022-09-05 | 2022-10-04 | 腾讯科技(深圳)有限公司 | Network bandwidth detection method and device, computer equipment and storage medium |
CN115150283B (en) * | 2022-09-05 | 2022-11-22 | 腾讯科技(深圳)有限公司 | Network bandwidth detection method and device, computer equipment and storage medium |
CN116155918A (en) * | 2023-02-15 | 2023-05-23 | 讯芸电子科技(中山)有限公司 | Device connection method and device for carrying optoelectronic module |
CN116155918B (en) * | 2023-02-15 | 2023-11-03 | 讯芸电子科技(中山)有限公司 | Device connection method and device for carrying optoelectronic module |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106533826A (en) | Network state detection method and system | |
Kliazovich et al. | CA-DAG: Modeling communication-aware applications for scheduling in cloud computing | |
US9218203B2 (en) | Packet scheduling in a multiprocessor system using inter-core switchover policy | |
CN108268372B (en) | Mock test processing method and device, storage medium and computer equipment | |
CN111950988B (en) | Distributed workflow scheduling method and device, storage medium and electronic equipment | |
CN105103495B (en) | For allowing or refusing the admission control of the measurement request between the first and second equipment | |
CN109905259A (en) | Communicate to connect maintenance method, system and relevant device | |
CN110417650A (en) | Multilink data distribution method, device and electronic equipment | |
CN113038609B (en) | Method, device and equipment for allocating bandwidth resources based on communication demands | |
CN112311628B (en) | Network speed measuring method, system, network equipment and storage medium | |
CN111163018B (en) | Network equipment and method for reducing transmission delay thereof | |
CN110019386B (en) | Stream data processing method and device | |
CN107977302B (en) | CPU utilization rate output method and device | |
US20200019485A1 (en) | Dynamic management of monitoring tasks in a cloud environment | |
US20170366465A1 (en) | Communication control program, communication control method, and communication control apparatus | |
CN103416022A (en) | In-service throughput testing in distributed router/switch architectures | |
CN113595926A (en) | API data transmission method, device, equipment and medium based on data middlebox | |
CN110460491B (en) | RDMA (remote direct memory Access) -based performance test method and device | |
CN106549827A (en) | The detection method and device of network state | |
CN110677358A (en) | Message processing method and network equipment | |
CN115242687B (en) | Node activity detection method, device, equipment and medium | |
CN104468337A (en) | Message transmission method and device, message management center device and data centers | |
US20160373367A1 (en) | System and method for identifying performance characteristics in asynchronous networks | |
JP6637381B2 (en) | Wireless device | |
CN105721349B (en) | A kind of optimization method of mobile application Internet resources, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20170322 |