Process-to-process delivery is a fundamental concept in computer networking where data is transmitted between applications (processes) running on different hosts. This is achieved using transport layer protocols such as UDP (User Datagram Protocol), TCP (Transmission Control Protocol), and SCTP (Stream Control Transmission Protocol). Each protocol has distinct characteristics, making them suitable for different types of communication.
1. Process-to-Process Delivery
Before diving into UDP, TCP, and SCTP, it’s essential to understand how data moves between processes.
Key Concepts:
-
Host-to-Host vs. Process-to-Process:
- Host-to-Host (Network Layer - IP): Ensures data reaches the correct machine.
- Process-to-Process (Transport Layer - UDP/TCP/SCTP): Ensures data reaches the correct application on that machine.
-
Port Numbers:
- Used to identify processes (applications).
- Well-known ports (0–1023): HTTP (80), FTP (21), SSH (22).
- Registered ports (1024–49151): Assigned by IANA for specific services.
- Dynamic/Private ports (49152–65535): Used temporarily by clients.
-
Multiplexing & Demultiplexing:
- Multiplexing: Combining multiple application data streams into one transport layer segment.
- Demultiplexing: Separating received data and delivering it to the correct application.
2. UDP (User Datagram Protocol)
Overview:
- Connectionless: No handshaking before sending data.
- Unreliable: No guarantees for delivery, ordering, or duplicate protection.
- Lightweight: Low overhead (small header, no flow/error control).
UDP Header (8 Bytes)
Field | Size (Bytes) | Description |
---|---|---|
Source Port | 2 | Sender’s port (optional, can be 0) |
Destination Port | 2 | Receiver’s port |
Length | 2 | Total length (header + data) |
Checksum | 2 | Error detection (optional) |
Characteristics of UDP:
- No Connection Establishment: Data is sent immediately.
- No Acknowledgments (ACKs): No retransmission of lost packets.
- No Flow Control: Sender can overwhelm the receiver.
- No Congestion Control: Can contribute to network congestion.
- Supports Multicast & Broadcast: Useful for streaming, DNS, DHCP.
Use Cases:
- DNS (Domain Name System): Fast lookups.
- VoIP (Voice over IP): Real-time communication.
- Online Gaming: Low latency preferred over reliability.
- IoT & Sensor Data: Small, frequent transmissions.
3. TCP (Transmission Control Protocol)
Overview:
- Connection-Oriented: Requires a three-way handshake before data transfer.
- Reliable: Guarantees delivery, ordering, and error detection.
- Flow & Congestion Control: Prevents overwhelming the receiver or network.
TCP Header (20–60 Bytes)
Field | Size (Bytes) | Description |
---|---|---|
Source Port | 2 | Sender’s port |
Destination Port | 2 | Receiver’s port |
Sequence Number | 4 | Byte position in the stream |
Acknowledgment Number | 4 | Next expected byte |
Header Length | 1.5 | Size of the header (in 32-bit words) |
Control Flags | 1.5 | SYN, ACK, FIN, RST, etc. |
Window Size | 2 | Receiver’s buffer size (flow control) |
Checksum | 2 | Error detection |
Urgent Pointer | 2 | Points to urgent data (if URG flag set) |
Options | 0–40 | Additional features (MSS, SACK, etc.) |
Key Features of TCP:
-
Three-Way Handshake (Connection Establishment):
- SYN → SYN-ACK → ACK
- Ensures both sides are ready.
-
Reliable Data Transfer:
- Sequence Numbers: Track byte order.
- ACKs: Confirm received data.
- Retransmission: Lost packets are resent.
-
Flow Control (Sliding Window):
- Adjusts sending rate based on receiver’s buffer.
-
Congestion Control (AIMD, Slow Start):
- Prevents network overload.
-
Connection Termination (Four-Way Handshake):
- FIN → ACK → FIN → ACK
Use Cases:
- HTTP/HTTPS (Web Browsing): Reliable page loading.
- FTP (File Transfer): Ensures complete file delivery.
- Email (SMTP): Guarantees message integrity.
- SSH (Secure Shell): Secure remote access.
4. SCTP (Stream Control Transmission Protocol)
Overview:
- Combines features of TCP & UDP: Reliable like TCP, but message-oriented like UDP.
- Multi-homing & Multi-streaming: Supports multiple IP paths and parallel streams.
- Resistant to DoS attacks: Better security than TCP.
SCTP Header (12+ Bytes)
Field | Size (Bytes) | Description |
---|---|---|
Source Port | 2 | Sender’s port |
Destination Port | 2 | Receiver’s port |
Verification Tag | 4 | Protects against blind attacks |
Checksum | 4 | Error detection |
Chunks | Variable | Data, control, or error messages |
Key Features of SCTP:
- Message-Oriented (Like UDP): Preserves message boundaries.
- Reliable (Like TCP): ACKs, retransmissions, and sequencing.
- Multi-Streaming: Multiple independent data streams in one connection.
- Multi-Homing: Can use multiple network paths for redundancy.
- No Head-of-Line Blocking: Lost packet in one stream doesn’t block others.
Use Cases:
- VoIP & Video Conferencing: Handles multiple streams efficiently.
- Telecom Signaling (SIGTRAN): SS7 over IP.
- WebRTC: Real-time communication.
- High-Availability Systems: Multi-homing for failover.
5. Comparison: UDP vs. TCP vs. SCTP
Feature | UDP | TCP | SCTP |
---|---|---|---|
Connection Type | Connectionless | Connection-Oriented | Connection-Oriented |
Reliability | Unreliable | Reliable | Reliable |
Ordering | No | Yes | Yes |
Flow Control | No | Yes | Yes |
Congestion Control | No | Yes | Yes |
Message Boundaries | Preserved | Byte-stream | Preserved |
Multi-Streaming | No | No | Yes |
Multi-Homing | No | No | Yes |
Use Cases | DNS, VoIP, Gaming | Web, Email, FTP | VoIP, Telecom, WebRTC |