Designing IoT Applications

[Cross Post from Syam Madanapalli's Article. ]

In India, there is an old story about a student who prepared well to write an essay on a coconut tree, but in the examination, he was asked to write an essay about a cow. The student had no idea what to write about the cow because he had not read the cow lesson. He thought for a while and got an idea. The idea was to utilize his knowledge of the coconut tree, he started writing the essay wherein he tied the cow to the coconut tree and started writing the remaining essay on the coconut tree. There were many alternative endings to this story, but any wise teacher knows the trick and would give zero marks to the student. Imagine the situation, if the teacher thought he was a smart student and passed him. He might become a doctor, he would probably associate a symptom with one of his skills to do a surgery and may end up killing the patient. By chance, if this student becomes an engineer he would become a mass killer.

Figure 1: The Cow, the Coconut Tree and the Boy

The recent story of the Internet of Things seems to be very similar to the story of the cow. generates big data and the rest of the story is about the big data. Not many know how to design IoT applications except telling the story about big data and analytics probably because of many reasons, including they knew about big data (they knew how to use some of the tools and platforms - these are trained workforce) and/or they do the in the big data.

In practice, IoT design is complex and requires engineers to build them. In this article, I will discuss the IoT design and what it takes to build large-scale IoT applications.

When people (engineers?) talk about big data, they compare it with a big elephant , they say, big data is a lot like the story of a few blind men and the elephant; when each of them touched a part of the elephant they describe what the elephant is. I do not understand why they could not touch the whole elephant and then describe the elephant, maybe, they are not only blind they are brainless as well.

Figure 2: The Big data puzzle

The big data guys seem to be similar, they do not want to dig through the entire IoT application end-to-end to understand the complexities and what it takes to build IoT applications. Of course, like in the elephant and cow story, they are right about their limited perspective, like Aristotle, who thought an object in motion comes to rest because it gets tired, whereas an IoT engineer is like a post-Einstein era where a particle can exist at multiple places simultaneously leading to the multiverse.

In this article, I am going to present a few constructs that you can use to design the end-to-end scalable and secure IoT applications.

IoT and the Spatiotemporal Event Handling

There was a beautiful girl (of course, all the girls are beautiful) who just joined an IT company in Bangalore. A guy asked the girl to go for a coffee. She said she would let him know after talking to her mother. She called her mother, whether she could go with the guy for the coffee. Her mother asked for more details about the guy and advised the girl not to go with him. The girl conveyed the boy that she was not going with him for the coffee. The boy was disappointed. One day, the girl was walking on her way back to her hostel. The boy who was going on his bike saw her and decided to hit her with the bike as she refused to go out with him earlier. The girl noticed the boy's intention, and took her phone from the handbag to call her mom to take her advice on what she should be doing. She dialed her mother, it was Airtel 4G connection, …. Most likely that she would not have got the call connected. 

The nature protects the good, there was a pothole in front of the girl and the boy did not notice it as he was looking at the girl and he wanted to hit her, rather he hit the pothole and fell down on the road, injured and caused a traffic jam given the number of vehicles on Bangalore roads. The people near to the incident helped the guy, and sometime later traffic police came to the incident location to clear the traffic, and the boy was arrested knowing his intentions (these are real-time actions). As the potholes are causing accidents, municipalities decided to repair the roads (this is optimization). Police found that the boy had a criminal background and filed a charge sheet. As the crimes against the girls were increasing, the government started to bring in new laws to protect the girls (this is the planning for a better future).

Figure 3: Spatio-Temporal Event Handling in IoT Applications

In the above story, the girl trying to call her mother to take action instead of her making a decision to dodge the hit was a mistake. In IoT, certain decisions have to be made at that time and at that place, this is called Spatio-temporal Event Handling. As illustrated in Figure 3, the IoT devices should react; at one level up, the Roof (the true-) should act in realtime; at the next level, the fog (?), should optimize; and at one level up, the cloud, should plan for future actions.

In the girl’s story, the girl is like an IoT device while the mother is the cloud. While the mother provides great advice always, the girl should be able to take real-time actions and always reach her mother for a better future.

IoT and the Context Building

Whatever we do in this universe is based on context which is built using the information available to us, then make the decision to take appropriate actions that are suitable or required for that context. An IoT application should function autonomously in a secure manner within the context of a local environment. And, connect to the global Internet for more value creation. The context building helps in providing real-time analysis of the environment for taking the suitable and required actions [Figure 4].

Figure 4: IoT and the Context Building

IoT applications require two kinds of data analytics [Figure 5]: Context Building and Big data analytics, the former is a real-time analysis of the current situation, i.e. the real-time approximation of the real-world scenario while the latter is an analysis of history for predicting trends and preventive actions. The challenge is to provide the reliable real-time computing for context building and real-time actions. Building context and triggering real-time actions at the edge makes the IoT system more functional even in the cases of prolonged loss of connectivity to the Internet and Cloud. The edge builds the real-time context while the Cloud performs the big data analytics, both of which are natural for their location in the federated network architecture. 

Figure 5: Realtime vs. Future Actions

Securing the Internet of Things

The interface between the Things and the Internet/Cloud is the weakest link as the Things are the constrained devices (constrained by the processing power, battery and bandwidth) making them least self-protected network elements. Given that IoT devices are deployed in an unprecedented big scale, the insecure interface between the Things and Cloud can result in data corruption, denial of service or a complete takeover of the Things making people, business and governments vulnerable to cyber-attacks. In addition, most of the users and the designers of IoT applications are tech illiterates making the IoT applications more vulnerable to and privacy threats. Lack of security and privacy in IoT applications can have an impact on safety, economy and loss of lives.

Figure 6: Securing the IoT Systems is Complex

Securing the Internet of Things is different from cyber-security, and the challenges are unprecedented as illustrated in Figure 6. One way to solve the Security issues in IoT is to take the battle at one level up and assist the computing needs of the IoT devices at the edge level [Figure 7].

 

Figure 7: IoT Security by Indirection

Securing the Internet of Things requires building the Internet of Things first-time-right, which in turn requires certain guidelines, policies and standards to be established. These standards and guidelines would facilitate the creation of a collaborative of device vendors, software developers, network builders, system integrators and the regulators, and play their role in building the Secure IoT systems.

Backhaul, Information and Service Management

Things generate data continuously, not all data make sense nor useful. It is unwise to just route data to the cloud and store. It requires filtering the unwanted data, typically the normal conditions, that may not help for future analysis, and transmit only the useful aggregated intermediate data to the Cloud thereby increasing the efficiency of the backhaul connectivity. It also requires to store the data locally when the connectivity to the Cloud breaks, and upload the data when the connectivity has been reestablished.

An IoT network may support multiple applications, e.g. utilities, security, insurance, maintenance, etc. And there can be multiple service providers, e.g. we have multiple ISPs and one can change to the appropriate ISP depending on the quality of service and . Similarly, and IoT application should be able to switch the service providers as well as the cloud applications; this may take some more time for the standards to be established.

Horizontalization - Designing for Innovation

Most of the today's IoT solutions are vendor driven and vertically segmented - the vendor provides devices, IoT hub/gateway and cloud services. This leads to interoperability issues and vendor lock-in. Interoperability requires a standardized-gateway/edge with standard interfaces so that we can integrate the devices and cloud services horizontally by choosing devices from any vendor and get the services from any other vendor. This not only allows to build IoT applications using best of breed components, more importantly, allows the innovation to build new applications [Figure 8].

Figure 8: Horizontalization for Innovation

The number of contexts and hence the better contexts that can be built is directly proportional to the number of parameters that are being sensed from the application environment. The more the number of sensors, the more the number of data points and better the context building. If we have one (a temperature sensor) providing one IoT service (temperature service which provides the current temperature of a room), one can build only one simple context (the room is cold or hot). With two services, the number of possible contexts is three. With three services, seven contexts are possible. If there 'n' services, the number of contexts possible are (2^n) - 1. If you have 100 basic IoT services, the number of possible contexts that can be built is 1 267 650 600 228 229 401 496 703 205 375. It is one nonillion which is over one trillion trillion possible contexts. While some of these are not useful contexts, even if there are 1% useful contexts, the number of contexts one could build is unlimited in a moderate IoT deployment involving 100 different sensors. This allows innovation and collaboration for building better IoT applications provided that the IoT devices can be integrated horizontally.

Managing the Millions of New Devices Everyday

By 2025, tens of millions of devices would installed, which requires a huge number of trained personnel for installing, configuring and commissioning of the IoT devices. These procedures typically require 20 – 30 minutes for simple devices to few hours for large equipment. The efforts required for these procedures can be more expensive than the cost of IoT devices and limits the scalability. Hence, one should design the IoT devices and applications for auto-configuration and easy device life-cycle management. This would lead to the development of an ecosystem wherein deploying IoT applications would be easy without the need for deep technical knowledge for the installation, provisioning, commissioning and decommissioning [Figure 9].

Figure 9: Designing for Life Cycle Management

Scalability and Designing for Endurance

The Internet of Things will be the biggest network ever created by the humans, which requires a scalable and repeatable model built on smaller and reusable constructs. To be able to build such a massive network, we need to take the design patterns from the BIG things that scaled well: the Universe, the Internet and the Humans. One such model is IEEE P1931.1 - the Roof Computing, which is primarily modeled based on how the Humans evolved. Roof model can be replicated easily and can be used to build large-scale IoT applications [Figure 10], e.g. a Smart Cities. The Roof model can be used across multiple applications, verticals and enables federated architecture for fault isolation and semi-autonomous functionality for reliability and endurance.

Figure 10: Designing for Scalability and Endurance

Traits of a Good IoT Design

IoT is all about designing a system for actions that solve the pain points of the stakeholders in the problem statement. We do not design IoT for data collection, when we are designing for actions, we may collect and store data for future actions. The actions are designed for spatiotemporal event handling. Organizations can allow cross-functional innovation when the IoT platform is built with Open API that all the stakeholders can access for building new and improved contexts and hence better actions. Other traits are illustrated in Figure 11.

Figure 11: The traits of a good IoT system

IoT devices come in a wide variety of form factors from different vendors with varying input and output capabilities. The interactions with devices, typically, will be handled by web and mobile apps provided by the vendors. The value for the end user lies in coherent service for providing distributed user experience across multiple IoT devices/applications.

Figure 12: Building trustworthy IoT systems with a unique value proposition

To be able to build the interoperable IoT systems, standards play an important role while businesses require a scope for innovation to differentiate themselves from the crowd. Figure 12 illustrates, where the standards are required and where the businesses can focus on to innovate. Given that most of the end users and designers are tech illiterates, we need the standards for IoT security so that the ecosystem can reuse the knowledge without the need for their intervention which may result in compromised systems.

Final Words

Designing true-IoT Applications is complex; only the engineers can design them and put into use that can can scale, secure and solve the problems. And, I have few other IoT Design Sutrams, especially how do you know that how much you should budget for hardware vs. software & services; I will discuss these in another article. For now, if somebody pitches you IoT solution and if they are tying it to Big Data; I am sure you know what you have to do: direct them to this article. In addition; now you have few guidelines to check any IoT solution and see if it true IoT application.

Leave a Reply