# An Overview of Fog Data Analytics for IoT Applications
## 6 Case Study: Fog Data Analytics in Healthcare  
Advancements in technology have significantly benefited the area of healthcare. Recent developments in IoT and healthcare have improved patient healthcare services. Healthcare services are critical; we need instant solutions to problems and real-time patient services. Smart healthcare devices are increasing significantly and generate huge amounts of data that need to be processed and analyzed in real time. Fog computing plays a vital role in managing large volumes of health data and has benefits of a reduced latency, improved energy efficiency, increased reliability, and improved energy efficiency. This case study focused on the health monitoring system using fog computing. Rather than sending the big data generated by the health devices to the cloud layer, they will be processed and analyzed at the fog layer through fog nodes (FNs) to make real-time decisions. Fog computing plays a vital role in healthcare applications: they can decrease the network's data flow and provide an improved latency, security, and preventive care to patients [141].  
In this case study, a fog-based healthcare scenario was implemented, where patient health data were collected and transferred to the fog nodes at the fog layer. These data were filtered, pre-processed, and analyzed, and real-time decisions were made for the  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline  
better treatment of the patients. Figure 8 represents the IoT-based fog-enabled model for healthcare. Patient data were collected from ECG sensors attached to the patient's body and sent to a smart gateway. Based on the criticality level of the data, the captured data were sent to either the cloud or the fog layer by the smart gateway. The data received at the fog layer will be processed and analyzed to provide timely medical treatment to the patients, reducing latency. If the gathered data are not urgent, they will be sent to the cloud for further analysis and long-term storage. The patient's health information is accessible remotely by family members and medical personnel from both the fog and cloud layers.  
The performance of the proposed fog computing model was analyzed through a simulation and experiments using the iFogSim simulator. The simulation measures latency and network utilization in cloud and fog computing environments. The physical topology in iFogSim includes various ECG sensors, fog devices, and cloud servers. The simulation was conducted with five different physical topology configurations--conf1, conf2, conf3, conf4, and conf5--with monitoring devices 4, 8, 16, 32, and 64, respectively, and measured the latency and network utilization. The monitoring devices used in the configurations had a CPU length of 1200 million instructions and a network length of 20,000 bytes. Tables 6 and 7 present the simulation results of latency and network utilization, respectively, for each configuration in the fog and cloud environment.  
\begin{table}
\begin{tabular}{c c c} \hline
**Physical Topology** & \multicolumn{2}{c}{**Latency (ms)**} \\  & **Cloud Layer** & **Fog Layer** \\ \hline Conf-1 & 221.32 & 56.32 \\ Conf-2 & 248.91 & 64.20 \\ Conf-3 & 282.45 & 66.12 \\ Conf-4 & 1352.67 & 70.65 \\ Conf-5 & 3452.77 & 90.78 \\ \hline \end{tabular}
\end{table}
Table 6: Comparison of latency.  
\begin{table}
\begin{tabular}{c c c} \hline
**Physical Topology** & \multicolumn{2}{c}{**Network Utilization (KBs)**} \\  & **Cloud Layer** & **Fog Layer** \\ \hline Conf-1 & 151.23 & 40.43 \\ Conf-2 & 168.43 & 43.95 \\ Conf-3 & 334.78 & 51.56 \\ Conf-4 & 890.67 & 108.37 \\ Conf-5 & 1098.04 & 175.46 \\ \hline \end{tabular}
\end{table}
Table 7: Comparison of network utilization.  
Figure 8: Fog data analytics in healthcare.