# An Efficient Internet-Wide Scan Approach Based on Location Awareness
## 4 Proposed Approach
### Overview of Proposed Approach  
Our goal is to reduce the total time used for scanning (T). In Equation (1), we have already improved the scanning node's execution speed (Vi) by reasonably distributing scanning tasks based on the geographic location of each scanning node. However, solely relying on geographic location to distribute tasks can lead to an imbalance in the residual task volume (TSi) and the upcoming task volume (TRi) for each scanning node, which in turn affects the overall scanning time. Therefore, in order to improve the efficiency of the original allocation method, a good task scheduling method is needed [17]. To ensure that each scanner performs the tasks it is good at and to prevent wastage of scanner resources, we adopt a load-balanced task scheduling method combined with a location-aware method to form a location-aware efficient scanning algorithm; see Algorithm 1 for details. The method as a whole is divided into two phases: from step 1 to step 5 is the preprocessing phase before scanning, and from step 6 to step 12 is the load-balancing phase within the cluster. In the pre-scanning preprocessing phase, the main preparation work before scanning is completed. Specifically, steps 1 to 3 consist of clustering the scanners based on their geographical locations. Each clustering represents a geographic region, and the system will combine the historical task execution in the region to summarise the time delay and provide a guiding basis for subsequent task allocation. Subsequently, in Steps 4 and 5, we regionally cut the network-wide scanning tasks based on the above geographic clustering results, so that the tasks can be more efficiently matched to the corresponding scanner clusters. In the load-balancing phase, the focus is on task scheduling and load balancing within the cluster. The core idea of this phase is to allow scanners with currently free resources to undertake tasks in the regions they are good at as much as possible during the task allocation process to improve the overall scanning efficiency [18]. Among them, Step 9 is the key of this phase. In Step 9, the procedure will first distribute each subtask to the corresponding scanner cluster, and then the cluster head node in the scanner cluster will distribute the IP address to all scanners in the cluster as evenly as possible. Repeat steps 8 and 9 until the subtask queue is empty. In step 12, all the scanner clusters are monitored, and when a scanner cluster completes a task and is idle, it proactively communicates with the scanners in the cluster that have not yet completed a task and have a close time delayand assists them in completing the remaining tasks if the task has not yet been completed, thus achieving overall work balancing. In particular, in order to support the above scheduling and collaboration mechanisms, all scanners in our approach must have the ability to share task state and communicate. Therefore, in this system, scanners are not just nodes that simply deploy scanning tools; they also construct information interaction mechanisms among themselves to ensure efficient task assignment and collaborative execution. In the next subsection, we elaborate on our approach.