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
(for some reason, department mailer drops emails with large attachments)]

(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


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 */
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 )
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 .



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


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)

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;

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

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

Explain what type of broadcast suffices for the following application: a company manager issuing a series of instructions to his/her group of subordinates. we had discussed broadcast primitives with various semantics: atomic. causal. (15 pts) In the class.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. FIFO. and totally ordered. 5. 4 . Does your choice change when the instructions are sent from multiple managers at different locations.

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.