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;

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

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

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

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.