# Routing Algorithm Based on Trajectory Prediction in Opportunistic Networks
## 1 Introduction  
An opportunistic network is a kind of network that can construct communication services between nodes with the network structure fracture and topology dynamic change. It has extensive research and application value in military and civilian fields [1; 2]. At present, the main research hotspots of the opportunistic networks are: routing algorithms, network information security [3], energy research, mobility model research and so on. The topology of the opportunistic networks changes dynamically and no relatively stable data transmission path between nodes. This makes it difficult to achieve more efficient performance based on the change of network topology [4]. Therefore, how to find a routing protocol with good routing performance is one of the most challenging problems in opportunistic networks research. Opportunistic network routing protocols face the following challenges:  
1. Unevenness of opportunities to encounter between nodes. In the opportunistic network, the information interaction occurs only when two nodes enter each other's communication range. The chance of encountering between the two nodes is unpredictable, which leads to the imbalance of the chances of encountering the nodes. 2. Topology structure information is difficult to grasp. The topology of the opportunistic network changes dynamically, and the mobile information of nodes in the network is difficult to obtain accurately and timely. 3. Resource constraints. Most of the opportunistic network nodes are portable devices, so the nodes themselves have limitations such as energy, contact time, and storage space. * Unpredictability of node movement trajectory. The mobile behavior of a node is affected by many external factors, and it is impossible to obtain the precise location information of the node in time. At present, researchers have proposed many opportunistic network routing protocols. The opportunistic network information transmission mechanism is \"store-carry-forward\". According to the routing strategy, it can be divided into three categories: code-based, scene-based and switched-based routing [5]. However, they did not consider the location information of the node. The location information of the node plays an important role in quickly discovering the information of the next-hop forwarding node. At present, there are some location-based routing algorithms [6; 7]. In these algorithms, the next-hop forwarding node can be found through the location information of the neighbor and destination nodes, which effectively improves the routing performance and has strong adaptability to the dynamic change of the network topology. The DIG (Direction based geographic routing scheme) [8] algorithm is a representative location-based algorithm. However, the algorithm does not fully utilize the location information of the neighbor nodes, which makes the delay performance unsatisfactory and requires improvement. The LAR (Location Aided Routing) [9] algorithm and the LOTAR (Location Trace Aided Routing) algorithm [10] establish a source node to a destination node route by directly utilizing location information, thereby transmitting data packets. GPSR (Greedy Perimeter Stateless Routing) [11] algorithm and GLS (Grid Location Service) [12] algorithm also transmit information by using node location information, but the two algorithms do not establish a data transmission path from the source node to the destination node. To solve the problems, this paper proposes a routing algorithm based on trajectory prediction. This approach is based on the historical mobility characteristics of the nodes to establish the mobility model of the node. Based on the predicted location information, the metric value of the candidate node is calculated, and the node with the smaller metric value is selected as the data forwarding node. The presented method may be successfully used for vehicular ad hoc networks (VANETs). The main contributions of this article are in the following areas:  
1.