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

Internet of Things (Unit - II)

The document discusses hardware and software components of Internet of Things including Arduino, Raspberry Pi, communication protocols, sensors, actuators and input-output interfaces. It also discusses programming APIs using Python and making API requests in Python using the requests library.

Uploaded by

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

Internet of Things (Unit - II)

The document discusses hardware and software components of Internet of Things including Arduino, Raspberry Pi, communication protocols, sensors, actuators and input-output interfaces. It also discusses programming APIs using Python and making API requests in Python using the requests library.

Uploaded by

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

Internet of Things

Unit 2

Elements of IOT

Hardware Components:-

Arduino:- Arduino IoT Cloud is an application that helps makers build


connected objects in a quick, easy and secure way. You can connect multiple
devices to each other and allow them to exchange real-time data. You can also
monitor them from anywhere using a simple user interface. The Arduino IoT
Cloud is a online platform that makes it easy for you to create, deploy and
monitor IoT projects.

Arduino acts as the brain of the system and processes the data from the
sensor. Arduino is an open source hardware platform that is readily available for
hobbyists & enthusiasts across the globe to build projects.

The Raspberry Pi :- The Raspberry Pi is a series of low-cost, programmable


computers that include a set of GPIO, or 'General Purpose Input Output', pins that
can be used to connect and control external electronic devices, and to create
Internet of Things (IoT) solutions.

The powerful CPU coupled with Wireless LAN and Bluetooth 4.1 radio makes it
an ideal candidate for IoT projects, because multiple sensors can be connected to
it simultaneously. In addition, the Raspberry Pi has a 40-pin GPIO (General
Purpose I/O) connector for interfacing with external sensors.

Communication:- IoT is connection of devices over internet, where these


smart devices communicate with each other , exchange data , perform some
tasks without any human involvement. These devices are embedded with
electronics, software, network and sensors which help in communication.

Communication between smart devices is very important in IOT as it enables


these devices to gather, exchange data which contribute in success of that IOT
product/project.
Types of Communications in IOT :
The following are some communication types in IoT:-
1. Human to Machine (H2M) :
In this human gives input to IOT device i.e as speech/text/image etc. IOT device
(Machine) like sensors and actuators then understands input, analyses it and
responds back to human by means of text or Visual Display. This is very useful
as these machines assist humans in every everyday tasks. It is a combo of
software and hardware that includes human interaction with a machine to perform
a task.

Merits: This H2M has a user-friendly interface that can be quickly accessed by
following the instructions. It responds more quickly to any fault or failure. Its
features and functions can be customized.
Examples:
 Facial recognition.
 Bio-metric Attendance system.
 Speech or voice recognition.
2. Machine to Machine (M2M) :
In this the interaction or communication takes place between machines by
automating data/programs. In this machine level instructions are required for
communication. Here communication takes place without human interaction. The
machines may be either connected through wires or by wireless connection. An
M2M connection is a point-to-point connection between two network devices that
helps in transmitting information using public networking technologies like
Ethernet and cellular networks. IoT uses the basic concepts of M2M and expands
by creating large “cloud” networks of devices that communicate with one another
through cloud networking platforms.
M2M communication

Advantages –
This M2M can operate over cellular networks and is simple to manage. It can be
used both indoors and outdoors and aids in the communication of smart objects
without the need for human interaction. The M2M contact facility is used to
address security and privacy problems in IoT networks. Large-scale data
collection, processing, and security are all feasible.
Disadvantages –
However, in M2M, use of cloud computing restricts versatility and creativity.
Data security and ownership are major concerns here. The challenge of achieving
interoperability between cloud/M2M IoT systems is daunting. M2M connectivity
necessitates the existence of a reliable internet connection.
Examples:
 Smart Washing machine sends alerts to the owners’ smart devices after
completion of washing or drying of clothes.
 Smart meters tracks amount of energy used in household or in companies and
automatically alert the owner.
3. Machine to Human (M2H) :
In this machine interacts with Humans. Machine triggers information(text
messages/images/voice/signals) respective / irrespective of any human presence.
This type of communication is most commonly used where machines guide
humans in their daily life. It is way of interaction in which humans co-work with
smart systems and other machines by using tools or devices to finish a task.

M2H communication
Examples:
 Fire Alarms
 Traffic Light
 Fitness bands
 Health monitoring devices
4. Human to Human (H2H) :
This is generally how humans communicate with each other to exchange
information by speech, writing, drawing, facial expressions, body language etc.
Without H2H, M2M applications cannot produce the expected benefits unless
humans can immediately fix issues, solve challenges, and manage scenarios.

H2H communication

For, communication of IoT devices many protocols are used. These IoT
protocols are modes of communication which give security to the data being
exchanged between IoT connected devices. Example bluetooth, wifi, zigbee etc.

Sensors
A better term for a sensor is a transducer. A transducer is any physical device
that converts one form of energy into another. So, in the case of a sensor, the
transducer converts some physical phenomenon into an electrical impulse that
determines the reading. A microphone is a sensor that takes vibrational energy
(sound waves), and converts it to electrical energy in a useful way for
other components in the system to correlate back to the original sound.
Actuators
Another type of transducer that you will encounter in many IoT systems is
an actuator. In simple terms, an actuator operates in the reverse direction of a
sensor. It takes an electrical input and turns it into physical action. For instance, an
electric motor, a hydraulic system, and a pneumatic system are all different types
of actuators.
I/O Interfaces:- Input-Output Interface is used as an method which helps in
transferring of information between the internal storage devices i.e. memory and
the external peripheral device . A peripheral device is that which provide input
and output for the computer, it is also called Input-Output devices. For Example:
A keyboard and mouse provide Input to the computer are called input devices
while a monitor and printer that provide output to the computer are called output
devices. Just like the external hard-drives, there is also availability of some
peripheral devices which are able to provide both input and output.

In micro-computer base system, the only purpose of peripheral devices is just to


provide special communication links for the interfacing them with the CPU. To
resolve the differences between peripheral devices and CPU, there is a special
need for communication links.
The major differences are as follows:
1. The nature of peripheral devices is electromagnetic and electro-mechanical.
The nature of the CPU is electronic. There is a lot of difference in the mode of
operation of both peripheral devices and CPU.
2. There is also a synchronization mechanism because the data transfer rate of
peripheral devices are slow than CPU.
3. In peripheral devices, data code and formats are differ from the format in the
CPU and memory.
4. The operating mode of peripheral devices are different and each may be
controlled so as not to disturb the operation of other peripheral devices
connected to CPU.
There is a special need of the additional hardware to resolve the differences
between CPU and peripheral devices to supervise and synchronize all input and
output devices.

Software Components:-

Programming API using Python:-

What is an API?
An API, or Application Programming Interface, is a server that you can use to
retrieve and send data to using code. APIs are most commonly used to retrieve
data, and that will be the focus of this beginner tutorial.
When we want to receive data from an API, we need to make a request. Requests
are used all over the web. For instance, when you visited this blog post, your web
browser made a request to the Dataquest web server, which responded with the
content of this web page.
API requests work in exactly the same way – you make a request to an API server
for data, and it responds to your request.
Making API Requests in Python
In order to work with APIs in Python, we need tools that will make those requests.
In Python, the most common library for making requests and working with APIs is
the requests library. The requests library isn’t part of the standard Python library,
so you’ll need to install it to get started.
If you use pip to manage your Python packages, you can install requests using the
following command:
pip install requests
If you use conda, the command you’ll need is:
conda install requests
Once you’ve installed the library, you’ll need to import it. Let’s start with that
important step:
import requests
Now that we’ve installed and imported the requests library, let’s start using it.
Making Our First API Request
There are many different types of requests. The most commonly used one,
a GET request, is used to retrieve data. Because we’ll just be working with
retrieving data, our focus will be on making ‘get’ requests.
When we make a request, the response from the API comes with a response
code which tells us whether our request was successful. Response codes are
important because they immediately tell us if something went wrong.

To make a ‘GET’ request, we’ll use the requests.get() function, which requires
one argument — the URL we want to make the request to. We’ll start by making a
request to an API endpoint that doesn’t exist, so we can see what that response
code looks like.
response = requests.get("https://api.open-notify.org/this-api-doesnt-exist")
The get() function returns a response object. We can use
the response.status_code attribute to receive the status code for our request:
print(response.status_code)
404
The ‘404’ status code might be familiar to you — it’s the status code that a server
returns if it can’t find the file we requested. In this case, we asked for this-api-
doesnt-exist which (surprise, surprise) didn’t exist!
Let’s learn a little more about common status codes.
API Status Codes
Status codes are returned with every request that is made to a web server. Status
codes indicate information about what happened with a request. Here are some
codes that are relevant to GET requests:
 200: Everything went okay, and the result has been returned (if any).
 301: The server is redirecting you to a different endpoint. This can happen
when a company switches domain names, or an endpoint name is changed.
 400: The server thinks you made a bad request. This can happen when you
don’t send along the right data, among other things.
 401: The server thinks you’re not authenticated. Many APIs require login
ccredentials, so this happens when you don’t send the right credentials to
access an API.
 403: The resource you’re trying to access is forbidden: you don’t have the
right perlessons to see it.
 404: The resource you tried to access wasn’t found on the server.
 503: The server is not ready to handle the request.
You might notice that all of the status codes that begin with a ‘4’ indicate some
sort of error. The first number of status codes indicate their categorization. This is
useful — you can know that if your status code starts with a ‘2’ it was successful
and if it starts with a ‘4’ or ‘5’ there was an error. If you’re interested you can read
more about status codes here.
API Documentation
In order to ensure we make a successful request, when we work with APIs it’s
important to consult the documentation. Documentation can seem scary at first, but
as you use documentation more and more you’ll find it gets easier.
We’ll be working with the Open Notify API, which gives access to data about the
international space station. It’s a great API for learning because it has a very
simple design, and doesn’t require authentication. We’ll teach you how to use an
API that requires authentication in a later post.
Often there will be multiple APIs available on a particular server. Each of these
APIs are commonly called endpoints. The first endpoint we’ll use
is http://api.open-notify.org/astros.json, which returns data about astronauts
currently in space.
If you click the link above to look at the documentation for this endpoint, you’ll
see that it says This API takes no inputs. This makes it a simple API for us to get
started with. We’ll start by making a GET request to the endpoint using the
requests library:
response = requests.get("https://api.open-notify.org/astros.json")
print(response.status_code)
200
We received a ‘200’ code which tells us our request was successful. The
documentation tells us that the API response we’ll get is in JSON format. In the
next section we’ll learn about JSON, but first let’s use the response.json()
method to see the data we received back from the API:
print(response.json())
{'message': 'success', 'people': [{'name': 'Alexey Ovchinin', 'craft': 'ISS'}, {'name':
'Nick Hague', 'craft': 'ISS'}, {'name': 'Christina Koch', 'craft': 'ISS'}, {'name':
'Alexander Skvortsov', 'craft': 'ISS'}, {'name': 'Luca Parmitano', 'craft': 'ISS'},
{'name': 'Andrew Morgan', 'craft': 'ISS'}], 'number': 6}
Working with JSON Data in Python
JSON (JavaScript Object Notation) is the language of APIs. JSON is a way to
encode data structures that ensures that they are easily readable by machines.
JSON is the primary format in which data is passed back and forth to APIs, and
most API servers will send their responses in JSON format.
You might have noticed that the JSON output we received from the API looked
like it contained Python dictionaries, lists, strings and integers. You can think of
JSON as being a combination of these objects represented as strings. Let’s look at
a simple example:
Python has great JSON support with the json package. The json package is part of
the standard library, so we don’t have to install anything to use it. We can both
convert lists and dictionaries to JSON, and convert strings to lists and dictionaries.
In the case of our ISS Pass data, it is a dictionary encoded to a string in JSON
format.
The json library has two main functions:
 json.dumps() — Takes in a Python object, and converts (dumps) it to a
string.
 json.loads() — Takes a JSON string, and converts (loads) it to a Python
object.
The dumps() function is particularly useful as we can use it to print a formatted
string which makes it easier to understand the JSON output, like in the diagram we
saw above:
import json

def jprint(obj):
# create a formatted string of the Python JSON object
text = json.dumps(obj, sort_keys=True, indent=4)
print(text)

jprint(response.json())
{
"message": "success",
"number": 6,
"people": [
{
"craft": "ISS",
"name": "Alexey Ovchinin"
},
{
"craft": "ISS",
"name": "Nick Hague"
},
{
"craft": "ISS",
"name": "Christina Koch"
},
{
"craft": "ISS",
"name": "Alexander Skvortsov"
},
{
"craft": "ISS",
"name": "Luca Parmitano"
},
{
"craft": "ISS",
"name": "Andrew Morgan"
}
]
}
Immediately we can understand the structure of the data more easily – we can see
that their are six people currently in space, with their names existing as dictionaries
inside a list.
If we compare this to the documentation for the endpoint we’ll see that this
matches the specified output for the endpoint.
Using an API with Query Parameters
The http://api.open-notify.org/astros.json endpoint we used earlier does not take
any parameters. We just send a GET request and the API sends back data about the
number of people currently in space.
It’s very common, however, to have an API endpoint that requires us to specify
parameters. An example of this the https://api.open-notify.org/iss-pass.json
endpoint. This endpoint tells us the next times that the international space station
will pass over a given location on the earth.
If we look at the documentation, it specifies required lat (latitude)
and long (longitude) parameters.
We can do this by adding an optional keyword argument, params, to our request.
We can make a dictionary with these parameters, and then pass them into
the requests.get function. Here’s what our dictionary would look like, using
coordinates for New York City:
parameters = {
"lat": 40.71,
"lon": -74
}
We can also do the same thing directly by adding the parameters directly to the
URL. like this:
https://api.open-notify.org/iss-pass.json?lat=40.71&lon;=-74
It’s almost always preferable to setup the parameters as a dictionary,
because requests takes care of some things that come up, like properly formatting
the query parameters, and we don’t need to worry about inserting the values into
the URL string.
Let’s make a request using these coordinates and see what response we get.
response = requests.get("https://api.open-notify.org/iss-pass.json",
params=parameters)

jprint(response.json())
{
"message": "success",
"request": {
"altitude": 100,
"datetime": 1568062811,
"latitude": 40.71,
"longitude": -74.0,
"passes": 5
},
"response": [
{
"duration": 395,
"risetime": 1568082479
},
{
"duration": 640,
"risetime": 1568088118
},
{
"duration": 614,
"risetime": 1568093944
},
{
"duration": 555,
"risetime": 1568099831
},
{
"duration": 595,
"risetime": 1568105674
}
]
}
Understanding the Pass Times
The JSON response matches what the documentation specified:
 A dictionary with three keys
 The third key, response, contains a list of pass times
 Each pass time is a dictionary with risetime (pass start time)
and duration keys.
Let’s extract the pass times from our JSON object:
pass_times = response.json()['response']
jprint(pass_times)
[
{
"duration": 395,
"risetime": 1568082479
},
{
"duration": 640,
"risetime": 1568088118
},
{
"duration": 614,
"risetime": 1568093944
},
{
"duration": 555,
"risetime": 1568099831
},
{
"duration": 595,
"risetime": 1568105674
}
]
Next we’ll use a loop to extract just the five risetime values:
risetimes = []

for d in pass_times:
time = d['risetime']
risetimes.append(time)

print(risetimes)
[1568082479, 1568088118, 1568093944, 1568099831, 1568105674]
These times are difficult to understand – they are in a format known as timestamp
or epoch. Essentially the time is measured in the number of seconds since January
1st 1970. We can use the Python datetime.fromtimestamp() method to convert
these into easier to understand times:
from datetime import datetime

times = []

for rt in risetimes:
time = datetime.fromtimestamp(rt)
times.append(time)
print(time)
2019-09-09 21:27:59
2019-09-09 23:01:58
2019-09-10 00:39:04
2019-09-10 02:17:11
2019-09-10 03:54:34
It looks like the ISS passes over New York City often – the next five times happen
within a seven hour period!
Python API Tutorial: Next Steps
In this tutorial, we learned:
 What an API is
 Types of requests and response codes
 How to make a get request
 How to make a request with parameters
 How to display and extract JSON data from an API
These fundamental steps will help you to start working with APIs. Remember that
key to each time we used the API was to carefully read the API documentation and
use that to understand what request to make and what parameters to provide.
Now you’ve completed our Python API tutorial, you might like to:
 Complete our interactive Dataquest APIs and scraping course, which you
can start for free.
 Try working with some data from this list of Free Public APIs — we
recommend selecting an API that doesn’t require authentication as a good
first step.
 Try our Intermediate API tutorial, which covers API authentication,
pagination, and rate limiting
IOT Communication Protocols:-
The IOT data communication protocols are those that work in the low levels of the
Open Systems Interconnection (OSI) model, without the need for an Internet
connection.
Message Queue Telemetry Transport (MQTT)

Designed to be lightweight, so it can work in very low bandwidth


networks, MQTT allows communication between nodes in both reliable and
unreliable networks. MQTT follows a publish/subscribe architecture, meaning that
there are nodes (brokers) that make the information available, while others (clients)
can read the available information after subscribing by accessing the corresponding
URL.
A use case of MQTT is in a smart factory where there are temperature sensors
installed along with the production plant. The installed sensors will connect to the
MQTT broker and will publish the data within sensor topics, as follows:
sensors/temperature/assemblyLineInit

Constrained Application Protocol (CoAP)

CoAP is a web transfer protocol to be used with limited networks with low
bandwidth and low availability. It follows a client/server architecture and is built
similarly to HTTP, supporting the REST model: servers make resources available
with an URL, and clients can make requests of types GET, POST, PUT and
DELETE.

The CoAP communication links are 1:1 and UDP-based, so the delivery is not
guaranteed. CoAP is made to work in highly congested networks, where nodes do
not have a lot of intelligence and are not always working.

Zigbee:-

It is a standards-based wireless technology developed to enable low-cost, low-


power wireless machine-to-machine (M2M) and internet of things (IoT)
networks. Zigbee is for low-data rate, low-power applications and is an open
standard.

Zigbee devices can transmit data over long distances by passing data through
a mesh network of intermediate devices to reach more distant ones. Zigbee is
typically used in low data rate applications that require long battery life and secure
networking. (Zigbee networks are secured by 128 bit symmetric encryption keys.)

A typical example is when you have a Zigbee-enabled light bulb and a Zigbee-
enabled light switch and you want the light switch to control the light bulb.
With Zigbee, the two devices - even if they're from different manufacturers - speak
a common language, so there's no barrier to communication

Bluetooth In IoT:-
It is a serious technology used for IoT applications. Apart from being the
ubiquitous solution for hands-free calling and wireless transmission technology for
audio, Bluetooth technology is leading in consumer and business IoT.
Invented by Ericsson in 1994, Bluetooth was intended to enable wireless headsets.
Bluetooth has since expanded into a broad variety of applications including
Bluetooth headsets, speakers, printers, video game controllers, and much more.

Bluetooth is also important for the rapidly growing Internet of Things, including
smart homes and industrial applications. It is a low power, low range, high
bandwidth connectivity option. When Bluetooth devices connect to each other (for
example, your phone and your wireless speaker), it follows the parent-child model,
meaning that one device is the parent and other devices are the children. The parent
transmits information to the child and the child listens for information from the
parent.

A Bluetooth parent can have up to 7 children, which is why your computer can be
connected via Bluetooth to multiple devices at the same time. When devices are
connected together via Bluetooth, it’s called a “piconet”.

Not only can a device be a parent in one piconet and a child in a different piconet
at the same time, but the parent-child relationship can also switch. When you put
your Bluetooth device in pairing mode to connect it, it’s temporarily becoming the
parent so that it can establish a connection and proceeds to connect as the child.

In the Industrial Internet of Things, machines often need to send short bursts of
data in extremely noisy environments. With potentially hundreds of sensors and
devices sending data, WiFi poses too much hassle to set up.

A drawback of Bluetooth is lower bandwidth, but for many industrial applications


this higher bandwidth simply isn’t needed.
Bluetooth is also useful in a smart home setting. Again, many devices in the smart
home don’t need high bandwidth connections and it’s much easier to set up
Bluetooth.

TCP vs UDP
What is the TCP?
The TCP stands for Transmission Control Protocol. If we want the
communication between two computers and communication should be good and
reliable. For example, we want to view a web page, then we expect that nothing
should be missing on the page, or we want to download a file, then we require a
complete file, i.e., nothing should be missing either it could be a text or an image.
This can only be possible due to the TCP. It is one of the most widely used
protocols over the TCP/IP network.
Features of TCP
The following are the features of the TCP:
o Data
TCP protocol ensures that the data is received correctly, no data is missing
and in order. If TCP protocol is not used, then the incorrect data can be
received or out of order. For example, if we try to view the web page or
download a file without using TCP, then some data or images could be
missing.
o Protocol
TCP is a connection-oriented protocol. Through the word connection-
oriented, we understand that the computers first establish a connection and
then do the communication. This is done by using a three-way handshake. In
a three-way handshake, the first sender sends the SYN message to the
receiver then the receiver sends back the SYN ACK message to confirm that
the message has been received. After receiving the SYN ACK message, the
sender sends the acknowledgment message to the receiver. In this way, the
connection is established between the computers. Once the connection is
established, the data will be delivered. This protocol guarantees the data
delivery means that if the data is not received then the TCP will resend the
data.
What is UDP?
The UDP stands for User Datagram Protocol. Its working is similar to the TCP as
it is also used for sending and receiving the message. The main difference is that
UDP is a connectionless protocol. Here, connectionless means that no connection
establishes prior to communication. It also does not guarantee the delivery of data
packets. It does not even care whether the data has been received on the receiver's
end or not, so it is also known as the "fire-and-forget" protocol. It is also known as
the "fire-and-forget" protocol as it sends the data and does not care whether the
data is received or not. UDP is faster than TCP as it does not provide the assurance
for the delivery of the packets.
Differences between the TCP and UDP

o Type of protocol
Both the protocols, i.e., TCP and UDP, are the transport layer protocol. TCP
is a connection-oriented protocol, whereas UDP is a connectionless protocol.
It means that TCP requires connection prior to the communication, but the
UDP does not require any connection.
o Reliability
TCP is a reliable protocol as it provides assurance for the delivery of the
data. It follows the acknowledgment mechanism. In this mechanism, the
sender receives the acknowledgment from the receiver and checks whether
the acknowledgment is positive or negative. If the ACK is positive means,
the data has been received successfully. If ACK is negative, then TCP will
resend the data. It also follows the flow and error control mechanism.
UDP is an unreliable protocol as it does not ensure the delivery of the data.
o Flow Control
TCP follows the flow control mechanism that ensures a large number of
packets are not sent to the receiver at the same time, while UDP does not
follow the flow control mechanism.
o Ordering
TCP uses ordering and sequencing techniques to ensure that the data packets
are received in the same order in which they are sent. On the other hand,
UDP does not follow any ordering and sequencing technique; i.e., data can
be sent in any sequence.
o Speed
Since TCP establishes a connection between a sender and receiver, performs
error checking, and also guarantees the delivery of data packets while UDP
neither creates a connection nor it guarantees the delivery of data packets, so
UDP is faster than TCP.
o Flow of data
In TCP, data can flow in both directions means that it provides the full-
duplex service. On the other hand, UDP is mainly suitable for the
unidirectional flow of data.
Let's look at the differences between the TCP and UDP in a tabular form.
Play Videox

TCP UDP

Full form It stands for Transmission It stands for User Datagram


Control Protocol. Protocol.

Type of It is a connection-oriented It is a connectionless protocol,


connection protocol, which means that the which means that it sends the
connection needs to be data without checking whether
established before the data is the system is ready to receive
transmitted over the network. or not.

Reliable TCP is a reliable protocol as it UDP is an unreliable protocol


provides assurance for the as it does not take the
delivery of data packets. guarantee for the delivery of
packets.

Speed TCP is slower than UDP as it UDP is faster than TCP as it


performs error checking, flow does not guarantee the
control, and provides assurance delivery of data packets.
for the delivery of

Header size The size of TCP is 20 bytes. The size of the UDP is 8
bytes.

Acknowledgment TCP uses the three-way- UDP does not wait for any
handshake concept. In this acknowledgment; it just sends
concept, if the sender receives the data.
the ACK, then the sender will
send the data. TCP also has the
ability to resend the lost data.

Flow control It follows the flow control This protocol follows no such
mechanism mechanism in which too many mechanism.
packets cannot be sent to the
receiver at the same time.

Error checking TCP performs error checking by It does not perform any error
using a checksum. When the checking, and also does not
data is corrected, then the data is resend the lost data packets.
retransmitted to the receiver.

Applications This protocol is mainly used This protocol is used where


where a secure and reliable fast communication is required
communication process is and does not care about the
required, like military services, reliability like VoIP, game
web browsing, and e-mail. streaming, video and music
streaming, etc.

You might also like