Synchronous Ordering 1 Goals of the lecture Hiera rchy of - - PowerPoint PPT Presentation

synchronous ordering 1 goals of the lecture hiera rchy of
SMART_READER_LITE
LIVE PREVIEW

Synchronous Ordering 1 Goals of the lecture Hiera rchy of - - PowerPoint PPT Presentation

Synchronous Ordering 1 Goals of the lecture Hiera rchy of communication mo des Motivation fo r synchronous o rdering Cro wn Sucient conditions fo r synchronous o rdering Implementation rules


slide-1
SLIDE 1 Synchronous Ordering 1 Goals
  • f
the lecture
  • Hiera
rchy
  • f
communication mo des
  • Motivation
fo r synchronous
  • rdering
  • Cro
wn
  • Sucient
conditions fo r synchronous
  • rdering
  • Implementation
rules
  • Safet
y theo rem
  • Liveness
c Vija y K. Ga rg Distributed Systems F all 94
slide-2
SLIDE 2 Synchronous Ordering 2 Comm unicatio n Mo des
  • FIF0
s 1
  • s
2 = ) :(r 2
  • r
1 ) P 1 P 2 P 3
  • sequence
numb ers a re sucient to implement FIF O.
  • Causally
Ordered s 1 ! s 2 = ) :(r 2
  • r
1 ) P 1 P 2 P 3
  • matrix
clo cks a re sucient to implement Causal
  • rdering.
c Vija y K. Ga rg Distributed Systems F all 94
slide-3
SLIDE 3 Synchronous Ordering 3 Comm unicatio n Mo des [Contd.]
  • Synchronous
Ordering (SYNC) 9T : E ! 1 N : 8s; r ; e; f 2 E s ; r = ) T(s) = T(r ) e
  • f
= ) T(e) < T(f )
  • 6
6 ? 1 1 2 2 3 3
  • time
diagram
  • f
a synchronous computation can b e dra wn such that all message a rro ws a re vertical.
  • any
  • rder
clo ck is insucient to implement synchronous
  • rdering.
c Vija y K. Ga rg Distributed Systems F all 94
slide-4
SLIDE 4 Synchronous Ordering 4 Motivation fo r Synch. p 1 p 2 1: insert (queue q 1 , c) 1: insert (queue q 2 , a) 2: insert (queue q 2 , d) 2: insert (queue q 1 , b).
  • queue
q 1 queue q 2 pro cess p 1 pro cess p 2
  • *
  • *
@ @ @ @ @ @ @ @ @ @ I s in (queue q 2 , a) s in (queue q 1 , c) s in (queue q 1 , b) s in (queue q 2 , d)
  • queue
q 1 queue q 2
  • 6
s p 1 : 1 s p 1 : 2 6 s p 2 : 1 6 s p 2 : 2
  • 6
s p 1 : 1 s p 1 : 2 6 s p 2 : 1 6 s p 2 : 2
  • 6
s p 1 : 1 s p 1 : 2 6 s p 2 : 1 6 s p 2 : 2 State q 1 c b q 2 d a q 1 c b q 2 a d q 1 b c q 2 a d c Vija y K. Ga rg Distributed Systems F all 94
slide-5
SLIDE 5 Synchronous Ordering 5 Cro wns in Distributed Computation
  • A
computation is synchronous i there do es not exist a se- quence
  • f
send and co rresp
  • nding
receive events such that s ! E r 1 ; s 1 ! E r 2 ; : : : ; s k 2 ! E r k 1 ; s k 1 ! E r :
  • such
a structure is called cro wn.
  • Example:
P 1 P 2 P 3 s 1 r 1 s 2 r 2 s r s 1 r 1 s 3 r 3 s 2 r 2 (A) (B) s 1 ! r 2 ; s 2 ! r 1 s 1
  • r
2 ; s 2
  • r
3 ; s 3
  • r
1 (A) : Cro wn
  • f
size 2 (B) : Strong Cro wn
  • f
size 3 c Vija y K. Ga rg Distributed Systems F all 94
slide-6
SLIDE 6 Synchronous Ordering 6 Algo rithm
  • Commit
P
  • int
  • f
a Message P 1 P 2 e s 1 r 1 s 2 r 2
  • Prio
rit y Rule (RP) P 1 P 2 P 3 s r s r s r e (a) The message along with the underlying message P 1 P 2 P 3 s r r s e (b) The resulting message
  • rdering
c Vija y K. Ga rg Distributed Systems F all 94
slide-7
SLIDE 7 Synchronous Ordering 7 Algo rithm [Contd.]
  • Send
Condition s 1
  • s
2 = ) r 1 ! r 2
  • Receive
Condition s 1
  • s
2 = ) s 1 :ack
  • s
2 c Vija y K. Ga rg Distributed Systems F all 94
slide-8
SLIDE 8 Synchronous Ordering 8 Implem entati
  • n
P i P j e
  • passiv
e
  • f
f :ack e:ack
  • activ
e
  • activ
e
  • Send
Condition (SC) s 1
  • s
2 = ) r 1 ! r 2 (SP) s 1
  • s
2 = ) s 1 :ack
  • s
2 (W ait fo r ack)
  • Receive
Condition (R C) s 1
  • r
2 = ) :(r 2 ! r 1 ) (RP) s 1
  • r
2 = ) s 1 :ack
  • r
2 :ack (Send ack if no ack p ending ) c Vija y K. Ga rg Distributed Systems F all 94
slide-9
SLIDE 9 Synchronous Ordering 9 Basic Lemma Lemma 1 (s 1 ! r 2 ) and (SC) = ) (r 1 ! r 2 ) _ (s 1
  • r
2 ) Pro
  • f:
s s s
  • s
s 1
  • s
3 = ) r 1 ! r 3 = ) r 1 ! r 2 Case 1 Case 2 s 1 r 1 r 2 s 1 r 1 r 2 Case 3 s 1 r 1 s 3 r 2 r 3 ! r 2 2 c Vija y K. Ga rg Distributed Systems F all 94
slide-10
SLIDE 10 Synchronous Ordering 10 Cro wn and Strong Cro wn Lemma 2 Given SC and R C. 2 CR = ) 2 SCR. Pro
  • f:
s 1 ! r 2 ; s 2 ! r 1 Let :(s 1
  • r
2 ) = ) r 1 ! r 2 S C = ) :(s 2
  • r
1 ) R C :(s 2
  • r
1 ) ^ (s 2 ! r 1 ) = ) r 2 ! r 1 2 Lemma 3 Given SC, R C. CR(k ) = ) SCR (k ) Pro
  • f:
s i1 ! r i ; s i ! r i+1 s.t. :(s i
  • r
i+1 ) = ) r i ! r i+1 Therefo re, s i1 ! r i ; s i ! r i+1 reduced to s i1 ! r i+1 . 2 c Vija y K. Ga rg Distributed Systems F all 94
slide-11
SLIDE 11 Synchronous Ordering 11 Safet y :S Y N C H , C R ) S C R s
  • r
1 ; s 1
  • r
2 ;
  • ;
s k 1
  • r
i.e. P (s i ) = P (r (i+1) mo d k ) F rom PR : P (s i ) > P (r i ) w e get P (s ) < P (r ) c Vija y K. Ga rg Distributed Systems F all 94
slide-12
SLIDE 12 Synchronous Ordering 12 Liveness
  • If
P k w ants to send a message then it can eventually succeed.
  • k
smallest p ro cesses will eventually b e in active state. c Vija y K. Ga rg Distributed Systems F all 94
slide-13
SLIDE 13 Synchronous Ordering 13 Overhead
  • Prio
rit y Rule
  • fo
r every message (s; r ) if P(s) < P(r ): +
  • ne
control message and + dela y
  • f
less than 2t units
  • f
time.
  • fo
r every message (s; r ) if P(s) > P(r ): + no control message and + no dela y .
  • Send
and Receive Proto col +
  • ne
control message and + dela y is upp er b
  • unded
b y nt, where n is equal to the numb er
  • f
p ro cesses. c Vija y K. Ga rg Distributed Systems F all 94