# An Experimental Study on D2D Route Selection Mechanism in 5G Scenarios
## 4 System Model and Route Selection
### Delay Measurement  
The communication between a node pair incurs: (a) software processing delay \(t_{ls}^{s}\) incurred in processes (i.e., GNU radio initialization) running on RP3; (b) hardware processing delay \(t_{ls}^{h}\) incurred in data packet transmission (i.e., data packet transmission) performed by USRP; and (c) propagation delay \(t_{ls}^{p}\) incurred in wireless signal broadcast [16]. The end-to  
Figure 5: Conditions for selecting a D2D route. end delay increases with the number of hops of a D2D route, and it is the accumulated link delay of the links \(l_{n}\in L\) of a route as follows:  
\[t^{k_{k}}=\sum_{l_{n}\in k_{k}}\sum t_{l_{n}} \tag{1}\]  
where \(t_{l_{n}}\) consists of software, hardware and propagation delays as follows:  
\[t_{l_{n}}=t_{l_{n}}^{s}+t_{l_{n}}^{h}+t_{l_{n}}^{p} \tag{2}\]  
However, the propagation delay can be neglected as it is significantly lower than software and hardware delays. The presence of PUs' activities can cause a source node to change its operating channel and route, which can increase delay as follows:  
\[t^{k_{k}}=\sum_{l_{n}\in k_{k}}(\sum t_{l_{n(PU)}}+\sum t_{l_{n}}) \tag{3}\]  
where \(t_{l_{n(PU)}}\) is the link delay caused by interference with PUs' activities [50]. The PUs can be either ON (active) or OFF (idle). The duration of being active or idle follows a _Poisson_ model, and so the active time is exponentially distributed with \(\lambda_{c_{\text{C}},ON}^{PU}\), and the idle time is also exponentially distributed with \(\lambda_{c_{\text{C}},OFF}^{PU}\)[51]. The \(\Phi_{t_{c_{\text{C}},OFF}}^{l_{n}}\) determines the average channel availability of the link \(l_{n}\) at time instant \(t\), and it is expressed as follow:  
\[\Phi_{t_{c_{\text{C}},ON}}^{l_{n}}= \frac{\lambda_{c_{\text{C}},ON}^{PU}}{\lambda_{c_{\text{C}},ON}^ {PU}+\lambda_{c_{\text{C}},OFF}^{PU}} \tag{4}\] \[+\frac{\lambda_{c_{\text{C}},OFF}^{PU}}{\lambda_{c_{\text{C}},ON} ^{PU}+\lambda_{c_{\text{C}},OFF}^{PU}}\times e^{-(\lambda_{c_{\text{C}},ON}^{ PU}+\lambda_{c_{\text{C}},OFF}^{PU})^{t}}\]  
Algorithm 1 provides a general description of our route selection scheme. Algorithm 2, which is based on Algorithm 1, provides a detailed description of our route selection scheme as presented in Figure 5.  
```
1:procedureIndependent route selection
2: MC BS send available D2D routes \(k_{k}\in K\), where \(k_{1}\) has the highest priority and \(k_{k}\) has the lowest priority, to \(fc_{s}\) proactively
3:for(\(k_{k}\in K\))do
4: Select route \(k_{k}\) if it has the lowest k and OFF PU
5:if all \(k_{k}\) have ON PU then
6: Select backbone route \(k_{b}\)
7:endif
8:endfor
9:endprocedure
```  
**Algorithm 1** General description of the route selection scheme by the source node in the presence of PUsAlgorithm 2 provides more description about Figure 5. Based on PUs' activities and channel availability, the CC sends a list of available routes to the source node. Suppose the CC sends four available routes (\(k_{1},k_{2},k_{3},k_{4}\)) to the source node \(fc_{s}\). Then, the source node \(fc_{s}\) prioritizes the routes by giving a higher priority to D2D routes with no or less PUs' activities. interference. The least priority is given to the backbone route, which goes through the MC BS. The source node updates the CC and MC BS about the selected route. Please note that nodes receive route information from CC through MC BS, and so it is assumed that they do not perform channel sensing. This paper focuses on network performance analysis, rather than network performance comparison among different schemes and mechanisms. Nevertheless, the route selection scheme investigated in our experiment has incorporated various features of existing route selection scheme in 5G as follows:  
* A central controller is the decision-maker in the core network [2; 3] that manages and optimizes network resources based on network-wide information (i.e., the available routes, and the hop count, traffic, and number of white spaces of each route) [4].