# Performance Analysis of D2D Communication with Retransmission Mechanism in Cellular Networks
## 6 Numerical and Simulation Results  
In this section, we present the MATLAB simulations that were used to verify the validity of the above analytical results. The extensive simulation results are given to illustrate the behavior of the system with respect to the change in its loading parameters. The performances under different D2D density and packet arrival rates are investigated using the results of simulations and theoretical analysis. Further, we present the dropping probability of the D2D link with and without the retransmission strategy, and the optimal retransmission time was obtained by maximizing the average throughput. The major parameters in our simulation are listed in Table 1. In the following numerical results, unless otherwise stated, we considered a simulation area of 20 km \(\times\) 20 km. D2D transmitters were spatially distributed according to a homogeneous PPP with the density parameter \(\lambda_{D}\in\left\{10\ \text{users}/\text{km}^{2},20\ \text{users}/\text{km}^{2},30\ \text{users}/\text{km}^{2}\right\}\). Independent and identically distributed Rayleigh fading with unit variance was considered for all links. To validate our derived results, the simulation results were carried out and repeated for over 10,000 iterations. The simulation parameters that were based on the Monte Carlo simulation method are shown in Table 1.  
Figure 3 compares the numerical and simulation results in terms of the average queue length, average throughput, average delay, and dropping probability with varying data arrival rates and different path loss factors in D2D communications. The values of the path loss factor \(\alpha\) were 3, 3.5, and 4. Without loss of generality, we set the number of D2D links as 30 in a single cell and the maximum number of retransmission attempts \(K=3\). It can be seen that the numerical results closely coincided with the simulation results. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline time slot duration & 1 ms \\ path loss factor (\(\alpha\)) & 3, 3.5, 4 \\ cellular user transmit power & 23 dBm \\ D2D user transmit power & 20 dBm \\ the power of the additive white Gaussian noise & \(-\)104 dBm \\ packet size (\(B\)) & 100 bits \\ buffer size (packets) & 10 \\ duration of a time slot & 1 ms \\ radius of cell (\(R\)) & 500 m \\ D2D transmission length (\(r_{d}\)) & 25 m \\ SINR threshold of CUEs & 0 dB \\ density of BS (\(\lambda_{B}\)) & 1 BS/km\({}^{2}\) \\ Density of CU (\(\lambda_{C}\)) & 1 user/km\({}^{2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters of Monte Carlo simulation. CU, cellular user. Figure 3a shows that the average queue length increased with the mean packet arrival rate, and \(\alpha\) influenced the steepness of the curves. With the increase in the arrival rate, the average queue length increased and then reached the maximum buffer size. This means that the transmission ability of the D2D user was insufficient to send the packets within a time slot because of the high arrival rate. The average throughput varied with the mean arrival rate, and the path loss exponent is displayed in Figure 3b. When the arrival rate was not more than the successful transmission probability, the average throughput increased with the arrival rate. The reason was that lightly loaded D2D sent data packets without blocking the queue. When the arrival rate exceeded the transmission ability, the average throughput reached saturation, and the dropping probability sharply increased, as shown in Figure 3c, which was caused by increasing overflow dropping packets. Figure 3d is the curve of the average delay. Take \(\alpha=3\) for example: the average delay tended to be relatively flat after \(q=0.7\). The reason was that the fixed sending capability slowed the growth rate of the average delay when the queue buffer was full. Figure 3 also shows the influence of the path loss factor. Compared with \(\alpha=3.5\) and \(\alpha=4\), the average queue length for \(\alpha=3\) reached saturation more quickly.