You are on page 1of 12

UNIT IV - SYNCHRONIZATION AND REPLICATION

Two Marks

1. What do you mean by time in distributed system?

 Time is an important and interesting issue in distributed systems, for several reasons.
 First, time is a quantity we often want to measure accurately. In order to know at what time
of day a particular event occurred at a particular computer it is necessary to synchronize its
clock with an authoritative, external source of time.
 Second, algorithms that depend upon clock synchronization have been developed for
several problems in distribution [Liskov 1993]. These include maintaining the consistency
of distributed data (the use of timestamps to serialize transactions is discussed in Section
16.6), checking the authenticity of a request sent to a server

2. What is Coordinated Universal Time?

Coordinated Universal Time – abbreviated as UTC (from the French equivalent) – is an


international standard for timekeeping. It is based on atomic time, but a so-called ‘leap second’
is inserted – or, more rarely, deleted – occasionally to keep it in step with astronomical time.

3. Define Clock skew and clock drift.

Computer clocks, like any others, tend not to be in perfect agreement. The instantaneous
difference between the readings of any two clocks is called their skew. Also, the crystal-based
clocks used in computers are, like any other clocks, subject to clock drift, which means that
they count time at different rates, and so diverge.

4. What is a clock’s drift rate?

A clock’s drift rate is the change in the offset (difference in reading) between the clock and
a nominal perfect reference clock per unit of time measured by the reference clock. For
ordinary clocks based on a quartz crystal this is about 10–6 seconds/second, giving a difference
of 1 second every 1,000,000 seconds, or 11.6 days. The drift rate of ‘high-precision’ quartz
clocks is about 10–7 or 10–8

5. Define external synchronization.

In order to know at what time of day events occur at the processes in our distributed system
– for example, for accountancy purposes – it is necessary to synchronize the processes’
clocks, Ci , with an authoritative, external source of time. This is external synchronization.
External synchronization: For a synchronization bound D > 0, and for a source S of UTC time,
|S(t)-Ci(t)|<D, for i=1,2,….,N and for all real times t in I. Another way of saying this is that the
clocks Ci are accurate to within the bound D.

6. Define internal synchronization.

If the clocks Ci are synchronized with one another to a known degree of accuracy, then we
can measure the interval between two events occurring at different computers by appealing to
their local clocks, even though they are not necessarily synchronized to an external source of
time. This is internal synchronization.
Internal synchronization: For a synchronization bound D > 0, | Ci(t)-Cj(t)|<D, for i=1,2,….,N
and for all real times t in I. Another way of saying this is that the clocks C i agree within the
bound D.
1
7. Define faulty and clock’s crash failure.

A clock that does not keep to whatever correctness conditions apply is defined to be faulty.
A clock’s crash failure is said to occur when the clock stops ticking altogether; any other
clock failure is an arbitrary failure.

8. List the algorithm that provides clock synchronization.


 Cristian’s algorithm
 Berkeley algorithm
 Network time protocol

9. Sate Cristian’s algorithm.

Cristian observed that while there is no upper bound on message transmission delays in an
asynchronous system, the round-trip times for messages exchanged between pairs of processes
are often reasonably short – a small fraction of a second. He describes the algorithm as
probabilistic: the method achieves synchronization only if the observed round-trip times
between client and server are sufficiently short compared with the required accuracy.

10. State Berkeley algorithm.

It is an algorithm for internal synchronization that they developed for collections of


computers running Berkeley UNIX. In it, a coordinator computer is chosen to act as the master.
Unlike in Cristian’s protocol, this computer periodically polls the other computers whose clocks
are to be synchronized, called slaves. The slaves send back their clock values to it. The master
estimates their local clock times by observing the round-trip times (similarly to Cristian’s
technique), and it averages the values obtained (including its own clock’s reading).

11. Define NTP.

The Network Time Protocol (NTP) [Mills 1995] defines an architecture for a time service
and a protocol to distribute time information over the Internet.
NTP’s chief design aims and features are as follows:
 To provide a service enabling clients across the Internet to be synchronized accurately to
UTC
 To provide a reliable service that can survive lengthy losses of connectivity
 To enable clients to resynchronize sufficiently frequently to offset the rates of drift found in
most computers
 To provide protection against interference with the time service, whether malicious or
accidental

12. What is procedure-call mode?

In this mode, one server accepts requests from other computers, which it processes by
replying with its timestamp (current clock reading). This mode is suitable where higher
accuracies are required than can be achieved with multicast, or where multicast is not supported
in hardware.

13. What is symmetric mode?

This mode is intended for use by the servers that supply time information in LANs and by
the higher levels (lower strata) of the synchronization subnet, where the highest accuracies are
2
to be achieved. A pair of servers operating in symmetric mode exchange messages bearing
timing information.

14. What is Distributed garbage collection?

Distributed garbage collection: An object is considered to be garbage if there are no longer


any references to it anywhere in the distributed system. The memory taken up by that object can
be reclaimed once it is known to be garbage. To check that an object is garbage, we must verify
that there are no references to it anywhere in the system.

15. What is Distributed deadlock detection?

Distributed deadlock detection: A distributed deadlock occurs when each of a collection of


processes waits for another process to send it a message, and where there is a cycle in the graph
of this ‘waits-for’ relationship. Figure shows that processes p1 and p2 are each waiting for a
message from the other, so this system will never make progress.

16. What is distributed terminated detection?


Distributed termination detection: It refers how to detect that a distributed algorithm has
terminated. Detecting termination is a problem that sounds deceptively easy to solve: it seems
at first only necessary to test whether each process has halted.

17. What is consistent global state?


A consistent global state is one that corresponds to a consistent cut. We may characterize
the execution of a distributed system as a series of transitions between global states of the
system:

18. Define global state predicate.


A global state predicate is a function that maps from the set of global states of processes in
the system to {True, False}. One of the useful characteristics of the predicates associated with
the state of an object being garbage, of the system being deadlocked or the system being
terminated is that they are all stable.

3
19. What do you mean by snapshot algorithm?
‘Snapshot’ algorithm for determining global states of distributed systems, which we now
present. The goal of the algorithm is to record a set of process and channel states (a ‘snapshot’)
for a set of processes pi ( i = 1, 2,…, N ) such that, even though the combination of recorded
states may never have occurred at the same time, the recorded global state is consistent.

20. Define atomic commit protocols.


The atomicity property of transactions requires that the servers participating in a distributed
transaction either all commit it or all abort it. Atomic commit protocols are designed to achieve
this effect, even if servers crash during their execution.
Atomic commit protocols are the key to distributed transactions, but they cannot be guaranteed
to complete within a particular time limit.

21. What is two phase commit protocol?


The two-phase commit protocol is designed to allow any participant to abort its part of a
transaction. Due to the requirement for atomicity, if one part of a transaction is aborted, then the
whole transaction must be aborted. In the first phase of the protocol, each participant votes for
the transaction to be committed or aborted.
In the second phase of the protocol, every participant in the transaction carries out the joint
decision.

22. List the operations for tow-phase commit protocol.


Operations for two-phase commit protocol
 canCommit
 doCommit
 doAbort
 haveCommitted
 getDecision

23. Write note on two-phase commit protocol phases


The two-phase commit protocol consists of a voting phase and a completion Phase
Phase 1 (voting phase):
 The coordinator sends a can Commit? Request to each of the participants in the transaction.
 When a participant receives a canCommit? Request it replies with its vote (Yes or No) to
the coordinator. Before voting Yes, it prepares to commit by saving objects in permanent
storage. If the vote is No, the participant aborts immediately.
Phase 2 (completion according to outcome of vote):
 The coordinator collects the votes (including its own).
o If there are no failures and all the votes are Yes, the coordinator decides to commit the
transaction and sends a doCommit request to each of the participants.
o Otherwise, the coordinator decides to abort the transaction and sends doAbort requests
to all participants that voted Yes.
 Participants that voted Yes are waiting for a doCommit or doAbort request from the
coordinator. When a participant receives one of these messages it acts accordingly and, in
the case of commit, makes a have Committed call as confirmation to the coordinator.

24. Define Hierarchic two-phase commit protocol.


In this approach, the two-phase commit protocol becomes a multi-level nested protocol. The
coordinator of the top-level transaction communicates with the coordinators of the sub-
transactions for which it is the immediate parent.

25. Define flat two-phase commit protocol.


4
In this approach, the coordinator of the top-level transaction sends canCommit? Messages
to the coordinators of all of the sub-transactions in the provisional commit list

26. How does distributed deadlock occur?


 When transactions access objects located in several different servers, the possibility of
distributed deadlocks arises.
 In a distributed system involving multiple servers being accessed by multiple transactions, a
global wait-for graph can in theory be constructed from the local ones. There can be a cycle
in the global wait-for graph that is not in any single local one – that is, there can be a
distributed deadlock.

27. Define edge chasing.


A distributed approach to deadlock detection uses a technique called edge chasing or path
pushing. In this approach, the global wait-for graph is not constructed, but each of the servers
involved has knowledge about some of its edges. The servers attempt to find cycles by
forwarding messages called probes, which follow the edges of the graph throughout the
distributed system. A probe message consists of transaction wait-for relationships representing
a path in the global wait-for graph.

28. List the steps involved in edge-chasing algorithm.


Edge-chasing algorithms have three steps:
 Initiation
 Detection
 Resolution

29. List the motivation for replication to enhance services.


Replication is a technique for enhancing services. The motivations for replication include:
 Performance enhancement
 Increased availability
 Fault tolerance

30. Define Coda.


Coda, a distributed file system that maintains persistent replicas of files for reliability,
availability and disconnected working. It is a descendent of Andrew File System that aims to
address several requirements that AFS does not meet – particularly the requirement to provide
high availability despite disconnected operation.

31. Discuss about replication strategy in coda.


Coda’s replication strategy is optimistic – it allows modification of files to proceed when
the network is partitioned or during disconnected operation. It relies on the attachment to each
version of a file of a Coda version vector (CVV). A CVV is a vector timestamp with one
element for each server in the relevant volume storage Group VSG.

32. Define VSG.


The set of servers holding replicas of a file volume is known as the volume storage group
(VSG). At any instant, a client wishing to open a file in such a volume can access some subset
of the VSG, known as the available volume storage group (AVSG). The membership of the
AVSG varies as servers become accessible or are made inaccessible by network or server
failures.

5
BIG QUESTIONS
1. Explain the clocking in detail.(8)
Pg.no:4.1-4.3
 Definition for Synchronization
 Properties of distributed algorithms
 Issues in Clocks
 Synchronizing clocks
 Working of computer timer
 Software based solution for synchronizing clocks
2. Describe Cristian’s Algorithm.(8)
Pg.No: 4.3-4.4
 Principle
 Diagram
 Problem in this system
3. Write about Berkeley Algorithm.(8)
Pg.No:4.4-4.5
4. Brief about NTP.
Pg.no:4.5-4.8
 Features of NTP
 Working
 Modes of NTP
 Diagram of message exchange between NTP
 Implementation of NTP
5. What do you understand by logical time and logical clocks? What is lamport's contribution for
it? Discuss.(8)
Pg.No:4.8-4.10
 Lamport ordering of events
 Logical clocks
 Lamport’s Algorithm
 Vector clocks
6. Describe global states.(5)
Pg.No:4.10-4.12
7. Explain the Chandy and Lamport’s snapshot algorithm for determining the global states
of distributed systems.
Pg.No:4.10-4.15
6
 Definition of global states and problems
 Global states and consistency cuts
 Global state predicates, stability ,safety and liveness
 Chandy and Lamport Snapshot algorithm with diagram
8. Define the distributed mutual exclusion problem.
Pg.No:4.16-4.22
 Definition
 Algorithm for distributed Mutual Exclusion
 Central server Algorithm
 Ring based algorithm
 Multicast Synchronization
 Mackawa’s Voting Algorithm
 Fault tolerance
9. Write in detail about election algorithm.
Pg.No:4.21-4.25
 Ring based Election Algorithm with diagram
 Bully Algorithm with diagram
10. Explain in detail about concurrency control and transaction.
Pg.No:4.26-4.28
 Definition for transaction
 Concurrency control
11. Describe nested transaction and its issues.(8)
Pg.No:4.28-4.30
12. Explain optimistic concurrency control.(8)
Pg.No:4.34-4.37
13. Explain Time stamp ordering in detail.(8)
Pg.No:4.37-4.39
14. Explain about atomic commit protocol.
Pg.No:4.39-4.42
15. Explain about distributed deadlock.
Pg.No:4.43-4.45
16. Discuss active replication model.
Pg.No:4.45-4.46
17. Explain the architecture of CODA with its update and disconnect operation.

Pg.No:4.47-4.50
7
 Features of CFS
 Architecture of CODA with diagram
 Communication in CODA with diagram
 Processes in CODA with diagram
 Caching in CODA
 Server replication in CODA
 Fault tolerance

8
UNIT V - PROCESS & RESOURCE MANAGEMENT
Two Marks

1. What is process management?


Process management involves the activities aimed at defining a process, establishing
responsibilities, evaluating process performance, identifying and opportunities or improvement.

2. What are the goals of process management of distributed OS?


 Process allocation
 Process migration
 Threads

3. Define process migration.


Process migration is the relocation of a process from its current location (the source node)
to another node (the destination node)
A process can be migrated either before it starts executing on its source node or during the
course of its execution.

4. List the steps involved in process migration.


 Selection of a process that should be migrated
 Selection of the destination node to which the selected process should be
migrated
 Actual transfer of the selected process to the destination node

5. List the features of good process migration.


 Transparency
 Minimal interferences
 Minimal residue dependencies,
 Efficiency,
 Robustness and communication between co-processes.

6. What are the major sub activities of process migration?


 Freezing the process on its source node and restarting it on its destination node
 Transferring the process's address space from its source node to its destination node
 Forwarding messages meant for the migrant process
 Handling communication between cooperating processes that have been separated
(placed on different nodes) as a result of process migration

7. List the mechanisms for handling process migration.


 Mechanisms for Freezing and Restarting a Process
 Message forwarding mechanism
 Mechanism for handling process

8. List the levels of transparency?


 Object access level
 System call and inter-process communication level

9. Identify the sources of inefficiency in process migration.


 The time required for migrating a process
 The cost of locating an object (includes the migrated process)
 The cost of supporting remote execution once the process is migrated

9
10. Write about process migration in heterogeneous system.
 When a process is migrated in a homogeneous environment, the interpretation of data is
consistent on both the source and the destination nodes.
 When a process is migrated in a heterogeneous environment, all the concerned data must be
translated from the source CPU format to the destination CPU format before it can be
executed on the destination node. If the system consists of two CPU types, each processor
must be able to convert the data from the foreign processor type in to its own format.

11. List the advantages of process migration.


 Reducing average response time of process
 Speeding up individual jobs
 Gaining higher throughput
 Utilizing resources effectively
 Reducing network traffic
 Improving system reliability

12. What is thread?


A thread is the entity within a process that can be scheduled for execution. All threads of a
process share its virtual address space and system resources.

13. List the computational; activities done by thread.


 The overheads involved in creating a new process are in general considerably
greater than those of creating a new thread within a process.
 Switching between threads sharing the same address space is considerably
cheaper than switching between processes that have their own address spaces.
 Threads allow parallelism to be combined with sequential execution and blocking system
calls. Parallelism improves performance and blocking system calls make programming
easier.
 Resource sharing can be achieved more efficiently and naturally between threads of a
process than between processes because all threads of a process share the same
address space.

14. Define thread context.


The thread context includes the thread’s set of machine registers, the kernel stack, a thread
environment block and a user stack in the address space of the thread’s process.

15. List the models for organizing threads.


 dispatcher-workers model
 Team model
 Pipeline model

16. Identify the issues in designing a thread.


 Semantics of fork() and exec() system calls
 Thread cancellation
 Threads scheduling
 Signal handling

17. What is thread creation and termination?


Threads can be created either statically or dynamically. In the static approach, the number
of threads of a process remains fixed for its entire lifetime, while in the dynamic approach, the
number of threads of a process keeps changing dynamically.

10
Termination of threads is performed in a manner similar to the termination of conventional
processes. That is, a thread may either destroy itself when it finishes its job by making an exit
call or be killed from outside by using the kill command and specifying the thread identifier as
its parameter

18. What are the approaches for implementing threads?


 User level thread implementation
 Kernel level thread implementation

19. What is resource management?


A resource management schedules the processes in a distributed system to make use of the
system resources in such a manner that resource usage, response time, network congestion,
and scheduling overhead are optimized.

20. Classify the scheduling process techniques.


 Task assignment approach
 Load-balancing approach
 Load-sharing approach

21. List the features of good global scheduling algorithms.


 A Priori Knowledge about the Processes
 Dynamic in Nature
 Quick Decision-Making Capability
 Balanced System Performance and Scheduling Overhead
 Stability

22. When a scheduling algorithm is unstable?


A scheduling algorithm is said to be unstable if it can enter a state in which all the nodes of
the system are spending all of their time migrating processes without accomplishing any useful
work in an attempt to properly schedule the processes for better performance.

23. List the assumption of task assignment approach.


 A process has already been split into pieces called tasks
 The amount of computation required by each task and the speed of each
processor are known.
 The cost of processing each task on every node of the system is known.
 The inter-process communication (IPC) costs between every pair of tasks is
known.
24. List the goals task assignment approach.
 Minimization of IPC costs
 Quick turnaround time for the complete process
 A high degree of parallelism
 Efficient utilization of system resources in general

25. Define cutset of a graph.


A cutset of a graph is defined to be a set of edges such that when these edges are removed,
the nodes of the graph are partitioned into two disjoint subsets such that the nodes in one subset
are reachable from n1 and the nodes in the other are reachable from n2.

26. Define load balancing and load sharing.


A load-balancing algorithm tries to balance the total system load by
transparently transferring the workload from heavily loaded nodes to lightly loaded
11
nodes in an attempt to ensure good overall performance relative to some
specific metric of system performance.

The load-sharing algorithms do not attempt to balance the average workload on


all the nodes of the system. Rather, they only attempt to ensure that no node is idle when
a node is heavily loaded.

27. Identify the issues of load balancing.


 Load Estimation Policies: Determines how to estimate the workload of a node.
 Process transfer policy: Determines whether to execute a process locally or remote
 State information exchange policy: Determines how to exchange load information
among nodes
 Location policy: Determines the priority of execution of local and remote processes.
 Migration limiting policy: Determines the total number of times a process can
migrate.

28. Identify the issues of load sharing.


 Load Estimation Policies
 Process Transfer Policies
 Location Policies
 Sender-Initiated Location Policy
 Receiver-Initiated Location Policy
 State Information Exchange Policies
 Broadcast When State Changes
 Poll When State Changes

BIG QUESTIONS:

1. Explain the process migration mechanism in detail.


Pg.no:5.1-5.5
2. Describe threads. Explain all the multithreading thread models.
Pg.no:5.5-5.13
3. Describe the resource management in distributed systems.
Pg.no:5.13-5.16
4. Describe the task Assignment Approach.
Pg.no:5.16-5.17
5. Describe the issues in designing load Balancing Approach.
Pg.no:5.17-5.23
6. Describe the issues in designing Load Sharing Approach
Pg.no:5.23-5.25

12

You might also like