## 3 Proposed Methodology
### Estimation of Link Delay
#### 3.3.5 Predicting Exact One-Hop Channel Delay Using Machine Learning  
We propose to use a DNN to predict the exact one-hop channel delay. The design choice of DNN for this regression task is discussed in detail in Section 5. Thus, for predicting the exact delay, the estimated average values for one-hop delay (\(\overline{\mathcal{D}_{iWL}}\) and \(\overline{\mathcal{D}_{iWI}}\)) can be provided as some of the inputs. There should be an input to select the mode (M) as wired (M = 0) or wireless (M = 1). The average queue size of node \(i\) (\(\overline{\mathcal{R}_{i}}\)) should also be provided as one of the inputs. As pointed out earlier, the error, which is the difference between the estimates (\(\overline{\mathcal{D}_{iWL}}\), \(\overline{\mathcal{D}_{iWI}}\)) and the real one-hop delay, occurs from the error in contention delay due to the average contention delay being a network global average. Thus, factors governing contention delay in a given hop should be investigated. The main factors which affect collision probability in a given hop (\(\rho\)) are similar to when it is derived for the whole network. These are listed below:* Number of links in the same communication channel connected to the hop (\(N_{iWL}\) or \(N_{iWI}\));
* Average pending transmission packet distribution factor of the node and its neighbors (\(\overline{Q_{i,nei}}\)), which can be calculated as given in Equation (34): \[\overline{\mathcal{Q}_{i,nei}}=\left\{ \begin{array}{l}\frac{\overline{Q_{i}} \sum_{j\in S_{i}}\overline{Q_{j}}}{N_{i}};\;ifN_{i}>0;\\ 0;\;otherwise.\end{array} \right.\] (34)  
In Equation (34), \(S_{i}\) is the set of one-hop neighbors of node \(i\), and \(N_{i}\) is the total one-hop neighbors of node \(i\). Furthermore, there is an error due to obtaining the average value of the propagation delay (\(\overline{t_{propj}}\)). To compensate for any error that may occur in setting equal probability for selection of each path for propagation at node \(i\), we input the maximum (\(D_{ij,max}\)) and minimum (\(D_{ij,min}\)) of link distances as inputs to the neural network, to fit the weights of the addition of maximum and minimum link distances to minimize the error. Furthermore, there can be slight errors between the delays calculated for each individual delay component's theoretical value and the practical value that occurs in the real network. For example, consider the transmission delay. We calculate transmission delay theoretically using \(t_{ran,i}=packet\;size/data\;rate\). However, the practical transmission delay can be slightly higher or lower than the theoretical value. Thus, to compensate for any error, we should input all input parameters for all average delay calculations in Equations (32) and (33) to the neural network. The following list summarizes the input parameters of the neural network to compensate for theoretical calculation errors:  
* Data packet size (\(P_{D}\)), packet size of RTS (\(P_{\textit{rts}}\)), packet size of CTS (\(P_{\textit{cts}}\)), packet size of ACK (\(P_{\textit{ack}}\)), and data rate (DR) to compensate for transmission delay errors;
* Input Short Inter-Frame Space (SIFS) to compensate for processing delay errors;
* \(E\), \(T_{c}\), \(\text{CW}_{min}\), \(T_{\textit{slot}}\), 1 th-6 th-order terms of \(\overline{p_{\textit{WL}}}\), and 1 th-6 th-order terms of \(\overline{p_{\textit{WI}}}\). The DNN for predicting one-hop total delay per communication channel is graphically illustrated in Figure 10.  
Figure 10: The structure of the deep neural network for predicting one-hop total delay per communication channel. However, in high-contention scenarios (\(\mathcal{C}\geq 0.5\)), the proposed algorithm's metric is changed to distance, as the exact delay for choosing the least delay path is difficult to predict, even when using the exact delay prediction approach given above, due to the increment of randomness in the back-off approach in high-contention scenarios.