Process-to-Process Communication

 

Process-to-Process Communication

Definition

Process-to-process communication is the primary function of the Transport Layer. It ensures that data sent by a specific application (process) on the source computer is delivered to the correct application (process) on the destination computer.

A process is simply a running instance of an application program, such as a web browser, e-mail application, FTP client, or video streaming application.

While the Network Layer delivers data from one host (computer) to another (host-to-host communication), the Transport Layer delivers the data from one process to another (process-to-process communication).


Why is Process-to-Process Communication Needed?

Consider a computer connected to the Internet. It may be running several applications simultaneously:

  • Web browser (Chrome)
  • E-mail application (Outlook)
  • File Transfer (FTP)
  • Video conferencing (Zoom)
  • Music streaming application

When a message arrives at the destination computer, the operating system must determine which application should receive the data.

The Network Layer can identify only the destination computer using the IP address.

The Transport Layer identifies the correct application using port numbers.

Thus, the transport layer completes the delivery by handing the received data to the appropriate process.


Host-to-Host Communication vs Process-to-Process Communication

Host-to-Host Communication (Network Layer)

The Network Layer ensures that the packet reaches the correct computer.

Example:

Computer A  --------------------->  Computer B
      IP Address                     IP Address

The packet reaches Computer B, but the network layer does not know which application should receive it.


Process-to-Process Communication (Transport Layer)

The Transport Layer delivers the message to the correct application running on Computer B.

Computer A                             Computer B

Web Browser  ----------------------->  Web Browser

FTP Client  ------------------------>  FTP Server

E-mail Client ---------------------->  E-mail Server

Now the communication occurs between processes, not just computers.


Example

Suppose Alice opens a web browser and types:

www.google.com

The following events occur:

  1. The browser creates an HTTP request.
  2. TCP assigns destination port 80 (or 443 for HTTPS).
  3. The packet travels through the Internet.
  4. The Network Layer delivers it to Google's server.
  5. The Transport Layer examines the port number.
  6. It delivers the data to the Web Server process.

Similarly,

If Alice sends an email,

  • IP address identifies the destination computer.
  • Port number identifies the Email Server process.




Role of Port Numbers

The Transport Layer uses port numbers to distinguish between multiple processes.

Every application is assigned a unique port number.

For example:

ApplicationPort Number
HTTP80
HTTPS443
FTP21
SMTP25
DNS53
SSH22

Suppose a server receives the following packets:

Destination Port = 80

The Transport Layer immediately delivers the packet to the Web Server.

If

Destination Port = 25

The packet is delivered to the Mail Server.

Thus, IP addresses identify hosts, while port numbers identify processes.


Communication Analogy

Consider a large apartment building.

IP Address

The apartment building's address identifies the building.

15, MG Road

Port Number

Apartment number identifies the resident.

Apartment 402

The postal service first delivers the mail to the correct building (host), and then to the correct apartment (process).

Similarly,

  • IP Address → Computer (Host)
  • Port Number → Application (Process)

Difference Between Host-to-Host and Process-to-Process Communication

FeatureHost-to-Host CommunicationProcess-to-Process Communication
LayerNetwork LayerTransport Layer
IdentifiesComputerApplication Process
Address UsedIP AddressPort Number
CommunicationBetween two hostsBetween two application processes
ResponsibilityDeliver packet to destination computerDeliver data to the correct application

Illustration

                 Source Host                     Destination Host
              -----------------              ---------------------
              Web Browser (Port 50000) ----> Web Server (Port 80)
              FTP Client (Port 52000) -----> FTP Server (Port 21)
              Email Client (Port 53000) ---> SMTP Server (Port 25)
              -----------------              ---------------------
                     │                              │
               Transport Layer              Transport Layer
                     │                              │
               Network Layer                Network Layer
                     │                              │
                 Internet Communication (Host-to-Host)

The Network Layer ensures the packet reaches the destination host, while the Transport Layer ensures it reaches the correct process.


Advantages of Process-to-Process Communication

  • Enables multiple applications to communicate simultaneously.
  • Ensures data is delivered to the correct application.
  • Supports multiplexing and demultiplexing using port numbers.
  • Allows efficient sharing of network resources.
  • Provides end-to-end communication between application processes.

Comments

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Computer Networks

Introduction to Local Area Network (LAN)