WO2021138956A1 - 一种网络质量的探测方法及装置 - Google Patents

一种网络质量的探测方法及装置 Download PDF

Info

Publication number
WO2021138956A1
WO2021138956A1 PCT/CN2020/074974 CN2020074974W WO2021138956A1 WO 2021138956 A1 WO2021138956 A1 WO 2021138956A1 CN 2020074974 W CN2020074974 W CN 2020074974W WO 2021138956 A1 WO2021138956 A1 WO 2021138956A1
Authority
WO
WIPO (PCT)
Prior art keywords
detection
sampling
interval
sampled
ips
Prior art date
Application number
PCT/CN2020/074974
Other languages
English (en)
French (fr)
Inventor
郑立凡
Original Assignee
厦门网宿有限公司
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 厦门网宿有限公司 filed Critical 厦门网宿有限公司
Priority to EP20730554.1A priority Critical patent/EP3876479A1/en
Priority to US16/903,280 priority patent/US20210218655A1/en
Publication of WO2021138956A1 publication Critical patent/WO2021138956A1/zh

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/50Testing arrangements
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/695Types of network addresses using masks or ranges of addresses

Definitions

  • the embodiments of the present application relate to the computer field, and in particular, to a method and device for detecting network quality.
  • ICMP Internet Control Message Protocol, Internet Control Message Protocol
  • the number of IPs that need to be detected is huge, the detection period is long, the detection efficiency is low, and the connectivity of each IP may be unstable. For example, if all IPs in the network cannot be detected in one day, it needs to be detected for two days. , But the IP that is successfully connected on the first day may fail on the second day, and this IP cannot be used as the basis for network quality detection.
  • the embodiments of the present application provide a method and device for detecting network quality, which are used to pre-determine a small number of IPs with stable connectivity and uniform distribution from a large number of IPs, which are used as IPs for network quality detection, thereby improving network quality. Detection efficiency.
  • the method for detecting network quality includes: obtaining a first IP interval; masking the D segment of the starting IP in the first IP interval to obtain the first IP; The first IP, the sampling IP is determined from the first IP interval; if the sampling IP meets the preset number, survivability detection is performed on the sampling IP.
  • the masking the D segment of the starting IP in the first IP interval to obtain the first IP includes: performing a bitwise AND operation on the starting IP according to the C bit mask; The bitwise AND operation is used to change segment D in the starting IP to 0; change the starting IP of the D segment to 0 as the first IP.
  • the determining the sampling IP from the first IP interval according to the first IP includes: adding a plurality of first preset values to the C segment of the first IP to obtain each first IP The second IP corresponding to the preset value; the value of each first preset value is different; the D segment of the second IP corresponding to each first preset value is added to the second preset value to obtain each first preset value Set the third IP corresponding to the set value; the third IP corresponding to each first preset value is the same as the C segment of the second IP; the third IP corresponding to the multiple first preset values belongs to the first IP interval Three IPs are determined as sampling IPs.
  • the second preset value is equal to 1 or 254; the sampling IP is the gateway IP of the C segment.
  • the method further includes: if the sampling IP does not meet the preset number, randomly determining an IP other than the sampling IP from the first IP interval as the sampling IP.
  • the number of sampling IPs is M; the randomly determining IPs other than the sampling IP from the first IP interval as the sampling IP includes: according to the M sampling IPs, dividing the first IP interval Divide into M+1 second IP intervals; determine an IP from any second IP interval in the M+1 second IP intervals as the M+1th sampling IP; Sample IP, divide the second IP interval where the M+1th sampled IP is located into two second IP intervals to obtain M+2 second IP intervals; and then obtain M+2 second IP intervals from the M+2 second IP An IP in any second IP interval in the interval is determined as the M+2th sampling IP, until the sampling IP that meets the preset number is determined.
  • the randomly determining from the first IP interval an IP other than the sampling IP as the sampling IP includes: randomly determining from each first IP interval in turn An IP other than the sampling IP is selected as the sampling IP until the sampling IP that meets the preset number is determined.
  • the performing survivability detection on the sampled IP includes: performing survivability detection on each sampled IP, and determining the sampling IP that passes the survivability detection as a detection IP; the detection IP is used for network Quality detection; the survivability detection of the sampled IP includes: multiple connectivity detections of the sampled IP; in any connection detection, if the connection with the sampled IP is successful, it is determined that the connection detection is Packet loss rate; if it is determined that the proportion of successful connectivity corresponding to the sampled IP and the packet loss rate after each successful connectivity meet a preset condition, it is determined that the sampled IP passes the survivability detection.
  • the method further includes: adding the detection IP to a detection set; and performing the survivability on each detection IP in the detection set. Probe, delete the probe IP that fails the survivability probe in the probe set.
  • the first IP interval that is, the IP range corresponding to the service area
  • the D segment of the starting IP of the first IP interval is masked, so that according to the masked starting IP,
  • the sampling IP is determined in the first IP interval.
  • the number of sampling IPs is small, which can shorten the entire detection period and improve detection efficiency.
  • the D segment of the initial IP is masked, it is equivalent to retaining the initial IP.
  • C segment that is, determine the sampling IP from the first IP interval according to the C segment of the starting IP.
  • the distribution of sampled IPs determined from the first IP interval according to the C segment of the starting IP is relatively uniform and representative. Therefore, the network quality of a smaller number of sampled IPs can represent the network quality of a larger number of IPs. That can represent the network quality of the entire service area.
  • the survivability detection of the sampled IP can find sampled IPs with more uniform distribution and better connectivity, so that these IPs can be detected to evaluate the network quality of the entire service area and further improve the network quality of the service area. The efficiency of detection.
  • an embodiment of the present application also provides a network quality detection device, which includes: an acquiring unit, which acquires a first IP interval; and a sampling unit, which is configured to perform D segment of the starting IP in the first IP interval.
  • a network quality detection device which includes: an acquiring unit, which acquires a first IP interval; and a sampling unit, which is configured to perform D segment of the starting IP in the first IP interval.
  • sampling unit is specifically configured to: perform a bitwise AND operation on the starting IP according to the C bit mask; the bitwise AND operation is used to change the D segment in the starting IP to 0; The starting IP where the D segment becomes 0 is used as the first IP.
  • the sampling unit is specifically configured to: add multiple first preset values to the C segment of the first IP to obtain the second IP corresponding to each first preset value; each first preset value The value of is different; add the D segment of the second IP corresponding to each first preset value to the second preset value to obtain the third IP corresponding to each first preset value; each first preset value corresponds to The third IP of is the same as the C section of the second IP; the third IP belonging to the first IP interval among the plurality of third IPs corresponding to the first preset values is determined as the sampling IP.
  • the second preset value is equal to 1 or 254; the sampling IP is the gateway IP of the C segment.
  • sampling unit is further configured to: if the sampling IP does not meet the preset number, randomly determine an IP other than the sampling IP from the first IP interval as the sampling IP.
  • the sampling unit is specifically configured to: divide the first IP interval into M+1 second IP intervals according to the M sampling IPs; Determine an IP in any second IP interval of the two IP intervals as the M+1th sampling IP; according to the M+1th sampling IP, the second IP where the M+1th sampling IP is located The interval is divided into two second IP intervals, and M+2 second IP intervals are obtained; and then an IP is determined from any second IP interval in the M+2 second IP intervals as the M+2th Sampling IP until the sampling IP that meets the preset number is determined.
  • the sampling unit is specifically configured to randomly determine an IP other than the sampling IP from each first IP interval as the sampling IP until it is determined that it meets the pre-determined Set the number of sampling IPs.
  • the detection unit is specifically configured to: perform survivability detection on each sampled IP, and determine the sampling IP that passes the survivability detection as a detection IP; the detection IP is used to perform network quality detection; The detection unit is specifically configured to: perform multiple connectivity detections on the sampled IP; in any connection detection, if the connection with the sampled IP is successful, determine the packet loss rate in the connectivity detection; if the sampled IP is determined If the corresponding percentage of successful connection and the packet loss rate after each successful connection meet the preset condition, it is determined that the sampled IP passes the survivability detection.
  • the detection unit is further configured to: after the sampling IP that passed the survivability detection is determined to be the detection IP, add the detection IP to the detection set; and for each detection in the detection set The IP performs the survivability detection, and deletes the detection IP that fails the survivability detection in the detection set.
  • an embodiment of the present application also provides a computing device, including: a memory, configured to store program instructions; a processor, configured to call the program instructions stored in the memory, and execute the above-mentioned network quality detection according to the obtained program method.
  • an embodiment of the present application also provides a computer-readable non-volatile storage medium, including computer-readable instructions.
  • the computer reads and executes the computer-readable instructions, the computer is caused to perform the above-mentioned network quality detection. method.
  • FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of this application.
  • FIG. 2 is a schematic flowchart of a method for detecting network quality according to an embodiment of this application
  • FIG. 3 is a schematic diagram of dividing a first IP interval according to an embodiment of the application.
  • FIG. 4 is a schematic diagram of dividing multiple first IP intervals according to an embodiment of the application.
  • FIG. 5 is a schematic structural diagram of a network quality detection device provided by an embodiment of this application.
  • the detection server detects the network quality of the service area, in order to prevent the detection server from detecting all IPs in the service area, it needs to collect stable and evenly distributed IPs from all the IPs in the service area as the detection IP. Therefore, the detection server detects the detection IP to determine the network quality of the service area.
  • the embodiments of this application involve a global IP library.
  • the IP library records multiple IP segments. Each IP segment corresponds to a start IP and an end IP.
  • the IP segment can be understood as an IP range, IP interval, etc., For example, if the IP segment is 180.160.0.0-180.175.255.255, its starting IP is 180.160.0.0 and its ending IP is 180.175.255.255.
  • Each IP in the IP library corresponds to a country field, a state (province/city) field, a city field (if it is a small country, the city information is directly stored in the state field, and then the city field is consistent with the state field) and operator field, It can be that multiple IP segments in the IP library are grouped according to the country field, state field, city field, and operator field, and finally it is determined that each group corresponds to multiple IP segments.
  • determining to detect a certain service area it can be to determine the group corresponding to the service area, and then determine multiple sampling IPs from multiple IP segments of the group, and then determine the detection IP from the multiple sampling IPs, to It is used to detect the network quality of the service area.
  • FIG. 1 exemplarily shows a system architecture applicable to a method for detecting network quality provided by an embodiment of the present application, and the system architecture may include a big data platform, a sampling system, and a detection server;
  • the sampling system is used to determine multiple sampling IPs from multiple IP segments in the service area; the detection server continuously tests the survivability of the sampling IPs, and reports the test data of each sampling IP to the big data platform; the big data platform is based on the detection For the test data reported by the server, the detection IP is determined from the sampled IP, and the detection IP is added to the detection set.
  • the detection server detects the detection IP in the detection set for the detection of the network quality of the service area.
  • the survivability test refers to testing the connectivity and stability of the sampled IP.
  • FIG. 2 exemplarily shows a flow of a method for detecting network quality provided by an embodiment of the present application, and the flow may be executed by a device for detecting network quality.
  • the process specifically includes:
  • Step 201 Obtain a first IP interval.
  • the first IP interval is from the start IP to the end IP, and the first IP interval includes N consecutive IPs.
  • Step 202 Perform mask processing on the D segment of the starting IP in the first IP interval to obtain the first IP.
  • the initial IP is converted to a numeric type, including A segment, B segment, C segment, and D segment.
  • the range of each segment is 0-255, a total of 256.
  • one bit can be Represents two values of 0 or 1.
  • One byte is 8 bits, so one byte can just store the value of one segment. Therefore, a 4byte unsigned integer is used to represent an IP. For example, if the starting IP is 8.8.8.8, it corresponds to the A, B, C, and D sections of the IP, and the starting IP can be converted into a binary format of 000010000000100000001000.
  • it can be a bitwise AND operation on the starting IP based on the C bit mask.
  • the bitwise AND operation is used to change the D segment in the starting IP to 0, thereby changing the D segment into The starting IP of 0 is used as the first IP.
  • the C bit mask is 11111111111111111111100000000.
  • Step 203 Determine a sampling IP from the first IP interval according to the first IP.
  • a sample IP with a relatively uniform distribution can be determined from the first IP interval according to the first IP.
  • the C segment of the first IP may be added with multiple first presets. Set the value to obtain the second IP corresponding to each first preset value, where the value of each first preset value is different, which means that multiple first preset values can take 0, 1, 2, in turn 3.
  • the corresponding second IP is determined; when the first preset value is 1, the corresponding second IP is determined; when the first preset value is 2 When, determine its corresponding second IP.
  • the third IP corresponding to each first preset value is the same as the C segment of the second IP, that is, the D of the second IP corresponding to each first preset value is
  • the second preset value is not greater than 256 to ensure that the C segment of the second IP will not be increased by 1.
  • the D segment of the first IP can be first added to the second preset value.
  • the C segment of the first IP after adding the second preset value to the D segment remains unchanged, and then the After the D section plus the second preset value, the C section of the first IP is added with multiple first preset values respectively, and the multiple first preset values can still be sequentially selected as 0, 1, 2, 3..., respectively Get multiple C-segment changed IPs.
  • the second preset value can be added to the D segment of the first IP, and then multiple first preset values can be added to the C segment, of course. You can first add multiple first preset values to the C section of the first IP, and then add the second preset value to the D section.
  • a third IP belonging to the first IP interval may be determined from the plurality of third IPs, and the determined third IP may be determined as a sampling IP.
  • the sampling IP can be set as the gateway IP of segment C, that is, the third IP obtained is the gateway IP of segment C.
  • the second preset value can be equal to 1, or equal to 254.
  • Set C The gateway IP of the segment is because the granularity of segment C is finer and widely distributed.
  • the second preset value can also take other values, such as 128, 64, etc., then at this time, the sampling IP can be a non-gateway IP.
  • the sampling IP can also be the gateway IP of segment B.
  • the first preset value is 0, and the second preset value is 1, then the C section of the first IP remains unchanged, and the D section is increased by 1, and the third IP is 8.8.8.1. Determine whether the 8.8.8.1 is in the first IP In the interval, if yes, determine the 8.8.8.1 as the sampling IP.
  • the first preset value is 0, the second preset value is 254, then the C section of the first IP remains unchanged, and the D section adds 254 to obtain the third IP as 8.8.8.254.
  • the first preset value is 1, and the second preset value is 1, then the C section of the first IP is incremented by 1, and the D section is incremented by 1, and the third IP is 8.8.9.1. Determine whether the 8.8.9.1 is in the first IP In the interval, if yes, determine the 8.8.9.1 as the sampling IP.
  • the first preset value is 1, and the second preset value is 254. Then the C section of the first IP is increased by 1, and the D section is increased by 254, and the third IP is 8.8.9.254. Determine whether the 8.8.9.254 is in the first IP In the interval, if yes, the 8.8.9.254 is determined as the sampling IP.
  • the above process is looped until the gateway IPs of all C segments in the first IP interval are determined.
  • the D segment of the first IP can be increased by 1 and 254 to obtain two third IPs; the D segment of the first IP can be further increased by 256, so that the Add 1 to the C section of the first IP, and then add 1 to the D section of the first IP after adding 1 to the C section and add 254 to obtain two third IPs, ... until the first IP interval is determined Gateway IP of all C segments.
  • the IP After adding 256 to the D section of 8.8.8.0, the IP is 8.8.9.0, and then adding 1 to the D section of 8.8.9.0 to obtain 8.8.9.1. Determine whether the 8.8.9.1 is within the first IP interval; change 8.8. Add 254 to the D segment of 9.0 to get 8.8.9.254, and judge whether the 8.8.9.254 is in the first IP interval.
  • the IP After adding 256 to the D section of 8.8.9.0, the IP is 8.8.10.0, and then adding 1 to the D section of 8.8.10.0 to obtain 8.8.10.1, and judging whether the 8.8.10.1 is within the first IP interval; change 8.8. Add 254 to the D segment of 10.0 to get 8.8.10.254, and judge whether the 8.8.10.254 is in the first IP interval.
  • the above process is looped until the gateway IPs of all C segments in the first IP interval are determined.
  • Step 204 If the sampled IP meets the preset number, perform survivability detection on the sampled IP.
  • the sampling IP does not meet the preset number, it is necessary to randomly determine an IP other than the previously determined sampling IP from the first IP interval as the sampling IP.
  • the first IP interval can be divided into M+1 second IP intervals according to the M sampling IPs; from the M+1 second IP interval Determine an IP in any second IP interval as the M+1th sampling IP; then according to the M+1th sampling IP, divide the second IP interval where the M+1th sampling IP is located into two second IPs IP interval, M+2 second IP interval is obtained; then an IP is determined from any second IP interval in the M+2 second IP interval as the M+2th sampling IP, until it is determined that it conforms to the preset The number of sample IPs.
  • the first IP interval can be divided into M+1 second IP intervals, that is, sub-intervals of the first IP interval, according to the M sampling IPs determined from step 201 to step 203, as shown in Figure 3 Out.
  • one implementation can be to randomly determine an integer greater than or equal to 0 and less than M+1, and determine the corresponding value according to the integer And then randomly determine an IP from the corresponding second IP interval; in another implementation manner, it may be to count the total number of all IPs in the M+1 second IP interval, and randomly determine that it is greater than An integer equal to 0 and less than the total number, and an IP is determined from all IPs according to the integer.
  • the current packet may include multiple first IP intervals.
  • one IP may be randomly selected from the multiple second IP intervals corresponding to each first IP interval. Sampling IP, and further divide the corresponding second IP interval into two IP intervals according to the selected IP, which is equivalent to randomly selecting an IP from the first first IP interval as the sampling IP, and selecting The selected IP divides the corresponding second IP interval into two second IP intervals; then an IP is randomly selected from the second first IP interval as the sampling IP, and the corresponding second IP interval is selected according to the selected IP.
  • the IP interval is divided into two second IP intervals, and the above process is looped, and finally a sampling IP meeting the preset number is obtained, as shown in FIG. 4.
  • the sampling system may distribute the sampling IP to the detection server, so that the detection server performs survivability detection on the sampling IP, and the detection server uploads the detected data to the sampling server.
  • survivability detection can be performed on each sampled IP, and the sampled IP that passes the survivability detection is determined as the detection IP, and the detection IP is used to perform network quality detection.
  • multiple connectivity detections may be performed on the sampled IP.
  • Each connectivity detection may or may not be connected. Therefore, it is necessary to count the number of times that the sampled IP is connected to determine the proportion of successful connectivity corresponding to the sampled IP. And each time the connection is successful, the packet loss rate in the connectivity detection is determined; further, if it is determined that the proportion of the successful connection corresponding to the sampled IP and the packet loss rate after each successful connection meet the preset conditions, it is determined
  • the sampled IP passes survivability detection.
  • the sampling IP that meets the preset conditions is obtained from multiple sampling IPs as the detection IP.
  • the preset condition is that the connection rate (the number of times that can be connected ⁇ the total number of detection times ⁇ 100%)> 80%, and the response from the connection
  • the packet loss rate of each time is accumulated and averaged, and the average packet loss rate is less than 80%
  • the IP includes the country field, the state (province/city) field, the city field, and the operator field.
  • the sampled IP that passed the survivability detection is determined as the detection IP, and the detection IP is added to the detection set.
  • the detection IP is added to the detection set.
  • the determined sampling IP is subjected to survivability detection, and the sampling IP that passes the survivability detection is added to the detection set as the detection IP, and the detection IP in the detection set Perform survivability detection and delete the detection IP that failed the survivability detection from the detection set. In this way, it can be ensured that all the detection IPs in the detection set have good connectivity. Further, in the embodiment of the application, it is assumed that It is determined that the IP that was previously added to the detection set cannot be used as the sampling IP again, so that the accuracy of network quality detection can be improved on the premise of ensuring better connectivity of the detection IP. For example, the detection period is 1 day.
  • 5000 sampled IPs are determined, and then survivability detection is performed on the 5000 sampled IPs, and 2000 detection IPs are determined to be used to evaluate the network quality of the service area.
  • 2000 detection IPs are determined to be used to evaluate the network quality of the service area.
  • on the second day continue to determine 3000 sampling IPs from all IPs in the service area (all IPs except 2000 detection IPs), and combine the 2000 detection IPs on the first day to form a total of 5000 sampling IPs.
  • the 5000 sampled IPs continue to perform survivability detection.
  • 2300 IPs that pass the survivability detection are determined (1800 of the 2000 detection IPs on the first day passed the survivability detection, 3000 sampled IPs on the second day There are 500 detection IPs that passed the survivability detection, totaling 2300), then the 2300 IPs that passed the survivability detection are added to the detection set as the detection IP for use in evaluating the network quality of the service area.
  • sampling IPs are determined from all IPs in the service area (except those that have been determined to be detection IPs), and combined with the detection IPs of the previous day to form all sampling IPs of the day for survivability detection.
  • the sampled IP that passed the survivability detection is added to the detection set as the detection IP to be used for evaluating the quality of the service area network.
  • the first is to detect the survivability of the sampled IP after the sampled IP is determined, and determine the sampled IP that passed the survivability test as the detection IP;
  • the second step is to determine the connectivity of the detection IP after the detection IP is determined, and determine the network quality of the service area based on the connectivity of the detection IP. That is to say, the first detection is used to find evenly distributed and stable IPs in the service area as the detection IP, so in the second detection, the network quality of the service area can be determined based on these evenly distributed and stable IPs. Detection, through this method, the quality of the service area network can be effectively detected, and the detection efficiency is high.
  • the first type is the detection servers deployed by manufacturers in business scenarios, which can be deployed at home and abroad, and all sampled IPs can be distributed to the first type of detection servers. It can be used to determine the probe IP with stable connectivity.
  • the second type is the detection server deployed by users in business scenarios. It can also be deployed at home and abroad. After the detection IP is determined, the second type of detection server is used to detect the detection IP in the service area to determine the service area. Network quality.
  • the second type of detection server determines the network quality of the service area, correspondingly, you can actually know the network quality of the second type of detection server, that is, the second type of detection server is checking the detection IP When performing detection, it can know its own network quality accordingly. In this way, it is also known that when the second type of detection server is deployed in which computer room, the network quality of the second type of detection server is good, so that the cloud platform can be determined Which computer room or rooms are deployed in.
  • the operators used when the detection servers are deployed in each computer room are also different.
  • the numbers of the deployed detection servers can be as shown in Table 2.
  • the first IP interval that is, the IP range corresponding to the service area
  • the D segment of the starting IP of the first IP interval is masked, so that according to the masked starting IP, Determine the sampling IP from the first IP interval.
  • the number of sampling IPs is small, which can shorten the entire detection period and improve detection efficiency.
  • the D segment of the initial IP is masked, it is equivalent to retaining the initial IP
  • the C section of the IP that is, the sampling IP is determined from the first IP interval according to the C section of the starting IP. Since the C section has a finer granularity and a wider distribution than the B section, it is more representative than the D section.
  • the distribution of sampled IPs determined from the first IP interval according to the C segment of the starting IP is more uniform and representative, so the network quality of a smaller number of sampled IPs can represent the network quality of a larger number of IPs. That is, it can represent the network quality of the entire service area.
  • the survivability detection of the sampled IP can find sampled IPs with more uniform distribution and better connectivity, so that these IPs can be detected to evaluate the network quality of the entire service area and further improve the network quality of the service area. The efficiency of detection.
  • FIG. 5 exemplarily shows the structure of a network quality detection device provided by an embodiment of the present application, and the device can execute the process of the network quality detection method.
  • the device includes: an obtaining unit 501, which obtains a first IP interval; a sampling unit 502, which is used to mask the D segment of the starting IP in the first IP interval to obtain the first IP; and The first IP determines the sampling IP from the first IP interval; the detection unit 503 is configured to perform viability detection on the sampling IP if the sampling IP meets a preset number.
  • the sampling unit 502 is specifically configured to: perform a bitwise AND operation on the starting IP according to the C bit mask; the bitwise AND operation is used to change the D segment in the starting IP Is 0; the starting IP of the D segment becomes 0 as the first IP.
  • the sampling unit 502 is specifically configured to: add multiple first preset values to the C segment of the first IP to obtain the second IP corresponding to each first preset value;
  • the value of the preset value is different; add the D segment of the second IP corresponding to each first preset value to the second preset value to obtain the third IP corresponding to each first preset value;
  • the third IP corresponding to the set value is the same as the C segment of the second IP; the third IP belonging to the first IP interval among the plurality of third IPs corresponding to the first preset value is determined as the sampling IP.
  • the second preset value is equal to 1 or 254; the sampling IP is the gateway IP of the C segment.
  • the sampling unit 502 is further configured to: if the sampling IP does not meet the preset number, randomly determine an IP other than the sampling IP from the first IP interval as the sampling IP.
  • the sampling IP is M; the sampling unit 502 is specifically configured to: divide the first IP interval into M+1 second IP intervals according to the M sampling IP; One IP in any second IP interval in one second IP interval is determined as the M+1th sampling IP; according to the M+1th sampling IP, the location where the M+1th sampling IP is located The second IP interval is divided into two second IP intervals to obtain M+2 second IP intervals; and then one IP is determined as the Mth from any second IP interval in the M+2 second IP intervals +2 sampling IPs, until the sampling IP that meets the preset number is determined.
  • the sampling unit 502 is specifically configured to randomly determine an IP other than the sampling IP from each first IP interval as the sampling IP until it is determined Output sampling IP that meets the preset number.
  • the detection unit 503 is specifically configured to: perform survivability detection on each sampled IP, and determine the sampling IP that passes the survivability detection as a detection IP; the detection IP is used to perform network quality detection
  • the detection unit 503 is specifically configured to: perform multiple connectivity detections on the sampled IP; in any connection detection, if the connection with the sampled IP is successful, determine the packet loss rate in the connectivity detection; if it is determined If the proportion of successful connectivity corresponding to the sampled IP and the packet loss rate after each successful connectivity meet a preset condition, it is determined that the sampled IP passes the survivability detection.
  • the detection unit 503 is further configured to: after the sampling IP that passes the survivability detection is determined as the detection IP, add the detection IP to the detection set; Each detection IP performs the survivability detection, and deletes the detection IPs that have not passed the survivability detection in the detection set.
  • an embodiment of the present application also provides a computing device, including: a memory, used to store program instructions; a processor, used to call the program instructions stored in the memory, and execute the above network quality according to the obtained program The detection method.
  • the embodiments of the present application also provide a computer-readable non-volatile storage medium, including computer-readable instructions.
  • the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned network quality.
  • the detection method When the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned network quality.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Abstract

本申请公开了一种网络质量的探测方法及装置,其中,方法包括:获取第一IP区间(201);对第一IP区间中的起始IP的D段进行掩码处理,得到第一IP(202);根据第一IP,从第一IP区间确定出采样IP(203);若采样IP符合预设数量,则对采样IP进行存活性探测(204)。该技术方案用以从大量IP中预先确定出连通稳定的且分布均匀的较小数量IP,以作为网络质量探测的IP,从而提高网络质量的探测效率。

Description

一种网络质量的探测方法及装置
交叉引用
本申请引用于2020年01月09日递交的名称为“一种网络质量的探测方法及装置”的第202010021836.5号中国专利申请,其通过引用被全部并入本申请。
技术领域
本申请实施例涉及计算机领域,尤其涉及一种网络质量的探测方法及装置。
背景技术
在机房中部署云平台时,需要获取机房到服务区域的网络质量情况,比如,需要在美国地区部署云平台,则需要在美国的备选机房中申请主机,该主机作为探针,也即探测服务器,用于向美国各州、市、运营商下的IP发送ICMP(Internet Control Message Protocol,Internet控制报文协议)包进行网络探测,从而得到机房到各服务区域的网络质量。
网络质量探测中,需要探测的IP数量巨大,探测周期较长,探测效率低,而且每个IP的连通性可能不稳定,比如,网络中所有IP在一天内不能探测完成,则需要探测两天,但是在第一天连通成功的IP,到第二天可能就连通失败,该IP则不能作为网络质量探测的依据。
发明内容
本申请实施例提供一种网络质量的探测方法及装置,用以从大量IP中预先确定出连通状态稳定的且分布均匀的较小数量IP,以作为网络质量探测的 IP,从而提高网络质量的探测效率。
本申请实施例提供的一种网络质量的探测方法,包括:获取第一IP区间;对所述第一IP区间中的起始IP的D段进行掩码处理,得到第一IP;根据所述第一IP,从所述第一IP区间确定出采样IP;若所述采样IP符合预设数量,则对所述采样IP进行存活性探测。
另外,所述对所述第一IP区间中的起始IP的D段进行掩码处理,得到第一IP,包括:根据C位掩码,对所述起始IP进行按位与操作;所述按位与操作用于将所述起始IP中的D段变为0;将所述D段变为0的起始IP作为所述第一IP。
另外,所述根据所述第一IP,从所述第一IP区间中确定出采样IP,包括:将所述第一IP的C段分别加多个第一预设值,得到每个第一预设值对应的第二IP;每个第一预设值的取值不同;将每个第一预设值对应的第二IP的D段加第二预设值,得到每个第一预设值对应的第三IP;每个第一预设值对应的第三IP与第二IP的C段相同;将多个第一预设值对应的第三IP中属于第一IP区间的第三IP,确定为采样IP。
另外,所述第二预设值等于1或者254;所述采样IP为C段的网关IP。
另外,所述方法还包括:若所述采样IP不符合预设数量,则从所述第一IP区间中随机确定出除所述采样IP以外的IP作为采样IP。
另外,所述采样IP为M个;所述从所述第一IP区间中随机确定出除所述采样IP以外的IP作为采样IP,包括:根据M个采样IP,将所述第一IP区间划分为M+1个第二IP区间;从所述M+1个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+1个采样IP;根据所述第M+1个采样IP,将所述第M+1个采样IP所在的第二IP区间划分为两个第二IP区间,得到M+2个第二IP区间;进而从所述M+2个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+2个采样IP,直至确定出符合预设数量的采样IP。
另外,所述第一IP区间为多个;所述从所述第一IP区间中随机确定出 除所述采样IP以外的IP作为采样IP,包括:依次从每个第一IP区间中随机确定出除所述采样IP以外的一个IP作为采样IP,直至确定出符合预设数量的采样IP。
另外,所述对所述采样IP进行存活性探测,包括:对每个采样IP进行存活性探测,并将通过所述存活性探测的采样IP确定为探测IP;所述探测IP用于进行网络质量的探测;所述对采样IP进行存活性探测,包括:对所述采样IP进行多次连通探测;任一次连通探测中,若与所述采样IP连通成功,则确定所述连通探测中的丢包率;若确定所述采样IP对应的连通成功的比例和每次连通成功后的丢包率符合预设条件,则确定所述采样IP通过所述存活性探测。
另外,所述将通过所述存活性探测的采样IP确定为探测IP之后,还包括:将所述探测IP加入至探测集合中;对所述探测集合中的每个探测IP进行所述存活性探测,将所述探测集合中未通过所述存活性探测的探测IP删除。
上述技术方案中,获取到第一IP区间,即服务区域对应的IP的范围,将第一IP区间的起始IP的D段进行掩码处理,从而根据掩码处理后的起始IP,从该第一IP区间中确定采样IP,采样IP的数量较少,可以缩短整个探测周期,提高探测效率,又由于是对起始IP的D段进行掩码处理,相当于保留了起始IP的C段,也即根据起始IP的C段从第一IP区间中确定采样IP,由于C段粒度相比于B段更细,且分布更广泛,相比于D段更具有代表性,则根据起始IP的C段从第一IP区间中确定出的采样IP的分布较均匀且具有代表性,所以可以通过较少数量的采样IP的网络质量代表较大数量的IP的网络质量,也即可以代表整个服务区域的网络质量。而且对该采样IP进行存活性探测,可以找到分布较均匀且连通性较好的采样IP,从而可以对这些IP进行探测,以用于评估整个服务区域的网络质量,进一步提高服务区域的网络质量探测的效率。
相应的,本申请实施例还提供了一种网络质量的探测装置,包括:获取单元,获取第一IP区间;采样单元,用于对所述第一IP区间中的起始IP的D 段进行掩码处理,得到第一IP;以及根据所述第一IP,从所述第一IP区间确定出采样IP;探测单元,用于若所述采样IP符合预设数量,则对所述采样IP进行存活性探测。
另外,所述采样单元具体用于:根据C位掩码,对所述起始IP进行按位与操作;所述按位与操作用于将所述起始IP中的D段变为0;将所述D段变为0的起始IP作为所述第一IP。
另外,所述采样单元具体用于:将所述第一IP的C段分别加多个第一预设值,得到每个第一预设值对应的第二IP;每个第一预设值的取值不同;将每个第一预设值对应的第二IP的D段加第二预设值,得到每个第一预设值对应的第三IP;每个第一预设值对应的第三IP与第二IP的C段相同;将多个第一预设值对应的第三IP中属于第一IP区间的第三IP,确定为采样IP。
另外,所述第二预设值等于1或者254;所述采样IP为C段的网关IP。
另外,所述采样单元还用于:若所述采样IP不符合预设数量,则从所述第一IP区间中随机确定出除所述采样IP以外的IP作为采样IP。
另外,所述采样IP为M个;所述采样单元具体用于:根据M个采样IP,将所述第一IP区间划分为M+1个第二IP区间;从所述M+1个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+1个采样IP;根据所述第M+1个采样IP,将所述第M+1个采样IP所在的第二IP区间划分为两个第二IP区间,得到M+2个第二IP区间;进而从所述M+2个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+2个采样IP,直至确定出符合预设数量的采样IP。
另外,所述第一IP区间为多个;所述采样单元具体用于:依次从每个第一IP区间中随机确定出除所述采样IP以外的一个IP作为采样IP,直至确定出符合预设数量的采样IP。
另外,所述探测单元具体用于:对每个采样IP进行存活性探测,并将通过所述存活性探测的采样IP确定为探测IP;所述探测IP用于进行网络质量 的探测;所述探测单元具体用于:对所述采样IP进行多次连通探测;任一次连通探测中,若与所述采样IP连通成功,则确定所述连通探测中的丢包率;若确定所述采样IP对应的连通成功的比例和每次连通成功后的丢包率符合预设条件,则确定所述采样IP通过所述存活性探测。
另外,所述探测单元还用于:在所述将通过所述存活性探测的采样IP确定为探测IP之后,将所述探测IP加入至探测集合中;对所述探测集合中的每个探测IP进行所述存活性探测,将所述探测集合中未通过所述存活性探测的探测IP删除。
相应的,本申请实施例还提供了一种计算设备,包括:存储器,用于存储程序指令;处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述网络质量的探测方法。
相应的,本申请实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述网络质量的探测方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种系统架构的示意图;
图2为本申请实施例提供的一种网络质量的探测方法的流程示意图;
图3为本申请实施例提供的一种将第一IP区间进行划分的示意图;
图4为本申请实施例提供的一种将多个第一IP区间进行划分的示意图;
图5为本申请实施例提供的一种网络质量的探测装置的结构示意图。
具体实施例
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
为了更好地解释本申请实施例,先对本申请实施例所适用的业务场景具体说明如下:在机房中部署云平台时,需要获取机房到服务区域的网络质量情况,比如,需要在美国部署云平台,则需要在美国的备选机房中申请主机,该主机作为探针,即探测服务器,用于向美国各州、市、运营商下的IP发送ICMP包进行网络探测,从而得到机房到各服务区域的网络质量,相应的,可以确定出到各服务区域的网络质量较好的机房用于部署云平台。
探测服务器在对服务区域进行网络质量探测时,为避免探测服务器对该服务区域的所有IP进行探测,需要从该服务区域的所有IP中采集出网路连通稳定且分布均匀的IP作为探测IP,从而探测服务器对该探测IP进行探测,以确定服务区域的网络质量。
本申请实施例中涉及一个全球范围的IP库,该IP库中记录有多个IP段,每个IP段即对应起始IP和终止IP,IP段又可以理解成IP范围、IP区间等,比如,IP段为180.160.0.0—180.175.255.255,则其起始IP为180.160.0.0,终止IP为180.175.255.255。IP库中每个IP都对应国家字段、州(省/市)字段、市字段(若为小的国家,则州字段中直接存放市信息,然后市字段和州字段一致)和运营商字段,可以是将IP库中的多个IP段按照国家字段、州字段、市字段和运营商字段进行分组,最终确定出每个组对应多个IP段。
在确定对某个服务区域进行探测时,可以是确定该服务区域对应的分组,进而从该分组的多个IP段中确定多个采样IP,进而从该多个采样IP中确定探测IP,以用于服务区域网络质量的探测。
图1示例性的示出了本申请实施例提供网络质量的探测方法所适用的系统架构,该系统架构可以包括大数据平台、采样系统、探测服务器;
采样系统用于从服务区域的多个IP段中确定多个采样IP;探测服务器持续对采样IP进行存活性测试,并将每个采样IP的测试数据上报至大数据平台;大数据平台根据探测服务器上报的测试数据,从采样IP中确定出探测IP,并将探测IP加入至探测集合中,探测服务器对探测集合中的探测IP进行探测,以用于服务区域网络质量的探测。此处,存活性测试指的是对采样IP的连通性和稳定性进行测试。
基于上述描述,图2示例性的示出了本申请实施例提供的一种网络质量的探测方法的流程,该流程可以由网络质量的探测装置执行。
如图2所示,该流程具体包括:
步骤201,获取第一IP区间。
相当于获取当前分组中的IP区间,该第一IP区间为起始IP至终止IP,且该第一IP区间中包括N个连续的IP。
步骤202,对所述第一IP区间中的起始IP的D段进行掩码处理,得到第一IP。
本申请实施例中,将起始IP转换为数值类型,则包括A段、B段、C段和D段,每个段的范围是0—255,共256个,计算机领域中,一个bit可以代表0或1两种取值,一个byte是8个bit,所以一个byte刚好可以存放一个段的数值,因此,采用一个4byte的无符号整数来代表一个IP。举例来说,起始IP为8.8.8.8,则分别对应IP的A段、B段、C段和D段,可以将该起始IP转换为二进制格式为000010000000100000001000 00001000。
一种实现方式中,可以是根据C位掩码,对起始IP进行按位与操作,该按位与操作即用于将起始IP中的D段变为0,从而将D段变为0的起始IP作为第一IP。C位掩码为11111111111111111111111100000000。
以上述例子继续说明,根据C位掩码对起始IP进行按位与操作,起始 IP和C位掩码的位值都为1则输出1,起始IP和C位掩码的位值中有一个为0则输出0,可以得到对D段进行掩码处理后的第一IP,具体如下:
Figure PCTCN2020074974-appb-000001
步骤203,根据所述第一IP,从所述第一IP区间确定出采样IP。
在确定出第一IP之后,可以根据第一IP从第一IP区间中确定出分布较均匀的采样IP,一种实现方式中,可以是将第一IP的C段分别加多个第一预设值,得到每个第一预设值对应的第二IP,其中,每个第一预设值的取值不同,解释为,多个第一预设值可以依次取0、1、2、3……,比如,当第一预设值为0时,确定其对应的第二IP;当第一预设值为1时,确定其对应的第二IP;当第一预设值为2时,确定其对应的第二IP……。在确定出每个第一预设值对应的第二IP之后,将每个第一预设值对应的第二IP的D段再加上第二预设值,得到每个第一预设值对应的第三IP,此处,每个第一预设值对应的第三IP与第二IP的C段相同,也就是说,在将每个第一预设值对应的第二IP的D段加第二预设值时,第二预设值不大于256,以保障不会使第二IP的C段加1。
另一种实现方式中,可以先将第一IP的D段加第二预设值,此处,D段加第二预设值后的第一IP的C段仍保持不变,然后再将该D段加第二预设值后的第一IP的C段分别加上多个第一预设值,多个第一预设值仍然可以依次取0、1、2、3……,分别得到多个C段改变的IP。
也就是说,本申请实施例中,在得到第一IP之后,既可以先将第一IP的D段加第二预设值,然后在C段分别加多个第一预设值,当然也可以先将第一IP的C段分别加多个第一预设值,然后在D段加第二预设值。
在确定出多个第三IP之后,可以从该多个第三IP中确定出属于第一IP区间的第三IP,并将该确定出的第三IP确定为采样IP。
本申请实施例中,可设置采样IP为C段的网关IP,也即得到的第三IP为C段的网关IP,相应的,第二预设值可以等于1,也可以等于254,设置C段的网关IP是因为C段的划分粒度较细,且分布广泛。当然,在某些场景下,第二预设值也可以取其他值,比如128、64等,则此时,采样IP可以为非网关IP。此外,在某些场景下,采样IP也可以是B段的网关IP。
以上述例子继续说明,第一IP为8.8.8.0,则有如下情况:
第一预设值为0,第二预设值为1,则第一IP的C段不变,D段加1,得到第三IP为8.8.8.1,判断该8.8.8.1是否在第一IP区间内,若是,则将该8.8.8.1确定为采样IP。
第一预设值为0,第二预设值为254,则第一IP的C段不变,D段加254,得到第三IP为8.8.8.254,判断该8.8.8.254是否在第一IP区间内,若是,则将该8.8.8.254确定为采样IP。
第一预设值为1,第二预设值为1,则第一IP的C段加1,D段加1,得到第三IP为8.8.9.1,判断该8.8.9.1是否在第一IP区间内,若是,则将该8.8.9.1确定为采样IP。
第一预设值为1,第二预设值为254,则第一IP的C段加1,D段加254,得到第三IP为8.8.9.254,判断该8.8.9.254是否在第一IP区间内,若是,则将该8.8.9.254确定为采样IP。
……
循环上述过程,直至确定出第一IP区间内的所有C段的网关IP。
上述实施例中,还可以在得到第一IP之后,将第一IP的D段加1和加254,以得到两个第三IP;进一步将该第一IP的D段加256,从而使得该第一IP的C段加1,然后再将C段加1后的第一IP的D段加1和加254,以得到两个第三IP,……,直至确定出第一IP区间内的所有C段的网关IP。
以上述例子继续说明,第一IP为8.8.8.0,则有如下情况:
将8.8.8.0的D段加1,得到第三IP为8.8.8.1,判断该8.8.8.1是否 在第一IP区间内;将8.8.8.0的D段加254,得到第三IP为8.8.8.254,判断该8.8.8.254是否在第一IP区间内。
将8.8.8.0的D段加256后,得到IP为8.8.9.0,进而将8.8.9.0的D段加1,得到8.8.9.1,判断该8.8.9.1是否在第一IP区间内;将8.8.9.0的D段加254,得到8.8.9.254,判断该8.8.9.254是否在第一IP区间内。
将8.8.9.0的D段加256后,得到IP为8.8.10.0,进而将8.8.10.0的D段加1,得到8.8.10.1,判断该8.8.10.1是否在第一IP区间内;将8.8.10.0的D段加254,得到8.8.10.254,判断该8.8.10.254是否在第一IP区间内。
……
循环上述过程,直至确定出第一IP区间内的所有C段的网关IP。
步骤204,若所述采样IP符合预设数量,则对所述采样IP进行存活性探测。
在确定出多个采样IP之后,先确定采样IP的数量是否符合预设数量,若是,则对该得到的采样IP进行存活性探测,否则,需要进一步确定采样IP,直至确定采样IP的数量符合预设数量之后,再对该得到的采样IP进行存活性探测。
本申请实施例中,采样IP不符合预设数量,则需要从第一IP区间中随机确定出除之前确定出的采样IP以外的IP作为采样IP。假设已经确定出的采样IP的个数为M,则可以先根据该M个采样IP,将第一IP区间划分为M+1个第二IP区间;从M+1个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+1个采样IP;然后再根据第M+1个采样IP,将第M+1个采样IP所在的第二IP区间划分为两个第二IP区间,得到M+2个第二IP区间;进而从M+2个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+2个采样IP,直至确定出符合预设数量的采样IP。
解释为,在由步骤201至步骤203确定出的多个采样IP不符合预设数量之后,则需要随机从剩余的IP中再确定出部分IP作为采样IP,为了保障再 次确定出的采样IP的均匀性,可以先根据由步骤201至步骤203确定出的M个采样IP将第一IP区间划分为M+1个第二IP区间,也即第一IP区间的子区间,可以如图3示出。然后随机从该M+1个第二IP区间中随机取出一个第二IP区间中的IP作为采样IP,并将该随机确定的IP所在的第二IP区间进一步划分为两个第二IP区间,从而得到M+2个第二IP区间,通过该循环过程,从而最终得到符合预设数量的采样IP。此处,需要说明的是,在随机从M+1个第二IP区间中随机取出一个第二IP区间中的IP作为采样IP时,可能是将某个第二IP区间中的最后一个IP或者最前一个IP取出,以作为采样IP,此时,也即仍然是M+1个第二IP区间,进而再次从该M+1个第二IP区间中随机取出一个IP作为采样IP,直至最终得到符合预设数量的采样IP。
在M+1个第二IP区间中随机确定出第M+1个采样IP时,一种实现方式中,可以是随机确定一个大于等于0且小于M+1的整数,并根据该整数确定对应的第二IP区间,进而从该对应的第二IP区间中再随机确定出一个IP;另一实现方式中,可以是统计M+1个第二IP区间中所有IP的总数,并随机确定大于等于0且小于该总数的整数,并根据该整数从该所有IP中确定出一个IP。
本申请实施例中,当前分组内可以包括多个第一IP区间,为进一步保障采样IP的均匀性,可以依次从每个第一IP区间对应的多个第二IP区间中随机选取一个IP作为采样IP,并根据选取出的IP将对应的第二IP区间进一步划分为两个IP区间,相当于,可以先从第一个第一IP区间中随机选取一个IP作为采样IP,并根据该选取出的IP将对应的第二IP区间划分为两个第二IP区间;然后再从第二个第一IP区间中随机选取一个IP作为采样IP,并根据该选取出的IP将对应的第二IP区间划分为两个第二IP区间,循环上述过程,最终得到符合预设数量的采样IP,可以如图4所示。通过上述方式,实现从一个第一IP区间中随机选取一个IP之后,就切换到另一个第一IP区间,在所有第一IP区间中轮询取IP,这样可以确保所有的第一IP区间中,如果其中有一个第一IP区间特别短,那么在这个第一IP区间被取尽之后,仍然可以 从其他第一IP区间中选取IP作为采样IP。
在对采样IP进行存活性探测时,可以是采样系统将采样IP分发至探测服务器,从而探测服务器对采样IP进行存活性探测,探测服务器将探测的数据上传至采样服务器。具体探测中,可以是对每个采样IP进行存活性探测,并将通过存活性探测的采样IP确定为探测IP,探测IP即用于进行网络质量的探测。
本申请实施例中,可以是对采样IP进行多次连通探测,每次连通探测可能连通,也可能不连通,所以需要统计该采样IP所有连通的次数以确定采样IP对应的连通成功的比例,以及在每次连通成功时,则确定连通探测中的丢包率;进一步的,若确定该采样IP对应的连通成功的比例和每次连通成功后的丢包率均符合预设条件,则确定采样IP通过存活性探测。具体实现中,从多个采样IP中获取符合预设条件的采样IP作为探测IP,预设条件为连通率(能连通的次数÷探测总次数×100%)>80%,且从连通的响应数值中,将每一次的丢包率累加求平均,平均丢包率小于80%,且IP中包括国家字段、州(省/市)字段、市字段和运营商字段。
在对多个采样IP进行存活性探测之后,将通过存活性探测的采样IP确定为探测IP,并将探测IP加入至探测集合中。为了维持探测集合中所有探测IP的存活性,还需要对探测集合中每一个探测IP持续进行存活性检测,并将探测集合中未通过存活性探测的探测IP删除。
一种实现方式中,可以是每个探测周期中,将确定出的采样IP进行存活性探测,并将通过存活性探测的采样IP作为探测IP加入至探测集合中,且对探测集合中探测IP进行存活性检测,将未通过存活性探测的探测IP从探测集合中删除,通过该方式,可以保障探测集合中的探测IP均具有较好的连通性,进一步的,本申请实施例中,设定之前被加入至探测集合中的IP不能再次作为采样IP,从而在保障探测IP较好连通性的前提下,提高网络质量探测的准确性。比如,探测周期为1天,在第一天时,确定出5000个采样IP,然 后对该5000个采样IP进行存活性探测,确定出有2000个探测IP,以用于对服务区域网络质量评估,然后在第二天时,继续从服务区域的所有IP(除2000个探测IP以外的所有IP)中确定3000个采样IP,结合第一天的2000个探测IP共组成5000个采样IP,对该5000个采样IP继续进行存活性探测,若确定出2300个通过存活性探测的IP(第一天的2000个探测IP中有1800个探测IP通过存活性探测,第二天的3000个采样IP中有500个探测IP通过存活性探测,共计2300),则将该2300个通过存活性探测的IP作为探测IP加入至探测集合中,以用于对服务区域网络质量评估。以此类推,每天都会从服务区域的所有IP中(除去已经被确定为探测IP的IP)确定出采样IP,并结合前一天的探测IP共同组成当天的所有采样IP,以进行存活性探测,进而确定出通过存活性探测的采样IP作为探测IP加入至探测集合中,以用于对服务区域网络质量评估。
基于上述描述,本申请实施例中实际上有两次IP探测,第一次是在确定出采样IP后,探测采样IP的存活性,并将通过存活性测试的采样IP确定为探测IP;第二次是在确定出探测IP之后,确定探测IP的连通性,并基于探测IP的连通性确定服务区域的网络质量。也就是说,第一次探测用于从服务区域内找到分布均匀且连通稳定的IP作为探测IP,从而在第二次探测时,可以基于这些分布均匀且连通稳定的IP进行服务区域网络质量的探测,通过该方式可以有效探测服务区域网络质量,且探测效率高。
本申请在具体实现中,同样会部署两类探测服务器,第一类为业务场景中厂家所部署的探测服务器,可以部署在海内外,可以将所有的采样IP分发给各第一类探测服务器,以用于从中确定出连通稳定的探测IP。第二类为业务场景中用户所部署的探测服务器,同样可以部署在海内外,可以是在确定出探测IP之后,采用第二类探测服务器对服务区域中探测IP进行探测,进而确定服务区域的网络质量,此外,在第二类探测服务器确定出服务区域的网络质量的时候,相应的,其实可得知第二类探测服务器的网络质量,也就是说,第二 类探测服务器在对探测IP进行探测时,其相应的可以知道自己的网络质量,通过该方式,也即得到将第二类探测服务器部署在哪个机房时,第二类探测服务器的网络质量好,从而可以确定出将云平台部署在哪一个或哪几个机房。
举例来说,现在要部署一个云平台,服务的是美国的客户,那么美国在纽约、洛杉矶、休斯敦、芝加哥四个城市部署机房,部署的机房编号如表1所示。
表1
机房编号  
纽约—a 纽约的a机房
纽约—b 纽约的b机房
纽约—c 纽约的c机房
纽约—d 纽约的d机房
洛杉矶—a 洛杉矶的a机房
洛杉矶—b 洛杉矶的b机房
休斯敦—a 休斯敦的a机房
芝加哥—a 芝加哥的a机房
芝加哥—b 芝加哥的b机房
又由于各网络线路归属的运营商不同,在各机房部署探测服务器时所使用的运营商也有所不同,具体的,部署的探测服务器的编号可以如表2所示。
表2
探测服务器的编号  
纽约—a—ATT 纽约的a机房,运营商为ATT
纽约—a—Verizon 纽约的a机房,运营商为Verizon
纽约—b—ATT 纽约的b机房,运营商为ATT
纽约—b—Verizon 纽约的b机房,运营商为Verizon
纽约—c—ATT 纽约的c机房,运营商为ATT
纽约—c—Verizon 纽约的c机房,运营商为Verizon
纽约—d—ATT 纽约的d机房,运营商为ATT
纽约—d—Verizon 纽约的d机房,运营商为Verizon
洛杉矶—a—ATT 洛杉矶的a机房,运营商为ATT
洛杉矶—a—Verizon 洛杉矶的a机房,运营商为Verizon
洛杉矶—b—ATT 洛杉矶的b机房,运营商为ATT
洛杉矶—b—Verizon 洛杉矶的b机房,运营商为Verizon
休斯敦—a—ATT 休斯敦的a机房,运营商为ATT
休斯敦—a—Verizon 休斯敦的a机房,运营商为Verizon
芝加哥—a—ATT 芝加哥的a机房,运营商为ATT
芝加哥—a—Verizon 芝加哥的a机房,运营商为Verizon
芝加哥—b—ATT 芝加哥的b机房,运营商为ATT
芝加哥—b—Verizon 芝加哥的b机房,运营商为Verizon
可以选择某个服务区域下的IP分组中的探测IP,以探测服务器“芝加哥—a—Verizon”为例,使用探测服务器“芝加哥—a—Verizon”探测所有探测IP的连通性,从而确定服务区域的网络质量,相应的,可以得到探测服务器“芝加哥—a—Verizon”到服务区域的网络质量,通过上述方式,得到所有探测服务器到服务区域的网络质量,进而找到美国各城市机房中哪些探测服务器的网络质量好,即可以将云平台部署在哪个城市的那个机房中。
本申请实施例中,获取到第一IP区间,即服务区域对应的IP的范围,将第一IP区间的起始IP的D段进行掩码处理,从而根据掩码处理后的起始IP,从该第一IP区间中确定采样IP,采样IP的数量较少,可以缩短整个探测周期,提高探测效率,又由于是对起始IP的D段进行掩码处理,相当于保留了起始IP的C段,也即根据起始IP的C段从第一IP区间中确定采样IP,由于C段 粒度相比于B段更细,且分布更广泛,相比于D段更具有代表性,则根据起始IP的C段从第一IP区间中确定出的采样IP的分布较均匀且具有代表性,所以可以通过较少数量的采样IP的网络质量代表较大数量的IP的网络质量,也即可以代表整个服务区域的网络质量。而且对该采样IP进行存活性探测,可以找到分布较均匀且连通性较好的采样IP,从而可以对这些IP进行探测,以用于评估整个服务区域的网络质量,进一步提高服务区域的网络质量探测的效率。
基于同一发明构思,图5示例性的示出了本申请实施例提供的一种网络质量的探测装置的结构,该装置可以执行网络质量的探测方法的流程。
所述装置,包括:获取单元501,获取第一IP区间;采样单元502,用于对所述第一IP区间中的起始IP的D段进行掩码处理,得到第一IP;以及根据所述第一IP,从所述第一IP区间确定出采样IP;探测单元503,用于若所述采样IP符合预设数量,则对所述采样IP进行存活性探测。
示例性的,所述采样单元502具体用于:根据C位掩码,对所述起始IP进行按位与操作;所述按位与操作用于将所述起始IP中的D段变为0;将所述D段变为0的起始IP作为所述第一IP。
示例性的,所述采样单元502具体用于:将所述第一IP的C段分别加多个第一预设值,得到每个第一预设值对应的第二IP;每个第一预设值的取值不同;将每个第一预设值对应的第二IP的D段加第二预设值,得到每个第一预设值对应的第三IP;每个第一预设值对应的第三IP与第二IP的C段相同;将多个第一预设值对应的第三IP中属于第一IP区间的第三IP,确定为采样IP。
示例性的,所述第二预设值等于1或者254;所述采样IP为C段的网关IP。
示例性的,所述采样单元502还用于:若所述采样IP不符合预设数量,则从所述第一IP区间中随机确定出除所述采样IP以外的IP作为采样IP。
示例性的,所述采样IP为M个;所述采样单元502具体用于:根据M 个采样IP,将所述第一IP区间划分为M+1个第二IP区间;从所述M+1个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+1个采样IP;根据所述第M+1个采样IP,将所述第M+1个采样IP所在的第二IP区间划分为两个第二IP区间,得到M+2个第二IP区间;进而从所述M+2个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+2个采样IP,直至确定出符合预设数量的采样IP。
示例性的,所述第一IP区间为多个;所述采样单元502具体用于:依次从每个第一IP区间中随机确定出除所述采样IP以外的一个IP作为采样IP,直至确定出符合预设数量的采样IP。
示例性的,所述探测单元503具体用于:对每个采样IP进行存活性探测,并将通过所述存活性探测的采样IP确定为探测IP;所述探测IP用于进行网络质量的探测;所述探测单元503具体用于:对所述采样IP进行多次连通探测;任一次连通探测中,若与所述采样IP连通成功,则确定所述连通探测中的丢包率;若确定所述采样IP对应的连通成功的比例和每次连通成功后的丢包率符合预设条件,则确定所述采样IP通过所述存活性探测。
示例性的,所述探测单元503还用于:在所述将通过所述存活性探测的采样IP确定为探测IP之后,将所述探测IP加入至探测集合中;对所述探测集合中的每个探测IP进行所述存活性探测,将所述探测集合中未通过所述存活性探测的探测IP删除。
基于同一发明构思,本申请实施例还提供了一种计算设备,包括:存储器,用于存储程序指令;处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述网络质量的探测方法。
基于同一发明构思,本申请实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述网络质量的探测方法。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序 产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (12)

  1. 一种网络质量的探测方法,包括:
    获取第一IP区间;
    对所述第一IP区间中的起始IP的D段进行掩码处理,得到第一IP;
    根据所述第一IP,从所述第一IP区间确定出采样IP;
    若所述采样IP符合预设数量,则对所述采样IP进行存活性探测。
  2. 如权利要求1所述的方法,其中,所述对所述第一IP区间中的起始IP的D段进行掩码处理,得到第一IP,包括:
    根据C位掩码,对所述起始IP进行按位与操作;所述按位与操作用于将所述起始IP中的D段变为0;
    将所述D段变为0的起始IP作为所述第一IP。
  3. 如权利要求2所述的方法,其中,所述根据所述第一IP,从所述第一IP区间中确定出采样IP,包括:
    将所述第一IP的C段分别加多个第一预设值,得到每个第一预设值对应的第二IP;每个第一预设值的取值不同;
    将每个第一预设值对应的第二IP的D段加第二预设值,得到每个第一预设值对应的第三IP;每个第一预设值对应的第三IP与第二IP的C段相同;
    将多个第一预设值对应的第三IP中属于第一IP区间的第三IP,确定为采样IP。
  4. 如权利要求3所述的方法,其中,所述第二预设值等于1或者254;所述采样IP为C段的网关IP。
  5. 如权利要求1所述的方法,其中,所述方法还包括:
    若所述采样IP不符合预设数量,则从所述第一IP区间中随机确定出除所述采样IP以外的IP作为采样IP。
  6. 如权利要求5所述的方法,其中,所述采样IP为M个;
    所述从所述第一IP区间中随机确定出除所述采样IP以外的IP作为采样 IP,包括:
    根据M个采样IP,将所述第一IP区间划分为M+1个第二IP区间;
    从所述M+1个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+1个采样IP;
    根据所述第M+1个采样IP,将所述第M+1个采样IP所在的第二IP区间划分为两个第二IP区间,得到M+2个第二IP区间;进而从所述M+2个第二IP区间中的任一个第二IP区间中确定一个IP作为第M+2个采样IP,直至确定出符合预设数量的采样IP。
  7. 如权利要求5所述的方法,其中,所述第一IP区间为多个;
    所述从所述第一IP区间中随机确定出除所述采样IP以外的IP作为采样IP,包括:
    依次从每个第一IP区间中随机确定出除所述采样IP以外的一个IP作为采样IP,直至确定出符合预设数量的采样IP。
  8. 如权利要求1所述的方法,其中,所述对所述采样IP进行存活性探测,包括:
    对每个采样IP进行存活性探测,并将通过所述存活性探测的采样IP确定为探测IP;所述探测IP用于进行网络质量的探测;
    所述对采样IP进行存活性探测,包括:
    对所述采样IP进行多次连通探测;任一次连通探测中,若与所述采样IP连通成功,则确定所述连通探测中的丢包率;
    若确定所述采样IP对应的连通成功的比例和每次连通成功后的丢包率符合预设条件,则确定所述采样IP通过所述存活性探测。
  9. 如权利要求8所述的方法,其中,所述将通过所述存活性探测的采样IP确定为探测IP之后,还包括:
    将所述探测IP加入至探测集合中;
    对所述探测集合中的每个探测IP进行所述存活性探测,将所述探测集合 中未通过所述存活性探测的探测IP删除。
  10. 一种网络质量的探测装置,包括:
    获取单元,获取第一IP区间;
    采样单元,用于对所述第一IP区间中的起始IP的D段进行掩码处理,得到第一IP;以及根据所述第一IP,从所述第一IP区间确定出采样IP;
    探测单元,用于若所述采样IP符合预设数量,则对所述采样IP进行存活性探测。
  11. 一种计算设备,包括:
    存储器,用于存储程序指令;
    处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1至9任一项所述的方法。
  12. 一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行如权利要求1至9任一项所述的方法。
PCT/CN2020/074974 2020-01-09 2020-02-12 一种网络质量的探测方法及装置 WO2021138956A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20730554.1A EP3876479A1 (en) 2020-01-09 2020-02-12 Network quality detection method and device
US16/903,280 US20210218655A1 (en) 2020-01-09 2020-06-16 Method and apparatus for detecting network quality

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010021836.5 2020-01-09
CN202010021836.5A CN113114519B (zh) 2020-01-09 2020-01-09 一种网络质量的探测方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/903,280 Continuation US20210218655A1 (en) 2020-01-09 2020-06-16 Method and apparatus for detecting network quality

Publications (1)

Publication Number Publication Date
WO2021138956A1 true WO2021138956A1 (zh) 2021-07-15

Family

ID=74494706

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/074974 WO2021138956A1 (zh) 2020-01-09 2020-02-12 一种网络质量的探测方法及装置

Country Status (3)

Country Link
EP (1) EP3876479A1 (zh)
CN (1) CN113114519B (zh)
WO (1) WO2021138956A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713449A (zh) * 2016-12-21 2017-05-24 中国电子科技网络信息安全有限公司 一种快速识别联网工控设备的方法
US20170289023A1 (en) * 2016-03-31 2017-10-05 FUJllTSU LIMITED Non-transitory computer readable recording medium, communication method and communication device
CN109274551A (zh) * 2018-09-14 2019-01-25 江苏博智软件科技股份有限公司 一种精确高效的工控资源定位方法
CN109766176A (zh) * 2018-12-29 2019-05-17 北京威努特技术有限公司 一种基于大规模网络空间探测的扫描进度计算方法及装置
CN110557286A (zh) * 2019-09-02 2019-12-10 南京航空航天大学 一种有效测量并构建IPv6网络拓扑的方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100386998C (zh) * 2006-03-10 2008-05-07 清华大学 对等网络中全局节点维护方法
CN103957538B (zh) * 2014-04-04 2017-11-28 新华三技术有限公司 一种网络质量探测方法和设备
US10108516B2 (en) * 2015-01-29 2018-10-23 Knuedge Incorporated Affinity data collection in a computing system
CN109962790B (zh) * 2017-12-14 2020-05-29 北京金山云网络技术有限公司 一种网络质量监测方法、装置、电子设备及存储介质
CN109660401A (zh) * 2018-12-20 2019-04-19 中国电子科技集团公司第三十研究所 一种分布式网络资产探测方法
CN110086684B (zh) * 2019-05-30 2023-04-21 深圳市中航比特通讯技术股份有限公司 一种基于动态规划的dcn网络自通方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170289023A1 (en) * 2016-03-31 2017-10-05 FUJllTSU LIMITED Non-transitory computer readable recording medium, communication method and communication device
CN106713449A (zh) * 2016-12-21 2017-05-24 中国电子科技网络信息安全有限公司 一种快速识别联网工控设备的方法
CN109274551A (zh) * 2018-09-14 2019-01-25 江苏博智软件科技股份有限公司 一种精确高效的工控资源定位方法
CN109766176A (zh) * 2018-12-29 2019-05-17 北京威努特技术有限公司 一种基于大规模网络空间探测的扫描进度计算方法及装置
CN110557286A (zh) * 2019-09-02 2019-12-10 南京航空航天大学 一种有效测量并构建IPv6网络拓扑的方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3876479A4 *

Also Published As

Publication number Publication date
CN113114519B (zh) 2022-10-11
EP3876479A4 (en) 2021-09-08
EP3876479A1 (en) 2021-09-08
CN113114519A (zh) 2021-07-13

Similar Documents

Publication Publication Date Title
EP3905622A1 (en) Botnet detection method and system, and storage medium
US20200334123A1 (en) Rule-based continuous diagnosing and alerting from application logs
CN111431800B (zh) 一种建立路径的方法、装置、设备及机器可读存储介质
EP2337266A2 (en) Detecting and classifying anomalies in communication networks
JPH077518A (ja) ネットワーク解析方法
US7602789B2 (en) Low overhead method to detect new connection rate for network traffic
CN111030296B (zh) 一种基于lldp协议的智能变电站网络拓扑逐级嗅探方法
EP3823217A1 (en) Network flow measurement method, network measurement device and control plane device
JP2017188814A (ja) ネットワーク装置
EP3460769B1 (en) System and method for managing alerts using a state machine
WO2021138956A1 (zh) 一种网络质量的探测方法及装置
CN107925702B (zh) 用于检测损坏的绑定器的方法、设备、计算机可读介质
CN112532467B (zh) 用于实现故障检测的方法、装置及系统
CN111835641B (zh) 故障检测方法、服务器以及采集设备
CN110609761B (zh) 确定故障源的方法、装置、存储介质和电子设备
Wang et al. Simple and efficient identification of heavy hitters based on bitcount
US20210218655A1 (en) Method and apparatus for detecting network quality
US20180302305A1 (en) Data center automated network troubleshooting system
CN111343031B (zh) 网络故障的确定方法和装置
CN113300914A (zh) 网络质量监测方法、装置、系统、电子设备和存储介质
CN113812119A (zh) 用于性能测量的网络节点
US20190207805A1 (en) Node fault isolation
US9900207B2 (en) Network control protocol
CN112839018B (zh) 一种度数值生成方法以及相关设备
JP4112590B2 (ja) 異なり数上位nキーの推定方法および推定システム

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2020730554

Country of ref document: EP

Effective date: 20200615

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20730554

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE