UNIT 3
Protocol Classification
Protocol classification
IoT protocols can be broadly classified into
• Data protocols
• Network protocols.
• Data protocols focus on the content and format of information exchange,
• Network protocols handle the physical and logical connection of devices.
• Additionally, protocols can be categorized by their application layer (e.g., MQTT, CoAP),
transport layer (e.g., TCP, UDP), or network layer (e.g., IPv6, 6LoWPAN).
Data Protocols
How data is formatted and exchanged between devices.
Examples:
• MQTT (Message Queuing Telemetry Transport): A lightweight publish-
subscribe protocol ideal for resource-constrained IoT devices.
• CoAP (Constrained Application Protocol): A specialized protocol for
constrained devices and networks, often used with MQTT.
• AMQP (Advanced Message Queuing Protocol): A robust, open-standard
protocol for asynchronous messaging.
• DDS (Data Distribution Service): A middleware protocol for data-centric
connectivity in real-time systems.
• XMPP (Extensible Messaging and Presence Protocol): An extensible
protocol used for real-time communication and messaging.
Network Protocols
Focus:
• Establish the connection and communication paths between devices, often using
IP addressing and routing.
Examples:
• IPv6: The latest version of the Internet Protocol, enabling a vast number of
devices to connect.
• 6LoWPAN: A protocol that allows IPv6 to operate over low-power wireless
personal area networks, like those used in smart homes.
• Bluetooth/Bluetooth Low Energy (BLE): Short-range wireless communication
protocols, widely used in wearables and smart home devices.
• Wi-Fi: A common wireless networking standard for connecting devices to local
networks.
• LoRaWAN: A low-power wide-area networking protocol designed for long-range,
low-bitrate communication.
Other Categorizations
By Application Layer:
• Protocols like HTTP, CoAP, and MQTT are used for communication between
devices and applications (or cloud services).
By Transport Layer:
• Protocols like TCP and UDP provide reliable or unreliable data transmission,
respectively.
By Physical and Data Link Layers:
• Protocols like IEEE 802.15.4 (Zigbee, etc.) define the physical and data link
layer characteristics for low-power, low-rate wireless communication.
By Network Type:
• Protocols can be classified based on the type of network they operate on, such
as Personal Area Networks (PAN), Local Area Networks (LAN), or Wide Area
Networks (WAN).
Message Queuing Telemetry Transport(MQTT)
• MQTT is a lightweight, publish-
subscribe network protocol that is
widely used in the Internet of Things
(IoT) for efficient communication
between devices, particularly in
resource-constrained environments.
• It's designed for low bandwidth,
high latency, and unreliable
networks, making it ideal for
connecting devices like sensors and
actuators in IoT applications
Key Features and Concepts:
Publish/Subscribe Model:
• MQTT operates on a publish/subscribe model, where devices (clients) can publish
messages to specific topics, and other devices can subscribe to those topics to receive the
messages.
Broker:
• A central MQTT broker acts as an intermediary, receiving messages from publishers,
filtering them based on topics, and delivering them to subscribers.
Lightweight:
• MQTT is designed to be light `weight, minimizing the overhead of messages and
maximizing efficiency, especially crucial for resource-constrained IoT devices.
Low Bandwidth and High Latency:
• MQTT is well-suited for environments where bandwidth is limited and network latency can
be high, making it suitable for remote and mobile applications.
Quality of Service (QoS):
• MQTT offers different QoS levels (0, 1, and 2) to ensure message delivery reliability, from
"at most once" to "exactly once".
Security:
• MQTT supports TLS encryption for secure communication between clients and the broker,
MQTT Use Cases in IoT
Smart Homes:
• Controlling and monitoring smart appliances, lighting, and
security systems.
Industrial Automation:
• Monitoring and controlling industrial equipment, optimizing
processes, and predictive maintenance.
Transportation:
• Tracking vehicle locations, managing traffic flow, and monitoring
public transportation.
Agriculture:
• Monitoring environmental factors like soil moisture, temperature,
and humidity.
Advantages of MQTT in IoT:
• Efficient Communication: Lightweight protocol for low-bandwidth
and high-latency networks.
• Scalability: Can handle a large number of devices and messages.
• Reliability: Different QoS levels ensure message delivery
reliability.
• Flexibility: Supports various communication patterns and can be
easily integrated with cloud platforms.
• Battery Efficiency: Optimized for low-power devices, extending
battery life.
How it works in IoT
Device sends a message (publish):
• An IoT device (e.g., a temperature sensor) publishes a message
containing data (e.g., current temperature reading) to a specific topic
(e.g., "sensor/temperature").
Broker routes the message:
• The MQTT broker receives the message and forwards it to all clients that
have subscribed to the "sensor/temperature" topic.
Device receives the message (subscribe):
• A device that has subscribed to the "sensor/temperature" topic receives
the temperature data.
Extensible Messaging and Presence Protocol (XMPP)
• XMPP is a communication protocol that can be effectively used in the Internet
of Things (IoT) for enabling device-to-device and device-to-application
communication.
• It allows for the exchange of data, control commands, and real-time status
updates between various IoT components.
• XMPP's decentralized nature, security features, and support for different
communication patterns make it a suitable choice for building robust and
scalable IoT systems.
Key aspects of XMPP in IoT:
Decentralized Architecture:
• XMPP operates on a client-server model, but unlike some messaging services, it's
decentralized, meaning there isn't a single, central XMPP server. Anyone can run their
own XMPP server, promoting interoperability and flexibility in IoT deployments.
Asynchronous Messaging:
• XMPP excels at asynchronous communication, delivering messages even when the
recipient is offline. This is crucial for IoT devices that may not always be connected or
have limited resources.
Lightweight Protocol:
• XMPP uses XML stanzas, which are relatively small data packets, making it suitable for
resource-constrained IoT devices.
Security:
• XMPP offers various security features, including TLS encryption, SASL authentication,
and support for end-to-end encryption via extensions like XEP-0384, enhancing the
security of IoT communications.
CONTINUES....
Federation:
• XMPP's federation capabilities allow devices and services from different domains
to communicate with each other, enabling seamless interactions across various
IoT networks.
Real-time Communication:
• XMPP's support for presence information and real-time messaging makes it
suitable for applications that require immediate updates and interactions, such
as monitoring and control systems.
Extensibility:
• XMPP's extensible nature allows for the integration of new features and
functionalities, making it adaptable to the evolving needs of IoT.
Examples of XMPP in IoT:
• Smart Homes: Controlling lights, thermostats, and other appliances through a
central hub.
• Industrial Automation: Monitoring and controlling equipment in factories and
other industrial settings.
• Healthcare: Enabling remote patient monitoring and management.
• Agriculture: Tracking environmental conditions and controlling irrigation systems.
• Smart Cities: Managing traffic flow, public transportation, and other urban
infrastructure.
Advantages of using XMPP in IoT
• Interoperability:
• XMPP's open and decentralized nature promotes interoperability between devices from
different manufacturers and networks.
• Scalability:
• XMPP can handle a large number of devices and users, making it suitable for large-scale IoT
deployments.
• Flexibility:
• XMPP's extensibility and support for various communication patterns make it adaptable to
diverse IoT applications.
• Security:
• XMPP provides robust security features to protect sensitive data transmitted between IoT
devices.
• Real-time Capabilities:
• XMPP's ability to handle real-time communication makes it ideal for time-critical IoT
applications.
(Data Distribution Service) - DDS
• DDS is a middleware protocol and API standard used in
IoT for enabling real-time, high-performance, and reliable
data exchange between devices. It's a data-centric,
publish-subscribe system that facilitates direct, peer-to-
peer communication among IoT devices, offering features
like quality of service (QoS) and scalability.
continues
Key aspects of DDS in IoT:
Data-centric communication:
• DDS focuses on the data itself, rather than just messages, allowing devices to interact based on
data types and topics.
Publish-subscribe model:
• Devices publish data to specific topics, and other devices subscribe to those topics to receive the
data, enabling efficient and flexible communication.
Real-time capabilities:
• DDS is designed for real-time applications, ensuring timely delivery of data, which is crucial for
many IoT scenarios.
Scalability and reliability:
• DDS can handle a large number of devices and connections, and its distributed architecture
ensures high reliability.
Broker-less architecture:
• Unlike some other protocols like MQTT, DDS doesn't rely on a central broker, which can improve
performance and reduce single points of failure.
DDS in IoT applications:
Industrial IoT (IIoT):
• DDS is used in IIoT for applications like robotics, automation, and smart
grid management, where real-time data exchange is critical.
Automotive:
• DDS is used in connected and autonomous vehicles for communication
between sensors, actuators, and control systems.
Healthcare:
• DDS enables interoperability and real-time data exchange between
medical devices and healthcare systems.
Aerospace and Defense:
• DDS is used in safety-critical systems where reliability and real-time
performance are paramount.
DDS vs. MQTT:
• While both DDS and MQTT are popular IoT protocols,
they have different strengths. MQTT is a message-centric
protocol with a broker-based architecture, making it
suitable for simpler, less demanding applications.
• DDS, with its data-centric approach and broker-less
design, is better suited for complex, real-time, and high-
performance IoT systems.
continues....
• AMQP, or Advanced Message Queuing Protocol, is a
powerful open standard protocol used in IoT for reliable,
asynchronous message exchange between devices and
applications.
• It acts as a robust middleware, facilitating communication
in distributed systems with features like message
queuing, routing, and security.
• While MQTT is often favored for its simplicity and
lightweight nature in IoT, AMQP offers more advanced
features suitable for complex, enterprise-level IoT
deployments.
Key Features of AMQP in IoT:
Message Orientation:
• AMQP focuses on the exchange of discrete messages, making it ideal for handling events and data payloads
in IoT systems.
Queuing:
• Messages are stored in queues, ensuring reliable delivery even if the recipient is temporarily unavailable.
Routing:
• AMQP brokers can intelligently route messages based on predefined rules and configurations, enabling
flexible communication patterns.
Reliability:
• AMQP provides features like message persistence, acknowledgments, and transaction support,
guaranteeing reliable message delivery.
Security:
• AMQP supports encryption (TLS) and authentication (SASL) to protect sensitive data and control access to
resources.
Interoperability:
• Being an open standard, AMQP allows different systems and applications to communicate seamlessly,
regardless of the underlying technology or platform.
How AMQP is used in IoT:
Data Acquisition:
• Devices can publish sensor data to AMQP brokers, which then route the data to
relevant applications or storage systems.
Command and Control:
• Applications can send commands to devices through AMQP, enabling remote
control and management.
Event Handling:
• AMQP can be used to handle various events in an IoT system, such as device
status changes, alerts, or anomalies.
Integration with Enterprise Systems:
• AMQP can connect IoT devices and applications with backend systems like
databases, CRM, and ERP, facilitating data flow and business process
integration.
Comparison with MQTT
• MQTT is known for its simplicity, lightweight nature, and low bandwidth
consumption, making it suitable for resource-constrained devices.
• AMQP, on the other hand, offers more advanced features like message
queuing, routing, and reliability, making it suitable for complex,
enterprise-level IoT deployments that require robust and flexible
messaging capabilities.
• In conclusion, AMQP provides a powerful and reliable messaging
solution for IoT systems, particularly in scenarios where advanced
features, high reliability, and interoperability are crucial.
• While MQTT might be preferred for simpler, resource-constrained
devices, AMQP offers a robust foundation for building complex and
scalable IoT solutions.
Constrained Application Protocol (CoAP)
• Constrained Application Protocol (CoAP) is a specialized web transfer protocol
designed for resource-constrained devices and networks in the Internet of Things
(IoT).
• It allows small, low-power devices like sensors and wearables to communicate
efficiently with the internet using minimal resources.
• CoAP is often compared to HTTP but is tailored for the specific needs of IoT, such
as low bandwidth and power consumption.
Key Features and Characteristics:
Lightweight:
• CoAP is designed to be compact and efficient, minimizing overhead on constrained devices.
UDP-based:
• It operates over the User Datagram Protocol (UDP), which is simpler and faster than TCP, making it
suitable for real-time applications.
Request/Response Model:
• CoAP follows a request/response interaction model, similar to HTTP, enabling devices to exchange
information in a simple manner.
RESTful Architecture:
• It leverages the principles of Representational State Transfer (REST), allowing devices to access
resources using standard web methods like GET, POST, PUT, and DELETE.
Built-in Discovery:
• CoAP includes features for service and resource discovery, enabling devices to find and interact with
each other.
Security:
• CoAP can be secured using Datagram Transport Layer Security (DTLS), providing encryption and
authentication for sensitive data.
Why is CoAP important in IoT?
Enables communication for resource-constrained devices:
• CoAP is specifically designed to work with devices that have limited processing
power, memory, and battery life, which is common in IoT deployments.
Optimized for low-power networks:
• It is well-suited for networks with low bandwidth and intermittent connectivity,
such as those used in smart agriculture, building automation, and industrial IoT.
Facilitates efficient communication:
• By using UDP and a simple request/response model, CoAP minimizes the
amount of data that needs to be transmitted, conserving energy and bandwidth.
Promotes interoperability:
• CoAP's standardized nature and RESTful architecture make it easier for different
IoT devices and systems to communicate with each other.
Representational State Transfer (REST)
• REST is an architectural style for designing networked
applications, commonly used in IoT for communication
between devices and backend services.
• It utilizes standard HTTP methods (like GET, POST, PUT,
DELETE) to interact with resources identified by URIs,
making it a simple and efficient way to exchange data.
• In IoT, RESTful APIs enable devices to send sensor data,
receive commands, and interact with other connected
systems.
Key Concepts:
Resources:
• In a RESTful system, everything is treated as a resource, identified by a URI (Uniform
Resource Identifier).
HTTP Methods:
• Standard HTTP methods like GET (retrieve), POST (create), PUT (update), and DELETE
(remove) are used to interact with these resources.
Statelessness:
• Each request from a client to the server contains all the information needed to
understand and process the request. The server doesn't store any client context
between requests.
Representations:
• Resources are transferred between client and server in a specific format, often JSON
(JavaScript Object Notation) due to its simplicity and language-agnostic nature.
Uniform Interface:
• REST APIs have a uniform interface, meaning that the same set of methods are used to
interact with all resources, promoting consistency and ease of use.
REST in IoT:
Data Collection:
• Devices can use REST APIs to send sensor readings (temperature, humidity, etc.)
to a central server for storage and analysis.
Remote Control:
• Devices can receive commands via REST APIs to adjust settings, activate
actuators, or perform other actions.
Interoperability:
• RESTful APIs allow different IoT devices and systems to communicate and
exchange data with each other, enabling integration and automation
example
Imagine an IoT device that monitors temperature.
It could expose a REST API endpoint like /temperature.
•A GET request to /temperature would retrieve the current
temperature reading.
•A POST request to /temperature with a new temperature value in
the
request body could update the device's temperature setting.
COMPARISON OF IOT PROTOCOLS
IoT platform design methodology
• Typically involves a structured approach to developing an IoT system, encompassing various
aspects from initial requirements to application development.
Key steps
• system's purpose and requirements,
• specifying processes,
• creating domain and information models,
• defining services,
• determining IoT levels,
• developing functional and operational views,
• integrating devices and components,
• and finally, building the application.
DESIGN
METHODOLOGY
Purpose and Requirement Specification
• Define the core objectives and functionalities of the IoT system.
• Identify specific requirements, including data collection, analysis, system management, and security
needs.
• Example: In a smart home system, this could include requirements for temperature monitoring, lighting control, and
security alerts.
A home automation system that allows controlling the lights remotely using a
Purpose
web application
Home automation system should support two modes: auto and manual
Auto: System measures the light level in the room and switches on the light
Behavior when it is dark
Manual: Allows remotely switching lights on and off
System Management System should provide remote monitoring and control functions
Data Analysis System should perform local analysis of the data
Security Should provide basic security like user authentication
Application
Application should be deployed locally, but should be accessible remotely
Deployment
Process Specification:
• Outline the flow of operations and how the system will achieve its goals.
• Determine the steps involved in data acquisition, processing, and transmission.
• Example: For a smart home, this could involve specifying the steps for temperature sensing, data
analysis, and triggering actions like turning on the AC.
CONTINUES ....
3. Domain Model Specification
• Define the main concepts, entities, and their relationships within the IoT system's domain.
• This model helps in understanding the system's structure and the interactions between different
elements.
• Example: In a smart home, this could involve defining entities like "room," "sensor," "actuator," and
their relationships (e.g., a sensor belongs to a room).
• The physical identifiable objects in the environment
Physical Entity • IoT system provides information about the physical entity (using sensors) or performs actuation upon
the physical entity
• Virtual entity is a representation of the physical entity in the digital world
Virtual Entity
• For every physical entity there is a virtual entity
• Devices provide a medium for interaction between physical and virtual entities
Device
• Devices are used to gather information from or perform actuation on physical entities
• Resources are software components which can be either on-device or network-resources
Resource • On-device resources are hosted on the device and provide sensing or actuation (eg: operating system)
• Network-resources include software components that are available on the network (eg: database)
• Services provide an interface for interacting with the physical entity
Service
• Services access resources to perform operations on physical entities
CONTINUES....
4 Information Model Specification:
• Specify the structure and format of the data being collected and transmitted by the IoT system.
• This includes data types, units, and other relevant information.
• Example: Defining the temperature readings as a numerical value with a specific unit (e.g., Celsius).
CONTINUES....
5. Service Specification:
• Define the various services offered by the IoT system, including their inputs, outputs, and
endpoints.
• Example: In a smart home, this could include services like "turn on/off light," "adjust
thermostat," or "send security alert".
6. IoT Level Specification:
• Determine the appropriate IoT level (e.g., device, gateway, cloud) for different parts of the
system.
• This helps in deciding where specific functionalities should be deployed and how they
should interact.
CONTINUES....
7. Functional View Specification:
• Describe the functional components of the system and how they interact to achieve the desired
behavior.
• This provides a high-level overview of the system's architecture.
• Example: Defining modules for data acquisition, processing, and control.
8. Operational View Specification:
• Specify the operational aspects of the system, such as communication protocols, security
mechanisms, and data storage.
• This ensures the system operates efficiently and securely.
• Example: Specifying communication protocols like MQTT or HTTP, and security measures like
encryption and authentication.
CONTINUES....
9. Device and Component Integration:
• Integrate the physical devices and components (sensors, actuators, gateways, etc.) into the system.
• This involves connecting the devices, configuring their communication parameters, and ensuring they
can interact with each other and the platform.
10. Application Development:
• Develop the applications that utilize the services and data provided by the IoT platform.
• This could involve creating user interfaces, developing business logic, and integrating with other
systems.
• Example: Developing a mobile app for controlling smart home devices or a web dashboard for
visualizing data.