0% found this document useful (0 votes)
28 views128 pages

IoT 04d

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)
28 views128 pages

IoT 04d

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/ 128

Internet of Things:

An Introduction
Electronics and Communication Engineering
Haldia Institute of Technology

Internet of Things (IoT)


IoT Architecture Layers

Internet of Things (IoT) 2


IoT Architecture Layers
❑ Perception Layer:
➢ It consists of sensors that collect essential
data. Its primary role is to gather information
from the environment and transmit it to the
other layers for further activity.

❑ Network Layer:
➢ It Bridges the Perception and Middleware
layers with diverse networking technologies,
such as 3G, 4G, Wi-Fi, or infrared, to facilitate
seamless data transfer and communication.

Internet of Things (IoT) 3


IoT Architecture Layers
❑ Middleware Layer:
➢ This layer consists of some advanced
capabilities like storage, computation, and
decision-making abilities. It stores datasets,
provides data to devices based on address and
name, and executes decisions derived from
sensor data calculations.
❑ Application Layer:
➢ This layer is responsible for responding to
information from the Middleware layer, looking
over tasks like sending emails, activating
alarms, and controlling devices in smart
applications.

Internet of Things (IoT) 4


IoT Architecture Layers
❑ Business Layer:
➢ It Handles tasks involving flowcharts, result
analysis, and continuous improvement
strategies, ensuring that the device seamlessly
aligns with user requirements and
expectations.

Internet of Things (IoT) 5


Internet of Things (IoT) | July 30, 2024 6
Interfaces for connections
❑ I/O interfaces for sensors
❑ Interfaces for Internet connectivity
❑ Memory and storage interfaces
❑ Audio/video interfaces.

Internet of Things (IoT) 7


Internet of Things (IoT) | July 30, 2024 8
Internet of Things (IoT) | July 30, 2024 9
Logical Design of IoT
❑ Abstract representation of entities and
processes with no low-level specifications of the
implementation.

❑ Functional blocks that provide the system with


the capabilities for identification, sensing,
actuation, communication, and management

Internet of Things (IoT) 10


Internet of Things (IoT) | July 30, 2024 11
Logical Design of IoT
❑Logical Design of IoT
• IoT Functional Blocks
• IoT Communication Models
• IoT Communication APIs
• Request-Response Model
• Publish-Subscribe Model
• Push-Pull Model
• Exclusive Pair Model

✓REST-based Communication APIs


✓WebSocket-based Communication APIs

Internet of Things (IoT)


Types of Communication Models in IoT
Communication models used in IoT are:
❑ Client-Server Model
❑ Publish-Subscribe Model
❑ Push-Pull Model
❑ Exclusive Pair Model

Internet of Things (IoT) 13


Client-Server
Model

Internet of Things (IoT) 14


Client-Server Model

Internet of Things (IoT) 15


Publish-Subscribe
Model

Internet of Things (IoT) 16


Publish-Subscribe Model
Consists of three entities:

❑ Publishers
➢ Generating and sending the data to the
specific topics that are managed by the broker.
➢Publishers are not aware of the consumers.

❑ Brokers
➢ Receives data for a topic from the publisher
➢ Sends the data to all the subscribed consumers.

❑ Consumers
➢Consumers subscribe to the topics which are
managed by the broker.

Internet of Things (IoT) 17


Publish-Subscribe Model

Internet of Things (IoT) 18


Publish-Subscribe Model

Internet of Things (IoT) 19


Example of publish-subscribe model
❑ Environmental monitoring: IoT sensors
deployed in agriculture or environmental
monitoring networks.
➢ Soil moisture sensors can publish data on a
topic.
➢ Subscribers, such as a farming application,
receive this data to make further irrigation
decisions.

Internet of Things (IoT) 20


Push-Pull
Model

Internet of Things (IoT) 21


Push-Pull Model
Consists of three entities:
❑ Publishers
➢ Push messages or data into the queue
➢ Consumers on the other end pull data out of the
queue

❑ Data Queues
➢ Queue acts as a buffer for messages which
helps smooth communication between the two
entities.
➢ There is a difference in the rate of data push or
pull by the publisher and consumer

❑ Consumer
➢ Pull the message from the Queue

Internet of Things (IoT) 22


Push-Pull Model
Social media: Platforms like Twitter, LinkedIn, and
Facebook are great for sharing project updates,
news, and other information.

Internet of Things (IoT) 23


Exclusive Pair Model
❑ Provide full-duplex, bidirectional communication
between a client and server.
❑ These models are designed for continuous
connections between the two entities.
❑ Once a connection is established, both the
client and server can exchange messages with
each other.
❑ As long as the client does not request to close
the connection, it remains open, and the server is
aware of every open connection.
❑ This enables the client and server to
communicate seamlessly and in real-time.
Internet of Things (IoT) 24
Exclusive Pair Model

Internet of Things (IoT) 25


Future of IoT Communication Models
❑ As the number of connected devices and
applications continues to increase, the need for
efficient and effective communication models will
become even more critical.
❑ Shifting towards edge computing
➢ Processing data closer to the source
➢ Reduced Latency
➢ Real-time responses
➢ Reduces transmitted data amount
➢ Reducing bandwidth requirements
➢ Improving efficiency.

Internet of Things (IoT) 26


Future of IoT Communication Models
❑ Hybrid communication models
➢ Combine different communication protocols to
achieve the best possible results.

For example, a hybrid model might combine the


Publish-Subscribe model with the Request-
Response model to achieve real-time data
updates while still allowing for targeted data
requests.

Internet of Things (IoT) 27


Future of IoT Communication Models
❑ Communication models that prioritize security
and privacy will become increasingly important in
the future to ensure the safe and secure
exchange of data.

Internet of Things (IoT) 28


Logical design of an IoT system

Internet of Things (IoT) 29


IoT Protocols

Internet of Things (IoT) 30


Application Layer
❑ HTTP
❑ WebSocket
❑ MQTT: Message Queuing Telemetry Transport
❑ XMPP: Extensible Messaging and Presence
Protocol (XMPP)
❑ DDS: Data distribution service
❑ AMQP: Advanced Message Queuing Protocol
❑ CoAP: Constrained Application Protocol

Internet of Things (IoT) 31


Middleware
❑ Middleware is software that lies between an
operating system and the applications running on
it. Essentially functioning as hidden translation
layer, middleware enables communication and
data management for distributed applications.

❑ IoT middleware is software that sits between the


hardware and applications layers in an Internet of
Things (IoT) system, providing a set of services
and functionalities to manage the communication
and interaction between different IoT devices,
platforms, and applications.

Internet of Things (IoT) 32


HTTP
❑ HTTP is an application layer protocol designed
to transfer information between networked
devices and runs on top of other layers of the
network protocol stack.

Internet of Things (IoT) 33


WebSocket

Internet of Things (IoT) 34


WebSocket-based Communication
❑ WebSocket APIs allow bidirectional, full duplex
communication between clients and servers.

❑ WebSocket APIs follow the exclusive pair


communication model.
❑ WebSocket is
➢ bidirectional, full-duplex client-server
communication.
➢ A stateful protocol, which means the
connection between client and server will stay
alive until it is terminated by either party (client
or server).
Internet of Things (IoT) 35
WebSocket

Internet of Things (IoT) 36


WebSocket
❑In WebSocket, data is continuously
pushed/transmitted into the same connection that
is already open; that is why WebSocket is faster
and improves application performance.

❑ For example, a trading website displays price


fluctuation and movement data continuously
pushed by the backend server to the client end by
using a WebSocket channel.

Internet of Things (IoT) 37


WebSocket
❑ IoT systems rely on WebSocket in situations
where constant communication between a server
and a client, plus audio and video support, are
necessary.

❑The goal of this technology is to provide a


mechanism for browser-based applications that
need two-way communication with servers that
do not rely on opening multiple HTTP
connections.

Internet of Things (IoT) 38


WebSocket-based Communication

Internet of Things (IoT) 39


WebSocket vs HTTP

Internet of Things (IoT) 40


Message Queuing
Telemetry Transport
(MQTT)

Internet of Things (IoT) 41


MQTT
❑MQTT stands for Message Queuing Telemetry
Transport
➢ Simple and lightweight messaging protocol
(subscribe and publish).
➢ Specifically targeted at IoT solutions.
➢ Run over TCP connections and follow a client-
server architecture.
➢ Allows messages to pass in both directions
between clients and servers.

Internet of Things (IoT) 42


MQTT
❑ Designed for limited devices and networks with
high latency, low bandwidth, or unreliable
networks.

❑ The MQTT commands are CONNECT,


SUBSCRIBE, PUBLISH, UNSUBSCRIBE and
DISCONNECT.

❑ MQTT Topics are the unit of distribution, to


which clients can PUBLISH and SUBSCRIBE. All
authorized subscribers to a topic will receive all
messages published to it.
Internet of Things (IoT) 43
MQTT

Internet of Things (IoT) 44


MQTT
❑ The MQTT broker is a server that receives
messages from publishers and delivers them to
subscribers based on their topic subscriptions.
❑ It manages client connections, handles
subscriptions and unsubscriptions, and ensures
message delivery according to the specified
Quality of Service (QoS) levels.

❑Its main advantage is small data overhead


leading to fast transfer, which is ideal for IoT
applications.

Internet of Things (IoT) 45


MQTT

Internet of Things (IoT) 46


Advantages of MQTT
❑It is capable of many-to-many broadcasts.
❑Supports publish-subscribe messaging queue.
❑This protocol is light in weight and offers efficient
data transmission
❑MQTT offers reduced network bandwidth in
communication.

Internet of Things (IoT) 47


Disadvantages of MQTT protocol
❑ MQTT uses TCP protocol which requires more
processing power and more memory.

❑TCP uses handshake protocol, which requires


frequent wake-up and communication time
intervals and leads to more power consumption.

❑ The number of times devices can be put to


sleep is limited. For such cases where the device
sleeps more, MQTT-S, which works with UDP
instead of TCP needs to be used.

Internet of Things (IoT) 48


Disadvantages of MQTT protocol
❑ The protocol itself does not provide any
encryption or authentication mechanisms, which
means that the messages can be intercepted,
modified, or spoofed by malicious actors. Any
custom security at the application level is difficult
and will require significant work.

Internet of Things (IoT) 49


Extensible Messaging and
Presence Protocol
(XMPP)

Internet of Things (IoT) 50


XMPP
❑ XMPP enables the exchange of XML-based
messages between clients and servers in a
decentralized manner.

❑ Unlike other messaging protocols, XMPP doesn't


rely on a central server to facilitate communication.
Instead, it follows a federated model where users or
organizations can operate their own XMPP server
and communicate with users server-side.

❑ XMPP protocol is based on the typical client-


server architecture, in which the XMPP client uses
the XMPP server with the TCP socket.

Internet of Things (IoT) 51


XMPP

Internet of Things (IoT) 52


Decentralized
❑ XMPP is based on client-server architecture, i.e.
clients don’t communicate directly, they do it with
the help of server as intermediary.

❑ There is no centralized XMPP server, just like


email; anyone can run their own XMPP server.
Each XMPP client is identified by JID (Jabber ID).

Internet of Things (IoT) 53


XMPP

Internet of Things (IoT) 54


XMPP

Internet of Things (IoT) 55


Advantages of using XMPP protocol
❑ Open Standard:
➢XMPP is a widely adopted standard for real-
time communication.
➢This open standard allows for interoperability
between different implementations and vendor-
neutral development.

Internet of Things (IoT) 56


Advantages of using XMPP protocol
❑Real-time Communication:
➢XMPP is designed for live data streaming,
making it ideal for apps that
require chat, presence information, and real-
time notifications.
➢ It supports various communication types,
including text, voice, video, and file transfer,
enabling developers to create feature-rich
applications.

Internet of Things (IoT) 57


Advantages of using XMPP protocol
❑ Scalability:
➢It is a highly scalable protocol that can handle
many concurrent connections and messages.
➢It uses a distributed architecture with
decentralized servers, allowing for easy scaling
by adding more servers to handle increased
traffic.
➢This scalability is particularly important for
applications that need to support a growing
user base or handle spikes in usage.

Internet of Things (IoT) 58


Advantages of using XMPP protocol
❑Security:
➢XMPP provides several security features to
protect communication's confidentiality,
integrity, and authenticity.
➢It supports end-to-end encryption using
Transport Layer Security (TLS) or Secure
Sockets Layer (SSL), ensuring that messages
are encrypted and can only be accessed by the
intended recipients.

Internet of Things (IoT) 59


Advantages of XMPP
❑ Can be used in publish-subscribe systems
because of the XML base.
❑ It is open and decentralized in nature.
❑ Different aspects are highly customizable per
individual user needs and requirements.
❑ It is easy to own an XMPP server, and hence, API
operators can create their own network of devices.
❑ Security can be customized and enhanced based
on specific needs and requirements as the XMPP
server can be isolated behind secure protocols.
❑ Short messages are used and communication is
fast.
❑ It allows servers based on different architectures
to communicate.

Internet of Things (IoT) 60


Disadvantages of XMPP
❑ This is a lack of end-to-end encryption.
❑ There is no way to make sure that messages
are delivered. The quality of Service (QoS)
mechanism is not there.
❑ XML content transports asynchronously and
there is a possibility of the server overloading.

Internet of Things (IoT) 61


Data Distribution Service
(DDS)

Internet of Things (IoT) 62


DDS IoT protocol
❑ Data Distribution Service
❑ DDS is a publish-subscribe-based middleware
program that has been standardized to operate in
real-time.
❑ It enables network interoperability for connected
devices, machines, enterprise systems, etc.
❑ It offers benefits such as QoS, scalability, etc.,
to the IoT applications and can be deployed in a
variety of platforms.
❑ It is used for real-time applications using peer-
to-peer communication.

Internet of Things (IoT) 63


DDS IoT protocol

Internet of Things (IoT) 64


DDS IoT protocol

Internet of Things (IoT) 65


DDS protocol stack

Two layers in the DDS


protocol stack:
1. Data-Centric Publish-
Subscribe (DCPS)
2. Data Local
Reconstruction Layer
(DLRL)

Internet of Things (IoT) 66


DDS IoT protocol
❑ It is used in all critical applications to provide a
reliable communication layer between sensors,
controllers, and actuators

❑ DDS uses the RTPS protocol, which is a data-


centric publish-subscribe model that allows
participants to communicate directly without the
need for a centralized broker.

Internet of Things (IoT) 67


Advantages of DDS
❑ It provides a flexible and efficient way to
manage the flow of information in distributed
systems.
❑ It provides low-latency, high-throughput data
communications.
❑It uses a powerful QoS mechanism.
❑ It is scalable, extensible, and efficient
standard.
❑ It is suitable for real-time IoT applications.

Internet of Things (IoT) 68


Advantages of DDS
❑ It can run in resource-constrained
environments and can easily ported to run on and
use custom hardware and operating systems.

❑ DDS supports interoperability between


different vendors in communicating on the wire by
using the RTPS (Real Time Publish Subscribe)
protocol.

Internet of Things (IoT) 69


Disadvantages of DDS protocol
❑ Heavyweight to be used in embedded systems.
❑ DDS consumes twice the bandwidth as the
MQTT protocol.
❑ QoS policies are only applied in strict DDS
environments.
❑ DDS does not interface with web services. A
specified web-enabled DDS is used to address
this. Through this interface, the web application
can be built that directly interacts with the running
DDS system using a gateway.

Internet of Things (IoT) 70


Advanced Message
Queuing Protocol
(AMQP)

Internet of Things (IoT) 71


AMQP IoT protocol
❑ Advanced Message Queuing Protocol.
❑It is a protocol that is used for communication
between applications. It is a lightweight, protocol
that supports the applications for data transfer.
This protocol is used for its scalability and
modularity with the technologies.

❑ designed for asynchronous communication with


guaranteed message delivery and fault tolerance,
making it perfect for specialized, scalable
systems.

Internet of Things (IoT) 72


AMQP IoT protocol

Internet of Things (IoT) 73


Components of AMQP
❑ Exchanges: Responsible for fetching messages
and properly arranging them in the appropriate
queue.
❑Channel: Create a virtual connection between
AMQP peers.
❑Message Queue: It is a unique entity that connects
messages to their resources or points.
❑ Binding: A set of predetermined instructions for
queuing and exchanging. It manages message
transmission and delivery.
❑Virtual Host: A platform that provides isolation
capabilities within the broker. Multiple vhosts may
be functional at the same time, depending on the
users and their access rights.

Internet of Things (IoT) 74


Advantages Of AMQP Protocol
❑ Allows a wide range of applications and
systems to communicate with one another,
regardless of their internal architecture
❑It employs QoS to ensure the secure
transmission of critical data.
❑ AMQP employs the same publish/subscribe
architecture as the MQTT protocol for data
exchange.
❑ Because it employs a wire-level protocol that
provides data as a stream of bytes, it assures
compatibility.

Internet of Things (IoT) 75


Disadvantages of AMQP
❑ Limited adoption: AMQP adoption is limited
compared to other messaging systems.
❑ Complexity: AMQP can be complex to
implement and manage.

Internet of Things (IoT) 76


Constrained
Application Protocol
(CoAP)

Internet of Things (IoT) 77


CoAP IoT Protocol
❑ Constrained Application Protocol (CoAP)
❑ It is a specialized web transfer protocol
designed for constrained (limited) nodes and
constrained networks in the Internet of Things.
❑ CoAP is designed to enable simple, constrained
devices to join the IoT even through constrained
networks with low bandwidth and low availability.
❑ Due to less overhead and the capability to
transfer data effectively even under low
bandwidth, CoAP has become a primary choice
for IoT and cloud computing system architecture.

Internet of Things (IoT) 78


CoAP Architecture

Internet of Things (IoT) 79


CoAP IoT Protocol
❑ Client-Server Model: The CoAP model is
essentially a client/server model enabling the
client to request service from the server as
needed, and the server responds to the client’s
request.

❑ Resource-Oriented: CoAP treats various


objects in the network as resources, each
uniquely identified by a URI. Clients can request
information about these resources, and servers
provide responses.

Internet of Things (IoT) 80


CoAP IoT Protocol
❑ Methods: CoAP supports several methods
similar to HTTP:
➢GET
➢POST
➢DELETE
➢PUT
❑ Asynchronous Messaging: CoAP messages
are asynchronous because it uses
the UDP. Unlike TCP-based protocols, CoAP
does not require acknowledgments for every
message, which helps conserve energy in
resource-constrained devices.

Internet of Things (IoT) 81


CoAP IoT Protocol
❑ Energy Efficiency: CoAP is designed to
minimize energy consumption while simplifying
communication between clients and devices. It
achieves this by managing resources, providing
device descriptions, and supporting mechanisms
to determine if a device is powered on or off.

Internet of Things (IoT) 82


CoAP Features
❑ Lightweight and Simple
❑ RESTful Architecture
❑ UDP-Based
❑ Asynchronous Communication
❑ Low Header Overhead
❑ Multicast Communication

Internet of Things (IoT) 83


CoAP Message Formats
❑ CoAP messages are encoded in binary-
format or 0/1 format.
❑ Like other message formats, a CoAP message
has a header and a payload section along with an
optional section.
❑ The size of the CoAP header is 4 bytes or 32
bits. This size is fixed for every CoAP message.
❑ The other part of the message is optional, which
includes payload and tokens of variable size
ranging from 0-8 bytes.

Internet of Things (IoT) 84


CoAP Message Formats

Internet of Things (IoT) 85


Advantages of CoAP protocol
❑ It is a simple protocol and uses less overhead
due to operation over UDP.
❑ It allows short wake-up times and long sleepy
states.
❑ It uses IPSEC ( Internet Protocol Security) or
Datagram Transport Layer Security (DTLS) to
provide secure communication.
❑ It has lower latency compared to HTTP.
❑ It consumes less power than HTTP.
❑ It uses ACK message and hence it becomes
reliable like HTTP.
❑ It avoids unnecessary retransmissions.

Internet of Things (IoT) 86


Disadvantages of CoAP protocol
❑ CoAP is an unreliable protocol due to the use of
UDP.
❑ It acknowledges each receipt of the message
and hence increases processing time.
❑ It does not verify whether the received message
has been decoded properly or not.
❑ It is an unencrypted protocol like MQTT and
uses DTLS to provide security at the cost of
implementation overhead.
❑ CoAP has communication issues for devices
behind NAT (Network Address Translation)

Internet of Things (IoT) 87


Hyper Text Transfer
Protocol
(HTTP)

Internet of Things (IoT) 88


HTTP

Internet of Things (IoT) 89


HTTP
❑ The HTTP (Hypertext Transfer Protocol) can be
used to transfer data in the form of plain text,
hypertext, audio, video, and so on.

Internet of Things (IoT) 90


HTTP

Internet of Things (IoT) 91


Features of HTTP
❑ Connectionless: 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 exists only during the current request and
response time only.

Internet of Things (IoT) 92


Features of HTTP
❑ Stateless: HTTP is a stateless protocol as both
the client and server know each other only during
the current request. Due to the nature of the
protocol, neither the client nor the server retains
the information between various requests on the
web pages.

Internet of Things (IoT) 93


Features of HTTP
❑ Media independent: HTTP protocol is media
independent as data can be sent as long as both
the client and server know how to handle the data
content. Both the client and server are required to
specify the content type in the MIME-type header.

[MIME (Multipurpose Internet Mail Extensions) type is


a standard way of describing a data type in the body of
an HTTP message or email. Or MIME Type is a label
used to identify a specific type of data
Content-Type: text/html header tells the browser that
it received an HTML page. Similarly, image/jpeg,
text/csv etc]

Internet of Things (IoT) 94


Advantages of HTTP
❑ Memory usage and CPU usage are low
because of fewer simultaneous connections.
❑ Since there are few TCP connections, network
congestion is lower.
❑ Since handshaking is done at the initial
connection stage, the latency is reduced.
❑ The error can be reported without closing the
connection.
❑ HTTP allows an HTTP pipeline of requests or
responses.

Internet of Things (IoT) 95


Uniform Resource Locator (URL)
❑ A client that wants to access the document on
the internet needs an address, and to facilitate
the access of documents, the HTTP uses the
concept of a 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.

Internet of Things (IoT) 96


Disadvantages of HTTP
❑ HTTP requires high power to establish
communication and transfer data.

❑ HTTP is less secure because it does not use


any encryption method. HTTPS is used to encrypt
regular HTTP requests and responses.

❑ The client does not close the connection until it


receives complete data from the server; hence,
the server needs to wait for data completion and
cannot be available for other clients during this
time.
Internet of Things (IoT) 97
Uniform Resource Locator (URL)

Internet of Things (IoT) 98


Uniform Resource Locator (URL)
❑ 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
computers, and the computers are given an alias
name that begins with the character "www." This
field is not mandatory.

Internet of Things (IoT) 99


Uniform Resource Locator (URL)
❑ Port: The URL can also contain the port number
of the server, but it's an optional field. If the port
number is included, then it must come between
the host and path and it should be separated from
the host by a colon.

❑ Path: Path is the pathname of the file where the


information is stored. The path itself contains
slashes that separate the directories from the
subdirectories and files.

Internet of Things (IoT) 100


Internet of Things (IoT) | July 30, 2024 101
Transmission Control
Protocol
(TCP)

Internet of Things (IoT) 102


Transmission Control Protocol (TCP)

Internet of Things (IoT) 103


Transmission Control Protocol (TCP)
❑ It is a transport layer protocol that facilitates the
transmission of packets from source to
destination.
❑ It is a connection-oriented protocol, which
means it establishes the connection prior to the
communication that occurs between the
computing devices in a network.
❑ This protocol is used with an IP protocol, so
together, they are referred to as a TCP/IP.

Internet of Things (IoT) 104


Working of the TCP protocol

Internet of Things (IoT) 105


Features of TCP/IP
❑ TCP is to take the data from the application
layer. Then, it divides the data into several
packets, provides numbering to these packets,
and finally transmits these packets to the
destination. The TCP, on the other side, will
reassemble the packets and transmit them to the
application layer.
❑ The connection remains established until the
communication is completed between the sender
and the receiver.

Internet of Things (IoT) 106


Features of TCP/IP
❑ Reliable: TCP is a reliable protocol as it follows
the flow and error control mechanism. It also
supports the acknowledgment mechanism, which
checks the state of arrival of the data.
❑ In the acknowledgment mechanism, the
receiver sends either positive or negative
acknowledgment to the sender so that the sender
can get to know whether the data packet has
been received or needs to resend.

Internet of Things (IoT) 107


Features of TCP/IP
❑ Order of the data is maintained: This protocol
ensures that the data reaches the intended
receiver in the same order in which it is sent. It
orders and numbers each segment so that the
TCP layer on the destination side can reassemble
them based on their ordering.

❑ Connection-oriented: The data exchange


occurs only after the connection establishment.
When the data transfer is completed, then the
connection will be closed.

Internet of Things (IoT) 108


Features of TCP
❑ Full duplex: The data can transfer in both
directions at the same time.

❑ Stream-oriented: TCP is a stream-oriented


protocol as it allows the sender to send the data
in the form of a stream of bytes and also allows
the receiver to accept the data in the form of a
stream of bytes.

❑ Flow Control: Flow control limits the rate at


which a sender transfers data. This is done to
ensure reliable delivery. The receiver continually
hints to the sender on how much data can be
received.

Internet of Things (IoT) 109


Features of TCP
❑ Error Control: TCP implements an error control
mechanism for reliable data transfer.

❑ Congestion Control: TCP takes into account


the level of congestion in the network. Congestion
level is determined by the amount of data sent by
a sender.

Internet of Things (IoT) 110


Advantages of TCP
❑ It provides a connection-oriented reliable
service, which guarantees the delivery of data
packets. If the data packet is lost across the
network, then the TCP will resend the lost
packets.
❑ It makes sure that the data reaches the proper
destination in the exact order that it was sent.
❑ It provides error detection by using checksum
and error control by using Go Back or ARP
protocol.
❑ It eliminates the congestion by using a network
congestion avoidance algorithm.

Internet of Things (IoT) 111


Disadvantages of TCP
❑ TCP is made for Wide Area Networks, thus its
size can become an issue for small networks with
low resources.
❑ TCP runs several layers so it can slow down the
speed of the network.
❑ It is not generic in nature. This means it cannot
represent any protocol stack other than the
TCP/IP suite. E.g., it cannot work with a Bluetooth
connection.
❑ It increases a large amount of overhead as each
segment gets its own TCP header, so
fragmentation by the router increases the
overhead.

Internet of Things (IoT) 112


User Datagram Protocol
(UDP)

Internet of Things (IoT) 113


User Datagram Protocol (UDP)
❑ UDP is a Transport Layer protocol. Unlike TCP,
it is an unreliable and connectionless
protocol. So, there is no need to establish a
connection before data transfer.

❑ The UDP helps to establish low-latency and


loss-tolerating connections over the network.

❑ The UDP enables process-to-process


communication.

Internet of Things (IoT) 114


User Datagram Protocol (UDP)

Internet of Things (IoT) 115


User Datagram Protocol (UDP)

Internet of Things (IoT) 116


Applications of UDP
❑ Used for simple request-response
communication when the size of data is less and
hence there is lesser concern about flow and
error control.
❑ It is a suitable protocol for multicasting as UDP
supports packet switching.
❑ UDP is used for some routing update protocols
like RIP(Routing Information Protocol).
❑ Routing Information Protocol (RIP) is a dynamic
routing protocol that uses hop count as a routing
metric to find the best path between the source
and the destination network.

Internet of Things (IoT) 117


Applications of UDP
❑ VoIP (Voice over Internet Protocol) services,
such as Skype and WhatsApp, use UDP for real-
time voice communication. The UDP is used to
ensure fast and efficient data transmission.
❑ DNS (Domain Name System) requires a quick
response time, making UDP a suitable protocol
for this application.
❑ DHCP (Dynamic Host Configuration
Protocol) uses UDP to dynamically assign IP
addresses to devices on a network.

Internet of Things (IoT) 118


Domain Name Server
❑The client machine sends a request to the local
name server, which, if the root does not find the
address in its database, sends a request to the
root name server, which in turn, will route the
query to a top-level domain (TLD) or authoritative
name server.
❑The root name server can also contain some
hostname to IP address mappings. The Top-level
domain (TLD) server always knows who the
authoritative name server is. So finally, the IP
address is returned to the local name server,
which in turn returns the IP address to the host.

Internet of Things (IoT) 119


Domain Name Server

Internet of Things (IoT) 120


Domain Name Server

Internet of Things (IoT) 121


Advantages of UDP
❑ Speed: UDP is faster than TCP because it does
not have the overhead of establishing a
connection and ensuring reliable data delivery.

❑ Lower latency: Since there is no connection


establishment, there is lower latency and faster
response time.

❑ Simplicity: UDP has a simpler protocol design


than TCP, making it easier to implement and
manage.

Internet of Things (IoT) 122


Advantages of UDP
❑ Broadcast support: UDP supports
broadcasting to multiple recipients, making it
useful for applications such as video streaming
and online gaming.

❑ Smaller packet size: UDP uses smaller packet


sizes than TCP, which can reduce network
congestion and improve overall network
performance.

Internet of Things (IoT) 123


Disadvantages of UDP
❑ No reliability: UDP does not guarantee delivery
of packets or order of delivery, which can lead to
missing or duplicate data.

❑ No congestion control: UDP does not have


congestion control, which means that it can send
packets at a rate that can cause network
congestion.

Internet of Things (IoT) 124


Disadvantages of UDP
❑ Vulnerable to attacks: UDP is vulnerable
to denial-of-service attacks, where an attacker
can flood a network with UDP packets,
overwhelming the network and causing it to
crash.

❑ Limited use cases: UDP is not suitable for


applications that require reliable data delivery,
such as email or file transfers, and is better suited
for applications that can tolerate some data loss,
such as video streaming or online gaming.

Internet of Things (IoT) 125


TCP vs UDP
❑ 1. TCP is a connection-oriented protocol.
Whereas, the UDP is a connection-less protocol
and doesn’t require a handshake before data
transfer.
❑There is no overhead for opening a connection,
maintaining a connection, or terminating a
connection, and therefore, UDP is efficient for
broadcast and multicast types of network
transmission.

Internet of Things (IoT) 126


TCP vs UDP
❑ 2. TCP is reliable as it guarantees the delivery
of data to the destination router. Whereas, the
delivery of data to the destination cannot be
guaranteed in UDP.
❑ 3. An acknowledgment segment is present in
TCP, but no acknowledgment segment is present
in UDP.
❑ 4. TCP provides extensive error-checking
mechanisms. UDP has only the basic error-
checking mechanism using checksums.

Internet of Things (IoT) 127


TCP vs UDP
❑5. TCP is comparatively slower than UDP. UDP
is faster, simpler, and more efficient than TCP.
❑6. Retransmission of lost packets is possible in
TCP but not in UDP.

Internet of Things (IoT) 128

You might also like