In general, network layer protocols provide a logical communication between
hosts, whereas transport layer protocols provide a logical communication
between processes running on these hosts.
This application tries to show this important difference with an analogy.
Consider two houses on the east and west side, with each house being
home to some kids. The kids of the west household are cousins of the
kids in the east household. Each kid writes each cousin every week a
letter, with each letter delivered by postal service in a separate envelope.
In each household is one kid – Ann in the west house, Bill in the east
house – responsible for mail collection and mail distribution.
Now try the application! Similar to the network layer, the postal service
provides a logical communication between the houses (it transports mail
only from house to house and not from person to person!). On the other
hand, Ann and Bill can be compared with the transport layer since they
provide logical communication between the cousins in the two houses.
(This analogy is described in detail in J. F. Kurose, K. W. Ross: Computer
Networking - chapter: transport layer)