Unit 2
Unit 2: Distributed Operating Systems - Complete Notes
1. Issues in Distributed Operating Systems
Definition and Overview:
A Distributed Operating System (DOS) manages a collection of independent computers and makes them appear as a single system.
It handles resource sharing, communication, and coordination among distributed nodes.
Key Issues:
Transparency:
Users should not be aware that the system is distributed.
Example: Accessing files on a remote server should feel like accessing local files.
Scalability:
The system should handle growth in users, nodes, and resources.
Example: Adding more servers to a cloud system without downtime.
Fault Tolerance:
The system should continue functioning even if some nodes fail.
Example: Google’s distributed file system (GFS) continues working even if some servers fail.
Consistency:
Data should remain consistent across all nodes.
Example: Updating a file on one server should reflect on all other servers.
Security:
Protecting data and resources from unauthorized access.
Example: Encrypting data transmitted between nodes in a distributed system.
Mind Map for Issues in Distributed Operating Systems:
2. Threads in Distributed Systems
Definition:
A thread is the smallest unit of execution within a process.
In distributed systems, threads enable concurrent execution of tasks across multiple nodes.
Role of Threads:
Concurrency:
Threads allow multiple tasks to run simultaneously.
Example: A web server handling multiple client requests using threads.
Resource Sharing:
Threads share memory and resources within a process.
Example: A distributed database using threads to process queries.
Efficiency:
Threads reduce the overhead of creating separate processes.
Example: A distributed application using threads for parallel processing.
Challenges:
Synchronization:
Threads must be synchronized to avoid conflicts.
Example: Two threads updating the same data simultaneously.
Deadlocks:
Threads may wait indefinitely for resources.
Example: Two threads waiting for each other to release locks.
Mind Map for Threads in Distributed Systems:
3. Clock Synchronization
Definition:
Clock synchronization ensures that all nodes in a distributed system have a consistent notion of time.
Why It’s Important:
Event Ordering:
Helps determine the order of events across nodes.
Example: Logging events in a distributed database.
Coordination:
Ensures tasks are executed at the correct time.
Example: Scheduling jobs in a distributed system.
Techniques:
Physical Clock Synchronization:
Synchronizing hardware clocks using protocols like NTP (Network Time Protocol).
Example: Synchronizing clocks across servers in a data center.
Logical Clock Synchronization:
Using logical clocks (e.g., Lamport timestamps) to order events.
Example: Ordering messages in a distributed messaging system.
Mind Map for Clock Synchronization:
4. Causal Ordering
Definition:
Causal ordering ensures that events that are causally related are processed in the correct order.
Why It’s Important:
Prevents anomalies in distributed systems.
Example: In a messaging system, a reply should not be processed before the original message.
Techniques:
Lamport Timestamps:
Assigns logical timestamps to events to preserve causality.
Example: Ordering messages in a chat application.
Vector Clocks:
Tracks causal relationships between events.
Example: Detecting conflicts in distributed databases.
Mind Map for Causal Ordering:
5. Global States
Definition:
A global state is a snapshot of the entire distributed system at a particular time.
Why It’s Important:
Helps in debugging, monitoring, and recovery.
Example: Detecting deadlocks or inconsistencies in a distributed system.
Techniques:
Snapshot Algorithm:
Captures the global state of the system.
Example: Chandy-Lamport algorithm for distributed snapshots.
Consistent Global States:
Ensures the captured state is consistent.
Example: Detecting inconsistencies in distributed transactions.
Mind Map for Global States:
6. Election Algorithms
Definition:
Election algorithms are used to select a coordinator or leader in a distributed system.
Why It’s Important:
Ensures a single node is responsible for coordination.
Example: Electing a leader in a distributed database for write operations.
Algorithms:
Bully Algorithm:
The node with the highest ID becomes the leader.
Example: Electing a leader in a distributed system.
Ring Algorithm:
Nodes are arranged in a ring, and the leader is elected by passing messages.
Example: Leader election in a token ring network.
Mind Map for Election Algorithms:
7. Distributed Mutual Exclusion
Definition:
Distributed mutual exclusion ensures that only one process can access a shared resource at a time.
Why It’s Important:
Prevents conflicts and ensures data integrity.
Example: Multiple processes accessing a shared file in a distributed system.
Algorithms:
Token-Based Algorithms:
A token is passed among nodes to grant access.
Example: Token ring algorithm.
Permission-Based Algorithms:
Nodes request permission from other nodes to access resources.
Example: Ricart-Agrawala algorithm.
Mind Map for Distributed Mutual Exclusion:
8. Distributed Deadlock
Definition:
Distributed deadlock occurs when processes in a distributed system are waiting for resources held by each other.
Why It’s Important:
Deadlocks can halt the entire system.
Example: Two processes waiting for each other to release locks in a distributed database.
Detection and Prevention:
Detection Algorithms:
Detect deadlocks by analyzing wait-for graphs.
Example: Chandy-Misra-Haas algorithm.
Prevention Techniques:
Avoid deadlocks by resource allocation strategies.
Example: Timeout-based resource allocation.
Mind Map for Distributed Deadlock:
9. Agreement Protocols
Definition:
Agreement protocols ensure that all nodes in a distributed system reach a consensus.
Why It’s Important:
Ensures consistency and reliability.
Example: Reaching consensus on a transaction in a distributed database.
Protocols:
Two-Phase Commit (2PC):
Coordinates distributed transactions.
Example: Committing transactions in a distributed database.
Paxos Algorithm:
Ensures consensus in asynchronous systems.
Example: Leader election in distributed systems.
Mind Map for Agreement Protocols:
Summary of Unit 2: Distributed Operating Systems
Distributed operating systems handle resource sharing, communication, and coordination in distributed systems.
Key issues include transparency, scalability, fault tolerance, consistency, and security.
Threads enable concurrency and resource sharing but face synchronization and deadlock challenges.
Clock synchronization, causal ordering, and global states ensure consistency and coordination.
Election algorithms, mutual exclusion, deadlock handling, and agreement protocols are essential for system reliability.
Final Mind Map for Unit 2:
Last updated