SMS: A Secure Healthcare Model for Smart Cities

: Technological innovations have enabled the realization of a utopian world where all objects of everydaylife, aswellashumans, areinterconnectedtoforman“InternetofThings(IoT).”Theseconnected technologies and IoT solutions have led to the emergence of smart cities where all components are converted into a connected smart ecosystem. IoT has envisioned several areas of smart cities including the modern healthcare environment like real-time monitoring, patient information management, ambient-assisted living, ambient-intelligence, anomaly detection, and accelerated sensing. IoT has also brought a breakthrough in the medical domain by integrating stake holders, medical components, and hospitals to bring about holistic healthcare management. The healthcare domain is already witnessing promising IoT-based solutions ranging from embedded mobile applications to wearable devices and implantable gadgets. However, with all these exemplary benefits, there is a need to ensure the safety and privacy of the patient’s personal and medical data communicated to and from the connected devices and systems. For a smart city, it is pertinent to have an accessible, effective, and secure healthcare system for its inhabitants. This paper discusses the various elements of technology-enabled healthcare and presents a privacy-preserved and secure “Smart Medical System (SMS)” framework for the smart city ecosystem. For providing real-time analysis and responses, this paper proposes to use the concept of secured Mobile Edge Computing (MEC) for performing critical time-bound computations on the edge itself. In order to protect the medical and personal data of the patients and to make the data tamper-proof, the concept of blockchain has been used. Finally, this paper highlights the ways to capture and store the medical big data generated from IoT devices and sensors.


Introduction
The amalgamation of computer science, electronics, and other related technologies has created a synergistic relationship leading to the birth of one of the most prominent technologies branded as the "Internet of Things (IoT)" [1]. The advances in ICT and the emergence of IoT have attracted interests of researchers across the globe and helped in the realization of smart city ecosystems. Since the time IoT was first coined, there have been numerous researches in this field ranging from its application areas to implementation challenges and issues. Today, IoT has been imprinted in almost every area of computing, leading to the concept of "Smart-Environment", where all the participating objects are interconnected and are capable of sensing, storing, communicating, and sharing information [1]. The advancement in ICT and networked technologies like Bluetooth, Wi-Fi, 3G/4G/5G, NFC/RFID, LiFi, and Smart dust has further expanded this concept [2]. It has also enabled humans to be an active part of the network as one of the primary entities.

Paper Organization
The paper is organized into five sections. The second section highlights the need for transition from the cloud to the edge paradigm, which is a necessity for this type of system. It defines the concept of MEC along with the security vulnerabilities associated with it. The third section gives an overview of the past researches in the area. Several existing "state-of-the-art" approaches for smart healthcare systems are reviewed in this section. This section also identifies the research gaps in the existing literature and the motivation for the current paper. The fourth section provides details about the proposed approach along with the various components of the system, their significance, and usage. The section also introduces the mechanism to secure edge and IoT devices from possible vulnerabilities attacks. The final section provides the conclusion and discusses the future scope of the smart healthcare systems.

Main Contributions
The manuscript proposes an MEC-based healthcare system for smart cities. The main contributions of the paper include: • Identifying the limitations of classical healthcare systems and their inapplicability in smart cities ecosystems.

•
Identifying the need for transitioning from the cloud to edge and the role of mobile edge computing in providing real-time healthcare services. • Identifying security vulnerabilities in MEC and the possible solutions.

•
Proposing a smart healthcare model for smart cities based on MEC, IoT, and blockchain consensus mechanisms for the reliable, faster, secured, and transparent interconnection of participating entities of the healthcare system.

Need for Transition from Cloud to Edge in a Smart City Ecosystem
The penetration of IoT in everyday lives for providing smarter solutions has resulted in the generation of large volumes of data. With such large volumes of data at our disposal, cloud computing (CC) has emerged as one of the preferred choices for IoT solutions. Cloud computing became jargon in the year Electronics 2020, 9, 1135 3 of 18 2006, when it was introduced to the world. The term cloud computing further gained popularity in the following years after it was widely used by the tech giants like Amazon, Microsoft, IBM, etc.
The two technological breakthroughs of the modern world, i.e., IoT and cloud computing, have always complemented each other for efficient results. However, the centralized structure of cloud computing has proven to be a limitation for providing solutions in cases where components are geographically dispersed. Edge Computing (EC) was born to meet this challenge by allowing some of the processing to be done at the network nodes that can be either "centralized" or "distributed" or at the "end of the network," creating the "edge nodes" and contributing to distributed processing. Since its inception in 2005, cloud computing has emerged as a breakthrough technology that brought transformational changes in the way business were run. CC has provided an efficient and cost-effective way to store and process the data in a centralized cloud repository. However, the centralized storage structure is not able to keep up with the increasing demand for the real-time processing of data [9][10][11]. To address this increasing demand for minimizing the latency, edge computing can provide potential solutions by providing processing capabilities at the "edge of the network", thus minimizing the overhead caused by the speed of the data transformation and latencies [12][13][14].

Mobile Edge Computing (MEC)
"Mobile Edge Computing (MEC)" is a computing paradigm wherein the data are processed in close proximity to its original source of generation. MEC involves a distributed intermediate server having some compute, storage, and networking facilities to handle the real-time processing of data for producing fast and instant results. The data that require real-time processing can be easily handled by such intermediate servers to provide instant results. What is important to mention is that, as of 2019, 45% of the data created under IoT solutions is expected to be stored and processed at network edges [15]. One of the main features of EC is the ease of adoption to multi-component and peripheral scenarios, which is commonly found in IoT solutions [11]. In the EC architecture, we assist a part of the processing and storage resources to be at the edges, near sensors or mobile devices, allowing for "agile-connectivity," "real-time services," "data optimization," "security," and "privacy." Real-time response, low latency, reduction of network traffic, storage, energy consumption, and bandwidth cost are some of the advantages that can be pointed out to the EC paradigm [10]. The need to adopt a different paradigm from cloud computing to current and future IoT solutions is mainly due to three reasons:

•
The large amount of data generated at the edges of the network (sensors, devices, etc.) requires, in a cloud architecture, the transmission of a large amount of data across the network, which is the origin of the bottleneck that is currently seen in the cloud paradigm. If we use the example of a Boeing 787, which is estimated to generate 5 gigabytes of data per second, it is easy to conclude that a system using the cloud paradigm will not scale to support such or similar situations [16]. • Data producers in an IoT solution (such as sensors, mobile devices, traffic lights, lights, appliances, etc.) will grow exponentially and reach billions in the coming years. In a cloud computing architecture, data consumers obtain the information they want after requesting it to the cloud, which will no longer be possible considering the amount and increasing number of data producers.

•
In today's scenarios with the proliferation of mobile devices and even other wearables, data consumers will also act as producers of data (uploading and sharing multimedia contents) and hence the cloud paradigm will not be enough. In addition, the data being produced on the edges tend to be more personal (photos, videos, etc.), raising privacy issues that will be more easily addressed by maintaining edge processing.
Although, MEC seems to be an appropriate solution for handling real-time requests, which the typical cloud computing paradigm fails to acknowledge. There are several vulnerabilities associated with this technology.

Related Works
The popularity and widespread scope of the IoT technology has attracted several researches in this area in the past decade. The authors in [22] discussed the critical security provisions in "Sensor Network (BSN)"-based state-of-art healthcare ecosystems and presented a secured healthcare model. The researchers in [23] proposed a secured healthcare model using the "certificate-based DTLS" protocol. In [24], the authors presented a review of applications of IoT in healthcare. An efficient health monitoring system for controlling health parameters like "blood pressure (BP)," "hemoglobin (HB)," "blood sugar," and "abnormal cellular growth" for the underprivileged is presented in [25]. The survey in [26] discusses the RFID technology and its applications for gathering information about the "living environment" of the users. The paper also discusses the various possible new research trends and the challenges for the same. A cloud computing platform for managing the sensors and wearable is presented in [27], which depict the application of the IoT paradigm for providing pervasive healthcare. The authors in [28] proposed a "single sign-on"-based authentication scheme for securing medical IoT data. The authors in [29] propose an interoperable "Smart Hospital System (SHS)" based on technologies like "RFID," "WSN," and "smart mobile" using the "Constrained Application Protocol (CoAP)/IPv6" over the "low-power wireless personal area network (6LoWPAN)" and "representational state transfer (REST) network infrastructure." The presented SHS aimed to collect the "environmental conditions" and patient's "physiological parameters" using a "hybrid-sensing network." A control center collects the data, which is made available to the local and remote users by an advanced monitoring application (MA) via a REST web Electronics 2020, 9, 1135 5 of 18 service. An "ontology-based automating design methodology (ADM)" for "smart rehabilitation systems" using IoT was presented in [30]. The paper also empirically evaluates the proposal on parameters like "feasibility," "rapidity," and "effectiveness." The authors in [31] highlighted the role and applications of IoT in healthcare. The research in [32] proposed a "semantic data model" for data storage and interpretation. Furthermore, a new method for efficient data access "UDA-IoT" was proposed. Finally, the authors presented an "IoT-based system" for "emergency medical services." The authors in [33] presented a new conceptual framework for a "Home Health Hub Internet of Things (H3IoT)" for monitoring the physiological parameters of elderly people. The authors in [34] presented an overview of various "IoT-based technologies" and further discussed the technical and managerial challenges in its implementation. It also focuses on the three categories of IoT used to enhance customer value for enterprise applications. The authors in [35] investigated the challenges in collection of private data and presented a practical framework named "privacy protector" using the "Slepian-Wolf-coding-based secret sharing (SW-SSS)," to help attain secured sharing of the patient's personal data. They used a distributed database comprising multiple cloud servers to ensure data privacy and protection. The authors in [36] proposed a "privacy-preserved smart IoT-based healthcare system" for effectively storing big data and "self-adaptive access control." The proposed model also provides support for "deduplication to optimize space" in a big data storage system. The researchers in [37] analyzed the major concerns in the IoT technology related to the "smart sensors for healthcare applications" including the "wearable and body sensors" and "advanced pervasive healthcare systems." The researchers talked about the integration of IoT features into the medical devices and healthcare as a whole, thus improving the quality of service and performance parameters like efficiency, privacy, cost, etc. The researchers in [38] proposed an IoT-driven system that collects information related to the patient's vital parameters like pulse, temperature, etc. They used an Intel Edison to provide multi-tasking capabilities and low power consumption. The authors in [11] presented the basics of edge computing including its definition and need. The authors further discussed the various cases where edge computing can bring significant outcomes. The concept of collaborative edge is also introduced. Lastly, the authors highlighted the different challenges and opportunities in the area of edge computing, paving the way for future research. A "smart healthcare system" based on "edge computing" is proposed in [17]. The proposed healthcare system uses a cognitive computing approach to monitor and manage the patient's health. The results show that the proposed approach improves the patient's survival rates in emergency situations. The authors in [18] proposed an algorithm to improve the medical QoS in EC-based healthcare systems. The authors further compared the performance of the proposed "window-based rate control algorithm (w-RCA)" with the traditional algorithm and showed that w-RCA gives improved results. The authors in [19] proposed a resource management system for a SHS based on EC. In the proposed work, the authors introduced a "resource preservation net (RPN)" for emergency departments. The RPN framework is integrated with edge and cloud computing and shows some significant improvements in the patient's waiting time and length of stay. In [17] and [20], the authors discussed the emergence and need of edge computing and its role in enhancing the services of CC and IoT. The researchers in [39] developed a framework for treatment and assessment of voice disorders using cloud and edge computing. Initially, edge computing was used to process the voice samples, which were then forwarded to a cloud for further processing. The authors used the "Saarbrucken voice disorder database" and achieved an accuracy of 98.5 percent. In [40], the authors presented a mechanism to show how the query results can be authenticated in edge computing. The proposed mechanism creates verification objects to authenticate the queries. The authors in [41] proposed a blockchain-based healthcare system that involves secured and the privacy-preserved interaction of all the participating entities of a healthcare ecosystem. Smart cities are a privileged environment for the adoption of ICT technologies to solve several problems. In [42], the authors address the adoption of big data and analytical treatment of data within a smart city, also presenting a prototype from which it was possible to conclude a set of methods used for analyzing smart healthcare data. In [43], the authors discuss how ICT can improve and impact the effectiveness of healthcare and reduce the costs of these services to citizens. In [44], the authors identify the type of technology used in a smart city regarding Electronics 2020, 9, 1135 6 of 18 healthcare, the most important applications in this field, its degree of maturity, as well as the greatest barriers to its proliferation. Finally, the main benefits of smart health and future trends in this area are presented and discussed in [45].

Research Gaps and Motivations
The work presented in Section 3 shows that in the last few years, several architectures, frameworks, and methods have been proposed and developed to provide secure and smart healthcare for the patients. However, in recent years, very few reliable and trustworthy frameworks have emerged that can effectively provide a holistically secured, privacy-preserved, cost-effective, smart, and energy-efficient approach for the healthcare ecosystems [46][47][48][49][50][51][52][53][54][55]. Some existing solutions talk about securing the patient medical data, while others talk about effectively integrating different entities of the healthcare systems. In healthcare systems, especially with critical care units, real-time processing and decision-making is imperative [56,57]. With issues like network latency, traffic bottleneck, central node dependency, etc., the existing solutions using the "cloud-computing paradigm" fail to address the crucial need of "real-time data processing" and "decision-making" [12][13][14]. The time taken for the data to travel from the source sensor node to the cloud and return the results to the users is significantly high. The existing cloud-based solutions do not provide any reliable and significant solution to address this issue. Considering the above-mentioned insufficiencies of the existing cloud computing paradigm, it cannot provide a feasible solution for the critical real-time healthcare monitoring use-cases [12,13]. As the IoT devices are strictly power-constrained systems, the implementation of exhaustive and complex cryptographic techniques is not practically possible, because of the limited processing capabilities of the sensor devices. In the past, researchers have shown that cloud computing offers a large number of facilities and advantages compared to the legacy systems; however, in cases of real-time processing and data management, they somehow fail to keep up with the increasing demands for efficiency and satisfy the needs of the users [12][13][14]. With all these limitations of the classical cloud computing paradigm as motivation, this paper proposed a new framework that combines the capabilities of both cloud and edge computing paradigms to provide real-time, cost-effective, and energy-efficient data processing and management. Blockchain technology is integrated in the proposed framework to ensure the security and integrity of the sensitive and personal data like patient health records [58][59][60]. Edge computing helps in processing and managing critical use-cases at the edge nodes rather than centralized processing at the cloud. This can facilitate a near-real-time decision-making and delivery of the services. In addition, as the data captured by the sensors are handled on the edge only, a very short distance has to be travelled for the data to reach the edge nodes, which makes it faster, energy efficient, and cost-effective with very few chances of data losses [9][10][11][17][18][19][20]39].

Overview and Architecture
The proposed framework for the SMS facilitates the round-the-clock monitoring of patients by the doctors, care providers, and hospitals using smart-wearable devices and sensors. The SMS consists of five modules, namely users, a central monitoring unit, encryption and standardization unit, edge nodes, and cloud storage and processing unit. Figure 1 shows the core components in the SMS framework and their interconnection.
In the proposed framework for the SMS, several hospitals are connected together to facilitate information sharing using blockchain-based information storage. The stakeholders (users, doctors, patients, administrators, care providers) can perform their respective activities by authenticating themselves using the legitimate credentials. Any new user can register in the SMS by providing the respective registration details. Activities like reports downloads, viewing test results, and prescriptions providing diagnosis and suggesting treatments can be done with the help of smart devices using basic internet facilities. As the records of the patients are maintained on blockchains, the possibility of data tampering is negligible. A smart contract consisting of sets of rules, preferred communication modes, and access rights to be followed by the entities of the SMS enables a secured and privacy-preserved information exchange and transfer. The data/requests that require immediate processing are handled on the edge of the network itself by the edge nodes. In order to overcome the security vulnerabilities of the mobile edge computing framework, the notion of the "OAuth 2.0" [61,62] and "Twofish cryptographic technique" [63,64] has been used in the proposed SMS system. The OAuth 2.0 protocol is used for authentication of the users and provides time-based access to the system. Once the time period is expired, access to the system is revoked. The "Twofish cryptographic technique" is used to encrypt the data captured by the IoT devices. As Twofish uses a Feistel network and symmetric key approach and is a lightweight algorithm, it is very easy to implement on the IoT devices. In the proposed framework for the SMS, several hospitals are connected together to facilitate information sharing using blockchain-based information storage. The stakeholders (users, doctors, patients, administrators, care providers) can perform their respective activities by authenticating themselves using the legitimate credentials. Any new user can register in the SMS by providing the respective registration details. Activities like reports downloads, viewing test results, and prescriptions providing diagnosis and suggesting treatments can be done with the help of smart devices using basic internet facilities. As the records of the patients are maintained on blockchains, the possibility of data tampering is negligible. A smart contract consisting of sets of rules, preferred communication modes, and access rights to be followed by the entities of the SMS enables a secured and privacy-preserved information exchange and transfer. The data/requests that require immediate processing are handled on the edge of the network itself by the edge nodes. In order to overcome the security vulnerabilities of the mobile edge computing framework, the notion of the "OAuth 2.0" [61,62] and "Twofish cryptographic technique" [63,64] has been used in the proposed SMS system. The OAuth 2.0 protocol is used for authentication of the users and provides time-based access to the system. Once the time period is expired, access to the system is revoked. The "Twofish cryptographic technique" is used to encrypt the data captured by the IoT devices. As Twofish uses a Feistel network and symmetric key approach and is a lightweight algorithm, it is very easy to implement on the IoT devices.

Components of SMS
The Central Monitoring Unit (CMU) is the heart of the SMS framework. All the decisions about data capturing, routing, storage, retrieval, and blocking are taken by it. The Encryption and Standardization Unit (ESU) is responsible for converting the data captured by the sensors into a standard format so that it can be used for analysis. As the SMS employs multiple sensors of varied nature and configuration, the format in which they capture the data is largely different. Therefore, in order to perform a meaningful analysis, it is imperative to convert these intricate and heterogeneous data into a standard format.
The SMS uses the OAuth 2.0 protocol to ensure that only the legitimate personnel get access to

Components of SMS
The Central Monitoring Unit (CMU) is the heart of the SMS framework. All the decisions about data capturing, routing, storage, retrieval, and blocking are taken by it. The Encryption and Standardization Unit (ESU) is responsible for converting the data captured by the sensors into a standard format so that it can be used for analysis. As the SMS employs multiple sensors of varied nature and configuration, the format in which they capture the data is largely different. Therefore, in order to perform a meaningful analysis, it is imperative to convert these intricate and heterogeneous data into a standard format.
The SMS uses the OAuth 2.0 protocol to ensure that only the legitimate personnel get access to the sensitive and protected information like patient's records. The CMU validates the credentials of the users in real time before allowing access to the patients' data. These data can also be made available through an SMS app, which can be accessed by the doctors, hospitals, as well as the patients using valid authentication credentials. This can save a major amount of time and effort spent in travelling to the hospitals or doctor's premises. Furthermore, the Cloud Storage and Processing Unit (CSPU) serves several purposes. First, it acts as a repository for storing the patient's data generated over the observation period. Secondly, the data from the cloud can be used as reference for similar medical cases. The data stored in the cloud are made available to the CMU for centralized monitoring of the patient's current health status, which can be used for diagnosis and suggesting treatments. The doctors, as well as the hospitals, can be connected to the CMU to keep track of the patient's medical history and current state and suggest a treatment or help in diagnosis. In cases of "Critical Care Units (CCU)," "Intensive Care Units (ICU)," "Intensive Critical Care Units (ICCU)," etc., it is imperative to process the data on the edge of the network in order to provide real-time diagnosis and analysis of the data. The unit requires round-the-clock real-time monitoring of the patients. The edge nodes are responsible for performing the processing of the data captured by the sensors, which requires immediate actions and decision-making. The presented architecture aims to bring together the patients, doctors, and hospitals into a single umbrella for better medical facilities, and better diagnostics and treatments. The movement of data from one source to another in the SMS is governed by Software-Defined Networking (SDN) [65,66]. As SDN provides network flexibility, the data traffic can be dynamically controlled by the CMU in real time. SDN ensures dynamic route management for selecting optimal paths for faster data transfer.

Three Stages of the Proposed Approach
For better understanding of the process, the proposed approach has been divided into three phases.

Phase 1-Data collection
This is the initial step of the proposed SMS framework. In this phase, the "real-time data" of the patients are captured with the help of multiple sensor-based devices including wearable and other medical equipment to collect the physiological parameters of the patients and other health-related data.

Phase 2-Data Encryption and Standardization
In the second phase, the information captured by the data collection phase is encrypted and converted into a predefined standard format in order to maintain "consistency," "confidentiality," and "privacy" of the data. Data standardization is necessary because of the fact that different devices capture and store the data in their respective format and, in order to maintain the "consistency," the data must be converted into a predefined standard format. The block diagram given below in Figure 2 presents the working of the data standardization unit.
process the data on the edge of the network in order to provide real-time diagnosis and analysis of the data. The unit requires round-the-clock real-time monitoring of the patients. The edge nodes are responsible for performing the processing of the data captured by the sensors, which requires immediate actions and decision-making. The presented architecture aims to bring together the patients, doctors, and hospitals into a single umbrella for better medical facilities, and better diagnostics and treatments. The movement of data from one source to another in the SMS is governed by Software-Defined Networking (SDN) [65,66]. As SDN provides network flexibility, the data traffic can be dynamically controlled by the CMU in real time. SDN ensures dynamic route management for selecting optimal paths for faster data transfer.

Three Stages of the Proposed Approach
For better understanding of the process, the proposed approach has been divided into three phases.

Phase 1-Data collection
This is the initial step of the proposed SMS framework. In this phase, the "real-time data" of the patients are captured with the help of multiple sensor-based devices including wearable and other medical equipment to collect the physiological parameters of the patients and other health-related data.

Phase 2-Data Encryption and Standardization
In the second phase, the information captured by the data collection phase is encrypted and converted into a predefined standard format in order to maintain "consistency," "confidentiality," and "privacy" of the data. Data standardization is necessary because of the fact that different devices capture and store the data in their respective format and, in order to maintain the "consistency," the data must be converted into a predefined standard format. The block diagram given below in Figure  2 presents the working of the data standardization unit.  Figure 3 presents the architectural framework of the proposed SMS. The data captured by the different sensors are collected in the data collection phase. While capturing the required information, each sensor adds a sensor_id, model_no, data format, and size of the data in the data-header field (metadata). This step ensures the "authenticity" and "legitimacy" of the data at later stages (if required). After this, the essential portions among the data are identified and the outliers and noises are removed from the data. Then, the data are converted into the required standard format. Finally, the data are normalized in order to remove any duplicity or inconsistency. All this is governed by the central monitoring unit. The encryption unit is responsible for converting the data collected from the sensors into an encrypted format to protect it from eavesdroppers (if any). The SMS uses the "Twofish cryptographic technique" to perform the encryption of the data. It is a "symmetric key cryptographic" technique that uses a "Feistel network," and it is fast and has an intricate internal structure that is very hard to break but, at the same time, fairly simple to embed in the hardware devices because of the availability of its open-source APIs in several prominent languages. Further details about the Twofish algorithm can be found in [63,64]. different sensors are collected in the data collection phase. While capturing the required information, each sensor adds a sensor_id, model_no, data format, and size of the data in the data-header field (metadata). This step ensures the "authenticity" and "legitimacy" of the data at later stages (if required). After this, the essential portions among the data are identified and the outliers and noises are removed from the data. Then, the data are converted into the required standard format. Finally, the data are normalized in order to remove any duplicity or inconsistency. All this is governed by the central monitoring unit. The encryption unit is responsible for converting the data collected from the sensors into an encrypted format to protect it from eavesdroppers (if any). The SMS uses the "Twofish cryptographic technique" to perform the encryption of the data. It is a "symmetric key cryptographic" technique that uses a "Feistel network," and it is fast and has an intricate internal structure that is very hard to break but, at the same time, fairly simple to embed in the hardware devices because of the availability of its open-source APIs in several prominent languages. Further details about the Twofish algorithm can be found in [63,64].

Phase 3-Data Storage
Once the patient's data is encrypted and standardized, these data and information are passed to the pre-authenticated account of the patients on the cloud for storage. The proposed SMS uses "OAuth 2.0" for performing the "authentication" and "authorization" process [61,62]. The OAuth protocol is a widely used industry-level authorization and authentication protocol that usually provides predefined threshold value-based access to the users. This may include time-based access, level-based access, or complete access. Once the threshold value expires, the access is revoked [61,62]. This mechanism is useful for maintaining consistency of the data along with authorization and authentication. The encrypted records from the cloud storage can be made available for any medical assistance and case-studies by doctors, students, and researchers on mutual agreements with the hospitals and patients. In the final phase, the doctors and the hospitals access this data in real time by logging into the central monitoring system and requesting access to the "data and information" of the patients. The proposed SMS framework is a generic concept that can be modelled into any specific medical domain and use-case. The presence of OAuth 2.0, Twofish, and SDN makes it a secured, dynamic, privacy-preserved, intelligent, and dependable framework for the healthcare data management.
The data collected from various sources (wearable devices, fixed equipment, test data, etc.) is initially stored in the local storage units and later transferred to permanent storage hubs. While the data resides in local storage, it is preprocessed and refined to extract useful data for further processing. Once the process of extraction is completed, the extracted data is fed into the data analytics models for obtaining insights about the conditions of the patients and perform predictive and preventive analysis. Some of these analyses (which are urgently required) are done at the edge nodes while detailed analysis is done at the central control units. This serves two purposes, the immediate requirements and firsthand analysis are available in near-real time so that informed decisions can be taken in cases of emergency, while for regular cases, a detailed analysis is performed at the central hubs. This improves the overall performance of the system by minimizing latency, network bandwidth consumptions, and increasing the throughput.

Role of IoT in SMS
IoT-enabled devices are primarily responsible for sensing and collecting data about the patient and their surroundings. This data sensing, collection, and transfer to hubs are governed by typical IoT protocols. Some of these protocols include [67][68][69][70]: MQTT: This is a very lightweight protocol responsible for sharing information between two devices. It supports "machine-to-machine (M2M)" communication and works on the principle of the "publish-subscribe" communication pattern usually using TCP/IP [67]. OMA-DM: This is a device management protocol responsible for managing the devices connected in an IoT network. It works in the client server model. OMA-DM works in sessions. A typical session comprises two phases. The first phase is known as the "setup," while the second phase is known as the "management" phase. The setup phase contains authentication and device information, while in the management phase, the commands issued by DM server are executed by DM clients [67]. 6LowPAN: This provides a low-power wireless connection over IPv6. It is used to provide end-to-end connectivity for the transfer of data in a WSN. It has an inbuilt encryption and compression mechanism that takes care of the security and speed of the data transferred [67]. CoAP: CoAP is primarily used for low-resourced devices like sensors nodes. They can provide multicast support, minimal overhead, and ease of usage [67]. XMPP: This stands for "Extensible Messaging and Presence Protocol'. It is mainly used in "real-time communication" like "instant messaging," "voice and video calls," chatting, etc. ZigBee: This is a protocol that uses the IEEE 82.15.4 standard and is used for low-powered sensor devices. They are highly cost-effective and perform very well in several varieties of applications like home automation, personal health monitoring, etc. [67].
The SMS proposes to use an integration of these protocols to effectively capture, store, and transfer the data sensed by the sensors.

Data Analytics in SMS
The data collected during the process can be used for performing various types of analytics to assist the healthcare community and the stakeholders. Table 1 shows how the integration of data analytics into the traditional healthcare systems impacts the stakeholders.

Role of MEC in the Proposed SMS
In a typical edge computing paradigm, the data are processed in close proximity to the source from where the data is generated as close as possible. This is made possible by deploying dynamic intermediator servers optimally placed in a distributed manner. These servers are capable of performing basic data processing and analysis that can be used to service requests in real time or near-real time. Although there are several security vulnerabilities associated with the classical mobile edge computing paradigm that can affect the edge devices and gain access to the data and information, this paper proposes to implement the OAuth 2.0 protocol, twofish cryptographic approach, and blockchain technology to safeguard the system against such attacks. In the SMS, all the participating devices and entities need to register in the system beforehand. Each device in the SMS can be uniquely identified with a unique key formed by combining the device_hardware_id and the device_registration_id provided at the time of registration. This unique code along with the hardware id of the device together forms the uniquely identifying key for the device. Figure 4 shows the creation of a unique key for the IoT and edge devices.
The users are authenticated using the "OAuth 2.0" protocol. The protocol provides "role-based access" to the legitimate user for a "specific period of time." Once the time period expires, access to the system is revoked. The users are authenticated using the "OAuth 2.0" protocol. The protocol provides "role-based access" to the legitimate user for a "specific period of time." Once the time period expires, access to the system is revoked.

Blockchain in SMS
The information exchange between the users, IoT devices, edge devices, and servers are governed by the blockchain mechanism. All the participating entities form a smart contract among each other on mutually agreed conditions (consensus). Blockchain is a digital distributed ledger that consists of a series of timestamped records that are immutable, secured, and linked using cryptographic techniques [41,59,60,71]. Consensus algorithms are used to establish agreement between the nodes on a single state of the ledger across the distributed decentralized system. Proof of work is the most commonly used consensus algorithm that works on the idea that the miner nodes in the underlying network must provide proof of their effort. It is achieved by solving a cryptographic puzzle by the miner nodes. Other popular consensus algorithms include proof of stake, delegated proof of stake, byzantine fault tolerance, etc.
The smart contract is an agreement in the form of a computer code that can be stored on a public database and cannot be manipulated. The entire system works on the if-then premise where the transactions are executed only when the conditions specified in the agreement are met, thus eliminating the need of an intermediary third party [71][72][73].
In the blockchain-based healthcare systems like the SMS, smart contracts are used to empower the patients to control their own data. Smart contracts can record and safely transfer data. The use of zero-knowledge proofs in healthcare data can allow for anonymous querying and aggregation of patient's medical data and, hence, ensure patients anonymity. Further, using the smart contract, the patient can control the access and usage of their data by establishing an agreement to revoke the access and remove the data once the purpose is fulfilled. Smart contracts can also be used to record the health insurance of patients, which eliminates the need to file lengthy insurance claims in the case

Blockchain in SMS
The information exchange between the users, IoT devices, edge devices, and servers are governed by the blockchain mechanism. All the participating entities form a smart contract among each other on mutually agreed conditions (consensus). Blockchain is a digital distributed ledger that consists of a series of timestamped records that are immutable, secured, and linked using cryptographic techniques [41,59,60,71]. Consensus algorithms are used to establish agreement between the nodes on a single state of the ledger across the distributed decentralized system. Proof of work is the most commonly used consensus algorithm that works on the idea that the miner nodes in the underlying network must provide proof of their effort. It is achieved by solving a cryptographic puzzle by the miner nodes. Other popular consensus algorithms include proof of stake, delegated proof of stake, byzantine fault tolerance, etc.
The smart contract is an agreement in the form of a computer code that can be stored on a public database and cannot be manipulated. The entire system works on the if-then premise where the transactions are executed only when the conditions specified in the agreement are met, thus eliminating the need of an intermediary third party [71][72][73].
In the blockchain-based healthcare systems like the SMS, smart contracts are used to empower the patients to control their own data. Smart contracts can record and safely transfer data. The use of zero-knowledge proofs in healthcare data can allow for anonymous querying and aggregation of patient's medical data and, hence, ensure patients anonymity. Further, using the smart contract, the patient can control the access and usage of their data by establishing an agreement to revoke the access and remove the data once the purpose is fulfilled. Smart contracts can also be used to record the health insurance of patients, which eliminates the need to file lengthy insurance claims in the case of need. Moreover, the health records of patients can easily be accessed while moving from one hospital to another. It also allows efficiency in telemedicine. Broadly, the smart contracts apply to the following aspects of the healthcare system [69- These smart contracts identify the role, access mechanism, data ownerships, and data exchange policies. As blockchain is a distributed ledger technology that is immutable, there are no chances of data compromises or other tampering issues, as all the entities of the SMS system will be able to uniquely identify the legitimacy of each other. Figure 5 shows the formation of smart contracts between the participating entities of the SMS.
Electronics 2020, 9, x FOR PEER REVIEW 13 of 18 of need. Moreover, the health records of patients can easily be accessed while moving from one hospital to another. It also allows efficiency in telemedicine. Broadly, the smart contracts apply to the following aspects of the healthcare system [69- These smart contracts identify the role, access mechanism, data ownerships, and data exchange policies. As blockchain is a distributed ledger technology that is immutable, there are no chances of data compromises or other tampering issues, as all the entities of the SMS system will be able to uniquely identify the legitimacy of each other. Figure 5 shows the formation of smart contracts between the participating entities of the SMS. There are several types of consensus algorithms that are widely used in blockchain technology. These include "Proof of Work (PoW)," "Proof of Stake (PoS)," "Delegated Proof of Stake (DPoS)," "Proof of Burns (PoB)," "Proof of Capacity (PoC)," "Proof of Elapsed Time," "Practical Byzantine Fault tolerance," etc. [71][72][73]. All these consensus algorithms can be used in different scenarios and for different purposes within a healthcare system. The different participating entities of the SMS can use the combination of these consensus algorithms to provide granular access control, transparency, and security.
In the proposed SMS, critical cases that require real-time 24/7 monitoring of the patient's physiological parameters can leverage the potentials of edge computing to provide instant diagnosis and alert the care providers of the current situation of the patients. Furthermore, on the basis of extensive real-time data analysis and historical data available in the cloud, models can be developed that can provide predictive healthcare facilities. Consider a situation where a patient is about to get a heart attack, and, based on the constant real-time monitoring and historical data analysis, the There are several types of consensus algorithms that are widely used in blockchain technology. These include "Proof of Work (PoW)," "Proof of Stake (PoS)," "Delegated Proof of Stake (DPoS)," "Proof of Burns (PoB)," "Proof of Capacity (PoC)," "Proof of Elapsed Time," "Practical Byzantine Fault tolerance," etc. [71][72][73]. All these consensus algorithms can be used in different scenarios and for different purposes within a healthcare system. The different participating entities of the SMS can use the combination of these consensus algorithms to provide granular access control, transparency, and security.
In the proposed SMS, critical cases that require real-time 24/7 monitoring of the patient's physiological parameters can leverage the potentials of edge computing to provide instant diagnosis and alert the care providers of the current situation of the patients. Furthermore, on the basis of extensive real-time data analysis and historical data available in the cloud, models can be developed that can provide predictive healthcare facilities. Consider a situation where a patient is about to get a heart attack, and, based on the constant real-time monitoring and historical data analysis, the doctors are able to predict it well before time. Thus, this predictive healthcare can provide revolutionary measures to know the nature and severity of the event even before it occurs and, thus, can save many valuable human lives. All this is made possible only because of the possibility of processing the data close to its source of origin with the help of edge computing paradigms. In MEC, the "device relationship management (DRM)" software is responsible for monitoring and managing edge devices. The DRM is capable of providing the facilities like caching, filtering, optimizing, and buffering of the datasets. Algorithm 1 provides the mechanism for handling requests in the SMS.

Conclusions and Future Scope
This paper proposes a unique framework for the continuous health monitoring of patients. The proposed framework combines the three modern-day technologies IoT, cloud computing, and edge computing to facilitate efficient medical services. This is particularly helpful in critical cases that require 24 × 7 monitoring of the patients that is otherwise difficult with manual monitoring (nurses or ward boys). The system has the provision to capture any change in the condition of the patients in real time and send alerts to the doctors and care providers. In addition, this information can be used to construct prediction and analytics models using deep-learning techniques that can predict the incoming situation of the patient on the basis of the fluctuations in the vitals of the patients. Furthermore, the patients can be monitored regarding dietary and self-care instructions after they are discharged from the hospital with the help of the wearable devices worn by the patients. The amalgamation of big data and IoT in the proposed model also facilitates the storing of genomic data in a cost-effective and reliable manner and can open new horizons for genomic data analytics for treatments of various chronic and hereditary diseases. In addition, the data collected from the patients can serve as a repository for future medical references, prescriptions, and case studies. As a future scope, we can design a deep-learning-based analytical model for predicting the conditions of the patients in the near future and come up with state-of-the-art methodologies for diagnosis and treatments. As an extension of this work, the proposed model shall be converted into a prototype and will be evaluated with the help of simulation and real datasets.