## 4 Implementation
### GPSR_DA Algorithm
#### 4.1.2 Angle Calculation
Subsequently, the predicted location information can be sent to the source node through data packets sent by the destination node to update its location information, establishing a location preservation relationship. Specifically, we use a cross-layer protocol interaction for location prediction. This design allows communication between different layers without necessarily passing through intermediate layers. A flow can traverse from the link layer through the other four layers to the application layer. When the destination node receives a data packet, it needs to dynamically update the predicted location information at the source node. Taking inspiration from TCP's acknowledgment mechanism, the location information is carried in the returning data packet and transmitted back to the source node. The implementation steps are as follows:

**Step I:** At the beginning of the network, the source node starts sending data packets to the destination node based on the requirements of the service flow. **Step II:** The network layer of the destination node receives the first data packet of the service flow, calculates using (15), and triggers a remote interrupt to obtain the predicted location information after time \(PT\). \[\rho=L_{(N_{k}^{\prime\prime\prime},S)}=d_{(N_{k}^{\prime\prime\prime},SD)}sin\theta. \tag{2}\]7

where \(L_{D-1}\) represents the communication range of the last-hop node that received the most recent data packet. \(L_{(D-1,D)}\) represents the distance between the last-hop node and the destination node \(D\). \(v_{D}\) represents the velocity of the destination node \(D\). **Step III:** After the destination node waits for time \(PT\), if the service flow has not ended yet, the destination node recalculates \(PT\) based on the most recently received data packet and calls the interface to obtain the predicted location information Pre_Position. **Step IV:** When the destination node detects that there is a data packet being forwarded to the source node, it encapsulates Pre_Position in the IP header of the data packet and sends it back to the source node. **Step V:** Upon receiving the data packet, the source node extracts Pre_Position from the IP header during the network layer's IP header parsing process and performs the necessary storage and update operations. Subsequently, the data packets will be routed using the updated destination node location information. ## 5 Simulation Implement

### Simulation Setting

This paper divides the network scenarios into three different scales based on the number of nodes: small-scale network scenario with 16 nodes, medium-scale network scenario with 32 and 48 nodes, and large-scale network scenario with 96 nodes to study the performance variations in different scale network scenarios. Nodes in the network scenario move along set trajectories within different ranges: a 10 km \(\times\) 10 km area is suitable for simulating small-scale network scenarios, while a 40 km \(\times\) 40 km area is suitable for simulating large-scale network scenarios. For the medium-scale network scenario, the area is chosen between 20 km \(\times\) 20 km and 30 km \(\times\) 30 km based on the number of nodes and simulation requirements. At the beginning of the simulation, the network starts broadcasting beacon messages, and the neighbor table entries of nodes are incomplete, leading to a high packet loss rate as many data packets are dropped due to the inability to find the next-hop forwarding node. Therefore, the network is unstable within the first 100 s. By 300 s, the network gradually stabilizes. The simulation is set to run from 600 s to 1000 s to evaluate network performance in a stable environment. The data channel has a speed of 2 Mbps and a communication distance of 2 km-5 km, which effectively simulates real-world network-transmission scenarios. The communication distance is adjusted based on the size of the moving area. The control channel utilizes 96 Kbps with a communication distance of 10 km-40 km.