Figure 15.1 A distributed multimedia system

Slides for Chapter 10:
Time and Global State
From Coulouris, Dollimore and Kindberg
Distributed Systems:
Concepts and Design
Edition 3, © Addison-Wesley 2001
Figure 10.1
Skew between computer clocks in a distributed system
Netw ork
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.2
Clock synchronization using a time server
mr
mt
p
Time server,S
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.3
An example synchronization subnet in an NTP implementation
1
2
3
2
3
3
Note: Arrows denote synchronization control, numbers denote strata.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.4
Messages exchanged between a pair of NTP peers
Server B
Ti-2
m
Ti-1
Time
m'
Time
Server A
Ti- 3
Ti
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.5
Events occurring at three processes
p1
a
b
m1
Phy sical
time
p2
c
d
m2
p3
e
f
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.6
Lamport timestamps for the events shown in Figure 10.5
p1
1
2
a
b
m1
3
4
c
d
Phy sical
time
p2
m2
1
5
e
f
p3
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.7
Vector timestamps for the events shown in Figure 10.5
(1,0,0) (2,0,0)
p1
a
b
m1
(2,1,0)
(2,2,0)
Phy sical
time
p2
c
(0,0,1)
d
m2
(2,2,2)
p3
e
f
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.8
Detecting global properties
p2
p1
objec t
referenc e
mess age
a. Garbage collec tion
garbage objec t
p1
w ait-for
b. Deadlock
p2
w ait-for
p2
p1
activate
c . Termination
pas sive
pas sive
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.9
Cuts
0
e1
1
2
e1
3
e1
e1
p1
m1
p2
m2
0
e2
1
e2
2
e2
Incons is tent cut
Cons is tent c ut
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Phys ic al
time
Figure 10.10
Chandy and Lamport’s ‘snapshot’ algorithm
Marker receiving rule for process pi
On pi’s receipt of a marker message over channel c:
if (pi has not yet recorded its state) it
records its process state now;
records the state of c as the empty set;
turns on recording of messages arriving over other incoming channels;
else
pi records the state of c as the set of messages it has received over c
since it saved its state.
end if
Marker sending rule for process pi
After pi has recorded its state, for each outgoing channel c:
pi sends one marker message over c
(before it sends any other message over c).
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.11
Two processes and their initial states
c2
p1
p2
c1
$1000
(none)
$50
2000
ac count
w idgets
ac count
w idgets
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.12
The execution of the processes in Figure 10.11
1. Global state S0
2. Global state S1
3. Global state S2
4. Global state S3
<$1000, 0>
<$900, 0>
<$900, 0>
<$900, 5>
p1
p1
p1
p1
c2
(empty )
c1
(empty )
c2
(Order 10, $100), M
c1
(empty )
c2
(Order 10, $100), M
c1
(fiv e w idgets )
c2
(Order 10, $100)
c1
(empty )
(M = marker mes sage)
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
p2
<$50, 2000>
p2
<$50, 2000>
p2
<$50, 1995>
p2
<$50, 1995>
Figure 10.13
Reachability between states in the snapshot algorithm
ac tual ex ec ution e0 ,e 1,...
Sini t
rec ording
begins
pre-snap: e'0 ,e'1 ,...e'R- 1
rec ording
ends
Ssnap
Sfi nal
post-snap: e' R,e 'R+1 ,...
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.14
Vector timestamps and variable values for the execution of Figure 10.9
(1,0)
(2,0)
(3,0)
x1= 1 x1 = 100 x1 = 105
(4,3)
x1= 90
p1
m1
m2
Phys ic al
time
p2
x2 = 100 x2 = 95
(2,1) (2,2)
x2 = 90
(2,3)
Cut C 2
Cut C 1
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.15
The lattice of global states for the execution of Figure 10.14
Lev el 0
S 00
1
S 10
2
3
4
5
S 20
S30
S21
S31
S 22
S32
6
7
Sij= global s tate after i ev ents at process 1
and j events at proc es s 2
S23
S 33
S 43
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.16
Algorithms to evaluate possibly f and definitely f
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000
Figure 10.17
Evaluating definitely f
Lev el 0
F
1
F
2
3
4
5
F = (f S False);T = (f S  True)
F
F
T
–
F
?
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3
© Addison-Wesley Publishers 2000