0% found this document useful (0 votes)
20 views51 pages

Unit - Iv

The document discusses various data link layer protocols used in the Internet of Things (IoT), including Bluetooth, Z-Wave, ZigBee, LoRaWAN, Wi-Fi, Bluetooth Low Energy, NB-IoT, and LoRa technology. Each protocol is described in terms of its properties, advantages, disadvantages, and applications, highlighting their roles in enabling communication for IoT devices. The document emphasizes the importance of wireless communication technologies in facilitating connectivity and efficiency in various industrial and consumer applications.

Uploaded by

SRIKANTH KETHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views51 pages

Unit - Iv

The document discusses various data link layer protocols used in the Internet of Things (IoT), including Bluetooth, Z-Wave, ZigBee, LoRaWAN, Wi-Fi, Bluetooth Low Energy, NB-IoT, and LoRa technology. Each protocol is described in terms of its properties, advantages, disadvantages, and applications, highlighting their roles in enabling communication for IoT devices. The document emphasizes the importance of wireless communication technologies in facilitating connectivity and efficiency in various industrial and consumer applications.

Uploaded by

SRIKANTH KETHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

[INTERNET OF THINGS]

UNIT – IV
DATA LINK LAYER OF IOT

The IoT Data Link communication protocol provides service to the Network
Layer. There are various protocols and standard technologies specified by the
different organization for data link protocols.

Bluetooth

Bluetooth is a short-range wireless communication network over a radio


frequency. Bluetooth is mostly integrated into smartphones and mobile devices.
The Bluetooth communication network works within 2.4 ISM band frequencies
with data rate up to 3Mbps.

There are three categories of Bluetooth technology:

1. Bluetooth Classic
2. Bluetooth Low Energy
3. Bluetooth Smart Ready

The features of Bluetooth 5.0 version is introduced as Bluetooth 5 which have


been developed entirely for the Internet of Things.

Properties of Bluetooth network

 Standard: Bluetooth 4.2


 Frequency: 2.4GHz
 Range: 50-150m
 Data transfer rates: 3Mbps

Advantages of Bluetooth network

 It is wireless.
 It is cheap.
 It is easy to install.
 It is free to use if the device is installed with it.

UNIT - IV 1
[INTERNET OF THINGS]

Disadvantages of Bluetooth network

 It is a short-range communication network.


 It connects only two devices at a time.

Bluetooth Low Energy

Bluetooth low energy (BLE) is a short-range communication network protocol


with PHY (physical layer) and MAC (Medium Access Control) layer. It is designed
for low-power devices which uses less data. BLE always remain in sleep mode
except when the connection between devices is initiated and data transmission
occurs, due to this it conserves power of the device. Bluetooth low energy
follows the master/slave architecture and offers two types of frames that are
adverting and data frames. Slave node sent the advertising frame to discover
one or more dedicated advertisement channels. Master nodes sense this
advertisement channels to find slaves and connect them.

Z-Wave

Z-Wave is a wireless communication protocol with the frequency of 900MHz.


The ranges of Z-Wave lies between 30 meters to 100 meters with the data
transfer rate of 100kbps so that it is suitable for small messages in IoT
applications for home automation. This communication protocol operates on
mesh network architecture with one and several secondary controllers.

UNIT - IV 2
[INTERNET OF THINGS]

Properties of Z-Wave protocol

 Standard: Z-Wave Alliance ZAD12837 / ITU-T G.9959


 Frequency: 908.42GHz
 Range: 30-100m
 Data transfer rate: 100kbps

Advantages of Z-Wave protocol

 Low power consumption


 Remote or local control
 Simple installation
 Interoperability

Application of Z-Wave protocol

 Smart product and IoT based application


 Energy saving
 Home security

ZigBee Smart Energy

ZigBee is a low power, low data rate wireless personal area network
communication protocol. It is mostly used in home automation and industrial
settings. Since ZigBee is a low power communication protocol, the IoT power
devices used with ZigBee technology. The ZigBee communication protocol is
based on the IEEE 802.15.4 standard operating at the 2.4GHz frequency. The
ZigBee protocol supports star, cluster or wireless mesh technology topology.

UNIT - IV 3
[INTERNET OF THINGS]

ZigBee uses the following devices in its network:

o Zigbee Coordinator
o Zigbee End Device
o Zigbee Router

Properties of ZigBee protocol

 Standard: ZigBee 3.0 based on IEEE802.15.4


 Frequency: 2.4GHz
 Range: 10-100m
 Data transfer rate: 250kbps

Advantages of ZigBee protocol

 Wireless
 Mesh networking
 Direct communication
 Low power consumption

Disadvantages of ZigBee protocol

 Costly
 Works with low speed within a small distance

UNIT - IV 4
[INTERNET OF THINGS]

Application of ZigBee protocol

 Commercial and residential control


 Personal and healthcare
 Home networking
 Industrial control and management
 Consumer electronics

LoRaWAN

LoRaWAN refers to Long Rage Wide Area Network which is a wide area
network protocol. It is an optimized low-power consumption protocol design to
support large-scale public networks with millions of low-power devices. A single
operator operates the LoRaWAN. The LoRaWAN network is a bi-directional
communication for IoT application with low cost, mobility, and security.

Properties of LoRaWAN protocol

 Standard: LoRaWAN
 Frequency: Various
 Range: 2-5km (urban environment), 15km (suburban environment)
 Data Rates: 0.3-50 kbps.

WIRELESS COMMUNICATION TECHNOLOGIES


Wireless communication technology transmits information over the air using
electromagnetic waves like IR (Infrared), RF (Radio Frequency), satellite, etc. For
example, GPS, Wi-Fi, satellite television, wireless computer parts, wireless
phones that include 3G and 4G networks, and Bluetooth.

In the current social and economic development situation, information


transmission has an important impact on social and economic development. In
recent years, the level of communication technology has been significantly
improved and rapidly promoted, and it has been deeply penetrated into the
industrial and civil fields.

Wireless communication technology has significant advantages in its


transmission speed and cost, including low price, flexibility, and rapid
transmission. The combination of many elements such as software, network,
UNIT - IV 5
[INTERNET OF THINGS]

microprocessor, cloud computing, and Internet of Things, makes it possible to


realize digital and intelligent transformation.

In large production scenarios, production application systems, equipment,


products, personnel, and other factors are involved, making stable, high-speed,
and easy-to-manage wireless networks an essential requirement.

Different wireless communication methods differ in terms of networking, power


consumption, communication distance, security, stability, etc.

Therefore, different networking methods have different application scenarios.


At present, the most common wireless communication technologies in industrial
IoT are Wi-Fi, Bluetooth, NB-IoT, and LoRa.

3 types of wireless communication technologies

Wi-Fi technology of the types of wireless communication technologies

Wi-Fi technology in the types of wireless communication technologies in the IoT


is a technology that allows devices with WIFI capabilities to connect to a wireless
local area network (WLAN), Wi-Fi full name Wireless Fidelity, also known
as 802.11 standards. Widely used in IoT use cases, it is designed mainly for
mobile devices to access LAN (Local Area Network), WAN (Wide Area Network),
and the Internet, with the mobile device playing the role of the client and the
server being the network-centric device (e.g., server, etc.).

(1) ADVANTAGES OF WI-FI TECHNOLOGY

Wide coverage:

The radius of Wi-Fi can reach about 300 feet or about 100 meters, and additional
antennas or hotspots can be set up to expand the coverage area.

Fast speed and high reliability:

The maximum bandwidth is 1Mbps during communication, and the bandwidth


can be adjusted to 5.5Mbps, 2Mbps, and 1Mbps in case of weak signal or
interference, and the automatic adjustment of bandwidth effectively
guarantees the stability and reliability of the network.

Network structure:

Support star topology structure networking.


UNIT - IV 6
[INTERNET OF THINGS]

(2) DISADVANTAGES OF WI-FI TECHNOLOGY

Large signal attenuation:

Compared to wired networks, wireless networks in its coverage area, its signal
will weaken with the increase of distance from the node, resulting in weaker
transmission speed, and wireless signals are easily obstructed by obscurants,
electromagnetic environment, and lightning weather, and wireless signals are
easily interfered by the same frequency radio waves.

Poor security:

Wi-Fi provides an encryption algorithm called WEP though, which encrypts the
data transmitted wirelessly between the network access point and the host
device to prevent illegal users from eavesdropping, attacking, and invading the
network.

Since Wi-Fi does not have the protection of the physical structure of the wired
network, and also unlike to access the wired network before you must first
connect to the network, if the network is not protected, as long as it is in the
signal coverage range, just through the wireless network card others can access
your network, occupy your bandwidth and cause your information leakage.

(3) THE APPLICATION OF WI-FI TECHNOLOGY

With the development and update of Wi-Fi technology, Wi-Fi is one of the most
important wireless communication technologies in IoT, from the first phase
driven by consumer-grade electronic terminals such as cell phones, tablets,
laptops, etc.

The second phase driven by IoT applications such as smart homes, smart cities,
smart manufacturing, Industry 4.0, and the third phase driven by a new
generation of high-speed rate applications such as virtual reality, ultra-high-
definition video applications driven, is focusing on penetrating IoT application
scenarios as the most widely used means of wireless networking.

Bluetooth technology of the types of wireless communication technologies

Bluetooth technology in the types of wireless communication technologies in


the IoT is a wireless transmission technology in close proximity, first created by
Ericsson in 1994, then as an alternative to RS232 data line connection, can
realize the data exchange between fixed devices, mobile devices in a short

UNIT - IV 7
[INTERNET OF THINGS]

distance, from the release of Bluetooth 1.0 in 1998 to now, has developed to
Bluetooth 5.0, in the data transmission speed, stability, security, exchange
protocol, power consumption performance and other aspects have been greatly
improved.

(1) The advantages of Bluetooth technology

Transmission mode:

Using circuit switching and packet switching technology, support asynchronous


data channel, three-way voice channel and asynchronous data and
simultaneous voice transmission channel, can transmit voice and data at the
same time.

Peer-to-peer connection:

The temporary peer-to-peer connections can be established, according to the


role of Bluetooth devices in the network, can be divided into master and slave.

Small size: Bluetooth modules are small and easy to integrate, and are usually
embedded directly into mobile devices.

Low power consumption:

Bluetooth devices in the communication connection state, there are four


working modes, active mode, breathing mode, hold mode, and hibernation
mode, according to the actual use of the four modes automatically switch.

(2) The disadvantages of Bluetooth technology

Transmission distance is short:

Bluetooth 5.0 theoretically can be in the distance range of about 100 meters
between the devices for short-distance connection, but the actual use of only
about 10 meters.

Poor anti-interference:

Because the Bluetooth transmission protocol and other 2.4G Bluetooth devices
are sharing this band of signals, it will lead to signal interference with each
other's situation.

UNIT - IV 8
[INTERNET OF THINGS]

(3) The application of BlueTooth technology

Bluetooth technology in the types of wireless communication technologies in


the IoT is a relatively large feature is to let the portable mobile communication
equipment fast networking, data transmission, and exchange, currently
commonly used in mobile terminals, wearable devices, smart homes, vehicle
networks, and other industries.

NB-IoT technology of the types of wireless communication technologies

NB-IoT (Narrow Band Internet of Things) technology in the types of wireless


communication technologies in the IoT is a narrow band IoT based on the
cellular network, which can be directly deployed in GSM network, UMTS
network, or LTE network to reduce deployment cost and achieve a smooth
upgrade.

It is an emerging technology in the field of IoT and the main standard for future
IoT construction, China is already in the scale commercialization stage.

It is also called Low Power Wide Area Network LPWA because it supports cellular
data connection of low-power devices in wide area networks.

(1) Advantages of NB-IoT technology

Strong connectivity:

NB-IoT can provide 50-100 times more access than existing wireless
technologies. Supports low latency sensitivity, low device power consumption,
and optimized network architecture.

Wide coverage:

NB-IoT can cover indoors and basements, which can not only meet the network
coverage demand in remote places, but also long-distance communication up to
10KM or more, and is also applicable to application scenarios such as factory,
garage, and manhole cover which have requirements for deep coverage.

Low power consumption:

NB-IoT focuses on small data volume and small rate applications, so the power
consumption of NB-IoT devices can be very small, and the equipment endurance

UNIT - IV 9
[INTERNET OF THINGS]

working time can be significantly increased from a few months in the past to
several years.

Low cost:

NB-IoT does not need to re-build the network, and RF and antennas are basically
reused. Low rate, low power consumption, and low bandwidth also bring low-
cost advantages to NB-IoT chips and modules.

(2) Disadvantages of NB-IoT technology

Small communication data:

Weak computing power; small transmission data volume; more difficult to


upgrade.

Complex deployment environment:

Many NB-IoT terminals are deployed in unsafe places such as outdoors, which
are easy to be stolen and controlled. When the terminal is out of control, it is
easy to cause leakage of user privacy and other information.

Difficult to upgrade:

NB-IoT terminals are widely deployed in large numbers and network


communication resources are not abundant, which makes it difficult to upgrade
NB-IoT terminals in time. The terminals that are not upgraded in time are a
security risk for the system.

The network and core network of NB-IoT access are open to a large number of
terminals, and the network layer is vulnerable to attacks from terminals and
wireless space, bringing the risk of invasion to the system.

(3) Application of NB-IoT technology

NB-IoT is an extension and expansion of the Internet, specifically, it combines


various information sensing devices with the Internet to realize the
interconnection of people, machines, and things at any time and any place.

Currently, NB-IoT has been widely used in smart homes, smart meters, smart
devices, smart cities, artificial intelligence, and other fields.

UNIT - IV 10
[INTERNET OF THINGS]

LoRa technology of the types of wireless communication technologies

LoRa (Long Range) wireless transmission technology in the types of wireless


communication technologies in the IoT is a low-power narrowband long-
distance communication technology based on spread spectrum technology
introduced by Semtech Corporation in the U.S.

LoRa uses linear FM spread spectrum modulation technology, which increases


communication distance and network efficiency while maintaining low power
consumption, and eliminates interference, i.e., using the same frequency to
send data at the same time without generating.

It can receive and process data from multiple nodes in parallel. In the same
power consumption conditions as other wireless communication methods to
spread farther distance, to achieve the unification of low power consumption
and long-distance, it is the same power consumption than the traditional
wireless radio frequency communication distance expanded 3-5 times.

(1) Advantages of LoRa technology

Long communication distance:

The communication distance in urban areas is 1KM-2KM, and the


communication distance in a suburban area is up to 15KM.

More connected nodes:

The number of 10,000 nodes can be added, and the network deployment
topology layout can be designed and deployed according to specific applications
and scenarios to form networks by themselves at low cost.

Low power consumption:

In the case of applications with low communication frequency and small data
volume, the battery can be used for 1~5 years.

(2) Disadvantages of LoRa technology

Low security:

The data transmission method is to send the field data to the base station first
and then back to the enterprise server, not to upload directly, and there is data
leakage in this process.
UNIT - IV 11
[INTERNET OF THINGS]

Poor latency:

The interference and blocking factors in the transmission path of WAN are not
controllable, and the link transmission has a delay, which easily leads to unstable
data reception.

(3) LoRa technology application

LoRa technology in the types of wireless communication technologies in the IoT


is being deployed worldwide, because its low power consumption, deep
coverage, easy deployment, and other advantages make it very suitable for IoT
applications requiring low power consumption, long-distance, a large number of
connections and location tracking, etc.

Currently, smart meter reading, smart parking, vehicle tracking, smart factory,
smart agriculture, smart industry, smart city, smart community, and other fields
are applied.

The development of wireless communication technologies in the future

Wireless communication technologies itself is a diversified market, and there is


no one technology that can solve all problems. Facing different wireless
communication technologies, enterprises should combine their own scenarios
to choose, and meet the needs to solve the pain points in order to play its
maximum value and bring real benefits to enterprises.

With the rise of new wireless communication technologies such as big data,
cloud services, intelligent manufacturing, high-end equipment, in order to
comply with the development trend of information technology, digitalization,
intelligence, wireless communication technologies in commercial, civil, and
industrial fields will be more widely used, and the future will also be more
reliable, flexible, stable and lower construction costs.

WIRED COMMUNICATION TECHNOLOGIES


The Internet of Things Refers to A Network of Devices Which Communicate With
Each Other Through the Internet Through Wires or Wirelessly. When Connected
with A Smartphone or Laptop, It Can Automate and Form a Network of All the
Connected Devices. So, This Makes Data Sharing and Data Access Simple and
Seamless. The Type of Network Chosen Depends on The Network Range,
Network Bandwidth, Power Usage, Intermittent Connectivity and Security.

UNIT - IV 12
[INTERNET OF THINGS]

Though The IoT System Mostly Utilises Wireless Communication Networks,


Sometimes Wired Networks Become Easier And Efficient. So, IoT Uses A Hybrid
Of Both Networks.

There Are Two Types Of Communication Protocols:- Wired Communication And


Wireless Communication.
So, We Shall Discuss The Wired Communication. Basically, Wired
Communication Is The Transfer Of Data From The Transmitter To The Receiver
Through A Wired Medium Like Ethernet, USB, Etc.

However, For IoT, Understanding Communication Protocols Is Very Important,


Why They Are, Why They Are Used And The Difference Between Different
Protocols. Wired Communication Protocols Are Simply A Set Of Rules That
Allows Us To Transmit Data Through A Physical Medium.

Therefore, The Syntax, Semantics, And Synchronization Of Communication And


Possible Error Recovery Methods Between Communication Systems Are Called
“Protocol”. Further, Each Protocol Has Its Own Use.

Communication Protocols Are Of Two Types: –


1. External System Protocols: - USB, UART/USART, RS-232, RS-485,
Ethernet.
2. Internal System Protocols: - I2C, SPI.
External System Protocols
External System Protocols Are Used To Communicate Between Two
Communicating Devices. For Example, Between A Laptop And Development
Boards. Hence Communication Is Through The Inter Bus System.

UNIT - IV 13
[INTERNET OF THINGS]

1. USB Protocols
USB Stands For Universal Serial Bus. Hence, It Is A Serial Communication
Protocol For Connecting Devices With USB Ports Like Gaming Consoles, Mobile
Phones, Set-Top Box, Etc. It Also Provides A Fast Master-Slave Interface
Supporting Up To 127 Devices With Up To 6 Tires.

A Pc Is Generally The Master Or Host And Each Of The Other Components Or


Devices Linked To It Are Called Slaves.

USB 1.X And 2.X Use Four Lines Ie. Vcc, Ground, D+ And D-. Data Is Though
Transferred In The Form Of Packets, Which Is Composed Of 8 Bits(1 Byte) With
LSB(Least Significant Bit) Transmitted First.

Pros: -
1. Simple And Fast.
2. Almost Acceptable Everywhere.
Cons: -
1. Requires Powerful Master-Slave Device.
2. Particular Drivers Are Required.
2. UART/USART Protocols
UART Stands For Universal Asynchronous Receiver Transmitter And USART Also
Means For Universal Synchronous Asynchronous Receiver Transmitter.

UART Converts Data Into Serial Data. Though, UARTs Communicate Directly By
Converting Data Into Serial Form And Transmits It Into The Receiving UART That
Converts Serial Data Into Parallel Data For The Receiving Device.

The Flow Of Data Is From The Tx Pin Of The Transmitting UART To The Rx Pin Of
The Receiving UART. Hence Only Two Wires Are Required. UART Is
Asynchronous And Hence Doesn’t Require A Clock For Synchronisation Whereas
USART Uses A Clock For Synchronisation In Case Of Synchronous
Communication. It Can Be Used In Asynchronous Communication Also. Hence,
It Is A Dual-Type Of Serial Communication.

UART Is Generally Used In Serial Ports Used With Personal Computers


Connected To Modems Use 8 Data Bits And Low Cost Embedded Systems.

UNIT - IV 14
[INTERNET OF THINGS]

Pros: -
1. No Clock Signal Required.
2. Only Requires Two Wires.
Cons: -
1. Data Frame Size Is Limited Only To A Maximum Of 9 Bits.
2. Multiple Master/Slaves Are Not Possible.
3. RS-232 Protocols
RS-232 Stands For Recommended Standard 232. Basically, It Is An Interface
Standard Commonly Used In Computer Serial Ports. It Also Defines The Electrical
Signals And Its Timings. However, It Serializes The Data To Be Transfer To The
Modem And Deserializes It Back While Receiving Back From The Modem.

It Uses A Half-Duplex Master-Slave Operation. The Current Version Is TIA-232F.

Pros:-
1. Cheap And Also Easily Available.
2. Simple Connections And Easy To Code.
3. Commonly In Use.
Cons:-
1. Half Duplex Master/Slave Operation.
2. Less Standardized Connectors And Terminology Also.
4. RS-485 Protocols
It Is An Improved Version Of RS-232 Which Can Connect 10 To 32 Devices At The
Same Time And Defines Electrical Characteristics To Ensure Proper Signal
Voltages Under Maximum Load. The Good Noise Immunity And Multi-Drop
Ability Make It The Choice For Serial Connection In Industrial Applications With
Its Cable Length Up To 4000 Feet. However, Generally In Use For Computer And
Automation Systems.

Pros:-
1. Good Noise Immunity.
2. Multipoint Applications.
3. Though Cheap.
Cons:-
1. Half-Duplex Master-Slave Operation.
2. Less Standardized Connectors And Technology.
5. Ethernet
A System Connecting A Number Of Systems To Form A LAN (Local Area Network)
Having Protocols To Control The Data Transfer And Avoid Data Transmission By

UNIT - IV 15
[INTERNET OF THINGS]

Two Or More Systems Simultaneously. Every Ethernet Network Interface Card


(NIC) Is Apply A Unique Identifier – A MAC Address Which Is A 48-Bit Number.

The First 24 Bits Identify The Manufacturer And It Is The Manufacturer ID Or


Organizational Unique Identifier (OUI) Which Is Assign Along The Registration
Authority. It Comes In Various Strengths Like Standard Ethernet(10 Mbps), Fast
Ethernet(100 Mbps), Gigabit Ethernet(1000 Mbps), Etc.

Pros:–
1. The Network Starts And Ends With It.
2. Needs A Switch To Keep A Network.
3. Can Be In Use In A Building.
Cons:-
1. Can’t Be In Use For Long Distances As Fibre Should Be In Use.
2. It Includes Too Many Wires While Connecting It In A Building Which Is
Tough To Manage.
INTERNAL SYSTEMS
Internal System Protocols Are Use To Communicate Between Devices Within
The Same Circuit.

1. I2C Protocols
I2C Stands For Inter-Integrated Circuit Bus. It Is An Internal Communication
Protocol That Uses One Wire SCL (Serial Clock) For Clock And The Other Wire
SDA (Serial Data) For Transmission. It Can Connect Many Slave Devices To
Master Devices. Since Communication Is Half-Duplex, It Can Either Send Or
Receive Messages At A Time.
Pros:-
1. Multiple Devices Can Connect.
2. Interconnection Without Extra Wires.
Cons:-
1. Complicated Hardware.
2. Complicated Programming.
2. SPI Protocol
The SPI Stands For Serial Peripheral Interface Bus. It Is A Synchronous Serial
Communication Interface Which Is Generally In Use For Short-Distance
Communication. It Uses Four Wires I.E.
 SCLK (Serial Clock).
 MOSI (Master Output Slave Input).
 MISO (Master Input Slave Output).

UNIT - IV 16
[INTERNET OF THINGS]

 SS (Slave Select).
Here, The Communication Is Full-Duplex I.E. Devices Can Transmit And Receive
Data Simultaneously. First 3 Pins Have The Same Line From The Controller. Only
The SS Pin Controls Which Slave Device Is Active.
Pros: –
1. Faster.
2. The Receiver Can Be Also A Simple Shift Register.
3. Multiple Devices Can Connect.
Cons:-
1. Requires A Greater Number Of Wires Than Other Types Of
Protocols.
2. Slave Devices Can Not Communicate With Each Other. An Only
Master-Slave Can Communicate With Slaves.
3. So, Each Slave Requires Different SS Lines Which Causes Problems
If Many Slaves Have Connection

MANET NETWORKS:
 A MANET consists of a number of mobile devices that come together
to form a network as needed, without any support from any existing
internet infrastructure or any other kind of fixed stations.
 A MANET can be defined as an autonomous system of nodes or
MSs(also serving as routers) connected by wireless links, the union of
which forms a communication network modeled in the form of an
arbitrary communication graph.
 This is in contrast to the well-known single hop cellular network model
that supports the needs of wireless communication between two
mobile nodes relies on the wired backbone and fixed base stations.
 In a MANET, no such infrastructure exists and network topology may
be changed dynamically in an unpredictable manner since nodes are
free to move and each node has limiting transmitting power,
restricting access to the node only in the neighboring range.
 MANETs are basically peer-to-peer, multi-hop wireless networks in
which information packets are transmitted in a store and forward
manner from a source to an arbitrary destination, via intermediate
nodes as given in the figure:

UNIT - IV 17
[INTERNET OF THINGS]

 As nodes move, the connectivity may change based on relative


locations of other nodes. The resulting change in the network topology
known at the local level must be passed on to other nodes so that old
topology information can be updated.
 For example, as MS2 in the figure changes its point of attachment from
MS3 to MS4, other nodes that are part of the network should use this
new route to forward packets to MS2. In the figure, we assume that it
is not possible to have all nodes within each other's radio range. In case
all nodes are closed by within each other's radio range, there are no
routing issues to be addressed.
 In figures raise another issue, that of symmetric and asymmetric
(bidirectional) and asymmetric (unidirectional) links. Consider
symmetric links with associative radio range; for example, if MS1 is
within radio range of MS3, then MS3 is also within radio range of MS1.
The communication links are symmetric. This assumption is not always
valid because of differences in transmitting power levels and the
terrain. Routing in asymmetric networks is relatively hard task. In
certain cases, it is possible to find routes that exclude asymmetric links,
since it is cumbersome to find the return path. The issue of efficient is
one of the several challenges encountered in a MANET.

The other issue is varying the mobility patterns of different nodes. Some
other nodes are highly mobile, while others are primarily stationary. It is
difficult to predict a node's movement and direction of movement and
numerous studies have been performed to evaluate their performance using
different simulators.
UNIT - IV 18
[INTERNET OF THINGS]

Characteristics of MANET

Some characteristics of adhoc network are as follows:

 Dynamic topologies: nodes are free to move arbitrarily; thus the


network topology may be changed randomly and unpredictably and
primarily consists of bidirectional links. In some cases where the
transmission power of two nodes is different, a unidirectional link may
exist.
 Bandwidth-constrained and variable capacity links: wireless links
continue to have significantly lower capacity than infrastructure
networks.
 Energy-constrained operation: some or all of the MSs in a MANET may
rely on batteries or other exhaustible means for their energy. For these
nodes or devices, the most important system design optimization
criteria may be energy conservation.
 Limited physical security: MANETs are generally more prone to
physical security threats than wire line networks. The increased
possibility of eavesdropping, spoofing, and denial of services (DoS)
attacks should be considered carefully. To reduce security threats,
many existing link security techniques are often applied within
wireless networks.

Applications of MANET

Some specific applications of ad hoc networks include industrial and commercial


applications involving cooperative mobile data exchange. There are many
existing and future military networking requirements for robust, IP-compliant
data services within mobile wireless communication networks, with many of
these networks consist of highly dynamic autonomous topology segments.
Advanced features of Mobile ad hoc networks, including data rates compatible
with multimedia applications global roaming capability, and coordination with
other network structures are enabling new applications.

 Défense applications: Many Défense applications require on the fly


communications set-up, and ad hoc/sensor networks are excellent
candidates for use in battlefield management.

UNIT - IV 19
[INTERNET OF THINGS]

 Crisis management applications: These arise, for example, as a result


of natural disasters in which the entire communication infrastructure
is in disarray. Restoring communications quickly is essential.
 Telemedicine: The paramedic assisting the victim of a traffic accident
in a remote location must access medical records (e.g. X-rays) and may
need video conference assistance from a surgeon for an emergency
intervention. In fact, the paramedic may need to instantaneously relay
back to the hospital the victim's X-rays and other diagnostic tests from
the site of the accident.
 Tele-geoprocessing application: The combination of GPS, GIS
(Geographical Information Systems), and high-capacity wireless
mobile systems enables a new type of application referred to as tele-
geo processing.
 Virtual Navigation: A remote database contains the graphical
representation of building, streets, and physical characteristics of a
large metropolis. They may also "virtually" see the internal layout of
buildings, including an emergency rescue plan, or find possible points
of interest.
 Education via the internet: Educational opportunities available on the
internet or remote areas because of the economic infeasibility of
providing expensive last-mile wire line internet access in these areas
to all subscribers.
 Vehicular area network: This a growing and very useful application of
adhoc network in providing emergency services and other
information. This is equally effective in both urban and rural setup. The
basic and exchange necessary data that is beneficial in a given
situation.

NETWORK LAYER OF IOT


The network layer is divided into two sublayers: routing layer which handles the
transfer of packets from source to destination, and an encapsulation layer that
forms the packets.

RPL Protocol

RPL stands for Routing Protocol for Low-Power and Lossy Network. It is a
distance-vector protocol that supports a varity of Data Link Protocols. RPL builds

UNIT - IV 20
[INTERNET OF THINGS]

a Destination Oriented Directed Acyclic Graph (DODAG) which has only one
route from each leaf node to the root. All the traffic in this DODAG is routed
through the root. Initially, each node sends a DODAG Information Object (DIO)
announcing them self as a root. This information travels in the network, and
complete DODAG is gradually built. When a new node wants to join the network,
it sends a DODAG Information Solicitation (DIS) request and root responds back
with a DAO Acknowledgment (DAO-ACK) confirming the join.

CORPL Protocol

CORPL protocol is the extension of the RPL protocol, which is termed


as cognitive RPL. This network protocol is designed for cognitive networks and
uses DODAG topology. CORPL protocol makes two new modifications in the RPL
protocol. It uses opportunistic forwarding to forward a packet between the
nodes. Each node of CORPL protocol keeps the information of forwarding set
rather than parents only maintaining it. Each node updates its changes to its
neighbor using DIO messages. On the basis of this updated message, each node
frequently updates its neighbor for constant forwarder set.

CARP Protocol

CARP (Channel-Aware Routing Protocol) is a distributed routing protocol. It is


designed for underwater communication. It has lightweight packets so that it
can be used for Internet of Things (IoT). It performs two different functionalities:
network initialization and data forwarding. CARP protocol does not support
previously collected data. Hence, it is not beneficial for those IoT or other
application where data is changed frequently. The upgradation of CARP is done
in E-CARP which overcomes the limitation of CARP. The E-CARP allows the sink
node to save previously received sensory data.

6LoWPAN

The 6LoWPAN protocol refers to IPv6 Low Power Personal Area Network which
uses a lightweight IP-based communication to travel over low data rate
networks. It has limited processing ability to transfer information wirelessly
using an internet protocol. So, it is mainly used for home and building
automation. The 6LoWPAN protocol operates only within the 2.4 GHz frequency
range with 250 kbps transfer rate. It has a maximum length of 128-bit header
packets.

UNIT - IV 21
[INTERNET OF THINGS]

6LowPAN Security Measure

Security is a major issue for 6LowPAN communication Protocol. There are


several attacks issues at the security level of 6LoWPAN which aim is to direct
destruction of the network. Since it is the combination of two systems, so, there
is a possibility of attack from two sides that targets all the layer of the 6LoWPAN
stack (Physical layer, Data link layer, Adaptation layer, Network layer, Transport
layer, Application layer).

Properties of 6LowPAN protocol

 Standard: RFC6282
 Frequency: Used over a variety of other networking media including
Bluetooth Smart (2.4GHz) or ZigBee or low-power RF (sub-1GHz)
 Range: NA
 Data Rates: NA

6LOWPAN ADAPTATION LAYER FOR DEVICES WITH LIMITED


RESOURCES
The adaptation layer is always used when sending the data over PHY and MAC
layers. For example, how an IPv6 packet is encapsulated in an Ethernet frame
is defined by RFC2464. It is also the same for IEEE 802.11 Wi-Fi. RFC 6282
defines how an IPv6 data frame is encapsulated over an IEE 802.15.4 radio link.

IETF working group focused on 6LoWPAN WG to optimize the transmission of


IPv6 packets over low-power and lossy networks (LLNs) such as IEEE 802.15.4
and led to the publication of RFC 6282 Specifying;

Header compression
-Assuming the usage of common fields, the header compression compresses
the 40-byte and 8-byte UDP headers. Header fields are suppressed when they
can be derived from the link layer and the way that the header can be
compressed is one of the factors that led to the standard that only supporting
IPv6 and not IPv4.

Fragmentation and reassembly


-The MTU of IPv6 which is 1280 bytes does not match with the data link on
IEEE 802.15.4 with a frame length of a maximum of 127 bytes. The frame
format of IEEE 802.15.4g does not have the same limitation

UNIT - IV 22
[INTERNET OF THINGS]

Stateless autoconfiguration
-It is the process where the devices in the 6LoWPAN network automatically
generate their own IPv6 address. A method to avoid the two devices getting
the same address is called duplicate address detection (DAD)

The key concept of the 6LoWPAN adaptation layer is to use stateless or shared-
context compression to compressed header fields. This can compress all
headers (adaptation, network, and transport layers) down to a few bytes.
Header fields are possible to compress since they often carry common values.
Common values always occur due to frequent use of a subset of IPv6
functionality, namely UDP, TCP, and ICMP. The 6LoWPAN adaptation layer
removes duplicate information that can be derived from other layers such as
the IPv6 addresses and UDP/IPv6 length fields.

As you can see from the above technical explanation, you will notice 6LoWPAN
exists and does provide a much more practical approach to local personal area
network (PAN) device exchange of data, in particular for the model world
where Internet of Things (IoT) devices keep rising. We are now in the world full
of IoT sensors, whether it is your smartphone you wear all the time, to
smartTag you bind with your physical keys, to smart home or smart office
devices, all are IoT devices.

E-SPIN being active in helping enterprise customers to implement enterprise


digital transformation technology to achieve scale, scope, and speed. E-SPIN
since 2005, already in the business of supply, consultancy, integration, training,
and maintenance of various supplies for enterprise customers and government
agencies. Feel free to contact E-SPIN for your project and operation
requirements.

DYNAMIC ROUTING PROTOCOLS FOR WIRELESS ADHOC NETWORKS


COMMUNICATION PROTOCOLS FOR IOT
Routing is the process of finding the best path for traffic in a network, or across
multiple networks. The role of routing is similar to the road map for a hotel. In
both cases, we need to deliver messages at proper location and in an
appropriate way.

Routing in a mobile ad-hoc network depends on many factors such as:

 Modeling of the topology,


 Selection of routers,
UNIT - IV 23
[INTERNET OF THINGS]

 Initiation of a route request,


 And specific underlying characteristics that could serve as heuristics in
finding the path effectively.

In a MANET, each node or device is expected to serve as a router, and each


router is indistinguishable from another in the sense that all routers execute the
same routing algorithm to compute paths through the entire network.

Need for Routing

There are following needs for routing:

 Since centralized routing in a dynamic and even for small networks is


impossible therefore routing computation must be distributed.
 Route computation should not add many more nodes.
 If any host demands for the route, they must have quick access.
 Maintenance of a global state should not involve in the route
computation.
 Each node should care about their destination node to its route and
should not be involved in frequent topology updates for those portions
of the network that have no traffic.
 Since broadcast can be time consuming for MANETs, it must be
avoided as much as possible.
 In routing there must have a backup route when the primary route has
become stale.

Routing Classification

Routing protocol can be classified as:

1. Proactive Protocol
2. Reactive Protocol
3. Hybrid Protocol

1. Proactive Protocol

Proactive protocols attempt to evaluate continuously the routes within the


network. It means proactive protocol continuously maintain the routing
information, so that when a packet needs to be forwarded, the path is known

UNIT - IV 24
[INTERNET OF THINGS]

already and can be immediately used. The family of distance vector protocols is
an example of proactive scheme.

The advantage of the proactive schemes is that whenever a route is needed,


there is negligible delay in determining the route.

Unfortunately, it is a big overhead to maintain routing tables in the MANET


environment. Therefore, this type of protocol has following common
disadvantages:

 Requires more amounts of data for maintaining routing information.


 Low reaction on re-structuring network and failures of individual
nodes.

2. Reactive Protocols

Reactive protocols do not maintain routes but invoke a route determination


procedure only on demand or we can say reactive protocols build the routes
only on demand. Thus, when a route is required, some sort of global search
procedure is initiated. The family of classical flooding algorithms belongs to the
reactive protocol group. Examples of reactive ad-hoc network routing protocols
include ad hoc on demand distance vector (AODV) and temporally ordered
routing algorithm (TORA).

These protocols have the following advantages:

 No large overhead for global routing table maintenance as in proactive


protocols.
 Reaction is quick for network restructure and node failure.
Even though reactive protocols have become the main stream for
MANET routing,

they still have the following disadvantages:

 Latency time is high in route finding


 Excessive flooding can lead to network clogging.

3. Hybrid Protocols

Hybrid protocols attempt to take advantage of best of reactive and proactive


schemes. The basic idea behind such protocols is to initiate route discovery on

UNIT - IV 25
[INTERNET OF THINGS]

demand but at a limited search cost. One of the popular hybrid protocols is zone
routing protocol (ZRP).

Routing protocols may also be categorized as follows:

1. Table-driven protocols
2. Source initiated on -demand protocols

1. Table-driven routing protocol

 These protocols are called table-driven because each node is required


to maintain one or more tables containing routing information on
every other node in the network.
 They are proactive in nature so that the routing information is always
consistent and up to date.
 The protocols respond to changes in network topology by propagating
the updates throughput the network so that every node has a
consistent view of the network.

The table driven routing protocols are categorized as follows:

Destination - sequenced distance vector routing

 Destination sequenced distance vector routing (DSDV) is a table driven


routing protocol for MANET based on Bellman-Ford algorithm.
 DSDV was developed by C. Perkins and P. Bhagwat in 1994. The main
contribution of the algorithm was that the algorithm works correctly,
even in the presence of the loops in the routing table.
 As we know, each mobile node maintains a routing table with a route to
every possible destination in the network and the number of hops to the
destination.
 Each entry in the table contains a sequence number assigned by the
destination node.
 The sequence numbers allow the node to distinguish stale routes from
new ones, and help avoid formation of routing loops.
 A new route broadcast contains:
o The destination address.
o The number of hops required to reach the destination.

UNIT - IV 26
[INTERNET OF THINGS]

o The sequence number of the information received about the


destination and a new sequence number unique to the broadcast.
 If there multiple routes are available for the same destination, the route
with the most recent sequence number is used. If two updates have the
same sequence number, the route with smaller metric is used to optimize
the routing.

For example the routing table of Node A from the above network is:

Destination Next Hop No. of Hops Sequence no. Install time

A A 0 A46 001000

B B 1 B36 001200

C B 2 C28 001500

Basically the table stores description of all possible paths reachable by node A,
along with the hop, number of hops, sequence number and install time.

Advantages

 Destination sequenced distance vector routing was one of the early


algorithms available. It is suitable for creating ad-hoc networks with small
no. of nodes.

UNIT - IV 27
[INTERNET OF THINGS]

Disadvantage

 Destination sequenced distance vector routing requires a regular update


of its routing tables, which uses more battery power and a small amount
of bandwidth even when the network is idle.
 This algorithm is not suitable for highly dynamic networks.

Cluster Head gateway switch Routing

 The cluster head (CH) gateway switch routing (CGSR) protocol is different
from the destination sequenced distance vector routing in the type of
addressing and the network organization scheme employed.
 Instead of a flat network, CGSR uses cluster heads, which control a group
of ad hoc nodes and hence achieve a hierarchical framework for code
separation among clusters, routing, channel access, and bandwidth
allocation.
 Identification of appropriate clusters and selection of cluster heads is
quite complex. Once clusters have been defined, it is desirable to use a
distributed algorithm within the cluster to elect a node as the cluster
head.
 The disadvantage of using a cluster head scheme is that frequent changes
adversely affect performance as nodes spend more time selecting a
cluster head rather than relaying packets. Hence, the least cluster change
(LCC) clustering algorithm is used rather than CH selection every time the
cluster membership changes. Using LCC, CHs change only when two CHs
come into contact, or when a node moves out of contact with all other
CHs.

UNIT - IV 28
[INTERNET OF THINGS]

 In this scheme, each node must maintain a cluster member table (CMT),
which stores the destination CH for each node in the network. The cluster
member tables are broadcast periodically by the nodes using the DSDV
algorithm.
 When a node receives such a table from a neighbor, it can update its own
information. As expected, each node also maintains a routing table to
determine the next hop required to reach any destination.

Wireless routing protocol (WRP)

The wireless routing protocol is a proactive unicast routing protocol for MANETs.
It uses an enhanced version of the distance vector routing protocol, which uses
the Bellman - Ford algorithm to calculate paths.

For the wireless routing protocol (WRP) each node maintains 4 tables:

 Distance table
 Routing table
 Link cost table
 Message retransmission list (MRL) table

Each entry in the message retransmission list has a sequence number of the
update message, a retransmission counter, an acknowledgment required flag
vector with one entry per neighbor, and a list of updates sent in the update
message. When any node receives a hello message from a new node, it adds the
new node to its routing table and sends the new node a copy of its routing table.
A node must send a message to its neighbors within a certain time to ensure
connectivity.

Advantages

o The advantage of WRP is similar to DSDV. In addition, it has faster


convergence and adds fewer table updates.

Disadvantage

o The complexity of maintenance of multiple tables demands a large


amount of memory and greater processing power from nodes in the
MANET.

UNIT - IV 29
[INTERNET OF THINGS]

o Since it suffers from limited scalability therefore WRP is not suitable for
highly dynamic and for a very large ad hoc wireless network.

2. Source initiated on -demand protocols

 Source - initiated on demand routing is reactive in nature, unlike table


driven routing. This type of protocols generates routes only when a source
demands it.
 In other words, when a source node requires a route to a destination, the
source initiates a route discovery process in the network. This process
finishes when a route to the destination has been discovered or all
possible routes have been examined without any success.
 The discovered route is maintained by a route maintenance procedure,
until it is no longer desired or the destination becomes inaccessible.

The source initiated on demand routing is categorized as follows:

Ad hoc on demand distance vector routing (AODV)

 AODV is a routing protocol for MANETs (mobile ad hoc networks) and


other wireless ad hoc networks.
 It is a reactive routing protocol; it means it establishes a route to a
destination only on demand.
 AODV routing is built over the DSDV algorithm. It is a significant
improvement over DSDV.
 The devices that are not on a particular path do not maintain routing
information, nor do they participate in the routing table exchanges.
 When a source requires sending a message to a destination and does not
have a valid route to the latter, the source initiates a route discovery
process.
 Source sends a route request (RREQ) packet to all its neighbors, the latter
forward the request to all their neighbors, and so on, until either the
destination or an intermediate mobile (node) with a "fresh enough" route
to the destination is reached.

UNIT - IV 30
[INTERNET OF THINGS]

The above figure illustrates the propagation of the broadcast request (RREQs)
across the network. Since in DSDV, destination sequence numbers are used to
ensure that all routes are loop free and contain the most recent route
information. Each node has a unique sequence number and a broadcast ID,
which is incremented each time the node, initiates RREQ.

The broadcast ID, together with the IP address of node, uniquely identifies every
RREQ.

Intermediate mobile reply only if they have a route to the destination with a
sequence number greater than or at least equal to that contained in the RREQ.
To optimize the route performance, intermediate nodes record the address.

From the above figure, since RREP (route reply packet) travels back on the
reverse path, the nodes on this path set up their forward route entries to point
to the node from which RREP had just been received. These forward route
records indicate the active forward route. The RREP continues traveling back
along the reverse path till it reaches the initiator of the route discovery. Thus,
AODV can support only the use of symmetric links.

UNIT - IV 31
[INTERNET OF THINGS]

Dynamic Source Routing (DSR)

 Dynamic source routing is an on-demand routing protocol which is based


on source routing.
 It is very similar to AODV in that it forms a route on demand when a
transmitting computer requests one. But, it uses source routing instead
of relying on the routing table at each intermediate device. Many
successive refinements have been made to dynamic source routing.
 This protocol works in two main phases:
o Route discovery
o Route maintenance
 When a node has a message to send, it contacts to the route cache to
determine whether is it has a route to the destination. If an active route
to the destination exists, it is used to send a message.
 Otherwise a node initiates a route discovery by broadcasting a route
request packet. The route request stores the destination address, the
source address, and a unique identification number.
 Each device that receives the route request checks whether it has a route
to the destination. If it does not, it adds its own address to the route
record of the packet and then rebroadcasts the packet on its outgoing
links.
 To minimize the no. of broadcasts, a mobile rebroadcasts a packet only if
it has not seen the packet before and its own address was not already in
the route record.

SERVICE ORIENTED PROTOCOL(COAP)

Professionals involved in IoT network designing or development must have


come across CoAP. A dedicatedly set standard by IETF, it works the best when it
comes to constrained IoT-enabled solutions.

To make you understand CoAP (Constrained Application Protocol) better, we


have prepared this post, presenting a crisp CoAP definition, architecture, its role
in API security, and other related topics.
CoAP a customary client-server IoT protocol. It enables clients to make requests
for web transfers as per the need of the hour. On the other hand, it also let

UNIT - IV 32
[INTERNET OF THINGS]

supporting servers to respond to arriving requests. In summary, devices’ nodes


in the IoT ecosystem are enabled to interact over through CoAP only.
CoAP and HTTP follow the same working procedure. However, CoAP attains its
functionality via asynchronous transactions (using UDP). It utilizes the POST,
GET, PUT, and DELETE calls. That’s the reason why API security is of higher grade
while CoAP is active as it is an RPK and PSK-certified protocol.
CoAP is compatible with 4 types of information exchange:

1. Acknowledgments confirm the completion or failure of an event.


2. Confirmable are the messages that are resent on time out until the
confirmation of successful sending doesn’t arrive.
3. Reset messages are empty, with confirmable as their nature.
4. Non-confirmable information is just sent and has no guarantee of
successful delivery. There is no acknowledgment of success either.

Key traits of CoAP are:

 Works for devices in the same network types.


 Enables data transmission, to and fro, for the general internet-enabled
nodes and network-connected devices.
 Works really fine for SMSs shared over mobile network connectivity.
 Suitable for internet-operative applications that use connected
devices/sensors and have resource limitations.
 Capable of translating HTTP, supports multicast, and exerts the bare
minimum cost burden.
 Only helps machines to communicate (in the network).

CoAP Architecture

The WWW and the constraints ecosystem are the 2 foundational elements of
the CoAP protocol architecture. Here, the server monitors and helps in
communication happening using CoAP and HTTP while proxy devices bridge the
existing gap for these 2 ecosystems, making the communication smoother.
CoAP allows HTTP clients (also called CoAP clients here) to talk or exchange
data/information with each other within resource constraints.
While one tries to understand this architecture, gaining acquaintances with
some key terms is crucial:

UNIT - IV 33
[INTERNET OF THINGS]

 Endpoints are the nodes that host have knowledge of;


 Client sends requests and replies to incoming requests;
 Server gets and forwards requests. It also gets and forwards the messages
received in response to the requests it had processed.
 Sender creates and sends the original message.
 Recipient gets the information sent by the client or forwarded by the
server.

CoAP Function
The key role of CoAP is to act like HTTP wherever restricted devices are a part of
communication. While filling the gap of HTTP, it enables devices like actuators
and sensors to interact over the internet.
The devices, involved in the process, are administered and controlled by
considering data as a system’s component. CoAP protocol can operate its
functions in an environment having reduced bandwidth and extreme congestion
as it consumes reduced power and network bandwidth.
Networks featuring intense congestion and constrained connectivity are not
ideal conditions for TCP-based protocols to carry out their responsibilities. CoAP
comes as a rescuer at this place and supports the wen transfers.

UNIT - IV 34
[INTERNET OF THINGS]

Web transfers happening using satellites and covering long distances can be
accomplished with full perfection using CoAP. Networks featuring billions of
nodes take the help of the CoAP protocol for information exchange.
Regardless of the function handled or role played, CoAP promised security of
highest grade as DTLS parameters as default security parameter; the
counterpart of 128-bit RSA keys.
Speaking of its deployment, it’s simple and hassle-free. It can be implemented
from scratch for a straightforward application.
For the application ecosystem where CoAP is not desirable, generic
implementations are offered for various platforms. Most of the CoAP
implementations are done privately while few are published in open-source
libraries like MIT license.
CoAP Features
The defining features that place CoAP protocol separate from other protocols
are as stated next. As it shares great similarities with HTTP, developers face bare
minimum difficulties while using it.
CoAP is an integration-friendly protocol and can be paired easily with
applications using cross-protocol proxies. Seamlessly, it integrates with JSON,
XML, CBOR, and various other data formats. In the process, the web client
doesn’t get hints about a sensor resource being accessed.
Developers are endowed with various payloads and have the freedom to make
a choice to bring the ideal payload into action.
The successful IoT device/application demands the usage of billions of nodes at
a time. CoAP is designed to handle such huge mode amounts with full perfection
while keeping the overheads under control. It can operate on tons of
microcontrollers while using the least possible resources. RAM space as low as
10KiB and code space as 100 KiB is enough for CoAP.
As resources demanded by CoAP are on the minimum side, it keeps the wastes
under control. There is no need to deploy a hefty transport stack for web
transfers. The header and encoding, used for message processing, are compact
and don’t cause any fragments on the link layer. At a time, it supports the
functions of multiple servers.

UNIT - IV 35
[INTERNET OF THINGS]

CoAP offers a comprehensive resource directory to spot the properties of the


node.
CoAP is verified by RFC 7252, is developed for the future, and is able to deal with
congestion control issues.

CoAP Layer
The protocol works through its two layers:

1. CoAP Messages Model

It makes UDP transactions possible at endpoints in the confirmable (CON) or


non-confirmable (NON) format. Every CoAP message features a distinct ID to
keep the possibilities of message duplications at bay.
The 3 key parts involved to build this layer are binary header, computer option,
and payload.
As explained before, confirmable texts are reliable and easy-to-construct
message that are fast and are resent until the receipt of a confirmation of
successful delivery (ACK) with message ID.

2. CoAp Request/Response Model

This layer takes care of CON and NON message requests. Acceptance of these
requests depend on server’s availability. Cases are:

1. If idle, the server will handle the request right away. If a CON, the client
will get an ACK for it. If the ACK is shared as a Token and differs from the
ID, it is essential to map it properly by matching request-response pairs.
2. If there is a delay or wait involved, the ACK is sent but as an empty text.
When its turn arrvies, the request is processed andthe client gets a fresh
CON.

The key traits of the Request/Response model are mentioned next:

 Request or response codes for CoAP are same as for the HTTP, except for
the fact that they are in the binary format (0-8 byte Tokens) in CoAP’s
case.
 Request methods for making calls (GET, PUT, POST, and DELETE) are
declared in the process.
UNIT - IV 36
[INTERNET OF THINGS]

 A CON response could either be stored in an ACK message or forward as


CON/NON.

CoAP vs MQTT
As there are great similarities, we won’t blame you if you consider these two
identical. For instance, they both are used for IoT devices as they both
necessitate less amounts of network packets causing more power-optimized
performance, less storage consumption, and longer battery power.
CoAP and MQTT are distinct from each other on various fronts:
CoAP vs MQTT

MQTT CoAP

This model has publishers and


Uses requests and responses
subscribers as main participants

Central broker handles message Message dispatching happens on a


dispatching, following the optimal unicasting basis (one-to-one). The
publisher to client path. process is same as HTTP.

UNIT - IV 37
[INTERNET OF THINGS]

Event-oriented operations Viable for state transfer

Establishing a continual and long- Involved parties use UDP packets


lasting TCP connection with the (async) for message passing and
broker is essential for the client. communication.

No message labeling but have to use


It defines messages properly and
diverse messages for different
makes its discovery easy.
purposes.

REST Protocol and CoAP


RESTful protocol refers to Representational State Transfer and is operational
over HTTP. In its casel, every entity is treated as a resource and is accessible via
the mutual interface. REST is hugely powered by web technology but is not
solely dependent on HTTP
Suitable for IoT applications, CoAP is often called a lightweight RESTful dialect.
It requires less CPU resources and bandwidth on the network if we compare. IoT
device development is a hefty task if it happens over HTTP as it involves billions
of nodes. However, due to its nature, architecture and working, CoAP is capable
of performing all of this.
COMMUNICATION PROTOCOLS BASED ON THE EXCHANGE OF
MESSAGES(MQTT)
MQTT stands for Message Queuing Telemetry Transport. MQTT is a machine to
machine internet of things connectivity protocol. It is an extremely lightweight
and publish-subscribe messaging transport protocol. This protocol is useful for
the connection with the remote location where the bandwidth is a premium.
These characteristics make it useful in various situations, including constant
environment such as for communication machine to machine and internet of
things contexts. It is a publish and subscribe system where we can publish and
receive the messages as a client. It makes it easy for communication between
multiple devices. It is a simple messaging protocol designed for the constrained
devices and with low bandwidth, so it's a perfect solution for the internet of
things applications.

UNIT - IV 38
[INTERNET OF THINGS]

Characteristics of MQTT

The MQTT has some unique features which are hardly found in other protocols.
Some of the features of an MQTT are given below:

 It is a machine to machine protocol, i.e., it provides communication


between the devices.
 It is designed as a simple and lightweight messaging protocol that uses a
publish/subscribe system to exchange the information between the client
and the server.
 It does not require that both the client and the server establish a
connection at the same time.
 It provides faster data transmission, like how WhatsApp/messenger
provides a faster delivery. It's a real-time messaging protocol.
 It allows the clients to subscribe to the narrow selection of topics so that
they can receive the information they are looking for.

History of MQTT

The MQTT was developed by Dr. Andy Stanford-Clark, IBM

, and Arlen Nipper. The previous versions of protocol 3.1 and 3.1.1 were made
available under MQTT ORG. In 2014, the MQTT was officially published by OASIS.
The OASIS becomes a new home for the development of the MQTT. Then, the
OASIS started the further development of the MQTT. Version 3.1.1 is backward
comfortable with a 3.1 and brought only minor changes such as changes to the
connect message and clarification of the 3.1 version. The recent version of MQTT
is 5.0, which is a successor of the 3.1.1 version. Version 5.0 is not backward,

UNIT - IV 39
[INTERNET OF THINGS]

comfortable like version 3.1.1. According to the specifications, version 5.0 has a
significant number of features that make the code in place.

The major functional objectives in version 5.0 are:

o Enhancement in the scalability and the large-scale system in order to set


up with the thousands or the millions of devices.
o Improvement in the error reporting

MQTT Architecture

To understand the MQTT architecture, we first look at the components of the


MQTT.

 Message
 Client
 Server or Broker
 TOPIC

Message

The message is the data that is carried out by the protocol across the network
for the application. When the message is transmitted over the network, then
the message contains the following parameters:

1. Payload data
2. Quality of Service (QoS)
3. Collection of Properties
4. Topic Name

Client

In MQTT, the subscriber and publisher are the two roles of a client. The clients
subscribe to the topics to publish and receive messages. In simple words, we can
say that if any program or device uses an MQTT, then that device is referred to
as a client. A device is a client if it opens the network connection to the server,
publishes messages that other clients want to see, subscribes to the messages
that it is interested in receiving, unsubscribes to the messages that it is not
interested in receiving, and closes the network connection to the server.

UNIT - IV 40
[INTERNET OF THINGS]

In MQTT, the client performs two operations:

 Publish: When the client sends the data to the server, then we call this
operation as a publish.
 Subscribe: When the client receives the data from the server, then we call
this operation a subscription.

Server

The device or a program that allows the client to publish the messages and
subscribe to the messages. A server accepts the network connection from the
client, accepts the messages from the client, processes the subscribe and
unsubscribe requests, forwards the application messages to the client, and
closes the network connection from the client.

TOPIC

The label provided to the message is checked against the subscription known by
the server is known as TOPIC.

Architecture of MQTT

UNIT - IV 41
[INTERNET OF THINGS]

Now we will look at the architecture of MQTT. To understand it more clearly, we


will look at the example. Suppose a device has a temperature sensor and wants
to send the rating to the server or the broker. If the phone or desktop application
wishes to receive this temperature value on the other side, then there will be
two things that happened. The publisher first defines the topic; for example, the
temperature then publishes the message, i.e., the temperature's value. After
publishing the message, the phone or the desktop application on the other side
will subscribe to the topic, i.e., temperature and then receive the published
message, i.e., the value of the temperature. The server or the broker's role is to
deliver the published message to the phone or the desktop application.

MQTT Message Format

The MQTT uses the command and the command acknowledgment format,
which means that each command has an associated acknowledgment. As shown
in the above figure that the connect command has connect acknowledgment,
subscribe command has subscribe acknowledgment, and publish command has
publish acknowledgment. This mechanism is similar to the handshaking
mechanism as in TCP protocol.

Now we will look at the packet structure or message format of the MQTT.

UNIT - IV 42
[INTERNET OF THINGS]

The MQTT message format consists of 2 bytes fixed header, which is present in
all the MQTT packets. The second field is a variable header, which is not always
present. The third field is a payload, which is also not always present. The
payload field basically contains the data which is being sent. We might think that
the payload is a compulsory field, but it does not happen. Some commands do
not use the payload field, for example, disconnect message.

Fixed Header

Let's observe the format of the fixed header.

As we can observe in the above format that the fixed header contains two bytes.
The first byte contains the following fields:

 MQTT Control Packet Type: It occupies 4 bits, i.e., 7 to 4-bit positions.


This 4-bit is an assigned value, and each bit represents the MQTT control
packet type.
 Flag specific to each MQTT packet type: The remaining 4-bits represent
flag specific to each MQTT packet type.

The byte 2 contains the remaining length, which is a variable-length byte integer.
It represents the number of bytes remaining in a current control packet,
including data in the variable header and payload. Therefore, we can say that
the remaining length is equal to the sum of the data in the variable header and
the payload.

UNIT - IV 43
[INTERNET OF THINGS]

MQTT Control Packet Types

The above table shows the control packet types with 4-bit value and direction
flow. As we can observe that every command is followed by acknowledgment
like CONNECT has CONNACK, PUBLISH has PUBACK, PUBREC, PUBREL, and
PUBCOMP, SUBSCRIBE has SUBACK, UNSUBSCRIBE has UNSUBACK.

UNIT - IV 44
[INTERNET OF THINGS]

Flag Bit

The above table shows the flag value associated with each command. Here,
reserved refers to future use, which means that it is not being used right now.
In the case of PUBLISH command, flag bits are further divided into DUP, QoS,
and RETAIN, where DUP is a duplicate delivery of a PUBLISH packet, QoS is
Quality of Service, and RETAIN is retained message flag.

Remaining length

The remaining length is a variable-length integer that denotes the number of


bytes remaining within the current control packet, including data in the variable
header and the payload. Therefore, the remaining length is equal to the data in
the variable header plus payload.

Remaining length = length of variable header + length of payload

For example, if the length of the variable header is 20 and the length of the
payload is 30, then the remaining length is 50.

The remaining length can be used upto 4 bytes, and it starts from 2 bytes and
can be used upto 4 bytes.

This field uses 7-bit for the lengths, and MSB bit can be used to continue a flag.
If the continuation flag is 1, the next byte is also a part of the

UNIT - IV 45
[INTERNET OF THINGS]

remaining length. If the continuation flag is 0, a byte is the last one of the
remaining length.

Variable header

Some types of MQTT control packet types contain an optional field also, i.e.,
variable header component. This field resides between the fixed header and the
payload. The content of the variable header depends upon the packet type. The
variable header contains the packet identifier field, which is common in several
packet types. The variable header component of many MQTT control packet
types includes 2-byte integer, i.e., the packet identifier field.

The given list below contains the packet identifier field:

 PUBLISH
 PUBACK
 PUBREC
 PUBREL
 PUBCOMP
 SUBSCRIBE
 SUBACK
 UNSUBSCRIBE
 UNSUBACK

Key points related to the packet identifier field:

o A PUBLISH packet should not contain the packet identifier field if the value
of QoS (Quality of Service) is set to zero. It implies that if the value of QoS
is greater than zero, only the PUBLISH packet will contain the packet
identifier field.
o When a client sends a new SUBSCRIBE, UNSUBSCRIBE, or PUBLISH MQTT
control packet, it should assign a non-zero packet identifier that is
currently unused.
o When a server sends a new PUBLISH MQTT control packet, it should assign
a non-zero packet identifier that is currently unused.
o A PUBACK, PUBREC, PUBUREL, PUBREC are the acknowledgment packets
of PUBLISH command that contain the same packet identifier as the
PUBLISH packet.

UNIT - IV 46
[INTERNET OF THINGS]

o A SUBACK and UNSUBACK are the acknowledgment packets of SUBSCRIBE


and UNSUBSCRIBE, respectively. Both the packets, i.e., SUBACK and
UNSUBACK, use the same packet identifier as the SUBSCRIBE and
UNSUBSCRIBE packets.
o The packet identifier can be reusable after processing the corresponding
acknowledgment packet. It can be defined as follows:

If the value of QoS is 1 then the acknowledgment packet of PUBLISH would be


PUBACK. If it processes the PUBACK, then the packet identifier of PUBACK can
be reused.

If the QoS value is 2 then the acknowledgment packet of PUBLISH would be


either PUBCOMP or PUBREC.

Payload

In the ICMP message format, the last MQTT control packet is the payload. This
field contains the data which is to be sent. For example, in the case of the
CONNECT packet, the payload is a client ID, the username and password, and
the PUBLISH packet, the payload is just an application message.

UNIT - IV 47
[INTERNET OF THINGS]

Service Discovery Protocol (SDP)


Service Discovery layer has a prominent role in an IOT architecture. It is the
service discovery or service management layer which differentiates an IOT
network with that of typical internet network. The IOT devices need to connect
and communicate with web or cloud based services and applications for IOT
implementation. The cloud or web services and applications run on host
computers which are identified by unique IP addresses on a network. In order
to avail a cloud based service, the IOT devices must be connected with the
computers (servers) hosting those services or applications. So, there are some
protocols designed to resolve host IP addresses rendering IOT services and
applications. These protocols help identifying servers hosting IOT services by
their namespaces and allow an IOT board to connect with one (Unicast) or group
of servers (Multicast) over the network.
Some of the popular service discovery protocols are as follow –
1. mDNS
2. DNS Service Discovery (DNS-SD)
3. uPnP
4. Simple Discovery Service Protocol
mDNS – Multicast Domain Name System (mDNS) is a DNS like service discovery
protocol to resolve host names to IP addresses in a local network without using
any unicast DNS server. It can be used without any additional infrastructure or
DNS server in the network. The protocol operates on IP multicast UDP packets
through which a node in the local network enquires the names of all other
nodes. The client node sends a query message to respond by a node with specific
name. When the node with the corresponding name receives the query, it
responds with a multicast response message containing its IP address. Being a
multicast response, the target device IP address and name is also saved by all
the devices (nodes) of the network in their local caches.
In such a local network, the IP addresses could change at some time but not the
names. This protocol is really useful as it does not need any additional
infrastructure (DNS server in the network) and can be used to manage devices
without any manual configuration or administration. The protocol can be
implemented despite of infrastructure failures. Developed by IETF, mDNS
protocol is defined in RFC6762 standard.

UNIT - IV 48
[INTERNET OF THINGS]

DNS Service Discovery (DNS-SD) – This protocol stack uses standard DNS
messages to discover services in an IOT network. Based on mDNS, DNS-SD is
used to resolve services available in a network. The service discovery is
implemented in two steps – in the first step, host names of the service providers
are resolved and in the next step, IP addresses are paired with the host names
using mDNS. It is important to identify host names as IP addresses can change
in the network.
Like in mDNS, the IP address and host name of the target device is
communicated as a multicast response and each node (connected IOT device in
the network) updates the host name and related IP address on receiving the
response. It is the protocol which keeps the host names constant in the network
despite the devices or nodes have dynamic IP addresses. As the host name
always remain constant in the network, it is possible to identify the devices
uniquely and reliably within the local IOT network. Like mDNS, this protocol
stack does not require any additional infrastructure (DNS Name Server in the
network) or manual configuration or administration of connected IOT devices.
uPnP – Maintained by Open Connectivity Foundation, Universal Plug and Play
(uPnP) is a protocol stack that allows devices in a network to discover each other
and each other’s capabilities along with setting up network functions like data
sharing and communication.
There are three building blocks of any uPnP network – devices, services and
control points. The devices are the basic blocks of the network where each
device provides specific service or services. The services are seen as set of
actions which can be implemented by the device. The control points identify
devices by device and service descriptions and respond to client node by
invoking requested services. In this protocol, the discovery of devices and
services happen automatically and autonomously once a node enters the
network. So, there remains no need to manually configure nodes (IOT devices)
to discover available devices and service in the network.
This protocol is based on TCP-IP routing. The devices are identified by their
Universal Resource Indicators (URIs) and the services are discovered using
Hypertext Transfer Protocol (HTTP). A device connected to network
automatically configures itself by acquiring a TCP-IP address and indicating
available services by it using HTTP. The devices then use XML to communicate
with each other and indicate each other’s capabilities (services to offer).

UNIT - IV 49
[INTERNET OF THINGS]

UPnP was earlier a proprietary standard of Microsoft but is now an open


standard. It is quite suitable for small local IOT networks where devices would
need to communicate with each other without any additional infrastructure.
Like UPnP can be used by mobile devices to connect with printers and scanners
in an automated office. Similarly, it can be used to transfer photos from a
camera to mobile devices or laptop.
Simple Discovery Service Protocol (SDSP) – Simple Discovery Service Protocol
is used in UPnP networks for discovering available services. It is used by control
points in UPnP network to look for devices, services offered by them and their
availability at a time. The control point sends a multicast search request to which
the device offering requested service responds. The devices and services offered
by them are identified by device and service descriptors respectively. The
control point uses devices and service descriptions to look for requested services
in the network.
There are also many public service discovery platforms to which IOT devices can
request services for. Some of these platforms are as follow –
 HyperCat – an open standard collection of URIs to identify sensors and
publish sensor data
 Physical Web – a service initiated by Google’s Chrome Development
Team, physical web allow mobile devices to capture sensor data using BLE
beacons
 Wi-Fi Aware – a service that will use Wi-Fi to connect smart phones and
mobile devices with the surrounding sensors and IOT devices and collect
as well as transmit data to them.
 Bluetooth Beacons – a service that will allow smart phones and mobile
devices to receive bluetooth beacons containing sensor data
 Shazam – a service to identify music by recording an audio clip for few
seconds. It is currently available as a mobile app and is frequently used
for identifying music tracks
 Open Hybrid – a service to map digital interfaces to the physical objects
 Chirp – a mobile app to encode, transmit and decode data in the form of
audible and inaudible near ultrasonic pitches
In the next tutorial, various application layer protocols used in IOT systems will
be discussed.

UNIT - IV 50
[INTERNET OF THINGS]

UNIT - IV 51

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy