Download presentation
Presentation is loading. Please wait.
Published byMelvyn Horton Modified over 6 years ago
1
A Mutual Exclusion Algorithm for Ad Hoc Mobile Networks
Jennifer E. Walter, Jennifer L. Welch, and Nitin H. Vaidya
2
Introduction Ad-Hoc Wireless Network – definition
Mobility causes link failures. Unpredictable message delays Previous work – Routing protocols Broadcasting and Multicasting in Ad-Hoc wireless networks Use Ad-Hoc Routing, or take mobility into account.
3
Critical Section Problem
Only one node may be in its critical section at a time. CS may be a block of code, or a resource. There should be no starvation. The CS must be granted only by request. Typical algorithms may be inefficient if run on an Ad-Hoc wireless network.
4
The General Approach Impose a logical DAG on the network.
The token circulates in the network. All nodes in the DAG “point” toward the node that is holding the token. Based on Raymond’s token-based ME algorithm, which was based on a static spanning tree. Here, the DAG is dynamic.
5
The Approach (Continued)
Use a partial reversal technique to maintain DAG. Each node has height, chooses its lowest neighbor as the preferred link to the token holder. Each node keeps a local request queue.
6
Definitions There are n independent, mobile nodes, uniquely numbered 0, …, n – 1. Nodes are either in REMAINDER, WAITING, or CRITICAL sections. Nodes do not fail. Nodes are aware of link failures and recovery in the network. Communication is reliable on a per-hop basis, and incipient link failures are detectable. The network does not partition. All links are bidirectional.
7
Input and Output Events
Request CS_i Release CS_i Recv_i(j, m) LinkUp_i(l) LinkDown_i(l) EnterCS_i Send_i(j, m) Application vs. Network Events
8
Constraints C_0 initial configuration
C_k is based on C_{k – 1} and in_k, following the transition function’s rules. Times assigned to the steps are nondecreasing. If the execution is infinite, then the times must increase without bound. If there is a requestCS at node i, then the previous application event was a releaseCS. If there is a releaseCS at a node, then the last application event at that node must be an enterCS
9
Constraints (Con’t) For every EnterCS_i, there is a following ReleaseCS_i. Given link l joins i and j, iff linkUp_i(l) occurs at time t, then so does linkUp_j(l). The same is true of LinkDown. A linkdown event cannot occur while messages are in transit on l.
10
Variables in the Algorithm
status = REMAINDER. N = set of neighboring nodes. myHeight(h1, h2, i) totally orders nodes. The DAG initially points at node 0, which starts with height (0, 0, 0). height(j) is the height of the neighboring nodes. tokenHolder = true if this node holds the token
11
Variables (Continued)
next = i, if i holds the token, otherwise, it is the node on the lowest outgoing link. Q = Queue of requesting neighbors. Q is empty initially. receivedLI[j] = true. Has a linkInfo message been received from j, to which a token was recently sent. forming[j] = true only after LinkUp(j) and before LinkInfo message is received. formHeight[j] is an array of tuples storing the value of myHeight when new link to j is first detected. formHeight = myHeight in the beginning.
12
When node i requests access to the CS:
status := WAITING Enqueue(Q, i) if (!tokenHolder) if (length(Q) = 1) ForwardRequest() else GiveTokenToNext() When node I releases the CS: if (length(Q) > 0) GiveTokenToNext() Status := REMAINDER
13
When Request(h) received at node i from node j.
if (receivedLI[j]) height[j] := h if (myHeight < height[j]) Enqueue(Q, j) if (tokenholder) if (length(Q) > 0) and (status = REMAINDER) GiveTokenToNext() else // not the holder if (myHeight < height[k], for all k in N) RaiseHeight() else if ((Q = [j]) or (length(Q) > 0)and (myheight < height[next])) ForwardRequest() // reroute request
14
When failure of link to j detected at node i
N := N – {j} Delete(Q, j) ReceivedLI[j] = true if (!tokenHolder) if (myHeight < height[k], for all k in N) RaiseHeight() // reroute request else if ((length(Q) > 0) and (next not in N)) ForwardRequest()
15
When formation of link to j detected at node i
Send LinkInfo(myHeight) to j forming[j] := true formheight[j] := myHeight Procedure ForwardRequest() next := l in N, where height[l] <= height[j] for all j in N send Request(myHeight) to next
16
Procedure GiveTokentoNext() // Called when length(Q) > 0
next = dequeue(Q) if (next != i) tokenHolder := false height[next] = (myHeight.h1, myHeight.h2 – 1, next) ReceivedLI[next] := false Send Token(myHeight) to next if (length(Q) > 0) send Request(myHeight) to next else { status := CRITICAL Enter CS }
17
Procedure RaiseHeight()
myHeight.h1 = 1 + min_{k in N} {height[k].h} s := {the set of l in N, height[l].h1 = myHeight.h1} if (s is not empty) myHeight.h2 = min_{l in s} height[l].h2 – 1 send LinkInfo(myHeight) to all k in set N. for all k in N such that (myHeight > height[k]) Delete(Q, k) if (length(Q) > 0) ForwardRequest()
18
Simulation Results 30 nodes, exponential rate of link failures and creations due to mobility exponential rate of requests compared only to Raymond’s algorithm no routing overhead taken into consideration did 4 tests, and this algorithm RL outperformed Raymond’s (RR) on only some of them.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.