Transport Layer · Computer Networks

Process to Process Communication

Watch lectures

Process-to-Process Communication


1. The Role of the Transport Layer

While the Data Link Layer is responsible for Node-to-Node (Hop-to-Hop) delivery and the Network Layer is responsible for Host-to-Host (Source-to-Destination) delivery, the Transport Layer is responsible for Process-to-Process Delivery.

A host computer runs dozens of network applications simultaneously (web browser, email client, music stream, chat application). Receiving a packet at the host interface is insufficient—the operating system must deliver the payload to the exact running program (process) that initiated the connection!

                                  NETWORK DELIVERY SCOPES
+---------------------+-------------------------------------+-----------------------------------+
| LAYER               | DELIVERY SCOPE                      | ADDRESSING USED                   |
+---------------------+-------------------------------------+-----------------------------------+
| 4. Transport        | Process-to-Process (End-to-End)     | Port Numbers (16-bit)             |
| 3. Network          | Host-to-Host (Source-to-Dest)       | IP Addresses (32/128-bit)         |
| 2. Data Link        | Node-to-Node (Hop-to-Hop)           | MAC Addresses (48-bit)            |
+---------------------+-------------------------------------+-----------------------------------+

2. Port Numbers and Address Ranges

Processes are addressed via 16-bit unsigned integers called Port Numbers, providing 216=65,5362^{16} = 65{,}536 possible ports (00 to 65,53565{,}535).

The Internet Assigned Numbers Authority (IANA) divides the port spectrum into three ranges:

 0                    1023 1024                49151 49152             65535
 +------------------------+-------------------------+-----------------------+
 |   Well-Known Ports     |    Registered Ports     | Dynamic / Ephemeral   |
 |   (Standard Servers)   |    (Vendor Services)    | (Temporary Clients)   |
 +------------------------+-------------------------+-----------------------+
  1. Well-Known Ports (0−10230 - 1023):
    • Reserved for universal standard server applications. Requires root/administrator privileges to bind.
    • Examples:
      • Port 20 / 21: FTP (File Transfer Protocol)
      • Port 22: SSH (Secure Shell)
      • Port 25: SMTP (Simple Mail Transfer Protocol)
      • Port 53: DNS (Domain Name System)
      • Port 67 / 68: DHCP (Server / Client)
      • Port 80: HTTP (World Wide Web)
      • Port 443: HTTPS (HTTP Secure over TLS)
  2. Registered Ports (1024−491511024 - 49151):
    • Registered with IANA by software vendors to avoid port collisions (e.g., Port 3306 for MySQL, Port 5432 for PostgreSQL, Port 8080 for HTTP Alternate).
  3. Dynamic / Private / Ephemeral Ports (49152−6553549152 - 65535):
    • Short-lived, temporary port numbers assigned automatically by the local operating system kernel to client applications when they initiate an outbound connection. Reclaimed when the socket closes.

3. The Socket Address

An IP address alone only identifies a physical computer. A port number alone only identifies a process on a machine.

The combination of an IP Address and a Port Number is called a Socket Address:

Socket Address=(IP Address:Port Number)\text{Socket Address} = (\text{IP Address} : \text{Port Number})
Example: 192.168.1.15:52140\text{Example: } 192.168.1.15 : 52140

Every end-to-end transport communication is uniquely identified across the entire planet by a Socket Pair:

(Source IP,Source Port)⟷(Destination IP,Destination Port)(\text{Source IP}, \text{Source Port}) \longleftrightarrow (\text{Destination IP}, \text{Destination Port})

4. Multiplexing and Demultiplexing

  APPLICATION LAYER:
  [ Web Browser: Port 51000 ]    [ SSH Client: Port 51001 ]    [ DNS Resolver: Port 51002 ]
               \                             |                             /
                +----------------------------+----------------------------+
                                             |
  TRANSPORT LAYER:             MULTIPLEXING (Gathers data & prepends Port headers)
                                             |
                                             v
  NETWORK LAYER:                    IP Packet Transmission
                                             |
                                             v
  RECEIVER TRANSPORT:          DEMULTIPLEXING (Directs packets to correct port)
                                             |
                +----------------------------+----------------------------+
               /                             |                             \
  [ Web Server: Port 80 ]        [ SSH Daemon: Port 22 ]       [ DNS Server: Port 53 ]

Connectionless Demultiplexing (UDP):

  • A UDP socket is identified solely by a two-tuple:
(Destination IP,Destination Port)(\text{Destination IP}, \text{Destination Port})
  • All incoming UDP datagrams directed to that destination port are delivered to the same socket, regardless of which source IP or source port they originated from.

Connection-Oriented Demultiplexing (TCP):

  • A TCP socket is identified by a strict four-tuple:
(Source IP,Source Port,Destination IP,Destination Port)(\text{Source IP}, \text{Source Port}, \text{Destination IP}, \text{Destination Port})
  • When a client connects to a web server on Port 80, the server OS creates a dedicated socket specifically for that four-tuple, allowing a single server port (Port 80) to handle thousands of concurrent client connections without mixing up data streams!

5. Key Exam Questions & Takeaways

  1. Differentiate Host-to-Host delivery from Process-to-Process delivery.
    • Host-to-Host delivery (Network Layer) moves packets across intermediate networks from the source computer to the destination computer using IP addresses. Process-to-Process delivery (Transport Layer) takes the payload from the destination computer and routes it to the specific active software process using Port numbers.
  2. What is an Ephemeral Port?
    • A short-lived, dynamically allocated port number (from range 49152−6553549152 - 65535) assigned by the client's operating system to identify the local client process for the duration of a network connection.
  3. What four parameters uniquely identify an active TCP connection?
    • Source IP Address, Source Port Number, Destination IP Address, and Destination Port Number.
Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.

← All Computer Networks modules