Fundamentals of IoT
Fundamentals of IoT
Piconet:
Piconet is a type of Bluetooth network that contains one primary node called the
master node and seven active secondary nodes called slave nodes. Thus, we can
say that there is a total of 8 active nodes which are present at a distance of 10
meters. The communication between the primary and secondary nodes can be
one-to-one or one-to-many. Possible communication is only between the master
and slave; Slave-slave communication is not possible. It also has 255 parked
nodes, these are secondary nodes and cannot take participation in
communication unless it gets converted to the active state.
Scatternet:
It is formed by using various piconets. A slave that is present in one piconet can
act as master or we can say primary in another piconet. This kind of node can
receive a message from a master in one piconet and deliver the message to its
slave in the other piconet where it is acting as a slave. This type of node is
referred to as a bridge node. A station cannot be mastered in two piconets.
Advantage:
Low cost.
Easy to use.
It can also penetrate through walls.
It creates an Ad-hoc connection immediately without any wires.
It is used for voice and data transfer.
Disadvantages:
It can be hacked and hence, less secure.
It has a slow data transfer rate: of 3 Mbps.
It has a small range: 10 meters.
Bluetooth communication does not support routing.
The issues of handoffs have not been addressed.
Applications:
Used in laptops, and in wireless PCs.
In printers, games
In wireless headsets.
Connecting digital camera wirelessly to a mobile phone.
Data transfer from one cell phone to other cell phone or computer.
Medical health care
ZigBee :-
ZigBee is a IEEE 802.15.4 based, low power, low data rate supporting wireless
networking standard, which is basically built for sensor and control system.
It is a short-range communication standard like Bluetooth and Wi-Fi, covering
range of 10 to 100 meters.
The difference being while Bluetooth and Wi-Fi are high data rate
communications standard supporting transfer of complex structure like media,
software etc.
ZigBee Technology supports transfer of simple data collected from sensors.
It supports low data rate of about 250 kbps. The operating frequencies are 868
MHz, 902 to 928 MHz and 2.4 GHz.
ZigBee Technology is used mainly for applications requiring low power, low cost,
low data rate and long battery life.
Architecture of Zigbee:
1. Application Layer
2. Application Interface Layer
3. Security Layer
4. Network Layer
5. Medium Access Control Layer
6. Physical Layer
Physical layer: The lowest two layers i.e the physical and the MAC (Medium
Access Control) Layer are defined by the IEEE 802.15.4 specifications. The
Physical layer is closest to the hardware and directly controls and
communicates with the Zigbee radio. The physical layer translates the data
packets in the over-the-air bits for transmission and vice-versa during the
reception.
Medium Access Control layer (MAC layer): The layer is responsible for the
interface between the physical and network layer. The MAC layer is also
responsible for providing PAN ID and also network discovery through
beacon requests.
Network layer: This layer acts as an interface between the MAC layer and
the application layer. It is responsible for mesh networking.
Application layer: The application layer in the Zigbee stack is the highest
protocol layer and it consists of the application support sub-layer and
Zigbee device object. It contains manufacturer-defined applications.
Channel Access:
1. Contention Based Method (Carrier-Sense Multiple Access With Collision
Avoidance Mechanism)
2. Contention Free Method (Coordinator dedicates a specific time slot to each
device (Guaranteed Time Slot (GTS)))
Zigbee Applications:
1. Home Automation
2. Medical Data Collection
3. Industrial Control Systems
4. meter reading system
Terminology of WIFI
Another term for Wi-Fi is "wireless LAN."
SSID (Service Set Identifier)-WiFi networks are identified and distinguished from
one another by their service set identification (SSID) numbers, which are 32
characters long. All gadgets are trying to communicate to the same SSID (Service
Set Identifier). SSID stands for "Service Set Identifier" and is the title of the
wireless network.
WPA-PSK (Wi-Fi Protected Access- Pre-Shared Key): It's a programme created by
the Wi-Fi Alliance Authority to safeguard wireless networks using Pre-Shared Key
authentication. WPA comes in three varieties: WPA, WPA2, and WPA3. An
encryption method for Wi-Fi signals to keep out unwanted users.
Ad hoc networks are used by Wi-Fi in order to transmit data. A point-to-point
network without an interface, it's a wireless mesh network.
Advantages of WIFI
1. A versatile network connection and the absence of complicated wiring
requirements for installation.
2. Everywhere in the Wi-Fi range can access it.
3. Independent users are not required to obtain regulatory approval.
4. In addition, Wi-Fi Extenders make it possible to expand the network.
5. It's easy and quick to set up.
6. Only the SSID and password need to be configured.
.
Wi-Fi Disadvantages
1. Batteries consume a lot of power when using Wi-Fi.
2. Even when encryption is in place, security issues can still arise.
3. Wi-Fi can be attacked and accessed in the same way that recognised devices
become unidentified to the router.
4. In comparison to a direct cable connection, the speed is slower.
5. People can be harmed by it because it emits radiation like cell phones.
6. Because it lacks a firewall, unauthorised access to Wi-Fi is possible.
RFID
RFID stands for radio frequency identification, It is a short range wireless
communication technology which uses radio waves to uniquely identify an object,
animal or person.
RFID systems consist of three components: an RFID tag, RFID reader, and an
antenna. RFID tags contain an integrated circuit and an antenna, which are used
to transmit data to the RFID reader (also called an interrogator). The reader then
converts the radio waves to a more usable form of data. Information collected
from the tags is then transferred through a communications interface to a host
computer system, where the data can be stored in a database and analyzed at a
later time.
It consist of the following components
>> RFID Tag
>> RFID Reader
>> Host Computer
RFID tags/ labels/transponder :
RFID tags or transponders are small devices that utilize low-power radio waves to
receive, store, and transmit data to nearby readers.
The main components of RFID tags are : a microchip or integrated circuit (IC), an
antenna, and a substrate or protective material layer that holds all the
components together.
The tag comprises of a simple silicon microchip attached to a small flat aerial and
mounted on a substrate. The whole device can then be encapsulated in different
materials (such as plastic) dependent upon its intended usage. The finished tag
can be attached to an object, typically an item, box or pallet and read remotely
the identity of tag.
Tags, which uses radio waves to communicate their identity and other
information to nearby readers, can be passive or active. Passive RFID tags are
powered by the reader and do not have a battery. Active RFID tags are powered
by batteries. RFID tags can store a range of information from one serial number to
several pages of data.
RFID Reader or Interrogator
In this RFID system, this RFID reader continuously sends radio waves of a
particular frequency. If the object, on which this RFID tag is attached is within the
range of this radio waves then it sends the feedback back to this RFID reader. And
based on this feedback, RFID reader identifies the object.
Host Computer
The data acquired by the readers is then passed to a host computer, which may
run specialist RFID software or middleware to filter the data and route it to the
correct application, to be processed into useful information.
Mobile Internet
Cellular IoT is the technology that connects physical objects to the Internet
utilising the same cellular network currently used by smartphones. In other
words, this technology can connect IoT devices using existing mobile networks.
Thus, it eliminates the need to invest and develop a separate dedicated network
infrastructure just for IoT devices.
Benefits of Cellular IoT
1. Extensive Coverage
2. Cost-saving
3. Remote Management
4. Flexibility in Connectivity
5. Security
Types of Cellular IoT
IoT can connect via 2G, 3G,4G, or 5G networks. Depending on the needs of the
IoT device and application, there are primarily two types of Cellular IoT
connections, namely, LTE-M and NB-IoT which are the recent IoT specific
variables. Cellular network IoT connectivity options include:
2G, 3G, 4G: The standard cellular network technologies, which were
originally designed for mobile phones only and now support other types of
devices. While 4G is the current generation, and now 5G has been
launched, yet in many markets IoT is still supported using 2G or 3G
connections.
LTE Advanced: A faster version of the standard LTE technology. It can be
used in IoT projects like self-driving vehicles which require rapid responses.
LTE Cat 0: Is a low cost, and relatively low power solution for IoT, but has
the benefits of also supporting Voice and SMS. As voice and SMS both have
a role to play within IoT as well – think about device wake-up and voice
interaction with machines.
NB-IoT: The cellular response to the need for low power connectivity, using
a cellular compatible connectivity technology. Ideal for battery powered
devices with relatively low data transmission requirements.
These three cross layers are mainly used for controlling the network as well as to
make the sensors function as one in order to enhance the overall network
efficiency. The above mentioned five layers of WSN are discussed below.
3.1 Application Layer The application layer is liable for traffic management and
offers software for numerous applications that convert the data in a clear form to
find positive information. Sensor networks arranged in numerous applications in
different fields such as agricultural, military, environment, medical, etc.
3.2 Transport Layer The function of the transport layer is to deliver congestion
avoidance and reliability where a lot of protocols intended to offer this function
are either practical on the upstream. These protocols use dissimilar mechanisms
for loss recognition and loss recovery. The transport layer is exactly needed when
a system is planned to contact other networks. Providing a reliable loss recovery
is more energy-efficient and that is one of the main reasons why TCP is not fit for
WSN. In general, Transport layers can be separated into Packet driven, Event-
driven. There are some popular protocols in the transport layer namely STCP
(Sensor Transmission Control Protocol), PORT (Price-Oriented Reliable Transport
Protocol and PSFQ (pump slow fetch quick).
3.3 Network Layer The main function of the network layer is routing, it has a lot
of tasks based on the application, but actually, the main tasks are in the power
conserving, partial memory, buffers, and sensor don’t have a universal ID and
have to be self-organized. The simple idea of the routing protocol is to explain a
reliable lane and redundant lanes, according to a convincing scale called a metric,
which varies from protocol to protocol. There are a lot of existing protocols for
this network layer, they can be separated into; flat routing and hierarchal routing
or can be separated into time-driven, query-driven & event-driven.
3.4 Data Link Layer The data link layer is liable for multiplexing data frame
detection, data streams, MAC, & error control, confirm the reliability of point–
point (or) point– multipoint.
3.5 Physical Layer The physical layer provides an edge for transferring a stream of
bits above the physical medium. This layer is responsible for the selection of
frequency, generation of a carrier frequency, signal detection, Modulation & data
encryption. IEEE 802.15.4 is suggested as typical for low rate particular areas &
wireless sensor networks with low cost, power consumption, density, the range of
communication to improve the battery life. CSMA/CA is used to support star &
peer to peer topology. There are several versions of IEEE 802.15.4.V. The main
benefits of using this kind of architecture in WSN is that every node involves
simply in less-distance, low- power transmissions to the neighboring nodes due to
which power utilization is low as compared with other kinds of sensor network
architecture. This kind of network is scalable as well as includes a high fault
tolerance
TCP/IP protocol:
The TCP/IP reference model is the most widely used model for internetworking. It
allows diverse networks to communicate with each other. An Internetwork (also
called Internet) is a vast collection of interconnected and diverse networks. These
networks contain different types of computers, different data formats different
addressing mechanisms etc. they can communicate with each other using TCP/IP
model.
Goals:
• Connect multiple networks in a seamless way.
• The network should be able to survive the loss of subnet hardware.
• Flexible architecture is needed since the applications on different networks
were diverse.
The TCP/IP model is a 4 layered model as shown below:
TCP/IP model protocol Suite: Protocols used in the various layers of TCP/IP model
are as shown in following diagram:
1. Host-to-Network Layer:
The TCP/IP model does not define any specific protocol at physical and data link
layer. It
supports all the standard and proprietary protocols.
This layer corresponds to the physical and Data link layer of the OSI model.
2. Network (Internet) Layer:
• The main job of this layer is to transport data packets from the source machine
to the destination.
• In order to connect multiple diverse networks in a seamless manner, the
internet is based on a packet - switching network which is connection less.
• This layer takes care of delivering data from the source host to the destination
host.
• The fundamental protocol operating in this layer is the Internet Protocol (IP).
• IP takes care of addressing and routing the packets through the internetwork.
• It is an unreliable, connectionless protocol and provides best-effort delivery.
This means that the protocol does not take any responsibility for error free
delivery.
DNS (Domain Name System): Used for mapping host names to network address.
HTTP (Hypertext Transfer Protocol): Used to access the World Wide Web.
HTTP :-
HTTP stands for HyperText Transfer Protocol.
It is a protocol used to access the data on the World Wide Web (www).
The HTTP protocol can be used to transfer the data in the form of plain text,
hypertext, audio, video, and so on.
This protocol is known as HyperText Transfer Protocol because of its efficiency
that allows us to use in a hypertext environment where there are rapid jumps
from one document to another document.
HTTP is similar to the FTP as it also transfers the files from one host to another
host. But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no
control connection to transfer the files.
HTTP is used to carry the data in the form of MIME-like format.
HTTP is similar to SMTP as the data is transferred between client and server. The
HTTP differs from the SMTP in the way the messages are sent from the client to
the server and from server to the client. SMTP messages are stored and
forwarded while HTTP messages are delivered immediately.
Features of HTTP:
Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates a
request and waits for a response from the server. When the server receives the
request, the server processes the request and sends back the response to the
HTTP client after which the client disconnects the connection. The connection
between client and server exist only during the current request and response
time only.
Media independent: HTTP protocol is a media independent as data can be sent as
long as both the client and server know how to handle the data content. It is
required for both the client and server to specify the content type in MIME-type
header.
Stateless: HTTP is a stateless protocol as both the client and server know each
other only during the current request. Due to this nature of the protocol, both the
client and server do not retain the information between various requests of the
web pages.
The HTTP protocol is a request/response protocol based on the client/server
based architecture where web browsers, robots and search engines, etc. act like
HTTP clients, and the Web server acts as a server.
Client
The HTTP client sends a request to the server in the form of a request method,
URI, and protocol version, followed by a MIME-like message containing request
modifiers, client information, and possible body content over a TCP/IP
connection.
Server
The HTTP server responds with a status line, including the message's protocol
version and a success or error code, followed by a MIME-like message containing
server information, entity meta information, and possible entity-body content.
HTTP messages are of two types: request and response. Both the message types
follow the same message format.
Request Message: The request message is sent by the client that consists of a
request line, headers, and sometimes a body.
Response Message: The response message is sent by the server to the client that
consists of a status line, headers, and sometimes a body.
Play Video
Uniform Resource Locator (URL)
A client that wants to access the document in an internet needs an address and to
facilitate the access of documents, the HTTP uses the concept of Uniform
Resource Locator (URL).
The Uniform Resource Locator (URL) is a standard way of specifying any kind of
information on the internet.
The URL defines four parts: method, host computer, port, and path.
URL Synatx :- Method :// Host : Port / Path
Method: The method is the protocol used to retrieve the document from a
server. For example, HTTP.
Host: The host is the computer where the information is stored, and the
computer is given an alias name. Web pages are mainly stored in the computers
and the computers are given an alias name that begins with the characters
"www". This field is not mandatory.
Port: The URL can also contain the port number of the server, but it's an optional
field.
Path: Path is the pathname of the file where the information is stored
IOT Protocol:
MQTT
MQTT stands for Message Queuing Telemetry Transport. MQTT is defined as a
protocol used to transport messages between devices and server. It is designed as
a lightweight messaging protocol that uses publish/subscribe (similar to a
message queue) operations to exchange data between the publisher and the
receivers.
Furthermore, MQTT messages are smaller in nature, minimized data packets, low
power usage and ease of implementation makes the protocol ideal for the
“machine-to-machine” or “Internet of Things” world.
In MQTT protocol, communication happens between “MQTT Broker” and MQTT
Clients”.
MQTT Client
MQTT client is a message publisher or receiver which connects to the MQTT
broker (message hub) over the internet which runs on the MQTT library. MQTT
Client may publish a message to an MQTT broker as a publisher and other MQTT
clients subscribed to messages that it wants to receive. To initiate a connection,
the client sends a “CONNECT” message to the broker to establish a
communicational channel.
MQTT Broker
MQTT broker is the central communication point or hub which collects published
messages from the client and dispatches the message channel to the subscribing
MQTT clients. In simple terms, the broker receives the messages from the client,
filters the messages, authenticates which client is subscribed to each message and
then delivers the message to the subscribing clients.
An MQTT message contains a category of the channel called “topic” that MQTT
clients subscribe to and MQTT brokers use these subscription lists for validating
the MQTT clients to accept the message. When a broker receives a CONNECT
message, it responds with a CONNACK message to connect to the client.
Publish/Subscribe
Publish is a technical name used when the sender (client or broker) sends the
“topic”. Subscribe is used when the receiver (subscribed client) receives the
“topic”. Clients publish, subscribe or do both to a topic. In short, Publish is from
the sender and Subscribe is from the receiver.
The MQTT connection is always between client and the broker. Clients never
connect to each other directly. Hence, the clients do not have to know each
other, they only communicate over the topic. This model enables highly scalable
solutions which helps connect millions of devices without dependencies between
the data producers and the data consumers.
QoS (Quality of Service) in MQTT. The QoS plays critical role in handling the
message delivery to subscribers on are different scale.
Each connection can specify a quality of service to the broker with an integer
value ranging from 0-2.
1. 0 specifies publishing terms at most once, or once and only once. It is often
referred to as fire and forget. This does not require an acknowledgement of
delivery.
2. 1 specifies at least once. The message is sent multiple times until it receives
an acknowledgment. This type is known as acknowledged delivery.
3. 2 specifies exactly once. The receiver and sender clients use a two-level
handshake so that only one copy of the message is received. This type is
known as guaranteed delivery.
With so many special features, the MQTT protocol has been able to replace all
other protocols which were used for device-to-device communication over a
decade.
Pros :
1. Efficiency is the selling point of MQTT, as its architecture runs even on
devices with low-power CPUs and low RAM. The result is smoother data
transfers over competing protocols like AMQP. The lightweight architecture
allows MQTT users to implement the protocol quickly and easily.
2. Fewer data packets being sent results in reduced network usage.
3. The reduced power usage makes it ideal for connected devices.
4. MQTT can achieve a more efficient distribution of data.
5. Implementation of remote sensing and control is easier through the
protocol.
Cons.
1. Slower transmit cycles
2. Resource discovery.
3. Lack of security encryption. .
4. Scalability. .
Advantages
1. The packet size used is very small thus maximizing the use of memory
efficiency and allowing for faster communication.
2. Since it operates over UDP, devices can sleep for extended periods and
wake up quickly. This in turn helps to save battery and optimize power
usage.
3. CoAP allows for asynchronous message exchanges.
4. Sensor nodes can send their messages to a multicast group.
5. Offers simple proxy and caching capabilities.
Disadvantages
1. It is a one-to-one protocol, and any broadcast capabilities are not inherent
to the protocol.
2. The publish-subscribe message queue is lacking.
3. It is not an encrypted protocol.
4. In the case of Network Address Translation devices being used, CoAP can
have problems since the IP can be a dynamic IP.
5. CoAP is also an evolving and maturing standard.
XMPP
XMPP stands for Extensible Messaging & Presence Protocol. It is an open set of
rules for streaming XML elements in order to swap messages and presence
information in close to real-time. The XMPP protocol is based on the typical client
server architecture, in which the XMPP client uses the XMPP server with the TCP
socket. XMPP provides a general framework for messaging across a network,
offering a multitude of applications beyond traditional instant messaging (IM) and
the distribution of presence data.
XMPP Architecture
On a structural level, XMPP shares great similarities with protocols that work on
the application layer. For example, it also concerns uniquely named clients
communicating over an associated server. Enforcing the protocol as per both
clients, XMPP monitors and handles routing for them.
The overhead figure illustrates the XMPP architecture straightforwardly.
However, in a complex implementation, multiple XMPP gateways might also exist.
In this scenario, the protocol also needs to takes care of the intercommunication
for multiple domain routing. So, the gateways act as a translating medium
between various protocols and domains that are in the cycle during the
information-exchange.
Additionally, the XMPP gateway brooks the tasks like commencing and
termination of the client-to-server sessios at the intended protocol while
including the demanding protocol translation elements.
Even with the use of considerable gateways and domains, one can succeed in
achieving constant connectivity across all the network points with the help of
XMPP.
While comprehending the XMPP architecture, understanding a few terms is
crucial.
For example, you must know about XMPP stanzas. These, simply, are the small
XML fragments that are used for starting a communication session. they can be of
3 types:
The presence stanza defines the network or user’s present status to others.
For example, the user/network is online or offline.
Message stanza is a pushing instrument essential for chat messages
exchange.
IQ stanza is the element that XMPP utilizes for data requests and
modification. Just as HTTP has GET and POST, XMPP has IQ stanza.
The pros and cons of XMPP
Pros
Addressing scheme to recognise devices on the network
Client-server architecture
Decentralised
Flexible
Open standards and formalised
Cons
Text-based messaging and no provision for end-to-end encryption
No provision for quality of service
Absence of binary data
Limited scope for stability
OSGi
OSGi(Open Service Gateway Initiative ) defines an architecture for developing
modular Java applications. OSGi specification describes a dynamic component
model that allows applications and components, coming in form of bundles, to be
started, stopped and updated without requiring a reboot.
When talking about OSGi, services are in the layer that connects bundles in a
dynamic way by offering a publish-find-bind model for plain old Java objects.
Services are dynamic. Life-cycle is the API defined to install, uninstall, start and
stop bundles.
OSGi architecture is actually about keeping things local and not sharing. OSGi
bundles are plain old JARs and, as we know, in normal Java everything in a JAR is
completely visible to all other JARs. In OSGi, by default, there is no sharing. OSGi
hides everything unless it is explicitly exported.