# An Integrated DQN and RF Packet Routing Framework for the V2X Network
## 4 System Simulations and Performance Evaluations  
### Simulation Environment  
The IDRF_DQN, IDRF_DQN_RF, and IDRF algorithms introduced in this paper for decision-making were compared in terms of their performances with TDRL-RP, focusing on vehicle training for decision-making, VRDRT, focusing on road information-based decision-making, and traditional VANET routing algorithms, Epidemic and GPSR, for packet routing. Epidemic was chosen due to its broadcast-based packet forwarding method, which enables the source vehicle to obtain multiple forwarding paths from a single set of pairs. VRDRT, on the other hand, utilizes vehicle positions, distances to neighboring vehicles, and vehicle density statistics information from the dataset. Simulations were conducted using Python and NS-3. Python interacts with NS-3 and was used for DQN training, while NS-3 was used for a network simulation with environmental parameters (Table 7). In this simulation, the MAC protocol used in NS-3 was IEEE 802.11p, and the radio propagation model used was the Log Distance Propagation Loss Model. As mentioned in Section 3.1, NS-3 employed real vehicle trajectory data from Beijing city's taxi dataset, encompassing the GPS trajectories of 10,357 taxis on 2-8 February 2008. The map used in this study includes latitudes 39.89851 to 39.94923 and longitudes 116.36701 to 116.41253, forming a map with dimensions of 3880 by 5636 m. Regarding the dataset, the proposed IDRF_DQN, IDRF_DQN_RF, IDRF, and TDRL-RP algorithms were evaluated against the Epidemic algorithm using the following default simulation parameters: randomly selected pairs of 32, a TTL of 90, a message time of 1.0, and a transmission range of 425. This resulted in 1000 simulations, which were used to generate forwarding paths for the actual vehicle trajectory data from the Beijing city taxi dataset. The \(x\)-axis of the result showed the number of source-destination pairs and the transmission range. The \(y\)-axis of the simulation results showed the average packet delivery ratio, average end-to-end delay, and average overhead ratio, defined as Equations (10)-(12). The results from 1000 simulation runs were averaged. The figures were drawn with 95% confidence intervals. * Average end-to-end delay This paper defines the average end-to-end delay as follows: It is the average delay when all packets are transmitted from the source vehicle to the destination vehicle across all forwarding paths. This average delay accounts for the total delay time of all delivered packets, divided by the total number of delivered packets received by the destination vehicle. The calculation of the average end-to-end delay is performed using Equation (10). \[\textit{Average end-to-end delay}=\frac{\textit{Total end-to-end delays of all delivered packets}}{\textit{Number of delivered packets}} \tag{10}\]
* Average packet delivery ratio In this study, the average packet delivery ratio is defined as the number of delivered packets received by the destination divided by the number of packets transmitted by the source, calculated using Equation (11). \[\textit{Average Packet delivery ratio}=\frac{\textit{Number of delivered packets}}{\textit{Number of transmitted packets by source}} \tag{11}\] \begin{table}
\begin{tabular}{c c c} \hline \hline  & **End-to-End Forwarding Path** & **IDRF Total Delay Weights** \\ \hline Path 1 & \(S\to V_{3}\to V_{6}\to V_{9}\to D\) & 0.5789 + 0.1450 + 0.102480 + 0.1420 = 0.968380 \\ \hline Path 2 & \(S\to V_{4}\to V_{7}\to V_{11}\to D\) & 0.1046 + 0.0944 + 0.117164 + 0.4806 = 0.796764 \\ \hline Path 3 & \(S\to V_{4}\to V_{7}\to V_{12}\to D\) & 0.1046 + 0.0944 + 0.316440 + 0.4615 = 0.976940 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: The total delay weights for the three packet forwarding paths calculated by the IDRF.