# SubvectorS_Geo: A Neural-Network-Based IPv6 Geolocation Algorithm
## 3 The SubvectorS_Geo Algorithm
### Pre-Classifier  
A robust model requires a reasonable set of parameters. In the assumption of region delay similarity, we must approximate the training set to a fine-grained region to achieve the task of robust model training. Reasonable constraints should be imposed on the partitioning of the training set before, importing the partitioned training set into the neural network model.  
Landmark clustering: This task aims to reduce the complexity of the model in evaluating vector similarity through rule-based preselection of real geographic relationships among landmarks. The street-level clustering task of landmarks is accomplished based on a priori knowledge of street-level IP geolocation combined with the routing features of landmark IPs. In addition, as mentioned in the Introduction, the latitude of delay caused by the processing of delay in this paper is not uniform, which leads to the accuracy of the subsequent evaluation results being affected. In the landmark clustering task, we try to solve this problem using SubvectorS.Detailed steps are shown below.  
Step 1: First, the closest common router with the strongest and stable geographic correlation is extracted from the coded landmark routing vector as the first round of screening criteria, and then, the IPv6 prefix in the Whois information is used as a constraint to screen for the dataset \(G_{i}(i=1,2,3,\ldots,i)\). \(i\) is the maximum profile factor.  
Step 2: Clustering based on real geographic information of landmarks (latitude and longitude) to obtain datasets \(L_{j}(j=1,2,3,\ldots,j)\), where \(j\) is the maximum profile factor. The clustering method uses the K-means method with a latitude and longitude distance constraint of 10 km.  
Step 3: Street-level landmark dataset \(G_{i}\cap L_{j}\). Obtain \(s_{n}(n=1,2,3,\ldots,n)\), where \(n\) is the maximum profile factor and uses the cluster center landmark as the geographic location information for this street-level landmark class.  
Step 4: Landmark path collection \(S_{n}(n=1,2,3,\ldots,n)\); the \(S_{1}\) set of geographically related landmarks' path sets (10 km) is recorded, and this section iterates the delay vector on the path of each landmark using the subvector algorithm to obtain the delay vector of a landmark at different latitudes.  
SubvectorS: To delineate the final fine-grained region constraint of the entity, we used the rules of the closest common router and the closest hostname similar router. Each entity to be located may filter out different closest common routers and closest routers with similar hostnames. Therefore, after the credible region of each target to be located is divided, its remaining path length is difficult to unify, resulting in the nonuniformity of the dimensionality of the delay feature vector. Difficulties exist in the similarity measure of the delay vectors based on the cosine similarity.  
We let \(T_{l}\) denote the landmark residual path delay vector. \(T_{t}\) denotes the target IP residual path delay vector. \(|T_{t}|\) denotes the dimension of the target IP residual path delay vector. SubvectorS enumerates all the subdelay vectors \(T_{l}\) of \(T_{l}[1,j](1<j\leq|T_{l}|)\) and iteratively generates all subvectors of the landmark delay vector combined with the routing vector to expand a landmark path vector into \(T_{t}\). This task is performed iteratively in the planned training set. \([1,j]\) denotes the first router to the jth router sequence. The Algorithm 1 is shown as follows.  
```
0: Landmark paths and delay vectors \(C_{l}\)
0: Training set \(S_{n}\)
1:\(\Theta(T_{l}[1,j],T_{t})\longleftarrow 0,|T_{t}|\longleftarrow dimension(T_{t})\)
2:for(int \(i\) = 0 ; \(i\) + \(n\); \(i\)++)do
3:for(int \(k\) = 0 ; \(k\) < \(j\); \(k\)++) do
4:\(T_{lk}\longleftarrow(T_{l}[1,k])\)
5:\(C_{lk}\longleftarrow(R_{cl},T_{lk})\)
6:\(S_{n}.append(C_{lk})\)
7:endfor
8:endfor
9:return\(S_{n}\)
```  
**Algorithm 1** SubvectorS