Professional Documents
Culture Documents
FIoT Unit 04
FIoT Unit 04
2 / 65
Where are we ?
3 / 65
IoT: Remote Data Logging
5 / 65
DHT Sensor:
• Digital Humidity and Temperature Sen-
sor (DHT)
• PIN1,2,3,4(from left to right)
◦ PIN1-3.3V-5VPower supply
◦ PIN2-Data
◦ PIN3-Null
◦ PIN4-Ground
6 / 65
Sensor interface with Raspberry Pi: • Use the function
• Connect pin 1 of DHT sensor to the 3.3V Adafruit_DHT.read_retry() to read
pin of Raspberry Pi data from the sensor
• Connect pin 2 of DHT sensor to any in-
put pins of Raspberry Pi, here we have
used pin 11
• Connect pin 4 of DHT sensor to the
ground pin of the Raspberry Pi
Read Data from the Sensor
• Adafruit provides a library to work with
the DHT22 sensor
• Install the library in Raspberry Pi
7 / 65
1 import RPi.GPIO as GPIO
2 from time import sleep
3 import Adafruit_DHT
4
5 GPIO.setmode(GPIO.BOARD)
6
7 sensor = Adafruit_DHT.AM2302
8 print("Getting data from the sensor")
9
8 / 65
Where are we ?
9 / 65
Sending Data to a Server
10 / 65
Client Code: Obtain readings from the sensor and send the data to the server
1 import Adafruit_DHT, time, socket
2 def sensordata():
3 GPIO.setmode(GPIO.BOARD)
4 sensor = Adafruit_DHT.AM2302
5 return Adafruit_DHT.read_retry(sensor,17)
6
3 plt.ion()
4 plt.style.use("seaborn-v0_8-poster")
5 fig, (ax1, ax2) = plt.subplots(2,1)
6
12 / 65
1 import socket
2 s_addr = ('127.0.0.1', 10001)
3 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
4 s.bind(s_addr)
5
6 try:
7 cnt = 0
8 while True:
9 data, c_addr = s.recvfrom(4096)
0 with open("DataLog.txt", "a") as f:
1 msg = data.decode('utf-8')
2 print("From:",c_addr, " Received: ", msg)
3 coverage_plot(msg, cnt)
4 f.write(msg+'\n')
5 cnt +=1
6 finally:
7 s.close() 13 / 65
Where are we ?
14 / 65
Data Processing
Data from the client needs to be processed before it can be used further
15 / 65
Plotting the data: • close(): Close the current figure window
• scatter(): make a scatter plot of the
1 import matplotlib.pyplot as plt given points
2 plt.plot([1,2,3,4])
3 plt.ylabel('Y-Axis')
4 plt.show()
17 / 65
Client Output:
18 / 65
Server Output:
19 / 65
20 / 65
21 / 65
Where are we ?
22 / 65
Conventional Network Architecture
• The figure below shows the conventional network architecture built with specialised
hardware i.e., switches, routers etc
23 / 65
• Network devices in conventional network ar- that carries the payload data traffic
chitectures are getting exceedingly com-
plex with the
◦ with the increasing number of dis-
tributed protocols being implemented
and
◦ with the use of proprietary hardware
and interfaces
• In the conventional network architecture,
the control plane and data plane are cou-
pled
• Control plane is the part of the network
that carries the signalling and routing mes-
sage traffic
• The data plane is the part of the network
24 / 65
Limitations of Conventional networks
The limitations of conventional networks are as follows:
26 / 65
Where are we ?
27 / 65
28 / 65
Origin of SDN
29 / 65
SDN Network Architecture
SDN attempts to create network architectures that are simple, in-expensive, scalable,
agile and easy to manage
30 / 65
• In the SDN architecture • Network devices received instructions
◦ The SDN layers i.e., the control and from the SDN controller on how to for-
data planes are decoupled and ward the packets
◦ the network controller is centralised • These devices can be simpler and cost less
• Software-based SDN controllers maintain as they can be built from standard hardware
a unified view of the network and make and software components
configurations, management and provision-
ing simpler
• The underlying infrastructure in SDN uses
simple packet forwarding hardware as
opposed to specialise hardware in conven-
tional networks
• The underlying network infrastructure is ab-
stracted from the applications
• Network devices become simple with
SDN as they do not require implementa-
tion of a large number of protocols
31 / 65
Where are we ?
32 / 65
Key Elements of SDN
Key elements of SDN are as follows: grammable open APIs for interface
I. Centralized Network Controller: between the SDN application and
• With decoupled control / data planes control layers (Northbound inter-
and centralised network controller, the face)
network administrators can rapidly • With these open APIs, various net-
configure the network work services can be implemented,
• SDN applications can be deployed such as routing, quality of service
through programmable open APIs (QoS), access control etc
• This speeds up innovation as the
network administrators no longer need
to wait for the device vendors to em-
bed new features in their proprietary
hardware
II. Programmable Open APIs:
• SDN architecture supports pro-
33 / 65
III. Standard Communication Interface • OpenFlow protocol is implemented
(OpenFlow): on both sides of the interface between
• SDN architecture uses a standard the controller and the network devices
communication interface between ◦ The controler can add, update,
the control and infrastructure layers and delete flow entries in the flow
(Southbound interface) tables
• OpenFlow, which is defined by • Each flow table contains a set of flow
the Open Networking Foundation entries
(ONF) is the broadly accepted SDN ◦ Each flow entry consist of match
protocol for the southbound inter- fields, counters, and set of instruc-
face tions to apply to matching packets
• With OpenFlow, the forwarding
plane of the network devices can be
directly accessed and manipulated
• Flows (match rules) can be pro-
grammed, statically or dynamically by
the SDN control software
34 / 65
Where are we ?
35 / 65
Network Function Virtualization (NFV)
36 / 65
Key elements of the NFV architecture are and storage resources that are virtu-
as follows alised
I. Virtualized Network Function III. NFV Mangament and Orchestration:
(VNF): • NFV management and orchestration
• VNF is a software implementation focuses on all the virtualisation spe-
of a Network function which is capa- cific management tasks and covers
ble of running over the NFV infras- the life-cycle management of phys-
tructure (NFVI) ical and software resources that sup-
II. NFV Infrastructure (NFVI): port the infrastructure virtualisation
• NFVI includes compute, network
37 / 65
Example: Virtualized Home Gateway
39 / 65
Where are we ?
40 / 65
41 / 65
Benefits of Integrating SDN in IoT
42 / 65
I. Constrained Node Networks → Control of end-devices, such as sensors and actuators
II. Intelligent Aggregation → Rule - placement at access devices, while considering
mobility and heterogeneity of end-users
III. Transport Network → Rule - placement and traffic engineering at backbone networks
IV. IoT Cloud → Flow classification and enhanced security at data center networks
43 / 65
Where are we ?
44 / 65
Introduction
• Data handling
◦ Ensures that research data is stored, archived or disposed off in a safe and
secure manner during and after the conclusion of a research project
◦ Includes the development of policies and procedures to manage data
handling electronically as well as through non-electronic means.
• Big Data
◦ Due to heavy traffic generated by IoT devices
◦ Huge amount of data generated by the deployed sensors
45 / 65
Big Data
46 / 65
Types of Data
I. Structured data
◦ Data that can be easily organized.
◦ Usually stored in relational databases.
◦ Structured Query Language (SQL) manages structured data in databases.
◦ It accounts for only 20% of the total available data today in the world.
II. Unstructured data
◦ Information that do not possess any pre-defined model.
◦ Traditional RDBMSs are unable to process unstructured data.
◦ Enhances the ability to provide better insight to huge datasets.
◦ It accounts for 80% of the total data available today in the world.
47 / 65
Characteristics of Big Data
I. Volume: Quantity of data that is gen- III. Variety: Refers to the category to
erated which the data belongs
• Sources of data are added continu- • No restriction over the input data
ously formats
• Example of volume: 500 Hours of • Data mostly unstructured or semi-
video content is uploaded to YouTube structured
every minute • Example of variety : Pure text, im-
II. Velocity: Refers to the speed of gen- ages, audio, video, sensor data, etc.
eration of data IV. Variability: Refers to data whose
• Data processing time decreasing meaning is constantly changing.
day-by-day in order to provide real- • Meaning of the data depends on the
time services context.
• Older batch processing technology • Data appear as an indecipherable
is unable to handle high velocity of mass without structure
data • Example: Language processing, Hash-
• Example of velocity : 140 million tags, Geo-spatial data, Multimedia,
tweets per day on average Sensor event 48 / 65
V. Veracity: Veracity refers to the biases, lytics presented visually
noise and abnormality in data. • Identify new patterns
• It is important in programs that in- VII. Value: It means extracting useful
volve automated decision-making, business information from scattered
or feeding the data into an unsuper- data.
vised machine learning algorithm. • Includes a large volume and variety of
• Veracity isn’t just about data quality, data
it’s about data understandability. • Easy to access and delivers quality an-
VI. Visualization: Presentation of data alytics that enables informed deci-
in a pictorial or graphical format sions
• Enables decision makers to see ana-
49 / 65
Where are we ?
50 / 65
Data Handling Technologies
I. Cloud computing: every day physical objects
• Essential characteristics will be connected to the
◦ On-demand self service internet and will be able to
◦ Broad network access identify themselves to other
◦ Resource pooling devices.”
◦ Rapid elasticity • Sensors embedded into various de-
◦ Measured service vices and machines and deployed
• Basic service models provided by into fields.
cloud computing • Sensors transmit sensed data to re-
◦ Infrastructure-as-a-Service (IaaS) mote servers via Internet.
◦ Platform-as-a-Service (PaaS) • Continuous data acquisition from
◦ Software-as-a-Service (SaaS) mobile equipment, transportation fa-
II. Internet of Things (IoT): cilities, public facilities, and home ap-
• According to Techopedia, IoT pliances
“describes a future where
51 / 65
III. Data handling at data centers: sumption.
• Storing, managing, and organizing • Replicates data to keep backup.
data. • Develop business oriented strategic
• Estimates and provides necessary solutions from big data.
processing capacity. • Helps business personnel to analyze
• Provides sufficient network infras- existing data.
tructure. • Discovers problems in business op-
• Effectively manages energy con- erations.
52 / 65
Where are we ?
53 / 65
Flow of Data
54 / 65
I. Data Sources
i. Enterprise data families.
◦ Online trading and analysis data. iii. Bio-medical data
◦ Production and inventory data. ◦ Masses of data generated by gene se-
◦ Sales and other financial data quencing.
ii. IoT data ◦ Data from medical clinics and medi-
◦ Data from industry, agriculture, traf- cal R&Ds.
fic, transportation iv. Other fields
◦ Medical-care data, ◦ Fields such as – computational biol-
◦ Data from public departments, and ogy, astronomy, nuclear research etc
55 / 65
II. Data Acquisition
i. Data collection
◦ Log files or record files that are au- tion through mobile devices. E.g. – ge-
tomatically generated by data sources ographical location, 2D barcodes, pic-
to record activities for further analysis. tures, videos etc
◦ Sensory data such as sound wave, ii. Data transmission
voice, vibration, automobile, chemical, ◦ After collecting data, it will be trans-
current, weather, pressure, tempera- ferred to storage system for further
ture etc. processing and analysis of the data.
◦ Complex and variety of data collec-
56 / 65
iii. Data pre-processing
◦ Collected datasets suffer from noise, • Cleaning is identifying inaccurate,
redundancy, inconsistency etc., incomplete, or unreasonable data,
thus, pre-processing of data is nec- and then modifying or deleting such
essary. data.
◦ Pre-processing of relational data • Redundancy mitigation is eliminat-
mainly follows – integration, clean- ing data repetition through detec-
ing, and redundancy mitigation tion, filtering and compression of
• Integration is combining data from data to avoid unnecessary trans-
various sources and provides users mission.
with a uniform view of data.
57 / 65
III. Data Storage
i. File system table file systems, derived from the
◦ Distributed file systems that store open source codes of GFS
massive data and ensure – consis- ii. Databases
tency, availability, and fault tolerance ◦ Emergence of non-traditional relational
of data. databases (NoSQL) in order to deal
◦ GFS is a notable example of dis- with the characteristics that big data
tributed file system that supports possess.
large-scale file system, though it’s ◦ Three main NoSQL databases – Key-
performance is limited in case of small value databases, column-oriented
files databases, and document-oriented
◦ Hadoop Distributed File System databases.
(HDFS) and Kosmosfs are other no-
58 / 65
Where are we ?
59 / 65
Introduction
60 / 65
Qualitative Analysis
i. Data is not described through numerical v. The grouping of data into identifiable
values themes
ii. Described by some sort of descriptive vi. Qualitative analysis can be summarized
context such as text by three basic principles (Seidel, 1998):
iii. Data can be gathered by many meth- • Notice things
ods such as interviews, videos and au- • Collect things
dio recordings, field notes • Think about things
iv. Data needs to be interpreted
61 / 65
Quantitative Analysis
i. Quantitative analysis refers to the process • Data dispersion
by which numerical data is analyzed • Analysis of relationships between vari-
ii. Involves descriptive statistics such as ables
mean, median, standard deviation • Contingence and correlation
iii. The following are often involved with • Regression analysis
quantitative analysis: • Statistical significance
• Statistical models • Precision
• Analysis of variables • Error limits
62 / 65
Comparison
Advantages
• Allows for the identification of important (and often mission-critical) trends
• Helps businesses identify performance problems that require some sort of action
• Can be viewed in a visual manner, which leads to faster and better decisions
• Better awareness regarding the habits of potential customers
• It can provide a company with an edge over their competitors
63 / 65
Text Books
64 / 65
Thank you
65 / 65