0% found this document useful (0 votes)
32 views144 pages

IoT CSE U 3

Uploaded by

shravans2k02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views144 pages

IoT CSE U 3

Uploaded by

shravans2k02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 144

UNIT-III

Design Principles for Web Connectivity

12/06/2024
Key-Terms Meanings

12/06/2024
Application

• Application: A software (S/W) for an application, such


as, creating and sending an SMS, measuring and sending
the measured data, receiving message from specified
sender
• App: Short abbreviation for Application S/W in
mobiles or devices

12/06/2024
Application Programming Interface (API)

• API: Software (S/W) component which receives


messages from one end and send those to other end that
execute an Application.
• Example: an API consisting of GUI (Button, Check
Box, Text Box, Dialog Box) for input(s) and send
command(s) to other end S/W for running the
Application for graphics.

12/06/2024
Web Service

• A service using the web protocols, web objects or web


Sockets.
• For examples: weather-reports communication service,
Traffic-density reports communication service,
Streetlights monitoring and controlling service.

12/06/2024
Resource

• One that can be read, written or executed.


• A path specification also a resource.
• The resource is atomic (not further divisible)
information which is usable during computations, for
example, temperature .
• A resource may have multiple instances or just a single
instance.

12/06/2024
Resource Directory

• Resource Directory (RD) maintains information and


values for each resource-type.
• A resource of a resource-type accessed from an RD
using a URI for that resource.

12/06/2024
Object

• A collection of resources, for example, collection of


data and methods (also called functions; procedures) to
operate on that data.
• Example: Time_Date object with second, minutes,
hour, day, month, and year fields and update methods
(field means a memory address for the value)

12/06/2024
Object instance

• Can be just one for an object which is instance of a


Class as in Java
• An example of object instance is weather report object
for reporting the rains.

12/06/2024
Multiple Object instances

• Java uses concept of class


• Class creates one or more object instances
• JavaScript creates multiple object instances from an
object itself

12/06/2024
Communication Gateway

• Functions as communication protocol translator


(convertor) for provisioning the communication
capabilities between two networks
• For example, ZigBee IP for communication between
ZigBee and IP network on Rpi.

12/06/2024
Client

• A Software object (or an API associated with that)


makes request for the data, messages, objects or
resources
• A client can have one or more object instances.
• May be an API or APIs for enabling the
communication to a server
• Can be at a device or Application on a network or
Internet connected web, enterprise or cloud.

12/06/2024
Server

• Software which send the responses on the requests.


• Sends messages, alerts or notifications .
• Serve the accesses to resources, databases and objects
on client’s request or subscriptions.
• Server can be on a device or can be on separate
computer system not necessarily on Internet connected
web, enterprise or cloud.

12/06/2024
Header

• A protocol adds header word(s) when sending data to


next layer or step.
• Each header has fields.
• Each field is a set of bits which the receiver object
interprets.
• Header word and fields depend on the protocol used
for sending data stack to receiver.

12/06/2024
Web object

• One that retrieves a resource from the web object at


other end using a web protocol

12/06/2024
URI (Universal Resource Identifier)

• Used for retrieving saved resources, such as Contacts


or address book.
• An URI example: /Contacts/First_Character_R/ for a
set a resource directory Contacts having resource
repository First_Character_R for the contacts with first
character R.
Example of URI • sensorNetwork_J/sensorID_N/
temperature for a temperature value • The value is at a
resource directory sensorNetwork_J for a sensor
network • Identifies the stored sensors data for a sensor
of the id sensorID_N.

12/06/2024
URL

• Generally used for resources retrieval at a client from


the saved resources at a remote server on Internet.
• Example: http://www.mhhe.com/ for a set of resource
directories, resource repositories and resources.

12/06/2024
Datagram

• Limited size data (216 Byte) used for stateless and


connectionless transfer from a web object.
• Stateless means each single data transfer which is
independent of previous data interchanges.

12/06/2024
Connectionless

• Means no connection establishment prior to resource


exchanges between the web objects.
• No connection closure for the resource exchanges after
the datagram transfer ends.

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

• Means one which follows REST constraints and


characteristics

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

• Hyper Text Markup Language which enables designing


of a web page for storing at a server.
• The page retrieves using usage of an URL at a Client.

12/06/2024
XML

• Extensible markup language which enables sending


and receiving messages, commands, query responses,
queries, form using a set of new tags, each with new data
type definitions than the standard ones at HTML

12/06/2024
ROLL

• Routes Over the Low power and Lossy Network.


• Routing: Transmission through a specified route.
• Low Power: For example, wireless communication.
• Lossy network means frequent disconnections can
occur.

12/06/2024
Web-Connectivity Protocol
• CoAP
• LWM2M

12/06/2024
Constrained Environment for Connected
Devices

• Data is limited in size


• 10s of Bytes from a device
• Limited compared to data interchange of 1000s of
bytes between web clients and web servers when using
HTTP, TCP and IP
• Data routes over the low power and lossy (ROLL)
network

12/06/2024
Constrained Environment for Connected
Devices

•Devices may sleep most of the time in low power


environment
• Awakes when required (when a client initiates)
• The connectivity breaks for long periods
• Have limited up intervals in lossy environment

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)

• The gathered data from number of devices consists of


100s of Bytes after enriching and consolidating at
Gateway.
• Communication framework enables that data of
networked devices communicate over the Internet using
the REST software architecture.

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)

• An IETF recommended protocol for constrained


environment devices.
• A web-object’s data transfer standard protocol for
sending a request or response.
• For example, RESTful CoAP

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

• Object or resource uses CoAP.


• CoAP client at a device, IoT/M2M Area Local
Network or Gateway sends requests to a server.
• CoAP server sends the responses, messages, resources
and notifications.

12/06/2024
CoAP Features

• Standard organization IETF defined Application


support layer protocol.
• CoAP web-objects communication using
request/response interactions model.
• A specialized web transfer protocol used for CoRE
using ROLL network.
• Use of object model for resources, and each object can
have single or multiple instances.
• Each resource can have single or multiple instances

12/06/2024
CoAP Features

• Supports resource directory and resource discovery


functions.
• The resource identifiers use the URIs coap://…
• Small message-header of 4 bytes.
• CoRE communication is asynchronous communication
over the ROLL.
• Integrates easily with the web using the CoAP
application cross-protocol proxies.
• Because HTTP and CoAP both share the REST model

12/06/2024
UDP (Universal Datagram Protocol)

• A transport layer standard protocol sending a request or


response data grams.

12/06/2024
DTLS (Datagram Transport Layer Security
protocol)

• Provisions for three types of security services


(integrity, authentication and confidentiality.
• Security binding with PSK or RPK or Certificate.

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

• An Application-layer protocol specified by OMA


(Open Mobile Alliance) for transfer of service data
between the machines.
• Uses Compact and Efficient data model

12/06/2024
12/06/2024
LWM2M (Lightweight Machine to Machine)
Protocol

• A client object sends a request or receives a response


of the LWM2M server over the access and CoRE
networks. • M2M Area Local Network M2M Client
objects can also communicate through COAP clients.
• A M2M Gateway protocol generally interface to CoAP
for the web connectivity.

12/06/2024
Features of LWM2M Objects and resources

• An object or resource use CoAP, DTLS, and UDP or


SMS standard protocols for sending a request or
response.
• Use of (i) plain text for a resource or (ii) Use of JSON
(Java Script Object Notation) during a single data
transfer.
• Uses binary TLV format data transfer for a package for
a batch of resource-representations in a single data
transfer.
• Objects or its resource access using URI (Universal
resource identifier)
12/06/2024
Interface Functions LWM2M-CoAP
(i) bootstrapping,
(ii) registration, deregister or update a client and its
objects,
(iii) or reporting the notifications with new resource
values, and
(iv) service and management access through server.

12/06/2024
Messaging Protocols for Connected Devices

12/06/2024
Pub/Sub (Publish/Subscribe)

• An object (server) publishes the a resource(s) for the


clients.
• Another end object (client) receives the resource on
subscription.
• Numbers of clients can subscribe to a published
resource, for example, weather report or location
information

12/06/2024
Request/Response (Client/Server)

• An object (client) requests for a resource(s).


• Another end object (server) sends the response.
•Both client and server using REST functions.
•Request adds the header words.

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

• A message queue protocol using a broker and


resource directory (RD).
• CoAP end-points role as the client and server.

12/06/2024
12/06/2024
CoAP-MQ-Service

• Sending CoAP messages of one endpoint to another,


• queuing of messages (store) by intermediate node
(s), and
•forwarding only when it suits for example, when the
message recipient endpoint is awake (not sleeping) or
connected and alive.

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

• Functions as a server node capable of storing


messages to and from other nodes.
• Performs a store-and-forward function between web
clients and the CoAP-MQ capable endpoints.
• Matches subscriptions and publications in order to
route messages to right end-points.
• Sends state of an end point when end-point or a web
client subscribes to the state of the endpoint.

12/06/2024
CoAP-MQ Broker Functions

• Enables the web client publishing of updates to the


endpoint state through the CoAP-MQ broker.
• Returns the last published value to web clients or
other endpoints on behalf of endpoints that are
sleeping, and
• Acts as a proxy.

12/06/2024
Message Queue Telemetry Transport (MQTT)

12/06/2024
MQTT (Message Queuing Telemetry Transport)

• An open source protocol for machine-to-machine


(M2M)/"Internet of Things" connectivity.

• (Telemetry dictionary meaning is measuring and


sending values or messages to far off places by radio
or other mechanism)

12/06/2024
MQTT (Message Queuing Telemetry Transport)

• Created by IBM

• The objects communicating using the Connected


devices network protocols, such as ZigBee.

• Web objects also using MQTT library functions and


communicate using IP network and SSL and TLS
security protocols

12/06/2024
MQTT Features
• Constrained environment protocol.

• PubSub messaging architecture in place of request


response client-server architecture.

• publisher (message sender at the device domain or


web object at network and application domain)
sending the messages on a topic

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

•Lightweight, running on limited resources of


processor and memory processor or memory resources.

• Header of fixed-length header and two bytes only

12/06/2024
MQTT Features
• M2Mqtt library providing a set of functions for
coding.

• M2Mqtt library functions in Java needing just 100 kB


and in C# is 30 kB.

• Minimum number of exchanges, and therefore


lessening the network traffic.

•Three Quality of Services.

12/06/2024
MQTT Features
• MQTT TCP/IP Connectivity.

•Broker-based publish/subscribe messaging protocol.

• publish/subscribe functions enable one-to-many


message distribution decoupled with the applications
(unconcerned about the payload),

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.

•The last will specifying the final action to be taken on


failure to send the messages.

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.

7. retains the last received message from a publisher for


a new connected subscriber on same topic, when
retain field in the header is set.

12/06/2024
MQTT Authentication and Security
• Username/Password in the Connect message.

• Client security through SSL/TLS.

• Security considerations same as of CoAP, web-


linking and CoRE resource Directory.

• Intelligent and Business analyst Server support, and


other servers.

12/06/2024
Extensible Messaging and presence (XMPP)
protocol

12/06/2024
Extensible Mark up Language (XML)

• An open source popular language which uses the


markups.
• Markup means marking by some signs and characters
or tags so specify the contents between the
markups.

12/06/2024
XML

• Markup can be at the beginning as well as end of the


contents within. Each markup in XML language has
text within a pair of tag and end-tag.

• For eaxmple, Raj Kamal </Contact_Name)

12/06/2024
Example of an XML message
• <SensorTemp ID = ‘250715’ TimeDate = ‘19:28:33
Jul 17 2015’> 22 </SensorTemp>.

• Java or C++ or other langauge Parser reads the XML


and finds that sensor of ID = 250715 had T = 22 C on
17.07.2015 at 19:28:33

12/06/2024
XMPP
• XMPP specifies the Instant Messaging (IM) and
Presence,

• RFCs are for Internet, protocols, procedures,


programs, and concepts and other related aspects

• RFC 6122 XMPP specifies the Address format

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.

• RFC document series contain technical and


organizational notes.

12/06/2024
XMPP
• XML is open source IETF recommend language.

• XMPP also an open source protocol accepted by


IETF. RFC 6120 standardization document specifies
XMPP CoRE, RFC 6121.

12/06/2024
XMPP
• Enables communication .

•Interoperable, for example, Google Talk.

• XMPP enables IMs (Instant Messaging) between


many using presence notification and Chat features

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

• Different users at an instance in chat room can do


IMs.
• Messages notify presence for the IMs (instant
messaging) to one or many at same time.

12/06/2024
XMPP-IOT

• Extends the use of XMPP to IoT and machine to


machine messaging.

12/06/2024
XML Elements in XMPP

• Uses XML and the XML elements sent in open-ended


stream within the tag and corresponding end tag

12/06/2024
XML stanzas (elements)

• XMPP are of three basic types:


1. message,
2. presence and
3. iq (information/query, request/response).

12/06/2024
XMPP Authentication Security and Supports

• Authentication by SASL/TLS, and


• Support from Intelligent and Business analyst
Applications and processing through XMPP server and
gateway for connecting device network with IP
network

12/06/2024
Communication Gateway

12/06/2024
Communication Gateway

• Connects two application layers, one at sender and


other at receiver.
• Gateway enables use of two different protocols at
sender and receiver ends.

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

• Facilitates the communication between web server


using TCP/IP protocol conversion gateway and IoT
devices.
• Facilitates Communication between a device using
CoAP client and HTTP server.

12/06/2024
Communication Gateway

• connects the sender and receiver ends using two


different protocols.
• For example, IoT devices network maybe ZigBee
network for connecting the devices.
• The network then connects to the web server through
a 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.

• Facilitates access to a web Service.

• Specifies the formats and a way of sending messages.

• Usage in independent of Application language and


platform (OS and hardware).

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.

• For example, a state represented by URI of a resource


of a resource type at a resource repository at a server.

• For example, get ( ) method for operations using the


state.

12/06/2024
REST architectural style
• A coordinated set of practices and constraints.

• These practices and constraints used during design of


software components in a distributed hypermedia.

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.

• Server Responses must therefore be implicitly or


explicitly, define themselves as cacheable, or not.

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.

• For example, the server may send data HTML, XML,


TLV or JSON from its database which can have other
distinct internal representation at a connected database
server.

12/06/2024
REST Features
• use of specific practices.

• Client server interactions.

• Services have characteristics of performance, and


creation of scalable web objects and services.

12/06/2024
REST Feature of usages of Layered System
• A client can connect through intermediate (proxy or
firewall or Gateway intermediary server) layers.

• REST enables intermediate layer processing by


constraining messages to be self-descriptive
interaction.

12/06/2024
REST Feature of enabling usage of Intermediate
system(s)

• Client may not ordinarily be made aware whether it is


connected directly to the end server.
• enables assistance in trans coding and different
protocols at two ends.
• Improves performance when using bigger scales and
shared caches.

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

• Client components can port on other objects

• user interface and user state are of no concern of


Server.

12/06/2024
REST's client–server separation of concerns

• Simplifies the component implementation.


• Increases the scalability of pure server components.
• Reduces the complexity of connector semantics, and
• improves the effectiveness of performance tuning.

12/06/2024
Formal REST constraint of Uniform Interfaces

• Client holding representation of a resource including


any metadata attached then it means it has enough
information to modify or delete the resource.
• Manipulation of resources through representations
sent to the client,
• Stateless client–server communication which means
that constraints are such that client context does not
store at the server, each request from client is
considered independent of previous one.

12/06/2024
Stateless Communication

• Stateless means a transfer is not connected with the


previous transfers (Meta data in header can define
the state (for example sequence number) to link two
independent data transfers

12/06/2024
Client Data

• Itself free to include the context in the data, a session


state holds at the client itself.
• Client has information, using that the server serves
the request.

12/06/2024
Client Session State

• Can transfer to the server or another server.


• It can be used for authentication.
• Can also be used for data persistency for a period or
at the database server when required.

12/06/2024
WEB SOCKETS

12/06/2024
Web Socket Protocol

• An independent TCP-based protocol.


• Intended to be compatible with HTTP-based server
side software and intermediaries.
• Single port can be used by both HTTP clients talking
to that server and Web Socket clients talking to that
server.

12/06/2024
Web Socket Features and WSAPIs

• Small header size (2 Byte) [Over 500 Byte for HTTP


request and response headers].
• WSAPIs facilitate live content and the creation of
real-time games.
• Therefore, much smaller latency in message
interchanges.

12/06/2024
12/06/2024
Web Socket Port

• Default port 80 for regular WebSocket connections


using ws:// and
• port 443 when using wss:// for WebSocket
connections tunneled over Transport Layer Security
(TLS)
• Only relationship to HTTP is that its handshake is
interpreted by HTTP servers as an Upgrade request.

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

• Each frame belonging to the same message contains


the same type of data..

12/06/2024
Control frame

• Frame not intended to carry data for the application.


• Used for protocol-level signaling, such as to signal
that the connection should be closed.
• Supports HTML5 Web Socket when the client and
server support HTML5.

12/06/2024
Client Library examples

• Web-socket-js (in JavaScript), Arudino C++


WebSocket client; Ruby-web-socket, .NET
WebSocket client (in .NET) and Silverlight
WebSocket Client

12/06/2024
Server Library examples

• Apache-websocket,
• SuperWebSocket,
• ActiveMQ,
• PHD WebSocket and
• Socket.io (node.js)

12/06/2024
Extensibility

• Request-response (client-server) architecture extends


to iq (Information through querying),
• Chat and
• Super chat

12/06/2024
???

12/06/2024
THANK YOU

Stay Healthy- Stay Safe

12/06/2024

You might also like