0% found this document useful (0 votes)
25 views27 pages

IoT Module 2 Note

Uploaded by

sc.cse
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)
25 views27 pages

IoT Module 2 Note

Uploaded by

sc.cse
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/ 27

Internet of Things (ESCM301)

Module- 2

1. IoT Layered Architecture

2. IoT Communication Protocols/ Modules

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

3. Wired Communication Protocols in IoT

4. Power Sources in IoT

1. IoT Layered Architecture:

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

Scatternet: Piconets can be combined to form what is called a scatternet. A secondary


station in one piconet can be the primary in another piconet. This station can receive
messages from the primary in the first piconet (as a secondary) and, acting as a
primary, deliver them to secondaries in the second piconet.
Fig 3: Scatternet

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.

Fig 4: Communication between one primary and one secondary


Let us elaborate on the figure.
1. In slot 0, the primary sends a frame to secondary 1.
2. In slot 1, only secondary I sends a frame to the primary because the previous frame
was addressed to secondary 1; other secondaries are silent.
3. In slot 2, the primary sends a frame to secondary 2.
4. In slot 3, only secondary 2 sends a frame to the primary because the previous frame
was addressed to secondary 2; other secondaries are silent.
5. The cycle continues.

Fig 5: Communication between one primary and two secondary

Let us elaborate on the figure.


1. In slot 0, the primary sends a frame to secondary 1.
2. In slot 1, only secondary I sends a frame to the primary because the previous frame
was addressed to secondary 1; other secondaries are silent.
3. In slot 2, the primary sends a frame to secondary 2.
4. In slot 3, only secondary 2 sends a frame to the primary because the previous frame
was addressed to secondary 2; other secondaries are silent.
5. The cycle continues.
A frame in the baseband layer can be one of three types: one-slot, three-slot, or five-
slot.
A slot, as we said before, is 625 μs. However, in a one-slot frame exchange, 259us is
needed for hopping and control mechanisms. This means that a one-slot frame can
last only 625 - 259, or 366 μs. A three-slot frame occupies three slots. However, since
259 μs is used for hopping, the length of the frame is 3 x 625 - 259 = 1616 μs. A five-slot
frame also uses 259 bits for hopping, which means that the length of the
frame is 5 x 625 - 259 =2866 μs.
Applications: Bluetooth technology has several applications. Peripheral devices such
as a wireless mouse or keyboard can communicate with the computer through this
technology. Monitoring devices can communicate with sensor devices in a small
health care center. Home security devices can use this technology to connect different
sensors to the main security controller. Conference attendees can synchronize their
laptop computers at a conference.

2.2 Zigbee: ZigBee is a wireless communication technology designed specifically for


control and automation tasks in IoT applications. It is widely used in smart homes,
industrial automation, healthcare, and other fields that require reliable and secure
communication.

 ZigBee is focused on control and automation: It is designed specifically for tasks


like controlling devices and automating processes, making it ideal for smart home
and industrial applications.

 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.

2.2.1 Zigbee: Architecture:

 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.

2.2.2 Zigbee: Topology

 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.

2.2.3 Zigbee: Characteristics

 Low Power Consumption


 Low Data Rate (20- 250 kbps)
 Short-Range (75-100 meters)
 Network Join Time (~ 30 msec)
 Support Small and Large Networks (up to 65000 devices (Theory); 240 devices
(Practically))
 Low Cost of Products and Cheap Implementation (Open-Source Protocol)
 3 frequency bands with 27 channels.
Operating Frequency Bands (Only one channel will be selected for use in a network):

Channel 0: 868 MHz (Europe)


Channel 1-10: 915 MHz (the US and Australia)
Channel 11-26: 2.4 GHz (Across the World)

Applications:

 Home Automation
 Medical Data Collection
 Industrial Control Systems

Advantages:

 Low Power Consumption


 Security and Application Support
 Easy Implementation
 Mesh Networking
 High Reliability
 Cost-Effective

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.

2.3.1 Key Features of WiFi:

 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:

 Smart Home and Consumer Electronics


 Video Surveillance
 Enterprise and Industrial IoT

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.

 Ubiquity: WiFi is widespread, making it easy to connect to existing networks and


the internet.

Limitations:

 Power Consumption: Higher power consumption compared to Bluetooth and


Zigbee, making it less suitable for battery-powered devices.

 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.

 Security Concerns: While modern WiFi standards have strong encryption,


networks are still vulnerable to various types of cyber-attacks if not properly
secured.

Wireless WAN: SATELLITE NETWORKS:


Satellites can provide transmission capability to and from any location on Earth, no matter
how remote. This advantage makes high-quality communication available to undeveloped
parts of the world without requiring a huge investment in ground-based infrastructure.
Based on the location of the orbit, satellites can be divided into three categories:
geostationary Earth orbit (GEO), low-Earth-orbit (LEO), and middle-Earth-orbit (MEO).
One reason for having different orbits is due to the existence of two Van Allen belts. A Van
Allen belt is a layer that contains charged particles. A satellite orbiting in one of these two
belts would be totally destroyed by the energetic charged particles. The MEO orbits are
located between these two belts.
Medium-Earth-orbit (MEO) satellites are positioned between the two Van Allen belts. A
satellite at this orbit takes approximately 6-8 hours to circle the Earth.
Global Positioning System
One example of a MEO satellite system is the Global Positioning System (GPS), constracted
and operated by the US Department of Defense, orbiting at an altitude about 18,000 km
(11,000 mi) above the Earth. The system consists of 24 satellites and is used for land, sea, and
air navigation to provide time and locations for vehicles and ships. GPS uses 24 satellites in six
orbits, as shown in Figure 16.17. The orbits and the locations of the satellites in each orbit are
designed in such a way that, at any time, four satellites are visible from any point on Earth. A
GPS receiver has an almanac that tells the current position of each satellite.
Trilateration GPS is based on a principle called trilateration. We need at least four spheres to
find our exact position in space (longitude, latitude, and altitude).
Measuring the Distance
The trilateration principle can find our location on the earth if we know our distance from
three satellites and know the position of each satellite. The position of each satellite can be
calculated by a GPS receiver (using the predetermined path of the satellites). The GPS receiver,
then, needs to find its distance from at least three GPS satellites (center of the spheres).
Measuring the distance is done using a principle called one-way ranging.

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.

2.4.1 Key Features of GPS:


 Frequency Bands: Uses L1 (1575.42 MHz) and L2 (1227.60 MHz) frequencies.

 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.

 Power Consumption: Relatively high compared to Bluetooth and Zigbee.


Continuous GPS tracking can drain battery-powered devices quickly.

 Availability: Available globally, providing consistent and reliable location data.

Applications:

 Vehicle Tracking and Fleet Management


 Asset Tracking and Personal Navigation
 Emergency Response

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 IPv4 & IPv6:

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.

 Complex Configuration: IPv4 often requires manual configuration or DHCP to


assign addresses, which can be time-consuming and prone to errors.

 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.

 Fragmentation: IPv4 allows routers to fragment packets, which can lead to


inefficiencies and increased chances of data being lost or corrupted.

 Broadcasting Overhead: IPv4 uses broadcasting to communicate with multiple


devices on a network, which can create unnecessary network traffic and reduce
performance.

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.

2.5.4 Benefits of IPv6 over IPv4

 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.

2.5.5 Difference Between IPv4 and IPv6


IPv4 IPv6
IPv4 has a 32-bit address length IPv6 has a 128-bit address length
It Supports Manual and DHCP address It supports Auto and renumbering add
configuration ress configuration
In IPv4 end to end, connection integrit In IPv6 end-to-
y is Unachievable end, connection integrity is Achievable
It can generate 4.29×109 address spac The address space of IPv6 is quite large
e it can produce 3.4×1038 address spac
e
The Security feature is dependent on t IPSEC is an inbuilt security feature in th
he application e IPv6 protocol
Address representation of IPv4 is in de Address representation of IPv6 is in he
cimal xadecimal
IPv4’s IP addresses are divided into fi IPv6 does not have any classes of the I
ve different classes. Class A , Class B, C P address.
lass C, Class D , Class E.
It has a broadcast Message Transmissi In IPv6 multicast and anycast message
on Scheme transmission scheme is available

2.5.6 Benefits and Challenges of IPv6 for IoT:

Benefits of IPv6 for IoT:


 Scalability: IPv6's vast address space supports easy network expansion as more
IoT devices are added.

 Interoperability: IPv6 ensures seamless communication across various devices


and networks, enhancing compatibility among different IoT platforms.

 Future-Proofing: IPv6 adoption aligns with future technological growth, ensuring


IoT networks remain relevant.

Challenges in Implementing IPv6 for IoT:

 Transition from IPv4: Moving from IPv4 to IPv6 requires careful planning and
investment, as many networks still use IPv4.

 Address Management Complexity: Managing numerous IPv6 addresses can be


challenging, particularly in large IoT networks.

 Security Concerns: Proper configuration of IPv6 is essential to avoid security


vulnerabilities, despite its advanced features.

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.

2.6.1 6LoWPAN Features:

 Compatible with IEEE 802.15.4 in the 2.4 GHz band.


 Outdoor range up to 200 meters.
 Data rate up to 200 kbps.
 Supports up to 100 nodes.

Advantages of 6LoWPAN:

 Robust, and self-healing mesh network.


 Low-cost and secure communication for IoT devices.
 Supports IPv6, enabling direct routing to cloud platforms.
 Supports one-to-many and many-to-one routing.
 Leaf nodes can remain in sleep mode for longer duration.
Disadvantages of 6LoWPAN:

 Less secure than Zigbee.


 Less resistant to interference compared to Wi-Fi and Bluetooth.
 Limited range without mesh topology.

Applications of 6LoWPAN:

 Wireless sensor networks.


 Home automation.
 Smart agriculture and industrial monitoring.
 Enables IPv6 packet transmission on networks with limited power and reliability.

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.

 Multipoint-to-Point Traffic: The protocol efficiently handles data aggregation


from multiple devices to a single destination, which is common in sensor networks.

 Quality of Service (QoS): RPL incorporates mechanisms for reliable packet delivery
and congestion control, ensuring consistent network performance.

 Adaptability: The protocol dynamically adjusts routes in response to changes in


network conditions, such as link quality and energy levels of nodes.

 Security: RPL includes security features like authentication, integrity protection,


confidentiality, and encryption to safeguard communications.

Implementation/ Applications

Contiki OS: RPL is commonly implemented in Contiki OS, an open-source operating


system designed for IoT devices, particularly low-power wireless devices. Contiki OS
provides a platform for simulating and deploying IoT applications.

2.8 TCP & UDP:

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.

2.8.1 TCP (How TCP Works):


TCP uses a three-step process to create a connection between a device and a server.

 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 2 - Server Responds with SYN-ACK: The server responds by acknowledging


the client's SYN and sends back its own SYN number, in a step called SYN-ACK.

 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.

2.8.2 Applications of TCP:

(i) Email or Texting:

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.

(ii) File Transfers:

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.3 Advantages of TCP: Transmission control protocol (TCP) is the protocol to


choose for maximum reliability and quality. It may not be the fastest, but it gets the
job done right. Here are a few advantages of the TCP protocol:

 It sets up and maintains a connection between sender and receiver.

 It operates independently of the operating system.

 It supports many routing protocols.

 It checks for errors, guaranteeing data arrives at its destination unaltered.

 It confirms data arrival after delivery, or attempts to re-transfer.

 It’s able to send data in a particular sequence.

 It optimizes the pace of data transmission based on the receiver.

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 uses more bandwidth and is slower than UDP.

 It’s especially slow at the beginning of a file transfer.

 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.

 It’s not suited for LAN and PAN networks.

 It can’t multicast or broadcast.

2.8.5 UDP (How UDP Works):


 No Connection Setup: UDP sends data immediately without establishing a
connection, making the process fast.

 Sending Data Packets: Data is broken into packets and sent quickly to the receiver,
one after another.

 No Sequence or Acknowledgment: Packets are sent without order or tracking; the


sender doesn’t know if they arrive or if they’re in the correct order.

 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.

2.8.6 Applications of UDP:

(i) Online Gaming: UDP is used in online games for fast data transmission, allowing
real-time interactions without delays.

(ii) Multicasting: UDP efficiently sends data to multiple recipients simultaneously,


making it ideal for applications like live broadcasts.

(iii) Video Chatting/Conferencing: UDP supports real-time video communication by


quickly transmitting video and audio packets.

(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.

 No connection is needed to send or receive data, so apps and operating systems


work faster.
 Broadcast and multicast transmission is available, meaning one UDP
transmission can send data to multiple recipients.

 It endures packet loss, delivering data even if it's incomplete.

 Smaller packet size and less overhead reduce end-to-end delay.

 Operates over a larger range of network conditions than TCP.

 UDP communication is more efficient.

 It can transmit live and real-time data.

2.8.8 Disadvantages of UDP:

 It’s connection-less, which makes data transfer unreliable.

 There’s no system in place to acknowledge a successful data transfer.

 There’s no way to know if data is delivered in its original state, or at all.

 It has no error control, so it drops packets when errors are detected.

 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.8.9 Differences between TCP and UDP

Factor TCP UDP


Connection type Requires an established con No connection is needed to
nection before transmitting start and end a data transfe
data r
Can sequence data (send in Cannot sequence or arrange
Data sequence
a specific order) data
Can retransmit data if packe No data retransmitting. Lost
Data retransmission
ts fail to arrive data can’t be retrieved

Delivery Delivery is guaranteed Delivery is not guaranteed


Minimal error-
Thorough error-
checking covers the basics b
Check for errors checking guarantees data ar
ut may not prevent all error
rives in its intended state
s
Broadcasting Not supported Supported
Slow, but complete data deli Fast, but at risk of incomplet
Speed
very e data delivery

2.9 MQTT:

Message Queuing Telemetry Transport (MQTT) is a lightweight, TCP-based messaging


protocol designed for efficient communication between resource-constrained IoT
devices using a publish-subscribe model. These features make MQTT a preferred
choice for IoT applications, including smart homes and industrial automation.

Key Characteristics:

(i) Publish-Subscribe Model: Publishers send messages to topics, and subscribers


receive messages based on their subscriptions, enhancing scalability.

(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.

(iv) Session Management: Supports session persistence, allowing clients to reconnect


without losing messages.

2.10 CoAP

Constrained Application Protocol (CoAP) is a client-server protocol designed for


resource-constrained devices. It allows communication between client nodes and a
CoAP server, which shares information based on its logic without requiring
acknowledgment. CoAP is commonly used in applications like smart homes, industrial
automation.

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.10.1 Differences between MQTT and CoAP:

Factor MQTT CoAP


Communication Ty It uses Publish-
It uses Request-Response model
pe Subscribe model

This uses only Asynchro This uses both Asynchronous an


Messaging Mode
nous d Synchronous
This mainly uses Trans
Transport layer pro This mainly uses User Datagram
mission Control protoc
tocol Protocol (UDP)
ol (TCP)
Reliability High Medium
Power Usage Higher Lower
Latency Medium Low
It is used in IoT applica It is used in Utility area network
Usability/Security
tions and is secure s and has secured mechanism.

2.11 XMPP:

XMPP (Extensible Messaging and Presence Protocol) is an open-standard protocol for


real-time messaging and presence information. It uses XML (Extensible Markup
Language) to facilitate message exchange over the internet in a decentralized way,
allowing users to communicate across different platforms. It is widely used in chat
apps for real-time messaging, provides presence information for user availability in
social networking and collaboration tools, facilitates VoIP and video conferencing.

Key Characteristics:

 Extensibility: Developers can add custom features through various extensions


(XEPs).

 Real-Time Communication: Supports instant message delivery and presence


updates.

 Federation: Different servers can communicate, allowing users on different


platforms to interact.
 Presence Information: Users can see and share their availability status (online,
offline, busy).

 Multi-Communication Types: Supports text, voice, video, and file transfer.

 Security: Provides encryption and security features to protect messages.

3. Wired Communication Protocols in IoT

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:

 Needs Powerful Host: Requires a capable master device (like a PC).


 Driver Requirements: Specific drivers are needed for different devices.

3.2 UART/USART (Universal Asynchronous Receiver Transmitter /


Universal Synchronous Asynchronous Receiver Transmitter): Protocols
used for serial communication between devices. Converts parallel data to serial form
for transmission and back to parallel at the receiver end. UART doesn’t use a clock
signal (asynchronous), while USART can use a clock (synchronous or asynchronous).

Pros:

 No Clock Needed: UART doesn’t need a clock, reducing complexity.


 Simple Wiring: Only two wires (Tx for transmit, Rx for receive) are needed.

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:

 Affordable and Available: Cheap to implement and easy to find components.


 Simple Setup: Easy to connect devices.

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:

 Reliable and Fast: Provides stable and high-speed connections.


 Widely Used: Standard in most office and home networks.

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:

3.5 I2C (Inter-Integrated Circuit): A protocol used for communication between


components on the same circuit board. Uses two wires (SCL for clock and SDA for data)
to connect multiple slave devices to a single master. Only one device communicates
at a time (half-duplex).
Pros:

 Less Wiring: Only two wires are needed for multiple devices.
 Supports Multiple Devices: Many devices can be connected on the same bus.

Cons:

 Complex Design: Requires careful hardware design and programming.


 Slower Communication: Not as fast as some other protocols due to shared lines.

3.6 SPI (Serial Peripheral Interface): A protocol for short-distance


communication between microcontrollers and peripherals. Uses four wires (SCLK for
clock, MOSI for master output/slave input, MISO for master input/slave output, and
SS for slave select). It supports full-duplex communication, allowing simultaneous
sending and receiving.

Pros:

 High Speed: Faster than I2C because it supports full-duplex.


 Simple for the Receiver: The receiving device can be a simple shift register.

Cons:

 More Wires Needed: Requires more wires than I2C.


 Complicated for Multiple Devices: Each slave needs a separate SS line, which can
become complex with many devices.

3.7 Wired vs. Wireless Networks in IoT:

Factor Wired Wireless


Cost More expensive due to cables an Cheaper; fewer hardware require
d installation ments

More flexible; no physical cables


Flexibility Less flexible; requires fixed cables
needed

Portability Not portable; fixed installations Portable; suitable for remote

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)

4. Power Sources in IoT

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.

You might also like