Fog Computing-Based IoT for Health Monitoring System

Wireless sensor networks (WSNs) are widely used in the area of health informatics. Wireless and wearable sensors have become prevalent devices to monitor patients at risk for chronic diseases. This helps ascertain that patients comply by the treatment plans and also safeguard them during sudden attacks. The amount of data that are gathered from various sensors is numerous. In this paper, we propose to use fog computing to help monitor patients suffering from chronic diseases such that the data are collected and processed in an efficient manner. The main challenge would be to only sort out context-sensitive data that are relevant to the health of the patient. Just having a simple sensor-to-cloud architecture is not viable, and this is where having a fog computing layer makes a difference. This increases the efficiency of the entire system, as it not only reduces the amount of data that is transported back and forth between the cloud and the sensors but also eliminates the risk that a data center failure bears with it. We also analyze the security and deployment issues of this fog computing layer.


Introduction
With each passing day, the way the world interacts changes.The past few years have seen an increase in the usage of cloud computing for a huge number of applications.But now, the cloud does not cater to just simple applications and technological needs; the Internet of things (IoT) is proving to be the next technological trend when it comes to cloud computing.In healthcare applications, wireless sensor networks (WSN) have started playing a huge role in the way patients are being monitored.Wireless sensors in the form of wireless wearable accessories or devices are attached to a patient such that this information can be used for the monitoring process.The sensors can be of various forms and sizes [1,2] as long as they are relevant to the need.
The wireless sensor networks generate a huge amount of data.These data that have been collected from all the devices connected to the network may be useful as well as redundant.All these unprecedented amounts of data can overwhelm the data storage systems and the data analysis applications.The weeding out of irrelevant data has to be a context-sensitive process.Hence, the sensors would have to send the data collected to computing devices that are capable of performing tasks of analysis, aggregation, and storage.In many cases, each patient requires a high number of sensors, and hence, creating an infrastructure dedicated to an individual becomes inefficient.Hence, IoT provides an alternative approach in which sensor devices are used in a common infrastructure.These sensor devices can then forward the data to a cloud server.
For many healthcare applications, having a simple sensor-to-cloud architecture is not viable, especially due to the fact that most hospitals would not prefer patient data to be stored outside [3].Also, there is always the bleak case of there being a network failure or a data center failure, which puts patients' health at risk.This is where fog computing aids healthcare applications.
Using only the cloud may cause delay during the transfer of data from the sensors to the cloud and the cloud to the hospitals or personal physicians.In healthcare, we have emergency response systems that require real-time operations in which efficiency and time play an important part; this may suffer due to delay caused by the cloud [4].Hence, transfer of such immense amounts of data back and forth is not an efficient option not only due to latency issues but also due to security.The risks involved here are not only infringement of data but also risks to the health of patients.Hence, the classical centralized cloud computing architecture has to be extended to a distributed one.A distributed architecture refers to tasks being divided and then offloaded to more than one node.This is commonly referred to as edge computing.
In edge computing, the main computationally intensive operations are performed at the edge of the network instead of holding it in the cloud or on a centralized data warehouse.Edge computing uses computing resources near IoT devices for local storage and preliminary data processing.According to Cisco [5], by 2020, 50 billion devices will be connected to the Internet.Hence, edge computing will also require greater flexibility in order to manage this huge influx of devices.Edge devices cannot handle multiple IoT applications competing for their limited resources, which results in resource contention and increases processing latency.A distributed feature added to this will help in scalability and reduces the risk of exposure of data and hence increases security and eliminates most of the privacy concerns [6].
A fog computing layer integrates edge devices with cloud resources and hence extends the existing cloud infrastructure [7].In this architecture, the application resides not only in the cloud but also in the devices closest to the patients and the infrastructure components between them.The term infrastructure refers to access points, gateways, and routers.The main objective of healthcare applications is to provide constant supervision on the health of a patient.Implementing this fog layer provides for the successful fulfillment of this requirement.Also, due to the fact that data are stored in data centers in the cloud, the problem of infrastructure, maintenance, upgrades, and costs is solved.
In this paper, we strive to improve current healthcare systems by implementing a context-sensitive fog computing environment.We discuss the various computational tasks involved in healthcare that will be performed in the fog layer, the cloud, or at the user devices and sensors.The security of the information passing the system will be improved as the exposure of data is limited due to the fact that it does not have to travel to and fro in the network.The services that the cloud performs can be distributed to other nodes in such a way that the overhead time taken for data to go back and forth from the cloud to devices is compensated or reduced.Distributing the services among various nodes overcomes some of the challenges that previous healthcare monitoring applications have faced.
The remainder of the paper is organized as follows.In Section 2, we discuss about fog computing, the expectations, and various challenges that have to be faced in the process of implementing fog computing in healthcare.The proposed research is discussed in Section 3. Section 4 analyzes the proposed scheme and the experimental results obtained.The conclusion to the work is given in Section 5.

Related Work
In this section, we discuss the various technologies that will be used in the proposed research.Also, the research already done in this area will be reviewed in the upcoming subsections.
2.1.Fog Computing.Fog computing is highly virtualized and provides a medium for computing, storage, and networking between end devices and the cloud [7].The main notion of fog computing is to migrate the tasks of data centers to fog nodes situated at the edge of the network.We refer to these fog nodes as the fog layer.As these devices that perform the tasks are at the edge of the network, it results in a higher data transfer rate and a reduced user response time.
Figures 1 and 2 show the architecture of a simple fog layer with respect to the cloud and the sensors.

Research in Fog
Computing.The main applications where fog computing will prove very useful are time-sensitive applications where a huge amount of data has to be processed [8].
The following are the application areas that can benefit from fog computing.
(1) Healthcare applications: this is an area in which realtime processing plays an important role.Hence, data will have to be processed very fast, and the response time will have to be as less as possible [4,9,10].

Cloud Fog layer
Sensors (2) Augmented reality: for augmented reality (AR), overlaying useful information onto the physical world in real time is very important.Using fog computing will help achieve this aspect of augmented reality [11].
(3) Smart utility services: utility services like electricity, water, telephone, and so on can be managed by fog computing.
(4) Traffic management system: fog computing can increase the efficiency of the traffic signal system by reducing the latency.The interactions between vehicles, traffic signals, and access points can be enhanced by the fog [12].
(5) Caching and processing: fog computing can also be used for improving the performance of websites [13].Certain websites have a lot of databases and data to be processed, for example, social networking sites and library or online shopping malls.These websites can use the fog layer for caching and preprocessing its data and hence reducing time and space complexity.
(6) Gaming: in the past few years, there has been a huge evolution in the gaming industry.Apart from games being computationally complex, they are mostly multiplayer these days and depend greatly on real-time processing.
(7) Decentralized smart building control: similar to smart utility services, even in the case of smart building, control fog computing will play a huge role in making it more efficient and secure.
Fog computing offers enormous advantages for delaysensitive fog-based application.Chen et al. [14] implemented a prototype of a smart gateway for the use of WSN in healthcare systems at home.The system is able to transmit reports at real time in a low power embedded system.Hong et al. [15] presented Mobile Fog, which is a programming model for Internet applications that are geographically distributed and latency-sensitive.

Motivation.
The use of smart devices has fortuitously been exercised in healthcare.These days, it is commonplace to find a range of healthcare gadgets that can be used by patients at home or even worn by them.The gadgets mostly encompass sensors.These sensors generally incorporate transducers and are capable of detecting electrical, thermal optical, chemical, and other signals [10].
The main motivation of this paper is to enhance health monitoring systems that are based on IoT devices such that the information collected from WSNs are processed efficiently, and the context-sensitive data that are relevant to the patient are considered.For this, we implement a fog layer that improves the latency of health monitoring systems and enables real-time health monitoring.By this, we strive to also ensure security for the information of the patients such that patient privacy is maintained, and also, tampering of data by third party is avoided.
2.4.Key Objectives of Healthcare Systems.Some of the key objectives of healthcare systems are [16] (1) improved clinical decision making, (2) reduced duplication of diagnostic testing, imaging, and history taking, (3) better medication management, (4) increased adoption of screening programs and preventive health measures.

Challenges in Implementing a Health Monitoring System.
In order to successfully implement a health monitoring system, a number of challenges have to be addressed [16]: (1) Safeguarding privacy and security (2) Technical problems (3) Organizational barriers (4) Financial costs (5) Different policies (6) Training programs for practitioners and healthcare providers

Proposed Research
In this section, we present a tri-tier architecture for contextand latency-sensitive health monitoring using cloud and fog computing.The tri-tiers consist of cloud computing, fog computing, and sensors which work in conjunction with one another.Sensors consist of wearable or not wearable devices that are attached to the patients in the form of smart watches, fitness bands, smart phones, wearable glasses, and so on.The applications used for health monitoring will have components running in the edge devices situated in the fog layer, the wearable sensors, or the cloud.The edge devices may be controlled by the cloud and the fog layers.Information will flow across this tri-tiered infrastructure.
In context-sensitive health monitoring, personalized care can be given to each patient.Context can be classified into extrinsic and intrinsic context.In case of healthcare, extrinsic context is influenced by external factors like the environment that is surrounding the patient.Environmental sensors can be used to extract the extrinsic parameters of a user, and the intrinsic context can be extracted by biosensors.Both intrinsic and extrinsic sensors provide relevant information that may be used for monitoring patients' health.But depending on the disease of the patient, the type of data that is relevant differs.Hence, maintaining context-sensitive data processing has to also be done by the fog layer.
The schematic diagram of the proposed architecture is given in Figure 3.In this architecture of context-and latency-sensitive health monitoring systems, we ensure that all the key objectives of health monitoring and more are all accomplished.
3.1.Sensors Tier.These are the devices that gather information from the patients.These sensors gather both extrinsic and intrinsic values.Extrinsic characteristics are the temperature, location, and so on.Intrinsic characteristics are the blood pressure, blood glucose level, heartbeat, and so on that are collected by the patient's wearable sensors.The patient can also enter data into his or her smart phone, and these data will then be made available for processing.The job of the sensors is to collect all this data and send them to the fog computing layer.

Fog
Computing Tier.This layer performs data analysis and aggregation of the data.The data and information collected by the edge devices are analyzed in this layer.This layer behaves as the server.Massive amounts of real-time data from sensors are sent to this tier.The fog layer then distributes the processing work to various edge devices connected to the fog layer, and hence, massive amounts of data are analyzed.The distribution of the processing work has to be done using an efficient task-scheduling algorithm.
(1) Work distribution: this task is performed via the smart gateway using a scheduler.In this paper, we distribute the tasks using the task-scheduling mechanism for cloud-fog computing systems introduced by Pham and Huh [17].Two graphs are first created: task graph and processor graph.Figure 4 gives a graphical representation of the task and processor graphs.
Let G = V, E represent the task graph, where G is a directed acyclic graph (DAG); V is the set of vertices v 1 , v 2 , … , v n that denote the parallel subtasks, and E is the set of edges where each edge e ij ∈ E implies that task v i has a corresponding workload w i that signifies the amount of work to be processed at a particular resource.Every edge e ij has a corresponding weight c ij which represents the amount of data that is transferred from v i to v + i.
Let H = R, L be a DAG that represents the processor graph, where R denotes the set of vertices P 1 , P 2 , … , P n where each P i ∈ R is a processor at the cloud or fog.The edge l ij ∈ L denotes a link between processor P i and P j .Now, R = N cloud U N fog , where N cloud and N fog denote the set of cloud nodes and fog nodes, respectively.
The priority of computing a particular task is calculated as where w v i = w v i /w v i , and c e ij = c ij /BW; also, BW is the bandwidth.

4
Journal of Sensors Once the priority for the various tasks has been calculated, these tasks are sent to nodes for execution.Now the choice of the nodes to do a particular task has to be figured out.For this, the time required by the processor at each node and the processing speed have to be taken into consideration.The earliest start time and earliest finish time will be used for making those calculations.For more details, please refer to the paper by Pham and Huh [17].
(2) Data aggregation: once tasks are distributed, the data have to be aggregated.Data aggregation consists of three main parts: schema mapping, duplicated detection, and data fusion.Schema mapping will ensure that the data are aggregated in such a way that it makes sense, and there is a flow to the data.Duplicated detection ensures that there will not be any redundancy in the data.Redundancy is a challenge because there are many nodes that perform the work, as a result, there may be overlap in data.Apart from duplicate detection, false data injection is also avoided to ensure security in the fog device.This is implemented by adding a local filter to the fog device.Data fusion is the final stage of data aggregation in which the final information is gathered and put together as one entity.

Cloud
Computing Tier.This is the layer that manages the various actions that are to be performed by the health monitoring system.A component of the monitoring app runs on the sensors which enables the sensors to collect data and send it to the fog layer.The decision of what task to perform is done with the help of the fog layer as described in the previous subsection.The cloud computing tier constantly supervises the health monitoring system.

Health Monitoring System.
Apart from the various tiers described above, the healthcare delivery system typically consists of four levels: the region, the institution, the clinical department or outpatient clinic, and the individual physician, nurse, or patient [18].The flow of information between these four levels has to be efficiently managed.Hence, there are many important privacy and security challenges that have to be met.

Experimental Results and Analysis
In this section, we discuss the experiments performed so far and the analysis of the proposed system.
4.1.Simulation of the Fog Environment.For the purpose of comparing the use of fog computing versus just using the traditional cloud computing in healthcare, we used iFogSim toolkit to simulate the fog network [19].
The iFogSim simulates the specified configuration and gives the simulated outputs.This makes it convenient to observe end results when all required technology is not available.The simulator itself adds a bit overhead time.For this simulation, we conducted several test runs for 5 configurations of monitoring devices.
The average latency and network usage for the 5 configurations are given in Table 1.The table shows that the configurations of connected devices do not really affect the latency of our architecture that uses fog computing.The network usage of the architecture with fog computing is much lower than the architecture that uses only fog computing.The iFogSim toolkit is used to simulate the 5 different configurations.For each of the 5 configurations, the monitoring devices are varied.In Config 1, Config 2, Config 3, Config 4, and Config 5, they each have 4, 8, 16, 32, and 64 monitoring devices, respectively.So each configuration will give different results when simulated.The monitoring devices used in the configurations have a CPU length of 1000 million instructions, a network length of 20,000 bytes, and an average interarrival time of 5 ms.Figures 5 and 6 give the comparison of the latency and network usage for the various configurations.The simulation of configurations that use only the  cloud is done using the CloudSim toolkit, and those that use the cloud in conjunction with the fog layer is done using the iFogSim toolkit.From both the charts, we can observe that the complexity of the fog layer does not affect the latency or the network usage.In fact, fog computing increases the efficiency of the entire system.From Table 1, we can observe that using fog layer indeed decreases the latency and network usage when compared to using only cloud computing.Figure 7 shows the energy consumption of fog computing versus only using the cloud.From the figure, it can be analyzed that the energy consumption for fog computing mainly takes places at the edge where most of the processing is done.On the other hand, in the case of cloud computing, the energy is mainly spent at the data centers or at the cloud.

Analysis
4.2.1.Latency.In our implementation of fog computing in health informatics, there will be transfer of data among the various tiers.The amount of data and the time taken will differ in different cases.Hence, the latency differs.Let us consider L f as the latency when the evaluated data has to be returned to the IoT devices and L e be the latency when the data is sent to the cloud.Then, In the above equations, t s is the time taken from IoT sensors to the fog layer; t r is the time taken for the data to return from the fog layer to the IoT devices; e f is the evaluation time taken by the edge devices; and e e is the evaluation time taken at the cloud.
These two equations will be used by us to analyze the latency times.This is very important because most applications of fog computing rely on the real-time processing capabilities of the network.

Computation.
The computations in the fog layer should be real-time and latency-sensitive services.Many techniques for reducing the computation complexities have to be adopted.The data packets can be stored at the fog nodes for some time to avoid reloading of the same data.According to some renewal algorithms, these data packets may be replenished by new data packets.Intelligently, distributing data packets to the most efficient number of edge devices also plays a very important role.

Security Analysis.
Introducing a fog layer into the cloud computing infrastructure reduces the security risk when it comes to data of the patients not getting lost due to failure in a data center.But at the same time, the data is stored in the cloud.This increases the threat to the privacy of patient information.In this scheme, we propose to secure the data of the patient by encrypting the data of the patient using a secret key.

Conclusion
With increase in the use of the IoT, there is a huge demand for data to be processed in real time and efficiently.The  The work shown in this paper is a work in progress.There are many factors that have hindered and slowed down our implementation process.These factors include not readily available software, complexity, and so on.In spite of all these obstacles, the research area is a very promising one and when implemented will prove to be a very useful technology.The future work is to deploy this system to various edge devices and judge the behavior of the system.

Figure 4 :
Figure 4: Graphical representation of the task and processor graphs.

Table 1 :
Comparison of percentages.