Design Principles For Web Connectivity

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 46

Module 4

Design principles for Web


Connectivity
Introduction

• An IoT/M2M device network gateway needs connectivity to web


servers.
• A communication gateway enables Web connectivity, while IoT/M2M
specific protocols and methods enable web connectivity for a
connected devices network.

• A server enables IoT device data accumulation(storage)

• Application (reporting, analysis and control), collaboration, service and


processes (involving people and business process) use this data.
Key terms used in Web connectivity
• Application or App: refers to a software for applications such as
creating and sending SMS, measuring and sending the measured
data, receiving the message etc.
• API- refers to software component, which receives messages from
one end .(application, client or input)
- consists of GUIs(button, check box, text box, dialog box)
- input from a server or a user
- It initiates actions and may send the messages. For ex: application
software, server or a client at the other end.
• Web Service- refers to a servicing software which uses web
protocols, web objects or Web sockets. For ex: weather report
service, traffic density reports, streetlight monitoring and controlling
services
Key terms used in Web connectivity
• Object – refers to a collection of resources. For ex: collections of data
and methods to operate on that data( functions and procedures) .
Take for instance, Time_Date object with second, minute, hour, day,
month and year fields and update methods.
• An object instance can be just one or more than one for an object.
Ex: birth_date
• Server- is defined as a software which send a response on a request.
Sends messages, alerts or notifications.
• Proxy- refers to an application which receives a response from the
server for usage of a client or application and which also receives
request from client for the responses retrieved or saved at proxy.
Key terms used in Web connectivity
• Communication protocol
• Web protocol- is a protocol that defines the rules and conventions
for communication between the web server and web clients.
• Web object- is the one that receives resource from the web object at
the other end using a web protocol.
• Resource
• REST
• Hypertext, Hyperlink etc
Web Communication protocols for connected
devices
Data of connected devices routes over the web in 2 types

Constrained Unconstrained
RESTful Environment
Environment

(CoRE)
Constrained RESTful Environment
(CoRE)
• M2M and IoT communication - LAN
• Each Device sends 10’s of data
• After data consolidation from many devices - 100’s od data is
gathered
• The gateway communicates over internet using REST API
Constraints
• Devices can sense data in limited size compared to web
clients/servers
• Data routing - routing over a n/w of low power & loss(ROLL) :
wireless n/w with low power transceivers
• Devices sleep in low power environment
Unconstrained Environment

• Web applications use HTTP and REST Ful HTTP for web client/server
communication
• Data routes over IP n/w for internet
• Web applications use IP, TCP protocols

• IoT Device / Machine applications need constrained protocols such as


CoAP & LWM2M
Devices LAN connectivity in Constarined and unconstrained
REST ful Environments
-Assume i-devices connected devices in the
n/w, Local network connectivity.
-Communication between Web Objects(RHS)
-CoAP and UDP protocols
-Web objects protocols for sending a request or
response. Ex: RESTFul CoAP, CoAP client and
CoAP server communication over the network
and transport layers to other end.
-Transport layer protocols are DTLS, UDP
-Data between the web objects route using
ROLL
-100s of bytes communicate between IoT web
objects
-Web objects HTTP client and HTTP server
communicate over Internet using IP and client
server use URLs http://
-1000s of bytes communicate between HTTP
web objects using certain protocols for sending
and receiving.
Constrained Application Protocol - CoAP
Features
• CoAP Web Objects communicate using request/response
communication protocol
• Uses object model for resource, each object can single or multiple
instances
• Specialized web transfer protocol is used for CoRE using ROLL N/w
• An object /resource use CoAP, DTLS (Datagram transport Layer
Security) & UDP protocols for sending request/response
• Follows asynchronous communication over ROLL
• Integrates easily with the web using CoAP Application cross protocol
proxies
• Use REST to access CoAP Object/resource using
• URI, Subset of MIME Types, subset of response codes used in HTTP object/resource
(a) Direct & indirect access of CoAP client objects to a CoAP Server
(b) CoAP Client access for lookup of objects/resources using resource directory
(c) CoAP client and server access using proxies – Refer the diagram
(a)

(b)

(c)
CoAP- CoAP Client Web Connectivity
• A Proxy is the intermediate server – accepts request from client & sends
response to client
• HTTP – CoAP Proxy accepts request from HTTP client using HTTP Protocol
and sends request to server using CoAP protocol
• CoAP – HTTP Proxy accepts request from CoAP client using CoAP Protocol
and sends request to server using HTTP protocol
• TLS (Transport Layer Security) known as SSL (Secure Socket Layer)is the
protocol used for securing the TCP based internet data interchanges , DTLS
for datagrams
• DTLS features
• 3 types of security services – Integrity, authentication & confidentiality
• DTLS= TLS+UDP
• Well suited for tunneling applications(VPN)
• Uses Open SSL repository openssl-0.9.8 Security based PSK, RPK & certificate
CoAP- Secured use of Key for client Authentication
PSK - Pre Shared Key is a method of securing using a key to authenticate a
client
• Contains up to 133 characters in English
• Generates unique encryption key for each client
• PSK is a symmetric key without forward secrecy (sender key not secret
from receiver)
• K12 for Encryption and Decryption
RPK – Random Pair wise keys/ Raw public key
• Means Private /public Key are asymmetric
Certificate
• X.509 is a certificate authorized by CA (Certification Authority) & PKI
(Public Key infrastructure)
LWM2M

Light Weight Machine to machine Protocol


• Its an application layer protocol specified in Open Mobile Alliance
(OMA) for transfer of service data/messages.
• ‘Light Weight’ means it does not depend on call to system resource
during execution.
• Light Weight also means data formats btw client & server are
binary/Java Script obj Notion(JSON) batches of obj arrays and
transfer upto 100’s of bytes
• LWM2M protocol enables communication bte LWM2M Client at IoT
device & LWM2M server at the M2M Application
• This protocol is used in conjunction with CoAP
LWM2M OMA Std

• Local M2M constrained devices use Bluetooth LE, 6LoWPAN, CoRE,


ROLL, NFC, Cellular, Wi-Fi or Zigbee IP n/w technologies
• An object /resource use CoAP, DTLS (Datagram transport Layer
Security) & UDP protocols
LWM2M Specifications & Features
• Interface functions are bootstrapping, registration, deregister or
updating a client and its objects
• M2M Mgmt Functions can be M2M Service Bootstrap
Function(MSBF) for credentials of the devices and gateway
• M2M authentication server (MAS) for security, root key data store &
data authentication
Message Communication Protocols for
connected devices
• A device/node/end-point/client/server sends and receives messages
• A communication module includes a protocol handler, message
queue and message cache.
• Terminologies:
 Request/Response
 Publish/Subscribe
 Resource Directory
 Resource Discovery
 Registration/Registration Update
 Pull(Subscribe/Notify) Data
 Polling or Observing
 Push Data , Message Cache, Message Queue, Information/Query
Communication Protocols

• Following are the protocols used in communication


1. CoAP-SMS and CoAP-MQ
• CoAP-SMS is a protocol when CoAP Object uses IP as well as Cellular
networks and uses SMS
• It is an alternative to UDP-DTLS by a CoAP client or server
• A CoAP client communicates to a mobile terminal (MT) end point
over the General Packet Radio Service(GPRS), High Speed Packet
Access(HSPA) or Long Term Evolution(LTE) networks using CoAP-SMS
protocol.
• Termonologies: SMS-C, SMS-SP, CIMD, MS, MO, MT, SMPP, SS7,
UCP/UMI
CoAP-SMS Features
• An URI used as coap+sms:// in place of coap://
• A CoAP message encodes with alphabets for SMS communication
• CoAP end points have to work with a Subscriber Identity
Module(SIM) card for SMS in cellular networks.
• Does not support multi-casting
• Two additional options are Response-to-URI-Host(RUH) and
Response-to-URI-Port(RUP)
• Data interchange sequences: An MS/CoAP client sends a SMS
request (SMS-SUBMIT) to SMS-C; SMS-C reports using SMS-SUBMIT-
REPORT; SMS-C sends SMS (SMS-DELIVER) to MS/CoAP server ; the
server reports using SMS-DELIVER-REPORT; and SMS-C sends SMS-
STATUS-REPORT to the client.
Continued…

• Refer the text book(page no 96)


• Fig 3.4(a) shows s CoAP request or response communication to a
machine, IoT device or MT
• Fig 3.4(b) shows a computer or machine interface using IP for
sending request or receiving the CoAP data or HTTP request(REQ)to
a mobile service provider using SMPP OR CIMD for data interchange.
• Fig 3.4(c) shows a CoAP request or response communication from a
machine.
• Fig 3.4(d) shows a computer or machine interface using IP fpr
receiving request or sending response
CoAP-MQ

•CoAP-MQ is a message queue protocol using a broker and RD. Roles of


CoAP endpoints have roles as a client and server.
•Figure 3.5 shows CoAP-MQ server provisioning for the resource-
subscription, store from the publisher. (page no. 97)
MQTT Protocol

•Message Queuing Telemetry Transport is an open source protocol for


machine to machine/IoT connectivity.
•IBM first created it and then donated to M2M ‘Paho’ project to Eclipse.
•A version is MQTT v3.1.1 has been accepted standard for M2M/IoT
•A version MQTT-SN v1.2. sensor neetworks and non TCP/IP networks.

• Figure 3.6 shows the messages interchange between M2M/IoT device


objects and web objects using an MQTT Broker
MQTT Broker does the following:
•Functions as a server node capable of storing messages from publishers and
forwarding then to subscribing clients.
•Recieves topics from the publishers.
•Performs a store-and-forward function
•Receives subscriptions from clients on the topics, matches subscriptions and
publications in order to route messages to a right endpoints
•Recovers subscription on reconnect
•Acts as a broker between the puiblisher of the topics and their subscribers
•Finds client disconnection until DISCONNECT message receives, keeps message
active till explicit disconnection
•Retains the last-received message from a publisher for a new connected subscriber
on the same topic
•Authentication by username/password in connect message and client security
through SSL/TLS
•Support from intelligent and business analyst server and other servers through a
MQTT server with a gateway.
XMPP Protocol

•XML is an open source and is widely used for encoding messages and
texts.
•XMPP is an XML based specification for messaging and presence
protocols.
•XMPP is also an open source protocol.
•Messages notify presence for the IMs to one or many at the same
time. It enables chatting and Multi –user chat (MUC) after creation of a
chat room where different users can do the IMs.
•XMPP enables interoperable communication for ex: GoogleTalk.
•XMPP uses IMs between many users as it uses presence-notifications
and chat features.
XMPP Protocol
•XML is extensible-XSF (XMPP Standard Foundation) developes and
publishes the xeps(XMPP extension protocols).
•List of xeps for web objects are: xep-DataForms Format, xep-XHTML-
IM, xep-Service Discovery, Xep-FileTransfer
•XMPP-IoT xeps extend the use of XMPP to IoT and machine to machine
messaging.
•List of extensions for xeps are: xep-0322 efficient XML interchange EXI
format, xeps-0323 Internet of things-sensor data etc.
•Figure 3.7 shows use of the XMPP and XMPP Extension protocols for
connected devices and web objects.
•Simple Authentication and Secirty Layer (SASL) and TLS are security
protocols for APIs and web objects messages using TCP/IP network.
•XML streams in XMPP format communicate between the devices,
deviices to web objects and between the web objects.
Features of XMPP Protocol
•XMPP uses XML
•XML elements are sent in the open ended stream within the tag
<stream. And corresponding end tag </stream>
•The three basic types of XMPP stanzas are Message, presence,
iq(information query, request/response
•Extensibility to constrained environment messaging and presence
protocols as well as IP network messaging.
•Extensibility of request-response architecture to iq. PubSub messaging,
Chat Room messaging.
•Authentication by SASL/TLS and support from intelligent and business
analyst applications.
XMPP does the following:
•Binary data is first encoded using base 64 and then transmitted in
band.
•No end to end encryption
•Higher overhead being text based in place of binary implementation
•No support for QoS like MQTT does
Web Connectivity for connected devices
network
Communication Gateway
• Communication Gateway connects two application layers, one at
sender and the other at receiver.
•The gateway also enables use of two different protocols, one at the
sender and other at receiver ends.
•The gateway facilitates the communication between web server using
the TCP/IP protocol conversion gateway and IoT devices.
•It also facilitates communication between the devices using CoAP client
and server using HTTP.
Continued…

Communication Gateway provides for one or more of the following


functions:
• Connects the sender and receiver ends using two different protocols.
•A gateway facilitates the communication between IoT devices and web
server.
•Functions as proxy between the system and server
Continued…

HTTP Request and Response method


• An application uses a protocol.
•The application layer in TCP/IP suite of protocols for Internet uses HTTP,
FTP, SMTP, POP3, TELNET and a no of other protocols.
•Data exchange between HTTP Web-Objects
•HTTP Polling
Continued…

SOAP
•Applications need to exchange objects on the Internet using protocols
such as HTTP.
•SOAP-Simple Object Application Protocol is an open source protocol.
•SOAP is a protocol for exchange of objects between applications using
XML.
•It is also a protocol for access to a web service.
•SOAP enables development of applications and APIs.
•SOAP functions connect the GUI applications to web servers using the
standard of the internet-HTTP and XML.
Continued…

SOAP
•Applications need to exchange objects on the Internet using protocols
such as HTTP.
•SOAP-Simple Object Application Protocol is an open source protocol.
•SOAP is a protocol for exchange of objects between applications using
XML.
•It is also a protocol for access to a web service.
•SOAP enables development of applications and APIs.
•SOAP functions connect the GUI applications to web servers using the
standard of the internet-HTTP and XML. (REFER textbook)
Continued…
REST and RESTful HTTP Web Applications
•Representational State Transfer.
•REST is a coordinated set of constraints which are used during the
design of software components.
•WWW uses REST practices and constraints.
•REST is a simpler alternative for SOAP and Web services Description
Languaage (WSDL).
•Due to its architectural property, user interface and user state are of no
concern to the server.
•REST’s client server separation simplifies the component
implementation, increases scalability, reduces complexity of connector
semantics and improves effectiveness of performance tuning.
•Client-Server interactions, Layered system, Representations
Continued…
RESTful HTTP Web Applications
•When all interactions used in the applications conform fully to the REST
constraints then these are called RESTful.
•REST architectural style can be used for HTTP access by GET, POST, PUT
and DELETE methods

RESTful HTTP APIs:


Standard HTTP methods are GET, PUT, POST and DELETE. HTTP based
RESTful APIs use the following:
URI/URLs, such as http://weathermsgservices.com/weathermsg/
REST based web objects comminicate typically but not always over the
HTTP.
Continued…
RESTful HTTP Verbs
•REST interfaces usually involve resource repositories with identifiers.
•Standard verbs are used as follows:
•GET command is to get a list of the URIs for resource repository of the
resources
•POST command creates a new entry in the resource repository for the
reources.
• PUT command which replaces the entire resource repository with
another resource repository or replaces the entire resource item of the
repository.
•DELETE command from client retrieves web objects and sends data to
remote servers.
Continued…
WebSockets
•WebSocket is an IETF accepted protocol.
•Uses Web Interface Definition Language
•Instant Messaging and many application need bidirectional data
exchange over the same connection.
•WebSocket enables bidirectional communicationf over a single TCP
connection
•Fig 3.9 (a) shows Opcode and other fields at a WebSocket Frame.
• Fig 3.9(b) shows WebSocket provisions for events, attributes and
functions.
•Fig 3.9(c) shows data bidirectional communication using WebSocket
APIs between the web objects and also the browsers and servers.
Features of WebSockets
•Small header size
•No new connection which will need a new header and thus no new
latency period
•WSAPIs, because of very low connection latencies, facilitates live
content and creation of real time games.
•Protocol is and independent TCP-based protocol.
•Protocol uses default port 80 for regular WebSocket connections using
ws:// and port 443 when using wss:// for WebSocket connections
tunnelled over Transport Layer Security(TLS).
•Protocol is intended to be compatible with HTTP based server-side
software and intermediaries so that a single port can be used by both
HTTP clients talking to that server and WebSocket clients talking to that
server.
Features of WebSockets
•Protocol specifies six frame types and leaves ten reserved for future
use.
•Clients and servers exchange the messages after a successful
handshake.
•Extensibility of request-response architecture to iq chat and super chat
extensibility to cloud services.
•Support from intelligent and business analyst applications and
processing through web server or XMPP sever and gateway for
connecting the device network with the IP network.
Internet Connectivity Principles
•Internet is a global network with a set of connectivity protocols for:
•Connected devices gateway for sending the data frames of the devices
or to the devices.
•The devices perform, the controlling and monitoring functions using
the messages, data stacks and commands sent through the internet by
the applications, services or business processes.
Key Terms:
Header: refers to words, which are required for processing a received
data stack at the layer and which envelopes the data stack.
IP Header: refers to header fields which comprise parameters and their
encodings as per the IP protocol.
Protocol Data Unit(PDU): is the unit of data stack maximum number of
bytes, which can be processed at a layer as per the protocol at a layer or
sublayer.
TCP stream: is a sequence of bytes or words in the data stack created
at the transport layer that transmits to the destination.
Maximum Transferrable Unit: is the unit of data-stack maximum
number of bytes, which can be transferred from a higher layer to lower
layer.
Packet: is a set of bytes with a fixed maximum specified size that
transfers from network layer and communicates from one router to
another until it reaches the destination.
IP packet: is a data packet which includes IP header.
Data Segment: refers to data stack from application –support layer for
transport.
Network interface is a system software component or hardware for
facilitating communication.
Port: is an interface to the network using a protocol that sends an
application
Socket is a software interface to the network that links to data stack
using a port protocol and an IP address.
Host: is a device or node that connects to a network of computers.
IP Host: is the on that uses the internet protocol suite.
Subnet:
Routing Prefix
Host Idetifier
Data Flow Graph
Acyclic Data Flow Graph
Directed Acyclic Graph
Internet Connectivity
IP Addressing in the IoT
•An IP header consists of source and destination addresses called IP
addresses.
•The Internet generally use IPv6 addresses.
•Following are the addressing schemes:
IP address:
•IP version 4 address consists of 32 bits
•It can be considered as four decimal numbers separated by dots.
•For example: 198.136.56.2 for 32 bits i.e.
•11000110 10001000 00111000 00000010
•Each decimal number is decimal value of an Octet
•IP address can be between 0.0.0.0 to 255.255.255.255 total 32 bit
addresses.
•IP address is visible to outside world. That is it is visible to routers on
the internet.
IP Addressing in the IoT
•Subnet address is for use within the group internally and is invisible to
the outside world.
•An IP address serves the purpose of uniquely identifying an individual
network interface of a host.

Static IP address
A static IP address is the one assigned by the internet service provider.
Dynamic IP address
Once a device connects to the internet, it needs to be allotted an
individual IP address.
When the device connects to router, the router and device use the
DHCP which assigns an IP address at an instance to the device. This
address is called Dynamic IP address.
IP Addressing in the IoT
DNS- Domain Name Server

DHCP- Dynamic Host Configuration Protocol


•Is a protocol to dynamically provide new IP addresses and set subnet
masks for the connected node so that it can use the subnet server and
subnet router at the communication framework.

•Steps in the DHCP protocol for dynamically configuring the IP address


and other networks are given in the page no. 141(refer text book)
IP Addressing in the IoT
IPv6 Address
•Devices(nodes) for IoT need large number of addresses.
•IPv6 uses 128-bit address.
•Devices in mesh network may use 6LoWPAN protocol at the adaption
layer and IPv6 when communication framework coomunicates on the
internet using IPv6.
•IPv6 addresses are classified into three classes.
i) Unicast
ii) Anycast
iii) Multicast

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy