“The transport-layer layer provides logical communication between application processes running on different hosts”
On the other hand, the network-layer provides logical communication between hosts”
The terminologies are explained below (if anyone has doubt) (Notes part).
The difference can be explained using an analogy.
Suppose
there are two orphanages: Orphanage A and Orphanage B. Both in two different cities in a state. Suppose some kids of A are siblings of B
(only girls stay in A and only boys stay in B). The kid loves to write to each other every week. Suppose, Alice is the caretaker of A and Bob is the caretaker of B. Both Alice and Bob are responsible for letter collection and distribution. Letters are sent inside an envelope using traditional postal service.
Each
week Alice visits all the kids, collects the letters, and gives them to a postal-service mail carrier, who makes daily visits to the house.
When letters arrive at A, Alice also has the job of distributing the
letter to kids. Bill has a similar job on orphanage B.
application messages = letters in envelopes
processes = kids
hosts = houses
transport-layer protocol =Alice and bob
network-layer protocol = postal service (including mail carriers)
Note:
By host we mean, all the devices like laptops, smartphones, tablets,
TVs, gaming consoles, Webcams, automobiles, environmental sensing devices that are hooked up to the Internet.
By Application process, we mean different applications like Facebook, Hotstar, youtube, Whatsapp in our mobile etc.
By logical communication,
we mean that from an application’s perspective, it is as if the hosts
running the processes were directly connected; in reality, the hosts may
be on opposite sides of the planet, connected via numerous routers and a
wide range of link types.
So when we chat with friends using Whatsapp, we send messages to one another
without worrying about details of the physical infrastructure used to carry these messages.