Eiot - Unit IV
Eiot - Unit IV
INTRODUCTION OF IOT
IoT comprises things that have unique identities and are connected to internet. By 2020
there will be a total of 50 billion devices /things connected to internet. IoT is not limited to just
connecting things to the internet but also allow things to communicate and exchange data.
Definition:
A dynamic global n/w infrastructure with self configuring capabilities based on
standard and interoperable communication protocols where physical and virtual ―things‖ have
identities, physical attributes and virtual personalities and use intelligent interfaces, and are
seamlessly integrated into information n/w, often communicate data associated with users and
their environments.
Characteristics:
1. Dynamic & Self Adapting: IoT devices and systems may have the capability to
dynamically adapt with the changing contexts and take actions based on their operating
conditions, user‗s context or sensed environment. Eg: the surveillance system is
adapting itself based on context and changing conditions.
2. Self-Configuring: allowing a large number of devices to work together to provide
certain functionality.
3. Inter Operable Communication Protocols: support a number of interoperable
communication protocols and can communicate with other devices and also with
infrastructure.
4. Unique Identity: Each IoT device has a unique identity and a unique identifier (IP
address).
5. Integrated into Information Network: that allow them to communicate and
exchange data with other devices and systems.
Applications of IoT:
1. Home
2. Cities
3. Environment
4. Energy
5. Retail
6. Logistics
7. Agriculture
8. Industry
9. Health & Life Style
The things in IoT refers to IoT devices which have unique identities and perform remote
sensing, actuating and monitoring capabilities. IoT devices can exchange data with other
connected devices applications. It collects data from other devices and process data either
locally or remotely.
An IoT device may consist of several interfaces for communication to other devices
both wired and wireless. These includes (i) I/O interfaces for sensors, (ii) Interfaces for internet
connectivity (iii) memory and storage interfaces and (iv) audio/video interfaces.
2. IoT Protocols:
Link Layer: Protocols determine how data is physically sent over the network‗s physical layer
or medium. Local network connect to which host is attached. Hosts on the same link exchange
data packets over the link layer using link layer protocols. Link layer determines how packets
are coded and signaled by the h/w device over the medium to which the host is attached.
Protocols:
● 802.3-Ethernet: IEEE802.3 is collection of wired Ethernet standards for the link layer.
Eg: 802.3 uses co-axial cable; 802.3i uses copper twisted pair connection; 802.3j uses
fiber optic connection; 802.3ae uses Ethernet over fiber.
● 802.11-WiFi: IEEE802.11 is a collection of wireless LAN(WLAN) communication
standards including extensive description of link layer. Eg: 802.11a operates in 5GHz
band, 802.11b and 802.11g operates in 2.4GHz band, 802.11n operates in 2.4/5GHz
band, 802.11ac operates in 5GHz band, 802.11ad operates in 60Ghzband.
● 802.16 - WiMax: IEEE802.16 is a collection of wireless broadband standards including
exclusive description of link layer. WiMax provide data rates from 1.5 Mb/s to 1Gb/s.
● 802.15.4-LR-WPAN: IEEE802.15.4 is a collection of standards for low rate wireless
personal area network(LR-WPAN). Basis for high level communication protocols such
as ZigBee. Provides data rate from 40kb/s to250kb/s.
● 2G/3G/4G-Mobile Communication: Data rates from 9.6kb/s(2G) to up
to100Mb/s(4G).
Network/Internet Layer:
Responsible for sending IP datagrams from source n/w to destination n/w. Performs the host
addressing and packet routing. Datagrams contains source and destination address.
Protocols:
● IPv4: Internet Protocol version4 is used to identify the devices on a n/w using a
hierarchical addressing scheme. 32 bit address. Allows total of 2**32addresses.
● IPv6: Internet Protocol version6 uses 128 bit address scheme and allows 2**128
addresses.
● 6LOWPAN:(IPv6 over Lowpower Wireless Personal Area Network) operates in 2.4
GHz frequency range and data transfer 250 kb/s.
Transport Layer:
Provides end-to-end message transfer capability independent of the underlying n/w. Set up on
connection with ACK as in TCP and without ACK as in UDP. Provides functions such as error
control, segmentation, flow control and congestion control.
Protocols:
● TCP: Transmission Control Protocol used by web browsers(along with HTTP and
HTTPS), email(along with SMTP, FTP). Connection oriented and stateless protocol. IP
Protocol deals with sending packets, TCP ensures reliable transmission of protocols in
order. Avoids n/w congestion and congestion collapse.
● UDP: User Datagram Protocol is connectionless protocol. Useful in time sensitive
applications, very small data units to exchange. Transaction oriented and stateless
protocol. Does not provide guaranteed delivery.
Application Layer:
Defines how the applications interface with lower layer protocolsto send data over the
n/w. Enables process-to-process communication using ports.
Protocols:
● HTTP: Hyper Text Transfer Protocol that forms foundation of WWW. Follow
requestresponse model Stateless protocol.
● CoAP: Constrained Application Protocol for machine-to-machine (M2M) applications
with constrained devices, constrained environment and constrained n/w. Uses
clientserver architecture. ∙ WebSocket: allows full duplex communication over a single
socket connection.
● MQTT: Message Queue Telemetry Transport is light weight messaging protocol based
on publish-subscribe model. Uses client server architecture. Well suited for constrained
environment.
● XMPP: Extensible Message and Presence Protocol for real time communication and
streaming XML data between network entities. Support client-server and server-server
communication.
● DDS: Data Distribution Service is data centric middleware standards for device-to-
device or machine-to-machine communication. Uses publish-subscribe model.
● AMQP: Advanced Message Queuing Protocol is open application layer protocol for
business messaging. Supports both point-to-point and publish-subscribe model.
LOGICAL DESIGN of IoT
Refers to an abstract represent of entities and processes without going into the low level
specifies of implementation.
1) IoT Functional Blocks 2) IoT Communication Models 3) IoT Comm. APIs
1) IoT Functional Blocks: Provide the system the capabilities for identification, sensing,
actuation, communication and management.
In which the client sends request to the server and the server replies to requests. Is a
stateless communication model and each request-response pair is independent of others.
HTTP works as a request-response protocol between a client and a server. A web browser may
be the client, and an application on a computer that hosts a website may be the server.
Example: A client (browser) submits an HTTP request to the server; then the server returns a
response to the client. The response contains status information about the request and may also
contain the requested content.
Publish-Subscibe Model:
Involves publishers, brokers and consumers. Publishers are source of data. Publishers send data
to the topics which are managed by the broker. Publishers are not aware of the consumers.
Consumers subscribe to the topics which are managed by the broker. When the broker receives
data for a topic from the publisher, it sends the data to all the subscribed consumers.
Push-Pull Model: in which data producers push data to queues and consumers pull data from
the queues. Producers do not need to aware of the consumers. Queues help in decoupling the
message between the producers and consumers.
Exclusive Pair: is bi-directional, fully duplex communication model that uses a persistent
connection between the client and server. Once connection is set up it remains open until the
client send a request to close the connection. Is a stateful communication model and server is
aware of all the open connections.
3) IoT Communication APIs:
● REST based communication APIs(Request-Response Based Model)
● WebSocket based Communication APIs(Exclusive PairBased Model)
REST based communication APIs: Representational State Transfer(REST) is a set of
architectural principles by which we can design web services and web APIs that focus on a
system‗s resources and have resource states are addressed and transferred.
The REST architectural constraints: Fig. shows communication between client server with
REST APIs.
RESTful web service is a collection of resources which are represented by URIs. RESTful web
API has a base URI(e.g: http://example.com/api/tasks/). The clients and requests to these URIs
using the methods defined by the HTTP protocol(e.g: GET, PUT, POST or DELETE). A
RESTful web service can support various internet media types.
WebSocket Based Communication APIs: WebSocket APIs allow bi-directional, full duplex
communication between clients and servers. WebSocket APIs follow the exclusive pair
communication model.
A "Thing" in Internet of Things (IoT) can be any object that has a unique identifier and
which can send/receive data (including user data) over a network (e.g., smart phone, smartTV,
computer, refrigerator, car, etc.).
• IoT devices are connected to the Internet and send information about themselves or about
their surroundings (e.g. information sensed by the connected sensors) over a network (to
other devices or servers/storage) or allow actuation upon the physical entities/environment
around them remotely.
IoT Device Examples
A home automation device that allows remotely monitoring the status of appliances and
controlling the appliances.
• An industrial machine which sends information abouts its operation and health monitoring
data to a server.
• A car which sends information about its location to a cloud-based service.
• A wireless-enabled wearable device that measures data about a person such as the number
of steps walked and sends the data to a cloud-based service.
Basic building blocks of an IoT Device
• Sensing: Sensors can be either on-board the IoT device or attached to the device.
• Actuation: IoT devices can have various types of actuators attached that allow taking
actions upon the physical entities in the vicinity of the device.
• Communication: Communication modules are responsible for sending collected data to
other devices or cloud-based servers/storage and receiving data from other devices and
commands from remote applications.
• Analysis & Processing: Analysis and processing modules are responsible for making sense
of the collected data.
Raspberry Pi GPIO
Raspberry Pi Interfaces
1. Serial: The serial interface on Raspberry Pi has receive (Rx) and transmit (Tx) pins for
communication with serial peripherals.
2. SPI: Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for
communicating with one or more peripheral devices.
3. I2C: The I2C interface pins on Raspberry Pi allow you to connect hardware modules. I2C
interface allows synchronous data transfer with just two pins - SDA (data line) and SCL
(clockline).
Characteristics
First, the cloud computing of IoT is an on-demand self service, meaning it‗s there when
you need it. Cloud computing is a web-based service that can be accessed without any special
assistance or permission from other people; however, you need at minimum some sort of
internet access.
Second, the cloud computing of IoT involves broad network access, meaning it offers several
connectivity options. Cloud computing resources can be accessed through a wide variety of
internet-connected devices such as tablets, mobile devices and laptops. This level of
convenience means users can access those resources in a wide variety of manners, even from
older devices. Again, though, this emphasizes the need for network access points.
Third, cloud computing allows for resource pooling, meaning information can be shared with
those who know where and how (have permission) to access the resource, anytime and
anywhere. This lends to broader collaboration or closer connections with other users. From an
IoT perspective, just as we can easily assign an IP address to every "thing" on the planet, we
can share the "address" of the cloud-based protected and stored information with others and
pool resources.
Fourth, cloud computing features rapid elasticity, meaning users can readily scale the service
to their needs. You can easily and quickly edit your software setup, add or remove users,
increase storage space, etc. This characteristic will further empower IoT by providing elastic
computing power, storage and networking.
Finally, the cloud computing of IoT is a measured service, meaning you get what you pay for.
Providers can easily measure usage statistics such as storage, processing, bandwidth and active
user accounts inside your cloud instance. This pay per use (PPU) model means your costs scale
with your usage. In IoT terms, it's comparable to the ever-growing network of physical objects
that feature an IP address for internet connectivity, and the communication that occurs between
these objects and other internet-enabled devices and systems; just like your cloud service, the
service rates for that IoT infrastructure may also scale with use.
Service and Deployment
Service models
Service delivery in cloud computing comprises three different service models: software
as a service (SaaS), platform as a service (PaaS), and infrastructure as a service (IaaS).
Software as a service (SaaS) provides applications to the cloud‗s end user that are
mainly accessed via a web portal or service-oriented architecture-based web service
technology. These services can be seen as ASP (application service provider) on the application
layer. Usually, a specific company that uses the service would run, maintain and give support
so that it can be reliably used over a long period of time.
Platform as a service (PaaS) consists of the actual environment for developing and
provisioning cloud applications. The main users of this layer are developers that want to
develop and run a cloud application for a particular purpose. A proprietary language was
supported and provided by the platform (a set of important basic services) to ease
communication, monitoring, billing and other aspects such as startup as well as to ensure an
application‗s scalability and flexibility. Limitations regarding the programming languages
supported, the programming model, the ability to access resources, and the long-term
persistence are possible disadvantages.
Infrastructure as a service (IaaS) provides the necessary hardware and software upon
which a customer can build a customized computing environment. Computing resources, data
storage resources and the communications channel are linked together with these essential IT
resources to ensure the stability of applications being used on the cloud. Those stack models
can be referred to as the medium for IoT, being used and conveyed by the users in different
methods for the greatest chance of interoperability. This includes connecting cars, wearables,
TVs, smartphones, fitness equipment, robots, ATMs, and vending machines as well as the
vertical applications, security and professional services, and analytics platforms that come with
them.
Deployment models
Deployment in cloud computing comprises four deployment models: private cloud,
public cloud, community cloud and hybrid cloud.
A private cloud has infrastructure that‗s provisioned for exclusive use by a single
organization comprising multiple consumers such as business units. It may be owned, managed
and operated by the organization, a third party or some combination of them, and it may exist
on or off premises.
A public cloud is created for open use by the general public. Public cloud sells services
to anyone on the internet. (Amazon Web Services is an example of a large public cloud
provider.) This model is suitable for business requirements that require management of load
spikes and the applications used by the business, activities that would otherwise require greater
investment in infrastructure for the business. As such, public cloud also helps reduce capital
expenditure and bring down operational IT costs.
A community cloud is managed and used by a particular group or organizations that
have shared interests, such as specific security requirements or a common mission. Finally, a
hybrid cloud combines two or more distinct private, community or public cloud infrastructures
such that they remain unique entities but are bound together by standardized or proprietary
technology that enables data and application portability. Normally, information that‗s not
critical is outsourced to the public cloud, while business-critical services and data are kept
within the control of the organization.
CLOUD STORAGE API
A cloud storage API is an application program interface that connects a locally-based
application to a cloud-based storage system, so that a user can send data to it and access and
work with data stored in it. To the application, the cloud storage system is just another target
device, like tape or disk-based storage. An application program interface (API) is code that
allows two software programs to communicate with each other. The API defines the correct
way for a developer to write a program that requests services from an operating system (OS)
or other application. APIs are implemented by function calls composed of verbs and nouns.
The required syntax is described in the documentation of the application being called.
How APIs work
APIs are made up of two related elements. The first is a specification that describes
how information is exchanged between programs, done in the form of a request for processing
and a return of the necessary data. The second is a software interface written to that
specification and published in some way for use. The software that wants to access the features
and capabilities of the API is said to call it, and the software that creates the API is said to
publish it.
Why APIs are important for business
The web, software designed exchange information via the internet and cloud computing
have all combined to increase the interest in APIs in general and services in particular. Software
that was once custom-developed for a specific purpose is now often written referencing APIs
that provide broadly useful features, reducing development time and cost and mitigating the
risk of errors.APIs have steadily improved software quality over the last decade, and the
growing number of web services exposed through APIs by cloud providers is also encouraging
the creation of cloud-specific applications, internet of things (IoT) efforts and apps to support
mobile devices and users.
Three basic types of APIs
APIs take three basic forms: local, web-like and program-like.
Local APIs are the original form, from which the name came. They offer OS or middleware
services to application programs. Microsoft's .NET APIs, the TAPI (Telephony API) for voice
applications, and database access APIs are examples of the local APIform.
Web APIs are designed to represent widely used resources like HTML pages and are accessed
using a simple HTTP protocol. Any web URL activates a web API. Web APIs are often called
REST (representational state transfer) or RESTful because the publisher of REST interfaces
doesn't save any data internally between requests. As such, requests from many users can be
intermingled as they would be on the internet.
Program APIs are based on remote procedure call (RPC) technology that makes a remote
program component appear to be local to the rest of the software. Service oriented architecture
(SOA) APIs, such as Microsoft's WS-series of APIs, are program APIs.
IoT / Cloud Convergence
Internet-of-Things can benefit from the scalability, performance and pay-as-you-go
nature of cloud computing infrastructures. Indeed, as IoT applications produce large volumes
of data and comprise multiple computational components (e.g., data processing and analytics
algorithms), their integration with cloud computing infrastructures could provide them with
opportunities for cost-effective on-demand scaling. As prominent examples consider the
following settings:
A Small Medium Enterprise (SME) developing an energy management IoT product,
targeting smart homes and smart buildings. By streaming the data of the product (e.g., sensors
and WSN data) into the cloud it can accommodate its growth needs in a scalable and cost
effective fashion. As the SMEs acquires more customers and performs more deployments of
its product, it is able
tocollectandmanagegrowingvolumesofdatainascalableway,thustakingadvantageofa ―pay-as-
you-grow‖model. Moreover, cloud integration allows the SME to store and process massive
datasets collected from multiple (rather than a single)deployments.
A smart city can benefit from the cloud-based deployment of its IoT systems and
applications. A city is likely to deploy many IoT applications, such as applications for smart
energy management, smart water management, smart transport management, urban mobility
of the citizens and more. These applications comprise multiple sensors and devices, along with
computational components. Furthermore, they are likely to produce very large data volumes.
Cloud integration enables the city to host these data and applications in a cost-effective way.
Furthermore, the elasticity of the cloud can directly support expansions to these applications,
but also the rapid deployment of new ones without major concerns about the provisioning of
the required cloud computing resources.
A cloud computing provider offering pubic cloud services can extend them to the IoT
area, through enabling third-parties to access its infrastructure in order to integrate IoT data
and/or computational components operating over IoT devices. The provider can offer IoT data
access and services in a pay-as-you-fashion, through enabling third-parties to access resources
of its infrastructure and accordingly to charge them in a utility-based fashion.
These motivating examples illustrate the merit and need for converging IoT and cloud
computing infrastructure. Despite these merits, this convergence has always been challenging
mainly due to the conflicting properties of IoT and cloud infrastructures, in particular, IoT
devices tend to be location specific, resource constrained, expensive (in terms of development/
deployment cost) and generally inflexible (in terms of resource access and availability). On the
other hand, cloud computing resources are typically location independent and inexpensive,
while at the same time providing rapid and flexibly elasticity. In order to alleviate these
incompatibilities, sensors and devices are virtualized prior to integrating their data and services
in the cloud, in order to enable their distribution across any cloud resources. Furthermore,
service and sensor discovery functionalities are implementing on the cloud in order to enable
the discovery of services and sensors that reside in different locations.
Based on these principles the IoT/cloud convergence efforts have started since over a
decade i.e. since they very early days of IoT and cloud computing. Early efforts in the research
community (i.e. during 2005-2009) have focused on streaming sensor and WSN data in a cloud
infrastructure. Since 2007 we have also witnessed the emergence of public IoT clouds,
including commercial efforts. One of the earliest efforts has been the famous Pachube.com
infrastructure (used extensively for radiation detection and production of radiation maps during
earthquakes in Japan). Pachube.com has evolved (following several evolutions and acquisitions
of this infrastructure) to Xively.com, which is nowadays one of the most prominent public IoT
clouds. Nevertheless, there are tens of other public IoT clouds as well, such as ThingsWorx,
ThingsSpeak,Sensor-Cloud, Realtime.io and more. The list is certainly nonexhaustive. These
public IoT clouds offer commercial pay-as-you-go access to end-users wishing to deploying
IoT applications on the cloud. Most of them come with developer friendly tools, which enable
the development of cloud applications, thus acting like a PaaS for IoT in the cloud. Similarly
to cloud computing infrastructures, IoT/cloud infrastructures and related services can be
classified to the following models:
Infrastructure-as-a-Service (IaaS) IoT/Clouds: These services provide the means for
accessing sensors and actuator in the cloud. The associated business model involves the
IoT/Cloud provide to act either as data or sensor provider. IaaS services for IoT provide access
control to resources as a prerequisite for the offering of related pay-as-you-go services.
Platform-as-a-Service (PaaS) IoT/Clouds: This is the most widespread model for IoT/cloud
services, given that it is the model provided by all public IoT/cloud infrastructures outlined
above. As already illustrate most public IoT clouds come with a range of tools and related
environments for applications development and deployment in a cloud environment. A main
characteristic of PaaS IoT services is that they provide access to data, not to hardware. This is
a clear differentiator comparing to IaaS.
Software-as-a-Service (SaaS) IoT/Clouds: SaaS IoT services are the ones enabling their uses
to access complete IoT-based software applications through the cloud, on-demand and in a pay-
as-you-go fashion. As soon as sensors and IoT devices are not visible, SaaS IoT applications
resemble very much conventional cloud-based SaaS applications. There are however cases
where the IoT dimension is strong and evident, such as applications involving selection of
sensors and combination of data from the selected sensors in an integrated application. Several
of these applications are commonly called Sensing-as-aService, given that they provide on-
demand access to the services of multiple sensors. Note that SaaS IoT applications are typically
built over a PaaS infrastructure and enable utility-based business models involving IoT
software and services.