Kaku - Time and Global State Seminar
Kaku - Time and Global State Seminar
Master’s Program(Msc)
Distributed System
ID NO: AKU1603887
Junary,2024
Contents
1.1 Introduction............................................................................................................................3
1.1 Introduction
This seminar topic introduce fundamental concepts and algorithm related to monitoring
distributed system as their execution unfold and to timing the event that occur in their execution.
Time is important and interesting issue in distributing system for several reason. First, time is a
quantity we often want to measure accurately in order to know events at what time it occur
particularly in computer necessary to synchronize its clock with external sources of time.
Second, Algorithms that depend up on clock synchronization useful for concurrency control
based on timestamp ordering and checking the authenticity of requests sent to server.
We take distribute system to consist of collection P and N process where P i= i=1,2…N each
process executes on single processor and the processor do not share memory. Each process P i in
P has a state Si consisting of its variables (which it transforms as it executes). The process’s state
includes the value of all variable within it. Its state may also include the value of any object in its
logical operating system environment that it affects such as file. We assume that process cannot
communicate with one other in any one except by sending message through network. For
example, if the process operate robot arms connected to their respective node in the system, they
As each process Pi executes it takes a series of action each of which is either a message sends or
receive or change own state Pi’s state on that change one or more of the value in Si. For example,
if the process in P are engaged in e-commerce application, then action may be one such as ‘client
1|Page
The sequence of events within a single process Pi, can be placed in a single, total ordering which
we shall denoted by the relation →i between the events. i.e. e →ie’ if and only if the event e
occurs before e’ at Pi. this ordering is well defined whether or not the process is multi-threaded.
Clock: We have seen order the event at process but not how to timestamp them, to assign to
them a date and time of day. Computer each contain their own physical clock. At real time, t, the
operating system reads the time on the computer’s hardware clock Hi(t) scale it and add on offset
so as to produce a software clock it calculates the time on its software clock Ci(t) = αHi(t) + β –
that approximately measure real, physical time t for the process Pi. if Ci behaves well enough, we
can use its value to timestamp any event at Pi. Note that successive events will correspond to
different timestamps only if the clock resolution, the period between update of the clock is
smaller than the time between successive event. The rate at which events occur depends on such
Computer clocks are not generally in perfect agreement (see the figure above) the instances
different between the reading of any two clock is called skew. Also the crystal-based clock used
in computer are like any other clock subject to clock draft which means that they count time at
different rates and so diverge. A clock drift rate is the change in the offset (different reading)
2|Page
between the clock and nominal perfect references clock per unit of time measure by references
clock. For ordinary quartz clocks drift by about 1 sec in 11-12 days. (10-6secs/sec). The draft rate
of high precision quartz clocks drift rate is about 10-7or 10-8 secs/sec.
Coordinated Universal Time (UTC): UTC is an international standard for time keeping. The
most accurate physical clock uses atomic oscillators; whose drift rate is about one part in 10 -13.
The output of these atomic clock is used as the standard for elapsed real time known as
international atomic time. Seconds and years and other time units that we use are rooted in
astronomical time.
Refers to the process of aligning the time readings of multiple clocks or timekeeping devices to a
common reference or standard. We have two modes of synchronization more closely as follows,
authoritative time source. For synchronization bound D>0 and for a sources S of UTC time |S(t)-
Ci(t)|<D, for i=1, 2...N and for all real time t in I, another way of the clock Ci is accurate to
within bound D.
Internal synchronization: The clocks of a pair of computers are synchronized with one another
so that: –| Ci(t) -Cj(t)| < D for i, j= 1, 2, …N over an interval, I of real time –The clocks Ci and
Cj agree within the bound D. Internally synchronized clocks are not necessarily externally
synchronized, as they may drift collectively if the set of processes P is synchronized externally
3|Page
Global states
executes. We'd like to use logical time to construct a global view of the system state and
1) Garbage collection:
2) deadlock
3) Termination:
Cuts
Because physical time cannot be perfectly synchronized in a distributed system it is not possible
to gather the global state of the system at a particular time. Cuts provide the ability to "assemble
a meaningful global state from local states recorded at different times”. So here has some
definition: P is a system of N Processes Pi (i = 1, 2, ..., N) the series of events at each process and
that may have characterized the execution of each process by its history.
hik=<ei0,ei2,..eik>
sikis the state of the process pi immediately before the kth event occurs
4|Page
All processes record sending and receiving of messages. If a process pi records the
sending of message m to process pj and pj has not recorded receipt of the message, then m
h2 ∪...∪hN-1
A global state can be formed by taking the set of states of the individual processes: S =
To further examine how you might produce consistent cuts, we'll use the distributed debugging
example. Recall that we have several processes, each with a variable xi. "The safety condition
required in this example is |xi-xj| <= δ (i, j = 1, 2, ..., N).": this constraint is to be met even though
The algorithm we will discuss is a centralized algorithm that determines post hoc whether the
safety condition was ever violated. The processes in the system, p1, p2, ..., pN, send their states to
a passive monitoring process, p0. p0 is not part of the system. Based on the states collected, p0 can
Collecting the state: The processes send their initial state to a monitoring process and send
updates whenever relevant state changes, in this case the variable xi. In addition, the processes
need only send the value of xi and a vector timestamp. The monitoring process maintains an
ordered queue (by the vector timestamps) for each process where it stores the state messages. It
can then create consistent global states which it uses to evaluate the safety condition.
5|Page
Let S = (s1, s2, ..., SN) be a global state drawn from the state messages that the monitor
process has received. Let V(si) be the vector timestamp of the state si received from pi.
Then it can be shown that S is a consistent global state if and only if:
6|Page