Cp4251 Internet of Things

You might also like

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

(Approved by AICTE and Affiliated to Anna University,

Chennai)
27, Thayanur, Trichy – 620009

Year / Sem: I / II Batch: 2021 – 2023

M.E. –COMPUTER SCIENCE & ENGINEERING


AI & ML

S.NO REGISTER NO NAME


1 810721323001 G.DHIVYA DHARSHINI
2 810721323002 B.GOKUL
3 810721323003 R.POOVIZHI
(Approved by AICTE and Affiliated to Anna University,
Chennai)
27, Thayanur, Trichy – 620009

Year / Sem: I / II Batch: 2021 – 2023

M.E. –AI&ML
ABC ANALYSIS
FIRST YEAR
A
S.NO REGISTER NO NAME
1 810721323001 G.DHIVYA DHARSHINI
2 810721323002 R.POOVIZHI
3 810721323003 B.GOKUL
CP4251 INTERNET OF THINGS LTPC
3024

COURSE OBJECTIVES:
 To Understand the Architectural Overview of IoT
 To Understand the IoT Reference Architecture and Real World Design Constraints
 To Understand the various IoT levels
 To understand the basics of cloud architectue
 To gain experience in Raspberry PI and experiment simple IoT application on it

UNIT I INTRODUCTION :
Internet of Things- Domain Specific IoTs - IoT and M2M-Sensors for IoT Applications–
Structure of IoT– IoT Map Device- IoT System Management with NETCONF-YANG.
UNIT II IoT ARCHITECTURE, GENERATIONS AND PROTOCOLS :
IETF architecture for IoT - IoT reference architecture -First Generation – Description &
Characteristics–Advanced Generation – Description & Characteristics–Integrated IoT
Sensors –Description & Characteristics.
UNIT III IoT PROTOCOLS AND TECHNOLOGY :
SCADA and RFID Protocols - BACNet Protocol -Zigbee Architecture - 6LowPAN - CoAP –
Wireless Sensor Structure–Energy Storage Module–Power Management Module–RF
Module–Sensing Module.
UNIT IV CLOUD ARCHITECTURE BASICS:
The Cloud types; IaaS, PaaS, SaaS.- Development environments for service development;
Amazon, Azure, Google Appcloud platform in industry.
UNIT V IOT PROJECTS ON RASPBERRY PI
Building IOT with RASPBERRY PI- Creating the sensor project - Preparing Raspberry Pi –
Clayster libraries – Hardware Interacting with the hardware - Interfacing the hardware-
Internal representation of sensor values - Persisting data - External representation of sensor
values - Exporting sensor data.

SUGGESTED ACTIVITIES:
1. Develop an application for LED Blink and Pattern using arduino or Raspberry Pi
2. Develop an application for LED Pattern with Push Button Control using arduino
or Raspberry Pi
3. Develop an application for LM35 Temperature Sensor to display temperature values
usingarduino or Raspberry Pi
4. Develop an application for Forest fire detection end node using Raspberry Pi device
andsensor
5. Develop an application for home intrusion detection web application
6. Develop an application for Smart parking application using python and Django for web
application

COURSE OUTCOMES:
CO1: Understand the various concept of the IoT and their technologies
CO2: Develop the IoT application using different hardware platforms
CO3: Implement the various IoT Protocols
CO4: Understand the basic principles of cloud computing
CO5: Develop and deploy the IoT application into cloud environment
(Approved by AICTE and Affiliated to Anna University, Chennai)
27, Thayanur, Trichy - 620009

DEPARTMENT: Computer Science And Engineering


Lesson plan (Micro level)

Faculty Name: Designation: ASST.PROFESSOR

Course Code & Name: CP4251 INTERNET OF THINGS

Academic Year: 2021-2022 Sem/Year: I / II

UNIT I INTRODUCTION
Mode of Course Actua
Planned
S.No. Topics Teachin Reference outcom l date Remarks
Date
g e
1 Internet of Things
2 Domain Specific IoTs
IoT and M2M-Sensors for IoT
3
Applications
Structure of
4
IoT
5 IoT Map Device-
IoT System Management with
6
NETCONF-YANG
Total No. of Hours prescribed per Unit by Anna
University
Total No. of Hours Required as per Lesson Plan
Signature of Faculty Signature of HOD
UNIT II IoT ARCHITECTURE, GENERATIONS AND PROTOCOLS
7 IETF architecture for IoT
8 IoT reference architecture
9 First Generation
Description &
10
Characteristics
11 Advanced Generation
12 Description & Characteristics
13 Integrated IoT Sensors
14 Description & Characteristics
Total No. of Hours prescribed per Unit by
Anna University
Total No. of Hours Required as per Lesson Plan
Signature of Faculty Signature of HOD
UNIT III IoT PROTOCOLS AND TECHNOLOGY
15 SCADA and RFID Protocols
BACNet Protocol -Zigbee
16
Architecture
17 6LowPAN
18 CoAP
19 Wireless Sensor Structure
20 Energy Storage Module0
21 Power Management Module
22 RF Module
23 Sensing Module
Total No. of Hours prescribed per Unit by Anna
University
Total No. of Hours Required as per Lesson Plan
Signature of Faculty Signature of HOD
UNIT IV CLOUD ARCHITECTURE BASICS
The Cloud types; IaaS, PaaS,
24
SaaS.
Development environments for
service development; Amazon,
25
Azure, Google Appcloud
platform in industry
Total No. of Hours prescribed per Unit by Anna
University
Total No. of Hours Required as per Lesson Plan
Signature of Faculty Signature of HOD
UNIT V IOT PROJECTS ON RASPBERRY PI
Building IOT with
26
RASPBERRY PI-
27 Creating the sensor project
28 Preparing Raspberry Pi
29 Clayster libraries
Hardware Interacting with the
30
hardware
31 Interfacing the hardware-
Internal representation
32
of sensor values
33 Persisting data
External representation of sensor
34
values
35 Exporting sensor data
Total No. of Hours prescribed per Unit by Anna
University
Total No. of Hours Required as per Lesson Plan
Signature of Faculty Signature of HOD

Total No. of Hours prescribed by Anna University for Completion of the Course
Total No. of Hours Required as per Lesson Plan to complete the Course
No. of Hours Required for covering Content Beyond Syllabus
Total No. of Lecture Hours for Completion of the Course 50
Name:
Prepared by Sign
Designation: Assistant Professor
Name: J. SURESH
Approved by Sign
Designation: Head of the Department
IMPORTANT TWO MARK QUESTIONS

1) What is the Internet Of Things (IoT)?


Internet of Things (IoT) is a network of physical objects or people
called “things” that are embedded with software, electronics, network,
and sensors that allow these objects to collect and exchange data. The
goal of IoT is to extend to internet connectivity from standard devices
like computer, mobile, tablet to relatively dumb devices like a toaster.

2) Explain Raspberry Pi
Raspberry Pi is a computer which is capable of doing all the
operations like a conventional computer. It has other features such as
onboard WiFi, GPIO pins, and Bluetooth in order to communicate
with external things.

3) List mostly used sensors types in IoT


Mostly used sensor types in IoT are:

 Smoke sensor
 Temperature sensors
 Pressure sensor
 Motion detection sensors
 Gas sensor
 Proximity sensor
 IR sensors

4) What are the advantages of IoT?

Key benefits of IoT technology are as follows:


 Technical Optimization: IoT technology helps a lot in
improving techniques and making them better. For example,
with IoT, a manufacturer is able to collect data from various car
sensors. The manufacturer analyses them to improve its design
and make them more efficient.
 Improved Data Collection: Traditional data collection has its
limitations and its design for passive use. IoT facilitates
immediate action on data.
 Reduced Waste: IoT offers real-time information leading to
effective decision making & management of resources. For
example, if a manufacturer finds an issue in multiple car
engines, he can track the manufacturing plan of those engines
and solves this issue with the manufacturing belt.
 Improved Customer Engagement: IoT allows you to improve
customer experience by detecting problems and improving the
process.

5) What are the most common IoT applications?

The most common IoT applications are:

 Smart Thermostats: Helps you to save resources on heating


bills by knowing your usage patterns.
 Connected Cars: IoT helps automobile companies handle
billing, parking, insurance, and other related stuff automatically.
 Activity Trackers: Helps you to capture heart rate patterns,
calorie expenditure, activity levels, and skin temperature on
your wrist.
 Smart Outlets: Remotely turn any device on or off. It also
allows you to track a device’s energy level and get custom
notifications directly into your smartphone.
 Parking Sensors: IoT technology helps users to identify the
real-time availability of parking spaces on their phones.
 Connect Health: The concept of a connected healthcare system
facilitates real-time health monitoring and patient care. It helps
in improved medical decision-making based on patient data.

6) What are the challenges of IoT?


Important challenges of IoT are:

 Insufficient testing and updating


 Concern regarding data security and privacy
 Software complexity
 Data volumes and interpretation
 Integration with AI and automation
 Devices require a constant power supply which is difficult
 Interaction and short-range communication

7)The Role of Cloud Computing on the Internet of Things?


According to Amazon Web Services, there are four benefits of cloud
computing:
1. No need to pre-guess infrastructure capacity needs
2. Saves money, because you only need to pay for those resources
that you use, the larger the scale, the more savings
3. In a few minutes, platforms can be deployed around the world
4. Flexibility and speed in providing resources to developers
Thus, the role of cloud computing in IoT is to work together to store
IoT data, providing easy access when needed. It’s important to note
that cloud computing is an easy way to move large data packets
across the Internet generated by the IoT.

8)Software as a Service (SaaS)?

It is a cloud application service that runs directly through a web


browser. Here, cloud providers provide software through the Internet,
and administrators can upload applications individually. SaaS
manages everything from installation to management. It allows users
to access the application without the need to download the software. It
does so via a licensed subscription.

Example: Google Apps, Slack, Cisco Webex, HubSpot, and


Salesforce

9)Platform as a Service (PaaS)?

Similar to SaaS, PaaS is a cloud platform service for software


creation where the development and testing of applications occur.
PaaS streamlines the process of app development and functions
similar to middleware services. In PaaS, the host avails
hardware/software services without asking users to install it on their
premises. It is a platform that lets end-users run, develop, and execute
applications within the cloud.

Example: Azure, Magento, and OpenShift

10)Infrastructure as a Service (IaaS):?

It is a cloud infrastructure service responsible for application data


management and runtime environment. It is available to users on a
pay-per-usage basis and executes scalable and redundant storage
through API and cloud applications. IaaS maintains the backend to
facilitate computer hardware in the form of a service, along with
delivering virtualization technology.

Example: Cisco Metapod, Amazon Web Services (AWS), and


Google Compute Engine (GCE)

11) Components of WSN?

1. Sensors:
Sensors in WSN are used to capture the environmental variables
and which is used for data acquisition. Sensor signals are
converted into electrical signals.
2. Radio Nodes:
It is used to receive the data produced by the Sensors and sends it
to the WLAN access point. It consists of a microcontroller,
transceiver, external memory, and power source.
3. WLAN Access Point:
It receives the data which is sent by the Radio nodes wirelessly,
generally through the internet.
4. Evaluation Software:
The data received by the WLAN Access Point is processed by a
software called as Evaluation Software for presenting the report to
the users for further processing of the data which can be used for
processing, analysis, storage, and mining of the data.

12) Wireless Sensor Network Applications?


The applications of wireless sensor networks mainly include health,
military, environmental, home, & other commercial areas.

 Military Applications
 Health Applications
 Environmental Applications
 Home Applications
 Commercial Applications
 Area monitoring
 Health care monitoring
 Environmental/Earth sensings
 Air pollution monitoring
 Forest fire detection
 Landslide detection
 Water quality monitoring
 Industrial monitoring

13) RF modules in iot ?

The RF modules have now become a vital ingredient of almost all


Internet of Things (IoT) based boards and gadgets. These modules
have been used in a variety of IoT applications ranging from security
cameras (IP based), trackers, and scanners (point of sale) etc. The RF
modules are now being used in numerous medical devices as well.
IoT is seeing a constant change due to its evolutionary technology and
RF modules are also under constant change in its design. The RF
modules are shrinking in size and its performance is increasing with
each passing day. The small sized RF modules are becoming viable
because of its advantages such as lower power consumption, lower
time consumption, and best design and fabrication. The image below
is further illustrating the use of IoT based RF modules in various
industries.

The RF modules which are readily available in the form of SIP


(System in Package) are an integrated solution. These chips are
comprising of all essentials such as antennas which are already pre-
certified and pre-tested as well. This is how design complexities of
the RF modules are eradicated and development time along with risk
and effort has been reduced. These IoT based devices are already
certified and have an extended peripheral capacities allowing
developers to have a focus on the end application.

14) How does the raspberry pi works?

The memory card slot is used for inserting an SD card that acts as the
hardware of Raspberry Pi. The USB port, HDMI port, and the
audio/video port help us connect with a monitor, TV or any other
device. This is how Raspberry Pi is capable of working anytime and
anywhere. The processor gives the correct speed for running our
computer programs all the time.

15) Architecture of Zigbee?

Zigbee architecture is a combination of 6 layers.


1. Application Layer
2. Application Interface Layer
3. Security Layer
4. Network Layer
5. Medium Access Control Layer
6. Physical Layer
MODEL QUESTION PAPER
INTERNET of THINGS

(Model Question Paper – I)


Time: 3 Hours ] [ Maximum Marks: 100

Instructions to students:

Answer FIVE FULL questions.

RBT
Q.No. Questions Marks CO Cognitive
Level
Explain the generic M2M System Solution with a neat
a) 10 CO1 L3
diagram
1.
Summarize the Megatrends, Capabilities and implications of
b) 10 CO1 L2
IoT.
OR
Explain various trend in Information and communication
a) 10 CO1 L3
technologies and its impact on IoT.
Explain the potential and benefits of an IoT oriented
2.
approach over M2M by considering a Health band as the real
b) 10 CO1 L3
world use case example. Compare the main characteristics of
M2M and IoT.

a) Describe M2M value chain with a neat diagram 10 CO2 L2


3. Explain an information driven value chain for IoT with a neat
b) 10 CO2 L3
diagram
OR
Discuss the design objectives of IoT architecture needed to
a) 10 CO2 L2
target ahorizontal system of real-world services.
4.
Explain the functional layers and capabilities of an IoT
b) 10 CO2 L3
solution with a neat diagram.

Cite the various M2M/IoT device types and explain their


a) 10 CO3 L2, L3
characteristics and the deployment scenarios.
5.
Explain how gateways are used for data management, local
b) 10 CO3 L3
applications and device management in IoT.
OR
6. a) Explain ETSI M2M Functional architecture with a neat 10 CO3 L3
diagram.
Discuss various standards and technologies that enables
b) Adhoc connectivity between devices that forms the basis of 10 CO3 L3
IoT.

Illustrate ETSI M2M High Level architecture with a neat


a) 10 CO4 L2
diagram
7.
Explain ETSI M2M service capabilities in detail with a neat
b) 10 CO4 L3
diagram
OR

a) Discuss IETF Working Groups and Specifications Scope. 10 CO4 L2


8. Explain OGC functional architecture and interactions with a
b) 10 CO4 L3
neat diagram.

Explain device and application functional group,


communication functional group, IoT service functional
a) 10 CO5 L3
group and virtual entity functional group in detail with a neat
diagram of IoT functional view.
9.
Explain IoT process management functional group, service
organization functional group, security functional group and
b) 10 CO5 L3
management functional group in detail with a neat diagram
of IoT functional view.
OR
Explain the flow of information through a context enrichment
a) 10 CO5 L3
process in IoT
10.
b) Describe the information exchange patterns in IoT. 10 CO5 L2

******
INTERNET of THINGS

(Model Question Paper – II)


Time: 3 Hours ] [ Maximum Marks: 100

Instructions to students:
Answer FIVE FULL questions.

RBT
Q.No. Questions Marks CO Cognitive
Level
a) Write a summary of cellular M2M market situation. 10 CO1 L3
1.
b) Explain the various emerging IoT applications. 10 CO1 L3

OR
Explain various trend in Information and communication
a) 10 CO1 L3
technologies and its impact on IoT.
Explain the potential and benefits of an IoT oriented
2.
approach over M2M by considering a Health band as the real
b) 10 CO1 L3
world use case example. Compare the Main characteristics of
M2M and IoT.

Explain the five fundamental roles within I-GVC that


a) companies and other factors are forming around in IoT 10 CO2 L3
industrial structure.
3. Describe how a solution is designed for a particular problem
by making use applied architecture in M2M/IoT. Also,
b) 10 CO2 L2
explain the use of partitioning the architectural work and
solution work into two domains.
OR
Discuss the design objectives of IoT architecture needed to
a) 10 CO2 L2
target ahorizontal system of real-world services.
4.
Explain the functional layers and capabilities of an IoT
b) 10 CO2 L3
solution with a neat diagram.

5. a) Identify the key characteristics of M2M data. Also, explain 10 CO3 L2


the data generation, data acquisition, data validation steps in
M2M data management.
Explain data storage, data processing, data analysis steps in
b) 10 CO3 L3
M2M data management.
OR
Explain how cloud of things acts as an enabler for new value
a) 10 CO3 L3
added services and applications with a neat diagram.
6.
b) Describe distributed business process in IoT. 10 CO3 L2

Illustrate ITU-IoT Reference model in detail with a neat


a) 10 CO4 L2
diagram.
7.
Explain OGC functional architecture and interactions with a
b) 10 CO4 L3
neat diagram.
OR

a) Discuss IETF Working Groups and Specifications Scope. 10 CO4 L2


8. Illustrate ETSI M2M High Level architecture with a neat
b) 10 CO4 L2
diagram

Describe the information flow process when utilizing the IoT


a) 10 CO5 L2
service resolution FC with a neat diagram.
9.
Explain the information flow process when the Virtual Entity
b) 10 CO5 L3
Service Resolution FC is utilized with a neat diagram.
OR
Explain service choreography and Processing of IoT services
a) 10 CO5 L3
with a neat diagram
10. Explain the deployment and operational view, resources,
b) services, virtual entities, users in an IoT system by 10 CO5 L3
considering a Parking lot example.

******
IOT MATERIAL
(FULL UNIT)
UNIT-I INTRODUCTION
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.
DOMAIN SPECIFIC IoTs :
1) Home Automation:

a) Smart Lighting: helps in saving energy by adapting the lighting to the ambient conditions and
switching on/off or diming the light when needed.

b) Smart Appliances: make the management easier and also provide status information to the
users remotely.

c) Intrusion Detection: use security cameras and sensors(PIR sensors and door sensors) to detect
intrusion and raise alerts. Alerts can be in the form of SMS or email sent to the user.

d) Smoke/Gas Detectors: Smoke detectors are installed in homes and buildings to detect smoke
that is typically an early sign of fire. Alerts raised by smoke detectors can be in the form of
signals to a fire alarm system. Gas detectors can detect the presence of harmful gases such as CO,
LPGetc.,

2) Cities:

a) Smart Parking: make the search for parking space easier and convenient for drivers. Smart
parking are powered by IoT systems that detect the no. of empty parking slots and send
information over internet to smart application backends.

b) Smart Lighting: for roads, parks and buildings can help in saving energy.

c) Smart Roads: Equipped with sensors can provide information on driving condition, travel time
estimating and alert in case of poor driving conditions, traffic condition and accidents.

d) Structural Health Monitoring: uses a network of sensors to monitor the vibration levels in the
structures such as bridges and buildings.

e) Surveillance: The video feeds from surveillance cameras can be aggregated in cloud based
scalable storage solution.

f) Emergency Response: IoT systems for fire detection, gas and water leakage detection can help
in generating alerts and minimizing their effects on the critical infrastructures.

3) Environment:

a) Weather Monitoring: Systems collect data from a no. of sensors attached and send the data to
cloud based applications and storage back ends. The data collected in cloud can then be analyzed
and visualized by cloud based applications.

b) Air Pollution Monitoring: System can monitor emission of harmful gases(CO2, CO, NO, NO2
etc.,) by factories and automobiles using gaseous and meteorological sensors. The collected data
can be analyzed to make informed decisions on pollutions control approaches.

c) Noise Pollution Monitoring: Due to growing urban development, noise levels in cities have
increased and even become alarmingly high in some cities. IoT based noise pollution monitoring
systems use a no. of noise monitoring systems that are deployed at different places in a city. The
data on noise levels from the station is collected on servers or in the cloud. The collected data is
then aggregated to generate noise maps.

d) Forest Fire Detection: Forest fire can cause damage to natural resources, property and human
life. Early detection of forest fire can help in minimizing damage.

e) River Flood Detection: River floods can cause damage to natural and human resources and
human life. Early warnings of floods can be given by monitoring the water level and flow rate.
IoT based river flood monitoring system uses a no. of sensor nodes that monitor the water level
and flow rate sensors.

4) Energy:

a) Smart Grids: is a data communication network integrated with the electrical grids that collects
and analyze data captured in near-real-time about power transmission, distribution and
consumption. Smart grid technology provides predictive information and recommendations to
utilities, their suppliers, and their customers on how best to manage power. By using IoT based
sensing and measurement technologies, the health of equipment and integrity of the grid can be
evaluated.

b) Renewable Energy Systems: IoT based systems integrated with the transformers at the point of
interconnection measure the electrical variables and how much power is fed into the grid. For
wind energy systems, closed-loop controls can be used to regulate the voltage at point of
interconnection which coordinate wind turbine outputs and provides power support.

c) Prognostics: In systems such as power grids, real-time information is collected using


specialized electrical sensors called Phasor Measurment Units(PMUs) at the substations. The
information received from PMUs must be monitored in real-time for estimating the state of the
system and for predicting failures.

5) Retail:

a) Inventory Management: IoT systems enable remote monitoring of inventory using data
collected by RFIDreaders.

b) Smart Payments: Solutions such as contact-less payments powered by technologies such as


Near Field Communication(NFC) and Bluetooth.

c) Smart Vending Machines: Sensors in a smart vending machines monitors its operations and
send the data to cloud which can be used for predictive maintenance.

6) Logistics:

a) Route generation & scheduling: IoT based system backed by cloud can provide first response
to the route generation queries and can be scaled upto serve a large transportation network.

b) Fleet Tracking: Use GPS to track locations of vehicles inreal-time.

c) Shipment Monitoring: IoT based shipment monitoring systems use sensors such as temp,
humidity, to monitor the conditions and send data to cloud, where it can be analyzed to detect
foods poilage.
d) Remote Vehicle Diagnostics: Systems use on-board IoT devices for collecting data on Vehicle
operations(speed, RPMetc.,) and status of various vehicle subsystems.

7) Agriculture:

a) Smart Irrigation: to determine moisture amount in soil.

b) Green House Control: to improve productivity.

8) Industry:

a) Machine diagnosis and prognosis

b) Indoor Air Quality Monitoring

9) Health and Life Style:

a) Health & Fitness Monitoring

b) Wearable Electronics.

M2M:
Machine-to-Machine (M2M) refers to networking of machines(or devices) for the purpose of
remote monitoring and control and data exchange.

 Term which is often synonymous with IoT is Machine-to-Machine (M2M).

 IoT and M2M are often used interchangeably. Fig. Shows the end-to-end architecture of M2M
systems comprises of M2M area networks, communication networks and application domain.

 An M2M area network comprises of machines( or M2M nodes) which have embedded network
modules for sensing, actuation and communicating various communication protocols can be used for
M2M LAN such as ZigBee, Bluetooth, M-bus, Wireless M-Bus etc., These protocols provide
connectivity between M2M nodes within an M2M area network.

 The communication network provides connectivity to remote M2M area networks. The
communication network provides connectivity to remote M2M area network. The communication
network can use either wired or wireless network(IP based). While the M2M are networks use
either properietorary or non-IP based communication protocols, the communication network uses
IP-based network. Since non-IP based protocols are used within M2M area network, the M2M
nodes within one network cannot communicate with nodes in an external network.

 To enable the communication between remote M2M are network, M2M gateways are used.

Fig. Shows a block diagram of an M2M gateway. The communication between M2M nodes and the
M2M gateway is based on the communication protocols which are naive to the M2M are network.
M2M gateway performs protocol translations to enable Ip-connectivity for M2M are networks.

M2M gateway acts as a proxy performing translations from/to native protocols to/from Internet
Protocol(IP). With an M2M gateway, each mode in an M2M area network appears as a virtualized
node for external M2M area networks.

Differences between IoT and M2M

1) Communication Protocols:
 Commonly uses M2M protocols include ZigBee, Bluetooth, ModBus, M-Bus, Wireless M-Bus
tec.,  In IoT uses HTTP, CoAP, WebSocket , MQTT ,XMPP ,DDS ,AMQP etc.,

2) Machines in M2M Vs Things in IoT:


 Machines in M2M will be homogenous whereas Things in IoT will be heterogeneous.

3) Hardware Vs Software Emphasis:


 the emphasis of M2M is more on hardware with embedded modules, the emphasis of IoT is
more on software.

4) Data Collection &Analysis


 M2M data is collected in point solutions and often in on-premises storage infrastructure.

 The data in IoT is collected in the cloud (can be public, private or hybrid cloud).

5) Applications
 M2M data is collected in point solutions and can be accessed by on-premises applications such
as diagnosis applications, service management applications, and on- premisis enterprise
applications.
 IoT data is collected in the cloud and can be accessed by cloud applications such as analytics
applications, enterprise applications, remote diagnosis and management applications, etc.

IoT Sensor :
Sensors are designed to respond to specific types of conditions in the physical world, and then
generate a signal (usually electrical) that can represent the magnitude of the condition being
monitored. Those conditions may be light, heat, sound, distance, pressure, or some other more
specific situation, such as the presence or absence of a gas or liquid. The common IoT sensors that
will be employed include:

 Temperature sensors
 Pressure sensors
 Motion sensors
 Level sensors
 Image sensors
 Proximity sensors
 Water quality sensors
 Chemical sensors
 Gas sensors
 Smoke sensors
 Infrared (IR) sensors
 Acceleration sensors
 Gyroscopic sensors
 Humidity sensors
 Optical sensors

A description of each of these sensors is provided below.

Temperature sensors: Temperature sensors detect the temperature of the air or a physical object and
concert that temperature level into an electrical signal that can be calibrated accurately reflect the
measured temperature. These sensors could monitor the temperature of the soil to help with
agricultural output or the temperature of a bearing operating in a critical piece of equipment to sense
when it might be overheating or nearing the point of failure.

Pressure sensors: Pressure sensors measure the pressure or force per unit area applied to the sensor
and can detect things such as atmospheric pressure, the pressure of a stored gas or liquid in a sealed
system such as tank or pressure vessel, or the weight of an object.

Motion sensors: Motion sensors or detectors can sense the movement of a physical object by using
any one of several technologies, including passive infrared (PIR), microwave detection, or ultrasonic,
which uses sound to detect objects. These sensors can be used in security and intrusion detection
systems, but can also be used to automate the control of doors, sinks, air conditioning and heating, or
other systems.

Level sensors: Level sensors translate the level of a liquid relative to a benchmark normal value into a
signal. Fuel gauges display the level of fuel in a vehicle’s tank, as an example, which provides a
continuous level reading. There are also point level sensors, which are a go-no/go or digital
representation of the level of the liquid. Some automobiles have a light that illuminates when the fuel
level tank is very close to empty, acting as an alarm that warns the driver that fuel is about to run out
completely.
Image sensors: Image sensors function to capture images to be digitally stored for processing.
License plate readers are an example, as well as facial recognition systems. Automated production
lines can use image sensors to detect issues with quality such as how well a surface is painted after
leaving the spray booth.

Proximity sensors: Proximity sensors can detect the presence or absence of objects that approach the
sensor through a variety of different technology designs. These approaches include:

 Inductive technologies which are useful for the detection of metal objects
 Capacitive technologies, which function on the basis of objects having a different dielectric
constant than that of air
 Photoelectric technologies, which rely on a beam of light to illuminate and reflect back from
an object, or
 Ultrasonic technologies, which use a sound signal to detect an object nearing the sensor

Water quality sensors: The importance of water to human beings on earth not only for drinking but as
a key ingredient needed in many production processes dictates the need to be able to sense and
measure parameters around water quality. Some examples of what is sensed and monitored include:

 chemical presence (such as chlorine levels or fluoride levels)


 oxygen levels (which may impact the growth of algae and bacteria)
 electrical conductivity (which can indicate the level of ions present in water)
 pH level (a reflection of the relative acidity or alkalinity of the water)
 turbidity levels (a measurement of the amount of suspended solids in water)

Chemical sensors: Chemical sensors are designed to detect the presence of specific chemical
substances which may have inadvertently leaked from their containers into spaces that are occupied
by personnel and are useful in controlling industrial process conditions.

Gas sensors: Related to chemical sensors, gas sensors are tuned to detect the presence of
combustible, toxic, or flammable gas in the vicinity of the sensor. Examples of specific gases that can
be detected include:

 Bromine (Br2)
 Carbon Monoxide (CO)
 Chlorine (Cl2)
 Chlorine Dioxide (ClO2)
 Ethylene (C2H4)
 Ethylene Oxide (C2H4O)
 Formaldehyde (HCHO)
 Hydrazine(s):
 (H2NNH2, CH3NHNH2, [CH3]2NNH2)
 Hydrogen (H2)
 Hydrogen Bromide (HBr)
 Hydrogen Chloride HCl)
 Hydrogen Cyanide (HCN)
 Hydrogen Peroxide (H2O2)
 Hydrogen Sulfide (H2S)
 Nitric Oxide (NO)
 Nitrogen Dioxide (NO2)
 Ozone (O3)
 Peracetic Acid (C2H4O3)
 Propylene Oxide (C3H6O)
 Sulfur Dioxide (SO2)
Smoke sensors: Smoke sensors or detectors pick up the presence of smoke conditions which could be
an indication of a fire typically using optical sensors (photoelectric detection) or ionization detection.

Infrared (IR) sensors: Infrared sensor technologies detect infrared radiation that is emitted by
objects. Non-contact thermometers make use of these types of sensors as a way of measuring the
temperature of an object without having to directly place a probe or sensor on that object. They find
use in analyzing the heat signature of electronics and detecting blood flow or blood pressure in
patients.

Acceleration sensors: While motion sensors detect movement of an object, acceleration sensors, or
accelerometers as they are also known, detect the rate of change of velocity of an object. This change
may be due to a free-fall condition, a sudden vibration that is causing movement with speed changes,
or rotational motion (a directional change). One of several technologies that are employed in
acceleration sensors include:

 Hall-effect sensors (which rely on measuring changes in magnetic fields)


 Capacitive sensors (which depend on measuring changes in voltage from two surfaces)
 Piezoelectric sensors (which generate a voltage that changes based on pressure from
distortion of the sensor)

Gyroscopic sensors: Gyroscopes or gyroscopic sensors are used to measure the rotation of an object
and determine the rate of its movement called the angular velocity, using a 3-axis system. These
sensors enable the determination of the object’s orientation without having to visibly observe it.

Humidity sensors: Humidity sensors can detect the relative humidity of the air or other gas, which is
a measure of the amount of water vapor contained in that gas. Controlling environmental conditions is
critical in the production processes of materials and humidity sensors enable readings to be taken and
changes made to mitigate increasing or decreasing levels. A common application is in HVAC systems
to maintain desired comfort levels.

Optical sensors: Optical sensors respond to light that is reflected off of an object and generate a
corresponding electrical signal for use in detecting or measuring a condition. These sensors work by
either sensing the interruption of a beam of light or its reflection caused by the presence of the object.
The types of optical sensors include:

 Through-beam sensors (which detect objects by the interruption of a light beam as the object
crosses the path between a transmitter and remote receiver)
 Retro-reflective sensors (which combine transmitter and receiver into a single unit and use a
separate reflective surface to bounce the light back to the device)
 Diffuse reflection sensors (which operate similarly to retro-reflective sensors except that the
object being detected serves as the reflective surface)

IoT Structure
IoT is a network of tiny innovations like the sensors which can be attached to possibly anything
available and then make them communicate with the cloud server without any human interaction. So,
the question is how to make this happen? Well the answer is to attach a sensor to a Raspberry Pi
device about which we will be discussing in the coming sections. Raspberry Pi device with the
installed EdgeX agent helps the users to acquire, store, process, and take actions any kind of data from
the device to the cloud server.
Figure 1 : Communication between sensors, gateway, and cloud server

Sensors - Tiny innovations that can be attached to anything and then with some additional help, can
be made to communicate with the internet. Sensors play a pivotal role in the IoT infrastructure.

Gateway device - A gateway device is nothing but a piece of hardware bridging the gap between the
sensors and the IoT platform. This guide details about a Raspberry Pi device which is integrated with
EdgeX agent to help the sensors communicate the data to the cloud server.

EdgeX agent - A revolutionary agent by WebNMS IoT that makes the devices IoT enabled and help
them to seamlessly discover, acquire, and process immense data smoothly.

Cloud Server - A virtual but logical server that is built, hosted and delivered through cloud
computing platform and can be accessed remotely.

Sensors are deployed at the remote location so that they can detect any changes in the environment
and notify the user for the occurred changes. These changes are then captured and pushed to the cloud
server. Multi-purpose EdgeX agent bridges the gap between the sensors installed at the remote
location and the cloud server. The agent when pushed to the gateway device ensures that the
communication establishes between the sensors and the cloud server.
Sensors are made to communicate with the cloud server with the help of the EgdeX agent that is
integrated with the Raspberry pi device. Data is collected, translated, and then transferred to the cloud
server from the sensors via the Raspberry Pi device.

IoT Systems Management with NETCONF-YANG:


YANG is a data modeling language used to model configuration and state data manupulated by the
NETCONF protocol. The generic approach of IoT device management weith NETCONF-YANG.
Roles of various componentsare:
1) Management System
2) Management API
3) Transaction Manager
4) Rollback Manager
5) Data Model Manager
6) Configuration Validator
7) Configuration Database
8) Configuration API
9) Data Provider API
1) Management System : The operator uses a management system to send NETCONF messages to
configure the IoT device and receives state information and notifications from the device as
NETCONF messages.
2) Management API : allows management application to start NETCONF sessions.
3) Transaction Manager: executes all the NETCONF transactions and ensures that ACID properties
hold true for the transactions.
4) Rollback Manager : is responsible for generating all the transactions necessary to rollback a
current configuration to its original state.
5) Data Model Manager : Keeps track of all the YANG data models and the corresponding managed
objects. Also keeps track of the applications which provide data for each part of a data model.
6) Configuration Validator : checks if the resulting configuration after applying a transaction would
be a valid configuration.
7) Configuration Database : contains both configuration and operational data.
8) Configuration API : Using the configuration API the application on the IoT device can be read
configuration data from the configuration datastore and write operational data to the operational
datastore.
9) Data Provider API: Applications on the IoT device can register for callbacks for various events
using the Data Provider API. Through the Data Provider API, the applications can report statistics and
operational ldata.
UNIT-II IOT ARCHITECTURE, GENERATION
AND PROTOCOL

Internet Engineering Task Force (IETF):

What is the Internet Engineering Task Force (IETF)?


The Internet Engineering Task Force (IETF) is the body that defines standard operating
internet protocols such as TCP/IP.

The IETF is an open standards organization supervised by the Internet Society's Internet Architecture
Board (IAB). However, prior to 1993, the IETF was supported by the United States federal
government.

The Internet of Things (IoT) is the network of physical objects or "things" embedded with electronics,
software, sensors, actuators, and connectivity to enable objects to exchange data with the
manufacturer, operator, and/or other connected devices.

The Internet of Things refers to a system with devices that are often constrained in communication
and computation capabilities, now becoming more commonly connected to the Internet or at least to
an IP network, and to various services that are built on top of the capabilities these devices jointly
provide. It is expected that this development will usher in more machine-to-machine communication
using the Internet with no human user actively involved.

THE IOT REFERENCE ARCHITECTURE:


The reference architecture consists of a set of components. Layers can be realized by means of
specific technologies, and we will discuss options for realizing each component. There are also some
cross-cutting/vertical layers such as access/identity management.

The layers are:

• Client/external communications - Web/Portal, Dashboard, APIs

• Event processing and analytics (including data storage)

• Aggregation/bus layer – ESB and message broker

• Relevant transports - MQTT/HTTP/XMPP/CoAP/AMQP, etc.

• Devices

The cross-cutting layers are

• Device manager

• Identity and access management.

First generation:
Cloud computing and ubiquitous networks are ground-breaking advancement ensuring that
large computing power and storage capacity become more affordable and accessible to
businesses and researchers. The ability to collect, transmit and store large volumes of data has
fueled the exponential growth of the first generation of IoT scenarios. Data from IoT devices
is streamed to cloud platforms for processing and studying machine learning for decision
making - trend analysis, optimization or preventive measures based on predictions. These IoT
scenarios are constrained by challenges like - ability to provide real-time responses, ability to
be continuously connected to a network or the inefficiency of transferring every sensor
reading to the cloud.

Infusion of compute and storage capability on the IoT edge devices itself is driving the next
generation of IoT scenarios. Edge or near edge processing enables near real-time analysis and
responses, pre-processing of data resulting in reduced data payload and asynchronous mode
of data transfer (store and forward). But, being disconnected from a secure network for long
intervals of time invites security risks and raises concern on data integrity. This paper
explores validation and security offered by blockchain to help overcome the data security
challenge in IoT.
UNIT-4
CLOUD ARCHITECTURE BASICS

TYPES OF CLOUDS: IaaS, PaaS, and SaaS


Cloud computing has risen massively in terms of popularity in recent times. This is due to the way it
reduces on-premise infrastructure cost and improves efficiency. Primarily, the cloud model has been
divided into three major service categories:

 Infrastructure as a Service (IaaS)


 Platform as a Service (PaaS)
 Software as a Service (SaaS)
We will discuss each of these instances in the following sections:
The article is an excerpt taken from the book ‘Cloud Analytics with Google Cloud Platform‘, written
by Sanket Thodge.

Infrastructure as a Service (IaaS)


Infrastructure as a Service: often provides the infrastructure such as servers, virtual machines,
networks, operating system, storage, and much more on a pay-as-you-use basis. IaaS providers offer
VM from small to extra-large machines.
The IaaS gives you complete freedom while Common cloud vendors providing the IaaS services are:

 Google Cloud Platform


 Amazon Web Services
 IBM
 HP Public Cloud

Platform as a Service (PaaS)


The PaaS model is similar to IaaS, but it also provides the additional tools such as database
management system, business intelligence services, and so on. The following figure illustrates the
architecture of the PaaS model:
choosing the instance type as per your requirements:
Common cloud vendors providing the IaaS services are:

 Google Cloud Platform


 Amazon Web Services
 IBM
 HP Public Cloud
Cloud platforms providing PaaS services are as follows:

 Windows Azure
 Google App Engine
 Cloud Foundry
 Amazon Web Services

Software as a Service (SaaS)


Software as a Service (SaaS) makes the users connect to the products through the internet (or
sometimes also help them build in-house as a private cloud solution) on a subscription basis model.
Below image shows the basic architecture of SaaS model.

Some cloud vendors providing SaaS are:


 Google Application
 Salesforce
 Zoho
 Microsoft Office 365
Differences between SaaS, PaaS, and IaaS
The major differences between these models can be summarized to a table as follows:
Software as a Platform as a Infrastructure as a Service
Service (SaaS) Service (PaaS) (IaaS)
Software as a
service is a model In IaaS, a third-party
This is a model in which
in which a third- application provides servers,
a third-party provider
party provider storage, compute resources,
application development
hosts multiple and so on. And then makes
platform and services
applications and it available for customers
built on its own
lets customers use for their utilization.
infrastructure. Again
them over the Customers can use IaaS to
these tools are made
internet. build their own PaaS and
available to customers
SaaS is a very SaaS service for their
over the internet.
useful pay-as-you- customers.
Examples:
use model. Examples:
Google App Engine,
Examples: Google Cloud Compute,
AWS Lambda
Salesforce, Amazon S3
NetSuite

How PaaS, IaaS, and SaaS are separated at a service level


In this section, we are going to learn about how we can separate IaaS, PaaS, and SaaS at the service
level:

As the previous diagram suggests, we have the first column as OPS, which stands for operations. That
means the bare minimum requirement for any typical server. When we are going with a server to buy,
we should consider the preceding features before buying.
It includes Application, Data, Runtime, Framework, Operating System,
Server, Disk, and Network Stack.
When we move to the cloud and decide to go with IaaS—in this case, we are not bothered about the
server, disk, and network stack. Thus, the headache of handling hardware part is no more with us.
That’s why it is called Infrastructure as a Service.
Now if we think of PaaS, we should not be worried about runtime, framework, and operating system
along with the components in IaaS. Things that we need to focus on are only application and data.
And the last deployment model is SaaS—Software as a Service. In this model, we are not concerned
about literally anything. The only thing that we need to work on is the code and just a look at the bill.
It’s that simple!

Google appcloud platform :

Our Google Cloud Platform Tutorial contains the basic and advanced concepts of Google Cloud
Platform. This tutorial is designed to help both beginners and professionals.

This tutorial gives you an introduction to Google Cloud Platform along with a wide range of topics
such as why use Google Cloud Platform, Benefits of Google Cloud Platform, Key features of
Google Cloud Platform, Google Cloud Platform Services, Creating a Free Tier Account and VM
Instance on Google Cloud Platform, etc.

Before we start learning Google Cloud Platform, let's understand about 'Cloud Computing' first:

What is Cloud Computing?

Cloud computing is defined as the services offered through remote servers on the internet. These
services might include database storage, applications, compute power and other IT resources over the
pay-as-you-go pricing approach. The remote server allows users to save, modify, or process data on
the internet or cloud-based platform instead of storing it on a local server or their devices.

Cloud computing is evolving due to fast performance, better manageability, and less maintenance. It
helps organizations to minimize the number of resources and overall infrastructure costs.
Additionally, it helps IT teams better focus on the important applications, services, and processes and
achieve the company's goals.

Typically, the cloud-computing providers offer their services according to the following three
standard models:
o Platform as a Service (PaaS)
o Software as a Service (SaaS)
o Infrastructure as a Service (IaaS)

What is Google Cloud Platform?

Google Cloud Platform (GCP) is a suite of cloud computing services provided by Google. It is a
public cloud computing platform consisting of a variety of services like compute, storage, networking,
application development, Big Data, and more, which run on the same cloud infrastructure that Google
uses internally for its end-user products, such as Google Search, Photos, Gmail and YouTube, etc.

The services of GCP can be accessed by software developers, cloud administrators and IT
professionals over the Internet or through a dedicated network connection.

Why Google Cloud Platform?

Google Cloud Platform is known as one of the leading cloud providers in the IT field. The services
and features can be easily accessed and used by the software developers and users with little technical
knowledge. Google has been on top amongst its competitors, offering the highly scalable and most
reliable platform for building, testing and deploying the applications in the real-time environment.

Apart from this, GCP was announced as the leading cloud platform in the Gartner's IaaS Magic
Quadrant in 2018. Gartner is one of the leading research and advisory company. Gartner organized a
campaign where Google Cloud Platform was compared with other cloud providers, and GCP was
selected as one of the top three providers in the market.

Most companies use data centers because of the availability of cost forecasting, hardware certainty,
and advanced control. However, they lack the necessary features to run and maintain resources in the
data center. GCP, on the other side, is a fully-featured cloud platform that includes:
o Capacity: Sufficient resources for easy scaling whenever required. Also, effective
management of those resources for optimum performance.
o Security: Multi-level security options to protect resources, such as assets, network and OS -
components.
o Network Infrastructure: Number of physical, logistical, and human-resource-related
components, such as wiring, routers, switches, firewalls, load balancers, etc.
o Support: Skilled professionals for installation, maintenance, and support.
o Bandwidth: Suitable amount of bandwidth for peak load.
o Facilities: Other infrastructure components, including physical equipment and power
resources.

Therefore, Google Cloud Platform is a viable option for businesses, especially when the businesses
require an extensive catalog of services with global recognition.

Benefits of Google Cloud Platform

Some of the main benefits of Google Cloud Platform are explained below:
Best Pricing: Google enables users to get Google Cloud hosting at the cheapest rates. The hosting
plans are not only cheaper than other hosting platforms but also offer better features than others. GCP
provides a pay-as-you-go option to the users where users can pay separately only for the services and
resources they want to use.

Work from Anywhere: Once the account is configured on GCP, it can be accessed from anywhere.
That means that the user can use GCP across different devices from different places. It is possible
because Google provides web-based applications that allow users to have complete access to GCP.

Private Network: Google has its own network that enables users to have more control over GCP
functions. Due to this, users achieve smooth performance and increased efficiency over the network.

Scalable: Users are getting a more scalable platform over the private network. Because Google uses
fiber-optic cables to extend its network range, it is likely to have more scalability. Google is always
working to scale its network because there can be any amount of traffic at any time.

Security: There is a high number of security professionals working at Google. They always keep
trying to secure the network and protect the data stored on servers. Additionally, Google uses an
algorithm that encrypts all the data on the Cloud platform. This gives assurance to the users that their
data is completely safe and secure from unauthorized sources.

Redundant Backup: Google always keeps backup of user's data with built-in redundant backup
integration. In case a user has lost the stored data, it's not a big problem. Google always has a copy of
the users' data unless the data is deleted forcefully. This adds data integrity, reliability and durability
with GCP.

Key Features of Google Cloud Platform

The following are some key features of Google Cloud Platform:


o On-demand services: Automated environment with web-based tools. Therefore, no human
intervention is required to access the resources.
o Broad network access: The resources and the information can be accessed from anywhere.
o Resource pooling: On-demand availability of a shared pool of computing resources to the
users.
o Rapid elasticity: The availability of more resources whenever required.
o Measured service: Easy-to-pay feature enables users to pay only for consumed services.
Working of Google Cloud Platform

When a file is uploaded on the Google cloud, the unique metadata is inserted into a file. It helps identify the different files
automatically to the main file, also called a master file. GCP further updates all the downloaded files using metadata to main

Let's understand the working of GCP with a general example:

Suppose that MS Office is implemented on Cloud to enable several people to work together. The primary aim of using cl
plugin for the MS Office suite. This will allow several people to edit a document at the same time. The owner can assign acc

Once users are assigned as an editor, they can use and edit the document's cloud copy as desired. The combined, edited cop
document given to different users. However, any of the authorized users' changes will be visible on all the copies of docum
appropriate changes to keep.

Google Cloud Platform Services

Google provides a considerable number of services with several unique features. That is the reason why Google Cloud Platf
o Compute Services
o Networking
o Storage Services
o Big Data
o Security and Identity Management
o Management Tools
o Cloud AI
o IoT (Internet of Things)
Let's understand each of these services in details:

Compute Services

GCP offers a scalable range of computing services, such as:


o Google App Engine: It is a cloud computing platform that follows the concept of Platform-as-a-Service to deploy
most significant advantage of Google App Engine is its automatic scaling capability. This means that the App Engin
o Compute Engine: It is a cloud computing platform that follows the concept of Infrastructure-as-a-Service to run W
by Google search engine, YouTube and other Google services.
o Kubernetes Engines: This computing service is responsible for offering a platform for automatic deployment, sca
docker, etc.

Networking

GCP includes the following network services:


o VPC: VPC stands for Virtual Private Network. The primary function of VPC is to offer a private network with rout
o Cloud Load Balancing: As its name states, Cloud balancing is used to distribute workload across different co
minimizing the availability and maximizing the capability of the resources.
o Content Delivery Network: CDN is a geographically distributed network of proxy servers and their data center
availability of resources by equally distributing the related services to the end-users.

Storage Services

GCP has the following storage services:


o Google Cloud Storage: It is an online data storage web service that Google provides to its users to store and acces
sharing.
o Cloud SQL: It is a web-service that enables users to create, manage, and use relational databases stored on Google
operations.
o Cloud Bigtable: It is known for its fast performance and highly manageable feature. It is a highly scalable NoSQL

Big Data

GCP provides a variety of services related to big data; they are:


o BigQuery: It is a fully managed data analysis service by Google. The primary aim of Google BigQuery service is t
to perform ad-hoc queries and share data insights across the web.
o Google Cloud Datastore: Google Cloud Datastore is a kind of datastore service that is fully managed, schema-le
advantage of Google Cloud Datastore is the capability of automatic scaling. This means that the service can itself sc
o Google Cloud Dataproc: It is a very fast and easy to use big data service offered by Google. It mainly helps in ma
sized according to the overall workload and can be accessed whenever users want them.

Security and Identity Management

GCP includes the following services related to Security and Identity management:
o Cloud Data Loss Prevention API: It is mainly designed to manage sensitive data. It helps users manage sensitiv
sensitive data.
o Cloud IAM: It stands for Cloud Identity and Access Management. It is a framework that contains rules and policie
Management (IdM).

Management Tools

GCP includes the following services related to management tools:


o Google Stackdriver: Google Stackdriver service is primarily responsible for displaying the overall performance an
prompts an alert notification to the public cloud users.
o Google Cloud Console App: It is a native mobile application powered by Google. The primary aim of this service
The primary functions of this service are alerting, monitoring, and performing critical actions on resources.

Cloud AI

When it comes to Cloud AI, GCP offers these services:


o Cloud Machine Learning Engine: It is another fully managed service that allows users to create Machine Learning
o Cloud AutoML: It is the type of service that is based on Machine Learning. It helps users to enter their data sets
Neural Architecture Search method.

IoT (Internet of Things)

GCP contains the following IoT services:

Cloud IoT Core: It is one of the fully managed core services. It allows users to connect, control, and ingest data from vario
visualize IoT data in real-time.
Cloud IoT Edge: The Edge computing service brings memory and other computing-power resources near to the location w

Advantages of Google Cloud Platform

There are several advantages of using Google Cloud Platform, such as:
o Google Cloud Offers Quick and Easy Collaboration: Multiple users can access the data and simultaneously contr
o Higher Productivity with Continuous Development: Google is always working on adding new features and fu
services.
o Less Disruption with Adopting New Features: Instead of pushing huge disruptive updates of changes, Google pro
o Least or Minimal Data is stored on Vulnerable Devices: Google does not store data on local devices unless a use
o Users can access Google Cloud from Anywhere: The best thing is that a user can easily access the information sto
o Google provides Maximum Security with its Robust Structure: Google hires leading security professionals to pr
o Users have Full Control over their Data: Users gain full control over services and the data stored in Google Cloud
o Google provides Higher Uptime and Reliability: Google uses several resources to provide higher and reliable
secondary center without interruption visible to users.

Creating a Free Tier Account on GCP

To start using Google Cloud Platform, we are first required to create an account GCP. Here, we will create a free tier acc
credit to spend over the next 90 days after the date of account creation. Google offers all the core services of GCP with a fre

However, users must have a credit card to start a free tier account. Google asks for the credit card details to make sure tha
$300 free credit. The amount will only be charged when we will be upgrading our free account to a paid account manually.

Let's start with the steps of creating a free tier account on Google Cloud Platform:

Step 1: First, we are required to navigate to the following link: https://cloud.google.com/gcp/

Step 2: On the next screen, we need to click on 'Get started for free', as shown below:
Step 3: Next, we are required to login to the Google Account. We can use the 'create an account' button if we don't have an

Step 4: Once we have logged in, we will get to the following screen:

Here, we must select the Country, agree to the Terms of Service, and then click on the 'CONTINUE' button.

Step 5: On the next screen, we have to enter some necessary details such as name and address details. Also, we have to e
button 'START MY FREE TRIAL' from the bottom of the page:
Step 6: Google asks for the confirmation to use the credit card for the small deduction to ensure that the card information is

Step 7: On the next screen, we must click on the 'GO TO CONSOLE' button:
After clicking on the 'GO TO CONSOLE' button, we will be redirected to the Dashboard that includes a summary of GCP s

To be specific, a Dashboards of GCP displays the summarized view of the followings:


o Project Info: contains project details such as project name, ID, and number.
o Resources: contains a list of resources being used in the related project.
o APIs: contains various API requests running with the project (in request/sec form).
o Google Cloud Platform Status: displays an overall summary of services that are part of GCP.
o Monitoring: displays alerts, performance stats, Uptime, etc. to ensure that systems are running reliably.
o Error Reporting: displays errors occurring in the projects, but it needs to be configured first.
o Trace: displays latency data of existing applications across a distributed tracing system.
o Compute Engine: displays the insights of CPU usage in percentage (%).
o Tutorials: contains Getting Started guides (basic guides) to explain how the GCP features work.
o News: displays news and other important updates regarding Google Cloud Platform.
o Documentation: contains in-depth guides to teach more about Compute Engine, Cloud Storage, and App Engine.

Google Cloud Platform Pricing

When it comes to pricing, Google Cloud Platform is the cheapest solution in the market. GCP is not only low on price but al

When comparing GCP with other leading competitors, it has more benefits over them. Google provides its users a massive 6
o 15% rightsizing recommendation
o 21% list price differences
o 24% of sustained usage discounts

Some of the main benefits of GCP pricing are:

No Hidden Charges: There are no hidden charges behind the GCP pricing. Google's pricing structure is straightforward and

Pay-as-you-go: Google offers its customer 'use now, pay later' option. So, users will have to pay only for those services whi

No Termination Fee: Users are free to stop using Google services whenever they want, and there will not have to pay any t

Difference between Google Cloud Platform, AWS and Azure

Like Google cloud platform, AWS and Azure are the other popular cloud-based platforms. However, there are differences a

Google Cloud AWS Azure

It uses GCE AWS EC2 offers It uses virtual


(Google Compute core compute machines for
Engine) for services. computation
computing purposes.
purposes.

It uses Google It uses Amazon S3 It uses a storage


Cloud Storage for for storing the data. block bob that
storage purposes. comprises blocks for
storing the data.

It offers the AWS pricing is Like AWS, Azure


lowest price to the generally keen to pricing structure is
customers to beat have inscrutable. The also difficult to
other cloud overall structure of understand unless
providers. granular pricing is a you have
bit complex. considerable
experience.

It uses Cloud Test It uses a device farm It uses DevTest labs


labs for App for App Testing for App Testing
Testing purposes. purposes. purposes.

It uses Subnet as a It uses VPC as a It uses VNet as a


virtual network. virtual network. virtual Network.

It follows the It follows the Elastic It follows the Load-


Cloud Load Load Balancing Balancer Application
Balancing configuration. Gateway
configuration. configuration.

Job Opportunities with GCP

Having a piece of in-depth knowledge in the Google Cloud Platform is very useful as per job purposes. However, an expe
more effective but will also open a variety of job opportunities.

There are many job-opportunities with GCP. Some popular job-roles are listed below:
o Technical Lead Manager
o Sales Engineer
o Technical Solutions Engineer
o Account Executive
o Technical Program Manager
o Cloud Software Engineer
o Data Center Software Engineer
o Solutions Architect
o Strategic Customer Engineer

Prerequisite

There is no special prerequisite for this GCP Tutorial. All you need is continuous learning and practicing with the tools. Ho
software and tools will be beneficial and put you at an advantage. We have designed this tutorial to help you learn all the co

Audience

Our Google Cloud Platform Tutorial is designed to help beginners and professionals.

Problem

We assure you that you will not find any difficulty while learning through our Google Cloud Platform Tutorial. But if you fi
UNIT-5
IOT PROJECTS ON RASPBERRY PI
Learn IoT creating a sensor project with Raspberry Pi and sensors
IOT, RASPBERRY PI, TUTORIAL
Learn how to create a sensor project in this guest post by Peter Wahr, an IoT expert.
The development of a Raspberry Pi sensor project is broken down into six steps. Here’s a
simple overview:
1. Firstly, you will set up the basic structure of a console application.
2. Then, you will configure the hardware and learn to sample sensor values and maintain
a useful historical record.
3. After adding HTTP server capabilities and other useful web resources to the project,
you will publish the sensor values collected on the internet.
4. You will then handle the persistence of sampled data in the sensor, so it can resume
after outages or software updates.
5. The next step will teach you how to add a security layer requiring user authentication
to access sensitive information on top of the application.
6. In the last step, you will learn how to overcome one of the major obstacles in the
request/response pattern used by HTTP, that is, how to send events from the server to
the client.
This tutorial, however, will focus only on the first two steps; to know more, you can refer to
the book, Learning Internet of Things.
Preparing Raspberry Pi for sensor project
To configure Raspberry Pi, refer to http://www.raspberrypi.org/help/faqs/#buyingWhere.
In this tutorial, you will see the use of Raspberry Pi Model B with the following:
 An SD card with the Raspbian operating system installed
 A configured network access, including Wi-Fi, if used
 User accounts, passwords, access rights, time zones, and so on, all configured correctly
The sensor project will be developed on a remote PC using C#, as it’s a modern
programming language that allows complete flexibility with IoT. It also allows you to
interchange code between Windows, Linux, Macintosh, Android, and iOS platforms.
Once a project is compiled, executable files are deployed to the corresponding Raspberry Pi
and then executed. Since the code runs on .NET, any language out of a large number of CLI-
compatible languages can be used.
Tip
Development tools for C# can be downloaded for free from http://xamarin.com/.
To prepare Raspberry for the execution of the .NET code, you need to install Mono, which
contains the Common Language Runtime for .NET that will help you run the .NET code on
Raspberry. This can be done by executing the following commands in a terminal window in
Raspberry Pi:
[bash] $ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install mono-complete
[/bash]
Your device is now ready to run the .NET code.
Hardware: Sensor used in Raspberry Pi IoT project
The sensor prototype will measure three things: light, temperature, and motion. To
summarize, here is a brief description of the components:
 The light sensor is a simple ZX-LDR analog sensor that will connect to a four-channel
analog-to-digital converter (Digilent Pmod AD2). This is then connected to an I2C bus
that will connect to the standard GPIO pins for I2C. Note that The I2C bus permits
communication with multiple circuits using synchronous communication, employing a
Serial Clock Line (SCL) and Serial Data Line (SDA) pin. This is a common way to
communicate with integrated circuits.
 The temperature sensor (Texas Instruments TMP102) connects directly to the same I2C
bus.
 The SCL and SDA pins on the I2C bus use recommended pull-up resistors to ensure
they are in a high state when nobody actively pulls them down.
 The infrared motion detector (Parallax PIR sensor) is a digital input that can be
connected to GPIO 22.
 Four LEDs will also be added to the board. One of these is green and is connected to
GPIO 23. This will show when the application is running. The second one is yellow
and is connected to GPIO 24. This will show when measurements are done. The third
one is yellow and is connected to GPIO 18. This will show when an HTTP activity is
performed. The last one is red and is connected to GPIO 25. This will show when a
communication error occurs.
 The pins that control the LEDs are first connected to 160 Ω resistors before they are
connected to the LEDs, and then to ground. All the hardware of the prototype board is
powered by the 3.3 V source provided by Raspberry Pi. A 160 Ω resistor connected in
series between the pin and ground ensures that the LED emits a bright light.
Tip
For an introduction to GPIO on Raspberry Pi, please refer
to http://www.raspberrypi.org/documentation/usage/gpio/.
Two guides on GPIO pins can be found at http://elinux.org/RPi_Low-level_peripherals.
For more information, refer to http://pi.gadgetoid.com/pinout.
The following figure shows a circuit diagram of the prototype board:

Interacting with the hardware


Interaction with the hardware is done using corresponding classes defined in
the Clayster.Library.RaspberryPi library. For instance, digital output is handled using
the DigitalOutput class and digital input with the DigitalInput class. Devices connected to an
I2C bus are handled using the I2C class. There are also other generic classes, such
as ParallelDigitalInput and ParallelDigitalOutput, which handle a series of digital input and
output at once.
The SoftwarePwm class handles a software-controlled pulse-width modulation output.
The Uart class handles communication using the UART port available on Raspberry Pi.
There’s also a subnamespace called Devices where device-specific classes are available.
In the end, all classes communicate with the static GPIO class, which is used to interact with
the GPIO layer in Raspberry Pi.
Each class has a constructor that initializes the corresponding hardware resource, methods
and properties to interact with the resource, and a Dispose method that releases the resource.
Tip
It is important that you release the hardware resources allocated before you terminate the
application. Since hardware resources are not controlled by the operating system, the fact that
the application is terminated is not sufficient to release the resources. For this reason, make
sure you call the Dispose methods of all the allocated hardware resources before you leave
the application. Preferably, this should be done in the final statement of a try-finally block.
Interfacing the hardware
The hardware interfaces to be used for the LEDs are as follows:
[csharp] private static DigitalOutput executionLed = new DigitalOutput (23, true);
private static DigitalOutput measurementLed = new DigitalOutput (24, false);
private static DigitalOutput errorLed = new DigitalOutput (25, false);
private static DigitalOutput networkLed = new DigitalOutput (18, false);
[/csharp]
Use a D igitalInput class for the motion detector:
[csharp] private static DigitalInput motion = new DigitalInput (22);[/csharp]
With the temperature sensor on the I2C bus, which limits the serial clock frequency to a
maximum of 400 kHz, interface it as follows:
[csharp] private static I2C i2cBus = new I2C (3, 2, 400000);
private static TexasInstrumentsTMP102 tmp102 =
new TexasInstrumentsTMP102 (0, i2cBus);[/csharp]
We interact with the light sensor using an analog-to-digital converter as follows:
[csharp] private static AD799x adc =
new AD799x (0, true, false, false, false, i2cBus);[/csharp]
Internal representation of sensor values
The sensor data values will be represented by the following set of variables:
[csharp] private static bool motionDetected = false;
private static double temperatureC;
private static double lightPercent;
private static object synchObject = new object ();
[/csharp]
Historical values will also be kept so that trends can be analyzed:
[csharp] private static List<Record> perSecond = new List<Record> ();
private static List<Record> perMinute = new List<Record> ();
private static List<Record> perHour = new List<Record> ();
private static List<Record> perDay = new List<Record> ();
private static List<Record> perMonth = new List<Record> ();
[/csharp]
Persisting data
Persisting data is simple. This is done using an object database. This object database
analyzes the class definition of objects to persist and dynamically creates the database
schema to accommodate the objects you want to store. The object database is defined in
the Clayster.Library.Data library . You first need a reference to the object database,
which is as follows:
[csharp]internal static ObjectDatabase db;[/csharp]
Then, you need to provide information on how to connect to the underlying database. This
can be done in the .config file of the application or the code itself. Specify a SQLite database
and provide the necessary parameters in the code during the startup:
[csharp] DB.BackupConnectionString = “Data Source=sensor.db;Version=3;”;
DB.BackupProviderName = “Clayster.Library.Data.Providers.”
+ “SQLiteServer.SQLiteServerProvider”;
[/csharp]
Finally, you will get a proxy object for the object database. This object can be used to store,
update, delete, and search for objects in your database:
[csharp] db = DB.GetDatabaseProxy (“TheSensor”);
[/csharp]
After doing this, the sensor won’t lose data if Raspberry Pi is restarted.
External representation of sensor values
To facilitate the interchange of sensor data between devices, you’ll need an interoperable
sensor data format based on XML, provided in the Clayster.Library.IoT library. Here,
the sensor data consists of a collection of nodes that report data ordered according to the
timestamp.
For each timestamp, a collection of fields is reported. There are different types of fields
available: numerical, string, date and time, timespan, Boolean, and enumeration-valued
fields. Each field has a field name, field value of the corresponding type, an optional readout
type, a field status, Quality of Service value, and localization information.
The Clayster.Library.IoT.Sens orData namespace helps you export sensor data
information by providing an abstract interface called ISensorDataExport. The same logic can
later be used to export to different sensor data formats. The library also provides a class
named ReadoutRequest that provides information about what type of data is desired. You can
use this to tailor the data export to the desires of the requestor.
Exporting sensor data
The export starts by calling the Start() method on the sensor data export module and ends
with a call to the End() method. Between these two, a sequence
of S tartNode() and EndN ode() calls are made, one for each node to export.
To simplify the export, you can call another function to output data from an array
of Record objects that contain the data. Use the same method to export the momentary values
by creating a temporary Record object that would contain them:
[csharp] private static void ExportSensorData (ISensorDataExport Output,
ReadoutRequest Request)
{
Output.Start ();
lock (synchObject)
{
Output.StartNode (“Sensor”);
Export (Output, new Record[] {
new Record (DateTime.Now, temperatureC, lightPercent, motionDetected)
},ReadoutType.MomentaryValues, Request);
Export (Output, perSecond, ReadoutType.HistoricalValuesSecond, Request);
Export (Output, perMinute, ReadoutType.HistoricalValuesMinute, Request);
Export (Output, perHour, ReadoutType.HistoricalValuesHour, Request);
Export (Output, perDay, ReadoutType.HistoricalValuesDay, Request);
Export (Output, perMonth, ReadoutType.HistoricalValuesMonth, Request);
Output.EndNode ();
}
Output.End ();
}
[/csharp]
Note that you need to check whether the corresponding readout type is desired by the client
before you export data of this type.
Learn More:
How to use OpenCV with Raspberry Pi
Raspberry Pi IoT: Sensors, InfluxDB, MQTT and Grafana
The Export method exports an enumeration of Record objects. It first checks whether the
corresponding readout type is desired by the client before exporting data of this type. The
method also checks whether the data is within the requested time interval and that the fields
are of interest to the client.
If a data field passes all these tests, it is exported by calling any of the instances of the
overloaded method ExportField(), available on the sensor data export object. Fields are
exported between the S tartTimes tamp() and EndTimestamp() method calls, defining
the timestamp that corresponds to the fields being exported:
[csharp] private static void Export(ISensorDataExport Output, IEnumerable History,
ReadoutType Type,ReadoutRequest Request)
{
if((Request.Types & Type) != 0)
{
foreach(Record Rec in History)
{
if(!Request.ReportTimestamp (Rec.Timestamp))
continue;
Output.StartTimestamp(Rec.Timestamp);
if (Request.ReportField(“Temperature”))
Output.ExportField(“Temperature”,Rec.TemperatureC, 1,”C”, Type);
if(Request.ReportField(“Light”))
Output.ExportField(“Light”,Rec.LightPercent, 1, “%”, Type);
if(Request.ReportField (“Motion”))
Output.ExportField(“Motion”,Rec.Motion, Type);
Output.EndTimestamp();
}
}
}
[/csharp]
You can test the method by exporting some sensor data to XML using
the SensorDataXmlExport class. It implements the ISensorDataExport interface. The result
would look something like this if you export only momentary and historic day values:
[xml] <?xml version=”1.0″?>
<fields xmlns=”urn:xmpp:iot:sensordata”>
<node nodeId=”Sensor”>
<timestamp value=”2014-07-25T12:29:32Z”>
<numeric value=”19.2″ unit=”C” automaticReadout=”true” momentary=”true”
name=”Temperature”/>
<numeric value=”48.5″ unit=”%” automaticReadout=”true” momentary=”true”
name=”Light”/>
<boolean value=”true” automaticReadout=”true” momentary=”true” name=”Motion”/>
</timestamp>
<timestamp value=”2014-07-25T04:00:00Z”>
<numeric value=”20.6″ unit=”C” automaticReadout=”true” name=”Temperature”
historicalDay=”true”/>
<numeric value=”13.0″ unit=”%” automaticReadout=”true” name=”Light”
historicalDay=”true”/>
<boolean value=”true” automaticReadout=”true” name=”Motion” historicalDay=”true”/>
</timestamp>

</node>
</fields>
[/xml]
If you enjoyed reading this tutorial and want to explore Internet of Things in detail, you can
explore the book, Learning Internet of Things by Peter Wahr. The book follows a hands-on
approach and demonstrates the building of several IoT projects, including actuators,
cameras, controllers, and more. If you’re an IoT enthusiast or a developer keen on learning
the fundamentals of IoT, this book is a must-have in your kitty.
Share TweetRedditSharePin it
UNIT-3

IOT PROTOCOLS AND TECHNOLOGY


6LOWPAN:

6LoWPAN stands for IPv6 over Low-power Wireless Personal Area Networks. It is a
standard protocol for realizing IPv6 communication on wireless networks composed of low-
power wireless modules. 6LoWPAN specification contains packet compression and other
optimization mechanisms to enable the efficient transmission of IPv6 packets on a network
with limited power resources and reliability, which makes efficient IPv6 communication over
low-power wireless networks possible.
Various low-power wireless networks have been proposed and implemented before
6LoWPAN, but currently, 6LoWPAN is regarded as one of the preferred protocols to realize
the Internet of Things (IoT). This is because 6LoWPAN communication based on IPv6
allows once closed low-power wireless networks to interface with the global network, the
Internet, and implement more advanced intelligent services that were not possible in the past.
Let us take the future smart house architecture that UC Technology aims to realize, for
example (the figure below).
Optimized control of a smart house requires the information to be collected from various
sensors. The control system consolidates the information to recognize the real-world context
then gives appropriate optimized feedback to the real-world environment using actuators.
Management of a smart house by executing control logic on the reliable cloud server
infrastructure is cost-effective from the viewpoint of high scalability, usability, and low
maintenance cost. To realize such a control framework, 6LoWPAN‘s conformance to the
Internet protocol plays an important role.
Currently, 6LoWPAN is published as a series of standard specifications, including RFC6282.
Related specifications also have been discussed actively and are being standardized one by
one.
UC Technology provides development tools including 6LoWPAN.
For more information, please visit “6LoWPAN Development Tool” and “IoT-Engine
Development Kit.”

Usage of 6LoWPAN for Smart House


Based on the status of IoT devices inside the house, a virtual house reflecting the real house
environment will be created on the cloud.
Using the status of the virtual house, the IoT application framework will control the
equipment inside the real house.
The status of the virtual house can be monitored from smartphones, etc.

3.3 The architecture of the CoAP

The CoAP is an application layer and web-based protocol designed for constrained devices
like sensors. Sensors have a small memory and limited processing power. The CoAP [12] is
similar to the HyperText Transport Protocol (HTTP) protocol. CoAP is used as the
Representative State Transfer (REST) architecture. CoAP is demonstrated with a layered
architecture in Fig. 10.

The transfer of data between two communicating devices is efficient and reliable in CoAP.
CoAP is used to move the data, which is collected by a sensor node, to the other networking
devices. The CoAP uses two sublayers called the Request/Response Layer and Messaging
Layer. CoAP can handle four kinds of messages: Confirmation (CON), Non-Confirmation
(NON), Acknowledgement (ACK), and Reset. The CON and ACA provide the exchange of
messages for reliable communication. The layered level architecture and a comparison of the
layered protocol stack and CoAP protocol stack are given in Fig. 10.

A Novel Cloud-Based IoT Architecture for Smart Building Automation


David Sembroiz, ... Davide Careglio, in Security and Resilience in Intelligent Data-Centric
Systems and Communication Networks, 2018

2.2.2 Constrained application protocol (CoAP)


The Constrained Application Protocol (CoAP) is defined as a specialized web transfer
protocol for use with constrained nodes and constrained networks in the Internet of
Things (CoAP, 2014). As it can be extracted from the definition, this protocol is specifically
tailored for the IoT and M2M applications. The major standardization of this protocol has
been carried out by the IETF Constrained RESTful environments (CoRe) Working Group and
the core is specified in Shelby et al. (2014). This application layer protocol can be seen as an
enhancement of HTTP for low power devices. It is based on the successful REST model, in
which resources are available under a URL and clients can access those resources using the
GET, PUT, POST and DELETE methods. Additionally, CoAP also supports publish-
subscribe thanks to the usage of an extended GET method.
Even though it shares similarities with HTTP, CoAP is specifically designed to run over UDP
only. As UDP is inherently not reliable, CoAP defines two types of messages,
namely confirmable messages and nonconfirmable messages to define its own reliability
mechanism. The former requires an acknowledgment similar to the ACK used in TCP
communications while the latter does not require any kind of acknowledgment.

You might also like