# Enabling Heterogeneous IoT Networks over 5G Networks with Ultra-Dense Deployment--Using MEC/SDN
## 4 Energy-Aware and Latency-Aware Offloading Scheme  
In this section, the proposed offloading algorithms for subnetworks are introduced. The proposed algorithms are built based on our previously developed energy-aware and latency-aware offloading algorithm developed for multilevel MEC structure, presented in [36]. Table 2 represents the notation of all used parameters and variables. This section is divided into three subsections. The first subsection introduces the developed offloading algorithm for IoT networks, while the second subsection presents the offloading scheme developed for D2D-based networks. The last subsection provides the offloading algorithm for the MEC-based cellular system.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Notation** & **Description** \\ \hline \(Z\) & Total size of computing task (in bits) \\ \(N_{CPU-CYC-Bit}\) & CPU cycles required for bit processing \\ \(N_{CPU-CYC}\) & Total number of processing cycles, i.e., CPU cycles, required to process a computing task \\ \(T_{QoS}\) & Quality of service latency of computing task, i.e., maximum allowable latency to handle a computing task \\ \(R_{IoT}\) & Resources of the IoT device allocated for a computing task \\ \(R_{LL}\) & Resources of the LL device allocated for a computing task \\ \(R_{GW}\) & Resources of the GW device allocated for a computing task \\ \(R_{HL}\) & Resources of the HL device allocated for a computing task \\ \(R_{I-MEC}\) & Resources of the I-MEC server allocated for a computing task \\ \(R_{C-MEC}\) & Resources of the C-MEC server allocated for a computing task \\ \(f_{IoT}\) & Total resources of the IoT device \\ \(f_{LL}\) & Total resources of the LL device \\ \(f_{GW}\) & Total resources of the GW device \\ \(f_{HL}\) & Total resources of the HL device \\ \(f_{I-MEC}\) & Total resources of the I-MEC server \\ \(f_{C-MEC}\) & Total resources of the C-MEC server \\ \(\delta_{IoT}\) & Energy consumed per CPU cycle of the IoT device \\ \(\delta_{LL}\) & Energy consumed per CPU cycle of the LL device \\ \(\delta_{CW}\) & Energy consumed per CPU cycle of the GW device \\ \(\delta_{HL}\) & Energy consumed per CPU cycle of the HL device \\ \(\delta_{I-MEC}\) & Energy consumed per CPU cycle of the I-MEC server \\ \(\delta_{C-MEC}\) & Energy consumed per CPU cycle of the C-MEC server \\ \(E_{thr-IoT}\) & Energy threshold level of the IoT device \\ \(E_{thr-II}\) & Energy threshold level of the LL device \\ \(E_{thr-GW}\) & Energy threshold level of the GW device \\ \(E_{thr-HL}\) & Energy threshold level of the HL device \\ \(E_{thr-I-MEC}\) & Energy threshold level of the I-MEC server \\ \(E_{thr-C-MEC}\) & Energy threshold level of the C-MEC server \\ \(E_{C-IoT}\) & Energy of the IoT device after local execution \\ \(E_{C-IL}\) & Energy of the ML device after handling the requested task \\ \(E_{C-IL-MEC}\) & Energy of the I-MEC server after handling the requested task \\ \(E_{C-C-MEC}\) & Energy of the C-MEC server after handling the requested task \\ \(E_{L-exec-IoT}\) & Total energy required for local execution of current computing task at the IoT device \\ \(E_{I-exec-LL}\) & Total energy required for local execution of current computing task at the LL device \\ \(E_{I-exec-CW}\) & Total energy required to execute a computing task at the GW device \\ \(E_{I-exec-HL}\) & Total energy required to execute a computing task at the H-L device \\ \(E_{I-exec-MEC}\) & Total energy required to execute a computing task at the H-MEC server \\ \(E_{I-exec-MEC}\) & Total energy required to execute a computing task at the I-MEC server \\ \(E_{IoT}\) & Energy of the IoT device before local execution \\ \(E_{LL}\) & Energy of the LL device before local execution \\ \hline \hline \end{tabular}
\end{table}
Table 2: Key annotation.