# Enabling Heterogeneous IoT Networks over 5G Networks with Ultra-Dense Deployment--Using MEC/SDN
## 4 Energy-Aware and Latency-Aware Offloading Scheme
### Energy-Aware and Latency-Aware Offloading Algorithm for Cellular Network
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Cell radius & 1 km \\ Number of LL devices & 30 \\ Number of GW devices & 10 \\ Number of HL devices & 5 \\ \(f_{LL}\) & \(\epsilon\) [0.1,5.0] GHz \\ \(f_{CW}\) & \(\epsilon\) [0.5,1.0] GHz \\ \(f_{HL}\) & \(\epsilon\) [1.0,2.0] GHz \\ \(f_{\text{C-MEC}}\) & \(\epsilon\) [4.0,10.0] GHz \\ \(f_{\text{C-networks}}\) & \(\epsilon\) [10.0,30.0] GHz \\ \(\delta_{LL}\) & 1.2 J/GHz \\ \(\delta_{GW}\) & 1.15 J/GHz \\ \(\delta_{HL}\) & 1.1 J/GHz \\ \(\delta_{\text{C-MEC}}\) & 1.0 J/GHz \\ \(P_{LL}\) & 22 dBm \\ \(P_{CW}\) & 22 dBm \\ \(P_{HL}\) & 22 dBm \\ D2D distance & 20–80 m \\ C-MEC Storage resources & 64 Gb \\ \(E_{\text{Hr-LL}}\) & 30\% \(E_{\text{Full-Battery-LL}}\) \\ \(E_{\text{Hr-GW}}\) & 30\% \(E_{\text{Full-Battery-GW}}\) \\ \(E_{\text{Hr-HL}}\) & 30\% \(E_{\text{Full-Battery-HL}}\) \\ \(E_{\text{Hr-C-MEC}}\) & 20\% \(E_{\text{Full-Battery-C-MEC}}\) \\ \(E_{\text{Full-Battery-LL}}\) & 8 KJ \\ \(E_{\text{Full-Battery-GW}}\) & 14 KJ \\ \(E_{\text{Full-Battery-HL}}\) & 20 KJ \\ \(E_{\text{Full-Battery-HL}}\) & 100 KJ \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Simulation parameters of the radio access network (RAN) of a cellular network. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Task** & **Task (1)** & **Task (2)** & **Task (3)** & **Task (4)** & **Task (5)** \\ \hline \(Z\) (KB) & 0.5 & 0.6 & 0.7 & 0.8 & 0.9 \\ \(T_{\text{QQ51}}\) (ms) & 1.0 & 1.0 & 1.1 & 1.1 & 1.2 \\ \(T_{\text{QQ52}}\) (ms) & 1.5 & 1.6 & 1.7 & 1.8 & 1.9 \\ \(T_{\text{QQ53}}\) (ms) & 2.0 & 2.2 & 2.4 & 2.6 & 2.8 \\ \hline
**Task** & **Task (6)** & **Task (7)** & **Task (8)** & **Task (9)** & **Task (10)** \\ \hline \(K\) (MB) & 1.0 & 1.1 & 1.2 & 1.3 & 1.4 \\ \(T_{\text{QQ51}}\) (ms) & 1.3 & 1.4 & 1.4 & 1.5 & 1.5 \\ \(T_{\text{QQ52}}\) (ms) & 2.0 & 2.2 & 2.4 & 2.6 & 2.8 \\ \(T_{\text{QQ53}}\) (ms) & 3.0 & 3.1 & 3.2 & 3.3 & 3.4 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Task specifications of IoT networks. Two main scenarios are considered for the performance evaluation. In the first scenario, the effect of QoS latency, \(T_{\text{QoS}}\), is checked. Three cases are considered for this case; in each case, a certain value of QoS latency is assumed. The first case, case 1, represents the minimum latency, which corresponds to the ultra-low latency applications. In the second case, case 2, the QoS latency is assumed to be higher than that of case 1. This facilitates local executions, even if the resources are limited. The last case, case 3, is set for the highest value of QoS latency. These cases are deployed for both IoT, and D2D enabled 5G cellular cells. The second scenario is introduced to evaluate the effect of introducing MEC servers to the edge of the IoT networks and also to the edge of the 5G cellular system. Two main cases are considered in this scenario; the first case, case I, is introduced to evaluate the effect of introducing I-MEC servers. In this case, the I-MEC servers are removed, and the percentage of blocked tasks is measured without deploying I-MEC servers. Furthermore, the percentage of blocked tasks is remeasured with the proposed MEC-based structure, where the I-MEC and C-MEC servers are deployed. The percentage of blocked tasks are compared in both systems to evaluate the effectiveness of introducing I-MEC servers. The second case, case II, is considered for evaluating the effectiveness of offloading computing tasks to GW and HL devices. Furthermore, the effect of adding C-MEC server for D2D-based 5G system. Four systems are considered in this case. The first, system A, is the proposed system structure, with GW, HL and C-MEC. The second system, system B, is the same as the proposed structure, without deploying GW devices. GW devices are considered LL devices. The third system, system C, removes HL devices and all other devices and structures remain the same. For this system, all GW and HL devices are