IoT Module 2 Note
IoT Module 2 Note
Module- 2
2.1 Bluetooth
2.2 Zigbee
2.3 WiFi
2.4 GPS
2.5 IPv4 & IPv6
2.6 6LoWPAN
2.7 RPL
2.8 TCP & UDP
2.9 MQTT
2.10 CoAP
2.11 XMPP
Layered architecture in IoT refers to a structured approach that organizes the various
components and functions of an IoT system into distinct layers. This architecture helps
to manage complexity by separating concerns, allowing each layer to focus on specific
tasks while interacting with other layers to achieve the overall system objectives.
1. Sensing Layer: This foundational layer consists of sensors and actuators that
interact with the physical world to collect raw data, such as temperature, humidity,
and motion. Sensors gather data, while actuators perform actions based on this data.
2. Network Layer: Responsible for transmitting the data collected by the sensing layer,
this layer uses communication technologies like Wi-Fi, Bluetooth, Zigbee, and LTE to
relay data from sensors to processing systems or cloud platforms. It ensures data is
transferred reliably and efficiently.
3. Data Processing Layer: Here, raw data is analyzed and processed to extract
meaningful insights. This layer includes data processing units and analytics tools that
perform tasks such as data filtering, aggregation, and advanced analytics, often
utilizing machine learning algorithms to generate actionable information.
4. Application Layer: The final layer delivers end-user services and interfaces. It
includes smart applications that utilize the processed data to provide various
functionalities such as automation, remote monitoring, and control. This layer allows
users to interact with and manage IoT devices and systems based on the insights
generated from the data.
Fig: 1
2. IoT Communication Protocols/ Modules
Bluetooth:
Bluetooth is a wireless LAN technology designed to connect devices of different
functions such as telephones, notebooks, computers (desktop and laptop), cameras,
printers, coffee makers, and so on. A Bluetooth LAN is an ad hoc network, which
means that the network is formed spontaneously; the devices, sometimes called
gadgets, find each other and make a network called a piconet. A Bluetooth LAN can
even be connected to the Internet if one of the gadgets has this capability. A Bluetooth
LAN, by nature, cannot be large. If there are many gadgets that try to connect, there
is chaos.
Bluetooth technology is the implementation of a protocol defined by the IEEE 802.15
standard. The standard defines a wireless personal-area network (PAN) operable in an
area the size of a room or a hall.
• Architecture
Bluetooth defines two types of networks: piconet and scatternet.
Piconets:
A Bluetooth network is called a piconet, or a small net. A piconet can have up to eight
stations, one of which is called the primary; the rest are called secondaries. All the
secondary stations synchronize their clocks and hopping sequence with the primary.
Note that a piconet can have only one primary station. The communication between
the primary and the secondary can be one-to-one or one-to-many.
Although a piconet can have a maximum of seven secondaries, an additional eight
secondaries can be in the parked state. A secondary in a parked state is synchronized
with the primary, but cannot take part in communication until it is moved from the
parked state. Because only eight stations can be active in a piconet, activating a station
from the parked state means that an active station must go to the parked state.
Fig 2: Piconet
Bluetooth uses the frequency-hopping spread spectrum (FHSS) method in the physical
layer to avoid interference from other devices or other networks. Bluetooth hops 1600
times per second, which means that each device changes its modulation frequency
1600 times per second. A device uses a frequency for only 625 us (1/1600 s) before it
hops to another frequency; the dwell time is 625 us.
The primary and secondary communicate with each other using time slots. The length
of a time slot is exactly the same as the dwell time, 625 us. This means that during the
time that one frequency is used, a sender sends a frame to a secondary, or a secondary
sends a frame to the primary. Note that the communication is only between the
primary and a secondary; secondaries cannot communicate directly with one another.
Bluetooth uses a form of TDMA that is called TDD-TDMA (time division duplex TDMA).
TDD-TDMA is a kind of half-duplex communication in which the secondary and
receiver send and receive data, but not at the same time (half-duplex); however, the
communication for each direction uses different hops. This is similar to walkie-talkies
using different carrier frequencies. Single-Secondary Communication If the piconet
has only one secondary, the TDMA operation is very simple. The time is divided into
slots of 625 μs. The primary uses even numbered slots (0, 2, 4, ...); the secondary uses
odd-numbered slots (1, 3, 5, ...). TDD-TDMA allows the primary and the secondary to
communicate in half-duplex mode.
Low data rates, low cost, and low power consumption: ZigBee uses low data rates
to conserve power, is cost-effective, and consumes minimal energy, which is
perfect for battery-operated devices.
Supports more devices and longer range than Bluetooth: ZigBee networks can
connect a larger number of devices and offer a longer communication range
between devices compared to Bluetooth, making it suitable for larger IoT
networks.
Zigbee Coordinator (ZC): Each Zigbee network has one Zigbee Coordinator that
serves as the root of the network. The coordinator is responsible for initializing
and managing the network, including assigning addresses to devices and
maintaining overall network control.
Zigbee Router (ZR): Routers are intermediary devices that help pass data between
End Devices and the Coordinator. They can also run their own applications and
extend the network range by relaying data across multiple devices.
Zigbee End Devices (ZED): These devices provide basic functionality and are
typically low-power sensors or actuators. They cannot communicate directly with
each other; instead, they rely on the Coordinator or Routers to relay their
messages.
Star Topology (ZigBee Smart Energy): All devices communicate directly with the
Zigbee Coordinator (ZC), which acts as the central hub. The coordinator manages
the network and controls all communication. This setup is simple but has a limited
range and depends on the coordinator, so if the Coordinator fails, the network
stops working.
Mesh Topology (Self-Healing Process): All Zigbee devices can communicate with
each other, either directly or through multiple hops via Routers. This topology is
very reliable because if one path fails, the network finds another path to send the
data. Mesh networks are best for large areas and are very robust against device
failures.
Tree Topology: The Zigbee Coordinator is at the top, with Zigbee Routers (ZRs)
forming the middle layers and Zigbee End Devices (ZEDs) at the bottom. Routers
extend the network's range by forwarding data from End Devices to the
Coordinator. If a Router fails, some devices may lose their connection, but the rest
of the network can continue working.
Applications:
Home Automation
Medical Data Collection
Industrial Control Systems
Advantages:
Limitations:
Limited range
Limited data rate
2.3 WiFi:
wireless LAN standard was dubbed 802.11 which is known as WiFi. It runs at speeds anywhere
from 11to hundreds of Mbps. (1 Mbps is 1,000,000 bits/sec ).
802.11 systems operate in unlicensed bands such as the ISM (Industrial, Scientific, and
Medical) bands defined by ITU-R (e.g., 902-928 MHz, 2.4-2.5 GHz, 5.725-5.825 GHz).
802.11 networks are made up of clients, such as laptops and mobile phones, and
infrastructure called APs (access points) that is installed in buildings. Access points are
sometimes called base stations. The access points connect to the wired network, and all
communication between clients goes through an access point. It is also possible for clients
that are in radio range to talk directly, such as two computers in an office without an access
point. This arrangement is called an ad hoc network. It is used much less often than the access
point mode.
Multipath fading:
802.11 transmission is complicated by wireless conditions that vary with even small changes
in the environment. At the frequencies used for 802.11, radio signals can be reflected off solid
objects so that multiple echoes of a transmission may reach a receiver along different paths.
The echoes can cancel or reinforce each other, causing the received signal to fluctuate greatly.
This phenomenon is called multipath fading.
The key idea for overcoming variable wireless conditions is path diversity, or the sending of
information along multiple, independent paths. In this way, the information is likely to be
received even if one of the paths happens to be poor due to a fade.
Since wireless is inherently a broadcast medium, 802.11 radios also have to deal with the
problem that multiple transmissions that are sent at the same time will collide, which may
interfere with reception. To handle this problem, 802.11 uses a CSMA (Carrier Sense Multiple
Access). Computers wait for a short random interval before transmitting, and defer their
transmissions if they hear that someone else is already transmitting. This scheme makes it less
likely that two computers will send at the same time.
Another problem is that of mobility. If a mobile client is moved away from the access point it
is using and into the range of a different access point, some way of handing it off is needed.
The solution is that an 802.11 network can consist of multiple cells, each with its own access
point, and a distribution system that connects the cells. The distribution system is often
switched Ethernet, but it can use any technology. As the clients move, they may find another
access point with a better signal than the one they are currently using and change their
association. From the outside, the entire system looks like a single wired LAN.
Finally, there is the problem of security. Since wireless transmissions are broadcast, it is easy
for nearby computers to receive packets of information that were not intended for them. To
prevent this, the 802.11 standard included an encryption scheme known as WiFi Protected
Access, initially called WPA but now replaced by WPA2.
Frequency Bands: Operates in both 2.4 GHz and 5 GHz bands. The 2.4 GHz band
offers broader coverage with slower speeds, while the 5 GHz band provides faster
speeds but shorter range.
Range: Typically, up to 100 meters indoors and 300 meters outdoors, though this
depends on environmental factors and the specific WiFi standard used.
Data Rate: Varies by standard (e.g., 802.11n offers up to 600 Mbps, 802.11ac up
to 1.3 Gbps, and 802.11ax, also known as WiFi 6, up to 9.6 Gbps).
Power Consumption: Higher than Bluetooth and Zigbee, which makes it less ideal
for battery-operated devices.
Topology: Supports star topology (all devices communicate through an access
point).
Applications:
Advantages:
High Data Rate: Suitable for applications requiring high-speed data transfer, such
as video streaming, file sharing, and online gaming.
Wide Range: Provides extensive coverage, especially with the use of multiple
access points.
Limitations:
Interference and Congestion: The 2.4 GHz band is crowded with other devices,
which can cause interference. The 5 GHz band, while faster, has a shorter range
and is also becoming increasingly congested.
2.4 GPS (Global Positioning System): GPS determines precise locations on Earth
using satellite signals. It's crucial for navigation, mapping, and tracking. GPS provides
real-time location updates and works in all weather conditions. In IoT, it enhances
tracking and monitoring by offering accurate location data, improving operational
efficiency. It functions through satellites transmitting signals that receivers use for
triangulation. However, accuracy can be affected by signal interference, weather, and
receiver location, and there are privacy and security concerns.
Accuracy: Provides location accuracy typically within a few meters, but this can be
enhanced with additional techniques like Differential GPS (DGPS) or Real-Time
Kinematic (RTK) for centimeter-level accuracy.
Applications:
Advantages:
Global Coverage: Provides location data anywhere on the planet, without the
need for local infrastructure.
High Accuracy: Offers precise location data, essential for navigation, tracking, and
geofencing applications.
Real-Time Data: Enables real-time location tracking, which is crucial for time-
sensitive applications.
Limitations:
Power Consumption: High power usage limits its use in battery-powered devices
unless supplemented with other lower-power technologies.
Signal Interference: GPS signals can be obstructed by tall buildings, dense forests,
or adverse weather conditions, reducing accuracy or availability.
2.5.1 IPv4
IPv4 addresses consist of two things: the network address and the host address. IPv4
addresses are 32-bit integers that have to be expressed in Decimal Notation. It is
represented by 4 numbers separated by dots in the range of 0-255, which have to be
converted to 0 and 1, to be understood by Computers.
2.5.2 Drawbacks/Challenges of IPv4
Limited Address Space: IPv4 has a limited number of addresses, which is not
enough for the growing number of devices connecting to the internet.
Less Efficient Routing: The IPv4 header is more complex, which can slow down
data processing and routing.
Security Issues: IPv4 does not have built-in security features, making it more
vulnerable to attacks unless extra security measures are added.
Limited Support for Quality of Service (QoS): IPv4 has limited capabilities for
prioritizing certain types of data, which can affect the performance of real-time
applications like video streaming and VoIP.
2.5.3 IPv6
IP version 6 is the new version of Internet Protocol, which is way better than IP version
4 in terms of complexity and efficiency. IPv6 is written as a group of 8 hexadecimal
numbers separated by colon (:). It can be written as 128 bits of 0s and 1s.
Larger Address Space: IPv6 has a greater address space than IPv4, which is
required for expanding the IP Connected Devices. IPv6 has 128 bit IP Address
rather and IPv4 has a 32-bit Address.
Improved Security: IPv6 has some improved security which is built in with it. IPv6
offers security like Data Authentication, Data Encryption, etc. Here, an Internet
Connection is more Secure.
Simplified Header Format: As compared to IPv4, IPv6 has a simpler and more
effective header Structure, which is more cost-effective and also increases the
speed of Internet Connection.
Prioritize: IPv6 contains stronger and more reliable support for QoS features,
which helps in increasing traffic over websites and increases audio and video
quality on pages.
Improved Support for Mobile Devices: IPv6 has increased and better support for
Mobile Devices. It helps in making quick connections over other Mobile Devices
and in a safer way than IPv4.
Transition from IPv4: Moving from IPv4 to IPv6 requires careful planning and
investment, as many networks still use IPv4.
2.6 6LoWPAN: 6LoWPAN stands for IPv6 over Low-Power Wireless Personal Area
Networks, a protocol designed to connect small, low-power devices over wireless
networks. 6LoWPAN is a protocol that extends IPv6 for use in Wireless Personal Area
Networks (WPANs), where devices connect wirelessly around a person’s workspace.
It allows communication using the IPv6 protocol, which is faster, more reliable, and
provides a larger address space. 6LoWPAN is designed for small devices with limited
processing power, enabling them to communicate efficiently and at a low cost. It is
characterized by short range, low memory usage, and low bit rates, making it ideal for
IoT applications.
Advantages of 6LoWPAN:
Applications of 6LoWPAN:
2.7 RPL: RPL stands for Routing Protocol for Low Power and Lossy Networks for
heterogeneous traffic networks. It is a routing protocol for Wireless Networks. This
protocol is based on the same standard as by Zigbee and 6 Lowpan is IEEE 802.15.4 It
holds both many-to-one and one-to-one communication.
It is a Distance Vector Routing Protocol that creates a tree-like routing topology called
the Destination Oriented Directed Acyclic Graph (DODAG), rooted towards one or
more nodes called the root node or sink node. The Directed Acyclic Graphs (DAGs) are
created based on user-specified specific Objective Function (OF). The OF defines the
method to find the best-optimized route among the number of sensor devices.
Storing Mode:
Every node maintains a full routing table of the entire network. This allows nodes to
determine the next hop for any destination. Suitable for networks where nodes have
sufficient memory to store the entire routing table.
Non-Storing Mode:
Only the border router maintains the full routing table. Intermediate nodes only keep
track of their parent nodes. Nodes forward packets to the border router, which then
directs them to the final destination. This mode is more memory-efficient for nodes
with limited resources.
2.7.1 Features and Benefits of RPL:
Scalability: RPL supports large networks with low-power and lossy connectivity,
making it ideal for diverse IoT applications.
Quality of Service (QoS): RPL incorporates mechanisms for reliable packet delivery
and congestion control, ensuring consistent network performance.
Implementation/ Applications
Internet traffic consists of numerous data transfers between servers and devices. Data
on the internet is primarily transferred using two protocols: TCP (Transmission Control
Protocol) and UDP (User Datagram Protocol). Both TCP and UDP have their own
strengths and weaknesses, which can be utilized to optimize the browsing experience.
Main Difference:
The key distinction between the two protocols is that TCP is connection-based,
meaning it establishes a connection before data transfer, while UDP is connection-less,
meaning it sends data without establishing a connection. TCP is more reliable because
it ensures that data is transferred correctly and in the correct order. However, this
reliability comes at the cost of speed. UDP is faster because it has less overhead and
does not ensure the reliability of the data transfer, making it less reliable. Because of
these differences, each protocol is better suited for specific types of data transfers.
TCP is ideal for applications requiring accuracy, while UDP is suitable for applications
where speed is more important.
Step 1 - Client Sends SYN: The device (client) starts by sending a special number,
called a SYN, to the server. This number tells the server where the data transfer
should begin.
Step 3 - Client Sends ACK: The client then acknowledges the server's response
(ACK). This completes the connection, and data transfer can start.
Maintaining the Connection: The connection between the client and server remains
active until all data is successfully transferred. Each time data is sent, the receiver must
send an acknowledgment. If the acknowledgment isn’t received, the data is resent.
Error Handling: If a data packet is faulty or lost, it is discarded, and a new packet is
sent. Even if there are issues like heavy traffic, the transmission continues without
breaking the connection.
Guaranteed Delivery: These steps ensure that data is delivered accurately and reliably
with TCP.
TCP ensures that messages are sent and received accurately. For example, when you
send an email, TCP makes sure that the entire message reaches the recipient without
any errors.
TCP is used for transferring files over the internet, such as through FTP (File Transfer
Protocol). It ensures that files are downloaded or uploaded completely and without
corruption.
(iii) Web Browsing:
When you browse the web, TCP is used to load web pages. It ensures that all parts of
the webpage (text, images, videos) are correctly delivered to your browser.
2.8.4 Disadvantages of TCP: TCP isn’t suited for some types of data transfers,
especially ones that require faster speeds. These are the drawbacks of TCP packet
transmission:
It can prevent data from loading if some data is lost. For example, it won’t load
images on a web page until all of the page data has been delivered.
It reduces its transfer rate if the network is congested, resulting in even slower
speeds.
Sending Data Packets: Data is broken into packets and sent quickly to the receiver,
one after another.
Recipient Responsibility: The receiver must handle any issues like out-of-order,
lost, or erroneous packets.
Speed Over Reliability: UDP is used where speed is critical, like in live streaming
or online gaming, where quick transmission is more important than perfect
delivery.
(i) Online Gaming: UDP is used in online games for fast data transmission, allowing
real-time interactions without delays.
(iv) VoIP (In-App Voice Calling): UDP is used in voice-over-IP applications to enable
quick voice transmission, prioritizing speed over perfect delivery.
2.8.7 Advantages of UDP: UDP delivers data rapidly, and it doesn’t slow down or
turn back to recollect lost data. This makes it an ideal protocol for delivering
continuous data or broadcasting.
In case of a data collision, routers will often drop UDP packets and favor TCP
packets.
Multiple users accepting UDP data can cause congestion, and there’s no way to
mitigate this.
It cannot sequence data, so data can arrive in any order or out of order.
2.9 MQTT:
Key Characteristics:
(ii) Lightweight: Minimal header size -makes it ideal for low-bandwidth environments.
(iii) Retained Messages: The broker retains the last message for a topic, delivering it
to new subscribers immediately.
2.10 CoAP
Key Characteristics:-
(i) UDP-Based: Utilizes UDP (User Datagram Protocol) for efficient communication in
limited-resource environments.
(ii) HTTP-Like Semantics: Supports familiar methods like GET, POST, PUT, and DELETE
for interactions.
(iii) Multicast Support: Enables multicast messaging, allowing multiple clients to
receive messages simultaneously.
(iv) Low Overhead: Minimizes protocol overhead, making it suitable for constrained
networks.
2.11 XMPP:
Key Characteristics:
Wired communication protocols play a crucial role in IoT, especially in scenarios where
reliable and secure data transmission is required over a physical medium.
Understanding these protocols, their applications, and their differences is crucial for
optimizing IoT systems.
External Protocols:
3.1. USB (Universal Serial Bus): A common protocol for connecting devices like
phones, computers, and peripherals (e.g., keyboards, mice). USB uses a master-slave
setup, where a computer (master) controls the connected devices (slaves). Data is
transferred in packets.
Pros:
Fast and Simple: Easy to use with quick data transfer rates.
Widely Compatible: Works with many types of devices.
Cons:
Pros:
Cons:
Limited Data Size: Can only send small amounts of data (up to 9 bits).
No Multi-Master Support: Only supports single master and single slave
communication.
3.3 RS-232: A standard protocol for serial communication commonly used in older
computer systems. Transfers data between a computer and peripherals like a modem.
It uses voltage levels to represent binary data.
Pros:
Cons:
Half-Duplex: Can only send or receive data at one time, not both.
Non-Standard Connectors: Different devices may use different connectors.
3.4 Ethernet: A protocol used to connect computers and devices in a Local Area
Network (LAN). Uses cables to connect devices to a network switch, which manages
data transmission between them. Ethernet supports different speeds (10 Mbps, 100
Mbps, 1000 Mbps).
Pros:
Cons:
Limited Range: Works well within buildings but not over long distances without
additional equipment.
Requires Cabling: Needs a lot of cables, which can be difficult to manage in large
setups.
Internal Protocols:
Less Wiring: Only two wires are needed for multiple devices.
Supports Multiple Devices: Many devices can be connected on the same bus.
Cons:
Pros:
Cons:
More secure; less prone to hackin Less secure; higher risk of signal i
Security
g nterception
High bandwidth; good for data- Limited bandwidth; may struggle
Bandwidth
heavy applications with high data loads
Higher latency; potential delays
Low latency; faster data transmiss
Latency
ion
Scalability Harder to scale Easier to scale
Best for high bandwidth, stable e Ideal for flexible, mobile setups (e
Use Cases
nvironments (e.g., data centers) .g., offices, remote areas)
1. Mains Electricity: Plugged into the electrical grid. Used in fixed-location devices
like smart home gadgets and industrial equipment.
2. Batteries: Used for portable devices. Rechargeable for frequent use; Primary
(one-time use) for low-power needs. Common in wearables, sensors, and tools.
3. Energy Harvesting: Converts ambient energy (light, motion, heat, RF) into
electricity. Ideal for remote or low-power devices where battery replacement is
difficult.