# An Integrated DQN and RF Packet Routing Framework for the V2X Network
## 4 System Simulations and Performance Evaluations
### Different Numbers of Source-Destination Pairs for the Sparse and Congested Periods  
Figures 32-37 show the simulation results for the sparse and congested periods. The simulations involve four source-destination pairs (4, 8, 16, 32). They demonstrate the impact on the average packet delivery ratio, average end-to-end delay, and average overhead ratio across all routing methods. The source and destination vehicles were randomly selected for this number of pairs from all of the vehicles. As the number of pairs increases, the network experiences a higher concurrent packet transmission load, leading to a decline in the average packet delivery ratio for all routing algorithms and an increase in both the average end-to-end delay and the average overhead ratio. Figure 31: Cumulative rewards with different discount factors for the congested period. Figure 30: Cumulative rewards with different discount factors for the sparse period. Figure 34: The average end-to-end delay with different numbers of pairs for sparse periods. Figure 32: The average packet delivery ratio with different numbers of pairs for sparse periods. Figure 33: The average packet delivery ratio with different numbers of pairs for congested periods. Figure 32 and 33 illustrate the average packet delivery ratio with different numbers of pairs for the sparse and congested periods, respectively. Epidemic disseminates packets through broadcasting, and under the assumption of negligible overhead, it can identify  
Figure 35: The average end-to-end delay with different numbers of pairs for congested periods. Figure 36: The average overhead ratio with different numbers of pairs for sparse periods. Figure 37: The average overhead ratio with different numbers of pairs for congested periods. more transmission paths in an unknown environment. However, as the number of pairs increases, more packets exist concurrently in the network environment, increasing packet collisions and resulting in a lower average packet delivery ratio. GPSR only considers the distance between the current packet and the destination vehicle. It may select relay nodes that cannot reach the destination vehicle during forwarding. With TDRL-RP and VRDRT, no additional processing is performed when untrained real-time vehicles are incorporated, causing both algorithms to have suboptimal average packet delivery ratios. TDRL-RP employs the current vehicle position as input but fails to exhibit good adaptability to dynamic environmental changes. If the current environment differs significantly from the trained environment, such as when the current vehicle position deviates from the trained one, the decisions made by TDRL-RP fall below the performance of GPSR, even in sparse periods. Although VRDRT does not handle untrained real-time vehicles, its training process references the current vehicle positions, the distance between the RSU and a vehicle, and the vehicle density. Consequently, for sparse periods, VRDRT still outperforms GPSR, TDRL-RP, IDRF_DQN, and IDRF_DQN_RF in terms of the average end-to-end delay. VRDRT has a higher average end-to-end delay for congested periods than IDRF_DQN. The proposed IDRF_DQN algorithm only uses DQN to determine which relay nodes to use for packet forwarding without considering the approaching intersections of the possible relay vehicles and real-time new vehicles. It consistently relays packets to the vehicle determined by the DQN decision to have the highest delay weight, causing its performance to surpass that of TDRL-RP only for sparse periods and that of GPSR exclusively for congestion periods. In IDRF_DQN_RF, the combination of DQN and RF identifies new relay paths. DQN is utilized to train the weights of relay nodes, while RF recalculates the probabilities of approaching intersections. This addresses issues such as consistently forwarding packets to the vehicle with the highest delay weight calculated by DQN, the possibility for the relay to carry packets for a long time, and incomplete packet transmission between vehicles.