CST402-Question Answer Bank - Module II
CST402-Question Answer Bank - Module II
Module - II
Part A
1. Define Logical Clock.
Intuitively, this relation is analogous to the earlier than relation provided by the
physical time.
2. Define Scalar time. / Explain the rules used to update clocks in scalar time
representation.
Basic properties
1. Consistency property
2. Total Ordering
The main problem in totally ordering events is that two or more events at
different processes may have an identical timestamp.
a tie-breaking mechanism is needed to order such events
process identifiers are linearly ordered and a tie among events with
identical scalar timestamp is broken on the basis of their process
identifiers.
The lower the process identifier in the ranking, the higher the priority.
3. Event counting
4. No strong consistency
The system of scalar clocks is not strongly consistent; that is, for two events e i
and ej
A vector clock is a data structure used for determining the partial ordering
of events in a distributed system and detecting causality violations
Basic properties
1. Isomorphism
relation “→” induces a partial order on the set of events that are produced by a
distributed execution.
3. Event counting
Applications
Since vector time tracks causal dependencies exactly, it finds a wide variety of
applications.
distributed debugging,
We say that a process calls the election if it takes an action that initiates a
particular run of the election algorithm.
All processes take their local snapshots at that instant in the global time.
Part B
1. Discus the implementation of logical Clock
A system of logical clocks consists of a time domain T and a logical clock C .
Elements of T form a partially ordered set over a relation <
Intuitively, this relation is analogous to the earlier than relation provided by the
physical time.
Each process p i has a communication channel to the next process in the ring, p
( i + 1) mod N ,
The goal of this algorithm is to elect a single process called the coordinator,
If, however, the received identifier is that of the receiver itself, then this
process’s identifier must be the greatest, and it becomes the coordinator.
The process that knows it has the highest identifier can elect itself as the
coordinator simply by sending a coordinator message to all processes
with lower identifiers.
On the other hand, a process with a lower identifier can begin an election
by sending an election message to those processes that have a higher
identifier and awaiting answer messages in response.
● Eventually, all processes give up but one, and that one is the new
coordinator.
● It holds an election.
● Biggest guy” always wins and hence the name “ bully” algorithm.
System model
The system consists of a collection of n processes, p1, p2, , pn, that are
connected by channels.
Messages are delivered reliably with finite but arbitrary time delay.
System model
For a message mij that is sent by process pi to process pj, let send(mij)
and rec(mij) denote its send and receive events, respectively.
For example, an internal event changes the state of the process at which it
occurs.
A send event (or a receive event) changes the state of the process that
sends (or receives) the message and the state of the channel on which the
message is sent (or received).
At any instant, the state of process pi, denoted by LSi, is a result of the
sequence of all the events executed by pi up to that instant
The global state of a distributed system is a collection of the local states of the
processes and the channels. Notationally, global state GS is defined as
A cut is a line joining an arbitrary point on each process line that slices
the space–time diagram into a PAST and a FUTURE.
All the messages that cross the cut from the PAST to the FUTURE are
captured in the corresponding channel state.
Chandy–Lamport algorithm
After a site has recorded its snapshot, it sends a marker along all of its outgoing
channels before sending out any more messages.
Since channels are FIFO, a marker separates the messages in the channel into
those to be included in the snapshot (i.e., channel state or process state) from
those not to be recorded in the snapshot.
The algorithm
If the process has not yet recorded its local state, it records the state of the
channel on which the marker is received as empty and executes the marker
sending rule to record its local state Otherwise, the state of the incoming
channel on which the marker is received is recorded
The algorithm can be initiated by any process by executing the marker sending
rule.
The recorded local snapshots can be put together to create the global snapshot
When a process goes from active to idle, it issues a request to all other
processes to take a local snapshot, and also requests itself to take a local
snapshot.
When a process receives the request, if it agrees that the requester became
idle before itself, it grants the request by taking a local snapshot for the
request.
The requester or any external agent may collect all the local snapshots of
a request.
in the recorded snapshot, all the processes are idle and there is no
message in transit to any of the processes
The computation starts when the controlling agent sends a basic message
to one of the processes.
Thus, the sum of weights on all the processes and on all the messages in
transit is always 1.
12. Apply spanning tree-based termination detection algorithm in the following scenario. The
nodes are processes 0 to 6. Leaf nodes 3, 4, 5, and 6 are each given tokens T3, T4, T5 and T6
respectively. Leaf nodes 3, 4, 5 and 6 terminate in the order, but before terminating node 5,it
sends a message to node