Unit 5
Unit 5
Unit 5
Following are some key terms, which need to be understood for learning web
connectivity and communication between the connected devices network and the web
for IoT:
Application or App Universal Resource Identifier
Application Programming Interface (API) Universal Resource Locator
Web service Representational State Transfer
Object (REST)
Communication gateway RESTful
Client User Datagram Protocol (UDP)
Server Hypertext
Broker HyperText Transfer Protocol (HTTP)
Communication protocol Hyperlink
Web protocol HyperText Markup Language (HTML)
Firewall Extensible Markup Language (XML)
Datagram Browser
Application or App refers to a software for applications such as creating and sending an
SMS, measuring and sending the measured data, receiving a message from a specific
sender etc.
Application Programming Interface (API) refers to a software component, which receives
messages from one end; for example, from an application or client or input. An API may
consist of GUIs (button, check box, text box, dialog box).
Web service refers to a servicing software which uses web protocols, web objects or
WebSockets; for example, weather reports service, traffic density reports, streetlights
monitoring and controlling service.
Object refers to a collection of resources; for example, collection of data and methods
(or functions or procedures) to operate on that data. Take for instance, Time_Date object
with second, minutes, hour, day, month and year fields and update methods.
An object instance can be just one or more than one for an object. An example of an object
instance is birth_date. Multiple object instances, abc_birth_date, pqr_birth_date,
xyz_birth_date and many instances can be created from birth_date object in JavaScript.
Communication gateway is one that functions as communication protocol translator
(convertor) for provisioning communication capabilities. For example, the gateway for
communication between ZigBee and IP networks.
Client refers to a software object which makes request for data, messages, resources or
objects.
Server is defined as a software which sends a response on a request. The server also sends
messages, alerts or notifications. The server has access to resources, databases and objects.
A server can be on a device or can be on a separate computer system, not necessarily on
Internet connected web.
Web object is the one that retrieves a resource from the web object at other end using a web
protocol.
Broker denotes an object, which arranges the communication between two ends;
Resource denotes something that can be read (used), written (created or changed)
or executed (processed). A path specification is also a resource. The resource is
atomic (not further divisible) information, which is usable during computations.
A resource is accessible using a resource identifier. A resource identifier can
be a path specification, such as a Universal Resource Locator (URL) or Universal
Resource Identifier (URI). Universal Resource Locator is generally used for retrieving
a resource(s) by a client.
Path denotes a navigation path between two ends when accessing a resource.
Datagram refers to a limited size data (216 byte).
Representational State Transfer (REST) is a software architecture referring to ways of
defining the identifiers for the resources, methods, access methods and data transfer
during interactions.
REST is a software architecture which also specifies the practices, constraints,
characteristics and guidelines for creating scalable web services. Scalable means can be used
as per the size.
The architecture is used during the design of web software components, clients and
web APIs .
RESTful refers to one which follows REST constraints and characteristics.
Hyperlink refers to a specification of the URL for a resource path, so that a link can be
established between two objects.
Hypertext means text embedded with hyperlinks. Hyper Text Transfer Protocol (HTTP)
means an application layer protocol for use of hypertext as app data transfer protocol.
Clients and servers use the URLs http://… .
Hyper Text Markup Language (HTML) is
a language for creating a hypertext which
refers to text that embeds
text,
images,
audio and video,
forms, lists, tables,
navigation links (reference to resources),
APIs..etc
User Datagram Protocol (UDP) is a protocol at the transport layer for the web using Internet
and Constrained RESTful Environment (CoRE).
UDP specifies the way of enveloping the datagram by header words, which just
specifies the ports and addresses of two ends between which the datagram transfers.
Figure: 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
Above Figure shows the following:
● Assume i-devices (1, 2, … ith) connected devices network, and local network having
Web objects refer to client and servernconnectivity between the devices at physical/data-link
and adaptation layer (left-handside)
As it is designed for web applications it is also known as "The Web of Things Protocol". It can be
used to transport data from few bytes to 1000s of bytes over web applications. It exists between
UDP layer and Application layer.
Following are the features of CoAP Protocol:
• It is very efficient RESTful protocol.
• Easy to proxy to/from HTTP.
• It is open IETF standard
• It is Embedded web transfer protocol (coap://)
• It uses asynchronous transaction model.
• UDP is binding with reliability and multicast support.
• URI is supported.
• It uses small and simple 4 byte header.
• Supports binding to UDP, SMS and TCP.
The above figure depicts CoAP Architecture.
As shown it extends normal HTTP clients to clients having resource constraints.
These clients are known as CoAP clients.
Proxy device bridges gap between constained environment and typical internet
environment based on HTTP protocols. Same server takes care of both HTTP and
CoAP protocol messages.
CoAP message format
The CoAP message format consists of 4 bytes header followed by token value (from
0 to 8 bytes). The table below mentions header which consists of 4 bytes i.e. 32 bits.
Lightweight Machine-to-Machine Communication
Protocol
Lightweight Machine-to-Machine Communication (LWM2M) protocol is an application layer
protocol specified
by Open Mobile Alliance (OMA)
Designed especially for remote device management and telemetry within the
Internet of Things as well as in other M2M applications.
Lightweight M2M was designed intrinsically to reduce power and data consumption.
Message cache keeps an incoming message until it is saved into the module.
A device message-queue inserts (writes) the message into the queue and
deletes (reads) the message from the queue. Device message-cache stores the
received messages.
Contd.. MESSAGE COMMUNICATION
PROTOCOLS
FOR CONNECTED DEVICES
Communication Protocols
Following are the protocols used in message communication.
CoAP-SMS and
CoAP-MQ
CoAP is also being used via other mechanisms, such as SMS on mobile
communication networks.
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.
Contd.. MESSAGE COMMUNICATION
PROTOCOLS
FOR CONNECTED DEVICES
CoAP-SMS
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 over ROLL for CoAP object messages and when
using cellular communication.
SMS is used instead of UDP + DTLS by a CoAP client or server. A CoAP client
communicates to a mobile terminal (MT) endpoint over the General Packet Radio Service
(GPRS), High Speed Packet Access (HSPA) or Long Term Evolution (LTE) networks using
CoAP-SMS protocol.
● An URI used as
coap+sms:// in place of coap://.
For example,
URI may be
coap+sms://telNum/carLocatiobObject/latitude
MQTT Protocol
Message Queuing Telemetry Transport (MQTT) is an open-source protocol for machine-to
machine (M2M)/IoT connectivity.
Word ‘telemetry’, in English dictionary, means measuring and sending values or
messages to far off places by radio or other mechanism.
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 sender
and the 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.
Contd…WEB CONNECTIVITY FOR CONNECTED DEVICES
NETWORK USING
GATEWAY, SOAP, REST, HTTP RESTFUL AND
WEBSOCKETS
SOAP
Applications need to exchange objects on the Internet using protocols such as HTTP.
Applications may be using different languages and platforms. Simple Object Access
(SOAP) is a W3C -The World Wide Web Consortium (W3C) approved open-source
protocol.
SOAP is a protocol for exchange of objects between applications using XML.
Its usage is independent of the application language and platform (OS and hardware).
It is extensible and is also used for APIs for the web services and Service-Oriented
Architecture (SOA).
Contd…WEB CONNECTIVITY FOR CONNECTED DEVICES
NETWORK USING
GATEWAY, SOAP, REST, HTTP RESTFUL AND
WEBSOCKETS
WebSocket
WebSocket is an IETF accepted protocol.
WebSocket enables
bidirectional communication over a single TCP connection.
Contd…WEB CONNECTIVITY FOR CONNECTED DEVICES
NETWORK USING
GATEWAY, SOAP, REST, HTTP RESTFUL AND
WEBSOCKETS
Features of WebSocket are:
● Small header size (2B extended to 6 byte and above compared to 100s B and above
for an HTTP header which results in high latency
● No new connection which will need a new header and thus no new latency period
● WSAPIs, because of very low connection latencies, facilitate live content and the
creation of real-time games.