Distributed Computing -- Concepts, Paradigms & Protocols
DISTRIBUTED COMPUTING
Concepts, Paradigms & Protocols
Comprehensive Study Notes -- 15 Key Questions Answered in Detail
Q1 Define Abstraction
Definition
Abstraction is the process of hiding the complex implementation details of a system and exposing only
the essential features or interface to the user. It allows programmers to work at a higher conceptual
level without worrying about low-level details.
Key Characteristics
* Hides complexity -- internal workings are not visible to the user
* Provides a simplified model of a complex system
* Enables modularity and reusability of components
* Reduces programming effort and improves maintainability
Types of Abstraction in Distributed Computing
Term Description
Data Abstraction Hiding how data is stored/organized; exposing only access operations
Process Abstraction Hiding how a process runs; only input/output behavior is visible
Resource Abstraction Hiding hardware details (CPU, memory, network) behind logical
interfaces
Communication Hiding network protocols behind high-level messaging APIs (e.g., RPC,
Abstraction sockets)
Example: When you call a remote procedure (RPC), you simply call a function -- you do not need to
know that it involves network packets, serialization, or remote server execution. The network
complexity is abstracted away.
Q2 What is a Paradigm?
Definition
A paradigm is a model, framework, or pattern that represents a fundamental style or approach to
solving problems. In computing, a programming or computing paradigm defines the conceptual
framework and methodology used to structure programs or distributed systems.
Page 1
Distributed Computing -- Concepts, Paradigms & Protocols
In the Context of Distributed Computing
A distributed computing paradigm defines HOW processes in a distributed system communicate,
coordinate, and collaborate with each other. It determines the structure of interactions between nodes.
Common Paradigms in Computing
Term Description
Message Passing Processes communicate by explicitly sending and receiving messages
Client-Server A client requests services from a dedicated server
Peer-to-Peer (P2P) All nodes are equal and can act as both client and server
Message System A middleware broker handles message routing between producers and
consumers
Object-Based Distributed objects interact via method calls (e.g., RMI, CORBA)
Data-Space Processes share a logical data space (e.g., tuple spaces, Linda)
Q3 Diagram of Distributed Computing Paradigms and Their Level of
Abstraction
The following diagram shows the major distributed computing paradigms arranged by their level of
abstraction -- from lowest (closest to hardware) to highest (farthest from hardware).
LEVEL OF ABSTRACTION IN DISTRIBUTED COMPUTING PARADIGMS
ABSTRACTION LEVEL PARADIGM MECHANISM / EXAMPLE
^ HIGHEST Message System / MOM JMS, AMQP, Kafka, RabbitMQ
| Object-Based (RMI/CORBA) Java RMI, CORBA, DCOM
| Client-Server Paradigm HTTP/REST, FTP, Telnet
| Peer-to-Peer (P2P) BitTorrent, Gnutella, Chord
| Message Passing MPI, PVM, Sockets
v LOWEST Raw Socket / Datagram TCP Socket, UDP Datagram
Note: Higher abstraction = more features and ease-of-use but less control. Lower abstraction = fine-
grained control but more programming effort required.
Q4 What is Message Passing? Basic Operations
Definition
Message passing is a communication paradigm in distributed systems where processes interact by
sending and receiving messages over a network. It is the fundamental mechanism for inter-process
communication (IPC) in distributed computing environments where processes do NOT share memory.
Page 2
Distributed Computing -- Concepts, Paradigms & Protocols
Characteristics
* Processes are independent and communicate only through messages
* Messages can be synchronous (blocking) or asynchronous (non-blocking)
* No shared memory is required between communicating processes
* Suitable for both local and distributed environments
Basic Operations Required to Support Message Passing
Term Description
send(message, dest) Sender transmits a message to a specified destination process or
address
receive(message, src) Receiver waits for (or picks up) a message from a source or any source
connect() Establishes a communication channel between two processes
(connection-oriented)
disconnect() Tears down an established communication channel after communication
is complete
bind(address) Associates a process with a specific network address so others can
address it
listen() Puts a process in a state ready to accept incoming messages or
connections
accept() Accepts an incoming connection or message from another process
Types of Message Passing
* Synchronous (Blocking): The sender blocks (waits) until the receiver acknowledges
* Asynchronous (Non-blocking): The sender continues execution after sending; no wait
* Buffered: Messages are stored in a buffer; sender and receiver don't need to be synchronized
* Unbuffered: Direct transfer; sender and receiver must be ready simultaneously
Q5 Uses of Sender and Receiver in Socket Application Program Interface
Overview of Socket API
The Socket Application Programming Interface (API) provides a standard way for programs to
communicate over a network using either the TCP or UDP protocol. Every socket communication
involves a sender and a receiver.
Role of the SENDER in Socket API
Term Description
socket() Creates a new socket endpoint for communication
connect() For TCP: establishes a connection to the remote receiver (server)
Page 3
Distributed Computing -- Concepts, Paradigms & Protocols
send() / sendto() Transmits data over the socket to the receiver (sendto() used for UDP
with address)
write() Alternative to send(); writes data to a connected socket stream
close() Closes the socket connection after data transmission is complete
Role of the RECEIVER in Socket API
Term Description
socket() Creates a socket endpoint to listen on
bind() Binds the socket to a specific IP address and port so clients can reach it
listen() Marks the socket as passive -- ready to accept incoming connections
(TCP only)
accept() Accepts an incoming connection request; returns a new socket for that
client (TCP)
recv() / recvfrom() Receives data from the sender (recvfrom() captures sender address for
UDP)
read() Alternative to recv(); reads data from the socket stream
close() Closes the socket after receiving data
TCP Socket Flow: RECEIVER: socket -> bind -> listen -> accept -> recv -> close | SENDER: socket
-> connect -> send -> close
Q6 What is Client-Server Paradigm?
Definition
The client-server paradigm is a distributed computing model in which a service provider (server) offers
resources or services, and service consumers (clients) request and use those services over a network.
It is the most widely used paradigm in networked systems.
Key Roles
Term Description
Client Initiates requests for services. Waits for response. Example: web
browser, email client, FTP client
Server Listens for requests, processes them, and sends responses. Runs
continuously. Example: web server, database server
Characteristics
* Asymmetric roles: clients request, servers respond
* Servers are passive (wait) until a client initiates contact
Page 4
Distributed Computing -- Concepts, Paradigms & Protocols
* One server can serve multiple clients simultaneously
* Servers are usually always-on (available 24/7)
* Communication is typically request-response based
Client-Server Interaction Diagram
CLIENT NETWORK SERVER
1. Send Request -->>-->-->-->>-->>-->-->-->>-->-->>-->>--> Receive Request
2. Process Request
3. Receive Response <<--<<--<<--<<--<<--<<--<<--<<--<<-- Send Response
Examples
* Web: Browser (client) <-> Apache/Nginx Web Server
* Email: Mail Client (Thunderbird) <-> Mail Server (SMTP/IMAP)
* Database: Application <-> MySQL/Oracle Server
* File: FTP Client <-> FTP Server
Q7 What is Peer-to-Peer (P2P) Paradigm?
Definition
The peer-to-peer (P2P) paradigm is a distributed computing model where all participating nodes (peers)
are equal in terms of capabilities and responsibilities. Each peer can act as BOTH a client (requesting
services) AND a server (providing services) simultaneously -- there is no dedicated server.
Key Characteristics
* No central server -- all nodes are equal
* Each peer shares resources (bandwidth, storage, processing power)
* Highly decentralized and fault-tolerant
* Scales naturally as more peers join
* Peers can join and leave the network dynamically
Comparison: Client-Server vs Peer-to-Peer
Feature Client-Server Peer-to-Peer
Roles Asymmetric (client/server) Symmetric (both)
Central Server Yes, required No, none needed
Scalability Limited by server Scales with peers
Fault Tolerance Single point of failure Highly resilient
Cost Higher (server infra) Lower (shared resources)
Example Web browser / Apache BitTorrent, Gnutella
Page 5
Distributed Computing -- Concepts, Paradigms & Protocols
Examples of P2P Systems
* BitTorrent -- file sharing
* Gnutella -- decentralized file search
* Chord, Pastry -- distributed hash table (DHT) systems
* Bitcoin -- blockchain/cryptocurrency network
Q8 Message System Paradigm -- Definition and Types
Definition
A message system paradigm (also called Message-Oriented Middleware, MOM) is a high-level
communication paradigm where messages are exchanged between producers and consumers through
an intermediary message broker or middleware. The producer sends a message to the broker, and the
consumer retrieves it -- they do NOT communicate directly.
Key Features
* Decouples sender and receiver -- they do NOT need to be online simultaneously
* Supports asynchronous communication
* Guarantees message delivery (persistence and reliability)
* Supports filtering, routing, and priority queuing of messages
Types of Message System Paradigms
1. Point-to-Point (Queue-based)
A message sent by a producer is placed in a QUEUE. Only ONE consumer receives and processes
each message. After consumption, the message is removed from the queue.
* One producer -> One queue -> One consumer
* Guarantees each message is processed exactly once
* Example: Task queue, order processing system
Producer -> Message Queue -> Consumer
(Sender) [ Msg1 | Msg2 | Msg3 ] (Receiver)
2. Publish-Subscribe (Topic-based)
A producer (publisher) sends a message to a TOPIC. ALL consumers who have subscribed to that
topic receive a copy of the message.
* One publisher -> One topic -> Many subscribers
* Every subscriber gets a copy of the published message
* Example: News feeds, stock price updates, event notifications
Publisher Topic: 'sports' Subscriber 1
-> Publishes Msg [ Broadcast ] Subscriber 2
Subscriber 3
Page 6
Distributed Computing -- Concepts, Paradigms & Protocols
Examples of Message System Software: JMS (Java Message Service), AMQP, Apache Kafka,
RabbitMQ, IBM MQ, ActiveMQ
Q9 Software Engineering Issues When Choosing a Tool
Overview
When selecting a middleware tool, communication API, or distributed computing framework, software
engineers must consider several engineering concerns that affect system quality, maintainability, and
long-term success.
Issue 1: Portability
* The tool must work across different operating systems, platforms, and hardware architectures
* If the tool is platform-specific (e.g., Windows-only), it limits deployment options
* Standards-based tools (e.g., POSIX sockets, JVM-based frameworks) ensure broader compatibility
* Consider: Does the tool work on Linux, Windows, macOS? Is it cloud-compatible?
Issue 2: Scalability and Performance
* The tool must handle increasing workload (more users, more data) without degradation
* Tools with built-in load balancing, connection pooling, and concurrency support are preferred
* Consider throughput (messages/second), latency (response time), and resource consumption
* A tool efficient for 100 users may fail under 100,000 users -- scalability must be planned upfront
Other issues (for reference): Ease of use, documentation quality, security features, licensing cost,
community support, fault tolerance, and integration with existing systems.
Q10 Two Transport Layer Protocols Used in Datagram Socket API
The Datagram Socket API operates at the Transport Layer of the network stack. The two primary
transport protocols used are:
Term Description
1. UDP (User Datagram UDP is a connectionless, lightweight transport protocol. Data is sent as
Protocol) independent datagrams without establishing a connection. There is no
guarantee of delivery, ordering, or error checking beyond a simple
checksum. Used in DNS, video streaming, online gaming.
2. IP (Raw IP Sockets) Raw IP sockets allow direct access to the IP layer. Used for custom
protocol implementations, network diagnostics (ICMP ping), and security
tools. Less common in standard applications.
Primary Protocol for Datagram Sockets: UDP is the standard transport layer protocol used with
DatagramSocket in Java and SOCK_DGRAM in C/POSIX socket API.
Page 7
Distributed Computing -- Concepts, Paradigms & Protocols
Q11 Expand TCP and UDP
Acronym Full Form Brief Description
TCP Transmission Control Protocol Connection-oriented, reliable,
ordered byte-stream protocol.
Ensures all data arrives
correctly.
UDP User Datagram Protocol Connectionless, fast, lightweight
protocol. No guarantee of
delivery or order. Used for
speed-critical applications.
Q12 Uses of UDP and TCP
Uses of TCP (Transmission Control Protocol)
TCP is used when data MUST be delivered reliably, in order, and without errors:
* World Wide Web (HTTP/HTTPS) -- web page loading
* Email protocols -- SMTP, IMAP, POP3
* File Transfer Protocol (FTP) -- file uploads and downloads
* Secure Shell (SSH) -- remote login and command execution
* Database communication -- SQL queries to database servers
* Online banking and e-commerce -- where data integrity is critical
Uses of UDP (User Datagram Protocol)
UDP is used when SPEED is more important than guaranteed delivery:
* DNS (Domain Name System) -- fast name resolution queries
* VoIP (Voice over IP) -- real-time voice calls (Skype, Zoom audio)
* Video Streaming -- YouTube live, Netflix adaptive streaming
* Online Gaming -- real-time game state updates
* DHCP -- dynamic IP address assignment
* SNMP -- network device monitoring
* Broadcast/Multicast -- sending data to multiple receivers at once
Feature TCP UDP
Connection Connection-oriented Connectionless
Reliability Guaranteed delivery No guarantee
Ordering In-order delivery No ordering
Speed Slower (overhead) Faster (lightweight)
Error Recovery Yes (retransmission) No
Use Case Web, Email, FTP DNS, VoIP, Gaming
Page 8
Distributed Computing -- Concepts, Paradigms & Protocols
Q13 Two Classes in Java for Datagram Socket API
Java provides two main classes in the [Link] package for implementing UDP-based datagram socket
communication:
Term Description
1. DatagramSocket Represents a socket for sending and receiving datagram (UDP) packets.
Used by both client and server. Key methods: send(DatagramPacket p),
receive(DatagramPacket p), bind(SocketAddress addr), close()
2. DatagramPacket Encapsulates a datagram packet -- the actual unit of data transmitted.
Contains the data payload (byte array), destination IP address, and port
number. For receiving: DatagramPacket(byte[] buf, int length) For
sending: DatagramPacket(byte[] buf, int length, InetAddress addr, int
port)
SENDER: DatagramSocket socket = new DatagramSocket(); byte[] data = [Link]();
DatagramPacket pkt = new DatagramPacket(data, [Link], addr, 9000); [Link](pkt);
RECEIVER: DatagramSocket ss = new DatagramSocket(9000); byte[] buf = new byte[1024];
DatagramPacket in = new DatagramPacket(buf, [Link]); [Link](in);
Q14 Two Types of Sockets in Stream Mode Socket API
The Stream Socket API (which uses TCP) provides two types of sockets that represent the two ends of
a TCP connection:
Term Description
1. ServerSocket Used by the SERVER side. It listens on a specific port for incoming
(Passive / Listening) connection requests. When a connection arrives, it accepts it and creates
a new Socket for that connection. Key methods: ServerSocket(int port),
accept() -- returns a Socket, close() Analogy: The reception desk that
waits for and admits incoming visitors.
2. Socket (Active / Used by the CLIENT side to initiate a connection. Also returned by the
Connected) server's accept() call to represent the established connection with a
specific client. Key methods: Socket(String host, int port),
getInputStream(), getOutputStream(), close() Analogy: The telephone
handset used for the actual conversation.
Stream Socket Connection Flow
SERVER SIDE CLIENT SIDE
ServerSocket ss = new ServerSocket(8080) Socket cs = new Socket(host, 8080)
Socket conn = [Link]() <<-- TCP 3-Way Handshake -->
InputStream/OutputStream via conn InputStream/OutputStream via cs
[Link](); [Link]() [Link]()
Page 9
Distributed Computing -- Concepts, Paradigms & Protocols
Q15 Expand SSL and JSSE
Acronym Full Form Description
SSL Secure Sockets Layer A cryptographic protocol that
provides secure communication
over a network. Now succeeded
by TLS (Transport Layer
Security). Used to encrypt data
between client and server (e.g.,
HTTPS).
JSSE Java Secure Socket Extension The Java implementation of
SSL/TLS. Part of Java SE
platform and provides APIs
([Link]) for secure socket
communication in Java
applications.
Details: SSL
* Developed by Netscape in the 1990s for secure web communication
* Provides: Authentication (verifying identity using certificates), Encryption (scrambling data in transit),
Data Integrity (ensuring data is not tampered with)
* Operates between the Application Layer and Transport Layer (TCP)
* SSL 3.0 is now deprecated; replaced by TLS 1.2 and TLS 1.3
Details: JSSE
* Part of Java Standard Edition ([Link] package)
* Provides SSLSocket, SSLServerSocket, SSLContext, and SSLEngine classes
* Allows Java applications to use SSL/TLS transparently
* Supports X.509 digital certificates, key management, and trust management
* Used in Java-based web servers, HTTPS connections, and enterprise apps
SSL/TLS Handshake: Client Hello -> Server Hello + Certificate -> Key Exchange -> Change Cipher
Spec -> Encrypted Communication Begins
QUICK REFERENCE SUMMARY
# Topic Key Takeaway
1 Abstraction Hiding complexity; exposing
only essential interface
2 Paradigm A model/framework for
structuring distributed system
communication
3 Abstraction Diagram From Datagram (lowest) ->
Page 10
Distributed Computing -- Concepts, Paradigms & Protocols
Message System (highest)
4 Message Passing IPC via send/receive; basic ops:
send, receive, bind, listen,
accept
5 Socket API Roles Sender:
socket,connect,send,close |
Receiver:
socket,bind,listen,accept,recv,cl
ose
6 Client-Server Client requests, server
responds; asymmetric roles;
e.g., HTTP
7 Peer-to-Peer All nodes equal; act as client
AND server; e.g., BitTorrent
8 Message System Via broker; Types: Point-to-
Point (Queue) and Publish-
Subscribe (Topic)
9 SE Issues Portability (cross-platform) and
Scalability (handles growth)
10 Datagram Protocols UDP (primary) and Raw IP for
datagram socket API
11 TCP/UDP Expansion TCP = Transmission Control
Protocol; UDP = User Datagram
Protocol
12 TCP vs UDP Uses TCP: Web, Email, FTP; UDP:
DNS, VoIP, Gaming, Streaming
13 Java Datagram Classes DatagramSocket
(communication) and
DatagramPacket (data
encapsulation)
14 Stream Socket Types ServerSocket (server/passive)
and Socket (client/active)
15 SSL / JSSE SSL = Secure Sockets Layer;
JSSE = Java Secure Socket
Extension
Page 11