0% found this document useful (0 votes)
5 views115 pages

IoT unit 3 vips

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 115

Introduction to Internet of Things

(AIML309)
Course Overview:

• This course is foundation course around the Internet of Things (IoT). It overviews about the
technology used to build these kinds of devices, how they communicate, how they store
data, and the kinds of distributed systems needed to support them. Divided into four
modules, the first unit explores about theoretical concepts of IoT while second unit is
completely programming based to explore IoT sensors and actuators with Arduino. The rest
of the syllabus is application oriented based on learning. In general, through this course
students will be explored to the interconnection and integration of the physical world and
the cyber space. They will be able to design and develop IOT Devices

Course Objective:

• To learn fundamentals of IoT and how to build IoT based systems


• To emphasize on development of Industrial IoT applications
• To recognize the factors that contributed to the emergence of IoT
• To utilize and implement solid theoretical foundation of the IoT Platform and System Design.
Course Outcomes (CO):

•CO1: Ability to understand design flow of IoT based systems


•CO2: Analyse and understand different communication protocols
for connecting IoT nodes to server
•CO3: Apply coding concepts to design real-time IoT solutions
•CO4: Develop the state-of-the-art IoT based systems, suitable for
real life and Industry applications
Syllabus
Contents
• UNIT- I
The Internet of Things: An Overview of what is IoT? Why IoT? Explain the definition and
usage of the term "Internet of Things (IOT)" in different contexts. Design Principles for
Connected Devices, internet principles: internet communications-An overview, Physical
Design of IoT, Logical Design of IoT, IoT standards, IoT generic architecture and IoT
protocols. IoT future trends, Understand IoT Applications and Examples. Understand
various IoT architectures based on applications. Understand different classes of sensors
and actuators. Sensors: sensor terminology, sensor dynamics and specifications.
Understand the basics of hardware design needed to build useful circuits using basic
sensors and actuators
Syllabus
Contents
• UNIT- II
Communication protocols and Arduino Programming: Understand various network
protocols used in IoT, Understand various communication protocols (SPI, I2C, UART). Design
and develop Arduino code needed to communicate the microcontroller with sensors and
actuators, build circuits using IoT supported Hardware platforms such as Arduino, ESP8266
etc., Use of software libraries with an Arduino sketch that allows a programmer to use
complicated hardware without dealing with complexity, Learning IoT application
programming and build solutions for real life problems and test them in Arduino and Node
MCU environments. Understand various wireless Technologies for IoT and its range,
frequency and applications.
Syllabus
Contents
• UNIT- III
Fundamentals of IEEE 802.15.4, Zigbee and 6LOWPAN: Importance of IEEE 802.15.4 MAC
and IEEE 802.15.4 PHY layer in constrained networks and their header format, Importance
of Zigbee technology and its applications, use of IPv6 in IoT Environments, Understanding
importance of IPv6 and how constrained nodes deal with bigger headers (IPv6).
Understand IPv6 over Low Power WPAN (6LoWPAN) and role of 6LoWPAN in wireless
sensor network. Various routing techniques in constrained network. Understanding IoT
Application Layer Protocols: HTTP, CoAP Message Queuing Telemetry Transport (MeTT).
Syllabus
Contents
• UNIT- IV
Application areas and Real-time Case Studies: Role of big data, cloud computing and data
analytics in a typical IoT system. Analyze various case studies implementing IoT in real
world environment and find out the solutions of various deployment issues. Smart parking
system, Smart irrigation system-block diagram, sensors, modules on Arduino and Node
MCU
Syllabus
Contents
• UNIT- III
Fundamentals of IEEE 802.15.4, Zigbee and 6LOWPAN: Importance of IEEE 802.15.4 MAC
and IEEE 802.15.4 PHY layer in constrained networks and their header format, Importance
of Zigbee technology and its applications, use of IPv6 in IoT Environments, Understanding
importance of IPv6 and how constrained nodes deal with bigger headers (IPv6).
Understand IPv6 over Low Power WPAN (6LoWPAN) and role of 6LoWPAN in wireless
sensor network. Various routing techniques in constrained network. Understanding IoT
Application Layer Protocols: HTTP, CoAP Message Queuing Telemetry Transport (MeTT).
IEEE
802.15.4
● Describes working of low-rate wireless personal area networks (LR-WPANs)
● Developed for low-data rate monitoring and control applications and extended life low
power consumption uses.
● Developed to provide a framework for low cost, low power wireless connectivity networks
for devices that are operated or work on batteries.
● Low power is one of the key elements of 802.15.4 as it is used in many areas where remote
sensors need to operate on battery power, possibly for years without attention.
● Provides MAC and PHY layers, leaving upper layers to be developed for specific higher layer
standards like Thread, Zigbee, 6LoWPAN and many others.
● i.e., this standard uses only first two layers (PHY, MAC) plus the logical link control (LLC) and
service specific convergence sub-layer (SSCs) additions to communicate with all upper
layers.
● Operates in ISM band.
Network Layer

LLC

SSCS
IEEE 802.15.4
MAC

PHY
IEEE
802.15.4
● IEEE 802.15.4 provides communications over distances up to about 10 metres and
with maximum transfer data rates of 250 kbps.
● Uses direct sequence spread spectrum (DSSS) modulation

● Highly tolerant of noise and interference and offers link reliability


improvement mechanisms.
● Low-speed version use Binary Phase Shift Keying (BPSK).

● High data-rate versions use offset-quadrature phase-shift keying (O-QPSK).

● Uses carrier sense multiple access with collision avoidance (CSMA-CA)

● Multiplexing allows users or nodes interference-free access to the same channel at


different times.
IEEE
802.15.4
● Power consumption is minimized due to infrequently occurring very short
packet transmissions with low duty cycle.

● Minimum power level defined is 3dBm or 0.5mW

● Transmission for most cases, is Line of Sight (LOS)

● Standard transmission range varies between 10m to 75m

● Best case transmission range achieved outdoors can be upto 1000m

● Networking topologies defined are StaDr.raandl Mesh topology.


IEEE 802.15.4
•Physical
Supports Layer
an extensive number of PHY options ranging from 2.4 GHz to sub-
GHz frequencies in ISM bands.
• Original IEEE 802.15.4-2003 standard specified only three PHY options
based on direct sequence spread spectrum (DSSS) modulation.
• In, DSSS modulation signal is intentionally spread in frequency domain, resulting in
greater bandwidth.
• Original physical layer transmission options were as follows:
 2.4 GHz, 16 channels, with a data rate of 250 kbps

 915 MHz, 10 channels, with a data rate of 40 kbps


 868 MHz, 1 channel, with a data rate of 20 kbps
IEEE 802.15.4
• 2.4 GHz band operates worldwide.
Physical Layer
• 915 MHz band operates mainly in North and South America, and 868 MHz frequencies are
used in Europe, Middle East, and Africa.
• IEEE802.15.4-2006, 802.15.4-2011, and IEEE 802.15.4-2015 introduced following
PHY communication options:
 OQPSK PHY: DSSS PHY type, employes Offset Quadrature Phase-shift Keying (OQPSK)
modulation. OQPSK uses four unique bit values that are signaled by phase changes.
Offset function present during phase shifts allows data to be transmitted more reliably.
 BPSK PHY: DSSS PHY type, employing Binary Phase-shift Keying (BPSK) modulation. BPSK
specifies two unique phase shifts as its data encoding scheme.
 ASK PHY: Parallel sequence spread spectrum (PSSS) PHY type, employing Amplitude Shift
Keying (ASK) and BPSK modulation. PSSS is advanced encoding scheme offering
increased range, throughput, data rates, and signal integrity compared to DSSS. ASK uses
amplitude shifts instead of phase shiDfrt. Dsvyi taoAgaswr igalnal different bit values.
IEEE 802.15.4 variants for different forms
of physical layer
IEEE 802.15.4 VERSION DETAILS AND COMMENTS
IEEE 802.15.4 - 2003 1st version; provided for two different PHYs – one for lower frequency bands of 868 and
915 MHz, and other for 2.4 GHz.
IEEE 802.15.4 - 2006 Standard provided for an increase in data rate achievable on lower frequency bands.
Updated earlier version and defined four new modulation schemes that could be used -
three for lower frequency bands, and one for 2.4 GHz.
IEEE 802.15.4a This defined two new PHYs - One used UWB technology and the other provided for using
chirp spread spectrum at 2.4 GHz.
IEEE 802.15.4c Updates for 2.4 GHz, 868 MHz and 915 MHz, UWB and China 779-787 MHz band.
IEEE 802.15.4d 2.4 GHz, 868 MHz, 915 MHz and Japanese 950 - 956 MHz band.
IEEE 802.15.4e Defines MAC enhancements to IEEE 802.15.4 in support of ISA SP100.11a application.
IEEE 802.15.4f Define new PHYs for UWB, 2.4 GHz band and also 433 MHz
IEEE 802.15.4g Define new PHYs for smart neighbourhood networks. These include applications such as
smart grid applications for energy industry. Include 902 - 928 MHz band.
IEEE 802.15.4
Physical Layer
• These improvements increase maximum data rate for both 868 MHz and 915 MHz to
100 kbps and 250 kbps, respectively.
• 868MHzsupport was enhanced to 3 channels, while other IEEE 802.15.4
study groups produced addendums for new frequency bands.
• For example, IEEE 802.15.4c study group created bands 314–316 MHz, 430–434 MHz,
and 779–787 MHz for use in China.
IEEE 802.15.4 PHY
Format
● Synchronization header = Preamble + Start of Frame Delimiter fields.

● Preamble field is a 32-bit 4-byte (for parallel construction) pattern that


identifies start of frame and is used to synchronize data transmission.
IEEE 802.15.4 PHY
Format
● Start of Frame Delimiter field informs receiver that frame contents start immediately

after this byte.

● PHY Header = frame length value. It lets receiver know how much total data
to expect in PHY service data unit (PSDU) portion of 802.4.15 PHY.
● PSDU is data field or payload.
IEEE 802.15.4 MAC
Layer
● IEEE 802.15.4 MAC layer manages access to PHY channel by defining how devices in

same area will share frequencies allocated.


● At this layer, scheduling and routing of data frames are also coordinated.
● IEEE 802.15.4 MAC layer performs following tasks:
 Network beaconing for devices acting as coordinators (New devices use beacons

to join an 802.15.4 network)


 PAN association and disassociation by a device
 Device security

 Reliable link communications between two peer MAC entities


IEEE 802.15.4 MAC Frame
Format
● MAC layer performs tasks by using various predefined frame types.
● Types of MAC frames are:
 Data frame: Handles all transfers of data
 Beacon frame: Used in the transmission of beacons from a PAN coordinator
 Acknowledgement frame: Confirms the successful reception of a frame
 MAC command frame: Responsible for control communication between devices

● Each of these MAC frame types follows same frame format.


● MAC frame is carried as PHY payload and is broken down into MAC Header, MAC

Payload, and MAC Footer fields


IEEE 802.15.4 MAC Frame
Format
IEEE 802.15.4 MAC Frame
Format
● MAC Header field is composed of Frame Control, Sequence Number and Addressing

fields.
● Frame Control defines attributes such as frame type, addressing modes, and other

control flags.
● Sequence Number indicates sequence identifier for frame.

● Addressing field specifies Source and Destination PAN Identifier fields as well
as Source and Destination Address fields.
IEEE 802.15.4 MAC Frame
Format
● MAC Payload field varies by individual frame type.
● For example, beacon frames have specific fields and payloads related to beacons, while
MAC command frames have different fields present.
● MAC Footer field is like a frame check sequence (FCS). FCS is a calculation based on data
in frame that is used by receiving side to confirm integrity of data in frame.
● IEEE 802.15.4 requires all devices to support a unique 64-bit extended MAC address,
based on EUI-64.
● However, because maximum payload is 127 bytes, 802.15.4 also defines how a 16-bit
“short address” is assigned to devices.
● This short address is local to PAN and substantially reduces frame overhead compared
to a 64-bit extended MAC address.
IEEE 802.15.4 Types of networks
and devices
Networks PAN coordinator

FFD Router
Non-Beacon
Enabled 802.15.4 Device

Beacon RFD Device


Enabled
IEEE 802.15.4
Devices
1. Full Function Device (FFD) 2. Reduced Function Device (RFD)
● Can talk to all types of devices ● RFDs can only talk to FFDs as they contain
● Supports full protocol no routing functionality.

● Can be used for sending and ● Low power devices as they do not need to
receiving data, but it can also route other traffic and can be put into a
route data from other nodes. sleep mode when not in use

● Coordinator is a special FFD to ● Minimal CPU/RAM required


controls IEEE 802.15.4 network. It
● Often known as child devices as they need
also sets IEEE 802.15.4 network
up and acts as coordinator or other parent devices to communicate
manager of network
Beacon Enabled
Networks
• Periodic transmission of beacon messages

• Data -frames sent via Slotted CSMA/CA with a super frame structure managed by
PAN coordinator

• Beacons used for synchronization & association of other nodes with


the coordinator

• Scope of operation spans the whole network.


Non-Beacon Enabled
Networks
• Data-frames sent via un-slotted CSMA/CA (Contention Based)

• Beacons used only for link layer discovery

• Requires both source and destination IDs.

• As 802.15.4 is primarily, a mesh protocol, all protocol addressing must adhere to


mesh configurations

• De-centralized communication amongst nodes


Topolo
•gy
IEEE 802.15.4–based networks can be built star, peer-to-peer, or
mesh
as topologies. Mesh networks tie together many
nodes.
• Every 802.15.4 PAN should be
set up with a unique ID and all
nodes within same 802.15.4
network should use same PAN
ID.
Securi
• IEEE 802.15.4 uses Advanced Encryption Standard (AES) with a 128-bit key length as base
tyencryption algorithm for securing its data.
• Established by US National Institute of Standards and Technology in 2001, AES is a block
cipher, which means it operates on fixed-size blocks of data.
• AES widespread adoption in private sector has helped it become one of most popular
algorithms used in symmetric key cryptography for encrypting data.
• AES in 802.15.4 validates sent data, accomplished by message integrity code (MIC), which
is calculated for entire frame using same AES key that is used for encryption.
• Enabling these security features for 802.15.4 changes frame format slightly and consumes
some of payload.
• Using Security Enabled field in Frame Control portion of 802.15.4 header is first step to
enabling AES encryption.
• This field is a single bit that is set to 1 for security. Once this bit is set, a field called
Auxiliary Security Header is created after Source Address field, by stealing some bytes
from Payload field.
Frame format with Auxiliary
Security Header Field for
802.15.4-2006

Figure shows IEEE 802.15.4 frame format at a high level, with Security Enabled bit
set and Auxiliary Security Header field present.
IEEE 802.15.4
•Summary
IEEE 802.15.4 wireless PHY and MAC layers are specifications that are foundation
for various industry standards and products

• PHY layer offers a maximum speed of up to 250 kbps, which varies


based on modulation and frequency.

• MAC layer for 802.15.4 is robust and handles how data is transmitted and received
over PHY layer.

• MAC layer handles association and disassociation of devices to/from a PAN, reliable
communications between devices, security, and formation of various topologies.
IEEE 802.15.4
•Summary
Topologies used in 802.15.4 include star, peer-to-peer, and cluster trees that allow
for formation of mesh networks.

• IEEE 802.15.4 utilizes AES encryption to allow secure communications and


also provide data integrity.

• Competitor to IEEE 802.15.4 is DASH7, another wireless technology that compares


favorably.

• For IoT sensor deployments requiring low power, low data rate, and low complexity,
the IEEE 802.15.4 standard deserves strong consideration.
What is
•ZigBee?
Wireless technology standard that provides a set of communication protocols for
short-range communications.
• Open-source global standard developed by Zigbee Alliance to address needs of low-
cost, low power wireless IoT networks.
• Protocol is used in low data rate, short to medium range wireless
networking devices like senors and control networks.
• Provides flexibility for developers and end-users and delivers great interoperability.
• Low-cost, low-power consumption and having faster wireless connectivity, makes it
desirable for multiple applications.
ZigB
•ee
ZigBee is popular choice for smart homes as outstands other wireless technologies

 By providing two-way communication which makes it reliable.

 Catering to all sectors like lightings, security, appliances and home access.

 Requires very little power mainly due to its low latency and low duty cycle.

 Uses mesh network and thus reduce chances of failure at nodes.


ZigB
ee
• Offers a wireless range of 70m indoors and 400m outdoors.

• Supports multiple networks like point to point, point to multipoint mesh- networks.

• Uses AES 128 encryption thus protecting information while on air transfers.

• Easy installation and maintenance makes it more affordable.

• Name ZigBee is closely in relation with Bees as bees do ‘waggle dance’ to communicate
with each other when they return to their hives

• This zigzag dance is where ZigBee got its name.


ZigBee
Frequency
• Zigbee uses physical and MAC layers of IEEE 802.15.4 standard.

• Operates in an unlicensed 2.4 GHz ISM band.

• 2.4 GHz is pervasive worldwide, there are devices that use


frequency bands like 915 MHz, 868 MHz, and
784 MHz in USA, Europe, and China respectively.

• It transfers data at a rate of 250 kbps.


ZigBee vs
Wi-Fi

Wondering why ZigBee when you already have other


communication standards like Wi-Fi, Bluetooth?
ZigBee vs
Wi-Fi
S. No ZigBee Wi-Fi
1 Used for short-range communications or to Used for short as well as long range
establish PAN communications
2 Works on same band as Wi-Fi, specially built Works on same band as ZigBee
for control and sensor networks.
3 Used to monitor and control devices Not suitable for monitoring or controlling
devices
4 Based on IEEE 802.15.4 Dependent on IEEE 802.11 series
5 Uses WPAN Based on WLAN
6 Covers a range of 10-30meters. Covers a distance of 30-100 meters
7 Provides a data rate of 250 Kbps. Works at a rate of 54 Mbps.
8 Low power consumption rate and sustained Requires high power and high data rate
battery life of devices.
ZigBee vs
Bluetooth
S. No ZigBee Bluetooth
1 Uses a transmit power of only 100mW Used higher power compared to ZigBee
which makes it efficient in case of
power consumption
2 Designed to support hundreds of Supports a maximum of 7 devices.
devices
ZigBee vs
Bluetooth
Data Rate Typical Application
Range Examples
ZigBee 20-250 10-100 m Wireless Sensor
Kbps Networks
Bluetooth 1 to 3 2-10 m Wireless Headset
Wireless Mouse
Mbps
IEEE 802.11b 1 to 11 30 – 100 m Wireless Internet
(WiFi) Mbps Connection
System
1.Structure
ZigBee Coordinator (ZC): Network consists of at least one central unit. Most important
device as it coordinates and acts as a bridge of network. Device responsible for start of
network. Responsible for transmission and reception of data. Facilitates handling and storing
of information.
2. ZigBee Router (ZR): Intermediate unit. Allows data to pass through them to and fro to other
devices.
3. ZigBee End-Device (ZED): ZED interfaces to a sensor and executes control operation. End
device contains just enough functionality to talk to either coordinator or router. This causes
node to stay asleep for a long time thereby increasing battery life to a great extent. ZED
device requires less energy as comparedDt.roDvi ZyaCAgaorwral ZR.
Topolog
ies
• Number of coordinators, routers, devices in network depends on topology used.
1. Star network consists of a coordinator and many end devices. These devices are
connected to coordinator but isolated from each other.
2. Cluster Tree topology: end devices connect coordinator via Router.
3. Mesh networks: Nodes are interconnected with other nodes so that there exist
multiple pathways connecting each node. Connection between nodes is updated
using built-in routing methodologies. Thus, it provides good stability in changing
conditions or failure at any node.
Topolog
ies
ZigBee
•Architecture
Four layers in ZigBee network architecture.
• Physical and MAC layers of ZigBee are as defined in IEEE 802.15.4 and other two layers
belong to Zigbee specification.
1. Physical layer performs modulation and demodulation to signals send and received.
2. MAC layer transfer data using CSMA/CA. MAC layer synchronizes communication
between devices.
3. Network layer is responsible for setting up a network, connecting to devices, routing
data, etc.
4. Application layer allows device to interface with a network layer for data
management
and communication between devices.
ZigBee
Architecture
Devices supporting ZigBee
protocol.
• Belkin WeMo • Security Systems from Bosch
• Samsung SmartThings • Comcast Xfinity Box from Samsung
• Yale smart locks • Hive Active Heating & accessories
• Philips Hue • Amazon Echo Plus
• Thermostats from Honeywell • Amazon Echo Show
• Ikea Tradfri
ZigBee
•Applications
Building Automation
• Remote control for consumer electronics
• Smart energy for home energy monitoring
• Health care for medical and fitness monitoring
• Home automation for control of smart homes
• Light link for control of LED lighting
• Telecom services
• Inventory Management
• Asset tracking
• Personnel Tracking
• Controlling access to restricted areas
• ID badging
• Supply chain management
• Counterfeit prevention
IoT resulting in Address
Crunch
• Estimated 20-50 billion devices by 2018
• Reason: Integration of existing devices, smart devices as well as
constrained nodes in a singular framework
• Integration of various connectivity features such as cellular, Wi-Fi,
ethernet, Bluetooth low energy (BLE), DASH7, Insteon, IEEE 802.15.4, etc.
• ITUvision is approaching reality as present day networked devices
have outnumbered humans on earth
Connectivity
Terminologies• Local, Short Range Communication, May or may not connect to Internet,
IoT LAN Building or Organization

• Connection of various network segments, Organizationally and


IoT WAN geographically wide, connects to internet

• Connected to other nodes inside LAN via IoT LAN; May be sometimes
IoT Node connected to internet through WAN directly

• A router connecting IoT LAN to WAN to internet; can implement several


IoT Gateway LAN and WAN; forwards packets between LAN and WAN on IP layer

• Performs active application layer functions between IoT nodes and


IoT Proxy other entities
IoT Network
Configurations
IoT resulting in Address
Crunch
• Some of IoT network configurations restricted to local areas, analogous to normal LANs, WANs
and proxy are shown in previous figures.

• Nodes represented by green circles have L: Local Link Addresses or LU: Local Link addresses which
are Unique locally.

• Nodes within gateway’s jurisdiction have addresses that are valid within gateway’s domain only.

• Same addresses may be repeated in domain of another gateway. Gateway has unique network
prefix, which can be used to identify them globally.

• Strategy saves lot of unnecessary address wastage. Although, nodes have to communicate to
the
internet via the gateway
Strategies of Address
Conservation
• Use local addresses which exist
uniquely within domain of gateway.
• Represented by circles here.
• Network connected to internet has routers
with their set of addresses and ranges.
• These routers have gateway
multiple connected to s
them from
packets which can to Internet, only
nodes, forwar
via
these routers. d
• These routers assign prefixes to gateways
under them, so that gateways can be
identified with them
Impact of Mobility on
Addressing Has global
view of
• This type of addressing helps to
network problem of mobility.
solve
underneath • How?
• When a particular Node changes its position
from a particular network to another network
then prefix also changes from 1 to 2, making
IoT LAN safe from changes due to mobility.
• IoT Gateway WAN takes care of
changes without change in LAN address.
address
• Within LAN, address remains same, but with
help of assignment of this unique prefix, WAN
address changes
• This is achieved using ULA.
Impact of Mobility on
• Gateways assigned with prefixes, which are
Addressing Has global
view of attached to a remote anchor point by using
network
underneath
various protocols such as Mobile IPv6, are
immune to changes of network prefixes.
• Achieved using LU.
• Address of nodes within gateways remain
unchanged as they provide them with unique
local address and change in gateway’s
network prefix doesn’t affect them.
• Tunnelling helps nodes to communicate
directly to internet, i.e, nodes communicate
to remote anchor point instead of channelling
their packets through router which is
achieved by using tunnelling protocols such
as IKEv2:internet key exchange version 2
IP Version 4
Protocol
• Packets in IPv4 layer
are called datagrams
• Datagram is a variable-
length packet
consisting of two parts:
header and data.
• Header is 20 to 60
bytes in length and
contains information
essential to routing and
delivery.
• Customary in TCP/IP to
show header in 4-byte
sections.
IP Version 4 Protocol
-•VER
4-bit field defines
version of IPv4 protocol
• Version 4 dominates
Internet today
• VER tells IPv4 software
running in processing
machine that datagram
has format of version
4.
• Including version at
start of each datagram,
makes possible
transition between
versions over a long
period of time.
IP Version 4 Protocol -
HLEN
• Header length (HLEN).
• 4-bit field defines total
length of datagram header
in 4-byte words.
• Needed because length of
header is variable (between
20 and 60 bytes).
• When there are no options,
header length is 20 bytes,
and value of this field is 5 (5
x 4 = 20).
• When option field is at its
maximum size, value of this
field is 15 (15 x 4 = 60).
IP Version 4 Protocol -
Services
• IETF has changed
interpretation and name of
this 8-bit field.
• Previously called service
type, is now called
differentiated services
• First 3 bits are called
precedence bits.
• Next 4 bits are
called type
of service (TOS) bits
• Last bit is not used.
IP Version 4 Protocol -
Services
a. Precedence is a 3-bit
subfield ranging from 0 (000
in binary) to 7 (111 in binary).
• Defines priority of
datagram in issues such as
congestion.
• If router is congested and
needs to discard some
datagrams, lowest
precedence datagrams are
discarded first.
IP Version 4 Protocol -
Services
b. Type of Service (TOS) bits
is a 4-bit subfield with each
bit having a special meaning.
• Although bits can be either
0 or 1, but only 1 bit set at a
time.
TOS bits Description
• Bit patterns and their
interpretations are given in 0000 Normal (Default)
Table. 0001 Minimize Cost
• With only 1 bit set at a 0010 Maximize reliability
time, we can have five
0100 Maximize throughput
different types of services.
1000 Maximize delay
Default types of
service
• Application programs can request a
specific type of service.
• Defaults for some applications are
shown in table
• Activities requiring immediate
attention and response need
minimum delay.
• Activities that send bulk data require
maximum throughput.
• Management activities need
maximum reliability.
• Background activities need minimum
cost
Default types of
service
• First 6 bits denote codepoint subfield
• Last 2 bits are not used.
• Codepoint subfield is used in two ways.
A. When 3 rightmost bits are 0’s, 3 leftmost bits
are interpreted same as precedence bits in
service type interpretation. i.e., it is
compatible with old interpretation.
Values for Codepoints
B. When 3 rightmost bits are not all 0’s, 6 bits
Category Code Description
define 64 services based on priority
assignment by Internet or local authorities Point
• First category (numbers 0, 2,4, ... ,62) is assigned
by Internet authorities (IETF). 1 XXXXX0 Internet
• Second category (3, 7, 11, 15,… 63) assigned by 2 XXXX11 Local
local authorities (organizations). 3 XXXX01 Temporary or
• Third category (1, 5, 9, ,61) is temporary and experimental
canused for experimental purposes.
be
IPv
6
•IPv4 provides host-to-host communication between systems in Internet.
• IPv4 is well designed, data communication has evolved since inception of IPv4 in 1970s.
• IPv4 has some deficiencies that make it unsuitable for the fast-growing Internet.
 Despite all short-term solutions, such as subnetting, classless addressing, and NAT,
address depletion is still a long-term problem in Internet.
 Internet must accommodate real-time audio and video transmission which requires
minimum delay strategies and reservation of resources not provided in IPv4 design.
 No encryption or authentication is provided by IPv4.
• To overcome these deficiencies, IPv6 was proposed
• IPv6 was extensively modified to accommodate unforeseen growth of Internet.
• Format and length of IP address were changed along with packet format.
IPv6 Advantages
over
• LargerIPv4
address space: IPv6 address is 128 bits long while IPv4 is 32-bit long
• Better header format. In, IPv6 options are separated from base header and inserted, when
needed, between base header and upper-layer data. This simplifies and speeds up routing
process because most options do not need to be checked by routers.
• New options. IPv6 has new options to allow for additional functionalities.
• Allowance for extension. IPv6 is designed to allow extension of protocol if required by new
technologies or applications.
• Support for resource allocation. In IPv6, type-of-service field has been removed, but a
mechanism (called jlow label) has been added to enable source to request special handling
of packet. This mechanism can be used to support traffic such as real-time audio and
video.
• Support for more security. Encryption and authentication options in IPv6 provide
confidentiality and integrity of packet.
IPv6
Structure
• IPv6 address consists of 16 bytes (octets); it is 128 bits long.
• To make addresses more readable, IPv6 specifies hexadecimal colon notation.
• In this , 128 bits is divided into eight sections, each 2 bytes in length.
• Two bytes in hexadecimal notation requires four hexadecimal digits.
• Thus, address consists of 32 hexadecimal digits, with every four digits separated by a colon
Abbreviated IPv6
addresses
• IP address, in hexadecimal format, is very long, many of its digits are zeros.
• Leading zeros of a section (four digits between two colons) can be omitted. Only leading zeros
can be dropped, not trailing zeros
IPv6 datagram header and
payload
IPv6 datagram header and
payload
Packet Format
• Each packet is composed of a mandatory base header followed by payload.
• Payload consists of two parts: optional extension headers and data from an upper
layer.
• Base header occupies 40 bytes, whereas extension headers and data from upper layer
contain up to 65,535 bytes of information.
IPv6 datagram header and
payload
Base Header
• Base header has eight fields.
Version: 4-bit field defines
version number of IP. For IPv6,
value is 6.
Priority: 4-bit field defines
priority of packet w.r.t. traffic
congestion.
Flow label: 3-byte (24-bit) field
designed to provide special
handling for a particular flow of
data.
Payload length: 2-byte field
defines length of IP datagram
excluding base header.
IPv6 datagram header and
payload
Base Header
Next header: 8-bit field defining
header that follows base
header in datagram. One of optional
extension headers used by IP or
header of an encapsulated packet
such as UDP or TCP. Each extension
header also contains this field. This
field in version 4 is called protocol.
 Hop limit: 8-bit field serves same
purpose as TIL field in IPv4.
Source address: 16-byte (128-bit)
Internet address that identifies
original source of datagram.
 Destination address: 16-byte
(128-
bit) Internetofaddress,
destination identifies
datagram.
Comparison of IPv4
and IPv6 IPv4
Properties IPv6
Addressing Provides 32-bit addresses Provides 128-bit addresses which results
in a significantly larger address space
Security Does not provide security Provides authentication, integrity, and
mechanisms, and requires confidentiality during communication of
additional security protocols data over a network with the
facilitated by network devices implementation of IPSec protocol suite

Protocol No such protocol enhancement Features Hierarchical Addressing, which


Enhancement process enables ISPs to allocate a subnet to an
organization
Routing Uses flat routing model which Uses hierarchical routing protocol, only
requires routers to store complete store routing information of networks
table of route identification which they are connected to
Comparison of IPv4
and IPv6
Properties IPv4 IPv6
Backward Special translation Special translation mechanisms like
Compatibility mechanisms like Dual Stack Dual Stack technology, Tunneling, and
technology, Tunneling, and NAT can be used to enable
NAT can be used to enable communication among devices on both
communication among networks
devices on both networks

Ease of Require a separate address Do not require a separate address


Configuratio configuration protocol configuration protocol
n
Use of Ipv6 in IoT
Environments
• IoT has dramatically increased number of devices that need to be connected to Internet.
• Impossible to manage massive no. of devices with IPv4 addressing due to its limited address
space.
• IPv6 offers vast address space to support every device locally or globally.
1. Addressing: Ipv6 provides a much larger addressing space than IPv4, allowing IoT devices
to have a unique and globally routable address.
2. Scalability: Can accommodate an unbounded number of devices in an IoT environment
due to its vast address space.
3. Security: Provides additional security measures, such as IPSec, which encrypts and
authenticates data transferred between IoT devices.
4. Energy Efficiency: Routing Protocol for Low-Power and Lossy Networks (LLNs) allows for
creation of LLNs in which low-power wireless devices can communicate with minimum
energy expenditure.
Use of Ipv6 in IoT
5. Environments
Quality of Service: Provides better level of service delivery performance in IoT
environments. QoS functionality works by prioritizing and classifying data traffic to
ensure that more important data gets delivered with less delay, loss, and jitter.
6. Integration: Designed to work seamlessly with other modern network standards, such
as Wi-Fi and Bluetooth, making it easier for IoT devices to communicate with one
another.
7. Mobility: Allows for easy mobility of IoT devices across network with Mobile IPv6 for
applications such as vehicular communication.
• IPv6's significantly larger address space offers a significant opportunity for IoT, enabling
more devices, stronger security, and more efficient network management.
• IPv6 helps overcome the challenges of addressing, mobility, and power requirements
that are unique to IoT environments, making it an ideal choice for IoT networks
How constrained nodes deal with
bigger headers (IPv6).

• Larger headers in IPv6 can cause issues for constrained nodes.

• IPv6 addresses enable every device to have a unique and globally routable address,
reducing need for Network Address Translation (NAT).

• Constrained nodes are low-power, resource-constrained devices that operate with limited
memory, processing power, and battery life.

• These devices cannot operate using full feature set of IPv6


How constrained nodes deal with
bigger headers (IPv6).
• Constrained nodes deal with bigger headers by using IPv6 over Low-power Wireless
Personal Area Networks (6LoWPAN) protocol.

• 6LoWPAN protocol enables IPv6 communication between constrained nodes and internet
via wireless networks using smaller and more efficient IPv6 datagrams.

• 6LoWPAN protocol makes use of a header compression mechanism, which compresses


IPv6 headers to ensure they fit into limited payload space available in constrained nodes.

• 6LoWPAN protocol also utilizes fragmentation, which breaks up packets into smaller
fragments that can be transmitted more efficiently over network
What is
6LoWPAN
• Internet Engineering Task Force (IETF) formed 6LoWPAN Working Group in 2004 to design
an adaptation layer for IPv6 when running over 802.15.4 low-power and lossy networks
• This adaptation layer provides features such as : packet fragmentation and packet
reassembly, compression of header and Routing of data link layer
• 6 stands for letter 6 in IPv6
• 6LoWPAN is about use of IPv6 over WPAN.
• 6LoWPAN optimizes IPv6 packet transmission in low power lossy networks.
• Operates at two frequencies:
 2400 to 2483.5 MHz (worldwide)
 902 to 929 MHz (North America)
• Uses IEEE 802.15.4 standard in unslotted CSMA/CA MAC protocol mode
6LoWPAN
Features
• Allows IEEE 802.15.4 radios to carry 128 ‐bit addresses of IPv6.

• Header compression and address translation techniques allow IEEE 802.15.4 radios to
access Internet.

• IPv6 packets compressed and reformatted to fit IEEE 802.15.4 packet format.

• Allows for smallest devices with limited processing ability to transmit information
wirelessly using an IP.

• Allows low-power devices to connect to internet

• Uses include IoT, Smart grid, and M2MDr.aDipvyapAlgaircwaal tions.


Addressing in
6LoWPAN
• 64 ‐bit addresses: globally unique
Addressing
• 16 bit addresses: PAN specific; assigned by
PAN coordinator
64-bit • IPv6 multicast not supported by 802.15.4
Extended • IPv6 packets carried as link layer broadcast
frames
16-bit
6LowPAN Packet
Format
Header Type: Dispatch
Header

• Dispatch: Initiates communication


• 0,1: Identifier for Dispatch Type
• Dispatch:
6 bits
Ident
ifies
the
next
Header Type: Mesh Addressing
Header

• 1,0: ID for Mesh Addressing Header

• V: ‘0’ if originator is 64 ‐bit extended address, ‘1’ if 16‐bitaddress

• F: ‘0’ if destination is 64‐bit addr., ‘1’ if 16‐bit addr.

• Hops Left: decremented by each node before sending to next hop

• Originator address: 12 bits field for source location IP address

• Final Address: 12 bits field for destin a t i o n lo cation IP


D r. D i vy aA garw al
Header Type: Fragmentation
Header

(a) First Fragment

(b) Subsequent Fragment


6LoWPAN Routing
Considerations • Mesh routing within PAN space.
• Routing between IPv6 and PAN domain
• Routing protocols in use:
1. LOADng
2. RPL
• Routing optimization objectives include
Minimizing energy
Minimizing latency
Satisfying constraints (w.r.t node power,
bandwidth, etc.)
LOADng
Routing
• Derived from AODV (Ad hoc On-Demand Distance Vector Routing)and
extended for use in IoT.

• Basic operations of LOADng include:


Generation of Route Requests (RREQs) by a LOADng Router (originator) for discovering

route to destination,
 Forwarding such RREQs until they reach destination LOADng Router,

 Generation of Route Replies (RREPs) upon receipt of an RREQ by indicated destination,

and unicast hop‐by‐hop forwarding of these RREPs towards originator.


LOADng
Routing
• If route is detected to be broken, Route Error (RERR) message is returned to
originator of that data packet to inform originator about route breakage.
• Optimized flooding is supported, reducing overhead incurred by RREQ generation
and flooding.
• Only destination is permitted to respond to an RREQ.
• Intermediate LOADng Routers are explicitly prohibited from responding to RREQs,
even if they may have active routes to sought destination.
• RREQ/RREP messages generated by a given LOADng Router share a single unique,
monotonically increasing sequence number.
RPL
Routing
• Distance Vector IPv6 routing protocol for lossy and low power networks.

• Maintains routing topology using low rate beaconing.

• Beaconing rate increases on detecting inconsistencies (e.g. node/link in a


route is down).

• Routing information included in datagram itself.

• Proactive: Maintaining routing topology.

• Reactive: Resolving routing inconsistencies.


RPL
Routing
• RPL separates packet processing and forwarding from routing optimization
objective, which helps in Low power Lossy Networks (LLN).

• Supports message confidentiality and integrity.

• Supports Data‐Path Validation and Loop Detection

• RPL operations require bidirectional links.

• In some LLN scenarios, links may exhibit asymmetric properties.

• It is required that reachability of a router be verified before router can be


used
as a parent.
Role of 6LoWPAN in wireless sensor
network.
•Enables WSNs to have larger address space and improved security features.

• Enables WSNs to integrate with other IPv6-enabled networks, such as internet, which
can provide new opportunities for data collection, analysis, and visualization.

• Allows WSNs to transmit IPv6 packets over low-power wireless networks.

• Aids in header compression, fragmentation and reassembly, and mesh networking,

• Enable WSNs to efficiently and effectively communicate with each other and
with other networks.
Message Queue Telemetry
•Transport.
ISO standard (ISO/IEC PRF 20922).
• Publish‐subscriber‐based lightweight messaging protocol for use in conjunction with TCP/IP
protocol.
• Introduced by IBM in 1999 and standardized by OASIS in 2013.
• Designed to provide connectivity (mostly embedded) between applications and
middle‐wares on one side and networks and communications on the other side.
• Message broker controls publish‐subscribe messaging pattern.
• Topic to which client is subscribed is updated in form of messages and distributed by
message broker.
• Designed for:
1. Remote connections
2. Limited bandwidth
3. Small‐code footprint
Message Queue Telemetry
•Transport.
ISO standard (ISO/IEC PRF 20922).
• Publish‐subscriber‐based lightweight messaging protocol for use in conjunction with TCP/IP
protocol.
• Introduced by IBM in 1999 and standardized by OASIS in 2013.
• Designed to provide connectivity (mostly embedded) between applications and
middle‐wares on one side and networks and communications on the other side.
• Message broker controls publish‐subscribe messaging pattern.
• Topic to which client is subscribed is updated in form of messages and distributed by
message broker.
• Designed for:
1. Remote connections
2. Limited bandwidth
3. Small‐code footprint
MQTT
Components

• Lightweight sensors
Publishers
• Applications interested in sensor
Subscriber data

• Connect publishers and


s Brokers subscribers
• Classify sensor data into topics
MQTT
Components
Connect

Disconnect

Subscribe

Unsubscribe

Publish
MQTT
Communication
MQTT
•Communication
Protocol uses publish/subscribe architecture (HTTP uses a
request/response paradigm).
• Publish/subscribe is event‐driven and enables messages to be pushed to
clients.
• Central communication point is MQTT broker, which is in charge of
dispatching all messages between senders and rightful receivers.
• Each client that publishes a message to broker, includes a topic into message.
• Topic is routing information for broker.
• Topic is a simple string that can have more hierarchy levels, separated by slash.
• Sample topic for sending temperature data of living room could be
house/living‐room/temperature.
• Client (e.g. mobile device) can subscribe to exact topic or can use a wildcard.
MQTT
Communication
• Subscription to house/+/temperature would result in all messages sent to
previously mentioned topic house/living‐ room/temperature, as
well as any topic with an arbitrary value in place of living room, such as
house/kitchen/temperature.

• Plus sign is a single level wild card and only allows arbitrary values for one
hierarchy.

• If more than one level needs to be subscribed, such as, entire sub‐tree, there is
also a
multilevel wildcard (#).
Applicati
ons
• Facebook Messenger uses MQTT for online chat.

• Amazon Web Services use Amazon IoT with MQTT.

• Microsoft Azure IoT Hub uses MQTT as its main protocol for telemetry messages.

• EVRYTHNG IoT platform uses MQTT as an M2M protocol for millions of


connected products.

• Adafruit launched a free MQTT cloud service for IoT experimenters called
Adafruit IO.
Secure MQTT
•(SMQTT)
Extension of MQTT, uses encryption based on lightweight attribute based
encryption.
• Advantage: Broadcast Encryption Feature, in which one message is encrypted and
delivered to multiple other nodes [common in IoT applications]
• Algorithm consists of four main stages: setup, encryption, publish and
decryption.
• In setup phase, subscribers and publishers register themselves to broker and
get a master secret key according to their developer’s choice of key generation
algorithm.
• When data is published, it is encrypted and published by broker to be sent to
subscribers, which is finally decrypted at subscriber end having same master secret
key.
CoAP – Constrained Application Protocol
• Web transfer protocol for use with constrained nodes and networks.
• Designed for Machine to Machine (M2M) applications such as smart energy
and building automation.
• Based on Request‐Response model between end‐points
• Client‐Server interaction is asynchronous over a datagram oriented transport
protocol such as UDP
• CoAP is a session layer protocol designed by IETF Constrained RESTful Environment
(CoRE) working group to provide lightweight RESTful (HTTP) interface.
• Representational State Transfer (REST) is standard interface between HTTP client and
servers.
• Lightweight applications such as those in IoT, could result in significant overhead
and consumption by REST.
power
CoAP – Constrained Application Protocol
• CoAP is designed to enable low‐power sensors to use RESTful services while
meeting their power constraints.
• Built over UDP, instead of TCP (which is commonly used with HTTP) and has a
light mechanism to provide reliability.
• CoAP architecture is divided into two main sub‐layers:
1. Messaging 2. Request/response.
• Messaging sub‐layer is responsible for reliability and duplication of messages,
while
request/response sub‐layer is responsible for communication.
• CoAP
1. has four messaging modes:
Confirmable 2. Non‐confirmable
3. Piggyback 4. Separate
CoAP Position

Application

Request
CoAP
Messages

UDP
CoAP Message Types

Message Types‐CoAP
Confirmable

Non‐confirmable

Piggyback

Separate
CoAP Request-Response Model
CoAP Request-Response Model
• Confirmable and non‐confirmable modes represent reliable and
unreliable transmissions, respectively, while other modes are used for
request/response.

• Piggyback is used for client/server direct communication where server


sends its response directly after receiving message, i.e., within acknowledgment
message.

• Separate mode is used when server response comes in message separate


from acknowledgment, and may take some time to be sent by
server.
CoAP Request-Response Model
CoAP Features

• Reduced overheads and parsing complexity.

• URL and content‐type support.

• Support for discovery of resources provided by known CoAP services.

• Simple subscription for a resource, and resulting push notifications.

• Simple caching based on maximum message age.


XMPP – Extensible Messaging and Presence Protocol

• Communication protocol for message‐oriented middleware based on


XML (Extensible Markup Language).

• Real‐time exchange of structured data.

• Open standard protocol using a client‐server architecture.

• Model is decentralized, no central server is required.

• Provides for discovery of services residing locally or across network, and availability
information of these services.
XMPP – Extensible Messaging and Presence Protocol

• Well‐suited for cloud computing where virtual machines, networks, and firewalls
would present obstacles to alternative service discovery and presence‐based
solutions.
• Open means to support machine‐to‐machine or peer‐to‐peer communications
across a diverse set of networks.
• Decentralization – No central server; anyone can run their own XMPP server.
• Open standards – No royalties or granted permissions are required to implement
these specifications
• Security – Authentication, encryption, etc.
• Flexibility – Supports interoperability
XMPP – Extensible Messaging and Presence Protocol
Core XMPP Technologies
Core
• information about ore XMPP technologies for XML streaming

Jingle
• multimedia signalling for voice, video, file transfer

Multi‐ user Chat


• flexible, multi‐ party communication

PubSub
• alerts and notifications for data syndication

BOSH
• HTTP binding for XMPP
XMPP – Weaknesses

• Does not support QoS.

• Text based communications induces higher network overheads.

• Binary data must be first encoded to base64 before


transmission.
XMPP - Applications
• Publish‐subscribe systems • Gaming

• Signaling for VoIP • Internet of Things applications

• Video • Smart grid

• File transfer • Social networking services


Comparison of Application Layer
Protocols
Syllabus
Contents
• UNIT- III
Fundamentals of IEEE 802.15.4, Zigbee and 6LOWPAN: Importance of IEEE 802.15.4 MAC
and IEEE 802.15.4 PHY layer in constrained networks and their header format, Importance
of Zigbee technology and its applications, use of IPv6 in IoT Environments, Understanding
importance of IPv6 and how constrained nodes deal with bigger headers (IPv6).
Understand IPv6 over Low Power WPAN (6LoWPAN) and role of 6LoWPAN in wireless
sensor network. Various routing techniques in constrained network. Understanding IoT
Application Layer Protocols: HTTP, CoAP Message Queuing Telemetry Transport (MeTT).
Unit 3 – Completed

THANKS

You might also like