# Flow Sensing-Based Congestion Detection for D2D Streaming on a 5G gNB
## 4 Simulation Results  
In the simulation, the total number of flow objects was set to \(N\), and 3 video on demand (VoD) sources were used as standard video clips. The VoD sources had 3000 flow objects extracted from news video and other clips. We created 10 flow blocks from B1 to B10 according to the relationship of detected flow objects. To simplify the simulation, the flow objects were assumed to have a signal-to-noise-ratio and were restricted to a maximum object size of 150 MB. The other parameters were as follows: the maximum bit stream rate wa 2.55 Mbps; the channel bandwidth was 3.5 GHz in Sub-6; the link bandwidth was 100 MHz in 3.5 GHz, and the mmWave frequency bandwidth was 28 GHz. A cell radius was less than 250 m in our campus area, and the cellular layout was set to 10 cells. The distance from the DUE and DUE, DUE and CUE was randomly distributed from 50 m to 250 m. DUEs and CUEs were assumed to be connected to the access point backbone network, considering the downlink and uplink under gNB. The simulation ran for 580 s with \(\mu\geq 0.5\), \(0<\delta<1\), and the time stamp of flow stream \(t_{s}\) was [1, 20 s]. The occupied caching rate was less than 90%, and maximum peak signal-to-noise-ratio (PSNR) was less than 35 dB. For simulation, the PSNR between the original flow object (\(i\)) and streamed flow object (\(j\)) was calculated for every combinational of \(i\) and \(j\) for \(i\leq j\). Considering the flow congestion sensing operation, the distortion reduction \(D_{i}\) for \(i\) can be expressed as follows:  
\[D_{i}=\left\{ \begin{array}{cc}d(i,j)+\sum_{j=2}^{N}d(i,j)&(i\bmod N)=1\\ d(i,j)+\sum_{j=i+1}^{N}d(i,j)-\sum_{j=1}^{N}d(i-1,j),\,\textit{otherwise}\end{array} \right. \tag{17}\]  
where \(d(i,j)\) is the \(D_{i}\) to detect the congestion degree between flow objects \(i\) and flow \(j\), and \(N\) is the number of total flow objects. Therefore \(D_{i}\) can be used to measure the optimal D2D streaming metric and estimate the performance of the client based on successfully received flow objects. The network model shown in Figures 3 and 4 with one streaming proxy server was used to measure the performance of the proposed algorithm. In the simulation, every flow object from DUEs was uplinked directly to the gNB which checks whether copied objects or flows exist. In the simulation, a generated traffic rate was set to have various sizes from 200 M to 1.5 GB. In the DUEs, the maximum timestamp was set as 20 s.  
Figure 3: 5G-based D2D streaming network model. For the simplicity of simulation, AP1 was assumed to have a DUE client networking model as shown in Figure 4. Thus, a flow object streaming service from SS was transmitted through the path R0-P1-AP1-(DUE1, DUE2)-gNB. However, another path, such as R0-P1-AP2-DUE3-gNB could be used for the flow object streaming service to DUEs. The simulation on the path R0-P1-AP1-(DUE1, DUE2)-gNB indicated a higher packet loss ratio and frequent disconnection, and thus a low throughput if congestion occurs. We analyzed the results of the proposed algorithm using the simulation parameters shown in Table 1. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline Total flow objects & 3000 \\ \hline The number of flow objects in a block & 300–500 \\ \hline Maximum block size & 5 Gbytes \\ \hline Maximum flow object size & 250 Mbytes \\ \hline Total simulation time & 580 s \\ \hline Request time interval & 2 s \\ \hline Time stamp & [1, 20 s] \\ \hline Buffer cache full & 90\% \\ \hline FV & 0 \textless{}1 \\ \hline Cell radius & 250 m \\ \hline Link bandwidth & 100 Mbps \\ \hline Noise power & \textless{}165 dBm \\ \hline SINR & 10 dB \\ \hline Average bit stream rate & 2.55 Mbps \\ \hline threshold & \(\mu\geq\) 0.5-cut \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. Figure 4: Network model for simulation. We measured the performance while changing the parameters such as the occupied capacity of buffer cache, FV, flow block, number of flow objects, and flow rate.