Download as pdf or txt
Download as pdf or txt
You are on page 1of 89

Physical Design of IoT

The physical design of an IoT system is referred to as the Things/Devices and


protocols that are used to build an IoT system.all these things/Devices are
called Node Devices.

Things
Basically, Things refers to IoT Devices, in which every device has a unique
identity that can perform remote sensing, actuating and monitoring
capabilities/work.
Ex; combination of sensors, actuators, Arduino, relay, non-IOT devices.
IoT devices can:
 Share/ Exchangedata with other connected devices and applications
(directlyorindirectly), or
 Collectdata from other devices and process the data locally or
 Send the data to centralized servers or cloud-based
applicationforprocessing the data, or
 Perform some tasks locally and other tasks within the IoT
infrastructure,based on temporal and space constraints (space memory,
processing capabilities, communication latencies (whenever you have
given input to the system and the total time period it takes to give
output so that particular time period/interval is known as latency) and
speeds, and deadlines).
 These devices generate data in some forms or the other which when
processed by data analytics systems leads to useful information to guide
further actions locally or remotely.
 For example, Temperature datagenerated by a Temperature Sensor in
Home or other place, when processed can help in determining
temperature and take action according to users.
IOT devices can be of varied types,
Some of the examples of IoT devices are:
 Home appliances: smart TV, smart refrigerator, smart AC, etc.
 Smart phones and computers
 Wearables: smart watch, smart sensors, etc.
 Automobiles like self-driving cars
 Energy systems
 Retail: smart payment
 Printers
 Industrial machines
 Healthcare: smart watch, smart healthcare, etc.
 Surveillance: smart cameras, smart trackers, etc.

Generic block diagram of an IoT Device


An IoT device may consist ofseveral interfaces forconnections to other
devices,both wired and wireless.
 I/O interfaces for sensors
 Interfaces for Internetconnectivity
 Memory and storage interfaces
 Audio/video interfaces.
An IoT thing or device is made up of different components. The generic block
diagram of an IoT thing or device is given below:
IoT Device collect data from on-board or attached Sensors and Sensed data
communicated either to other device or Cloud based sever including non-IOT
devices and systems. Today many cloud servers available for especially IoT
System.
How it works? For example, if relay switch connected to an IoT device can turn
on/Off an appliance on the commands sent to the IoT device over the Internet.
 An IoT device provides connectivity interfaces like USB, RJ45, etc (used
for connectivity between the devices and the server.).
 It contains a microcontroller or processor for computation tasks (used to
process the data).
 It provides audio/video interfaces like HDMI, RCA, 3.5mm audio channel
(used to record audio and videos in a system).
 It contains memory interfaces like DDR.
 It might support graphics by providing a separate Graphical Processing
Unit (GPU) (both DDR & GPU used to control the activity of an IoT
system).
 it provides storage interfaces like SD, MMC, SDIO (used to store the data
generated from an IoT device).
 Finally, it might provide different I/O interfaces for connecting sensors
and actuators like UART, SPI, I2C and CAN (To give input and output
signals to sensors, and actuators).

Abbreviations
 USB – Universal Serial Bus
 HDMI – High Definition Multimedia Interface
 RCA – Radio Corporation of America
 3.5 mm – audio jack with headphone adapter
 DDR – Double Data Rate
 GPU – Graphics Processing Unit
 SD – Secure Digital
 MMC – Multi Media Card
 SDIO – Secure Digital Input Output
 UART – Universal Asynchronous Receiver Transmitter
 SPI – Serial Peripheral Interface
 I2C – Inter Integrated Circuit
 CAN – Controller Area Network (used for microcontroller and devices
to communicate)

IoT Protocols
 In simpler terms, IoT protocols are a number of procedures or sets of
rules that decides how data will be transmitted between two devices
 These protocols are used to establish communication between a node
device and a server over the internet. it helps to send commands to an
IoT device and receive data from an IoT device over the internet.
 An overview of different protocols used in IoT with respect to TCP/IP
protocol stack is given below:

Link Layer
 Link layer protocols determine how data is physically sent over the
network’s physical layer or medium (Ex; Copper Wire, Coaxial cable
or radio wave).
 They also determine how devices signal and code packets on the
network.
 The packets or datagrams travel through these links. The link layer
also defines the format of packet that is to be communicated across
the link and is responsible for physical addressing.
 Protocols generally used at this layer are Ethernet, Wi-Fi, WiMax, LR-
WPAN, cellular technologies, etc.
802.3 – Ethernet:
 IEEE 802.3 is a collection of Ehternet standards (wireless local area
network) communication standards (Ex. 802.11a, 802.11b, 802.11g,
802.11n, 802.11ac, 802.11ad).
802.11 – Wi-Fi:
 IEEE 802.11 is a collection of WLANs (wireless local area network)
communication standards (Ex. 802.11a, 802.11b, 802.11g, 802.11n,
802.11ac, 802.11ad).
802.16 – Wi-Max:
 IEEE 802.16 is a collection of wireless broadband standards (or) The
standard for WiMAX technology is a standard for Wireless Metropolitan
Area Networks (WMANs).
 The recent update (802.16m) provides data rates of 100 Mbps for
mobile stations and 1 Gbps for fixed stations.
802.15.4 -LR-WPAN:
 A collection of standards for Low-rate wireless personal area network.
 These standards form the basis of network specifications for high level
communication protocols such as Zigbee
 The standards provide low-cost and low-speed communication for
power constrained devices.
2G/3G/4G- Mobile Communication:
 These are different types of telecommunication generations (2G
including GSM and CDMA, 3G – including UMTS and CDMA2000, 4G-
including LTE).
 GSM – Global System for Mobile communication
 CDMA - Code Division Multiple Access
 UMTS - Universal Mobile Telecommunications System
 LTE - Long Term Evolution
 IoT devices are based on these standards can communicate over the
cellular networks.

Network Layer
 Responsible for sending of IP datagrams from the source network to the
destination network.
 Network layer performs the host addressing and packet routing.
 The datagram contains the source and destination addresses, which are
used to route them from source to destination across multiple networks.
 Host identificationhierarchical IP addressing schemes such asIPv4 and
IPv6.

IPv4:
 Internet protocol version 4 is the most deployed internet protocol that is
used to identify the devices (by assigning the numeric label to each
device) on a network using hierarchical addressing scheme (The IPv4
addressing hierarchy includes network, subnet, and host components in
an IPv4 address).
 IPv4 uses a 32-bit address scheme that allows total of 2^32 or
4,294,967,296 (approx. > 4 billion) addresses.
 The IP protocols establish connections on packet networks, but do not
guarantee delivery of packets.
 Guaranteed delivery and data integrity are handled by the upper layer
protocols such as TCP.

IPv6:
 Is the newest version of internet protocol and successor to IPv4.
 IPv6 was developed by the Internet Engineering Task Force (IETF) to deal
with the long-anticipated problem of IPv4 address exhaustion.
 IPv6 uses a 128-bit address, theoretically allowing 2128, or
approximately 3.4×1038 addresses.

6LoWPAN:
 It is an acronym of IPv6 over Low-Power Wireless Personal Area
Networks.
 This protocol allows for the smallest devices with limited processing
ability to transmit information wirelessly using an internet protocol.
 6LoWPAN work with 802.15.4 link layer protocol and define
compression mechanisms for IPv6 datagrams.

Transport Layer
 this layer protocols provide end-to-end this layer protocols provide end-
to-end message transfer capability independent of the underlying
network.
 The message transfer capability can be set up on connections, either
using handshakes (as in TCP) or without handshakes /
acknowledgements (as in UDP).
 This layer provides functions such as error control, segmentation, flow
control and congestion control.
TCP:
 Transmission Control Protocol (TCP) is the most widely used transport
layer protocol, that is used by web browsers (along with HTTP, HTTPS
application layer protocols), email programs (SMTP application layer
protocol) and file transfer (FTP).
 TCP is a connection oriented and stateful protocol.
 While IP protocol deals with sending packets, TCP ensures reliable
transmission of packets in-order.
 TCP also provides error detection capability, so that duplicate packets
can be discarded and lost packets are retransmitted.
 The flow control capability of TCP ensures that rate at which the sender
sends the data is not too high for the receiver to process.
 The congestion control capability of TCP helps in avoiding network
congestion and congestion collapse which can lead to degradation of
network performance.
UDP:
 Unlike TCP, it is unreliable and connectionless protocol. So, there is no
need to establish connection prior to data transfer.
 UDP is useful for time sensitive applications that have very small data
units to exchange and do not want the overhead of connection setup.
 UDP is a transaction oriented and stateless protocol.
 UDP does not provide guaranteed delivery, ordering of messages and
duplicate elimination.

Application Layer
Communication Models in IoT (Internet of Things)
 IoT devices are found everywhere and will enable circulatory intelligence
in the future.
 For operational perception, it is important and useful to understand how
various IoT devices communicate with each other.
 Communication models used in IoT have great value. The IoTs allow
people and things to be connected any time, any space, with anything
and anyone, using any network and any service.

Types of Communication Model:


1. Request & Response Model –
This model follows client-server architecture.
 The client, when required, requests the information from the
server. This request is usually in the encoded format.
 This model is stateless since the data between the requests is not
retained and each request is independently handled.
 The server Categories the request, and fetches the data from the
database and its resource representation. This data is converted
to response and is transferred in an encoded format to the client.
The client, in turn, receives the response.
 On the other hand — In Request-Response communication model
client sends a request to the server and the server responds to the
request. When the server receives the request it decides how to
respond, fetches the data retrieves resources, and prepares the
response, and sends it to the client.

2. Publisher-Subscriber Model

There are three basic elements in publisher-subscriber Model as given below,


 Publisher: Publishers are the source of data. It sends the data to the
topic which are managed by the broker. They are not aware of
consumers.
 Broker: It is responsible to accept data from publishers and send it to
the appropriate subscriber.
 Subscriber: Consumers subscribe to the topics which are managed by
the broker.

Example: just to understand we can say, if a person upload an article on a


certain website and any third person read that topic from website then article
up-loader will be publisher, website is a broker and third person will be
consumer.

3 Push-Pull Models
There are three basic elements also in Push-Pull Model as given below

 Publisher: It pushes the data in Message Queue


 Message Queue: it is a buffer which stored data, pushed by publisher
 Consumers: It pulls data from message queue.
 Publishers and Consumers are not aware of each other.
 Publishers publish the message/data and push it into the queue.
The consumers, present on the other side, pull the data out of the
queue. Thus, the queue acts as the buffer for the message.
 Queues help in decoupling the messaging between the producer
and consumer.
 Queues also act as a buffer which helps in situations where there
is a mismatch between the rate at which the producers push the
data and consumers pull the data.

4. Exclusive Pair
 It is a bi-directional (full duplex) communication model among client and
server.
 The connection is constant and remains open till the client sends a
request to close the connection.
 The Server has the record of all the connections which has been opened.
 This is a state-full connection model.
 Web Socket based communication API is fully based on this model.
IoT Communication APIs
What are APIs?

 An API is an interface used by programs to access an application.


 It enables a program to send commands to another program and receive
replies from the app.
 IoT APIs are the interface points between an IoT device and the Internet
and/or other network components.
2-types of APIs are: REST-based API and the Web socket based API.

REST-based communication APIs:


 Representational state transfer (REST) is a set of architectural principles
by which you can design Web services the Web APIs that focus on the
system's resources and how resource states are addressed and
transferred.
 REST-ful web service is a collection of resources which are represented
by URI.
 Client tries to access these resources via URIs using the methods defined
by the HTTP Protocol (e.g., like GET, PUT, POST, DELETE and so on)
 In response, the server responds with a JSON object or XML file.
 A REST-ful web service is a “web API” implemented using HTTP and REST
principles. The following figure shows the communication between
client and server using REST APIs.

Fig: communication between client and server using REST APIs


 The REST APIs follow the request-response model, and the following
figure shows the interactions in the request-response model used by
REST.

 The REST architectural constraints apply to the components, connectors,


and data elements, within a distributed hypermedia system. Those
constraints are as follows:

1) Client-server
 The principle behind the client-server constraint is the separation of
concerns.
 For example, the client should not be concerned with the storage of data
which is a concern of the server; similarly, the server should not be
concerned about the user interface, which is the concern of the client.
 Separation makes it possible for the client and server to be developed
and updated independently.

2) Stateless
 Each request from client to server must contain all the information
necessary to understand the request, and cannot take advantage of any
stored context on the server.
 So the status of the session remains entirely on the client.
3) Cache-able
 This property defines whether the response to any request can be
cached or not. If a response can be cached, then a client cache is granted
the right to reuse that response data for subsequent matching requests.
4) Layered system
 A layered system defines the boundaries of the components within each
specific layer. For example, a client is unable to tell whether it is
connected to the end server or an intermediate node.
5) Uniform interface
 This specifies that the technique/method of communication between a
client and a server must be uniform throughout the communication
period.
6) Code on Demand (Optional Constraint)
 Servers may provide executable code or scripts for execution by clients
in their context.

Websocket based APIs:

 Web-socket APIs enable bi-directional and full duplex communication


between clients and servers.
 Unlike REST, There is no need to set up a new connection for every new
message to send between a client and a server.
 It works on the principle of the exclusive pair model. Means, Once a
connection is set up, there is a constant exchange of messages between
the client and the server. All we need is to establish a dedicated
connection to start the process. The communication goes on until the
connection is terminated.
 It is a state-ful type.
 Due to onetime dedicated connection setup, there is less overhead,
lower traffic and less latency and high throughput.
 So Web socket is the most suitable IoT Communication APIs for IoT
System.

You might also like