Transport Layer · Computer Networks

Process-to-Process Communication

Watch lectures
SVGVector Architecture Diagram (SVG)
COMPUTER NETWORKS · Module 4★ High PriorityProcess-to-Process DeliveryIT Sem 6 · Code 100602 · Ports and SocketsMNEMONICData link = hop to hop · Network = host to host · Transport = process to process.A 16-bit port picks the process; IP + Port = Socket.Core BreakdownRoleTransport layer delivers data to the exact running process, not just the host.The network layer stops at the host; the OS needs a port to find the program.Port numbersA port is a 16-bit unsigned number: 2^16 = 65,536 ports (0 to 65,535).Server ports are fixed and well known; client ports are chosen by the OS.IANA rangesWell-known 0-1023 (HTTP 80, DNS 53), registered 1024-49151 (MySQL 3306),dynamic / ephemeral 49152-65535 for short-lived client connections.SocketSocket address = IP address : port, e.g. 192.168.1.15 : 52140.A connection is a socket pair: (src IP, src port) with (dst IP, dst port).Mux / DemuxMultiplexing: the sender gathers data from many apps and adds port headers.Demultiplexing: the receiver reads the port and hands data to the process.UDP vs TCPUDP socket = 2-tuple (dst IP, dst port): one socket serves all senders.TCP socket = 4-tuple (src IP, src port, dst IP, dst port): one per client.Diagram: Layers and PortsData Link: node-to-node · MAC 48-bitNetwork: host-to-host · IP 32/128-bitTransport: process-to-process · Port 16-bitSocket = IP : Port192.168.1.15 : 521400-1023Well-known1024-49151Registered49152-65535EphemeralTCP socket = 4-tuple · UDP = 2-tuple⚠️ Exam Traps & Viva Favorites① Which layer uses ports?Transport layer (L4): process-to-process.Network layer is host-to-host (IP), datalink is node-to-node (MAC).② Well-known port range?0 to 1023 (admin rights to bind). Ports49152-65535 are ephemeral (client side).Examples: HTTP 80, HTTPS 443, DNS 53.③ What identifies a TCP link?Four values: source IP, source port, dest IP,dest port. So one server port 80 servesthousands of clients at once.Tip: IP finds host · Port finds processMaster Revision Table(learn it row by row!)LevelDeliveryAddressSizeExampleData LinkNode-to-node (hop)MAC address48 bit00:1A:2B:3C:4D:5ENetworkHost-to-hostIP address32 / 128 bit192.168.1.15TransportProcess-to-processPort number16 bit80, 443, 53, 52140SocketOne endpointIP : PortIP + 16 bit192.168.1.15 : 52140TCP connectionUnique 4-tupleSocket pair2 sockets(srcIP, srcPort, dstIP, dstPort)UDP socketUnique 2-tupleDest IP + portIP + 16 bitAll senders share a socketQUICK FACTSPorts: 0-1023 well-known · 1024-49151 registered · 49152-65535 dynamic (ephemeral)Common: FTP 20/21 · SSH 22 · SMTP 25 · DNS 53 · DHCP 67/68 · HTTP 80 · HTTPS 443Socket = IP : Port · TCP demux by 4-tuple · UDP demux by 2-tupleVERIFIED★ Golden rule: IP gets you to the host,the port gets you to the process.

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!

MermaidDiagram
Rendering diagram…

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:

MermaidDiagram
Rendering diagram…
  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

MermaidDiagram
Rendering diagram…

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!

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 49152−6553549152 - 65535) 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).

Budget AppAndroid App

Pocketly on Android

Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.

← All Computer Networks modules