Distributed System
Distributed System
a. Define SaaS, PaaS, and IaaS along with their relative benefits. (5)
Election Algorithms:
o Election algorithms are protocols used in distributed systems to select a
coordinator or leader among a group of distributed processes.
Bully Algorithm (Example):
o How It Works:
1. When a process detects that the coordinator has failed, it initiates an
election by sending a message to all processes with higher IDs.
2. If no response is received, it assumes it has the highest ID and becomes
the new coordinator.
3. If a higher-ID process responds, the initiating process backs down.
4. The process with the highest ID eventually becomes the coordinator.
c. Name the various clock synchronization algorithms. Describe any one algorithm. (5)
1. Client Stub: The client program calls a procedure as if it were a local call.
2. Marshalling: The client stub converts the procedure parameters into a message
format (marshalling) and sends it to the server.
3. Server Stub: The server receives the message, unpacks (unmarshalling) the
parameters, and calls the appropriate procedure on the server side.
4. Execution: The server executes the requested procedure and sends the result back
to the client stub.
5. Return: The client stub receives the result, unpackages it, and returns it to the
client program.
Q.2
Process Management:
o Refers to the activities that operating systems perform to manage processes in a
computing environment, including scheduling, creation, termination, and
synchronization.
Features of Good Process Migration:
o Minimal Downtime: The process should experience minimal interruption during
migration.
o State Preservation: The process state must be preserved to ensure seamless
continuation after migration.
o Resource Allocation: Efficient reallocation of resources in the destination
environment is crucial.
o Transparency: The migration process should be transparent to users and
applications, minimizing disruption.
o Security: Ensuring that security protocols are maintained during the migration
process to prevent unauthorized access.
Q.3
a. What are physical and logical clock synchronization? Explain the drifting of a clock. (10)
Group Communication:
o Refers to communication protocols that enable a group of processes to
communicate with each other efficiently and reliably.
Message Ordering Techniques:
o Absolute Ordering: Guarantees that messages are delivered in the exact order
they were sent, ensuring a strict total order. This is crucial for applications that
depend on the precise sequence of events.
o Consistent Ordering: Ensures that if one process receives two messages in a
particular order, all other processes will receive those messages in the same order.
This ordering is weaker than absolute ordering but still maintains consistency.
o Casual Ordering: Only guarantees that messages that are causally related are
delivered in the correct order. If one message causally influences another, the
influenced message will be delivered after the original. This is important for
applications where the relationship between events matters, rather than the
absolute order.
Q.4
Cloud Computing:
o A model that enables ubiquitous, convenient, on-demand network access to a
shared pool of configurable computing resources (e.g., servers, storage,
applications).
Types of Cloud Computing:
o Public Cloud: Services offered over the public internet, available to anyone.
Examples include Amazon Web Services (AWS) and Microsoft Azure.
o Private Cloud: Exclusive cloud infrastructure for a single organization, providing
more control and security. Can be hosted on-premises or by a third-party provider.
o Hybrid Cloud: A combination of public and private clouds, allowing data and
applications to be shared between them for greater flexibility.
o Community Cloud: Shared infrastructure among several organizations with
common concerns, such as security and compliance.
b. What are the load balancing transfer policies used for distributed systems? (10)
Q.5
b. What are threads? How are they different from processes? Explain the various thread
models. (10)
Threads:
o Threads are the smallest units of processing that can be scheduled by an operating
system. They share the same memory space within a process, allowing for
efficient communication and resource sharing.
Differences between Threads and Processes:
o Memory: Threads share the same memory space; processes have separate
memory.
o Overhead: Creating and managing threads has less overhead than processes since
they share resources.
o Communication: Communication between threads is easier and faster compared
to inter-process communication (IPC).
Thread Models:
o Many-to-One Model: Multiple user-level threads mapped to a single kernel
thread, which can lead to inefficiencies in utilizing multiple processors.
o One-to-One Model: Each user thread is paired with a kernel thread, allowing
multiple threads to run in parallel on multiple processors, providing better
performance and responsiveness.
o Many-to-Many Model: Allows multiple user threads to be mapped to multiple
kernel threads, providing flexibility and better scalability.
Q.6
Mutual Exclusion:
o A fundamental principle in concurrent programming that ensures that multiple
processes or threads do not access shared resources simultaneously, preventing
conflicts and ensuring data consistency.
o Techniques for Achieving Mutual Exclusion:
Lock-Based Mechanisms: Use of locks (mutexes) to control access to
shared resources, where a thread must acquire a lock before entering a
critical section.
Semaphore: A signaling mechanism that can be used to control access to
a common resource by multiple processes.
Monitors: High-level synchronization constructs that encapsulate shared
variables and the procedures that operate on them, ensuring that only one
process can execute a procedure at a time.
Callback RPC:
o A mechanism in which a client sends a request to a server and provides a callback
function to be executed upon completion of the request.
o How It Works:
The client sends an RPC request along with a reference to a callback
function.
The server processes the request and, upon completion, invokes the
callback function with the result.
This model is beneficial for handling asynchronous operations, allowing
the client to continue processing without waiting for the server’s response.
1. Write Short Notes on any four:
b) Mutual Exclusion
Overview: RMI is a Java API that allows remote communication between Java
programs, enabling the invocation of methods on an object located in another JVM.
Key Components:
o Stub and Skeleton: The stub acts as a proxy on the client side, while the skeleton
handles requests on the server side.
o Registry: A naming service where remote objects are registered and looked up.
Process:
o The client looks up the remote object using its name in the registry, then invokes
methods on it as if it were a local object.
Advantages:
o Simplifies the development of distributed applications by using Java’s built-in
capabilities.
d) Aneka
Overview: Aneka is a cloud computing framework that enables the development and
execution of applications in a distributed environment, supporting both public and private
clouds.
Features:
o Task Scheduling: Dynamic task scheduling for optimizing resource usage.
o Resource Management: Manages heterogeneous resources in a cloud
environment.
o Support for Multiple Programming Models: Supports various models such as
MapReduce and workflow-based models.
Use Cases: Ideal for applications in data processing, scientific computing, and enterprise
applications.
e) Thread Model
Election Algorithms:
o Used in distributed systems to elect a coordinator or leader among processes.
Common Algorithms:
o Bully Algorithm:
Initiated by a process detecting a failure. It sends messages to higher-ID
processes; if none respond, it assumes leadership.
o Ring Algorithm:
Processes are arranged in a logical ring. A process sends its ID to the next
process; the highest ID becomes the leader.
o Leasing Algorithm:
Assigns leases to processes, allowing temporary leadership. If a process
does not renew its lease, another election occurs.
Importance: Election algorithms ensure coordination and manage shared resources
effectively in distributed environments.
3. (b) Name the various clock synchronization algorithms. Describe any one
algorithm. (10)
4. (a) What is QoS (Quality of Service) and Resource Allocation in cloud? (10)
5. (a) Explain the mechanism for process migration and desirable features of
process migration mechanism. (10)
Process Migration:
o Refers to moving a process from one node in a distributed system to another to
balance load or improve resource utilization.
Mechanism:
1. State Capture: The current state of the process is captured, including its memory,
CPU state, and resources.
2. Transfer: The captured state is transferred to the target node over the network.
3. Restart: The process is restarted on the target node, using the transferred state to
resume execution.
Desirable Features:
o Transparency: The migration process should be invisible to users and
applications.
o Minimal Downtime: The process should experience minimal interruption.
o Resource Reallocation: Efficiently reallocates resources in the target
environment.
o Security: Ensures secure transfer and integrity of process data.
1. Client Stub: The client calls a local proxy (stub) instead of the remote procedure.
2. Marshalling: The stub converts the procedure parameters into a message format
(marshalling) and sends it to the server.
3. Server Stub: The server receives the message, unpacks the parameters
(unmarshalling), and calls the appropriate procedure.
4. Execution: The server executes the requested procedure and sends the result back
to the client stub.
5. Return to Client: The client stub receives the result and returns it to the original
caller.
Q.1
(a) What are the load-sharing policies used for distributed systems? (5)
(b) What are election algorithms? Explain the bully algorithm. (5)
Election Algorithms:
o These algorithms are used in distributed systems to elect a leader or coordinator
among processes for managing shared resources.
Bully Algorithm:
1. Initiation: If a process notices that the coordinator has failed, it initiates the
election by sending an "election" message to all processes with a higher ID.
2. Response: If a higher ID process receives this message, it responds with an "I am
alive" message, and the initiating process must stop the election.
3. No Response: If no higher ID processes respond, the initiating process assumes it
is the leader and broadcasts a "coordinator" message to all processes.
4. Result: The process with the highest ID becomes the new coordinator.
(c) What are the issues in data security in cloud computing? (5)
Q.2
(a) Discuss the issues in designing and implementing DSM systems. (10)
(b) What is process management? Explain the address transfer mechanism in detail. (10)
Process Management:
o Refers to the handling and coordination of processes in a computing environment,
ensuring that they are executed efficiently and securely.
Address Transfer Mechanism:
1. Logical vs. Physical Addresses: Processes operate with logical addresses that are
mapped to physical addresses by the operating system.
2. Address Space: Each process has its own address space, preventing processes
from interfering with each other's memory.
3. Address Mapping: The memory management unit (MMU) translates logical
addresses to physical addresses during execution.
4. Context Switching: When switching between processes, the current address
mapping must be saved and restored to ensure proper execution.
5. Dynamic Loading: Only the necessary portions of a program are loaded into
memory, with addresses adjusted dynamically to optimize resource usage.
Q.3
(a) What is physical and logical clock synchronization; explain the drifting of a clock. (10)
Clock Synchronization:
o Physical Clock Synchronization: Involves synchronizing the actual hardware
clocks of different machines in a distributed system to ensure they show the same
time.
o Logical Clock Synchronization: Does not require real-time synchronization but
ensures that the sequence of events is consistent across distributed systems.
Drifting of a Clock:
o Refers to the gradual divergence of a physical clock from the true time due to
factors like temperature variations, aging components, or inaccuracies in the clock
mechanism.
o Impact: Clock drift can lead to inconsistencies in event ordering and coordination
in distributed systems. Techniques such as NTP (Network Time Protocol) are
used to correct drift and maintain synchronization.
Group Communication:
o A method of communication that allows messages to be sent to a group of
processes or nodes, rather than individual recipients. It's essential for
collaboration and coordination in distributed systems.
Message Ordering Techniques:
1. Absolute Ordering:
Guarantees that messages are delivered in the exact order they were sent,
regardless of the sender. All processes receive messages in the same
sequence, ensuring total order.
2. Consistent Ordering:
Ensures that if one process receives messages in a certain order, all other
processes also receive those messages in that same order. This allows for
some flexibility but preserves the causal relationship between messages.
3. Causal Ordering:
Only guarantees that causally related messages are delivered in the order
they were sent. If one message influences another, the influencing
message must be received first. However, unrelated messages can be
received in any order.
Q.4
(a) Explain cloud computing and discuss cloud security issues. (10)
Cloud Computing:
o A technology that enables on-demand access to a shared pool of configurable
computing resources (like servers, storage, applications) over the internet. It
allows for rapid provisioning and release with minimal management effort.
Cloud Security Issues:
Q.5
(a) What is multi-datagram messaging? Explain the failure handling technique in IPC. (10)
Multi-Datagram Messaging:
o Refers to the transmission of multiple datagrams in a single message or operation,
often used to improve efficiency in communication.
Failure Handling Technique in IPC:
Q.6
Callback RPC:
o A communication method where the client can register a callback function to be
invoked by the server once a response is ready. This allows for asynchronous
communication, enabling the client to continue processing other tasks while
waiting for the server's response.
Q1
1. Strong Consistency: Guarantees that all operations appear to execute in some sequential
order, and each process sees the same order of operations. Any read operation returns the
most recent write.
2. Eventual Consistency: Ensures that, if no new updates are made, all accesses to a given
piece of data will eventually return the last updated value. It allows temporary
inconsistencies.
3. Causal Consistency: Preserves the causal relationships between operations. If one
operation causally affects another, all processes will see them in that order, but
concurrent operations can be seen in different orders.
4. Weak Consistency: There are no guarantees on the order of updates, and processes may
see different values. It relies on application-level mechanisms to ensure consistency when
needed.
5. Session Consistency: Guarantees that within a session, a user sees the updates they
made, but may not see updates made by others until the session ends.
Callback RPC (Remote Procedure Call): A mechanism where the client registers a
callback function with the server, which the server invokes once it has completed
processing a request.
How it Works:
1. Registration: The client sends a request to the server along with a reference to
the callback function.
2. Processing: The server processes the request asynchronously.
3. Invocation: Upon completion, the server calls the client’s callback function with
the result, allowing the client to handle the response.
Benefits:
Use Cases: Logical clocks are essential in scenarios like maintaining consistency in
distributed databases and for coordination in distributed systems.
Q2
(a) What is a Distributed Operating System? Why is Distributed Operating System gaining
popularity? (10)
Q3
Desirable Features:
Distributed Mutual Exclusion Algorithms: These algorithms ensure that only one
process accesses a critical section at a time in a distributed system.
1. Token-Based Algorithms:
o A token is passed among processes. A process must possess the token to enter its
critical section. If the token is lost, a new token must be generated to maintain
consistency.
2. Ricart-Agrawala Algorithm:
o Processes send a request message to all other processes when they want to enter
the critical section. Each process responds with a reply message if it is not
interested in entering its critical section or if it has a lower timestamp.
o The requesting process can enter the critical section once it has received replies
from all other processes.
Q4
1. Unique Identifiers: Each process has a unique identifier (PID) that distinguishes it from
other processes.
2. Address Space: Processes have their own address spaces, and IPC mechanisms must
handle data transfer without interfering with these spaces.
3. Communication Mechanisms:
o Shared Memory: Processes can communicate by reading and writing to shared
memory regions.
o Message Passing: Processes send and receive messages using IPC mechanisms,
which may include queues or sockets.
4. Security and Access Control: Ensuring that only authorized processes can access shared
resources is crucial in IPC.
1. Bully Algorithm:
o As explained earlier, it involves processes sending election messages to higher-ID
processes. If no higher-ID process responds, the initiating process declares itself
the coordinator.
2. Ring Algorithm:
o Processes are arranged in a logical ring. When a process wants to initiate an
election, it sends an election message to its neighbor.
o If a process receives an election message with a lower ID than its own, it forwards
the message. If it receives one with a higher ID, it discards it. The process with
the highest ID eventually becomes the coordinator.
Q5
(a) Explain design and implementation issues of Distributed Shared Memory. (10)
(b) What is process management? Explain features of a good process migration. (10)
1. Transparency: The migration process should be transparent to the user and application,
ensuring minimal disruption.
2. Efficiency: The migration should be performed with minimal resource consumption and
time.
3. Reliability: The system should ensure that processes can be resumed correctly after
migration without data loss.
4. Compatibility: Supporting migration across different hardware and software
environments.
5. Security: Ensuring that sensitive data remains protected during the migration process.
Q6
1. Data Breaches: Unauthorized access to sensitive data stored in the cloud, posing risks to
privacy and compliance.
2. Data Loss: Risks associated with unintentional data deletion or corruption, requiring
robust backup and recovery strategies.
3. Account Hijacking: Compromised user accounts can lead to unauthorized access and
manipulation of cloud resources.
4. Insecure APIs: Vulnerabilities in APIs can expose cloud services to attacks, requiring
secure development practices.
5. Compliance Violations: Ensuring adherence to regulatory requirements like GDPR or
HIPAA is critical, especially in multi-tenant environments.
1. Static Assignment: Tasks are assigned to specific nodes based on predetermined criteria.
Simple but may not adapt well to varying workloads.
2. Dynamic Assignment: Tasks are assigned based on current load and resource
availability, improving responsiveness and efficiency. Techniques include:
o Load Balancing: Distributing tasks evenly across nodes to prevent bottlenecks.
o Priority-based Assignment: Tasks are assigned based on their urgency and
resource requirements, ensuring critical tasks are handled promptly.