DC Exam Perp
DC Exam Perp
Ans
1. Fault Tolerance
Definition:
Fault tolerance is the system’s ability to continue functioning even in the presence of
failures (hardware, software, or network).
Explanation:
2. Scalability
Definition:
Scalability refers to the system's ability to handle growing amounts of work or its
potential to accommodate growth.
Explanation:
Definition:
Security is about protecting data and resources from unauthorized access and
ensuring integrity and confidentiality.
Explanation:
4. Synchronization
Definition:
Synchronization ensures that the operations across distributed nodes are
coordinated in time.
Explanation:
5. Resource Management
Definition:
Resource management involves efficient allocation and scheduling of distributed
resources.
Explanation:
6. Transparency
Definition:
Transparency hides the complexities of the distributed system from the user and
programmer.
Types of Transparency:
Explanation:
7. Heterogeneity
Definition:
Heterogeneity refers to the diversity in hardware, operating systems, networks, and
programming languages in a distributed system.
Explanation:
Definition:
Concurrency is the ability of the system to allow multiple processes to execute
simultaneously.
Explanation:
Conclusion
2) Analyze how Ricard - Agrawala's algorithm optimises the message overhead in
acheiving mutual exclusion?
Ans
In this algorithm, when a process wants to enter the CS, it sends a REQUEST message to
all (N − 1) processes. Each receiving process either immediately replies with a REPLY
message or defers the reply based on the timestamp comparison. The requesting process
enters the CS only after receiving all (N − 1) REPLY messages.
Overall, the Ricart–Agrawala algorithm maintains mutual exclusion while minimizing the
communication cost, making it suitable for systems where message efficiency is critical.
Ans:
1. Introduction
Global scheduling in distributed systems refers to the process of making scheduling
decisions by considering the state and workload of all available nodes in the system. Unlike
local scheduling, which only considers one node, global scheduling attempts to optimize
performance across the entire distributed system.
1. Fairness
The algorithm should ensure that no task or user is unfairly delayed or starved. All tasks
should receive equitable access to computational resources.
2. Efficiency
It should maximize system throughput and minimize job completion time. Idle resources
must be efficiently utilized.
3. Scalability
The algorithm must scale well with the increasing number of tasks and computing nodes
without degradation in performance.
4. Adaptability
It must adapt to changes in workload, resource availability, and system configuration in real
time.
5. Low Overhead
The scheduling mechanism should not consume excessive network bandwidth, memory, or
processing power.
6. Load Balancing
Workload should be evenly distributed among all participating nodes to avoid bottlenecks
and improve overall system performance.
7. Fault Tolerance
The algorithm should handle node failures gracefully by redistributing the tasks without
interrupting ongoing processes.
8. Transparency
Users should not be aware of the complexity involved in scheduling. The system should
provide location and access transparency.
9. Priority Support
It should support scheduling based on task priorities, ensuring that critical or time-sensitive
tasks are executed promptly.
3. Conclusion
A good global scheduling algorithm in a distributed system must be fair, efficient, scalable,
and fault-tolerant. It should ensure optimal use of system resources while providing a
transparent and reliable computing environment for the users.
Ans:
1. Introduction
In Distributed Systems (DS), processes residing on different nodes must communicate with
each other to exchange data and coordinate actions. Communication between these
processes is typically done using message passing. The Message Communication Model
defines how messages are sent, stored, and received, and is broadly classified based on
two dimensions:
2. Communication Dimensions
a. Synchronous Communication
In synchronous communication, the sender and receiver must be active simultaneously. The
sender blocks (waits) until the receiver acknowledges receipt of the message.
b. Asynchronous Communication
In asynchronous communication, the sender does not wait for the receiver. It sends the
message and continues its execution without blocking.
c. Persistent Communication
In persistent communication, the message is stored by the communication system
(middleware or message queue) until it is successfully delivered to the receiver, even if the
receiver is temporarily unavailable.
d. Transient Communication
In transient communication, the message is stored only while both sender and receiver are
active. If the receiver is not ready or the message is not delivered immediately, it is lost.
● In this model, the sender waits for the receiver to be ready and to acknowledge
receipt of the message.
● If the receiver is not available at the time of sending, the message is discarded.
● Here, the sender sends the message and does not wait.
● However, the message will be lost if the receiver is not available or ready.
● The sender waits until the message is stored and acknowledged by the receiver.
● The message is kept in storage (queue or buffer) until the receiver receives it.
● Use Case: Systems that require guaranteed delivery with confirmation (e.g., email
systems with delivery receipts).
4. Conclusion
Ans:
1. Introduction
2. Components of RPC
● Client Stub: Interface on the client side that represents the remote function.
● Server Stub: Interface on the server side that receives the call and invokes the
actual function.
2. Client stub marshals the procedure name and arguments into a message.
4. Server stub unmarshals the message and retrieves the arguments.
6. The result is marshalled back into a message by the server stub.
8. The client stub unmarshals the result and returns it to the client program.
4. Features of RPC
5. Advantages
● Simplifies distributed computing.
6. Disadvantages
(In actual exams, draw a diagram showing Client → Stub → Network → Server Stub →
Procedure and back.)
8. Conclusion
RPC is a vital concept in distributed systems that simplifies the process of calling remote
services. By making remote calls appear as local calls, it improves abstraction and
modularity, enabling scalable system development.
Ans:
1. Introduction
2. Terminology
● Token: A unique control message that grants permission to enter the critical section.
● Request Number (RN[i]): An array maintained by each process to store the latest
request number from each process.
● Last Request Number (LN[i]): Maintained in the token; represents the last request
number served for each process.
● When a process Pj receives a request from Pi, it updates RN[i] if the request
number is higher than the one it has.
● If Pj holds the token and is not in the critical section, and it sees that RN[i] >
LN[i], it sends the token to Pi.
● The process that receives the token enters the critical section.
● After exiting, it updates the token's LN[i] to its latest served request.
● It checks for any other pending requests. If found, it sends the token to the next
eligible process.
4. Example Flow
Assume 3 processes: P0, P1, P2
5. Advantages
● Fewer messages in the long run compared to some other mutual exclusion
algorithms.
6. Disadvantages
7. Conclusion
Suzuki-Kasami’s algorithm is a simple and efficient solution for achieving mutual exclusion in
distributed systems using a single token and broadcasted requests. It offers fairness,
simplicity, and reduced message overhead in the long run.
8) Analyze the architecture and performance of Andrew File System (AFS). Compare it
with Network File System (NFS). Discuss the advantages and limitations of each.
Ans:
1. Introduction
Distributed File Systems (DFS) allow multiple users and systems to share files across a
network as if the files were stored locally. Two notable DFS implementations are the Andrew
File System (AFS) and the Network File System (NFS). Each follows a client-server
architecture but differs significantly in their design, performance, and scalability.
2. Architecture of AFS
3. Architecture of NFS
● Earlier versions lack caching; later versions introduced limited caching mechanisms.
4. Performance Comparison
AFS Advantages:
AFS Limitations:
NFS Advantages:
NFS Limitations:
While both AFS and NFS serve the purpose of file sharing in a distributed environment, AFS
offers better scalability and performance due to its caching mechanism and callback
strategy. NFS, though simpler, may suffer from performance bottlenecks in larger systems.
The choice depends on the system size, complexity, and performance requirements.
3. Scalability
○ Server notifies clients when a file has been modified → ensures consistency
efficiently.
○ Clients don’t need to know file server locations; files appear to be locally
available.
❌ Limitations of AFS
1. High Initial Latency
○ Changes are written back only when the file is closed, not instantly → not
ideal for real-time collaborative editing.
○ Needs more disk space on client side to store full file caches.
❌ Limitations of NFS
1. High Server Load
○ Multiple users editing the same file at once may lead to conflicts.
Ans:
In a Distributed System (DS), scheduling strategies are critical for improving resource
utilization, responsiveness, and system performance. Three prominent strategies are Load
Sharing, Task Assignment, and Load Balancing. Each strategy aims to optimize the
placement of processes, but they differ in their goals, timing, and implementation.
● Key Features:
○ Reactive approach.
● Advantages:
● Limitations:
● Definition:
This strategy selects the best-suited node for a task at the time of arrival based on
predefined metrics like CPU power, memory availability, etc.
● Key Features:
● Advantages:
● Definition:
Load balancing aims to distribute tasks evenly among all available nodes to
optimize system-wide performance.
● Key Features:
● Advantages:
● Limitations:
○ Complex to implement.
Comparison Table
Feature Load Sharing Task Assignment Load Balancing
Main Goal Avoid overload Assign task to best Equalize load across
node all nodes
Conclusion
All three strategies serve different purposes in distributed systems. Load Sharing is simple
and suitable for small or loosely-coupled systems. Task Assignment provides initial
efficiency but lacks adaptability. Load Balancing, though complex, ensures optimal and fair
use of resources, especially in large-scale or dynamic systems.
10) Explain the Bully Election Algorithm with the help of an example.
Ans:
The Bully Algorithm is a leader election algorithm used in distributed systems where
each process has a unique identifier (ID). The algorithm ensures that the process with the
highest ID becomes the new coordinator after failure detection.
● A process initiates an election if it detects that the current coordinator has failed.
● This continues until the process with the highest ID, which receives no response
from higher processes, declares itself the coordinator.
3. Example:
arduino
CopyEdit
1 2 3 4 5
Let the current coordinator (P5) crash. Here's how the election proceeds:
○ P3 withdraws.
4. P4 sends COORDINATOR message to P1, P2, and P3 to inform them of the new
coordinator.
Message Description
Type
● Suitable when process IDs represent relative power (e.g., computing capacity).
6. Limitations:
● Not efficient for dynamic systems where nodes frequently join or leave.
7. Conclusion:
The Bully Election Algorithm ensures that the process with the highest ID becomes the
coordinator in case of failures. Although simple and effective in smaller systems, its
performance can degrade in large, dynamic environments due to high message overhead.
Ans:
1. Replication Model
● Definition:
In this model, multiple copies (replicas) of data are maintained across different
nodes.
● Purpose:
Improve fault tolerance, availability, and performance.
● Types of Replication:
● Challenges:
2. Caching Model
● Definition:
Frequently accessed data is stored in a local temporary memory (cache) to
reduce access time.
● Purpose:
Enhance performance by reducing communication with the main data server.
● Types:
● Challenges:
3. Mobile Model
● Definition:
The data or computation moves across different nodes to be closer to the user or
where it's needed.
● Example:
In edge computing, data is moved closer to the device (mobile, IoT) for faster
response.
● Purpose:
Improve responsiveness and reduce network latency.
● Challenges:
4. Transaction Model
● Definition:
Data operations are grouped into transactions that follow the ACID properties
(Atomicity, Consistency, Isolation, Durability).
● Purpose:
Ensure reliable updates and data integrity even in failure conditions.
● Challenges:
5. Consistency Models
● Definition:
Define how updates to a data item are visible to different users in the system.
● Types:
○ Strict Consistency: All users see the same value at the same time.
● Purpose:
Balance between performance and correctness.
❌ Limitations:
● Complexity in managing replication and consistency.
Conclusion:
11) Explain Maekawa’s Algorithm for Mutual Exclusion and specify the properties of Quorum
Sets
Ans:
1. Basic Concept:
Each process in the system is associated with a quorum set, a subset of processes
(including itself). To enter the Critical Section (CS), a process must obtain permission
(REPLY) from all members of its quorum.
The key idea is that all quorum sets intersect — meaning that any two processes must
share at least one common process in their respective quorum sets. This common member
ensures that no two processes can enter the CS simultaneously.
2. Algorithm Steps:
A. Request Phase:
● The requesting process Pi sends a REQUEST message to all processes in its quorum
set Qi.
B. Granting Phase:
D. Release Phase:
Intersection Every pair of quorum sets must share at least one process in
common.
Symmetry All processes may have quorum sets of the same size (for
(optional) fairness).
4. Example:
5. Advantages:
6. Limitations:
Conclusion:
Ans:
1. Introduction
Code migration refers to the movement of code across different nodes in a distributed
system. It enables dynamic relocation of processes or components from one machine to
another during execution, allowing the system to achieve better load balancing, flexibility,
and resource utilization.
Code migration can be classified into the following types based on what is transferred:
a. Weak Mobility
b. Strong Mobility
● Both the code and execution state (e.g., variables, program counter) are moved.
a. Process Migration
b. Object Migration
● Objects (in object-oriented systems) are moved, including their methods and
attributes.
● Fault Tolerance: Faulty nodes can hand over their tasks to healthy ones.
8. Real-World Examples
● Java RMI (Remote Method Invocation): Supports object migration with stubs and
skeletons.
9. Conclusion
Code migration in distributed systems enables flexible, dynamic, and efficient system
behavior by allowing code to move across machines. Though it introduces complexities in
state transfer and security, it is a powerful paradigm for modern distributed computing,
especially in cloud, IoT, and mobile agent-based applications.
13) explain features in distributed file system and explain model file service architecture.
Ans:
1. Introduction
A Distributed File System (DFS) enables users to store, access, and manage files across
multiple distributed nodes while providing a unified interface as if the data resides on a
single system. DFS plays a critical role in distributed computing by offering transparency,
reliability, and scalability in file handling.
5. Scalability
DFS can handle a growing amount of work or an increasing number of clients by
adding more servers.
6. Performance
Uses techniques such as caching, replication, and load balancing to ensure fast file
access.
7. Security
Incorporates mechanisms for authentication, authorization, and encryption to ensure
data security.
8. Heterogeneity
DFS operates across different hardware platforms and operating systems using
standard protocols.
9. Consistency
Ensures users view the most recent version of a file using synchronization protocols.
10.Data Sharing
Files can be shared across multiple users and applications with controlled access.
The file service architecture defines how client requests for file operations are handled by
the distributed file system.
● Provides an interface for system calls like open(), read(), write(), and
close().
CopyEdit
User Application
Client Module
↓
Physical Storage (Disks)
4. Conclusion
The Distributed File System provides an efficient and scalable way to manage files over a
network. With features like transparency, fault tolerance, and concurrency control, DFS is
widely used in modern computing systems. The File Service Architecture ensures modularity
and efficient file handling by dividing the system into client, service, and storage
components.
—------------------------------------------------------------------------------------------------------------------------
Ans:
1. Introduction
In a distributed system, different nodes operate independently and maintain their own clocks.
Due to clock drift and lack of a global time reference, these clocks may differ, leading to
inconsistencies in event ordering and coordination. Synchronization is required to ensure
consistent time perception across the system.
🧪 Characteristics:
● Represents actual time (e.g., 12:45 PM).
○ Cristian’s Algorithm
○ Berkeley Algorithm
b. Algorithms Used:
● Cristian’s Algorithm:
Uses a time server to send accurate time to other nodes.
Adjusts time considering message transmission delay.
● Berkeley Algorithm:
Averages the time of all nodes in the system and then corrects each clock
accordingly.
No master clock is assumed.
🧪 Characteristics:
● Does not represent real time.
b. Vector Clocks:
4. Comparison
5. Conclusion