Q 2a.
Summarize the distributed system with issues
involved
Distributed System Definition: A distributed system is characterized by:
• Multiple Computers: It consists of several computers.
• No Shared Memory or Clock: These computers do not share a common
memory or a global clock.
• Message-Based Communication: They communicate with each other by
exchanging messages over a communication network.
• Independent Operating Systems: Each computer has its own memory and
runs its own operating system.
• Local vs. Remote Resources: Resources owned and controlled by a
computer are local, while those accessed through the network are remote and
typically more expensive to access due to communication delays and CPU
overhead.
Main Purpose: The primary goal of a distributed operating system is to manage the
hardware and software resources of a distributed system in such a way that users
perceive the entire system as a single, powerful, monolithic computer system.
Transparency is key, meaning the use of multiple processors and remote data
access should be invisible to the user.
Issues in Distributed Operating Systems:
• Global Knowledge:
• Challenge: Unlike shared memory systems, it's practically impossible to
collect up-to-date and accurate information about the global state of a
distributed system due to the absence of global memory, a global clock,
and unpredictable message delays.
• Impact: This makes designing and debugging algorithms for distributed
systems more complex, especially for tasks requiring knowledge of the
system's overall state or temporal ordering of events.
• Solutions/Approaches: Logical clocks (like Lamport's and Vector
Clocks) are used to establish a consistent ordering of events, and
algorithms exist to obtain a coherent global state.
• Naming:
• Challenge: How to refer to and locate objects (computers, printers,
services, files, users) in a distributed environment.
• Approaches: Name services map logical names to physical addresses
using table lookups or algorithms.
• Sub-issues: Replication of directories for availability (but with storage
and synchronization overhead), partitioning of directories (but with
difficulty in finding partitions), and ensuring location transparency.
• Scalability:
• Challenge: Ensuring that the system's design and performance do not
degrade significantly as the number of computers and users grows.
• Impact: Protocols that rely on broadcasting (e.g., for file location)
become inefficient and costly in large systems, as every computer
incurs message handling overhead. Designs where resource
requirements (storage, bandwidth, manpower) increase linearly with
system size are generally not scalable.
• Compatibility:
• Challenge: Achieving interoperability among diverse hardware and
software components.
• Levels of Compatibility:
• Binary Level: All processors execute the same binary instruction
set. Simplifies system development but restricts the inclusion of
different architectures.
• Execution Level: The same source code can be compiled and
executed properly on any computer.
• Protocol Level: The least restrictive; all system components
support a common set of protocols (e.g., for file access, naming,
authentication). Allows different operating systems to coexist.
• Process Synchronization:
• Challenge: Synchronizing processes running on different computers,
especially when they concurrently access shared resources, due to the
absence of shared memory.
• Problems: Mutual exclusion (ensuring only one process accesses a
shared resource at a time) and deadlock (processes blocked indefinitely
waiting for resources).
• Solutions: Algorithms for distributed mutual exclusion and distributed
deadlock detection/resolution are crucial.
• Resource Management:
• Goal: Making both local and remote resources available to users
effectively and transparently.
• Methods:
• Data Migration: Moving data (files, memory contents) to the
computation's location. Handled by distributed file systems (for
files) and distributed shared memory (for memory).
• Computation Migration: Moving the computation (or parts of it)
to another location, often for efficiency (e.g., sending a query to a
remote database instead of transferring the whole database).
Remote Procedure Calls (RPC) are widely used for this.
• Distributed Scheduling: Transferring processes between
computers to balance load and maximize overall performance.
• Security:
• Challenge: Ensuring authentication (guaranteeing an entity is who it
claims to be) and authorization (deciding and enforcing privileges).
• Structuring:
• Challenge: Organizing the operating system components for efficiency
and flexibility in a distributed environment.
• Approaches:
• Monolithic Kernel: Traditional, but wasteful for diverse
distributed systems as not all services are needed by every
computer.
• Collective Kernel (Microkernel): Operating system services are
independent processes. A small microkernel supports inter-
process communication and essential services (task, processor,
virtual memory management). Allows for policy-mechanism
separation and flexible deployment.
• Object-Oriented Operating System: Services implemented as
objects encapsulating data and defining operations. Amenable to
collective structuring and policy-mechanism separation.
• Client-Server Computing Model:
• Concept: Processes are categorized as servers (providing services)
and clients (requesting services). Clients send messages to servers and
wait for replies.
• Benefits: Simplifies system design, allows for transparency of server
location and interactions, and supports caching. Easily adapts to
collective kernel structuring.
Q2 b. Elaborate Sender-Initiated Algorithms and Receiver-
Initiated Algorithms
These algorithms are types of Load Distributing Algorithms. They aim to improve
system performance by transferring processes (tasks) between computers to
balance the workload.
Sender-Initiated Algorithms:
• Mechanism: In these algorithms, an overloaded node (the "sender") actively
searches for a lightly loaded node (the "receiver") to offload some of its tasks.
• Process:
1. Detection: An overloaded node detects its high load (e.g., queue length
exceeding a threshold).
2. Search: It then initiates a search for a suitable remote node to transfer
a task to. This search might involve probing other nodes or consulting a
central load information server.
3. Transfer: Once a suitable receiver is found, the sender transfers one or
more tasks to it.
• Characteristics:
• Proactive: The overloaded node takes the initiative.
• Suitable for: Environments where tasks are frequently generated or
where nodes can become heavily loaded quickly.
• Potential Issues:
• Thrashing: If many overloaded nodes simultaneously try to offload
tasks, they might all send tasks to the same few lightly loaded nodes,
causing those nodes to become overloaded in turn, leading to
instability.
• Increased Network Traffic: The probing and negotiation process can
generate significant network traffic, especially under high system load.
Receiver-Initiated Algorithms:
• Mechanism: In these algorithms, a lightly loaded node (the "receiver")
actively searches for an overloaded node (the "sender") to request tasks from.
• Process:
1. Detection: A lightly loaded node detects its low load (e.g., queue length
falling below a threshold).
2. Search: It then initiates a search for an overloaded node that has tasks
to transfer. This might involve probing other nodes or consulting a
central load information server.
3. Request/Transfer: Once an overloaded sender is found, the receiver
requests a task, and the sender transfers it.
• Characteristics:
• Reactive: The underloaded node takes the initiative.
• Suitable for: Environments where nodes might become idle or
underutilized, and it's beneficial to pull work to them.
• Potential Issues:
• Idle Nodes: If there are no overloaded nodes to send tasks, the
receiver might remain idle for some time.
• Less Aggressive Load Balancing: May not balance the load as
aggressively as sender-initiated algorithms under very high system
loads, as the initiative comes from underloaded nodes.
Q3 a. Explain Central-Server Algorithm and Migration
Algorithm
Central-Server Algorithm:
• Concept: In this algorithm, a single designated server (or node) is responsible
for managing all shared memory pages. All requests for shared pages are
directed to this central server.
• Mechanism:
• Read Request: When a process needs to read a shared page, it sends
a request to the central server. The server sends a copy of the page to
the requesting process.
• Write Request: When a process needs to write to a shared page, it
sends a request to the central server. The server invalidates all other
cached copies of that page (if any) and then sends the page to the
requesting process. The server also marks the page as "dirty" or
"exclusive" to indicate it's being modified.
• Updates: After the writing process finishes, it sends the updated page
back to the central server. The server then updates its master copy.
• Advantages:
• Simplicity: Relatively easy to implement due to centralized control.
• Coherence: Maintaining memory coherence is straightforward as the
central server has the authoritative copy and controls all access.
• Disadvantages:
• Performance Bottleneck: The central server can become a bottleneck,
especially with high contention for shared pages, as all requests must
pass through it.
• Single Point of Failure: If the central server fails, the entire distributed
shared memory system becomes unavailable.
• Network Traffic: Can generate significant network traffic as all data
transfers involve the central server.
Migration Algorithm:
• Concept: Instead of having a central server, the shared memory page itself
"migrates" (moves) to the node that needs to access it.
• Mechanism:
• Exclusive Access: A page can only reside at one node at a time.
When a process needs to access a page (for read or write), it requests
the page.
• Page Transfer: If the page is currently at another node, it is transferred
to the requesting node.
• Ownership: The requesting node gains exclusive ownership of the
page.
• Invalidation/Update: Before transferring, the previous owner might
need to write back any modifications to a consistent state (e.g., to disk
or a home node, though the text doesn't specify this detail for the basic
migration algorithm).
• Advantages:
• Reduced Network Traffic (for sequential access): If a process
performs multiple operations on a page, all subsequent accesses are
local, reducing network overhead compared to the central-server model.
• No Single Bottleneck: Distributes the management of pages across
different nodes.
• Disadvantages:
• Page Thrashing: If multiple nodes frequently access the same page
(especially for writes), the page might "thrash" back and forth between
nodes, leading to high overhead.
• Coherence Complexity: Maintaining coherence can be more complex
as ownership changes dynamically.
Q3 b. Explain typical data access actions in distributed file
systems with diagram
A distributed file system (DFS) is a component of a distributed operating system that
provides a common file system accessible to autonomous computers in the system,
aiming for network transparency (users don't need to know file location).
Typical Data Access Actions (Inferred from context):
1. Client Request: A user program on a client machine initiates a file operation
(e.g., open(), read(), write(), close()).
2. DFS Intercepts: The client's local operating system (specifically, the DFS
client component) intercepts this request.
3. Location Determination: The DFS client determines if the requested file is
local or remote. This might involve consulting a name service or a local cache.
4. Remote Access (if applicable): If the file is remote, the DFS client sends a
request message to the appropriate file server (the machine where the file
resides).
5. Server Processing: The file server receives the request, performs the
requested operation on its local file system, and prepares a response.
6. Data Transfer (Data Migration):
• Read: For a read operation, the server sends the requested data blocks
back to the client. The client might cache these blocks locally for future
faster access.
• Write: For a write operation, the client sends the data to be written to
the server. The server updates its copy of the file. If the client has a
cached copy, it might need to invalidate it or update it based on the
cache consistency protocol.
7. Client Completion: The client receives the response/data and returns control
to the user program, making the operation appear as if it were a local file
access.
Diagram (Conceptual):
RunCopy code
+-------------------+ +-------------------+ +-------------------+
| Client Machine | | Network | | Server Machine |
| | | (Communication) | | |
| +---------------+ | | | | +---------------+ |
| | User Program | | | | | | File Server | |
| +-------+-------+ | | | | | (DFS Component) | |
| | | | | | +-------+-------+ |
| | File Op | | | | | |
| v | | | | | File Op |
| +-------+-------+ | | | | v |
| | DFS Client | | | | | +-------+-------+ |
| | (Intercepts | | | | | | Local File | |
| | Request) | | | | | | System | |
+-------+-------+ +---------------+
(1) Check Local/Remote
(2) If Remote, Send Request
+----------------------------------->
(Request Message)
<----------------------------------+-------+ (3) Process Request
(Data/Response)
(4) Cache Data (if read)
(5) Return to User Program
+-------------------+ +-------------------+ +-------------------+
RunCopy code
**Explanation of Diagram Elements:**
* **Client Machine:** Where the user program runs and initiates file operations.
* **DFS Client:** A component of the operating system on the client machine that
intercepts file requests. It determines if the file is local or remote and handles
communication with the server if needed. It might also manage a local cache.
* **Network (Communication):** The underlying communication infrastructure
(LAN/WAN) that facilitates message exchange between client and server.
* **Server Machine:** The machine where the actual file data resides and is
managed.
* **File Server (DFS Component):** A process or component on the server machine
that receives requests from clients, interacts with the local file system, and
sends responses/data back.
* **Local File System:** The traditional file system on the server machine that
manages the physical storage of files.
This conceptual diagram illustrates the flow of a file access request, highlighting
the role of the DFS client and server components in mediating access to potentially
remote data.