Upload
emerald-mccoy
View
213
Download
0
Embed Size (px)
Citation preview
1
A Mutual Exclusion Algorithm for Ad Hoc Mobile networks
Presentation by Sanjeev Verma
For COEN 317
10th Nov, 2003
J. E. Walter, J. L. Welch and N. Vaidya
2
Introduction
• Mobile Ad hoc networks characterized by– Frequent topology changes– Variable message delays
• Mutual Exclusion (ME)– Tree based ME Distributed Algorithm by Raymond but not
resilient to link failure– Extended by Chang et al. to ad hoc networks but suffers from
deadlocks– Further extended by Dhamdhare et al. but uses flooding and
cannot avoid starvation– Reverse Link Mutual Exclusion (RLME) solves the
problems
3
• RLME Algorithm solves mutual exclusion in distributed system and– is fault tolerant and adaptive– is mobility aware and does not rely on an
underlying routing algorithm.
Introduction (contd)
User Applications
Distributed Primitives Routing Protocol
Ad Hoc Network
4
Reverse Link Mutual Exclusion Algorithm
• Assumptions– The nodes have unique identifiers– Node failures do not occur– Communication links are bidirectional and FIFO– A link-level protocol ensures that each node is aware of
the set of nodes with which it can currently directly communicate by providing indications of link formations and failures
– Incipient link failures are detectable, providing reliable communication on a per-hop basis, and
– Partitions of the network do not occur.
5
Reverse Link Mutual Exclusion Algorithm (contd)
• System Architecture
Application Process
Network
Mutual Exclusion Process
LinkUp
Send(m)
RequestCSEnterCS
Recv(m)
ReleaseCS
LinkDown
6
Reverse Link Mutual Exclusion Algorithm (contd.)
• Key variables at a node i– Status : WAITING, CRITICAL or
REMAINDER– Height : A three-tuple (h1, h2, i) denoting
height of node i. Helps in maintaining a DAG.– Queue : queue of nodes that have requested the
token from the node i– Next pointer : points to a node that takes the
request towards the token holder
7
Reverse Link Mutual Exclusion Algorithm (contd.)
• Events and procedures at node i – RequestCS: Enqueue request if i is WAITING. If i is
not a token holder and there is request in queue, ForwardRequest, otherwise GiveTokenToNext
– ReleaseCS: GiveTokenToNext if there is a request in queue
– ForwardRequest: Set Next to a neighbor node with lowest height and send request to the node
– GiveTokenToNext: If request in queue is from i then enter CS otherwise send token and request to Next.
8
Reverse Link Mutual Exclusion Algorithm (contd.)
• Events and procedures at node i– Request received from j: If linkInfo is current for j update its
height info. If i’s height is less than j’s then put j’s request in queue. If i has token and it’s done with CS then GiveTokenToNext. Otherwise create an outgoing link by calling RaiseHeight or if there is an outgoing link and there is a request in queue then ForwardRequest
– RaiseHeight: Height is (h1, h2, i). h1 = 1 + minimum of the h1 of heights of all the neighbor nodes. h2 = minimum of h2 of all neighbor’s heights for which h1 is same – 1. Then update all neighbors with new height. Delete any requests in queue from node which is on the outgoing link now.
9
Reverse Link Mutual Exclusion Algorithm (contd.)
• Events and procedures at node i– Token received from j: i becomes token holder and
updates j’s height info. i lowers height and send the linkInfo with height to all the neighbors. GiveTokenToNext for any request in queue, otherwise Next is set to refer to self.
– LinkInfo received from j: Add j to neighbor list and note j’s height. If j does not know about me, send linkInfo to j. If i’s height is least among all neighbors and its not a token holder then RaiseHeight, otherwise if there is request to forward, ForwardRequest.
10
Reverse Link Mutual Exclusion Algorithm (contd.)
• Events and associated actions at node i:– LinkDown to j: Remove j from neighbor list and delete
any requests queued for j. If not token holder then RaiseHeight or ForwardRequest
– LinkUp to j: Send linkInfo to j and note that link is coming up. The information about link coming up is used in linkInfo received procedure, so that linkInfo’s are not exchanged in an infinite loop.
11
Operation of RLME Algorithm in static network
3 0
12
3
2
32
(0,1,3)
(0,2,1)(0,2,2)
(0,0,0)
0 has the token. 3 and 2 requested token from 0.
12
Operation of RLME Algorithm in static network (contd)
3 0
12
31
2
32
1
(0,1,3)
(0,2,1)(0,2,2)
(0,0,0)
1 has requested access to CS and sends request to 3
13
Operation of RLME Algorithm in static network (contd)
3 0
12
10
2
2
1
(0,-1,3)
(0,2,1)(0,2,2)
(0,0,0)
0 exits CS. 0 sends request to 3 on behalf of 2.
14
Operation of RLME Algorithm in static network (contd)
3 0
12
0
2
2
3
(0,-1,3)
(0,-2,1)(0,2,2)
(0,0,0)
3 exits CS. 3 sends request to 1 on behalf of 0.
15
Operation of RLME Algorithm in static network (contd)
3 0
12
(0,-3,3)
(0,-2,1)(0,-5,2)
(0,-4,0)
2 has the token. Token passes from 1 to 3 to 0 to 2.
16
Operation of RLME Algorithm in dynamic network
3 0
12
3
2
32
(0,1,3)
(0,2,1)(0,2,2)
(0,0,0)
0 has the token. 3 and 2 requested token from 0.
17
Operation of RLME Algorithm in dynamic network (contd)
3 0
12
3
2
2(0,1,3)
(0,2,1)(0,2,2)
(0,0,0)
3 has moved. The network is no longer token oriented.
18
Operation of RLME Algorithm in dynamic network (contd)
3 0
12
3
2
2(1,1,3)
(0,2,1)(0,2,2)
(0,0,0)
3 has adapted to the loss of link and sent a request message to 1.
19
Operation of RLME Algorithm in dynamic network (contd)
3 0
12
3
2
2
3
(1,1,3)
(1,0,1)(0,2,2)
(0,0,0)
1 has received 3’s request message.
20
Operation of RLME Algorithm in dynamic network (contd)
3 0
12
3
21
2
3
(1,1,3)
(1,0,1)(0,2,2)
(0,0,0)
1 has propagated request to node 2. DAG restored.
21
Operation of RLME Algorithm in dynamic network (contd)
3 0
12
3
1
3
(1,1,3)
(1,0,1)(0,-1,2)
(0,0,0)
0 comes out of CS. 2 gets the token..
22
Operation of RLME Algorithm in dynamic network (contd)
3 0
12
(0,-3,3)
(0,-2,1)(0,-1,2)
(0,0,0)
3 gets the token after 2 is done with CS.
23
Correctness of RLME Algorithm
• The algorithm ensures mutual exclusion– In every configuration of every execution, the DAG is
token oriented if and only if there are no sinks (its not token holder and height is less than all adjacent nodes)
– In every execution with finite number of link changes, there exists a finite number of height increases
– Once link changes cease, the logical direction on links imparted by height values will eventually always form a token oriented DAG
24
Simulation results
• Compared to Raymond’s tree based mutual exclusion algorithm for static, low mobility and high mobility network conditions for a network of 30 to 40 nodes– Average waiting time per CS entry
• RLME is better
– Average messages per CS entry• RLME is better