An IoT solution is an amalgamation of hardware, software and networking capabilities. Edge computing is required for any successful and optimised IoT solution. There are various open source frameworks available for edge computing in the IoT space. This article introduces some of them.
Data is the heart of an IoT system and it needs to be immediately processed. An IoT system can generate limitless data within a second, depending on the various IoT devices assembled under the system, as per business needs. Limitless data generated from IoT devices or sources can easily consume network bandwidth and lead to a need for excess data storage. It is crucial to aggregate and digitise the data at the periphery of the system, which can then be communicated to back-end systems. This responsibility is taken care of by edge computing, and helps to reduce or optimise the IT infrastructure. These edge computing systems reside close to the IoT devices/data sources and also enforce the required security. A major benefit of edge computing is that it improves the time to action, reduces response time and optimises the use of network resources. It also helps to reduce latency and network bottlenecks.
Reference architecture of edge computing for IoT solutions
IoT devices and data sources
An IoT system can have various data sources—IP capable or low-powered devices like sensors, appliances, applications, social media sites, or data from third party systems. These data sources can generate data in various formats, frequencies and volumes. This is the layer where data is getting generated. Data sources may vary as per an enterprise or industry’s needs. A solution should support the data source channels required to meet a business’ needs. These IoT devices will capture the data and communicate over IoT protocols to a nearby edge gateway system via Wi-Fi, Ethernet, Bluetooth, NFC, Zigbee or any other communication/transport layer protocols.
IoT communication/transport layer protocols
The following are some of the widely used IoT communication/transport layer protocols.
- Bluetooth: This is a wireless technology for data exchange between electronic devices over short distances. An electronic device must meet Bluetooth support standards to enable communication over Bluetooth protocols.
- Wi-Fi: This is a wireless local area networking technology. It is a very common and easy-to-set up communication/transport layer. Any electronic devices within range of a wireless modem can attempt to access the network.
- NFC: Near Field Communication (NFC) is a protocol to enable two electronic devices to establish communication. It is used for contactless payments, electronic tickets, mobile payments, sharing contacts, photos, videos, files, etc. It offers simple and safe two-way interaction between electronic devices within a specified range.
- Zigbee: This is a high-level communication protocol for personal area networks. Zigbee is a low power, low data rate and close proximity wireless network. It is simpler and less expensive than Bluetooth and Wi-Fi. It is used for home automation, medical devices, traffic management systems and other consumer or industrial low power, low bandwidth requirements for small scale projects.
- LoRaWAN: Low Power Wide Area Network (LPWAN/LoRaWAN) operates in the radio spectrum for wide area networks. Similar to Wi-Fi, it can be set up for using lower radio frequencies with a longer range. It allows low-powered devices to communicate with Internet connected applications.
There are some other transport layer protocols too, such as Z-Wave, 6LowPAN, Thread, Cellular, Ethernet, Eddystone, WiMax, etc.
IoT data protocols
Data protocols are a set of rules for establishing communication between various entities of the system. These protocols define the syntax, semantics, synchronisation of data, and provision for error recovery. The following are some of the widely used IoT data protocols.
- MQTT: Message Queue Telemetry Transport (MQTT) is designed to provide embedded connectivity between applications and middleware on the one side, and networks and communications on the other. It follows a publish/subscribe architecture, where the system consists of three main components: publishers, subscribers and a broker.
- AMQP: The Advanced Message Queuing Protocol (AMQP) runs over TCP and provides a publish/subscribe architecture that is similar to MQTT. The difference is that the broker is divided into two main components: the exchange and queues. The exchange is responsible for receiving publisher messages and distributing them to queues based on predefined roles and conditions. Queues basically represent the topics, and its subscribers get the sensory data whenever it is available in the queue.
- CoAP: The Constrained Application Protocol (CoAP) is for constrained devices called nodes to communicate with the wider Internet using the same protocols. It is designed to be used under the same constrained communication network between devices and nodes on the Internet. Multi-cast, low overheads and simplicity are important features of CoAP.
- HTTP: This is the standard protocol for Web services and is used in IoT solutions. The most popular architectural style, called RESTful, is widely used on mobile and Web applications, and is being considered for IoT solutions.
There are some other data communication protocols such as:
- Mosquitto: An open source MQTT broker
- XMPP (Extensible Messaging and Present Protocol)
- DDS (Data Distribution Service for real-time systems)
- LLAP (Lightweight Local Automation Protocol)
- LWM2M (Lightweight M2M)
- SSI (Simple Sensor Interface)
The edge gateway and middleware gateway
Edge gateways process initial accumulated data that is received from IoT devices/sources and convert that into an expected format. They share the accumulated data from IoT devices to the middleware gateway, which is an IoT and API gateway. The IoT gateway empowers the system to have bi-directional communication between IoT devices and storage/analytics systems. It helps to regulate the environmental changes and detect possible issues with the functioning of a system. These gateways protect information moving in both directions, as well as prevent unauthorised control of IoT devices from the outside world. They also facilitate the device’s life cycle management. Figure 2 depicts the various stages of this life cycle and the respective features for device management.
An IoT solution consists of some Web application interfaces like the Admin Information Dashboard or Cockpit. This Cockpit provides the interface to administer the IoT devices, as well as the configurations to manage and control the IoT devices. There can be multiple Web application interfaces. One can be at each deployment unit, which represents the edge computation at the periphery of the system. There can be other interfaces that manage the entire system’s configurations from a central portal.
The Cockpit can be implemented using front-end technologies like Angular, Node, etc.
Back-end platform and the open source technologies used
An IoT solution’s back-end system has the following functions.
- Ingestion: An ingestion framework is needed in the solutions approach to extract data from various data sources and send it to the processing tools. Data can be ingested as a stream in real-time or ingested on batch processing, depending on the business’ needs. An ingestion of data to the system for further processing requires various supportive frameworks based on other technology stacks of the system. The data input to the system can be from Hadoop data clusters, SQL data exports or data ingestion to the messaging server like Kafka, or other data stream processing frameworks/tools like Apache Camel, Spark Streaming, Storm and Flume.
- Orchestration and processing: This is the layer in which the alignment of business needs to applications, data and infrastructure takes place. System orchestration and automation are important layers of the entire solution. They define various rules, policies, business logic, automated workflows, provisioning, change management, etc. The entire system’s scalability depends a lot on this layer’s scalability and extensibility provisioning capabilities. There are many frameworks or tools that can be used for system orchestration and processing in enterprises with large data, like NiFi, Oozie and Apache Spark.
- Modelling and analytics: Data modelling for organisational data can span multiple levels of abstraction, ranging from conceptual to logical and physical. The conceptual models can be used for discussions with business people and domain experts. The logical model adds more precision, and provides the information to discuss and decide on logical representations. The physical model relies on various technology-specific data, and helps to prepare a target environment, such as a database management system. There are various frameworks or technologies available for data modelling and the respective analytics, like R, Python, Spark ML, Kibana, Elastic Search and TensorFlow.
- Data storage: Data storage components are the core of any solutions approach. From raw data to mission-critical records, the choice of storage can have a profound impact on the capacity, performance, long-term reliability and durability of any storage infrastructure. The system should have failover, backup and disaster recovery mechanisms. Data generated from various data sources may be structured, unstructured or semi-structured. Solutions should have a provision to process, format and message (if needed), and then provide the relevant storage options like SQL, NOSQL, a data warehouse, etc. The data storage platform depends on the nature of the data and the business needs. Some of the open source data storage options are MongoDB, MySQL, PostgreSQL, Redis, Couch DB, HBase, and Cassandra.
Reference architecture of edge computing for IoT solutions with the cloud technology stack
Cloud service providers have rich sets of services and technology options for IoT applications and edge computing. Considering the leading cloud service providers as Azure and AWS, Figure 3 depicts the technology choices at various layers of reference architecture.
The following are the cloud technologies and services available.
- Azure IoT Hub: This is a fully managed service that enables reliable and secure bi-directional communication between millions of IoT devices and a solutions back-end. It provides multiple device-to-cloud and cloud-to-device communication options. These options include one-way messaging, file transfers and request-reply methods. It has built-in declarative message routing to other Azure services, and provides extensive monitoring for device connectivity and device identity management events.
- Azure API Management: This is a solution for publishing APIs to external and internal customers. It quickly creates consistent and modern API gateways for existing back-end services hosted anywhere; it secures and protects them from abuse and overuse and gets insights into usage and health. Azure API Management provides the core competencies to ensure a successful API program through developer engagement, business insights, analytics, security and protection.
- Azure IoT Edge: This is an open source solution from Microsoft Azure for edge computing. If offers device management, compute, analytics, operating with offline connectivity and real-time decision making at the edge of an IoT solution. And it helps to reduce the bandwidth costs incurred for data communication to the cloud from the edge. It is a service that delivers cloud capabilities to the edge. Azure IoT Edge provides easy orchestration between code and services, so they flow securely between the cloud and the edge to distribute intelligence across IoT devices. It easily integrates Microsoft Azure and third-party services or augments existing services to create a custom IoT application with business logic. It helps to put intelligence into devices which can act locally, based on the data they generate, while also taking advantage of the cloud to configure, deploy and manage these devices securely and at scale.
- AWS IoT: This is a managed cloud platform that lets connected devices easily and securely interact with cloud applications and other devices. It can support billions of devices and trillions of messages. It can process and route those messages to AWS endpoints and to other devices reliably and securely. With AWS, IoT applications can keep track of and communicate with all devices, all the time, even when they aren’t connected.
- AWS API Gateway: This is a fully managed service that makes it easy for developers to create, publish, maintain, monitor and secure APIs at any scale. With a few clicks in the AWS Management Console, the user can create an API that acts as a ‘front door’ for applications to access data, business logic, or functionality from back-end services. It handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, authorisation and access control, monitoring, and API version management.
- AWS Greengrass: This is a service from AWS for edge computing. It offers local compute, messaging, data caching, sync and machine learning capabilities for connected devices. It ensures quick responses to local events and actions along with local storage, and helps to minimise the cost of transmitting IoT data to the cloud.
Admin information dashboard
Both the leading cloud service providers facilitate administrative consoles to configure, operate, view and manage the IoT devices and data protocols. IoT solutions powered by cloud services can also use these consoles.
Other IoT tools and services
Some of the other IoT specific tools, technologies or services from Azure/AWS are AWS IoT SDK, AWS IoT Registry, AWS IoT Security, AWS Rule Engine, AWS Device Shadows, Azure IoT Device SDK, Azure IoT Protocol Gateway, Azure AD and Azure Device Provisioning.
An end-to-end IoT solution can use many other services from cloud service providers like Azure Data Factory, Azure Stream Analytics, Azure Storage, Azure Cosmos DB, AWS Kinesis, AWS Data Pipeline, AWS SQS, AWS DynamoDB and AWS S3.
Note: Do refer to the AWS and Azure sites for the latest updates on their respective service details.
Reference architecture of edge computing for IoT solutions with the open source technology stack
The following are the technologies/frameworks available.
- Kura: Kura is a Java/OSGi-based open source framework for IoT systems. It has support to access the underlying hardware like serial ports, GPS, watchdog, etc. It supports the management of IoT devices, including configurations and communication. It provides M2M/IoT integration platforms and gateway management. Kura also provides various APIs, interfaces and capabilities for communication, connectivity, network management, data management, messaging, remote management, etc.
- Kapua: This is an IoT platform to manage and integrate devices and their data. It provides an integration framework and other features like a device registry, device management, messaging services, data management and application enablement.
- Spring Boot: This is a spring framework for the development of REST APIs. It facilitates the creation of standalone, production-grade spring based applications. It works with minimum spring configurations.
Other IoT tools and frameworks
There are many other open source IoT tools and frameworks, as listed below.
- Eclipse Hono: This tool works for connectivity and protocol support. It provides various APIs for device communication using arbitrary protocols and also supports protocol customisation.
- Kaa: This open source platform is for implementing end-to-end use cases for IoT solutions. It offers various features such as device management, data collection, configuration management, messaging, events, notifications, end points, etc.
- ThingsBoard: This open source IoT platform facilitates data collection, processing, visualisation, device management, a rule engine, asset management, customisation and integration.
Some other IoT open source projects are OpenIoT, DeviceHive, Node-RED, IoTivity, Mango and OpenThread.
An IoT solution is an amalgamation of hardware, software and networking capabilities. Emerging technologies and IoT devices will lead to the creation of more IoT applications for both consumers and industrial use cases. Edge computing is required for any successful and optimised IoT solution. There are various open source frameworks available in the IoT space. Cloud service providers are also providing very rich services for IoT solutions and edge computing. Recommended guidelines for IoT solutions are: loosely coupled, modular, platform-independent, and based on open standards.