Module1- IOT Notes (1)
Module1- IOT Notes (1)
CHARACTERISTICS OF IOT:
• Dynamic & Self-Adapting
IoT devices and systems have the capability to dynamically adapt to changing contexts and
take actions based on operational conditions, user context, or sensed environmental
parameters.
Example: In a surveillance system with multiple cameras, devices can switch between
normal and infrared night vision based on time of day, or adjust from low to high resolution
when motion is detected, alerting nearby cameras to do the same.
• Self-Configuring
IoT devices can automatically configure themselves, allowing a large number of devices to
collaborate with minimal manual intervention. This includes establishing network
connections, updating software, and adjusting configurations to suit operational
requirements.
Page 1
Example: Weather monitoring stations automatically connecting to a central server,
configuring network parameters, and downloading the latest firmware updates.
• Interoperable Communication Protocols
IoT devices typically support standardized, interoperable communication protocols,
enabling them to interact seamlessly with devices from different manufacturers as well as
with cloud or local infrastructure.
Example: Smart home devices from various brands communicating over protocols like
MQTT or CoAP to integrate into a single automation system.
• Unique Identity
Each IoT device possesses a unique identifier (such as an IP address, MAC address, or URI)
that ensures precise addressing, monitoring, and control. Intelligent interfaces adapt to
context, allowing users to query, monitor, and control devices remotely.
Example: A connected thermostat with a unique IP address enabling remote monitoring and
control via a mobile app.
• Integrated into the Information Network
IoT devices are integrated into broader networks that allow communication, discovery, and
exchange of data with other devices and systems. This integration enables collaborative
intelligence, were aggregated data leads to smarter decision-making.
Example: A network of weather monitoring nodes exchanging data, which is aggregated
and analyzed to generate accurate regional weather forecasts.
• Connectivity
Reliable connectivity is the backbone of IoT, enabling devices to exchange data with each
other and with cloud platforms in real time. This can involve wired or wireless technologies
such as Wi-Fi, Zigbee, LoRa, or cellular networks.
Example: A smart energy meter transmitting usage statistic to the utility company via LTE.
• Intelligence and Identity
Many IoT devices embed local intelligence for decision-making and always maintain a
unique identity to ensure secure and context-aware interaction.
Example: A factory robot that autonomously adjusts speed and precision based on product
type while being uniquely identifiable in the production network.
• Scalability
IoT systems must be capable of scaling from a few devices to millions without
compromising performance, reliability, or security.
Page 2
Example: A nationwide network of connected traffic lights that can handle growth in
connected intersections as cities expand smart infrastructure.
Page 3
b) Microprocessors
• Microprocessors are more powerful than microcontrollers. They act as central
computing units, capable of running operating systems like Linux, handling
multitasking, and supporting high-speed computation.
• Features:
• High processing speed (GHz range).
• Large memory support and external peripherals.
• Can run complex IoT applications and analytics locally (edge computing).
• Examples:
• ARM Cortex Processors → Found in smartphones and advanced IoT boards.
• Intel Atom → Designed for embedded IoT applications with higher
computational requirements.
• Raspberry Pi (Model 3/4) → Low-cost processor board with Linux OS support,
making it suitable for gateways and IoT servers.
• Use Case: Smart home hub using Raspberry Pi 4 as a central processor to manage
multiple IoT devices.
c) Sensors
• Sensors are devices that sense or measure physical conditions from the surrounding
environment and convert them into electrical signals.
• Types of Sensors & Examples:
• Temperature Sensors: LM35, DHT11/DHT22.
• Humidity Sensors: DHT11, hygrometers.
• Motion Sensors: Passive Infrared (PIR).
• Light Sensors: LDR, photodiodes.
• Gas Sensors: MQ series (CO2, LPG, methane detection).
• Role in IoT: They are the primary data sources, enabling IoT systems to monitor
environments and trigger automated actions.
• Use Case: DHT22 sensor monitoring temperature and humidity in a greenhouse and
sending data to the cloud.
d) Actuators
• Actuators are devices that take input signals (electrical) and produce physical actions.
They allow IoT systems to interact with the real world.
• Examples:
Page 4
• Motors (DC, servo, stepper) → Robotics and automation.
• Relays → Switching appliances remotely.
• LEDs and buzzers → Visual and audio alert systems.
• Importance: They transform IoT devices from passive observers into active controllers
of their environments.
• Use Case: Automatic door lock system controlled via IoT-enabled actuators.
e) Communication Modules
• These modules provide connectivity and enable IoT devices to exchange data with each
other and with the cloud.
• Examples:
• Wi-Fi modules (ESP8266, ESP32) → Short-range IoT.
• Bluetooth modules (HC-05, HC-06) → Wearables and smart gadgets.
• LoRa modules → Long-range IoT networks.
• GSM/4G/5G modules (SIM800L, SIM900) → Cellular IoT applications.
• Role: Ensure real-time, reliable, and scalable communication between IoT devices.
• Use Case: Smart water meter using LoRa to transmit usage data over long distances.
f) Gateways and Routers
• Gateways serve as intermediaries between local IoT devices and the broader Internet.
They manage device connectivity, security, and protocol translation.
• Functions:
• Protocol conversion (e.g., Zigbee → IP).
• Data buffering and filtering.
• Security enforcement.
• Examples: Cisco IoT gateways, Intel IoT Gateways, Raspberry Pi-based custom
gateways.
• Use Case: Smart city streetlights connected via Zigbee, with a gateway converting data
to cloud-based IoT platforms.
g) Cloud and Storage Units
• IoT generates large volumes of data that require secure storage, processing, and
analytics. Cloud platforms provide scalable and distributed infrastructure for IoT.
• Examples:
• AWS IoT Core.
• Microsoft Azure IoT Hub.
Page 5
• Google Cloud IoT Core.
• Ubidots (IoT visualization platform).
• Role:
• Long-term data storage.
• Big data analytics.
• Machine learning integration for predictions.
• Remote device management.
• Use Case: Smart healthcare wearable devices storing patient health records securely on
AWS IoT Cloud.
1. THINGS IN IOT
The “Things” in IoT refer to IoT devices that possess unique identities and capabilities
for remote sensing, actuating, and monitoring. These devices can:
• Exchange data with other connected devices and applications (directly or
indirectly).
• Collect data from other devices and process it locally or send it to centralized
servers or cloud-based application back-ends.
• Perform certain tasks locally and others within the IoT infrastructure depending on
memory, processing power, communication latency, network speeds, and deadlines.
A typical IoT device consists of several interfaces:
1. I/O interfaces for connecting sensors and actuators.
2. Internet connectivity interfaces (wired and wireless).
3. Memory and storage interfaces for data handling.
4. Audio/Video interfaces for multimedia communication.
Page 6
IoT devices can:
• Collect data from onboard or attached sensors (e.g., temperature, humidity, light
intensity).
• Communicate sensed data to other devices or cloud servers.
• Control actuators to interact with physical systems (e.g., turn appliances on/off).
Example:
A relay switch connected to an IoT device can automatically switch an appliance on or off
based on commands received over the Internet.
IoT devices come in various forms:
• Wearable sensors
• Smartwatches
• LED lights
• Automobiles
• Industrial machines
Page 7
2. IOT PROTOCOLS
In the Internet of Things (IoT) ecosystem, protocols define the rules and formats for
communication between devices, gateways, servers, and applications. They determine how
data is structured, transmitted, and received across the IoT network. IoT protocols are
designed to operate efficiently over constrained environments, where devices may have
limited computing resources, low bandwidth, and intermittent connectivity.
The Application Layer in the IoT protocol stack provides the interface between IoT devices
and end-user applications.
At this layer, protocols are application-specific but must be lightweight, scalable, and
optimized for constrained IoT devices.
Page 8
1. MQTT (Message Queue Telemetry Transport)
• MQTT is a lightweight pub/sub messaging protocol for IoT. Devices (clients) connect
to a central broker. Publishers send messages to topics on the broker, and the broker
forwards each message to all clients subscribed to that topic. This decouples publishers
and subscribers (they need not know each other).
• Features: Very low protocol overhead (MQTT headers can be as small as 2 bytes).
Operates over TCP with optional QoS levels (for reliable delivery). Brokers support
retained messages, last-will notifications, and efficient many-to-many distribution.
Designed for intermittent or low-bandwidth links, MQTT is well-suited for constrained
environments.
• Example: In a smart home, a temperature sensor publishes its readings every minute
to topic home/groundfloor/temperature. A thermostat controller and a smartphone app
are subscribed to that topic, so they immediately receive the latest temperature. This
lets the controller adjust heating in real time and the user monitor conditions.
An MQTT client can act as a publisher to send data (or resource information) to an MQTT
server acting as an MQTT message broker.
• In the figure, the MQTT client on the left side is a Temperature (Temp) and Relative
Humidity (RH) sensor that publishes its Temp/RH data.
• The MQTT server (message broker) accepts the network connection along with
application messages, such as Temp/RH data, from the publishers.
Page 9
• It also handles the subscription and unsubscription process and pushes the
application data to MQTT clients acting as subscribers.
• The application on the right side of the figure is an MQTT client that is a subscriber
to the Temp/RH data being generated by the publisher or sensor on the left.
The presence of a message broker in MQTT decouples the data transmission between clients
acting as publishers and subscribers.
• Publishers and subscribers do not need to know about each other’s existence.
• A key benefit of this decoupling is that the MQTT message broker can buffer and
cache information in case of network failures, ensuring reliable delivery when the
network is restored.
MQTT messages are exchanged between clients and the broker in a specific control packet
structure, which ensures efficient, lightweight communication. The MQTT message consists
of three main parts:
Page 10
• DUP (Duplicate Delivery Flag) – Set to 1 if the message is a duplicate of an earlier
attempt (for retransmissions).
• QoS (Quality of Service Level) – Indicates the delivery guarantee level:
0 – At most once (no acknowledgment).
1 – At least once (requires acknowledgment).
2 – Exactly once (two-phase handshake).
• Retain – When set, instructs the broker to retain the last message for new subscribers.
• Remaining Length – Specifies the number of bytes remaining in the message (variable
header + payload).
2. Variable Header (Optional)
The Variable Header is present in some control packets and contains additional control
information specific to the message type.
Examples:
• For CONNECT – Contains protocol name, version, connect flags, and keep-alive
timer.
• For PUBLISH – Contains the topic name and packet identifier (if QoS > 0).
3. Payload (Optional)
The Payload contains the actual application data being transmitted.
Examples:
• For PUBLISH – Contains the actual sensor readings, status updates, or messages.
• For SUBSCRIBE – Contains the list of topic filters to which the client wants to
subscribe.
• For CONNECT – Contains the client identifier, username, and password (if used).
Page 11
The figure shows the MQTT Control Field, which is a part of the fixed header in every MQTT
Control Packet. It is always 1 byte (8 bits) and is divided into two parts:
• Since 4 bits are used, it can represent 16 different packet types (0–15).
• Examples:
• 0001 → CONNECT
• 0010 → CONNACK
• 0011 → PUBLISH
• 0100 → PUBACK
• 1000 → SUBSCRIBE
• 1001 → SUBACK
• 1110 → DISCONNECT
Thus, the packet type tells whether the control packet is for connection establishment,
publishing messages, acknowledgments, subscription handling, or disconnecting.
2. Flags (4 bits)
• Examples:
• For other packets, flags may be reserved and must be set to specific values (like
0000).
Page 12
MQTT Message Types
The following table lists the MQTT protocol messages exchanged between a client and a
broker:
CONNECT Client to server (i.e., Broker), the client requests to connect to the server.
Page 13
Applications of MQTT
1. Smart Homes and Building Automation
• Used in smart lighting, HVAC (Heating, Ventilation, Air Conditioning), and energy
management.
• Example: A smart thermostat publishes temperature data, and smart appliances
subscribe to it for automated control.
2. Industrial IoT (IIoT) and Manufacturing
• Real-time monitoring of machines and predictive maintenance.
• MQTT ensures reliable message delivery even with intermittent connectivity in
factories.
3. Healthcare and Wearables
• IoT-enabled medical devices send patient data (e.g., heart rate, blood pressure) to
hospital servers or doctors.
• Useful in remote patient monitoring and telemedicine.
4. Automotive and Transportation
• Vehicle telematics (GPS, fuel usage, diagnostics) uses MQTT to transmit data to
fleet management systems.
• Supports real-time vehicle tracking and predictive maintenance.
5. Agriculture and Smart Farming
• Sensors publish soil moisture, temperature, and humidity data.
• Automated irrigation systems subscribe and take action accordingly.
6. Energy Systems and Smart Grids
• Used for monitoring power consumption, solar panels, and wind turbines.
• Enables demand-response management in smart grids.
7. Supply Chain and Logistics
• Shipment tracking sensors publish location and environmental conditions (e.g.,
temperature of perishable goods).
• Logistics platforms subscribe for real-time updates.
8. Surveillance and Security Systems
• Security cameras and motion sensors publish alerts.
• Monitoring applications subscribe to trigger alarms or notifications.
9. Social Media and Messaging Apps
Page 14
• Some real-time chat and collaboration applications (similar to Twitter-like updates)
use MQTT for instant delivery of notifications.
10. Environmental Monitoring
• Deployed in smart cities for monitoring air quality, pollution levels, and weather
data.
• Data is published from distributed sensors and subscribed by analytics dashboards.
• CoAP is a web-transfer protocol for constrained devices (often called “HTTP for
IoT”). Like HTTP, it uses a RESTful request/response model with methods such as
GET, PUT, POST, DELETE. However, CoAP runs over UDP (not TCP), uses much
smaller headers, and adds IoT-specific features. It was designed by the IETF CoRE
group to easily translate to HTTP for interoperability.
Page 15
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 Architecture
Page 16
Components in the Architecture
• These are IoT devices such as temperature sensors, smart meters, or light
controllers.
• They use the CoAP protocol to send requests (GET, POST, PUT, DELETE) and
receive responses.
2. CoAP Servers
• Example: A sensor acting as a server provides its readings when a client requests
them.
• CoAP servers respond with lightweight data packets optimized for low-power
networks.
3. Proxy
Page 17
• The Proxy acts as a translator or bridge between the CoAP world (constrained
networks) and the traditional Internet (HTTP).
• Example: A CoAP sensor in a smart home can send its data through a CoAP-
HTTP proxy to an Internet-based cloud application.
• On the Internet side, standard clients (e.g., browsers, apps) use HTTP.
• These interact with servers (e.g., cloud platforms like AWS IoT, Azure IoT
Hub, or web servers).
• The proxy converts CoAP messages to HTTP (and vice versa) so that
constrained devices can communicate seamlessly with Internet applications.
• Example: A sensor (CoAP server) responds to a CoAP client request for data.
• A CoAP-HTTP Proxy translates between CoAP (for IoT devices) and HTTP
(for Internet applications).
• Example: A mobile app using HTTP can still access IoT devices that speak
CoAP through the proxy.
• Data from IoT devices is sent to Internet servers for processing, storage, or
visualization.
Example Scenario
• In a smart home, temperature sensors and light controllers communicate via CoAP.
Page 18
• A cloud application (on the Internet) receives the data in HTTP format, processes it,
and allows users to control devices remotely.
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.
• HTTP is the standard Web application protocol over TCP. It is stateless and
request/response-based. Clients send HTTP requests (GET, POST, PUT, DELETE,
etc.) to a server; the server responds with data (HTML, JSON, etc.). Because it is so
ubiquitous, HTTP is often used in IoT when devices or gateways are powerful enough.
• Example: A smart energy meter posts its usage data once an hour to a cloud server via
an HTTP POST with a JSON payload. A cloud-hosted dashboard pulls data via HTTP
GET to display meter readings. Also, many IoT devices (cameras, routers) host simple
HTTP servers to allow configuration through a web browser.
HTTP Request/Response:
HTTP is a request-response protocol, which means that for every request sent by a client
(typically a web browser), the server responds with a corresponding response. The basic flow
of an HTTP request-response cycle is as follows:
Page 19
• Client sends an HTTP request: The client (usually a web browser) initiates the process
by sending an HTTP request to the server. This request includes a request method (GET,
POST, PUT, DELETE, etc.), the target URI (Uniform Resource Identifier, e.g., a URL),
headers, and an optional request body.
• Server processes the request: The server receives the request and processes it based
on the requested method and resource. This may involve retrieving data from a
database, executing server-side scripts, or performing other operations.
• Server sends an HTTP response: After processing the request, the server sends an
HTTP response back to the client. The response includes a status code (e.g., 200 OK,
404 Not Found), response headers, and an optional response body containing the
requested data or content.
• Client processes the response: The client receives the server's response and processes
it accordingly. For example, if the response contains an HTML page, the browser will
render and display it. If it's an image or other media file, the browser will display or
handle it appropriately.
Methods of HTTP
• GET: Used to retrieve data from a specified resource. It should have no side effects and
is commonly used for fetching web pages, images, etc.
Page 20
• PUT: Used to update or create a resource on the server. It replaces the entire resource
with the data provided in the request body.
• PATCH: Similar to PUT but used for partial modifications to a resource. It updates
specific fields of a resource rather than replacing the entire resource.
• HEAD: Similar to GET but retrieves only the response headers, useful for checking
resource properties without transferring the full content.
• TRACE: Used for debugging purposes to echo the received request back to the client,
though it's rarely used due to security concerns.
Page 21
The Hypertext Transfer Protocol (HTTP) is an application layer protocol used for
communication between clients (usually web browsers, IoT devices, or applications) and
servers (web servers, APIs, or cloud services).
Every HTTP message (also referred to as an HTTP packet) has a well-defined format that
ensures correct communication between client and server.
1. Start-Line
The first line in every HTTP message, known as the start-line, indicates the nature of the
message.
For Requests:
• <Method> <Request-Target> <HTTP-Version>
• Method: Specifies the action to be performed. Common methods include:
▪ GET → Retrieve data.
▪ POST → Send data to the server.
▪ PUT → Update a resource.
▪ DELETE → Remove a resource.
• Request-Target: The resource being requested (e.g., /[Link]).
• HTTP-Version: Protocol version (e.g., HTTP/1.1 or HTTP/2.0).
Example:
GET /products/[Link] HTTP/1.1
For Responses:
• <HTTP-Version> <Status-Code> <Reason-Phrase>
• HTTP-Version: Indicates which version the response follows.
• Status-Code: Numeric code indicating the result of the request.
▪ 200 → OK (successful).
▪ 404 → Not Found.
▪ 500 → Server Error.
• Reason-Phrase: Human-readable description of the status.
Example:
HTTP/1.1 200 OK
2. Header Fields
Following the start-line, headers provide metadata about the request or response.
They are written in key-value pairs:
Header-Name: Header-Value
Page 22
Types of headers:
• General Headers: Common to both request and response (e.g., Date, Connection).
• Request Headers: Give information about the client or expected response (e.g.,
Host, User-Agent, Accept).
• Response Headers: Provide server details or instructions (e.g., Server, Set-
Cookie).
• Entity Headers: Describe the body content (e.g., Content-Type, Content-Length).
Examples:
Host: [Link]
User-Agent: Mozilla/5.0
Content-Type: application/json
Content-Length: 256
Headers instruct the receiver on how to interpret and process the data.
3. Blank Line (CRLF)
• After headers, there is always a blank line (\r\n).
• This line acts as a separator to mark the end of headers and the beginning of the body.
• Without this blank line, the server cannot distinguish headers from the actual content.
4. Message Body
• The body is optional.
• It carries the payload (actual data being transmitted).
• In GET requests, the body is usually absent.
• In POST/PUT requests, the body contains data like:
• HTML form data.
• JSON objects.
• XML payloads.
• Binary data (files, images, videos).
The Content-Length header defines the body size, while Content-Type describes the
format.
Example of HTTP Communication
Request Packet (from Client to Server)
POST /api/data HTTP/1.1
Host: [Link]
User-Agent: IoT-Device/1.0
Page 23
Content-Type: application/json
Content-Length: 47
{"status":"success","message":"Data saved"}
• Start-Line → HTTP/1.1 200 OK
• Headers → Date, Server, Content-Type, Content-Length
• Blank Line → separator
• Body → JSON confirmation message
APPLICATIONS
1. Web Browsing
• HTTP is the foundation of data communication on the World Wide Web (WWW).
• Used to transfer web pages (HTML, CSS, JavaScript) from the server to the client
browser.
• Widely used in RESTful APIs to exchange data between client and server.
• Common in applications such as mobile apps, IoT devices, and cloud services.
Page 24
• Example: Weather apps fetching live data from servers via HTTP requests.
3. File Transfer
4. Streaming Media
5. E-commerce Applications
• Facilitates secure transactions and dynamic page loading in online shopping websites.
6. IoT Applications
• Some email clients and messaging platforms rely on HTTP-based APIs for
retrieving and sending messages.
• Example: Web-based email clients (Gmail, Outlook Web) and apps like Slack.
Page 25
• Features: Supports both point-to-point queues and publish/subscribe (via
exchanges/topics). Messages published to an exchange can be routed to one or more
queues based on rules. AMQP provides advanced features like guaranteed delivery,
transactions, message acknowledgments, and flexible routing. It is heavier than MQTT
but offers strong reliability and security.
• Example: In an industrial IoT deployment, sensors on the factory floor send telemetry
messages to an AMQP exchange on a central server. One queue bound to that exchange
might deliver data to a monitoring dashboard, while another queue archives the data.
Because AMQP queues can persist messages, temporary disconnections do not result
in data loss – the broker holds messages until consumers retrieve them.
AMQP is an acronym used for the Advanced Message Queuing Protocol. It is a protocol that
is used for communication between applications. It is a lightweight, protocol that supports the
applications for data transfer. This protocol is used for its scalability and modularity with the
technologies.
Components of AMQP
• Exchanges: The exchange is responsible for fetching messages and properly arranging
them in the appropriate queue
• Binding: Bindings are a set of predetermined instructions for queuing and exchanging.
It manages message transmission and delivery.
Page 26
• Virtual Host: Vhost is a platform that provides isolation capabilities within the broker.
Multiple vhosts may be functional at the same time, depending on the users and their
access rights.
Applications
• Used for factory automation where thousands of machines and sensors generate
telemetry data.
• Example: Sensor nodes publish data to a central RabbitMQ broker, which routes it to
monitoring dashboards, databases, and control systems.
• Ensures no data loss even if the network is unstable (messages persist in queues).
2. Financial Services
• Stock exchanges, banking systems, and payment gateways use AMQP for real-time
transaction messaging.
• Guarantees transaction integrity, ordering, and reliability, which are critical in financial
operations.
• AMQP underpins many cloud platforms (e.g., Microsoft Azure Service Bus,
OpenStack).
• AMQP allows diverse devices and systems to exchange event-based data with
guaranteed delivery.
5. Enterprise Applications
• ERP, CRM, and supply chain systems rely on AMQP for message-based integration.
Page 27
6. Healthcare Systems
• Medical IoT devices (e.g., patient monitoring sensors) send critical health data via
AMQP.
• Data is reliably queued and delivered to hospital dashboards and cloud storage, ensuring
availability for doctors.
7. Telecommunications
• Telecom companies use AMQP for billing systems, service orchestration, and
subscriber event handling.
• Features: Uses an open federated architecture with unique IDs (JIDs). XMPP streams
small XML "stanzas" between entities. It inherently supports presence (knowing if a
device/client is online), and has extensions for publish/subscribe (XMPP PubSub) and
remote service invocation. Because XMPP is bidirectional and persistent, it’s suited to
applications needing realtime chat-like interaction or status updates.
• Example: A smart home hub could use XMPP to track its devices: each device connects
to the XMPP server and announces its presence. When a door sensor opens, it sends an
XMPP message (a presence changes or custom stanza) to the hub, which immediately
triggers an alarm or notification. Voice-assistant devices also sometimes use XMPP to
stream events or alerts.
Page 28
XMPP follows a client–server–gateway model, ensuring efficient real-time communication.
1. XMPP Client
• These are end-user applications (like chat apps, IoT devices, or presence trackers).
• Clients connect to an XMPP server using XML-based messages called stanzas.
• Functions:
• Send and receive messages.
• Maintain presence information (online, offline, busy, etc.).
• Subscribe to services like group chat, file sharing, or IoT data exchange.
2. XMPP Server
• Acts as the central hub for handling communication.
• Responsibilities:
• Route messages between clients connected to the same server.
• Inter-server communication: connect with other XMPP servers to forward
messages to external clients.
• Authentication & authorization: validate connected clients.
• Presence management: keeps track of online/offline states.
3. Inter-server Communication
• XMPP servers can directly communicate with each other.
• Example: A client on Server A can chat with a client on Server B through server-to-
server links.
• This creates a federated network (like email), meaning no single point of control.
4. XMPP Gateway
• A special component that connects XMPP to other technologies/protocols (e.g., SMS,
email, or legacy messaging systems).
• It translates XMPP stanzas into another protocol’s format and vice versa.
• Example: XMPP-to-SMS gateway allows sending instant messages as text messages.
5. Other Technology
• Represents external systems connected through gateways (e.g., traditional email, IoT
platforms, or proprietary chat apps).
Applications:
1. Smart Homes & Automation
• Device presence management (knowing which devices are online/offline).
Page 29
• Example: Door sensors, smart bulbs, and alarms notifying the hub instantly.
2. Healthcare & Wearables
• Real-time sharing of patient vitals (heart rate, blood pressure, oxygen levels).
• Enables remote monitoring and emergency alerts.
3. Industrial IoT (IIoT)
• Factory machines sending live status updates and fault notifications.
• Monitoring and controlling production lines remotely.
4. Smart Cities
• Managing streetlights, traffic signals, and energy meters.
• Sending real-time alerts for accidents, congestion, or public safety.
5. Collaboration & Messaging Platforms
• Used in chat systems like Google Talk (earlier), WhatsApp (initial versions), Slack
gateways.
• Supports group chat, file sharing, and presence info.
6. Real-time Notifications
• Event-driven IoT applications such as fire alarms, motion detection, and intrusion
alerts.
• Voice assistants (e.g., Alexa-type devices) streaming alerts via XMPP.
7. Cross-Protocol Communication via Gateways
• Bridging IoT devices with SMS, Email, or legacy messaging systems.
• Example: XMPP-to-SMS gateways for remote alerts.
8. Education & Research IoT Platforms
• Universities and labs use XMPP for testbeds involving sensor-to-sensor messaging.
Page 30
1. IoT Functional Blocks
An IoT system comprises of a number of functional blocks that provide the system the
capabilities for identification, sensing, actuation, communication, and management as
shown in Figure. These functional blocks are described as follows:
• Device: An IoT system comprises of devices that provide sensing, actuation,
monitoring and control functions.
• Communication: The communication block handles the communication for the IoT
system.
• Services: An IoT system uses various types of IT services such as services for device
monitoring, device control services, data publishing services and services for device
discovery.
• Management: Management functional block provides various functions to govern
the IoT system.
• Security: Security functional block secures the loT system and by providing
functions such as authentication, authorization, message and content integrity, and
data security.
• Application: IoT applications provide an interface that the users can use to control
and monitor various aspects of the IoT system. Applications also allow users to view
the system status and view or analyze the processed data.
Page 31
application requirements, IoT systems may adopt synchronous request–response patterns,
asynchronous publish–subscribe mechanisms, queue-based push–pull methods, or
persistent exclusive pair connections.
Page 32
subscribed consumers. Below Figure shows the publisher-broker-consumer interactions
in the publish-subscribe model.
2.3 Push-Pull: Push-Pull is a communication model in which the data producers push the
data to queues and the consumers pull the data from the queues. Producers do not need
to be aware of the consumers. Queues help in decoupling the messaging between the
producers and consumers. Queues also act as a buffer which helps in situations when
there is a mismatch between the rate at which the producers push data and the rate rate
at which the consumers pull data. Below Figure shows the publisher-queue-consumer
interactions in the push-pull model.
2.4 Exclusive Pair: Exclusive Pair is a bi-directional, fully duplex communication model
that uses a persistent connection between the client and server. Once the connection is
setup it remains open until the client sends a request to close the connection. Client and
server can send messages to each other after connection setup. Exclusive pair is a stateful
communication model and the server is aware of all the open connections. Below Figure
shows the client-server interactions in the exclusive pair model.
Page 33
Figure 2.4: Exclusive Pair Communication Model
IoT communication APIs define how IoT applications and devices interact with each other,
cloud platforms, or user interfaces. They serve as standardized mechanisms for data exchange,
enabling interoperability between heterogeneous systems.
The REST architectural constraints apply to the components, connectors, and data
elements within a distributed hypermedia system.
Page 34
Figure 1: Communication with REST APIs
1. Client–Server
• The client is not concerned with data storage (server's role), and the server
is not concerned with the user interface (client's role).
2. Stateless
• Each request from client to server must contain all required information to
process the request.
• The server does not store session state; the state is entirely maintained by
the client.
3. Cache-able
4. Layered System
• Components can only see and interact with the immediate layer they
communicate with.
5. Uniform Interface
Page 35
• Resources are identified via URIs and are separate from their
representations.
• Servers can provide executable code (e.g., scripts) for clients to execute
locally.
• HTTP Methods: Uses standard methods such as GET, PUT, UPDATE, and DELETE.
Page 36
• Data Formats: Requests and responses typically use JSON or XML for data
representation.
1. Client Request: The client sends a request (GET, PUT, UPDATE, or DELETE) with
an optional payload (JSON/XML).
2. Server Response: The server returns a response containing data or a status message in
JSON/XML.
REST is well-suited for IoT scenarios that require simple, scalable, and loosely
coupled communication between distributed devices and services, but it may
introduce higher latency compared to persistent connections like WebSockets,
especially in real-time applications.
Page 37
• Popular Media Types: JSON (most common) and XML.
• The IP for Smart Objects Alliance (IPSO Alliance) has published an Application
Framework defining RESTful design for IP smart object systems.
Page 38
IOT ENABLING TECHNOLOGIES
IoT is enabled by several technologies including wireless sensor networks, cloud computing,
big data analytics, embedded systems, security protocols and architectures, communication
protocols, web services, mobile Internet, and semantic search engines. This section provides
an overview of some of these technologies which play a key-role in IoT.
Page 39
event of failure of some nodes or addition of new nodes to the network, the network can
reconfigure itself.
Page 40
• Software-as-a-Service (Saas): SaaS provides the users a complete software
application or the user interface to the application itself. The cloud service provider
manages the underlying cloud infrastructure including servers, network, operating
systems, storage and application software, and the user is unaware of the underlying
architecture of the cloud. Applications are provided to the user through a thin client
interface (e.g., a browser). SaaS applications are platform independent and can be
accessed from various client devices such as workstations, laptop, tablets and smart-
phones, running different operating systems. Since the cloud service provider manages
both the application and data, the users are able to access the applications from
anywhere.
Page 41
and how frequently it varies. Modern IT, industrial and other systems are generating
data at increasingly higher speeds.
• Variety: Variety refers to the forms of the data. Big data comes in different forms such
as structured or unstructured data, including text data, image, audio, video and sensor
data.
Page 42
Some embedded systems have specialized processors such as digital signal
processors (DSPs), graphics processors and application specific processors. Embedded
systems run embedded operating systems such as real-time operating systems (RTOS).
Embedded systems range from low-cost miniaturized devices such as digital watches to
devices such as digital cameras, point of sale terminals, vending machines, appliances (such
as washing machines), etc. In the next chapter we describe how such devices form an
integral part of IoT systems.
Page 43
• Examples: ARM Cortex-M series, ESP32, Raspberry Pi SoC.
3. Memory
5. Power Supply
2. Processing: The processor analyzes the sensed data, applies algorithms, and makes
logical decisions.
Page 44
5. Communication: Data is transmitted via communication modules (Wi-Fi, Zigbee,
LoRa, Bluetooth, 5G) to cloud servers for remote access.
Page 45