A multi-target anycast IP location method
Through dynamic allocation of detection resources and optimization methods based on utility curves, the problem of waste of detection resources in multi-objective anycast IP positioning is solved, and more efficient detection resource utilization and positioning efficiency are achieved.
Patent Information
- Application Number
- CN202411435062.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-10-15
AI Technical Summary
The prior art has problems of wasted detection resources and low utilization in multi-target anycast IP positioning, and it is impossible to efficiently realize the positioning of multiple anycast IP addresses.
By determining the set of anycast IP addresses to be located and the total number of detection resources, an ordered probe set is generated, and the detection resources are dynamically allocated according to the utility curve and utility gradient function, and the detection resources are carried out in batches, optimizing the allocation and utilization of detection resources.
It reduces the consumption and time of detection resources, improves the utilization rate of detection resources, and improves the positioning efficiency of any broadcast IP.
Smart Images

Figure CN118972442B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of IP (Internet Protocol) positioning technology, and in particular to a multi-target anycast IP positioning method. Background Art
[0002] IP Anycast is widely used in Domain Name System (DNS) and Content Delivery Network (CDN) to achieve scalable, highly fault-tolerant, and high-performance services. Since the mapping of users to IP Anycast networks is determined by the routing system, monitoring the Anycast network becomes complex and uncontrollable. Anycast geolocation is a technology that identifies the geographic location of the device that carries the Anycast IP. Due to the characteristics of Anycast IP, one Anycast IP is often mapped to multiple geographically dispersed devices. It can help network researchers and operators better understand the network, thereby achieving advanced analysis and diagnosis.
[0003] Although anycast geolocation is effective in discovering errors in anycast networks, it is very expensive. The class(IN) TXT DNS (Domain Name System)-based method uses more than 300,000 recursive DNS servers to observe a single anycast IP address. The existing iGreedy method uses 6,000 probes to geolocate devices on F-Root DNS servers. Although the iGreedy algorithm reduces probe consumption, it can only detect a single anycast IP address.
[0004] With the popularity of anycast services, more and more network services are equipped with anycast IP addresses, but there is no mature method to locate multiple anycast IP addresses. Obviously, the single-target anycast positioning method can be applied to the multi-target anycast positioning scenario, using a fixed number of probes to perform anycast positioning on any IP address, but it will generate unnecessary overhead, waste a lot of detection resources, and make the utilization rate of detection resources low. Summary of the invention
[0005] In order to solve the above technical problems existing in the prior art, the present invention provides a multi-target anycast IP positioning method. The specific technical solution of the present invention is as follows:
[0006] Step S1: Determine the set of anycast IP addresses to be located and the total number of probe resources ;in, For the Anycast IP addresses, =1,2,…, , is the number of anycast IP addresses;
[0007] Step S2: Generate an ordered probe set ;
[0008] Step S3: Execute round 0 allocation, that is, for each anycast IP address distribute detection resources; and update the number of detection resources to be allocated ,
[0009] ;
[0010] Step S4: From the ordered probe set Select from 1 to The probes are used to detect and obtain RTT value and input into the positioning algorithm to get the anycast IP address Include A set of coordinate pairs;
[0011] Among them, the form of the coordinate pair in the coordinate pair set is ( , ), To detect the number of resources, is the number of devices detected;
[0012] Step S5: Fit the set according to the coordinates Utility curve for anycast IP addresses , and according to the utility curve Calculate utility gradient function , calculate the utility gradient function The utility gradient value under the number of allocated detection resources in the previous round;
[0013] Step S6: Each detection resource to be allocated is allocated with a preset probability Assigned to the Anycast IP address corresponding to the maximum utility gradient value, with probability Assigned to any other anycast IP address;
[0014] Allocate all the detection resources to be allocated in this round and get the allocation plan ,
[0015] ;
[0016] In the formula, For the Anycast IP addresses The number of detection resources allocated, =1,2,…, ;
[0017] Step S7: Based on the allocation scheme , for each anycast IP address , use each allocated detection resource to select a probe and initiate ICMP Ping requests in turn, obtain the corresponding RTT value and input it into the positioning algorithm to achieve anycast IP address Positioning.
[0018] Preferably, step S2 comprises:
[0019] Step S21: Select the probe group and initialize it to empty, and set the first distance vector Initialize to infinity;
[0020] Step S22: randomly select a probe s to add to the probe group, and update the probe group;
[0021] Step S23: Calculate the distance from probe s to all probes to obtain the second distance vector , and the first distance vector Compare one by one and keep and The smaller elements in constitute the third distance vector; among them, =1,2,…, ;
[0022] Step S24: Select the probe with the largest distance in the third distance vector and add it to the probe group;
[0023] Step S25: loop step S23 to step S24 until the number of probes in the probe group equals the total number of probe resources , that is, an ordered probe set generate.
[0024] Preferably, step S2 comprises:
[0025] Initialize the ordered probe subset, randomly select probes from unselected probes and add them to the ordered probe subset;
[0026] Cycle random selection until the number of probes in the ordered probe subset is equal to the total number of probe resources , that is, an ordered probe set generate.
[0027] Preferably, the positioning algorithm is an iGreedy positioning algorithm.
[0028] Preferably, the coordinate pair set is fitted Utility curve for anycast IP addresses ,include:
[0029] Constructing utility curves After the coordinate pair set,
[0030] ;
[0031] In the formula, is the weight parameter, is the bias parameter;
[0032] Method error As the loss function,
[0033] ;
[0034] In the formula, for The fitted value of the number of devices detected by the detection resource, for The actual value of the number of devices detected by a detection resource;
[0035] Use the least squares method to solve the loss function and obtain the utility curve The weight parameter with the smallest value and bias parameters .
[0036] Furthermore, after step S4, the following steps are further included:
[0037] Divide the detection resources to be allocated into Execute in a loop Step S5 to step S6, ≧2;
[0038] In the kth round, the coordinate pair set is updated as follows:
[0039] use Select the detection resource ( +1) to ( + ) probes, that is, for each anycast IP address Initiate ICMP Ping request to obtain probe to anycast IP address The RTT value of is the first The number of detection resources allocated to anycast IP addresses, k = 1, 2, ..., ;
[0040] Each RTT value from the first round to the kth round is input into the positioning algorithm to obtain a new set of coordinate pairs.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows: the technical solution provided by the present invention can realize the positioning of multiple anycast IPs based on the positioning algorithm by dynamically allocating detection resources in batches. This method consumes fewer detection resources, can improve the utilization rate of detection resources, reduce detection costs and time consumption, and improve the positioning efficiency of anycast IPs. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flow chart of the multi-target anycast IP positioning method in the present invention.
[0043] Figure 2 The figure is a schematic diagram of the flow of the solution for dynamically allocating detection resources in any round in the present invention. DETAILED DESCRIPTION
[0044] Hereinafter, the technical solution provided by the present invention will be further elaborated in detail with reference to the accompanying drawings.
[0045] IP anycast refers to multiple geographically distributed devices sharing the same IP address, where a device refers to a server or a group of servers that are fixed in a geographical location. When a user requests anycast service, the routing algorithm in the routing system calculates the shortest path between the user and the target IP address, thereby directing the data packet to the "nearest" device. Due to the shortened data packet propagation path, IP anycast can provide high-quality services.
[0046] At present, the location of anycast IP often consumes a lot of detection resources and a long detection time. In theory, the more probes there are, the more anycast IP devices can be detected. In practice, the discovery of anycast IP devices increases in a step-by-step manner. For example, when 500 probes and 6000 probes are used to detect an anycast IP address and their detection results are used to achieve anycast location, the number of devices discovered is the same. In real life, commercial and community-driven detection platforms charge users based on the number of detections. The number of detections refers to one probe launching an ICMP (Internet Control Message Protocol) Ping detection to an anycast IP address. Therefore, many network researchers and engineers are faced with limited detection resources. Therefore, it is important to study a technology that can optimize the allocation of limited detection resources in the scenario of multi-target anycast location. For example, there are 800 detections, and anycast IP address A and anycast IP address B are located respectively according to the allocation method of (400, 400) and (300, 500). In the former, a total of 40 devices were found, of which 20 were found for A and 20 for B; in the latter, a total of 52 devices were found, of which 20 were found for A and 32 for B. Therefore, when the detection resources are fixed, the allocation method of (300, 500) can discover more devices.
[0047] The present invention first models the technical problem that is intended to be solved, that is, how to optimize the allocation of limited detection resources and realize the positioning of multi-target anycast IPs in the scenario of multi-target anycast positioning.
[0048] Specifically, the set of anycast IP addresses to be located , Representative target anycast IP addresses. The total number of detection resources is Assume that the target anycast IP address distribute When detecting resources, the number of devices discovered by the iGreedy algorithm is , then we can use the utility curve express arrive The optimization goal is to achieve a distribution method , which optimizes the detection resource allocation. Refers to the target anycast IP address distribute detection resources, =1,2,…, .
[0049] The utility curve can be expressed as:
[0050] ;
[0051] And the optimization function should satisfy the following constraints:
[0052] ;
[0053] ;
[0054] In the formula, Represents a positive integer.
[0055] The difficulties lie in the following two points:
[0056] Black box function: In actual measurement, the utility curve in the utility maximization problem is measured It is actually a black box that can only predict subsequent utility through past observations. And the allocation of probe resources is not cost-free. Once the probe resources are allocated, the resources have been consumed. Therefore, the allocation of probe resources can only be more or unchanged, and the allocation scheme must work in an incremental manner.
[0057] The dilemma of time and performance: In actual measurement behavior, not only the detection resource cost generated by the measurement should be considered, but also the time cost generated by the measurement. Currently, it takes 3 to 5 minutes to initiate a measurement and obtain the measurement results. Multiple measurements may result in a long measurement time span. On the one hand, long-term measurement may lead to poor algorithm scalability; on the other hand, using a large amount of time for detection may cause inaccurate measurement results due to network changes caused by time.
[0058] Based on the above technical problems and difficulties, such as Figure 1 As shown, the technical solution provided by the present invention is as follows:
[0059] Step 1: Since different probes have different detection capabilities, the number of devices they discover also varies. Therefore, we first select an ordered set of probes with stronger detection capabilities from the probes published by the measurement platform. , the size of the set is , used to initiate ICMP Ping probes to anycast IP addresses. Input to the subsequent steps to initiate ICMP Ping detection to anycast IP addresses in order. ( ) When allocating 3 detection resources, the ordered probe sets will be used in sequence The first three probes in ( ) When 3 detection resources are allocated, the ordered probe set will be used in sequence The fourth to sixth probes in the above example are used. Because probes are reusable for different anycast IP addresses, but repeated probes are meaningless for the same anycast IP address. During each probe, regardless of whether the probe is reused or not, one probe resource is consumed.
[0060] The following two methods can generate ordered probe sets: .
[0061] Method 1: Farthest point sampling. The specific process is:
[0062] 1.1 Initialize the selected probe group to empty, initialize the distance vector to the maximum value, and initialize the distance vector to infinity, which is represented as the first distance vector , Represents the distance between the selected probe group and The distance between the probes, where =1,2,…, ;
[0063] 1.2 Randomly select a probe s to add to the probe group and update the ordered probe set ;
[0064] 1.3 Calculate the distance from the selected probe s to all probes and obtain the second distance vector . Compare the first distance vector and the calculated second distance vector ,reserve and The smaller value in is the new third distance vector;
[0065] 1.4 Select the probe with the largest distance in the distance vector and add it to the ordered probe set ;
[0066] 1.5 Repeat 1.3 and 1.4 until the number of probes in the selected probe set reaches = .
[0067] Method 2: Random sampling. Initialize the ordered probe set , randomly select a probe from the unselected probes with equal probability and add it to the ordered probe set , the random selection process is repeated until the ordered probe set The number of probes in is equal to .
[0068] Step 2: Statically allocate detection resources. Then anycast IP address ,distribute Initial detection resources, and
[0069] ;
[0070] The current The allocation scheme of anycast IP addresses can be expressed as:
[0071] ;
[0072] The specific process is: for each anycast IP address ,distribute Probe resources and update the following parameters: Initial allocation plan ; The number of allocated detection resources ,
[0073] ;
[0074] Remaining detection resources to be allocated , = - . For the remaining detection resources Perform dynamic allocation, the specific process is as shown in steps 3 to 7.
[0075] Step 3: Anycast IP address , from the ordered probe set Select from 1 to The probes are used for detection, among which, The value of is the allocation scheme The At this point, we can get this The detection result (i.e. RTT value) of each probe is input into the iGreedy positioning algorithm according to the rules to obtain any broadcast IP address. The coordinate pair set ;
[0076] in, Indicates anycast IP address The number of devices found when using 1 probe for positioning. The coordinate pair set is used as input to the fourth step to generate the coordinate pair for anycast IP target. Utility curve from the number of probe resources used to the number of devices discovered .
[0077] It should be noted that, except for the iGreedy positioning algorithm, any positioning algorithm that can achieve the same function, that is, taking the RTT value as input and the coordinate pair set as output, can be applied to the above process.
[0078] The process is as follows:
[0079] 3.1 For Anycast IP addresses , using an ordered set of probes The first to The probe initiates ICMP Ping detection on it, and records each probe after the measurement is completed. The RTT value is , representing the probe to The RTT value is combined with the probe's latitude and longitude information to obtain sample data. ,in, represents the latitude of the probe, Represents the longitude of the probe.
[0080] 3.2 For Anycast IP addresses of records are input into the iGreedy algorithm according to the rules for anycast positioning. The specific input rules are as follows: Anycast IP addresses , a total of times. During the second positioning, the first to the Sample data To the iGreedy algorithm, get the coordinate pair This result represents the use of When a probe is generated, the target anycast IP address Number of devices that can be discovered ,in ∈ . Get a set of coordinate pairs ;
[0081] This coordinate pair set is input into the fourth step to complete the utility curve fitting.
[0082] Step 4: For any anycast IP address , according to the coordinate set ;
[0083] Fitting its utility curve Based on the utility curve, the utility gradient function can be calculated In mathematical definition, the utility gradient function is the first derivative of the utility curve. In physical sense, anycast IP address The utility gradient function The gradient value at a certain point represents the value when using When a probe resource is found, the number of devices that can be found by the probe is allocated to the IP address. The utility gradient function is used for subsequent probe allocation.
[0084] Dynamic allocation of detection resources: A more intuitive method is to use the utility gradient function to complete the allocation of remaining detection resources, and then perform unified detection and anycast positioning. However, it should be noted that the utility curve and the utility gradient function are fitted using a small amount of data and cannot represent the real utility curve. Therefore, the resource allocation completed using the utility curve may not be optimal. Another intuitive method is to allocate a detection resource, re-detect and complete anycast positioning, and update the utility curve. In theory, this method can ensure that each allocation is optimal. However, each batch of detection and positioning takes 3 to 5 minutes, and the detection duration is positively correlated with the number of detections. On the one hand, this method may cause the detection duration to be too long, resulting in unnecessary time overhead. On the other hand, the network environment is changing rapidly, and long-term detection may lead to inaccurate results due to network changes. Therefore, the present invention divides the remaining detection resources into This can not only make multiple corrections to the utility curve, but also avoid inaccurate measurement results caused by too long a time.
[0085] Therefore, if Figure 2 As shown, after completing the initial allocation and preliminary anycast positioning, the remaining detection resources to be allocated The average is Quantity per portion , = . At the same time, the subsequent steps are executed in a loop times, each consumption The current number of runs is initialized to k=0.
[0086] The specific process is:
[0087] 4.1 Use the coordinate pair set output in step 3 to create a new coordinate pair for each anycast IP address. Fitting a utility curve .
[0088] 4.1.1 For each anycast IP address , there is a set of coordinate pairs ;
[0089] Construct the utility curve using the logarithmic function as a prototype:
[0090] ;
[0091] In the formula, is the weight parameter, is the bias parameter. After the coordinate pair set, = .
[0092] 4.1.2 To obtain the optimal curve, we use mean square error as the loss function:
[0093] ;
[0094] The smaller the loss function, the better the curve fitting effect. Therefore, the optimization goal of the present invention is ;
[0095] because is a constant and has no effect on the optimization results, the method error can be used to replace the mean square error:
[0096] ;
[0097] In the formula, for The fitted value of the number of devices detected by the detection resource, for The actual value of the number of devices detected by a detection resource;
[0098] 4.1.3 Use the least squares method to solve the function so that the value of the loss function is minimized and the utility curve is obtained .
[0099] 4.2 Deriving the utility curve to obtain the utility gradient function .
[0100] Step 5: Now, the first round of iteration is performed, i.e., k = 1. Figure 2 As shown, for each anycast IP address , according to its utility gradient function , calculate its The utility gradient value on Then, The probability of choosing Among the anycast IP addresses, the one with the largest utility gradient value is The probability of selecting the remaining anycast IP addresses is is a predetermined constant between 0 and 1. Specifically, if the selected anycast IP address is , then it will be A new detection resource is allocated and its utility gradient value is changed from Updated to , while the utility gradient values of other anycast IP addresses remain unchanged. At this time, according to the updated utility gradient value, the above selection process is repeated until the resource is detected in this round. Allocation is complete. After allocation is complete, record the round as each anycast IP address Allocation scheme for newly allocated probes , ;and .
[0101] Step 6: For each anycast IP address , using the number of detection resources calculated in step 5 Select the ( +1) to ( + ) probe pairs Initiate an ICMP Ping request to obtain the RTT value from the probe to the target anycast IP address, and use the RTT value as the input of the iGreedy anycast positioning algorithm to obtain a set of coordinate pairs. , …, ;
[0102] After obtaining the coordinate pair set, And this set of coordinate pairs is used for the utility curve The fitting of
[0103] The process is as follows:
[0104] 6.1 For Anycast IP addresses , using ordered probe sets Middle +1 to + Each probe initiates an ICMP Ping probe to it. After the measurement is completed, the RTT value in the corresponding packet received by each probe is recorded. The RTT value represents the time from the probe to Then return the time taken. Combine the RTT value with the probe latitude and longitude information to get the sample data. ,in represents the latitude of the probe, Represents the longitude of the probe. The RTT value is the RTT value from the first round to the kth round.
[0105] 6.2 Input the sample data in 6.1 into the iGreedy algorithm according to the rules, perform anycast positioning, and obtain a set of coordinate pairs , …, ;
[0106] This coordinate pair set is input into the fourth step to perform utility curve fitting.
[0107] Step 7: If k < , then let k = k + 1 and repeat steps 4 to 6, otherwise, the algorithm ends. Finally, the optimal allocation solution can be obtained ,
[0108] ;
[0109] in, For the The number of probe resources finally allocated to anycast IP addresses, and .
[0110] Based on the optimal allocation scheme, for each anycast IP address , use each allocated detection resource to select a probe and initiate ICMP Ping requests in turn, obtain the corresponding RTT value and input the iGreedy positioning algorithm to achieve anycast IP address Positioning.
[0111] In summary, the technical solution provided by the present invention can realize the positioning of multiple anycast IPs based on the positioning algorithm by dynamically allocating detection resources in batches. This method consumes fewer detection resources, can improve the utilization rate of detection resources, reduce detection costs and time consumption, and improve the positioning efficiency of anycast IPs.
[0112] Furthermore, on the basis of achieving the above-mentioned beneficial effects, each preferred scheme has also achieved the following beneficial effects: the generation of an ordered probe set is conducive to the orderly allocation of detection resources, which helps to improve the efficiency of allocation and anycast IP positioning; fitting the utility curve helps to improve the rationality of detection resource allocation, which helps to improve the efficiency of subsequent anycast IP positioning; performing multiple batches of resource allocation can further improve the precision and rationality of detection resource allocation, so as to further improve the utilization rate of detection resources, reduce detection costs and time consumption, and improve the efficiency of anycast IP positioning.
Claims
1. A multi-target anycast IP positioning method, characterized in that: The following steps are involved: Step S1: Determine the set of anycast IP addresses to be located and the total number of probe resources ;in, For the Anycast IP addresses, =1,2,…, , is the number of anycast IP addresses; Step S2: Generate an ordered probe set ; Step S3: Execute round 0 allocation, that is, for each anycast IP address distribute detection resources; and update the number of detection resources to be allocated , ; Step S4: From the ordered probe set Select from 1 to The probes are used to detect and obtain RTT value and input into the positioning algorithm to get the anycast IP address Include A set of coordinate pairs; Among them, the form of the coordinate pair in the coordinate pair set is ( , ), To detect the number of resources, is the number of devices detected; Step S5: Fit the set according to the coordinates Utility curve for anycast IP addresses , and according to the utility curve Calculate utility gradient function , calculate the utility gradient function The utility gradient value under the number of allocated detection resources in the previous round; Step S6: Each detection resource to be allocated is allocated with a preset probability Assigned to the Anycast IP address corresponding to the maximum utility gradient value, with probability Assigned to any other anycast IP address; Allocate all the detection resources to be allocated in this round and get the allocation plan , ; In the formula, For the Anycast IP addresses The number of detection resources allocated, =1,2,…, ; Step S7: Based on the allocation scheme , for each anycast IP address , use each allocated detection resource to select a probe and initiate ICMP Ping requests in turn, obtain the corresponding RTT value and input it into the positioning algorithm to achieve anycast IP address Positioning.
2. A multi-target anycast IP positioning method as claimed in claim 1, characterized in that: Step S2 includes: Step S21: Select the probe group and initialize it to empty, and set the first distance vector Initialize to infinity; Step S22: randomly select a probe s to add to the probe group, and update the probe group; Step S23: Calculate the distance from probe s to all probes to obtain the second distance vector , and the first distance vector Compare one by one and keep and The smaller elements in constitute the third distance vector; among them, =1,2,…, ; Step S24: Select the probe with the largest distance in the third distance vector to add to the probe group; Step S25: loop step S23 to step S24 until the number of probes in the probe group equals the total number of probe resources , that is, an ordered probe set generate.
3. A multi-target anycast IP positioning method as claimed in claim 1, characterized in that: Step S2 includes: Initialize the ordered probe subset, randomly select probes from unselected probes and add them to the ordered probe subset; Cycle random selection until the number of probes in the ordered probe subset is equal to the total number of probe resources , that is, an ordered probe set generate.
4. A multi-target anycast IP positioning method as claimed in claim 1, characterized in that: The positioning algorithm is the iGreedy positioning algorithm.
5. A multi-target anycast IP positioning method as claimed in claim 1, characterized in that: The first step of fitting the set according to the coordinates Utility curve for anycast IP addresses ,include: Constructing utility curves After the coordinate pair set, ; In the formula, is the weight parameter, is the bias parameter; Method error As the loss function, ; In the formula, for The fitted value of the number of devices detected by the detection resource, for The actual value of the number of devices detected by a detection resource; Use the least squares method to solve the loss function and obtain the utility curve The weight parameter with the smallest value and bias parameters .
6. A multi-target anycast IP positioning method as claimed in claim 1, characterized in that: After step S4, the following steps are also included: Divide the detection resources to be allocated into Execute in a loop Step S5 to step S6, ≧2; In the kth round, the coordinate pair set is updated as follows: use Select the detection resource ( +1) to ( + ) probes, that is, for each anycast IP address Initiate ICMP Ping request to obtain probe to anycast IP address The RTT value of is the first The number of detection resources allocated to anycast IP addresses, k = 1, 2, ..., ; Each RTT value from the first round to the kth round is input into the positioning algorithm to obtain a new set of coordinate pairs.
Citation Information
Patent Citations
Method and device for determining position of DNS mirror image server
CN110113442A
Optimizing network delivery of 5G edge application services
CN116250216A
