100% found this document useful (2 votes)
325 views

F-IoT - Unit-1

This document provides information about a course on Fundamentals of Internet of Things taught at Anurag College of Engineering. The course is a 3rd year B.Tech course taught in the II semester. It includes 5 units that cover topics such as introduction to IoT, machine to machine communications, programming with Arduino and Raspberry Pi, software defined networks, and applications of IoT. The document outlines the course syllabus, objectives, outcomes and provides examples to explain some of the concepts taught in the course.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
325 views

F-IoT - Unit-1

This document provides information about a course on Fundamentals of Internet of Things taught at Anurag College of Engineering. The course is a 3rd year B.Tech course taught in the II semester. It includes 5 units that cover topics such as introduction to IoT, machine to machine communications, programming with Arduino and Raspberry Pi, software defined networks, and applications of IoT. The document outlines the course syllabus, objectives, outcomes and provides examples to explain some of the concepts taught in the course.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 178

ANURAG COLLEGE OF ENGINEERING

(Approved by AICTE, New Delhi & Affiliated to JNTU-HYD)


Aushapur (V), Ghatkesar (M), Medchal (Dist.), Telangana-501 301.

FUNDAMENTALS OF INTERNET OF THINGS


B.Tech - III YEAR II SEM - CSE

Presented By:

G. Kiran Kumari
Assistant Professor
Department of ECE
Anurag College of Engineering
Syllabus
UNIT – I
Introduction to Internet of Things, Characteristics of IoT,
Physical design of IoT, Functional blocks of IoT, Sensing,
Actuation, Basics of Networking, Communication
Protocols, Sensor Networks.
UNIT – II
Machine-to-Machine Communications, Difference
between IoT and M2M, Interoperability in IoT,
Introduction to Arduino Programming, Integration of
Sensors and Actuators with Arduino.
UNIT – III
Introduction to Python programming, Introduction to
Raspberry Pi, Interfacing Raspberry Pi with basic
peripherals, Implementation of IoT with Raspberry Pi

Anurag College of Engineering 2


Syllabus cont’d
UNIT - IV
Implementation of IoT with Raspberry Pi, Introduction
to Software defined Network (SDN), SDN for IoT, Data
Handling and Analytics.

UNIT - V
Cloud Computing, Sensor-Cloud, Smart Cities and
Smart Homes, Connected Vehicles, Smart Grid,
Industrial IoT, Case Study: Agriculture, Healthcare,
Activity Monitoring.

Anurag College of Engineering 3


TEXT BOOKS:
1. "The Internet 'of Things: Enabling Technologies, Platforms,
and Use Cases", by Pethuru Raj and Anupama C. Raman
(CRC Press)
2. “Make sensors”: Terokarvinen, kemo, karvinen and villey
valtokari, 1st edition, maker media, 2014.
3. "Internet of Things: A Hands-on Approach", by Arshdeep
Bahga and Vijay Madisetti

REFERENCE BOOKS:
1. Vijay Madisetti, Arshdeep Bahga, “Internet of Things: A
Hands-On Approach”
2. Waltenegus Dargie,Christian Poellabauer, "Fundamentals of
Wireless Sensor Networks: Theory and Practice"
3. Beginning Sensor networks with Arduino and Raspberry Pi –
Charles Bell, Apress, 2013
4
Anurag College of Engineering
Course Objectives:

The objectives of the course are to:


1.Understand the concepts of Internet of Things
and able to build IoT applications
2. Learn the programming and use of Arduino and
Raspberry Pi boards.
3. Known about data handling and analytics in
SDN.

Anurag College of Engineering 5


Course Outcomes:

Upon completing this course, the student will be able to


1. Known basic protocols in sensor networks.
2. Program and configure Arduino boards for various
designs.
3. Python programming and interfacing for Raspberry
Pi.
4. Design IoT applications in different domains.

Anurag College of Engineering 6


Syllabus

UNIT – I

Introduction to Internet of Things,


Characteristics of IoT, Physical design of
IoT, Functional blocks of IoT, Sensing,
Actuation, Basics of Networking,
Communication Protocols, Sensor Networks.

Anurag College of Engineering 7


Introduction to Internet of Things

• Internet of Things (IoT) comprises things that have


unique identities and are connected to the Internet.
• Devices such as networked computers or 4G enabled
mobile phones have some form of unique identities and
are also connected to the Internet.
• The focus on IoT is in the configuration, control and
networking via the Internet of devices or things.
• These include devices such as thermostats, utility meters,
a blue tooth-connected headset, irrigation pumps and
sensors or control circuits for an electric car’s engine.
Anurag College of Engineering 8
Introduction to Internet of Things cont’d

• Internet of Things is a new revolution in the capabilities


of the end points that are connected to the Internet, and is
driven by the advancements in capabilities in sensor
networks, mobile devices, wireless communications,
networking and cloud technologies.
• By the year 2020 there will be a total of 50 billion
devices/things connected to the Internet.
• IoT is not connecting things to the internet. It allows these
things to communicate and exchange data.

Anurag College of Engineering 9


Applications of IoT:
1) Home
2) Cities
3) Environment
4) Energy systems
5) Retail
6) Logistics
7) Agriculture
8) Industry
9) Health & Life Style

Anurag College of Engineering 10


Homes:
• Smart lighting that adapt the lighting to suit the ambient
conditions, smart appliances that can be remotely
monitored and controlled, intrusion detection systems,
smart smoke detectors, etc.

Cities:
• Smart parking systems that provide status updates on
available slots, smart lighting that helps in saving energy,
smart roads that provide information on driving
conditions and structural health monitoring systems.

Anurag College of Engineering 11


Environment:
• Weather monitoring, air and noise pollution, forest fire
detection and river flood detection systems.

Energy Systems:
• Smart grids, grid integration of renewable energy
sources and prognostic health management systems.

Retail Domain:
• Inventory management, smart payments and smart
vending machines.
Anurag College of Engineering 12
Agriculture:
• Smart irrigation systems that help in saving water
while enhancing productivity and green house control
systems.

Industrial Applications:
• Machine diagnosis and prognosis systems that help in
predicting faults and determining the cause of faults and
indoor air quality systems.

Health and Life style:


• Health and fitness monitoring systems and wearable
electronics.
13
Anurag College of Engineering
Definition of IoT:

A dynamic global network 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 network,
often communicate data associated with users and their
environments.

Anurag College of Engineering 14


Characteristics of IoT

1) Dynamic & Self Adapting


2) Self Configuring
3) Interoperable Communication Protocols
4) Unique Identity
5) Integrated into Information Network

Anurag College of Engineering 15


Characteristics of IoT cont’d
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,
users 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.

Anurag College of Engineering 16


Characteristics of IoT cont’d
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.
Anurag College of Engineering 17
Physical Design of IoT

1) Things in IoT

2) IoT Protocols

Anurag College of Engineering 18


1.Things in IoT:

Anurag College of Engineering 19


• 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 and 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.

Anurag College of Engineering 20


• These includes :

(i) I/O interfaces for sensors


(ii) Interfaces for internet connectivity
(iii) memory and storage interfaces and
(iv) audio/video interfaces

Anurag College of Engineering 21


Anurag College of Engineering 22
2. IoT Protocols:

Anurag College of Engineering 23


Link Layer
• Link Layer protocols determine how the data is
physically sent over the network’s physical layer or
medium.
Eg. Copper wire , coaxial cable, radio wave
• The scope of the link layer is the local network
connection to which the host is attached.
• Hosts on the same link exchange data packets over the link
layer using link layer protocols.
• Link layer determines how the packets are coded and
signaled by the hardware device over the medium to which
the host is attached.
• Link layer protocols are: 802.3-Ethernet, 802.11-Wi-Fi,
802.16-WiMax, 802.15.4-LR-WPAN, 2G/3G/4G-Mobile
24
Communication. Anurag College of Engineering
802.3- Ethernet
• IEEE 802.3 is a collection of wired Ethernet
standards for the link layer.
• 802.3 is the standard for 10 BASE 5 Ethernet that
uses coaxial cable as a shared medium.
• 802.3i is the standard for 10 BASE-T Ethernet over
copper twisted pair connections.
• 802.3 j is the standard for 10 BASE-F Ethernet over
fiber optic connections.
• 802.3ae is the standard for 10Gbit/s Ethernet over
fiber.
• These standards provide data rates from 10Mb/s to
40 Gb/s and higher.
25
Anurag College of Engineering
802.3- Ethernet cont’d

• The shared medium in Ethernet can be a coaxial


cable, twisted-pair wire or an optical cable.
• The shared medium carries the communication for
all the devices on the network, thus data sent by
one device can be received by all the devices
subject to propagation conditions and transceiver
capabilities.

Anurag College of Engineering 26


802.11- Wi-Fi
• IEEE 802.11 is a collection of wireless local area
network (WLAN) communication standards
including extensive description for the of the link
layer .
• 802.11a operates in the 5GHz band.
• 802.11b and 802.11g operate in the 2.4GHz band.
• 802.11n operates in the 2.4/5 GHz band.
• 802.11ac operates in the 5GHz band.
• 802.11ad operates in the 60GHz band.
• These standards provide data rates from 1Mb/s up to
6.75Gb/s
Anurag College of Engineering 27
802.16- WiMax

• IEEE 802.16 is a collection of wireless broadband


standards, including extensive descriptions for the
link layer.
• Also called WiMax.
• WiMax standards provide data rates from 1.5Mb/s to
1Gb/s.
• 802.16m provides data rates of 100 Mb/s for mobile
stations and 1Gb/s for fixed stations.

28
Anurag College of Engineering
802.15.4 – LR-WPAN

• IEEE 802.15.4 is a collection of standards for low-


rate wireless personal area networks (LR-WPANs).
• These standards form the basis of specifications for
high level communication protocols such as ZigBee.
• LR-WPAN standards provide data rates from 40 Kb/s
to 250 Kb/s.
• These standards provide low cost and low speed
communication for power constrained devices.

29
Anurag College of Engineering
2G/3G/4G- Mobile Communication
• There are different generations of mobile
communication standards.
✓ Second generation (2G- including GSM and
CDMA)
✓ Third generation (3G- including UMTS and
CDMA 2000)
✓ Fourth generation (4G- including LTE).
• IoT devices based on these standards can
communicate over cellular networks.
• Data rates for these standards range from 9.6 Kb/s
(for 2G) to up to 100 Mb/s (for 4G).
Anurag College of Engineering 30
Network/ Internet Layer
• The network layers are responsible for sending of
IP datagrams from the source network to the destination
network.
• This layer performs the host addressing and packet
routing.
• Datagrams contains source and destination addresses
which are used to route them from the source to
destination across multiple networks.
• Host identification is done using IP addressing schemes
such as IPv4 or IPv6.
• IP protocols establish connections on packet networks but
do not guarantee delivery of packets
• The protocols of this layer are IPv4, IPv6, 6LoWPAN. 31
Anurag College of Engineering
IPv4- Internet Protocol version 4:
• Internet Protocol version4 is used to identify the devices
on a network using a hierarchical addressing scheme.
• It uses a 32-bit address scheme and allows total of 232
addresses.

IPv6- Internet Protocol version 6:


• Internet Protocol version6 is the newest version of
Internet Protocol.
• It uses 128 bit address scheme and allows total of 2128
addresses.
32
Anurag College of Engineering
6LoWPAN:
• 6LoWPAN (IPv6 over Low Power Wireless Personal
Area Network) brings IP protocol to the low-power
devices which have limited processing capability.
• Operates in 2.4 GHz frequency range and data transfer
rates of 250 kb/s.
• 6LoWPAN works with the 802.15.4 link layer protocol
and defines compression mechanisms for IPv6
datagrams over IEEE 802.15.4 based networks.

Anurag College of Engineering 33


Transport Layer

• Transport layer protocols provides end-to-end message


transfer capability independent of the underlying
network.
• The message transfer capability can be set up on
connections with acknowledgements as in TCP and
without acknowledgements as in UDP.
• It provides functions such as error control, segmentation,
flow control and congestion control.
• The transport layer protocols are TCP and UDP.

Anurag College of Engineering 34


Transmission Control Protocol (TCP) :

• Transmission Control Protocol is the widely used


transport layer protocol.
• It is used by web browsers (along with HTTP and HTTPS),
email programs (along with SMTP) and File Transfer (FTP).
• It is a connection oriented and stateful protocol.
• IP Protocol deals with sending packets, TCP ensures reliable
transmission of protocols in order.
• TCP provides error detection capability so that duplicate
packets can be discarded and lost packets can be 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.
35
Anurag College of Engineering
User Datagram Protocol (UDP) :

• User Datagram Protocol is a connectionless


protocol.
• It is useful for time sensitive applications, very small data
units to exchange.
• It is a transaction oriented and stateless protocol.
• It does not provide guaranteed delivery, ordering of
messages and duplicate elimination.
• Higher level of protocols can ensure ensure reliable
delivery or ensure connections created are reliable.

36
Anurag College of Engineering
Application Layer
• Application layer protocols define how the
applications interface with lower layer protocols to send
data over the network.
• The application data in files is encoded by the application
layer protocol and encapsulated in the transport layer
Protocol which provides connection or transaction
oriented communication over the network.
• The protocols in this layer enable process-to-process
connections using ports.
• Port numbers are used for application addressing.
Eg. Port 80 for HTTP.
• The protocols of this layer are HTTP, CoAP, WebSocket,
MQTT, XMPP, DSS, AnuragAMQP.
College of Engineering
37
Hypertext Transfer Protocol (HTTP):

• Hyper Text Transfer Protocol forms foundation of World


Wide Web (WWW).
• It has commands such as GET, PUT, POST, DELETE,
HEAD, TRACE, etc.
• It follows a request-response model where a client sends
requests to a server using the HTTP commands.
• It is a Stateless protocol and each HTTP request is
independent of other requests.
• HTTP client can be a browser or an application running
on the client.
• This protocol uses Universal Resource Identifiers (URIs)
to identify HTTP resources.
38
Anurag College of Engineering
Constrained Application Protocol (CoAP):

• Constrained Application Protocol is for machine-to-


machine (M2M) applications for constrained devices,
constrained environment and constrained networks.
• CoAP is a web transfer protocol and uses a request-
response model.
• It uses client-server architecture where clients
communicate with serves using connectionless datagrams.
• CoAP is designed to easily interface with HTTP.
• It supports methods such as GET, PUT, POST and
DELETE.

39
Anurag College of Engineering
WebSocket:

• WebSocket protocol allows full duplex communication


over a single socket connection for sending messages
between client and server.
• WebSocket is based on TCP and allows streams of
messages to be sent back and forth between the client and
server while keeping the TCP connection open.
• The client can be a browser, a mobile application or an
IoT device.

40
Anurag College of Engineering
Message Queue Telemetry Transport (MQTT):

• Message Queue Telemetry Transport is light-weight


messaging protocol based on publish-subscribe model.
• It uses a client- server architecture. The client (IoT
device) connects to the server ( also called MQTT Broker)
and publishes messages to topics on the server.
• The broker forwards the messages to the clients
subscribed to topics.
• It is well suited for constrained environment where the
devices have limited processing and memory resources
and the network bandwidth is low.

41
Anurag College of Engineering
Extensible Messaging and Presence Protocol
(XMPP) :
• Extensible Message and Presence Protocol for real time
communication and streaming XML data between
network entities.
• XMPP powers wide range of applications including
messaging, presence, data syndication, gaming, multi-
party chat, voice/video calls.
• It allows sending small chunks of XML data from one
network entity to another in near real-time.
• It is a decentralized protocol and uses client-server
architecture.
• It supports both client-to-server and server-to-server
communication paths.
• In IoT, XMPP allows real-time communication between
IoT devices.
42
Anurag College of Engineering
Data Distribution Service (DSS):

• Data Distribution Service is data centric middleware


standard for device-to-device or machine-to-machine
communication.
• It uses publish-subscribe model where publishers create
topics to which subscribers can subscribe.
• Publisher is an object responsible for data distribution and
the subscriber is responsible for receiving published data.
• DSS provides Quality-of-Service (QoS) control and
configurable reliability.

43
Anurag College of Engineering
Advanced Message Queuing Protocol(AMQP):
• Advanced Message Queuing Protocol is an open
application layer protocol for business messaging.
• It supports both point-to-point and publish-subscribe
models.
• AMQP brokers receive messages from publishers
(devices or applications that generate data) and route them
over connections to consumers (applications that process
data).
• Publishers publish the messages to exchanges which then
distribute message copies to queues.
• Messages are either delivered by the broker to the
consumers which have subscribed to the queues or the
consumers can pull the messages from the queues.
44
Anurag College of Engineering
LOGICAL DESIGN of IoT

• Logical Design of an IoT system 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 Communication APIs

Anurag College of Engineering 45


Functional Blocks of IoT
• An IoT system comprises of a number of functional
blocks that provide the system the capabilities for
identification, sensing, actuation, communication and
management as shown in figure.

Fig: Functional Blocks of IoT


46
Anurag College of Engineering
Device:
An IoT system comprises of devices that provide sensing,
actuation, monitoring and control functions.

Communication:
The communication block handles the communication for
the IoT system.

Services:
An IoT system uses various types of IoT services such as
services for device monitoring, device control services,
data publishing services and services for device
discovery.
47
Anurag College of Engineering
.
Management:
Management functional block provides various functions
to govern the IoT system.
Security:
Security functional block secures the IoT system by
providing functions such as authentication, authorization,
message and content integrity and data security.
Application:
• IoT applications provide an interface that the users can
use to control and monitor various aspects of the IoT
system.
• Applications also allow users to view the system status
and view or analyze the processed data.
48
Anurag College of Engineering
IoT Communication Models

1) Request-Response Communication Model


2) Publish-Subscribe Communication Model
3) Push-Pull Communication Model
4) Exclusive Pair Communication Model

Anurag College of Engineering 49


Request-Response Communication Model

Fig. Request-Response Communication Model

Anurag College of Engineering 50


Request-Response Communication Model
(cont’d)

• Request-Response is a communication model in which


the client sends requests to the server and the server
responds to the requests.
• When the server receives a request, it decides how to
respond, fetches the data, retrieves resource
representations, prepares the response, and then sends the
response to the client.
• Request-Response model is a stateless communication
model and each request-response pair is independent of
others.
Anurag College of Engineering 51
Publish-Subscribe Communication Model

Fig. Publish-Subscribe Communication Model

Anurag College of Engineering 52


Publish-Subscribe Communication Model
(cont’d)
• Publish-Subscribe is a communication model that
involves publishers, brokers and consumers.
• Publishers are the source of data. Publishers send the
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.

Anurag College of Engineering 53


Push-Pull Communication Model

Fig. Push-Pull Communication Model

Anurag College of Engineering 54


Push-Pull Communication Model (cont’d)

• Push-Pull is a communication model in which the


data producers push the data to queues and the
consumers pull the data from the queues. Producers
do not need to be aware of the consumers.
• Queues help in decoupling the messaging between the
producers and consumers.
• Queues also act as a buffer which helps in situations
when there is a mismatch between the rate at which
the producers push data and the rate at which the
consumers pull data.

Anurag College of Engineering 55


Exclusive Pair Communication Model

Fig. Exclusive Pair Communication Model

Anurag College of Engineering 56


Exclusive Pair Communication Model
(cont’d)

• Exclusive Pair is a bidirectional, fully duplex


communication model that uses a persistent
connection between the client and server.
• Once the connection is setup it remains open until the
client sends a request to close the connection.
• Client and server can send messages to each other
after connection setup.
• It is a stateful communication model and the server is
aware of all the open connections.

Anurag College of Engineering 57


IoT Communication APIs

a) REST (Representational State Transfer) based


communication APIs

b) WebSocket based Communication APIs

Anurag College of Engineering 58


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 how resource states are addressed and
transferred.
• REST APIs follow the request- response
communication model.
• The REST architectural constraints apply to the
components, connectors, and data elements, within a
distributed hypermedia system

59
Anurag College of Engineering
REST Based Communication APIs (cont’d)
• The REST architectural constraints:
Fig. shows communication between client server with
REST APIs.

Anurag College of Engineering 60


• Client-Server: The principle behind client-server
constraint is the separation of concerns. Separation
allows client and server to be independently developed and
updated.
• 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.
• Cache-able: Cache constraint requires that the data within
a response to a request be implicitly or explicitly labeled as
cache-able or non-cacheable. If a response is cache-able,
then a client cache is given the right to reuse that response
data for later, equivalent requests. Caching can partially or
completely eliminate some interactions and improve
efficiency and scalability.
Anurag College of Engineering 61
• Layered System: In this constraints the behavior
of components such that each component cannot
see beyond the immediate layer with which they are
interacting.
• Uniform Interface: This constraint requires that the
method of communication between a client and a
server must be uniform.
• Code on Demand: Servers can provide executable code
or scripts for clients to execute in their context. This
constraint is the only one that is optional.

Anurag College of Engineering 62


Request-Response model used by REST

Anurag College of Engineering 63


Request-Response model used by REST
(cont’d)
• A RESTful web service is a ‘Web API’ implemented
using HTTP and REST principles.
• 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
Anurag College of Engineering 64
WebSocket Based Communication APIs

• WebSocket APIs allow bi-directional, full duplex


communication between clients and servers.
• WebSocket APIs follow the exclusive pair
communication model.

Anurag College of Engineering 65


WebSocket Based Communication APIs
(cont’d)

• The WebSocket APIs allow a full duplex communication


and do not require a new connection to be setup for each
message to be sent.
• WebSocket communication begins with a connection
setup request sent by the client to the server.
• This request (called a WebSocket Handshake) is sent over
HTTP and the server interprets it as an upgrade request.

66
Anurag College of Engineering
WebSocket Based Communication APIs
(cont’d)

• If the server supports WebSocket protocol, the server


responds to the WebSocket handshake responds.
• After a connection is setup, the client and server can
send data/messages to each other in full-duplex mode.
• WebSocket APIs reduce network traffic and latency as
there is no overhead for connection setup and
termination requests for each message.
• WebSocket is suitable for IoT applications that have
low latency or high throughput requirements.

Anurag College of Engineering 67


Sensing:
• Sensing is a technique used to gather information about a
physical object or process, including the occurrence of
events (i.e., changes in state such as a drop in temperature
or pressure).
• An object performing such a sensing task is called a
sensor
• Sensors can be either on-board the IoT device or attached
to the device.
• IoT device can collect various types of information from
the on-board or attached sensors.
• The sensed information can be communicated either to
other devices or cloud-based servers/ storage.
• Eg. Temperature, humidity, light intensity sensors, etc.68
Anurag College of Engineering
Actuation:

• IoT devices can have various type of actuators


attached that allow taking actions upon the
physical entities in the vicinity of the device.
Eg. A relay switch connected to an IoT device
can turn an application on/off based on the
commands sent to the device.

Anurag College of Engineering 69


Basics of Networking
Network:
A network is a set of devices (often referred to as nodes)
connected by communication links.
A node can be a computer, printer, or any other device
capable of sending and/or receiving data generated by other
nodes on the network.
Distributed Processing:
Most networks use distributed processing, in which a task
is divided among multiple computers.
Instead of one single large machine being responsible for
all aspects of a process, separate computers (usually a
personal computer or workstation) handle a subset.
Anurag College of Engineering 70
Network Criteria:
A network must be able to meet a certain number of
criteria.
1.Performance
2.Reliability
3. Security

Anurag College of Engineering 71


Network Criteria-Performance
Performance :
Performance of a network pertains to the measure of
service quality of a network as perceived by the user.
• Performance can be measured in
1.Transit time
2.Response time
• Transit time is the amount of time required for a
message to travel from one device to another.
• Response time is the elapsed time between an inquiry
and a response. (OR)
• It is defined as the total amount of time it takes to
respond to a request for service.
Anurag College of Engineering 72
The performance of a network depends on

• The number of users


• The type of transmission medium
• The capabilities of the connected hardware
• The efficiency of the software

Anurag College of Engineering 73


• Performance is often evaluated by
two networking metrics:
1.Throughput
2.Delay

1.Throughput is the amount of data moved


successfully from one place to another in a given
time period.
It is measured in bits per second (bps), Mega bits
per second (Mbps), Gigabits per second (Gbps)

Anurag College of Engineering 74


2.Delay: It specifies the latency for a bit of data
to travel across the network from one
communication end point to another.
Types of delay are
1. Transmission delay
2. Propagation delay
3. Queuing delay
4. Processing delay
• We often need more throughput and less delay.
• These two criteria are often contradictory. If we try to
send more data to the network, we may increase
throughput but we increase the delay because of
traffic congestion in the network.
75
Anurag College of Engineering
Network Criteria-Reliability
•In addition to accuracy of delivery, network
reliability is measured by the frequency of failure,
the time it takes a link to recover from a failure, and
the network's robustness in a catastrophe
(unexpected failure).
•A reliable protocol is a communication
protocol that notifies the sender whether or not the
delivery of data to intended recipients was
successful. Reliability is a synonym for assurance

Anurag College of Engineering 76


Network Criteria-Security
Network security issues include
• Protecting data from unauthorized access
• Protecting data from damage and development
• Implementing policies and procedures for recovery
from breaches and data losses.

• Security Breach: When an intruder gains


unauthorized access to an organizations protected
systems and data.

Anurag College of Engineering 77


Type of Connections

1. Point to Point - single transmitter and


receiver
2. Multipoint - multiple recipients of
single transmission

Anurag College of Engineering 78


1. Point-to-Point Connection:
• It provides a dedicated link between two devices.
• Link is a communication pathway that transfers data
from one device to another device
• Most point-to-point connections uses an actual length
of wire or cable to connect the two ends.
Eg: TV Remote

Anurag College of Engineering 79


2. Multi-Point Connection:
• In multi-point connection more than two specific
devices shares a single link.
• It is also known as Multidrop Connection
• In a multipoint environment, the capacity of the channel
is shared, either spatially or temporally.
• If several devices can use the link simultaneously, it is a
spatially shared connection. If users must take turns, it is
a timeshared connection.

Anurag College of Engineering 80


Physical Topology
• The term physical topology refers to the way in which a
network is laid out physically.
• Two or more devices connect to a link; two or more links
form a topology.
• The topology of a network is the geometric
representation of the relationship of all the links and
linking devices (usually called nodes) to one another.
• Network Topology is the schematic description of a
network arrangement, connecting various nodes(sender
and receiver) through lines of connection.

Anurag College of Engineering 81


Types of Topology

Anurag College of Engineering 82


Mesh Topology
• It is a point-to-point connection to other nodes or
devices.
All the network nodes are connected to each other.
• Mesh has n(n-1)/2 physical channels to link n devices.
• There are two techniques to transmit data over the Mesh
topology, they are :
1.Routing
2.Flooding
Anurag College of Engineering 83
1.Routing:
• In routing, the nodes have a routing logic, as per the
network requirements.
• Routing logic to direct the data to reach the
destination using the shortest distance.
• Routing logic which has information about the
broken links, and it avoids those node etc.
• We can even have routing logic, to re-configure the
failed nodes.

Anurag College of Engineering 84


2.Flooding:
• In flooding, the same data is transmitted to all the
network nodes, hence no routing logic is required.

• The network is robust, and it’s very unlikely to lose the


data.

• But it leads to unwanted load over the network.

Anurag College of Engineering 85


Types of Mesh Topology:
1. Partial Mesh Topology : In this topology some of the
systems are connected in the same fashion as mesh
topology but some devices are only connected to two or
three devices.
2. Full Mesh Topology : Each and every nodes or devices
are connected to each other.
Features of Mesh Topology:
1. Fully connected.
2. Robust.(is the ability of a computer system to cope with
errors during execution and cope with erroneous input)
3. Not flexible.

Anurag College of Engineering 86


Advantages of Mesh Topology:

1. Each connection can carry its own data load.


2. It is robust.
3. Fault is diagnosed easily.
4. Provides high security and privacy.
5. The connections made very fast
6. Data transfer rate is high
7. New nodes can be added easily

Anurag College of Engineering 87


Disadvantages of Mesh Topology:
1. Installation and configuration is difficult.
2. Cabling cost is more.
3. Bulk wiring is required.
4. High redundancy
Example of mesh topology
• Here are some of mesh topology examples:-
1. Zigbee
2. Google Home
3. Z-wave
4. Google Wi-Fi
5. Networks in military devices

88
Anurag College of Engineering
Star Topology
• In this type of topology all the computers are connected
to a single hub through a cable.

• This hub is the central node (is known as Server) and all
others nodes are connected to the central node .

89
Anurag College of Engineering
The central hub which connects nodes are
of four types:-

1. Hub or repeater
2. Switch or bridge
3. Router or gateway
4. Computer

Anurag College of Engineering 90


Advantages of Star Topology:
1. Fast performance with few nodes and low network traffic.

2. Hub can be upgraded easily.

3. Easy to troubleshoot.

4. Easy to setup and modify.

5. Only that node is affected which has failed, rest of the


nodes can work smoothly.

Anurag College of Engineering 91


Disadvantages of Star Topology:
1. Cost of installation is high.

2. Expensive to use.

3. If the hub fails then the whole network is stopped


because all the nodes depend on the hub.

4. Performance is based on the hub that is it depends on


its capacity.

Anurag College of Engineering 92


Example of star topology:

• Ethernet network is made by a star topology


(Ethernet is a way of connecting computers and
other network devices in a physical space. This is
often referred to as a local area network or LAN.)

Anurag College of Engineering 93


Bus Topology
Bus topology is a network type in which every computer
and network device is connected to single cable. When it
has exactly two endpoints, then it is called Linear Bus
topology.
Features of Bus Topology:
1. It transmits data only in one direction.
2. Every device is connected to a single cable

Anurag College of Engineering 94


Advantages of Bus Topology
1. It is cost effective.

2. Cable required is least compared to other network


topology.

3. Used in small networks.

4. It is easy to understand.

5. Easy to expand joining two cables together.

Anurag College of Engineering 95


Disadvantages of Bus Topology:
1. Cables fails then whole network fails.
2. If network traffic is heavy or nodes are more the
performance of the network decreases.
3. Cable has a limited length.
4. It is slower than the ring topology.

Anurag College of Engineering 96


Examples of a bus topology:
1. An example of bus topology is connecting two floors
through a single line.
2. Ethernet networks also use a bus topology
3. In a bus topology, one computer in the network works
as a server and other computers behave as clients.
The purpose of the server is to exchange data between
client computers.
4. Printers, scanners and other input/output devices can
be added in the office/home by using bus topology
network.

Anurag College of Engineering 97


Ring Topology
• In ring topology each device is connected with the two
devices on either side of it. There are two dedicated point
to point links a device has with the devices on the either
side of it. This structure forms a ring thus it is known as
ring topology.

Anurag College of Engineering 98


Features of Ring Topology:
1. A number of repeaters are used for Ring topology
with large number of nodes, because if someone wants to
send some data to the last node in the ring topology with
100 nodes, then the data will have to pass through 99 nodes
to reach the 100th node. Hence to prevent data loss
repeaters are used in the network.
2. The transmission is unidirectional, but it can be made
bidirectional by having 2 connections between each
Network Node, it is called Dual Ring Topology.
3. In Dual Ring Topology, two ring networks are formed, and
data flow is in opposite direction in them. Also, if one ring
fails, the second ring can act as a backup, to keep the
network up.
4. Data is transferred in a sequential manner that is bit by bit.
Data transmitted, has to pass through each node of the
network, till the destination node.
99
Anurag College of Engineering
Advantages of Ring Topology:
1. Transmitting network is not affected by high traffic or by
adding more nodes, as only the nodes having tokens can
transmit data.
2. Cheap to install and expand.

Disadvantages of Ring Topology:


1. Troubleshooting is difficult in ring topology.
2. Adding or deleting the computers disturbs the network
activity.
3. Failure of one computer disturbs the whole network.

100
Anurag College of Engineering
Hybrid Topology
• It is two different types of topologies which is a mixture
of two or more topologies.
• For example, if in an office in one department ring
topology is used and in another star topology is used,
connecting these topologies will result in Hybrid Topology
(ring topology and star topology).
Features of Hybrid Topology
1. It is a combination of two topologies
2. Inherits the advantages and disadvantages of the
topologies included
101
Anurag College of Engineering
Ring Topology Star Topology

Anurag College of Engineering 102


Advantages of Hybrid Topology:
1. Reliable as Error detecting and trouble shooting is easy.
2. Effective.
3. Scalable as size can be increased easily.
4. Flexible.

Disadvantages of Hybrid Topology:


1. Complex in design.
2. Costly.

Anurag College of Engineering 103


Network Devices
Repeater :
• A repeater operates at the physical layer.
• Its job is to regenerate the signal over the same network
before the signal becomes too weak or corrupted so as to
extend the length to which the signal can be transmitted
over the same network. An important point to be noted
about repeaters is that they do not amplify the signal.
• When the signal becomes weak, they copy the signal bit
by bit and regenerate it at the original strength.

Anurag College of Engineering 104


Network Devices
Hub :
• A hub is basically a multiport repeater.
• A hub connects multiple wires coming from different
branches.
• For example, the connector in star topology which
connects different stations
• Hubs cannot filter data, so data packets are sent to all
connected devices.
• Also, they do not have intelligence to find out best path
for data packets which leads to inefficiencies and
wastage.

Anurag College of Engineering 105


Types of Hub:

• Active Hub:- These are the hubs which have their own
power supply and can clean, boost and relay the signal
along with the network. It serves both as a repeater as
well as wiring center. These are used to extend the
maximum distance between nodes.
• Passive Hub :- These are the hubs which collect wiring
from nodes and power supply from active hub. These
hubs relay signals onto the network without cleaning
and boosting them and can’t be used to extend the
distance between nodes.

Anurag College of Engineering 106


Network Devices
Bridge :

• A bridge operates at data link layer.


• A bridge is a repeater, with add on the functionality of
filtering content by reading the MAC addresses of
source and destination.
• It is also used for interconnecting two LANs working
on the same protocol.
• It has a single input and single output port, thus
making it a 2 port device.

Anurag College of Engineering 107


Types of Bridges:
1.Transparent Bridges:-
• These are the bridge in which the stations are
completely unaware of the
bridge’s existence i.e. whether or not a bridge is added
or deleted from the network, reconfiguration of the
stations is unnecessary.
• These bridges make use of two processes i.e. bridge
forwarding and bridge learning.
2.Source Routing Bridges:-
• In these bridges, routing operation is performed by
source station and the frame specifies which route to
follow.
• The host can discover frame by sending a special frame
called discovery frame, which spreads through the entire
network using all possible paths to destination.
Anurag College of Engineering 108
Network Devices
Switch :
• A switch is a multiport bridge with a buffer and a
design that can boost its efficiency(a large number of
ports imply less traffic) and performance.
• A switch is a data link layer device.
• The switch can perform error checking before
forwarding data, that makes it very efficient as it does
not forward packets that have errors and forward good
packets selectively to correct port only.
• In other words, switch divides collision domain of
hosts, but broadcast domain remains same.

Anurag College of Engineering 109


Network Devices
Routers :
• A router is a device like a switch that routes data packets
based on their IP addresses.
• Router is mainly a Network Layer device.
• Routers normally connect LANs and WANs together
and have a dynamically updating routing table based on
which they make decisions on routing the data packets.
• Router divide broadcast domains of hosts connected
through it.

Anurag College of Engineering 110


Network Devices
Gateway :
• A gateway, as the name suggests, is a passage to
connect two networks together that may work upon
different networking models.
• They basically work as the messenger agents that take
data from one system, interpret it, and transfer it to
another system.
• Gateways are also called protocol converters and can
operate at any network layer.
• Gateways are generally more complex than switch or
router.
Anurag College of Engineering 111
Network Devices
Brouter :

• It is also known as bridging router


• Brouter is a device which combines features of both
bridge and router.
• It can work either at data link layer or at network layer.
• Working as router, it is capable of routing packets
across networks and working as bridge, it is capable of
filtering local area network traffic.

Anurag College of Engineering 112


Network Devices

Anurag College of Engineering 113


Network Models
Network:
• A network is a set of devices (often referred to as nodes)
connected by communication links.
• The Network allows computers to connect and
communicate with different computers via any medium.
• LAN, MAN and WAN are the three major types of the
network designed to operate over the area they cover.
• One of the major differences is the geographical area
they cover, i.e. LAN covers the smallest
area; MAN covers an area larger than LAN
and WAN comprises the largest of all.

114
Anurag College of Engineering,
LAN- Local Area Network
• LAN or Local Area Network connects network devices
in such a way that personal computer and workstations
can share data, tools and programs.
• The group of computers and devices are connected
together by a switch, or stack of switches, using a
private addressing scheme as defined by the TCP/IP
protocol.
• Private addresses are unique in relation to other
computers on the local network. Routers are found at the
boundary of a LAN, connecting them to the larger
WAN.

Anurag College of Engineering 115


LAN- Local Area Network
• Data transmits at a very fast rate as the number of
computers linked are limited.
• By definition, the connections must be high speed and
relatively inexpensive hardware (Such as hubs, network
adapters and Ethernet cables).
• LANs cover smaller geographical area (Size is limited to
a few kilometers) and are privately owned.
• Eg: One can use it for an office building, home, hospital,
schools, etc. LAN is easy to design and maintain.
• A Communication medium used for LAN has twisted pair
cables and coaxial cables.
• It covers a short distance, and so the error and noise are116
minimized. Anurag College of Engineering
LAN- Local Area Network
• Early LAN’s had data rates in the 4 to 16 Mbps range.
• Today, speeds are normally 100 or 1000 Mbps.
• Propagation delay is very short in a LAN.
• The smallest LAN may only use two computers, while
larger LANs can accommodate thousands of computers.
• A LAN typically relies mostly on wired connections for
increased speed and security, but wireless connections
can also be part of a LAN.
• The fault tolerance of a LAN is more and there is less
congestion in this network.
• For example : A bunch of students playing Counter
Strike in the same room (without internet). 117
Anurag College of Engineering
LAN- Local Area Network
• An isolated LAN connecting 12 computers to a hub in
a closet

Anurag College of Engineering 118


MAN -Metropolitan Area Network
• MAN or Metropolitan area Network covers a larger area
than that of a LAN and smaller area as compared to
WAN.
• It connects two or more computers that are apart but
resides in the same or different cities.
• It covers a large geographical area and may serve as an
ISP (Internet Service Provider).
• MAN is designed for customers who need a high-speed
connectivity.
• Speeds of MAN ranges in terms of Mbps.
• It’s hard to design and maintain a Metropolitan Area
Network. 119
Anurag College of Engineering
MAN- Metropolitan Area Network
• The fault tolerance of a MAN is less and also there is
more congestion in the network.
• It is costly and may or may not be owned by a single
organization.
• The data transfer rate and the propagation delay of MAN
is moderate.
• Devices used for transmission of data through MAN are:
Modem and Wire/Cable.
• Examples of a MAN are the part of the telephone
company network that can provide a high-speed DSL line
to the customer or the cable TV network in a city.
120
Anurag College of Engineering
WAN-Wide Area Network
• WAN or Wide Area Network is a computer network that
extends over a large geographical area, although it might
be confined within the bounds of a state or country.
• A WAN could be a connection of LAN connecting to
other LAN’s via telephone lines and radio waves and
may be limited to an enterprise (a corporation or an
organization) or accessible to the public.
• The technology is high speed and relatively expensive.

121
Anurag College of Engineering
WAN-Wide Area Network
• Types of WAN:
1. Switched WAN
2. Point-to-Point WAN.
• WAN is difficult to design and maintain. Similar to a
MAN, the fault tolerance of a WAN is less and there is
more congestion in the network.
• A Communication medium used for WAN is PSTN
(Public Switched Telephone Network) or Satellite Link.
• Due to long distance transmission, the noise and error
tend to be more in WAN.

122
Anurag College of Engineering
Point- to- Point WAN
 CSU- Channel Service Unit

Anurag College of Engineering 123


WAN’s: Switched WAN and Point-to-Point WAN

124
Anurag College of Engineering
WAN-Wide Area Network
• WAN’s data rate is slow about a 10th LAN’s speed, since
it involves increased distance and increased number of
servers and terminals etc.
• Speeds of WAN ranges from few kilobits per second
(Kbps) to megabits per second (Mbps).
• Propagation delay is one of the biggest problems faced
here.
• Devices used for transmission of data through WAN are:
Optic wires, Microwaves and Satellites.
• Example of a Switched WAN is the asynchronous transfer
mode (ATM) network and Point-to-Point WAN is dial-up
line that connects a home computer to the Internet. 125
Anurag College of Engineering
Interconnection of Networks:
Internetwork
• If two or more networks are connected, they become an
internetwork, or internet.

As an example, assume that an organization has two


offices, one on the east coast and the other on the west
coast. The established office on the west coast has a bus
topology LAN; the newly opened office on the east coast
has a star topology LAN. The president of the company
lives somewhere in the middle and needs to have control
over the company from home.

Anurag College of Engineering 126


The Heterogenous Network Made of 4 WANs and 2 LANs

Anurag College of Engineering, Aushapur 127


Communication Protocols

• Communication Protocols form the back-bone of IoT


systems and enable network connectivity and
coupling to applications.
• Allow devices to exchange data over network.
• Define the exchange formats, data encoding
addressing schemes for device and routing of packets
from source to destination.
• It includes sequence control, flow control and
retransmission of lost packets
Communication Protocols:

Anurag College of Engineering 129


Link Layer
• Link Layer protocols determine how the data is
physically sent over the network’s physical layer or
medium.
Eg. Copper wire , coaxial cable, radio wave
• The scope of the link layer is the local network
connection to which the host is attached.
• Hosts on the same link exchange data packets over the link
layer using link layer protocols.
• Link layer determines how the packets are coded and
signaled by the hardware device over the medium to which
the host is attached.
• Link layer protocols are: 802.3-Ethernet, 802.11-Wi-Fi,
802.16-WiMax, 802.15.4-LR-WPAN, 2G/3G/4G-Mobile
130
Communication. Anurag College of Engineering
802.3- Ethernet
• IEEE 802.3 is a collection of wired Ethernet
standards for the link layer.
• 802.3 is the standard for 10 BASE 5 Ethernet that
uses coaxial cable as a shared medium.
• 802.3i is the standard for 10 BASE-T Ethernet over
copper twisted pair connections.
• 802.3 j is the standard for 10 BASE-F Ethernet over
fiber optic connections.
• 802.3ae is the standard for 10Gbit/s Ethernet over
fiber.
• These standards provide data rates from 10Mb/s to
40 Gb/s and higher.
131
Anurag College of Engineering
802.3- Ethernet cont’d

• The shared medium in Ethernet can be a coaxial


cable, twisted-pair wire or an optical cable.
• The shared medium carries the communication for
all the devices on the network, thus data sent by
one device can be received by all the devices
subject to propagation conditions and transceiver
capabilities.

Anurag College of Engineering 132


802.11- Wi-Fi
• IEEE 802.11 is a collection of wireless local area
network (WLAN) communication standards
including extensive description for the of the link
layer .
• 802.11a operates in the 5GHz band.
• 802.11b and 802.11g operate in the 2.4GHz band.
• 802.11n operates in the 2.4/5 GHz band.
• 802.11ac operates in the 5GHz band.
• 802.11ad operates in the 60GHz band.
• These standards provide data rates from 1Mb/s up to
6.75Gb/s
Anurag College of Engineering 133
802.16- WiMax

• IEEE 802.16 is a collection of wireless broadband


standards, including extensive descriptions for the
link layer.
• Also called WiMax.
• WiMax standards provide data rates from 1.5Mb/s to
1Gb/s.
• 802.16m provides data rates of 100 Mb/s for mobile
stations and 1Gb/s for fixed stations.

134
Anurag College of Engineering
802.15.4 – LR-WPAN

• IEEE 802.15.4 is a collection of standards for low-


rate wireless personal area networks (LR-WPANs).
• These standards form the basis of specifications for
high level communication protocols such as ZigBee.
• LR-WPAN standards provide data rates from 40 Kb/s
to 250 Kb/s.
• These standards provide low cost and low speed
communication for power constrained devices.

135
Anurag College of Engineering
2G/3G/4G- Mobile Communication
• There are different generations of mobile
communication standards.
✓ Second generation (2G- including GSM and
CDMA)
✓ Third generation (3G- including UMTS and
CDMA 2000)
✓ Fourth generation (4G- including LTE).
• IoT devices based on these standards can
communicate over cellular networks.
• Data rates for these standards range from 9.6 Kb/s
(for 2G) to up to 100 Mb/s (for 4G).
Anurag College of Engineering 136
Network/ Internet Layer
• The network layers are responsible for sending of
IP datagrams from the source network to the destination
network.
• This layer performs the host addressing and packet
routing.
• Datagrams contains source and destination addresses
which are used to route them from the source to
destination across multiple networks.
• Host identification is done using IP addressing schemes
such as IPv4 or IPv6.
• IP protocols establish connections on packet networks but
do not guarantee delivery of packets
• The protocols of this layer are IPv4, IPv6, 6LoWPAN. 137
Anurag College of Engineering
IPv4- Internet Protocol version 4:
• Internet Protocol version4 is used to identify the devices
on a network using a hierarchical addressing scheme.
• It uses a 32-bit address scheme and allows total of 232
addresses.

IPv6- Internet Protocol version 6:


• Internet Protocol version6 is the newest version of
Internet Protocol.
• It uses 128 bit address scheme and allows total of 2128
addresses.
138
Anurag College of Engineering
6LoWPAN:
• 6LoWPAN (IPv6 over Low Power Wireless Personal
Area Network) brings IP protocol to the low-power
devices which have limited processing capability.
• Operates in 2.4 GHz frequency range and data transfer
rates of 250 kb/s.
• 6LoWPAN works with the 802.15.4 link layer protocol
and defines compression mechanisms for IPv6
datagrams over IEEE 802.15.4 based networks.

Anurag College of Engineering 139


Transport Layer

• Transport layer protocols provides end-to-end message


transfer capability independent of the underlying
network.
• The message transfer capability can be set up on
connections with acknowledgements as in TCP and
without acknowledgements as in UDP.
• It provides functions such as error control, segmentation,
flow control and congestion control.
• The transport layer protocols are TCP and UDP.

Anurag College of Engineering 140


Transmission Control Protocol (TCP) :

• Transmission Control Protocol is the widely used


transport layer protocol.
• It is used by web browsers (along with HTTP and HTTPS),
email programs (along with SMTP) and File Transfer (FTP).
• It is a connection oriented and stateful protocol.
• IP Protocol deals with sending packets, TCP ensures reliable
transmission of protocols in order.
• TCP provides error detection capability so that duplicate
packets can be discarded and lost packets can be 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.
141
Anurag College of Engineering
User Datagram Protocol (UDP) :

• User Datagram Protocol is a connectionless


protocol.
• It is useful for time sensitive applications, very small data
units to exchange.
• It is a transaction oriented and stateless protocol.
• It does not provide guaranteed delivery, ordering of
messages and duplicate elimination.
• Higher level of protocols can ensure ensure reliable
delivery or ensure connections created are reliable.

142
Anurag College of Engineering
Application Layer
• Application layer protocols define how the
applications interface with lower layer protocols to send
data over the network.
• The application data in files is encoded by the application
layer protocol and encapsulated in the transport layer
Protocol which provides connection or transaction
oriented communication over the network.
• The protocols in this layer enable process-to-process
connections using ports.
• Port numbers are used for application addressing.
Eg. Port 80 for HTTP.
• The protocols of this layer are HTTP, CoAP, WebSocket,
MQTT, XMPP, DSS, AnuragAMQP.
College of Engineering
143
Hypertext Transfer Protocol (HTTP):

• Hyper Text Transfer Protocol forms foundation of World


Wide Web (WWW).
• It has commands such as GET, PUT, POST, DELETE,
HEAD, TRACE, etc.
• It follows a request-response model where a client sends
requests to a server using the HTTP commands.
• It is a Stateless protocol and each HTTP request is
independent of other requests.
• HTTP client can be a browser or an application running
on the client.
• This protocol uses Universal Resource Identifiers (URIs)
to identify HTTP resources.
144
Anurag College of Engineering
Constrained Application Protocol (CoAP):

• Constrained Application Protocol is for machine-to-


machine (M2M) applications for constrained devices,
constrained environment and constrained networks.
• CoAP is a web transfer protocol and uses a request-
response model.
• It uses client-server architecture where clients
communicate with serves using connectionless datagrams.
• CoAP is designed to easily interface with HTTP.
• It supports methods such as GET, PUT, POST and
DELETE.

145
Anurag College of Engineering
WebSocket:

• WebSocket protocol allows full duplex communication


over a single socket connection for sending messages
between client and server.
• WebSocket is based on TCP and allows streams of
messages to be sent back and forth between the client and
server while keeping the TCP connection open.
• The client can be a browser, a mobile application or an
IoT device.

146
Anurag College of Engineering
Message Queue Telemetry Transport (MQTT):

• Message Queue Telemetry Transport is light-weight


messaging protocol based on publish-subscribe model.
• It uses a client- server architecture. The client (IoT
device) connects to the server ( also called MQTT Broker)
and publishes messages to topics on the server.
• The broker forwards the messages to the clients
subscribed to topics.
• It is well suited for constrained environment where the
devices have limited processing and memory resources
and the network bandwidth is low.

147
Anurag College of Engineering
Extensible Messaging and Presence Protocol
(XMPP) :
• Extensible Message and Presence Protocol for real time
communication and streaming XML data between
network entities.
• XMPP powers wide range of applications including
messaging, presence, data syndication, gaming, multi-
party chat, voice/video calls.
• It allows sending small chunks of XML data from one
network entity to another in near real-time.
• It is a decentralized protocol and uses client-server
architecture.
• It supports both client-to-server and server-to-server
communication paths.
• In IoT, XMPP allows real-time communication between
IoT devices.
148
Anurag College of Engineering
Data Distribution Service (DSS):

• Data Distribution Service is data centric middleware


standard for device-to-device or machine-to-machine
communication.
• It uses publish-subscribe model where publishers create
topics to which subscribers can subscribe.
• Publisher is an object responsible for data distribution and
the subscriber is responsible for receiving published data.
• DSS provides Quality-of-Service (QoS) control and
configurable reliability.

149
Anurag College of Engineering
Advanced Message Queuing Protocol(AMQP):
• Advanced Message Queuing Protocol is an open
application layer protocol for business messaging.
• It supports both point-to-point and publish-subscribe
models.
• AMQP brokers receive messages from publishers
(devices or applications that generate data) and route them
over connections to consumers (applications that process
data).
• Publishers publish the messages to exchanges which then
distribute message copies to queues.
• Messages are either delivered by the broker to the
consumers which have subscribed to the queues or the
consumers can pull the messages from the queues.
150
Anurag College of Engineering
Sensor Networks
• A sensor network connects numerous sensor nodes that
can detect information such as heat, pressure, and
motion.
• With the rapid development of sensors, sensor networks
are a vital part of the internet of things (IoT) and the
modern world.
• We can build a simple sensor network from easily
procured, low-cost hardware.
• We need some sensors and a microcontroller or computer
with input/output capabilities.
• Sensor networks play a prominent part in the IOT.
Anurag College of Engineering 151
Sensor Networks
• Sensor networks are everywhere (sensors are in
our phones, workplaces, vehicles, and the environment).
• A sensor network comprises a group of small, powered
devices, and a wireless or wired networked infrastructure.
• They record conditions in any number of environments
including industrial facilities, farms, and hospitals.
• The sensor network connects to the internet or computer
networks to transfer data for analysis and use.
• Sensor network nodes cooperatively sense and control the
environment.
• They enable interaction between persons or computers
and the surrounding environment.
Anurag College of Engineering 152
Examples of Sensor Networks

• Automotive
• Environmental monitoring
• Atmospheric monitoring
• Security system
• Surveillance system

153
Anurag College of Engineering
Automotive:
• Almost every modern automobile has a network of
sophisticated sensors that monitor the performance of
the engine and its subsystems.
• Some cars have additional sensors for monitoring
external air temperature, tyre pressure, and even
proximity to objects and other vehicles.
• Sensors in automobiles has begun to spill over into
related machinery such as motorcycles, boats, and
even the venerable farm tractor.

Anurag College of Engineering 154


Environmental monitoring :
• Motives for monitoring the environment range from
checking a specific area or room for gases and tracking
the area’s temperature and humidity; to monitoring and
reporting anomalies for sensitive equipment, such as
running chemical analyses for clean rooms.
• Examples of environment sensor networks include those
used to monitor air pollution, detect and track forest
fires, detect landslides, provide earthquake early
warnings, and provide industrial and structural
monitoring.
• Sensors for monitoring water purity, oxygen level, and
contaminants may be used in fish farms to maximize
crop yield.
Anurag College of Engineering 155
Atmospheric monitoring :

• There are specialized sensors to measure all forms


of air quality including free gases, particle
contamination, smoke, humidity, and so on.
• Other motivations for building atmospheric sensor
networks include measuring pollution from factories and
automobiles, ensuring clean drinking water from water
treatment plants, etc.

Anurag College of Engineering 156


Security system:

• A basic security system is designed to record and alert


whenever a door or window is opened.
• The sensors in such a network are switches (the simplest
of all sensors) that detect when a door or window is
opened or closed.
• A central processor or microcontroller can be used to
monitor the sensors and take action: for example,
generating a signal with a buzzer or bell

Anurag College of Engineering 157


Surveillance system:
• A surveillance system includes more than just a
set of switches. Typically, such a system includes video
sensors (cameras) and even audio sensors (microphones).
• The system may also include some form of monitor that
records the data and enables users to view that data (see
when doors were opened, listen to audio, and view
video).
• Most home surveillance systems include a digital video
recorder (DVR) and one or more cameras.
• Surveillance systems used in businesses are similar to
home surveillance systems but typically include
additional sensors and data tracking such as employee
badging, equipment monitoring, and integration, along
with offsite support services such as night watchmen and
data archiving.
158
Anurag College of Engineering
Components of a sensor network:
• A garden pond monitoring system. Specifically, the
system monitors the health of a fishpond. Thus, the
system is an environmental sensor network.

Fig. Typical fishpond monitoring system


159
Anurag College of Engineering
• The motivation is to ensure a safe environment for the
fish. This means the water temperature should be
within tolerance for the species of fish, the water depth
should be maintained to avoid over- or under-filling, and
the oxygen level of the water should be monitored to
ensure that there is sufficient oxygen for the fish to
survive.
• In the fig. shown in this system, there are three sensors, a
monitoring control or recording system, and a
communication medium—a way for the sensors to send
their data to the monitor.

160
Anurag College of Engineering
• Most sensors are discrete components that take
voltage in and produce either digital or analog data.
They require another component to read the data and send it to
the pond-monitoring control system.
• The microcontroller or microprocessor for reading data from
one or more sensors and sending it to another system for
processing.
• The Arduino is an excellent platform for reading data from
one or more sensors and sending it to another system for
processing. Some enterprising Arduino enthusiasts have built
monitoring systems using only a single Arduino and multiple
sensors.
• Eg. The pond-monitoring system is a computer with an
Arduino attached to it so that we can record, view, or access
the data remotely. We now have the sensors connected to an
Arduino (called a sensor node) and the pond-monitoring
system connected to another Arduino (called the aggregator
node).
161
Anurag College of Engineering
• How to get the data from the sensor node to the
aggregate node. There are many ways to get two
Arduino to communicate or share data,- wired or
wireless.
• Wired communication in this case can be via an
Ethernet shield or a wireless fidelity (Wi-Fi) shield
fitted to each Arduino.

Anurag College of Engineering 162


Communication Media
• How sensors communicate their data to the other nodes
in the network.
• Two basic forms of network communication:
(i) wired and
(ii) wireless.

163
Anurag College of Engineering
Wired Networks :
• Wired networks can take several forms.
• All involve some form of hardware designed to permit
electrical signals to be sent from one device to another
via a wire or cable.
• Thus, sensor networks that employ wired communication
must also add network hardware to the nodes in the
network.
• We can use Arduino with an Ethernet shield to connect
the sensor node(s) to the aggregate or data-collection
nodes.
• If our sensors were hosted with Raspberry Pi computers,
we already have the necessary hardware to connect two
Raspberry Pi computers—they all have RJ-45 LAN
ports.
Anurag College of Engineering 164
Wireless Networks :

• A more popular and more versatile medium is wireless


communication.
• We use a wireless device such as a Wi-Fi shield for each
Arduino or Wi-Fi adapters for Raspberry Pi computers. Like
wired Ethernet, wireless Ethernet (Wi-Fi) requires the addition
of a wireless router. However, Wi-Fi has a much shorter
maximum distance, so it may not be suitable for some networks.
• We can use XBee wireless modules instead of Ethernet (Wi-Fi).
XBee provides a specialized, lightweight protocol that is ideal
for use in sensor nodes and small microcontrollers and
embedded systems.
• One of the features of XBee modules is that they are low power
and can be placed into a periodic sleep mode to conserve power.
• The best feature is that XBee modules can be connected directly
to sensors, allowing to build even lighter weight (and cheaper)
sensor nodes.
Anurag College of Engineering 165
Hybrid Networks :
• Some sophisticated sensor networks require
the mixing of both communication media.
For example, an industrial sensor network may
collect data using sensor nodes installed in many
different buildings or rooms. We may want to isolate the
sensor networks into subsystems because each area may
require a different form of sensor network. In this case, it
may be better to use wireless for certain segments in
which the use of wired networks is difficult (for
example, a sensor on a moving industrial robot) and
wired Ethernet to link the subsystems to a central data-
recording or -monitoring system.
Anurag College of Engineering 166
Sensor Nodes
• Sensor nodes are composed of one or more sensors and a
communication device to transmit the data.
• The communication device can be a microcontroller like
an Arduino, an embedded system, or even a small-
footprint computer like a Raspberry Pi.
• Typically, sensor nodes are designed for unattended
operation; they’re sometimes installed on mobile objects
or in locations where wired communication is
impractical.
• In these situations, sensor nodes can be designed to
operate without being tethered to a power or
communication source.
167
Anurag College of Engineering
Types of Sensor Nodes
• Sensor nodes can be classified into different types based
on how they are used.

Types of Sensor Nodes:

➢ Basic Sensor Nodes


➢ Data Nodes
➢ Aggregator Nodes

168
Anurag College of Engineering
Basic Sensor Nodes:

• At the lowest (or leaf) level of the sensor network


is a basic sensor node.
• This is the type of node which has a single sensor and
a communication mechanism.
• These nodes don’t store or manipulate the captured
data in any way.
• They simply pass the data to another node in the
network.

Anurag College of Engineering 169


Data nodes:

• Data nodes are sensor nodes that store data.


• These nodes may send the data to another node, but
typically they are devices that send the data to a storage
mechanism such as a data card; to a database via a
computer; or directly to a visual output device like an
LCD screen, panel meter, or LED indicators.
• Data nodes require a device that can do a bit more than
simply pass the data to another node. They need to be
able to record or present the data.
• Data nodes can be used to form autonomous or
unattended sensor networks that record data for later
archiving.
Anurag College of Engineering 170
Aggregator Nodes:

• These nodes typically employ a communication device


and a recording device (or gateway) and no sensors.
• They are used to collect data from one or more data or
sensor nodes.

Anurag College of Engineering 171


Fig. Types of nodes in a sensor network

Anurag College of Engineering 172


• Several sensor nodes at the top send data
wirelessly to a data node in the middle.
• The data node collects the data and saves it to a secure
digital card, which then sends the data to an aggregator
node that communicates with a database server via a
wired computer network to store the data.
• Mixing data nodes with aggregator nodes ensures that
data is not lost if aggregator node fails or the recording
and monitoring system fails or goes offline.

Anurag College of Engineering 173


Wireless Sensor Networks
• A Wireless Sensor Network (WSN) comprises of
distributed devices with sensors which are used to
monitor the environmental and physical conditions.
• A WSN consist of a number of end-nodes and routers
and a coordinator.
• End nodes have several sensors attached to them. End
nodes can also act as routers.
• Routers are responsible for routing the data packets from
end-nodes to the coordinator.
• The coordinator collects the data from all the nodes.
• Coordinator also acts as a gateway that connects the
WSN to the internet.

Anurag College of Engineering 174


Wireless Sensor Networks
Examples of WSNs used in IoT systems:
• Weather monitoring systems use WSNs in which the nodes collect
temperature, humidity and other data, which is aggregated and
analyzed.
• Indoor air quality monitoring systems use WSNs to collect data on
the indoor air quality and concentration of various gases.
• Soil moisture monitoring systems use WSNs to monitor soil
moisture at various locations.
• Structural health monitoring system use WSNs to monitor the
health of structures (buildings, bridges) by collecting vibration
data from sensor nodes deployed at various points in the structure.
• Surveillance systems use WSNs for collecting surveillance data
(such as motion detection data).
• Smart grids use WSNs for monitoring the grid at various points.
Anurag College of Engineering 175
Wireless Sensor Networks
• WSNs are enabled by wireless communication protocols
such as IEEE 802.15.4.
• ZigBee is one of the most popular wireless technologies used by WSNs.
• ZigBee specifications are based on IEEE 802.15.4.
• ZigBee operates at 2.4 GHz frequency and offer data rates upto 250 KB/s
and range from 10 to 100 meters depending on the power output and
environmental conditions.
• The power of WSNs lies in their ability to deploy large number of low-cost
and low-power sensing nodes for continuous monitoring of environmental
and physical conditions.
• WSNs are self-organizing networks.
• Since WSNs have large number of nodes, manual configuration for each
node is not possible.
• The self-organizing capability of WSN makes the network robust.
• In the event of failure of some nodes or addition of new nodes to network,
the network can reconfigure itself. 176
Anurag College of Engineering
Anurag College of Engineering 177
Anurag College of Engineering 178

You might also like