# 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
The second subsection discusses the obtained results and the considered performance metrics. ### Simulation Setup

For performance evaluation of the proposed system and the comprised algorithms, an event-driven simulator is developed based on [13; 18]. The simulator is implemented using Java. The system is simulated for the topology illustrated in Figure 7. The IoT network considered for the simulation purposes is the LoRaWAN, which represents the most common and efficient LPWAN network [40]. LoRaWAN is a wide range IoT network that has been used widely for many applications [41]. The main reason for considering LoRaWAN as the IoT network in the simulation is the market use since LoRa is the most used IoT network [42]. The gateway of the LoRaWAN networks is connected to an I-MEC server to enable the edge services. The main characteristics of the considered LoRaWAN and the connected I-MEC server are indicated in Table 3.

A cellular network of one cell is considered for simulation purposes, with a base station centered at the cell. The base station is connected to the C-MEC edge server to provide computing capabilities to the end-users of the cellular cell. Heterogeneous devices, e.g., smartphones and tablets, are distributed randomly among the cell with the specifications introduced in Table 4. All these devices are assumed to support a D2D interface, wi-fi direct. Wi-fi direct is selected because it is the most common D2D interface with many advantages [43]. The full battery energy of heterogeneous devices of D2D networks and 5G cellular networks is selected as that of real existing devices. HL devices are assumed to be powerful smartphones, e.g., iPhone x and tablets. These devices have a lithium-ion battery (Li-ion) with a capacity of around 3000 mAh at a rate of 3.80 volt-DC. Thus, the full battery energy of such devices is around 20 KJ, and similar steps are performed for the better assumption of the full battery energy of GW and LL devices. The channel parameters are set as in [13]. Figure 7: Topology of the simulated network. \begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline Area of the network & 10 Km \\ Number of IoT devices & 300 \\ Number of IoT GWs & 5 \\ \(f_{IoT}\) & e [0.1,5.0] GHz \\ \(f_{I-MEC}\) & e [2.0,5.0] GHz \\ \(\delta_{IoT}\) & 1.2 J/GHz \\ \(\delta_{CMC}\) & 1.2 J/GHz \\ \(P_{IoT}\) & 22 dBm \\ \(P_{S}\) & 22 dBm \\ I-MEC Storage resources & 16 GB \\ \(E_{thr-IoT}\) & 35\% \(E_{Full-Battery-IoT}\) \\ \(E_{thr-I-MEC}\) & 25\% \(E_{Full-Battery-I-MEC}\) \\ \(E_{Full-Battery-IoT}\) & 5 KJ \\ \(E_{Full-Battery-I-MEC}\) & 25 KJ \\ \hline \end{tabular}
\end{table} 
Table 3: Simulation parameters of LoRaWAN networks. The core network deploys a core network cloud with the SDN networks. The SDN networks are deployed with the same specification as in [13]. The considered OpenFlow version in the simulation process is OpenFlow 1.4 [44; 45]. For IoT networks, each IoT device is assumed to have a computing task from the defined computing tasks, illustrated in Table 5. The assumed tasks are heterogeneous and selected to cover a wide range of IoT applications. Table 6 illustrates the specifications of LL devices' tasks. Each LL device is assumed to have one of the computing tasks introduced in Table 6. Tables 7 and 8 introduce task specifications of GW and HL devices, respectively. Each GW device is assumed to have a computing task from the tasks presented in Table 7, while HL devices have one task for each device; from the tasks presented in Table 8. All considered computing tasks are equivalent to the workloads of real tasks, such as processing web pages.