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!
2. Port Numbers and Address Ranges
Processes are addressed via 16-bit unsigned integers called Port Numbers, providing possible ports ( to ).
The Internet Assigned Numbers Authority (IANA) divides the port spectrum into three ranges:
- Well-Known Ports ():
- 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)
- Registered Ports ():
- 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).
- Dynamic / Private / Ephemeral Ports ():
- 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:
Every end-to-end transport communication is uniquely identified across the entire planet by a Socket Pair:
4. Multiplexing and Demultiplexing
Connectionless Demultiplexing (UDP):
- A UDP socket is identified solely by a two-tuple:
- 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:
- 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!
Frequently Asked Questions
QDifferentiate 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.
QWhat is an Ephemeral Port?
A short-lived, dynamically allocated port number (from range ) assigned by the client's operating system to identify the local client process for the duration of a network connection.
QWhat four parameters uniquely identify an active TCP connection?
Source IP Address, Source Port Number, Destination IP Address, and Destination Port Number.
QWhat are the three IANA port ranges?
Well-known ports 0–1023 (standard servers such as HTTP 80, DNS 53), registered ports 1024–49151 (vendor services) and dynamic/ephemeral ports 49152–65535 (temporary client ports).