Abstract
Rule-based fine-grained IP geolocation methods are hard to generalize in computer networks which do not follow hypothetical rules. Recently, deep learning methods, like multi-layer perceptron (MLP), are tried to increase generalization capabilities. However, MLP is not so suitable for graph-structured data like networks. MLP treats IP addresses as isolated instances and ignores the connection information, which limits geolocation accuracy. In this work, we research how to increase the generalization capability with an emerging graph deep learning method -- Graph Neural Network (GNN). First, IP geolocation is re-formulated as an attributed graph node regression problem. Then, we propose a GNN-based IP geolocation framework named GNN-Geo. GNN-Geo consists of a preprocessor, an encoder, messaging passing (MP) layers and a decoder. The preprocessor and encoder transform measurement data into the initial node embeddings. MP layers refine the initial node embeddings by modeling the connection information. The decoder maps the refined embeddings to nodes' locations and relieves the convergence problem by considering prior knowledge. The experiments in 8 real-world IPv4/IPv6 networks in North America, Europe and Asia show the proposed GNN-Geo clearly outperforms the state-of-art rule-based and learning-based baselines. This work verifies the great potential of GNN for fine-grained IP geolocation.
Introduction
IP geolocation—the process of determining the physical location of a device based on its IP address—is essential for localized services and cybersecurity. While coarse-grained geolocation (city-level) is relatively mature, fine-grained geolocation (street-level accuracy, typically <10km error) remains a significant challenge. Traditional rule-based methods often fail because real-world network congestion and complex routing violate simple assumptions like the "delay-distance" rule. Recent deep learning approaches using Multi-Layer Perceptrons (MLPs) also fall short because they treat IP addresses as isolated data points, ignoring the inherent graph structure of the internet.
GNN-Geo addresses these limitations by reformulating IP geolocation as a graph node regression problem. This allows the model to capture the topological connections between routers and hosts, significantly improving accuracy across diverse global networks.
Methodology: The GNN-Geo Framework
GNN-Geo is a novel four-stage framework designed to leverage network topology for precise geolocation.
- Preprocessor: Raw traceroute data is transformed into an attributed graph. A specialized matching algorithm handles "anonymous routers" by mapping them to known IPs found in similar network paths.
- Encoder: Raw features, such as node delays and IP identifiers, are converted into low-dimensional vector embeddings.
- Message Passing (MP) Layers: Utilizing a Message Passing Neural Network (MPNN), each node communicates with its neighbors. Through multiple layers, a target IP learns from the delays and locations of nearby landmarks and routers, effectively mapping the local network structure.
- Improved Decoder: To stabilize learning and improve convergence, the decoder incorporates "prior knowledge" by restricting the search space to a coarse-grained area (e.g., a specific city). It utilizes Batch Normalization and Sigmoid functions to map refined embeddings to geographic coordinates.
Experimental Evaluation
The framework was evaluated across eight real-world IPv4 and IPv6 networks in North America, Europe, and Asia, including New York State, Hong Kong, Shanghai, Beijing, Tokyo, Berlin, and Munich.
The study utilized a massive ground-truth dataset of over 350,000 landmarks. This benchmark is particularly significant for IPv6 networks, which are often understudied. GNN-Geo consistently outperformed both rule-based (SLG, Corr-SLG) and learning-based (MLP-Geo) baselines. On average, GNN-Geo reduced error distances by 21%. In the Hong Kong dataset, it achieved an average error of just 8.1 km.
Discussion and Conclusion
The success of GNN-Geo highlights that network topology is a critical feature for geolocation. Unlike traditional MLPs, GNNs naturally capture non-Euclidean data. Furthermore, by hybridizing deep learning with rule-based prior knowledge, the model overcomes the vast search space of global coordinates.
While GNN-Geo shows superior performance, especially in sparse IPv6 networks, it faces challenges regarding computational costs and the inherent "black box" nature of deep learning. Future research will explore attention mechanisms to weigh reliable routers more heavily and methods to reduce training overhead for industrial-scale deployment. This work demonstrates the significant potential of GNNs in achieving street-level IP geolocation accuracy.
Summary updated