GC82100

:

Distributed Operating Systems

Final exam (take-home); Handed out on 05/20/15; Due on 05/23/15
Instructor: K. Ravindran,
Spring ’15
[Send your answer sheets to my webmail address: ravir222@hotmail.com
DO NOT SEND TO MY DEPARTMENT ADDRESS
(for some reason, department mailer drops emails with large attachments)]
1.

(30 pts) The communication level agents of processes in a group form a logical ring, with
each agent C(pi ) for a process pi having an incoming channel ini and an outgoing channel
outi that connect to its predecessor C(pi−1 ) and successor C(pi+1 ) respectively in the ring
through a network, where i = 1, 2, . . . , N (modulo N addition is used for process indexes). See
Figure 1. On this communication configuration, the following basic implementation of causal
broadcast related primitives (C Bcast and C Deliver) is employed for the case of lossless
(and non-duplicating) channels and no process failures:
C Bcast(m) by ps for 1 ≤ s ≤ N

and

C Deliver by pi for i = 1, 2, . . . , N

C(ps )
C(pi )
seq no := seq no + 1
pend lst := ∅, del set := ∅, seq no := 0
m.prev del := del set
/* Initialize communication related variables */
forever
m.s id := my id
Receive(m0 , ini )
m.s no := seq no
Send(m, outs )
if (m0 .s id 6= my id)
include (seq no, my id) in del set
include m0 in pend lst
while ∃x ∈ pend lst 3 (x.prev del ⊆ del set) do
include (x.s no, x.s id) in del set
strip s id, s no and prev del from x
and deliver x to pi
remove x from pend lst
Send(x, outi )
else
notify pi about completion of C Bcast(m0 ).
del set: List of previously delivered messages;
seq no: Last assigned message sequence
number at this process; pend lst: List of messages awaiting delivery; 3 ≡ ‘such that0 .

2.

A:

Describe the functioning of the above causal broadcast message delivery algorithm.

B:

Given an underlying network behavior in which the channels are lossy but a C(pi ) knows
about a guaranteed upper bound δ on the transfer delay of a message m sent using
Send(m, outi ) in the case m is delivered at the receiver C(pi+1 ) at the other end of outi ,
how will you modify the above algorithm using timeout based message retransmissions ?
Assume that each C(pi ) knows about the total number of members N in the group.

(30 pts)
A:

Establish the truth or otherwise of the following statements:

Given a set of messages m1 , m2 and m3 , {(m1 → m2 ), ¬(m3 → m2 )} ≡ (m1 →
k{m2 , m3 }), where → denotes Lamport’s ‘happens before’ relation and k denotes concurrent messages;
1

e. pb . that a process is alive or otherwise cannot be accurately determined. than a coordinated checkpointing. · · ·} interconnected in the form of a ’logical ring’ through non-lossy and FIFO channels. Such a reconfiguration is however atomic with respect to an election activity. when the heart-beat message I AM ALIVE(u) is not heard from the current leader u or when a non-leader v spontaneously wishes to challenge u to take over its role1 . Only when pb crashes or its leadership gets challenged. 3. Any of the processes can start an election: say. Each process pi maintains two variables: [succ(pi ). indicating the process 1 The ranking of processes is a meta-information used only for the purpose of election. to support your answer. C(pN) out i Network channel for communication Figure 1: A realization of ’causal broadcast’ layer on ring-based networks B: Electing a leader among a set of processes is an instance of the generic problem of mutual exclusion among these processes. This information goes into the blind-spot of processes when there is no election. the saving of local states during a run (i. A process does not know before-hand as to which other processes are actually on the ring. a process arbitrarily deciding not to send any message when it is supposed to send one).Machines Application layer (C_Bcast/ C_Deliver) Broadcast layer (Send/ Receive) process group p1 p2 pi C(p1) C(p2) . where necessary. C: With send-omission behavior of processes (ie. the election algorithm amounts to finding out the highest ranked process in a given ring configuration. For algorithm design purposes. the ring connection data structure is distributed among processes. In the earlier example... D: Given a set of processes. Thus. 2 A background algorithm reconfigures the ring when a process in the ring fails or a new process joins the ring. You may give an example.. even if a new process pd with rank(pd ) > rank(pb ) subsequently joins the ring. See Figure 2. checkpointing) without any coordination among the processes results in a shorter recovery time upon a process failure.. the ensuing election will choose pd as the leader. the join of pd does not by itself trigger an eviction pb as the leader. in i C(pi) pN . For example. (25 pts) Consider a set of processes {pa . 2 . Assume that the ring is static (with no breaks) during an entire run of the election algorithm2 . An election algorithm uses information on the ranking among processes to choose the highest ranked process as the leader (the positional order of processes in the ring may not reflect the rank order). pred(pi )]. if rank(pb ) > rank(pc ) > rank(pa ). pc . the algorithm will choose pb as the leader.

for instance. See Figure 3. An election-related message: say. p2 . In E. Give an algorithm for an instant replay debugger in which each pi stores only local information. the actions taken by a pi depend only on the initial state of pi and the messages pi receives.e. s2 . Hint: The information var carried in the ELECT ME message can possibly include a process id x. where y is some process on the ring that kick-started the election and var is the information carried around during the circum-navigation of ELECT ME from y to pi . send a message md to p2 . mc in that sequence to p3 and having p3 regenerate md to p2 . i.. Consider. with the processing of these messages transforming the state of p1 . s3 from p2 . processes p1 . You should state how pi kick-starts the election activity. FIFO) process A s UNIDIRECTIONAL RING STRUCTURE s succ A pred B ldr A state information kept by a process during election s rank(B) > rank(C) > rank(A) ldr A process C I_AM_ALIVE message flow (A) succ C pred A process B ldr(x): process id of leader as known to process x Figure 2: Sructure of ranking-based election algorithm executed on a ring ids of its immediate successor and predecessor on the ring. var). and then receive a message mc from p1 . Then a replay of E may involve a controller process. and how pi terminates (i. decides that the election has completed and knows who the leader is).. The ELECT ME(· · ·) message causes some actions at pi in the form of changes in its local state and/or sending an ELECT ME(· · ·) along the channel connecting to succ(pi ).v E (C succ(x). what actions pi performs when an ELECT ME(· · ·) message is received.N executing a deterministic program._M CT ELE . installing p3 in the state sinit while leaving p1 3 and p2 in their states sf1 in and sf2 in respectively. Be sure to indicate the storage requirements of the 3 . p3 to sf1 in . With the above basic structure.···. mb . p may (say) receive a message m from p and a message m sinit 3 a 1 b 1 .2. predx) ar) s ldr A succ B variables maintained by a process x pred C channel segment of ring (non-lossy. p3 in initial states init init respectively. to roll it forward to sf3 in (md will be dropped). can be received by pi only on the channel connecting to pred(pi ). ELECT ME(y. (25 pts) Consider the processes {pi }i=1. p2 . After p3 reaches sf3 in .e. then program proceeds further by exchanging messages me and mf . indicating that the circum-navigation election request started by y has found x as the highest ranked process thus far. An instant-replay debugger records the message exchanges of an execution E of the program and permits an exact replay of E. sf2 in . say. 4. sf3 in respectively. give a schema of the ranking-based election algorithm in a pseudo-code form as executed by the process pi . Assume that messages channels are FIFO. and then presenting the messages ma .

and totally ordered. we had discussed broadcast primitives with various semantics: atomic. 4 . (15 pts) In the class. 5.p1 p2 p3 s1(init) ma s2(init) s3(init) mb Time mc md s1(fin) s3(fin) s2(fin) s3(init) ma mb mc md Regenerate messages s3(fin) message dropped me mf s1’ s2’ s3’ Replay of execution Figure 3: A sample scenario of roll-forward execution algorithm. Does your choice change when the instructions are sent from multiple managers at different locations. causal. Explain what type of broadcast suffices for the following application: a company manager issuing a series of instructions to his/her group of subordinates. FIFO.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.