IoT CSE U 3
IoT CSE U 3
12/06/2024
Key-Terms Meanings
12/06/2024
Application
12/06/2024
Application Programming Interface (API)
12/06/2024
Web Service
12/06/2024
Resource
12/06/2024
Resource Directory
12/06/2024
Object
12/06/2024
Object instance
12/06/2024
Multiple Object instances
12/06/2024
Communication Gateway
12/06/2024
Client
12/06/2024
Server
12/06/2024
Header
12/06/2024
Web object
12/06/2024
URI (Universal Resource Identifier)
12/06/2024
URL
12/06/2024
Datagram
12/06/2024
Connectionless
12/06/2024
Representational State Transfer (REST)
• A software architecture with following characteristics;
an architecture used during design of software
components.
• Uses the identifiers for the resources and methods.
• Specifies the access-methods and data transfer methods
during interactions.
• Specifies the practices, constraints, characteristics and
guidelines.
• Used for Creation of the scalable web services.
• Scalable means can be used as per the size.
12/06/2024
RESTful
12/06/2024
Hypertext
• Text embedded with hyperlinks.
• The link embeds along with text.
• Hyperlink means a specification of a URL for the
resource path so that a link establishes between two
objects.
• For example, hyperlink for a book is through a URL
which is http://www.mhhe.com/rajkamal/iot.
https://www.aec.edu.in
• Retrieval of a resource at a web object by the other
object can be, for example, on the click at a link shown
on a displayed text on browser.
12/06/2024
HTML
12/06/2024
XML
12/06/2024
ROLL
12/06/2024
Web-Connectivity Protocol
• CoAP
• LWM2M
12/06/2024
Constrained Environment for Connected
Devices
12/06/2024
Constrained Environment for Connected
Devices
12/06/2024
IoT or M2M devices local network connectivity and web connectivity in constrained (above thick dotted line)
and unconstrained RESTful HTTP (below thick dotted line) environments using communication protocols
12/06/2024
Constrained RESTful Environment (CoRE)
12/06/2024
Unconstrained RESTful Environment
(UCoRE)
• Web applications use HTTP and RESTful HTTP for
web client and web server communication.
• A web object consists of 1000s of bytes.
• Data routes over IP networks for the Internet.
• Web applications and services use the IP and TCP
protocols for Internet network and transport layers.
12/06/2024
CoAP (Constrained Application Protocol)
12/06/2024
(a) Direct and indirect accesses of CoAP client objects to a CoAP server, (b) CoAP client access for lookup of
object or resource using a resource directory, and (c) CoAP client and server access using proxies
12/06/2024
CoAP Client and Server
12/06/2024
CoAP Features
12/06/2024
CoAP Features
12/06/2024
UDP (Universal Datagram Protocol)
12/06/2024
DTLS (Datagram Transport Layer Security
protocol)
12/06/2024
LWM2M Web Connectivity Protocol
12/06/2024
Lightweight
• ‘Lightweight’ means in general that S/W component or
object does not depend on a call to the system resources
during execution.
• Example of a call to a system resource is calling an
API for display-menu or calling a network function in
the system software (OS).
12/06/2024
Lightweight in LWM2M
• Transfers up to 100s of bytes unlike the web-pages of
1000s of bytes.
• Data transfer formats between client and server: Binary
and has TLV (Tag Length Value) or JSON (Java Script
Object Notation) batches of objects arrays or resource
arrays or MIME (Multipurpose Internet Mail
Extensions) Type file
12/06/2024
LWM2M (Lightweight Machine to Machine)
Protocol
12/06/2024
12/06/2024
LWM2M (Lightweight Machine to Machine)
Protocol
12/06/2024
Features of LWM2M Objects and resources
12/06/2024
Messaging Protocols for Connected Devices
12/06/2024
Pub/Sub (Publish/Subscribe)
12/06/2024
Request/Response (Client/Server)
12/06/2024
Pub/Sub (Publish/Subscribe)
• A separate subscription required for each resource-type
or topic.
• Provisions for publication of messages and their
reception on subscription.
• PUT method used by Pub and GET Method by the
registered or authenticated devices.
• Publisher registers or deregisters a device for a
resource type .
12/06/2024
Pub/Sub (Publish/Subscribe)- Example
•Resource type: measured values of ambient light
condition in smart streetlights example.
• Another resource type: traffic presence or absence on
the street.
• Another resource type, a lighting function report
(proper or faulty) in the light
12/06/2024
Resource Discovery
• Resource discovery service may advertise (publish) at
regular intervals, the availability of the resources or
types of the resources available and their states.
• A client discovers the resource type and registers for
the RD service.
12/06/2024
Registration
• Registration means a receiver registers with a service,
for example, a resource directory service (RD).
• When one or more end-points or devices or nodes
registers, then that gets the access to the resources
and receives published messages.
• Security considerations may require authentication of
both ends (service provider and receiver) before
registration.
• A separate registration required for each end-point
(client or server)
12/06/2024
Registration Update
• Updating registrations for one or more end-points or
devices or nodes.
• Also includes unregistering for one or more endpoints.
12/06/2024
Pull (Subscribe/Notify)
• Pull means pulling a resource value or message or data
of a resource-type by registering and subscribing.
• Pull (Subscribe/Notify) Data Pull may be using GET or
on initiating OBSERVE.
12/06/2024
Pull Messaging Method
• The server maintains state information for a resource
and notifies on change of state.
• Client pulls again the resource on the change.
12/06/2024
Polling or Observing
• Finding from where new messages available.
• Finding whether new messages available.
• Finding updates available.
• Finding whether or not a need for refresh of
information.
• Finding the state information changed or same.
• GET + OBSERVE method.
• Observing means looking for change, if any, of a state
at periodic intervals.
12/06/2024
Push (Publish/Subscribe) Data
• Means a services (Server S/W) pushes using PUT ( )
the messages or information regularly.
• Interested device or endpoint or potential receiver
receives the pushes.
• For example, a mobile service pushes the temperature
and location information regularly for registered
subscribers.
12/06/2024
Message Cache
• Cache means storing when available, for use later on
when required.
• Useful in environment of short or prolonged
disconnections of a service.
• A message accessed once or more times from a cache .
12/06/2024
CoAP SMS and CoAP MQ
12/06/2024
CoAP-SMS and CoAP-MQ
• M2M or IoT device uses SMS quite frequently.
• SMS is identified as the transport protocol for
transmission of small data (up to 160 characters). It
is used for communicating with a GSM/GPRS
mobile device.
• M2M or IoT device uses message queuing quite
frequently due to ROLL environment and
constrained devices (awake only when initiated) or
connection-breaks for long periods.
• CoAP-SMS and CoAP-MQ are two protocols
drafted and recommended by IETF.
12/06/2024
CoAP-SMS
(c)
(d)
12/06/2024
CoAP-SMS
(a) A CoAP request or response communication to a
machine, IoT device or mobile terminal (MT),
(b) A computer or machine interface using IP
communication to a mobile service provider for data
interchange with terminal,
(c) A machine or IoT device or mobile origin (MO)
communication of CoAP request or response
communication, and
(d) An origin communication using SS7/CIMD/SMPP
with a computer or machine interface using IP
communication.
12/06/2024
CoAP- MQ
12/06/2024
12/06/2024
CoAP-MQ-Service
12/06/2024
CoAP-MQ End point Functions
• Implements the functions at the CoAP-MQ function
set,
• serves as CoAP-MQ client and CoAP-MQ server,
• Register with RD server for using Broker, (RD
server advertises a service).
• Receives advertisements from Broker which may
advertise service, and
• May permit implementation of sleeping end points
and message queuing for receiving on awaking of
end-point.
12/06/2024
CoAP-MQ Broker Functions
12/06/2024
CoAP-MQ Broker Functions
12/06/2024
Message Queue Telemetry Transport (MQTT)
12/06/2024
MQTT (Message Queuing Telemetry Transport)
12/06/2024
MQTT (Message Queuing Telemetry Transport)
• Created by IBM
12/06/2024
MQTT Features
• Constrained environment protocol.
12/06/2024
MQTT Features
• subscriber (message receiver at the device domain or
web object at network and application domain)
receiving the messages on a subscribed topic
12/06/2024
MQTT Features
• M2Mqtt library providing a set of functions for
coding.
12/06/2024
MQTT Features
• MQTT TCP/IP Connectivity.
12/06/2024
MQTT Features
• Notifying on an abnormal disconnection of a client,
notified all nodes subscribing to the message, also
notifies Will message, means last will.
12/06/2024
M2M/IoT device objects (publisher and subscriber) messaging to web
objects (publisher and subscriber) using an MQTT Broker
12/06/2024
MQTT Broker Functions
1. store and forward,
2. Clients publish topics and receives topics on
subscription,
3. recovers subscriptions on reconnect after a
disconnection, unless client explicitly disconnected
4. Acts as a broker between publisher of the topics and
subscribers of the topics
5. finds client disconnection until DISCONNET
message receives,
12/06/2024
MQTT Broker Functions
6. keeps message alive till explicit disconnection.
12/06/2024
MQTT Authentication and Security
• Username/Password in the Connect message.
12/06/2024
Extensible Messaging and presence (XMPP)
protocol
12/06/2024
Extensible Mark up Language (XML)
12/06/2024
XML
12/06/2024
Example of an XML message
• <SensorTemp ID = ‘250715’ TimeDate = ‘19:28:33
Jul 17 2015’> 22 </SensorTemp>.
12/06/2024
XMPP
• XMPP specifies the Instant Messaging (IM) and
Presence,
12/06/2024
Assignments of RFC to Protocol
• Request for Comment (RFC): an IETF publication
assigns number, such as RFC 6120, which later adopted
as Standards.
12/06/2024
XMPP
• XML is open source IETF recommend language.
12/06/2024
XMPP
• Enables communication .
12/06/2024
Use of XMPP and XMPP Extension Protocols for IoT/M2M and web objects for the
messaging, presence notifications, responses on demand and service discoveries using
XML streams
12/06/2024
Chatting and multi user chat (MUC) after creation
of chat room
12/06/2024
XMPP-IOT
12/06/2024
XML Elements in XMPP
12/06/2024
XML stanzas (elements)
12/06/2024
XMPP Authentication Security and Supports
12/06/2024
Communication Gateway
12/06/2024
Communication Gateway
12/06/2024
Oracle IoT Architecture Gateway
• Connects Applications.
• Connects IoT communication frameworks, and Web.
• Performs communication management.
• Performs proxy functions.
12/06/2024
Communication Gateway
12/06/2024
Communication Gateway
12/06/2024
Communication Gateway
• The HTTP server posts and devices network gets the
data using the Gateway.
• Facilitates the communication between IoT devices
and web server,
for example,
(i) ZigBee to SOAP and IP or
(ii) CoAP protocol conversion gateway for RESTful
HTTP (Section 3.3.4).
• Functions as Proxy between the system and server.
12/06/2024
Simple Object Access Protocol (SOAP)
12/06/2024
Applications Need to Exchange Objects
• Applications may be using different languages and
platforms.
• SOAP (Simple Object Access): A W3C approved
open source protocol.
(http://www.w3schools.com/soap/default. asp ).
12/06/2024
SOAP
• Facilitates for exchange of objects between the
Applications using the XML.
12/06/2024
SOAP
• Extensible.
• Also used for APIs for the web services and SOA
(service-oriented architecture).
12/06/2024
SOAP
SOAP Version 1.2 second edition Specifications
• Part 0: Primer.
• Part 1: A Messaging Framework.
• Part 2: Adjuncts
12/06/2024
SOAP Version 1.2 provisions
• Assertions.
• Test Collection.
• XML-binary Optimized Packaging.
• SOAP Message Transmission Optimization
Mechanism.
• Resource Representation.
• SOAP Header Block.
12/06/2024
Example
• Gateway sends requests for the weather service
response and receives the weather message from a
weather Msg Service daily.
• A SOAP request or response communicate between
two Applications.
12/06/2024
Example
• Gateway sends SOAP object weatherMsgG from
www.weatherMsgG.com and Weather service
weatherMsgService sends SOAP objects using
www.weatherMsgService.com
12/06/2024
REST Architectural Style and RESTful APIs
12/06/2024
REST (Representational State Transfer)
• CoAP, HTTP and XMPP use REST architectural
style.
• REST style developed by W3C Technical
Architecture Group (TAG).
• Simpler than SOAP and WSDL (Web Services
Description Language).
12/06/2024
Representation of Each Application State
• Contains links that may be used the next time when
the client selects those links and initiates a new state-
transition.
12/06/2024
REST architectural style
• A coordinated set of practices and constraints.
12/06/2024
Stateless, Client-Server, Cacheable communication
• REST design depends on the characteristics of
stateless, client server, cacheable communication.
• Client or server or intermediate systems can cache the
responses.
12/06/2024
Definable Cacheability
• Clients or intermediate layers can cache the
responses.
12/06/2024
Scalability
• Ability to support greater number of interactions
among components and greater number of components.
12/06/2024
Resources
• Resources themselves are conceptually separate from
the representations that are returned to the client.
12/06/2024
REST Features
• use of specific practices.
12/06/2024
REST Feature of usages of Layered System
• A client can connect through intermediate (proxy or
firewall or Gateway intermediary server) layers.
12/06/2024
REST Feature of enabling usage of Intermediate
system(s)
12/06/2024
REST Feature of Simplicity of Interfaces
1. Modifiability of components enables the changes
according to the needs, even while an App is
running.
2. Visibility of communication between components
by service agents.
3. Portability of components by moving the objects,
Object means program code with the data.
4. Reliability is the resistance to failure at the system
level in the presence of failures within data
elements, components or connectors.
12/06/2024
Formal REST constraint of Uniform Interfaces
• Identification of individual resources, identified in
requests, for example, using URIs in web-based
REST systems,
• Separation of concerns which means Client–server
interactions are such that a uniform interface
separates clients from servers.
12/06/2024
Separation of Concern architectural property
• That means how does data store at server is not a
concern for client and
12/06/2024
REST's client–server separation of concerns
12/06/2024
Formal REST constraint of Uniform Interfaces
12/06/2024
Stateless Communication
12/06/2024
Client Data
12/06/2024
Client Session State
12/06/2024
WEB SOCKETS
12/06/2024
Web Socket Protocol
12/06/2024
Web Socket Features and WSAPIs
12/06/2024
12/06/2024
Web Socket Port
12/06/2024
Events
• Onopen ( ),
• Onmessage ( ) and
• onerror ( )
12/06/2024
Attributes
• url,
• protocol,
• readystate,
• bufferd Amount and
• extensions
12/06/2024
Functions
• send ( ) and
• close ( )
12/06/2024
Six frame types in Web Socket
• Six types are (i) textual data (UTF-8) and (ii) binary
data (whose interpretation is left up to the
application)Ten additional reserved for future use
(version 13).
• Clients and servers exchange the “messages” after
success of handshake.
12/06/2024
Associated Type Frame
12/06/2024
Control frame
12/06/2024
Client Library examples
12/06/2024
Server Library examples
• Apache-websocket,
• SuperWebSocket,
• ActiveMQ,
• PHD WebSocket and
• Socket.io (node.js)
12/06/2024
Extensibility
12/06/2024
???
12/06/2024
THANK YOU
12/06/2024