IoT and Embedded Systems
IoT and Embedded Systems
IoT and Embedded Systems
Definition
The Internet of Things (IoT) describes the network of physical objects-
“things”- that are embedded with sensors, software, and other technologies for
the purpose of connecting and exchanging data with other devices and systems
over the Internet.
“The Internet of nThings (IoT) is a system of interrelated computing
devices, mechanical and digital machines, objects, animals or people that are
provided with unique identifiers and the ability to transfer data over a network
without prerequiring human to human or human to computer interaction.
Characteristics of IoT Devices
The Internet of Things (IoT) refers to the network of physical objects (devices,
vehicles, appliances, etc.) that are embedded with sensors, software, and other
technologies to connect and exchange data with other devices and systems over
the internet or other networks. Some key characteristics of IoT include:
1. Connectivity
Devices are interconnected via various communication protocols like Wi-
Fi, Bluetooth, Zigbee, LoRa, or cellular networks. This allows data
exchange and real-time updates between IoT devices and systems.
2. Automation and Control
IoT systems can be automated, enabling devices to perform actions
without human intervention. For example, smart thermostats adjusting
room temperature or lighting based on time of day or occupancy.
3. Data Collection and Analysis
IoT devices gather vast amounts of data from their environment (such as
temperature, humidity, movement, etc.). This data can be analyzed for
insights, trend prediction, and decision-making purposes.
4. Real-time Operation
Many IoT systems work in real-time, providing immediate feedback or
responses based on data received. This is crucial for applications like
autonomous vehicles, healthcare monitoring, or smart grids.
5. Scalability
IoT networks can easily scale by adding more devices or sensors to the
system. This is essential as the IoT ecosystem grows, with billions of
devices expected to be connected in the future.
6. Interoperability
IoT devices from different manufacturers or technologies should work
together seamlessly. Interoperability ensures devices can communicate
and integrate with each other, creating a unified system.
7. Remote Monitoring and Control
IoT allows users to monitor and control devices remotely via
smartphones, computers, or other interfaces. This is especially useful for
applications like home automation, industrial monitoring, or fleet
management.
8. Energy Efficiency
Many IoT devices are designed to be energy-efficient, using low-power
communication methods or having sleep modes to conserve energy,
especially in applications like smart meters or sensor networks.
9. Security and Privacy
Since IoT devices collect sensitive data and are often connected to
networks, ensuring security and privacy is critical. This includes
encryption, secure communication protocols, and regular updates to
prevent unauthorized access or data breaches.
10. Embedded Intelligence
IoT devices can be equipped with AI or machine learning algorithms to
process data locally and make decisions on-site, reducing the need for
external processing and improving efficiency.
11. Edge and Cloud Computing
IoT devices often use edge computing to process data closer to the source
of data collection, reducing latency. Alternatively, data may be sent to the
cloud for analysis and storage, depending on the complexity of the task.
12. Cost-effectiveness
The implementation and maintenance of IoT solutions are becoming
more affordable as technology improves, making IoT more accessible for
both personal and business applications.
These characteristics enable IoT systems to transform industries, improve
convenience, enhance productivity, and provide valuable insights across various
sectors, from healthcare to transportation, agriculture, and smart cities.
Applications of IoT
The concept of the internet of things entered our lives in 1999. However,
in fact the first IoT application has entered our lives before. In 1991, a system
was designed to send images of the coffee machine to the computers of
academics at the university of Cambridge three times a minute. Due to the fact
it is online and in real time, this system is considered to be the first application
of the internet of things in the world. Some of the applications are,
1. Wearables
2. Connected cars/ smart cars
3. Smart cities
4. Smart industries
5. Smart agriculture
6. Smart retail
7. Energy management
8. Smart healthcare
9. Smart poultry and farming
10.Smart dust
The generic architecture of M2M can also be categorized into four phases as
shown. It consists of collection of the data, transmission of the data through the
communication medium/network, assessment of the data collected and response
to the machine based on the assessment.
Example:
Let us take example of smart meter to understand the M2M concept. Smart
meter records the electricity rate which will be communicated to the software
application over some medium using internet. This application process the data
sent by the smart meter and decides whether the consumer device can be
switched on at this time or at later stage to conserve the energy. Hence smart
electricity meter here acts as interface between both consumer as well as for
electric company to save the energy and save the money.
M2M system support a mechanism to manage and interact with multiple M2M
Applications. The M2M system Architecture consists of following:
• M2M Applications
• M2M Transport network, which covers Access network, core network(CN)
and M2M service capabilities
The architecture is divided into M2M Device domain, and a Network and
applications domain.
M2M Capabilities
Following capabilities of M2M have the potential to revolutionize various
industries and applications. Some key M2M capabilities are as follows.
• Remote monitoring
• Data collection and analysis
• Automation of various processes and tasks
• Remote control and management of devices and systems
• Smart grids and energy management to allow real time monitoring and control
of energy
• Predictive maintenance
• Asset tracking
• Environmental monitoring
• Healthcare and telemedicine
• Smart home and IoT applications
M2M Applications
The cellular based M2M solutions provide easier installation and provisioning
targetted mainly for short term deployments. M2M communication could be
carried over mobile networks such as GSM-GPRS, CDMA EVDO networks,
4G LTE etc. In the M2M communication, the role of mobile network is largely
confined to serve as a transport network.
M2M devices vary from highly-mobile vehicles communicating in real-time, to
im-mobile meter-reading appliances that send small amounts of data at random
instants.
It covers the communications between the M2M Gateway(s) and M2M
application(s), e.g. xDSL, LTE, WiMAX, and WLAN.
Cellular M2M is widely adopted in energy,transport,real estate and agriculture
sectors. As mentioned previously smart meter utilizes the energy efficiently and
hence bring down CO2 emissions. Hence M2M helps in lowering the effect of
global warming.
In the transport sector, M2M helps by providing information regarding best
optimized routes to trucks,ships,trains and planes so that wastage of fuel can be
avoided. This also helps reduce CO2 emissions by cutting the distance of the
travel.
M2M helps in building and home management by conserving energy for various
systems viz. cooling, lighting,heating,ventillation and other electronic
appliances. It also provides security for the home or building owner with the
M2M compliant security enabled devices.
In agriculture sector, M2M provides solutions to monitor cattle health and
grazing style, soil monitoring,smart farming and smart watering. This helps
grow large amount of crops with lesser resources and hence save money for the
farmers.
M2M Protocols
M2M (Machine-to-Machine) Communication rely on various standards and
protocols to ensure interoperability and efficient data exchange between devices
and systems. Some of these key standards are described below.
MQTT (Message Queuing Telemetry Transport) : It is public subscribe
messaging protocol designed for IoT and M2M applications. it operates on
broker based architecture which allows devices to publish messages to central
server (i.e. broker) which later distributes those messages to other devices
(subscribers) as per their requests.
CoAP (Constrained Application Protocol) : It is designed for M2M
communication in constrained environments such as low power devices and
networks. it is based on REST architecture.
LwM2M (Lightweight M2M) : It is a protocol developed by Open Mobile
Alliance (PMA) for M2M communication in IoT devices. It is used to manage
and control devices remotely. It can be used for firmware updates, monitoring
and configurations of devices.
HTTP (Hypertext Transfer Protocol) : It is widely used for web
communication. It is used when interacting with web based services and APIs.
DDS (Data Distribution Service) : It is a standard for real time data distribution.
AMQP (Advanced Message Queuing Protocol) : It is a messaging protocol that
allows reliable message delivery between devices and systems.
Zigbee : Low power wireless standard which works in mesh topology. It is
defined in IEEE 802.15.4 standard. It is used in home automation and industrial
settings for M2M communication.
Z-wave : It is another wireless communication standard used in smart home
automation and other M2M applications.
3GPP : It defines various cellular standards which include GSM, LTE and 5G
etc. These standards are often used for M2M communication.
OPC UA : It is machine to machine communication protocol used in industrial
automation to enable interoperability and data exchange between different
machines and systems.
There are several more M2M standards and protocols which include Modbus,
CAN, Thread, Bluetooth, LoRaWAN, Sigfox, AMT, XMPP etc.
Introduction to Various protocols:
MQTT
MQTT is a simple, lightweight messaging protocol used to establish
communication between multiple devices. It is a TCP-based protocol relying on
the publish-subscribe model. This communication protocol is suitable for
transmitting data between resource-constrained devices having low bandwidth
and low power requirements. Hence this messaging protocol is widely used for
communication in the IoT Framework.
Publish-Subscribe Model
This model involves multiple clients interacting with each other, without having
any direct connection established between them. All clients communicate with
other clients only via a third party known as a Broker.
MQTT Client and Broker
Clients publish messages on different topics to brokers. The broker is the central
server that receives these messages and filters them based on their topics. It then
sends these messages to respective clients that have subscribed to those different
topics. The heart of any publish/subscribe protocol is the MQTT broker. A
broker can handle up to thousands of concurrently connected MQTT customers,
depending on how it is implemented. All communications must be received by
the broker, who will then sort them, ascertain who subscribed to each one, and
deliver the messages to the clients who have subscribed. All persistent
customers’ sessions, including missed messages and subscriptions, are likewise
kept by the Broker.
Publish-Subscribe Model
Hence client that has subscribed to a specific topic receives all messages
published on that topic.
Here the broker is central hub that receives messages, filters them, and
distributes them to appropriate clients, such that both message publishers, as
well as subscribers, are clients.
Working of MQTT
MQTT’s publish/subscribe (pub/sub) communication style, which aims to
maximise available bandwidth, is an alternative to conventional client-server
architecture that communicates directly with an endpoint. In contrast, the client
who transmits the message (the publisher) and the client or clients who receive
it (the subscribers) are not connected in the pub/sub paradigm. Third parties—
the brokers—manage the relationships between the publishers and subscribers
because they don’t communicate with one another directly.
Publishers and subscribers, which denote whether a client is publishing
messages or has subscribed to receive messages, are examples of MQTT clients.
The same MQTT client can be used to accomplish these two features. A publish
occurs when a client or device want to submit data to a server or broker.
The term “subscribe” refers to the reversal of the procedure. Several clients can
connect to a broker under the pub/sub paradigm and subscribe to subjects that
interest them.
MQTT
When a broker and a subscribing client lose contact, the broker will store
messages in a buffer and send them to the subscriber whenever the broker is
back up and running. The broker has the right to cut off communication with
subscribers and send them a cached message containing publisher instructions if
the publishing client abruptly disconnects from the broker.
“Publishers send the messages, subscribers receive the messages they are
interested in, and brokers pass the messages from the publishers to the
subscribers,” reads an IBM write-up describing the pub/sub paradigm. MQTT
clients, such as publishers and subscribers, can only speak with MQTT brokers.
Any device or programme that runs a MQTT library can be a MQTT client,
ranging from microcontrollers like the Arduino to entire application servers
housed in the cloud.
Characteristics of MQTT
Lightweight: MQTT is designed to be lightweight, making it suitable for
use in aid-restrained environments inclusive of embedded systems and
low-strength devices. The protocol minimizes bandwidth and processing
overhead, enabling green communication even on restricted networks.
Publish-Subscribe Model: In the publish-subscribe version, clients
(publishers) send messages to subjects, and different clients (subscribers)
acquire messages from subjects of interest. This decoupling of producers
and purchasers permits for flexible and dynamic conversation styles.
Quality of Service (QoS) Levels: MQTT supports exclusive stages of
message delivery warranty, referred to as Quality of Service (QoS). QoS
levels range from 0 to 2, providing various stages of reliability and
message transport guarantees, relying at the utility necessities.
Retained Messages: MQTT lets in agents to store retained messages on
topics, making sure that new subscribers acquire the maximum latest
message posted on a subject right now after subscribing. This
characteristic is beneficial for fame updates and configuration settings.
Last Will and Testament (LWT): MQTT clients can specify a Last Will
and Testament message to be posted by way of the broker in the occasion
of an sudden consumer disconnect. This function affords a mechanism for
detecting patron failures and dealing with them gracefully.
Security: MQTT helps various protection mechanisms, consisting
of Transport Layer Security (TLS) encryption and authentication
mechanisms which include username/password and consumer
certificates. These capabilities make certain the confidentiality, integrity,
and authenticity of messages exchanged over MQTT connections.
Advantages of MQTT
This model is not restricted to one-to-one communication between clients.
Although the publisher client sends a single message on specific topic, broker
sends multiple messages to all different clients subscribed to that topic.
Similarly, messages sent by multiple such publisher clients on multiple different
topics will be sent to all multiple clients subscribed to those topics. Hence one-
to-many, many-to-one, as well as many-to-many communication is possible
using this model. Also, clients can publish data and at the same time receive
data due to this two-way communication protocol. Hence MQTT is considered
to be bi-directional protocol. The default unencrypted MQTT port used for data
transmission is 1883. The encrypted port for secure transmission is 8883.
Lightweight protocol that is quick to create and allows for efficient data
transport
Minimal data packet usage, resulting in low network usage
Effective data dispersion
The effective use of remote sensing and control
Prompt and effective message delivery
Minimises power consumption, which is beneficial for the linked devices,
and maximises network capacity.
Data transmission is quick, efficient, and lightweight because MQTT
messages have small code footprint. These control messages have a fixed
header of size 2 bytes and payload message up to size 256 megabytes.
Disadvantages of MQTT
When compared to Constrained Application Protocol (CoAP), MQTT has
slower send cycles.
Resource discovery in MQTT is based on flexible topic subscription,
while resource discovery in CoAP is based on a reliable system.
MQTT lacks encryption. Rather, security encryption is accomplished by
TLS/SSL (Transport Layer Security/Secure Sockets Layer).
Building an internationally scalable MQTT network is challenging.
The Constrained Application Protocol (CoAP) is a special web transfer
protocol that operates with constrained nodes and networks. These
networks are commonly used for applications such as the Internet of
Things (IoT), where devices may have limited processor, memory, and
power resources. CoAP is intended to be simple, low-overhead, and
efficient, making it ideal for machine-to-machine communication.
CoAP
What is CoAP?
CoAP or Constrained Application Protocol, as the name suggests, is an
application layer protocol that was introduced by the Internet Engineering
Task Force in the year 2014. CoAP is designed for the constrained
environment. It is a web-based protocol that resembles HTTP. It is also
based on the request-response model. Based on the REST-style
architecture, this protocol considers the various objects in the network as
resources. These resources are uniquely assigned a URI or Uniform
Resource Identifier. The data from one resource to another resource is
transferred in the form of CoAP message packets whose format is briefly
described later. The Client requests for some resources and in response to
that, the server sends some response over which the client sends an
acknowledgement. Although, some types of CoAP do not involve the
receiver sending acknowledgments for the information received.
How Does CoAP Works?
Constrained Application Protocol (CoAP) is an application layer
protocol designed for resource-constrained devices and networks,
particularly in the context of the Internet of Things (IoT).
Client-Server Model: CoAP model is essentially a client/server model
enabling the client to request for service from server as needed and the
server responds to client's request.
Resource-Oriented: CoAP treats various objects in the network as
resources, each uniquely identified by a URI (Uniform Resource
Identifier). Clients can request information about these resources, and
servers provide responses2.
Methods: CoAP supports several methods similar to HTTP:
GET
POST
DELETE
PUT
Asynchronous Messaging: CoAP messages are asynchronous because it
uses the User Datagram Protocol (UDP). Unlike TCP-based protocols,
CoAP does not require acknowledgments for every message, which helps
conserve energy in resource-constrained devices.
Energy Efficiency: CoAP is designed to minimize energy consumption
while simplifying communication between clients and devices. It
achieves this by managing resources, providing device descriptions, and
supporting mechanisms to determine if a device is powered on or off.
Methods in CoAP
GET - The get method is used to retrieve resource information identified
by the request URI. In response to GET method success a 200(OK)
response is sent.
POST - The post method creates a new subordinate resource under the
parent URI requested by it to the server. On successful resource creation
on the server, a 201 (Created) response is sent while on failure a 200
(OK) response code is sent.
DELETE - The delete method deletes the resource identified by the
requested URI and a 200 (OK) response code is sent on successful
operation.
PUT - The PUT method updates or creates the resource identified by the
request URI with the enclosed message body. The message body is
considered as modified version of a resource if it already exists at the
specified URI otherwise a new resource with that URI is created. A 200
(OK) response is received in former case whereas a 201 (Created)
response is received in later case. If the resource is neither created nor
modified then an error response code is sent.
The most fundamental difference between CoAP and HTTP is that CoAP
defines a new method which is not present in HTTP. This method is
called Observe method. The observe method is very similar to the GET
method in addition with an observe option. This alerts the server, to send
every update about the resource to the client. Therefore, upon any change
in the resource, the server sends a response to the client. These responses
could either be directly sent individually or they can be piggy-backed.
Message Format of CoAP
CoAP messages are encoded in binary-format or 0/1 format. Like other
message formats, CoAP message has a header and a payload section
along with an optional section. The size of CoAP header is 4 bytes or 32
bits. This size is fixed for every CoAP message. Whereas the other part of
message is the optional part which includes payload and tokens of
variable size ranging from 0-8 bytes. The message format of CoAP
contains the following fields:
Version - The size of version field is 2 bits. It represents the version of
the CoAP protocol.
Type Code - The size of type field is 2 bits. There are four types of
messages namely confirmable, non-confirmable, acknowledgement and
reset represented by the bit patterns 00, 01, 10, 11 respectively.
Option Count - The size of option count field is 4 bits. These 4 bits,
means there could be a total of 16 possible options in header.
Code - The size of code field is 8 bits. This indicates whether message is
empty, request message or response message.
Message ID - The size of message ID field is 16 bits. It is used to detect
the message duplication and types of messages.
Tokens [Optional] - The size of tokens field is variable which ranges
from 0-8 bytes. It's used to match a response with request.
Options [Optional] - The options field in CoAP message has a variable
size. It defines the type of payload message.
Payload [Optional] - Similar to options field, the payload field has a
variable size. The payload of requests or of responses is typically a
representation of the requested resource or the result of the requested
action.
CoAP Message Format
CoAP Features
Lightweight and Simple
RESTful Architecture
UDP-Based
Asynchronous Communication
Low Header Overhead
Multicast Communication
Proxy and Caching
Applications of CoAP
Real Time Monitoring in Grid - Smart cities can monitor the
distribution and generation of power remotely. The CoAP sensors could
be embedded inside the transformers and the data could be transferred
over GPRS or 6LowPAN.
Defense utilities - The armory and tanks are now-a-days fitted with
sensors so that information could be communicated remotely without any
interference. The CoAP sensors could detect any intrusion. This makes
them capable to transfer more data even under low bandwidth network.
Aircraft utilities - The Aircraft sensors and actuators could be connected
with other sensors and communication can take place using smart CoAP
based sensors and actuators.
6LoWPAN
6LoWPAN stands for IPv6 over Low-Power Wireless Personal Area
Networks. It’s a communication protocol designed to enable small, low-
power devices to connect over wireless networks. In this article, we will
discover everything about 6LoWPAN and its various advantages and
disadvantages.
What is 6LoWPAN?
6LoWPAN is an IPv6 protocol, and It’s extended from IPv6 over Low
Power Personal Area Network. As the name itself explains the meaning of
this protocol is that this protocol works on Wireless Personal Area
Network. WPAN is a Personal Area Network (PAN) where the
interconnected devices are centered around a person’s workspace and
connected through a wireless medium. You can read more about WPAN
at WPAN. 6LoWPAN allows communication using the IPv6 protocol.
IPv6 is Internet Protocol Version 6 is a network layer protocol that allows
communication to take place over the network. It is faster and more
reliable and provides a large number of addresses.
6LoWPAN initially came into existence to overcome the conventional
methodologies that were adapted to transmit information. But still, it is
not so efficient as it only allows for the smaller devices with minimal
processing ability to establish communication using one of the Internet
Protocols, i.e., IPv6. It has very low cost, short-range, low memory usage,
and low bit rate. It comprises an Edge Router and Sensor Nodes. Even the
smallest of the IoT devices can now be part of the network, and the
information can be transmitted to the outside world as well. For example,
LED Streetlights.
Distribution Layer:
This layer basically provides policy-based connectivity and acts as a boundary
between the Access Layer and the Core Layer. Data Filtering and Routing take
place in this layer.
The Distribution Layer is mainly responsible for collecting/aggregating
data from the Switches of the Access Layer and distributing it to the rest
of the network.
It acts as a border as well as a connector to both the Access Layer and the
Core Layer.
It provides policy-based security by using Access Control Lists
(ACLs) and filtering.
The use of routing services (like EIGRP, OSPF. Etc.) also takes place in
this layer.
It provides Redundancy and Load Balancing.
Core Layer:
This layer is often considered to be the Backbone of the network which
provides fast transport between the switches present in the Distribution Layer of
the network. The Core Layer is considered to be the Backbone of the network
and acts as an aggregation point for multiple networks.
It consists of high-speed network devices responsible for switching
packets as fast as possible.
It provides interconnectivity between the Distribution Layer devices.
It provides reliability and fault tolerance to maximize performance.
It also plays a crucial role in avoiding CPU-intensive packet manipulation
caused by security services (restrictive ACLs), Quality of Service (QoS)
classification, inspection, etc.
In telemedicine, M2M devices can enable the real time monitoring of patients'
vital statistics, dispensing medicine when required or tracking healthcare assets.
The combination of the IoT, AI and ML is transforming and improving mobile
payment processes and creating new opportunities for different purchasing
behaviors. Digital wallets, such as Google Wallet and Apple Pay, will most
likely contribute to the widespread adoption of M2M financial activities.
Smart home systems have also incorporated M2M technology. The use of M2M
in this embedded system enables home appliances and other technologies to
have real time control of operations as well as the ability to remotely
communicate.
M2M is also an important aspect of remote-control software, robotics, traffic
control, security, logistics and fleet management and automotive.
Key features of M2M
Key features of M2M technology include:
Low power consumption, in an effort to improve the system's ability to
effectively service M2M applications.
A Network operator that provides packet-switched service
Monitoring abilities that provide functionality to detect events.
Time tolerance, meaning data transfers can be delayed.
Time control, meaning data can only be sent or received at specific
predetermined periods.
Location specific triggers that alert or wake up devices when they enter
particular areas.
The ability to continually send and receive small amounts of data.
M2M requirements
According to the European Telecommunications Standards Institute (ETSI),
requirements of an M2M system include:
Scalability - The M2M system should be able to continue to function
efficiently as more connected objects are added.
Anonymity - The M2M system must be able to hide the identity of an
M2M device when requested, subject to regulatory requirements.
Logging - M2M systems must support the recording of important events,
such as failed installation attempts, service not operating or the
occurrence of faulty information. The logs should be available by request.
M2M application communication principles - M2M systems should
enable communication between M2M applications in the network and the
M2M device or gateway using communication techniques, such as short
message service (SMS) and IP Connected devices should also be able to
communicate with each other in a peer-to-peer (P2P) manner.
Delivery methods - The M2M system should support Unicast,
anycast, multicast and broadcast communication modes, with broadcast
being replaced by multicast or anycast whenever possible to minimize the
load on the communication network.
Message transmission scheduling - M2M systems must be able to control
network access and messaging schedules and should be conscious of
M2M applications' scheduling delay tolerance.
Message communication path selection - Optimization of the message
communication paths within an M2M system must be possible and based
on policies like transmission failures, delays when other paths exist and
network costs.
UDP
User Datagram Protocol (UDP) is a Transport
Layer protocol. UDP is a part of the Internet Protocol suite, referred to as
UDP/IP suite. Unlike TCP, it is an unreliable and connectionless protocol. So,
there is no need to establish a connection before data transfer. The UDP helps to
establish low-latency and loss-tolerating connections over the network. The
UDP enables process-to-process communication.