## 4 Implementation
### GPSR_DA Algorithm
#### 4.1.2 Angle Calculation
_(b) Average packet loss rate_

Figure 7 depicts the average packet loss rate of the four routing methods in different scenario scales. As the number of nodes increases from 16 to 32, the packet loss rate gradually decreases for all four routing methods. When the number of nodes increases from 32 to 48, the packet loss rates of SD-GPSR and GPSR continue to decrease, while AODV and SD-MANET start to experience an increase in packet loss rate. Finally, when the number of nodes increases from 48 to 96, the packet loss rates of all four routing methods increase again. In smaller-scale scenarios, where the number of nodes is sparse and the available next-hop nodes for forwarding are limited, it is prone to data packet loss. GPSR and SD-GPSR employ a greedy forwarding strategy, which can easily result in packet loss due to the phenomenon of routing voids. On the other hand, the other two routing methods calculate from a global perspective, resulting in lower packet loss rates compared to SD-GPSR and GPSR. As the scenario scale gradually increases, the number of available next-hop nodes increases, making it easier to establish routing paths. Therefore, the packet loss rates of

Figure 6: Comparison of control costs in different scenarios. SD-GPSR and GPSR decrease over time. However, in the case of SD-MANET, the loss of topology update messages during network operation leads to a higher packet loss rate. Similarly, AODV also experiences decreasing stability of routing paths due to an increase in the number of forwarding hops, resulting in an increase in packet loss rate. Figure 8 compares the average end-to-end delays of the four routing methods in different scenario scales. As the scenario scale increases, the average end-to-end delay of GPSR is initially high at 16 nodes, but it decreases when the scenario scale reaches 32 nodes. However, it gradually increases with the increase in the number of nodes. On the other hand, the average end-to-end delays of AODV, SD-MANET, and SD-GPSR also increase gradually with the increase in the number of nodes. With the increase in the number of nodes, all four routing methods experience an increase in forwarding hops. In the forwarding process of SD-MANET, data forwarding can be quickly accomplished through flow table matching. However, due to the increase in forwarding hops, the flow table becomes invalidated more frequently, resulting in a gradual increase in latency. In the scenario of 16 nodes, GPSR experiences higher end-to-end latency due to the occurrence of numerous routing voids caused by sparse node distribution during path selection. However, as the number of nodes increases, the available nodes in the forwarding process also increase, reducing the frequency of routing voids and enabling

Figure 8: Comparison of average end-to-end delay in different scenarios. Figure 7: Comparison of average packet loss rate in different scenarios. fast packet forwarding. But as the scale of the scenario increases, the number of forwarding hops also increases, making it easier for packets to experience significant latency due to expired location information during the forwarding process. However, since the number of packets encountering this situation is relatively small, the average end-to-end latency is not expected to be very high. In SD-GPSR, with the increase in the number of nodes, there may be initial delays due to the inability to obtain accurate destination node location information, resulting in back-and-forth packet exchanges between the controller and nodes. Furthermore, an increase in the number of forwarding hops during route selection leads to a slight increase in the latency of path calculation in SD-GPSR. As a result, its average end-to-end latency gradually increases and remains higher than the latencies of SD-MANET and GPSR. In AODV, as the number of nodes increases, the number of forwarding hops along the routing path also increases. Once a node becomes unavailable, it requires rediscovering a new routing path, resulting in a gradual increase in average end-to-end latency.