TPR-DTVN: A Routing Algorithm in Delay Tolerant Vessel Network Based on Long-Term Trajectory Prediction

An efficient and low-cost communication system has great significance in maritime communication, but it faces enormous challenges because of high communication costs, incomplete communication infrastructure, and inefficient routing algorithms. Delay Tolerant Vessel Networks (DTVNs), which can create low-cost communication opportunities among vessels, have recently attracted considerable attention in the academic community. Most existing maritime ad hoc routing algorithms focus on predicting vessels’ future contacts by mining coarse-grained social relations or spatial distribution, which has led to poor performance. In this paper, we analyze 3-year trajectory data of 5123 fishery vessels in the China East Sea. Using entropy theory, we observe that the trajectory of the vessel has strongly spatial-temporal distribution regularity, especially when previous states were given. To predict accurate future trajectories, we develop a long-term accurate trajectory prediction model by improving the Bidirectional Long-Short Term Memory (Bi-LSTM) model. Based on predicted trajectories and the confident degree of each prediction step, we propose a series of routing algorithms called TPR-DTVN to achieve efficient communication performance. Finally, we carry out simulation experiments with extensive real data. Compared with existing algorithms, the simulation results show that TPR-DTVN can achieve a higher delivery ratio with lower cost and transmission delay.


Introduction
As the critical technology for smart ocean, a low-cost and efficient maritime communication system plays a key role in daily communication [1,2]. Most maritime activities, such as environmental monitoring, fishery operations, and knowledge exchange, can be successfully implemented under the above communication system [3,4]. Existing maritime communication systems, including satellite-based, sea-based, and shore-based, have severe shortages in terms of high cost volume, limited network coverage, and absence of facilities [5], which cannot meet the requirements of low cost, wider data transmission in ocean regions [6].
With growing marine operations, the mobile vessel is becoming extremely important in the ocean due to its storage and communication capabilities. In the academic commu-nity, considerable attention has been paid in the maritime delay tolerant vessel networks (DTVN) [7][8][9][10][11]. The routing algorithm of DTVN should make a correct decision on each relay based on known or expected information to ensure an effective data transmission. Thus, it is pivotal to get vessel mobility trends and accurately predict future contacts according to historical data [12,13].
Recent works mainly focus on modeling mobile regularity by setting up the default movement model and mining social relationship [7,8,12,14]. Most of the above work achieves coarse-grained, which is not enough to describe precise mobility patterns. The future trajectory is one of the most vital factors to build an efficient delay tolerant network system [13]. Once given the future trajectory, it is feasible to calculate expected contacts and get an optimal routing plan. Thus, the gap between actual and predicted trajectory has significant effects on data delivery in DTVN, which means that the accurate trajectory prediction model plays a vital role in the routing process.
Vessels' movement is free space moving due to lack of map topology. Many factors such as fish distribution, weather conditions, and ocean current have significant effects on their movement [15][16][17], which makes traditional prediction models on land not infeasible for vessel trajectory prediction. For modeling vessels' mobile regularity, some researchers design models based on high-order Markov chain, Bayes model, and deep learning methods [15,16,18]. By splitting area to nets, some machine learning models can also be applied by transferring regression to classification problem [19]. The methods based on long-term high-order Markov and Bayes models can predict long-term trajectory. However, the model has low cross-regional extendibility based on our experimental study, which means that the model cannot work when facing a new ocean area. Existing deep learning-based methods all focus on short-term (less than 20mins) trajectory prediction or vessel state estimation. Besides, the regression results do not have proper evaluation metrics on each prediction step, making routing algorithms not adopt it.
To address the above problems, we design a trajectory prediction algorithm to model the vessel's mobile regularity and get the long-term accurate predicted trajectory. Besides, the routing algorithm takes the evaluation result of predicted trajectory as a condition. Even the future trajectories are available, the routing algorithm is essentially a global optimization problem, which is also an NP-hard problem. Therefore, we need to properly design the routing algorithm using predicted future trajectory and evaluation results, to improve the routing performance.
In this paper, we propose a set of low-cost, large-scale DTVN algorithms based on long-term predicted trajectories. Firstly, we utilize entropy to verify the predictability of vessels with massive actual traces data. It can be observed that the regularity in trajectory has lower entropy with more previous states and sailing features. Then, we design an improved Bi-LSTM trajectory predict model with great cross-regional extendibility to model the mobile regularity. To address the predicted trajectory evaluation problem, we utilize the prediction model's performance on the test set to design the confident degree of each predicted step calculation method. Finally, a series of low-cost, large-scale DTVN routing algorithms based on the predicted trajectory is designed.
We have made the following intellectual contributions in this paper: (1) It is the first work, to the best of our knowledge, to exploit the precise mobility pattern of vessel networks and use them for routing algorithms design in the vessel maritime communication system (2) We design an accurate long-term trajectory prediction model based on improved Bi-LSTM to model vessels' mobility patterns, which achieves more than 9-hour accurate predictions. The trajectory prediction model shows an excellent prediction perfor-mance even the input sequences have never appeared in training sets. It indicates that our model can achieve a cross-regional trajectory prediction (3) An advanced evaluation method on trajectory regression results is designed to solve the regression model evaluation problem, making the predicted trajectory fully used by our DTVN routing algorithms (4) We propose a series of routing algorithms based on predicted trajectory to solve the optimal routing problem, which proves to be NP-Hard. Simulation in extensive actual trajectory data set, including 5123 vessels in 3 years, shows that our routing algorithm can achieve a higher delivery ratio than other routing strategies with lower cost and delay The rest of the paper is organized as follows. The system model and problem formulation are given in Section 2. Section 3 introduces our basic idea and challenges. The structure of our trajectory prediction model is proposed in Section 4. The routing algorithm based on trajectory prediction is presented in Section 5. Section 6 gives the introduction of distributed algorithms. Section 7 shows the performance of our algorithm. Section 8 reviews related works. This paper is concluded in Section 9.

System Model and Problem Formulation
In this section, we introduce the system model of DTVN. Then, we describe the optimal target of system, expected delivery probability, and system evaluation metrics including system cost, delivery delay, delivery ratio, and system efficiency. Finally, we prove that the system optimization problem is NP-Hard.
2.1. System Model. All vessels in DTVN are considered to be a set of nodes represented by S. Node trajectory s in S is specified as a sequence of states over a period of time (t1, tn) In T s , each state c s,t has its information, including latitude, longitude, speed, and direction. For nodes s i and s j in S, we use Disðs i , s j Þ to denote the distance between them and utilize r si , r sj to reflect their communication radius. Therefore, s i and s j can form a communication link when Disðs i , s j Þ is smaller than min ðr si , r sj Þ. The whole set S can form a link set at the time t, which can be specified Dis p s i ,t , p s j ,t < min r s i ,r s j : For a packet p, we use δðpÞ and ζðpÞ to denote its source and destination. The p could be copied for transfer to the node when they have links between them. Then, the packet 2 Wireless Communications and Mobile Computing set P n of size n is defined as We also set TTL (time-to-live) for the packet's remaining living time, TTL max for the maximum living time, H for remaining hops, and H max for maximum hops. Packet delivery will fail if p i does not get to its destination under the situation that TTL or H is equal to 0.
We next give the formal definitions of four system evaluation metrics system cost, delivery delay, delivery ratio, and system efficiency. Definition 1 (system cost). System cost represents the network occupation in the packet delivery process. In our system, ϕðpÞ is defined as the number of copies generated in the delivery process of p. Therefore, the system cost of P n can be given by Definition 2 (delivery delay). To measure the delivery time of p from source δðpÞ to destination ζðpÞ, χðpÞ is denoted as the delivery delay of p. tðδðpÞÞ is defined as the timestamp of p at the source node. So tðζðpÞÞ is at the destination node. Delivery delay of p can be defined as χðpÞ = tðζðpÞÞ − tðδðpÞÞ. The system delivery delay is the average delay of P n , which can be given by Definition 3 (delivery ratio). Delivery ratio is defined as the proportion of the packets successfully delivered to total packets number n. The delivery ratio can be given as ð|p success|/nÞ. Definition 4 (system efficiency). A high-performance communication system should have a high delivery ratio with low cost and delay. Hence, we define system efficiency as the proportion of the delivery ratio to system cost multiplying delivery delay. The efficiency of P n is defined as 2.2. Problem Formulation. The target of the system is to deliver all packets from sources to destinations, respectively. Our system's objective is to maximize system expected delivery probability. Several definitions are given as follows.
Definition 5 (packet expected delivery probability). Given a packet p with its source δðpÞ and destination ζðpÞ, the packet expected delivery probability ϱ p is the expected delivery probability of p, which can be calculated by a function f ðÞ.
ϱ p can be given by ϱ p is a fixed value if all the future trajectories T can be obtained. Additionally, it can be changed with nodes' different predicted future trajectories over time. Definition 6 (system expected delivery probability). Each packet p in P n can get ϱ p at the current time, the system expected delivery probability would be defined as ∑p ∈ Pn ϱ p.
The goal of our system is to maximize the system expected delivery probability. In conclusion, the whole optimal target of the system can be given by 2.3. Complexity Analysis. To address the expected delivery probability maximization problem, the algorithm needs to choose proper communication paths and a reasonable spectrum resource allocation strategy. The whole optimal problem is NP-hard due to its simplification problem. One can reduce the optimal resource allocation problem to the weighted maximum independent set problem (i.e., NP-hard problem). Note that the links within interference distance cannot allocate the same spectrum resources, which might generate mutual-interference. A portion of links within the network L t can allocate the same channel resources, constituting the reuse set. We use fω n g to represent all possible reuse sets in L t . Assuming that all communication paths are already known, and all reuse sets are allocated the same amount of subchannel resources.
For reuse set ω n , we select the links with a minimum data rate in one path and use κ n to represent the sum of these links. Then, we let the vertex weight equal to the sum of the reuse sets' data rate. Edges between vertexes represent different reuse sets that have partially repeated links (i.e., no edge between two vertexes represents that two reuse sets are totally different). Even knowing fκ n g and completed trajectory T i ∈ S, this reduction can also be established. So, the weighted maximum independent set problem means to find reuse sets, which has a maximum sum data rate without repeated links.
For any instance I of the weighted maximum independent set problem, we can construct the instance I * of the optimal resource allocation problem by using the partitioning ω ∈ fω n g to vertex set ν ∈ fν n g in I and using κ as weight for vertex ν n . So, if different ω has partially repeated links in I * , there are edges between them. The reduction can be accomplished in polynomial time, and it can verify that a feasible solution in I is a feasible solution.

Basic Idea and Challenges
In this section, we first verify the basic idea and algorithm feasibility. Also, challenges will be listed during the process of feasibility validation.
3.1. Basic Idea. In Section 2, we formulate the target of our algorithm. From problem formulation, we observe that the essential problem is how to predict future contacts among vessels. Obviously, if future trajectories can be reached or accurately predicted, we may measure the future contacts of the vessels in these trajectories. As a consequence, the DTVN routing problem can be converted into a trajectory forecast and predicted trajectory evaluation. The basic idea for our routing algorithm can be divided into four steps. The basic idea of our routing algorithm can be divided into four steps: Step 1: long-term precise future trajectories should be predicted by applying a proper algorithm to massive historical data of vessels Step 2: to make trajectories that can be used by the routing algorithm, predicted trajectories should be evaluated by specially designed measurement methods Step 3: based on predicted trajectories and their evaluation results, our system calculates the future contacts' probabilities Step 4: the routing algorithm utilizes contacts' probabilities to make a proper decision on each hop. A simple channel arrangement method should be applied during the data transmission process to solve the global optimal routing problem, which has been proved to be NP-Hard 3.2. Feasibility Validation. The effectiveness of the algorithm depends on whether the future trajectory of vessels can be predicted. To validate the predictability of the vessel's trajectory, we use conditional entropy, which has been commonly used to measure the disorder degree of time series data. Conditional entropy describes the disorder degree in the situation that some previous states have been given. The data is more predictable when it has lower conditional entropy than others.
From Section 2, we know that a vessel has T s = fc s,t1 , c s,t2 , ⋯, c s,tn g, s ∈ S. Firstly, we need to discretize the data in T s . Meanwhile, we set the location into 500 m × 500 m girds among the ocean and use the center coordinate to indicate each sample's location. Speed and direction are, respectively, discretized by 1 km and 20°. For all the c j of T s , we count how many times c j occurs and denote it as o cj , where 1 ≤ j ≤ ðLOC × SPE × DIRÞ: (i) LOC represents the gird number (ii) SPE represents the discretized speed number (iii) DIR represents the discretized direction number In terms of frequency ðo cj /nÞ, we calculate the marginal entropy HðT s Þ of T s by equation (9) Extend T s to asequence of two-tuples T s 1 = fðc 1 , c 2 Þ, ðc 2 , c 3 Þ, ⋯, 1 ðc n − 1, c n Þg, count how many times ðc α , c β Þ occurs in T s and denote it as oα, β, finally get joint HðT s 1 , T s Þ entropy as equation (10) H Then, conditional entropy HðT s 1 | T s Þ of T s 1 can be calculated by equation (11) H T s Based on previous equations, we can keep calculating the conditional entropy of T k i , and eventually, the conditional entropy of T k i is derived as equation (12).
We use entropy theory to analyze our data set. The data set from the Vessel Monitor System in China East Sea, which collects fishery vessel states from May 2015 to May 2018. We select 5123 vessels with good data integrity. System records vessels' sailing features including ship ID, latitude, longitude, speed, and direction on every 3 minutes. The whole data set has a range of 120°E to 130°E and 25°N to 35°N. Before analyzing, we sort all samples in time, remove duplicate and abnormal samples, to avoid any negative effects. Moreover, the local average interpolation method is applied to complete missing samples. Figure 1(a) shows that the vessel's trajectory uncertainty will decrease when more previous states are given. It illustrates that more historical data will help the mining mobility pattern of vessels. We also analyze the mutual effect of conditional entropy between features. We use different combinations of features, including location, speed, and direction, to measure whether the trajectory is more predictable with different feature combinations. Figure 1(b) illustrates that these additional features are of great benefit to regularity mining. To sum up, it is highly possible that vessel's future trajectory can be predicted by specifically mining historical data.

Challenges.
For time-series data prediction, some traditional models like Bayes or Markov chain have been applied [17,18,20]. Based on entropy results, a trajectory prediction model based on the high-order Markov chain has been realized. We use data from May 2015 to May 2016 to train the state transition matrix and the rest for testing. The test results of average continuous prediction time (ACPT) are shown in Table 1. It is obvious that 3-order Markov model with location, speed, and direction could only continuously predict the trajectory for 15.4 minutes on average. The continuous prediction time can improve to 46.3 minutes on average, with 49.7% more distance bias when only applying the location feature. There are 32.2% data in the test set that cannot apply this model, because these models can only work when current states are in the training set. A trajectory cannot be predicted when vessels change their working area, type, or time. Moreover, the Markov model's continuous prediction time and availability will continue decreasing with higher-order, limiting the usage of historical data. Therefore, traditional models like Bayes or Markov chain have shortages on both long-term prediction and cross-regional extendibility. The first challenge is listed as follows: Challenge 1: on account of traditional models' shortages, a novel trajectory prediction model needs to be designed to solve the historical data usage problems, long-term continuous prediction, and cross-regional extendibility. Section 4 addresses this challenge.
Since vessels' location, speed, and direction are all continuous variables, it is more suitable to use the regression model and sliding window to predict trajectory continuously. However, the regression results do not have a proper metric to evaluate each predicted step. The routing algorithm cannot make relay decisions without assessment criteria. So, challenge 2 and 3 are listed as follows: Challenge 2: a metric that can approximately represent the probability that the vessel appeared at a predicted loca-tion, which should be calculated using a novel evaluation method. The evaluation result needs to be directly adopted by the routing algorithm. This challenge is addressed in Section 5.1.
Challenge 3: a series of distributed routing algorithms with channel arrangements need to be proposed utilizing a novel evaluation method and predicted trajectories. The global optimal routing problem is NP-Hard, according to Section 2.3. This challenge is addressed in Section 5.2, Section 5.3, and Section 6.

Trajectory Prediction Model
In this section, we present our trajectory prediction model based on Bi-LSTM in detail. Firstly, the advantages of Bi-LSTM for time-series data are briefly introduced. Then, the detail of our model and its performance are given. Finally, we verify the cross-region extendability of our model.

Bi-LSTM for Time-Series Prediction.
Neural networks have a powerful ability to fit most functions. According to the universal approximation theorem, even a single hidden layer with no linear activation function neural network can approach any continuous finite dimension function with high precision.
For series data, many studies show that Recurrent Neural Network, like LSTM and GRU, has good learning performance to sequence learning problem [21,22]. To solve the vanishing gradient and exploding gradient problems that might happen in RNN, the LSTM adds a cell, an input gate, a forget gate, and an output gate. The cell remembers values over arbitrary time intervals, and the three gates regulate the flow of information into and out of the cell. Some researchers propose that the Bidirectional LSTM shows a more robust learning ability in sequence data learning [20]. Different from traditional LSTM, one Bi-LSTM unit includes two LSTM units. They can control the forward and backward   information flow in their cell state, respectively. In Figure 2, we could notice that the input state in the Bi-LSTM unit can flow in two directions. The unit in the next layer has connected with forward and backward units, which make it have a broader receptive field. Compared with LSTM, the Bidirectional LSTM is more suitable to predict the long-term trajectory in the ocean field.

Model Design and Performance.
Our dataset's raw data is the vessel's state every 3 minutes in 3 years, including time, ship ID, latitude, longitude, speed, and direction. To train the neural network, we first need to get the training sample by transferring the time series to the supervised learning problem. We need to get the input state sequence and output sequence from the original series of states. Assuming the length proportion between the input and output sequence is m, and the length of the predicted sequence is I. For given state sequence fc 1 , c 2 , ⋯, c n g, the sample i in sample set is the following: where 1 ≤ i ≤ n − ðm + 1ÞI + 1. In this paper, we set m = 3 and I = 1 h in our model, which means that the model utilizes 3-hour historical information to predict the future 1hour information. In addition to the location, our model also gives the prediction results of speed and direction. Therefore, if TTL is more than 1 hour, we can utilize the sliding window for long-term trajectory predictions. We shuffle the sample set and split the training, validation, and test sets according to the ratio of 7 : 2 : 1. Our model applies normalization to avoid the negative effect of feature range in the learning process. Figure 2 illustrates our model structure. Our model has four important parts, including convolution, Bi-LSTM, attention, and dense layers. We apply the stack of 1D convolutional layers at the beginning. The convolutional layer can process the grid structure data, including time series as 1D grids or graph as 2D grids. Because of the translation equivariant of convolution kernel, this layer helps our model learn spatiotemporal invariant patterns and reduce its capacity. The following layers also can get a bigger receptive field by the stack of the convolutional layers. As we know, one convolution kernel can only learn one pattern. Different convolution parameters like stride and activation functions have a significant impact on the model's performance. Therefore, we stack 3 layers of convolution with 64, 32, and 16 kernels with ReLU and set the stride = 3 in our improved model.
We use Bi-LSTM layers after convolution parts to avoid gradient explosion or vanish, which may lead to unstable state problems during the training process. Benefit from gate units and cell state, the typical LSTM has the memory of historical steps and stable gradient. Compared with typical LSTM, the Bi-LSTM has a more powerful fitting ability in sequence prediction. In each time step, the output of Bi-LSTM considers both forward and backward information. We choose four layers of Bi-LSTM with 64 cells and use softsign as an activation function. The softsign is better than tanh in this task, because it has a more gentle gradient performance than tanh. Additionally, we also choose proper weight initialization values based on the activation function. In this part, some residual connections between Bi-LSTM layers are added to avoid gradient vanishment.
The attention mechanism is added after the Bi-LSTM part. The attention mechanism can be used in time series prediction problems and show great performance in many     Figure 2, the attention layer gets the attention score by comparing the similarity of the last-hidden state with all history hidden states by the scaled-dot. Considering the Last hidden state, it has information learned from the whole input sequence, but the information from the beginning of the input sequence might disappear through long time steps. Therefore, one of the meanings that we design the attention layer is to integrate the information from the whole sequence. After that, softmax will be utilized to normalize the score. So, the context vector will be the weighted sum of attention score and hidden historical states. Then, we concat the context vector and Last hidden state as the output of attention layer.
At the end of the model, we add dense layers after the attention layer to obtain the output. In parameter setting, we stack two dense layers with 8ℑ and 4ℑ cells with ReLU and Linear activation function, respectively. Huber(), which has excellent robustness to outlier point, is adopted as the network's loss function. We mainly set the callback, including early stopping and learning rate decay. The model will stop training if MAE do not reduce in 30 epochs. We use 0.001 as the learning rate at the first ten epochs and use exponential learning rate decay. Finally, we set a total of 500 epochs to train the model with previous callbacks. Figure 3(a) indicates the average error on the test set. We can notice that our model can predict future trajectory in 1 hour with an average error of less than 300 meters. To further check the efficiency of our model, we use the sliding window to estimate the 9-hour trajectory. The model could give a longer predicted state sequence using slide window but might reduce the performance because using inaccuracy predicted states as input. And it also requires the model to predict all the features in state, which increases the complexity of trajectory prediction. The result shows that our model can achieve a 9-hour trajectory prediction with an average error of less than 2.73 kilometers.

Cross-Region Extendability Validation.
As mentioned in Challenge 1, traditional models do not have cross-region extendability. To verify our model's extendability, we artificially divide the data set based on each vessel's activity range. We use samples within 60% distance from port to farthest point for model training and the rest for testing. Figure 3(b) shows that the test set's average error is 30% larger than that in Figure 3(a). Compared with long communication distance(average 30 km), this error can be tolerated. The possible reason for this extendability is that our model learns some patterns from other state information, like speed and direction. Also, the stack of convolutional layers makes our model learn the spatiotemporal invariant patterns. In conclusion, cross-region extendability improves robustness during the applying process.

Global Routing Algorithm
In this section, we design the DTVN routing algorithm with global knowledge [?]. Like conventional delay-tolerant networks, vessels with larger expected encounter probability are more likely to meet in the future. When two vessels are within their range of contact, the packet should be copied and forwarded to the vessel with higher expected delivery probability in H hops. Therefore, the expected delivery probability calculation is the crucial issue of this algorithm. The process of expected delivery probability calculation is introduced in Sections 5.1 and 5.2. Section 5.3 will give a comprehensive overview of the routing algorithm.

Confident Degree of Predicted Trajectory
Definition 7 (confident degree of predicted trajectory). Confident degree of predicted trajectory approximately represents the probability that the vessel is on its expected position.
Since the regression results of the improved Bi-LSTM model do not include such metrics, to evaluate the results of predicted trajectories, we propose the confident degree calculation method based on the model's performance on the test set.
The mean error μ n and standard deviation σ n for each prediction step n on test set can be obtained after the model's training process. μ n and σ n can show the model's performance on historical data, which helps to determine the expected effects. For all prior assumed distributions, if we have a mean and standard deviation, the normal distribution has the highest entropy, which means that it shall have the highest adaptability. So we choose a normal distribution to fit the error of each predicted step.
The error n , which is the errors of step n, is denoted as the random variable. We could assume that error n ∼ Nðμ n , σ n 2 Þ. The Probability Density Function (PDF) with μ n and σ n can be given by Then, N ðμ n ′ , σ′ 2 n Þ can be fitted according to the results of equation (14). Therefore, the probability of error n less than ðμ n ′ + 3σ n ′ Þ is 99:87%. However, the predicted error can be tolerated in the routing scenario when the communication radius R is large enough. So the confident degree of the predicted trajectory should not only relate with μ n ′ and σ n ′ , but also relate with R. Considering that vessels are moving in 2D space, in this paper, the confident degree of predicted trajectory on step n can be given by

Wireless Communications and Mobile Computing
where υ is the identifier of vessel υ. When ðμ n ′ + 3σ n ′ Þ ≥ R, we define E υ,n = 0, because the error is too large to guarantee communication. The E υ,n could also be denoted as E υ,t where t is the timestamp of step n. E υ,t can be approximately treated as the probability of vessel appeared on predicted location based on empirical error and communication radius. Figure 4(a) shows the distribution of the error in the 11th step of the vessel "Zhe31828" and its fitted distribution. We can see that the distribution of the error is fitted to the normal distribution. Confident degree results are shown in Figure 4(b). We can observe that the confident degree changes with different communication radius. The confident degree declines in long-term prediction. The vessel with a smaller communication radius has a lower confident degree due to its tolerance for error.

Calculation of Packet Delivery Probability within n Hops.
For each vessel υ at time t, the confident degree of predicted trajectory E υ,t can be obtained. We use υ and τ to denote two nodes in the ocean. ϱ n υ, τðt start , t end Þ stands for expected delivery probability in time period ½t start , t end from υ to τ at just n hops, which means ϱ n υ, τðt start , t end Þ does not include the situation that packet is delivered in less than n hops.
When υ and τ are expected to meet (within their communication range) at time t, the one-hop delivery probability is E υ,t × E τ,t . So, the one-hop delivery probability can be given by Where t is the start time of expected contacts. The accompanying time is not considered in this equation to avoid repeated calculation. The meaning of t is the same in the following derivation procedures in this subsection.
The condition of two-hop delivery can be treated as two one-hop delivery procedures with the time constraint. The Then, three-hop delivery probability can be divided into one one-hop delivery procedure and one two-hop delivery.
The three-hop delivery probability can be derived by Therefore, the delivery probability of n hops is given by Considering the routing in DTVN, a vessel has a packet p that needs to be delivered to ζðpÞ with its remaining hops H and time-to-live TTL. When the vessel meets its neighbor υ at time t c , neighbor's delivery probability within (H − 1) hops needs to be calculated. The equation can be given by 5.3. Algorithm Description. The routing algorithm based on long-term trajectory prediction is described as follows.
Assuming that each vessel can obtain recent historical knowledge and trajectory prediction model of other vessels, and vessels sharing the same channel resource set need to compete for limited useful links. For packet list P in vessel υ, the source vessel first calculates ψ H−1 v,ςðpÞ ðt c , t c + TTLÞ of each p in P on υ's neighbors. The algorithm selects the relay node with the largest delivery probability. If links in the area are over link limitation, the algorithm will transfer the packet by probability rank to avoid channel collision.
When the packet p is copied and transferred, the system will update the copied packet's information. The algorithm would renew H pcopy . The packet will be abandoned if its TTL becomes 0. The packet p will stop forwarding when H is 0. The algorithm will repeatedly find the best relays for packets until packets in P are all delivered.
As an example, we show a small area of DTVN including vessel a,b,c,d,e in Figure 5. Vessel a met its neighbors b,c at time t 0 and wants to deliver its packet to e. The purple lines with arrow show the predicted trajectories of each vessel. Dotted line circles are vessels' expected location with confident degree, where t 0 < t 1 < t 2 and t 2 − t 0 ≥ TTL. Therefore, the one-hop expected delivery probability between c and e can be calculated by ϱ 1 to decide next relay.

Distributed Routing Algorithm
The previous section introduces the algorithm with global knowledge, including vessels' current location and mobility pattern. However, global knowledge is not available in distributed situations. Hence, we design the practical distributed algorithms with limited knowledge. In this section, we propose two distributed algorithms under fully distributed and cellular distributed situations.
6.1. TPR-Distributed Design. Compared with the global routing algorithm, the distributed algorithm further considers the actual application scenarios. So, the algorithm needs to make routing decisions utilizing incomplete knowledge of vessels and packets. In this situation, each vessel needs to have the ability to predict future contacts based on the received information and share its local information with meeting vessels. Each packet records its source node ζðpÞ, destination node ϱ p , H, and TTL. Therefore, each vessel can construct a local meeting graph in a period by exchanged information, and they can give prediction by sliding window and form the local link set Ł t in time t. When node cur meeting node v on time t c , the optimal target of packet p in one node is shown in Equation (8).
Information exchanging between vessels is vital in the fully distributed scenario. Thus, we design the data structure of exchanged information inf considering the efficiency and cost. It includes two parts: the current state sequence and prediction model, because other information, such as the evaluation table, contact graph, and future trajectory, could be calculated by these two parts.
As shown in Algorithm 1, the node n and its meeting node v both merge and update their local information. After 9 Wireless Communications and Mobile Computing that, both sides can construct a new local contact graph and form a local link set based on updated information. For each packet p in node n, p will be delivered to v, when v has greater ψ H−1 v,ςðpÞ ðt c , t c + TTLÞ. If links in the area are over link limitation, the algorithm will transfer the packet by probability rank to avoid channel collision.

TPR-Cellular Design.
Considering the cellular coverage range along the coast, we also design a cellular-based distributed algorithm called TPRCellular. Vessel within the cellular coverage area can provide communication with base stations in high efficiency. Hence, we assume the vessel in this area has the global knowledge of all the vessels. After moving out of the cellular coverage, each vessel's knowledge will stop updating. Nevertheless, they could make the routing decision based on predicted trajectory by prediction model and sliding window. Theoretically, by utilizing a sliding window, our model can endlessly predict future trajectory without considering the accuracy. So, this algorithm's routing performance will test our model's accuracy on long-term trajectory prediction. We assume that vessels do not exchange their knowledge when meeting with each other. Except for the predicted trajectory length, the TPR-Cellular algorithm is nearly the same as the global routing algorithm.

Performance Evaluation
We evaluate the performance of TPR-DTVN with metrics defined in Section 2.1. We first present the methodology for performance evaluation, introduce compared algorithms, and finally show simulation results.

Methodology and Experimental Setup.
We perform trajectory-driven simulations to evaluate the performance of TPR-DTVN compared with Epidemic, Random Walk (RW), and Community-Based Routing (CBR).
We train the trajectory model and perform a simulation experiment on a Linux server, which is based on ubuntu 18.04 with 64 core CPUs and 4 pieces of 1080ti GPUs. We use a total of 5123 vessels that had appeared from May 2015 to May 2018. The first 24 months' data train trajectory prediction models in default. For each packet, we randomly pick its source and destination pairs which have at least one contact before, because vessels that have not encountered each other barely have communication requirements. The number of packets varies from 200 to 1800. 5 simulations are carried out over 5 separate fishing months (Oct 2017, Nov 2017, Dec 2017, Jan 2018, and Feb 2018) to achieve average results. The default system parameters are shown in Table 2. 2.

Compared
Algorithms. Three compared algorithms are briefly introduced as follows: (1) Epidemic. Packets are flooded throughout the network, which provides upper bound on delivery ratio and system cost with lower bound of delay (2) Random Walk (RW). This algorithm randomly decides whether to forward a packet and randomly selects a relay if there is more than one neighbor vessel. In simulation experiments, the probability of forwarding a packet is set to 40%. This algorithm represents the algorithms without knowledge (3) Community-Based Routing (CBR) [12]. CBR utilizes vessels' historical contacts to form communities. Intercommunity betweenness centrality and familiarity are used to build a probability network for routing. This algorithm represents the algorithms with social knowledge 7.3. Comparative Results. We compare different routing algorithms' performance in delivery ratio, delay, cost, and efficiency. We vary the packet number from 200 to 1800 to simulate different network overhead. Figures 6(a) and 6(b) show six algorithms in terms of delivery ratio and average delay. The epidemic has the best performance in both metrics as expected. We can observe that TPR-Global, TPR-Distributed, TPRCellular, and CBR perform better than RW due to historical information. TPR-Global achieves a 21% higher Input:n,v,inf n ,inf v ,t cur . Variables:n: the current node; v: the meeting node; inf n ,inf v : information of node n, v; v n : stored information of node n; t cur : current time.   Figure 6(c) shows the costs of six algorithms. TPR-DTVN and CBR have a lower cost than others, because wasted data transmission is avoided with historical knowledge guidance. Figure 6(d) demonstrates the efficiency of all the algorithms. TPR-Global achieves the highest overall efficiency than the comparative algorithms. Because of the high cost of packet flooding, Epidemic's efficiency is uncompetitive. RW has the lowest efficiency due to its aimlessness. Also, TPRDistributed has a 16.25% higher efficiency than TPR-Cellular.
Although historical knowledge is different, TPRDistributed and TPR-Cellular have similar performance. Even if TPR-Cellular has the knowledge of all vessels, the vessels need to use longer prediction to get future trajectory based on its knowledge when the vessel moves out of cellular coverage. So the prediction accuracy is lower than that of TPR-Distributed. TPR-Distributed has limited knowledge, but its knowledge is up-to-date. These reasons make these two distributed algorithms have similar performance.

Impact of Communication Radius.
We compare the performance of TPR-Global, TPR-Distributed, and TPR-Cellular with different communication radius, including 10 km,15 km, and 20 km. With the decrease of communication radius, we notice that the performance in all metrics decreases in Figure 7. Delivery ratio with R = 10 km has decrease 65% than that of R = 20 km. Meanwhile, the average  11 Wireless Communications and Mobile Computing delay is twice of R = 20 km. Compared with 20 km communication radius, these algorithms' efficiency in 15 km and 10 km average decrease 72.79% and 97.11%, respectively. The reason is that the communication opportunities of R = 10 km are not enough to achieve data delivery in this vessel density. WiMAX technology can achieve maritime communication with more than 40 km communication distance, which leads to fierce channel competition. Although the shorter communication radius will have less competition, it cannot grantee routing in our scenario. Considering the performance and channel resources, we set the communication radius to 20 km in our experiment. 7.5. Impact of Data Set Usage. The size of data set usage has a direct effect on TPR-Global and two distributed algorithms due to its dependency on the accuracy of the predicted trajectory. We compare the performance of different sizes of data sets, including the recent 24, 16, and 8 consecutive months. In Figure 8, with the decrease of data set, the performance of the three algorithms has notably declined. Compared train by 24 months data set, two algorithms' efficiencies in 16 months and 8 months average decrease 26.74% and 76.19%, respectively. We thought it is because the trajectory predicts model with 24 and 16 months data can learn complete mobility pattern of four seasons. 8 consecutive months cannot  cover the mobility pattern of a season, which leads to poor performance. Therefore, we should choose more than 12 consecutive months of data to train our model to obtain excellent algorithm performance.

Relate Works
DTVN, which utilizes WiMAX to achieve vessel-to-vessel or vessel-to-coast communication, is complementary to maritime wireless mesh networks [6,23] [24]. Some studies apply fixed mobility models or encounter models for the design of DTVN routing algorithms. These algorithms are often suitable for vessels with stable mobility behavior, such as container ships, cruise ships, and wastedumping vessels. Raj et al. presume that all vessels obey the Gaussian-Markov mobility model [7]. The forwarding metrics are determined for routing on the basis of this assumption. Lanepost [25] and Mar-DTN [26] are standard graphic-based optimal routing algorithms. These algorithms   13 Wireless Communications and Mobile Computing build an opportunistic routing graph based on each vessel's fixed expected routes and use the graph for forwarding decisions. Liu et al. [27] and Qin et al. [28] study delay-tolerant routing problems in the seaway model that all vessels are moving in fixed seaways. Vessels predict the speed and arrival time based on proper models and utilize them for decisions.
Mining personalized characteristics of each node in the network are more beneficial for routing algorithm performance than fixed model [13,29,30]. Some vessels' moving patterns, like fishery vessels, are easier to be affected by objective factors, which cannot directly apply fixed models. Nodes in the network use neighbors' personalized models for routing decisions. These models need to be dynamically updated based on historical data. FBR and CBR [12] dynamically construct communities based on vessels' recent contacts. Based on unique social relationships, vessels build a probability network for efficient packet delivery.

Conclusion
This paper proposed a set of routing algorithms called TPRDTVN for efficient data transmission in vessel networks. TPR-DTVN uses a forwarding metric that characterizes the expected delivery probability of relay nodes. To address the challenge of long-term trajectory prediction, we design a Bi-LSTM-based trajectory prediction model and an evaluation method to get the practicable predicted trajectory. Then, we evaluate expected delivery probability with predicted information. Extensive trace-driven simulations show that our algorithms can achieve a higher delivery ratio with lower cost and transmission delay.

Data Availability
The data is not available.

Conflicts of Interest
The authors declare that they have no conflicts of interest.