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

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

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

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. and totally ordered. we had discussed broadcast primitives with various semantics: atomic. 4 . (15 pts) In the class. causal. 5. Does your choice change when the instructions are sent from multiple managers at different locations.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.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer: Get 4 months of Scribd and The New York Times for just $1.87 per week!

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