Leader Election and Mutual Exclusion Algorithms for Wireless Ad Hoc Networks. CPSC 661 Distributed Algorithms Abhishek Gaurav Alok Madhukar.

Slides:



Advertisements
Similar presentations
An Adaptive Compulsory Protocol for Basic Communication in Ad-hoc Mobile Networks Ioannis Chatzigiannakis Sotiris Nikoletseas April 2002.
Advertisements

CS542 Topics in Distributed Systems Diganta Goswami.
Lecture 8: Asynchronous Network Algorithms
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
TORA! TORA! TORA! By Jansen Cohoon. Developing TORA TORA was funded by the Army Research Laboratory. TORA is presently being transitioned into the commercial.
Max-Min D-Cluster Formation in Wireless Ad Hoc Networks - Alan Amis, Ravi Prakash, Thai Vuong, Dung Huynh Presenter: Nirav Shah.
A Highly Adaptive Distributed Routing Algorithm for Mobile Wireless Networks Temporally-Ordered Routing Algorithm (TORA) IEEE INFOCOM 112/4/20031Authors.
Topology Control of Multihop Wireless Networks Using Transmit Power Adjustment Paper By : Ram Ramanathan, Regina Resales-Hain Instructor : Dr Yingshu Li.
Mobile and Wireless Computing Institute for Computer Science, University of Freiburg Western Australian Interactive Virtual Environments Centre (IVEC)
1/14 Ad Hoc Networking, Eli M. Gafni and Dimitri P. Bertsekas Distributed Algorithm for Generating Loop-free Routes in Networks With Frequently.
Mobile and Wireless Computing Institute for Computer Science, University of Freiburg Western Australian Interactive Virtual Environments Centre (IVEC)
1 Complexity of Network Synchronization Raeda Naamnieh.
CS 582 / CMPE 481 Distributed Systems
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #4 Mobile Ad-Hoc Networks AODV Routing.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
© nCode 2000 Title of Presentation goes here - go to Master Slide to edit - Slide 1 Reliable Communication for Highly Mobile Agents ECE 7995: Term Paper.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Dept. of Computer Science Distributed Computing Group Asymptotically Optimal Mobile Ad-Hoc Routing Fabian Kuhn Roger Wattenhofer Aaron Zollinger.
Performance Comparison of Existing Leader Election Algorithms for Dynamic Networks Mobile Ad Hoc (Dynamic) Networks: Collection of potentially mobile computing.
Mobile and Wireless Computing Institute for Computer Science, University of Freiburg Western Australian Interactive Virtual Environments Centre (IVEC)
1 Prioritized h-out of-k Resource Allocation for Mobile Ad Hoc Networks and Distributed Systems Jehn-Ruey Jiang Hsuan Chuang University HsinChu, Taiwan.
An Energy Efficient Leaser Election Algorithm for Mobile Ad Hoc Networks Paolo Cemim, Vinicius De Antoni Instituto de Informatica Universidade Federal.
1 Internet Networking Spring 2006 Tutorial 3 Ad-hoc networks TBRPF (based on IETF tutorials on TBRPF)
1 Analysis of Link Reversal Routing Algorithms Srikanta Tirthapura (Iowa State University) and Costas Busch (Renssaeler Polytechnic Institute)
TORA : Temporally Ordered Routing Algorithm Invented by Vincent Park and M.Scott Corson from University of Maryland. TORA is an on-demand routing protocol.
1 Distributed Process Management: Distributed Global States and Distributed Mutual Exclusion.
CS401 presentation1 Effective Replica Allocation in Ad Hoc Networks for Improving Data Accessibility Takahiro Hara Presented by Mingsheng Peng (Proc. IEEE.
Ad Hoc Wireless Routing COS 461: Computer Networks
A Highly Adaptive Distributed Routing Algorithm for Mobile Wireless Networks Research Paper By V. D. Park and M. S. Corson.
Itrat Rasool Quadri ST ID COE-543 Wireless and Mobile Networks
DISTRIBUTED TOKEN CIRCULATION ON MOBILE AD HOC NETWORKS.
1 A Mutual Exclusion Algorithm for Ad Hoc Mobile networks Presentation by Sanjeev Verma For COEN th Nov, 2003 J. E. Walter, J. L. Welch and N. Vaidya.
Leader Election Algorithms for Mobile Ad Hoc Networks Presented by: Joseph Gunawan.
4.5 DISTRIBUTED MUTUAL EXCLUSION MOSES RENTAPALLI.
4.5 Distributed Mutual Exclusion Ranjitha Shivarudraiah.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 10 Instructor: Haifeng YU.
10.- Graph Algorithms Centro de Investigación y Estudios Avanzados del Instituto Politécnico Nacional Introduction Routing Algorithms Computation of Shortest.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Chapter 5 Network Layer.
Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
Analysis of Link Reversal Routing Algorithms for Mobile Ad Hoc Networks Costas Busch (RPI) Srikanth Surapaneni (RPI) Srikanta Tirthapura (Iowa State University)
DISTRIBUTED SYSTEMS II A POLYNOMIAL LOCAL SOLUTION TO MUTUAL EXCLUSION Prof Philippas Tsigas Distributed Computing and Systems Research Group.
SRL: A Bidirectional Abstraction for Unidirectional Ad Hoc Networks. Venugopalan Ramasubramanian Ranveer Chandra Daniel Mosse.
Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
Lecture 12-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) October 4, 2012 Lecture 12 Mutual Exclusion.
Load Balanced Link Reversal Routing in Mobile Wireless Ad Hoc Networks Nabhendra Bisnik, Alhussein Abouzeid ECSE Department RPI Costas Busch CSCI Department.
Ad Hoc On-Demand Distance Vector Routing (AODV) ietf
Lecture 7- 1 CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 7 Distributed Mutual Exclusion Section 12.2 Klara Nahrstedt.
Relying on Safe Distance to Achieve Strong Partitionable Group Membership in Ad Hoc Networks Authors: Q. Huang, C. Julien, G. Roman Presented By: Jeff.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
CS 6401 Intra-domain Routing Outline Introduction to Routing Distance Vector Algorithm.
CSC 8420 Advanced Operating Systems Georgia State University Yi Pan Transactions are communications with ACID property: Atomicity: all or nothing Consistency:
Asstt. Professor Adeel Akram. Other Novel Routing Approaches Link reversal Aimed for highly dynamic networks Goal: to identify some path, as opposed.
GeoTORA: A Protocol for Geocasting in Mobile Ad Hoc Networks
Mutual Exclusion Continued
Sensor Network Routing
GeoTORA: A Protocol for Geocasting in Mobile Ad Hoc Networks
A Mutual Exclusion Algorithm for Ad Hoc Mobile Networks
Routing: Distance Vector Algorithm
任課教授:陳朝鈞 教授 學生:王志嘉、馬敏修
Analysis of Link Reversal Routing Algorithms
Temporally-Ordered Routing Algorithm (TORA)
Distributed Mutual Exclusion
Effective Replica Allocation
Presentation transcript:

Leader Election and Mutual Exclusion Algorithms for Wireless Ad Hoc Networks. CPSC 661 Distributed Algorithms Abhishek Gaurav Alok Madhukar

Part 1: Leader Election Algorithms for Wireless Ad Hoc Networks - What is a mobile ad hoc network? - Use of Leader election in mobile systems - Challenges in making algorithms for mobile ad hoc network. - Model and Assumptions - Earlier Algorithms - Overview of Leader Election Algorithm - The Algorithm - Conclusion

Wireless Networks – Operating Modes Infrastructure Mode Ad Hoc Mode

Wireless Ad Hoc Networks - Characteristics - Wireless - Highly Mobile - No Access Points/Infrastructure - All nodes are peers - All nodes are routers - Network is formed dynamically

Wireless Ad Hoc Networks - Routing Alok Ian

Wireless Ad Hoc Networks - Routing Alok Ian Gabriel

Wireless Ad Hoc Networks - Routing Alok Ian Abhishek Gabriel Lisa

Use of Leader Election in Mobile Systems - Useful building block when failures are frequent - Lost Token in Mutual Exclusion - Group Communication Protocols - New Coordinator when Group Membership changes

Challenges in making Algorithms for Wireless Ad Hoc Networks - Communication link – function of position, transmission power levels, antenna patterns, co- channel reference levels, etc. - Frequent and unpredictable Topological Changes - Congested Links

New Definition Vs Classical Definition - Classical Definition 1. Eventually there is a leader with termination detection 2. There should never be more than one leader - New Definition 1. Any component whose topology is static sufficiently long will eventually have a leader with termination detection 2. There should never be more than one leader for any given component

Basic Ideas - Leader-Oriented DAG - Partition from Leader - Merging of Components - Multiple Topology Changes

System Model - N independent mobile nodes - Message passing over wireless network - Network – dynamically changing, not necessarily connected, a graph with nodes as vertices and edges between nodes that can communicate

Assumptions on System Model - Nodes have unique node identifiers - Communication links are bidirectional, reliable, FIFO - Link level protocol: aware of the neighbors - One Topological change at a time

Problem Statement - For every connected component C of the topology graph, there is a node l in C, s.t. lid i = l for each node i in C. - Eventually, each connected component is a directed acyclic graph with the leader as the single sink (leader-oriented DAG)

Existing Algorithms - Shortest Path and Adaptive Shortest Path Algorithms - Designed for static and quasi-static hard-wired links - Do not react fast enough to maintain routing - Only 1 path for routing between any source/destination pair - Link State Algorithms - Maintain multiple path for routing - Time and communication overhead associated with maintaining full topological knowledge at each router makes them impractical

Introduction of Link Reversal Routing - Objectives - Executes in a distributed environment - Provides loop-free routes - Provides multiple routes (to alleviate congestion) - Establishes routes quickly - Minimize communication overhead by localizing algorithmic reaction to topological changes when possible

Link Reversal Routing (LRR) - Approach - LRR Algorithms maintain only distributed state information sufficient to constitute an Directed Acyclic Graph (DAG), rooted at the destination - Maintenance of a distributed DAG is desirable, as it guarantees loop-freedom and can provide participating nodes with multiple, redundant routes to the destination - Route maintenance is triggered when a node i loses the link to its last downstream neighbor

Basis - Gafni – Bertsekas Algorithm [1]: Temporally Ordered Routing Algorithm (TORA) [2]: 1997

Leader Oriented DAG fig. A Leader Oriented DAG Height2 Height1 Reference2 Reference1 Height2 > Height1 Reference2 > Reference1

Leader Election Algorithm - An Overview fig. C is in trouble (It has no outgoing link) A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. C becomes originator of a new higher reference level A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. E is in trouble and sees that neighbors have different levels A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. E goes to new reference level and selects height just below C A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. Link from C to E is not reversed, but link from D to E is reversed A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. D in trouble A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. D goes to new reference level and selects height just below E A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. Links C to D and E to D are intact but A to D reverse A B C D E Everyone is happy

Leader Election Algorithm - An Overview (cont’d…) fig. Link Break disconnects the component from leader A B C D E Alas!!

Leader Election Algorithm - An Overview (cont’d…) fig. B is in trouble since it has lost all outgoing links A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. B selects new height in new (highest) reference level A B C D E

Leader Election Algorithm - An Overview (cont’d…) fig. A is in trouble A B C D E A sees something different !! – All neighbors are in higher level

Leader Election Algorithm - An Overview (cont’d…) fig. A creates higher sublevel within the new sub-level A B C D E {φ}{φ}

Leader Election Algorithm - An Overview (cont’d…) fig. All links to A are reversed A B C D E {φ}{φ}

Leader Election Algorithm - An Overview (cont’d…) fig. Higher Sub-level is reflected back to C (originator) A B C D E C knows that there is no route to the leader

Leader Election Algorithm - An Overview (cont’d…) fig. C elects itself the leader and propagates the message A B C D E All nodes adjust their height w.r.t. leader

Leader Election Algorithm - An Overview (cont’d…) fig. The separated component becomes a leader-oriented DAG A B C D E Everyone is happy again

Node Height in LE The height of node i is an ordered six-tuple (lid i, τ i, oid i, r i, δ i, i) - lid i : id of the node believed to be the leader of i’s component - τ i : the “logical time” of link failure, defining a new reference level - oid i : the unique id of the node that defined the reference level - r i : a bit used to divide each of the unique reference levels into two unique sub-levels – reflected and unreflected - δ i : a “propagation” ordering parameter - i: the unique id of the node (τ i, oid i, r i ) represents the reference level and (δ i, i) represents the “delta” or offset w.r.t. reference level. The reference level (-1,-1,-1) is used by the leader of a component to ensure that it is a sink.

The Algorithm Node i: - Each step is triggered either by the notification of the failure or formation of an incident link or by the receipt of a message from a neighbor. - Local variable N i : to store its neighbors' ids. When an incident link fails, i updates N i. When an incident link forms, i updates N i and sends an Update message over the link with its current height. - The only kind of message sent is an Update message, which contains the sender's height. - At the end of each step, if i's height has changed, then it sends an Update message with the new height to all its neighbors.

The Algorithm (cont’d…) A. When node i has no outgoing links due to a link failure: 1. if node i has no incoming links as well then 2. lid i := i 3. (τ i, oid i, r i ) := (-1,-1,-1) 4. δ i := 0 5. else 6. (τ i, oid i, r i ) := (t, i, 0) // t is the current time 7. δ i := 0

The Algorithm (cont’d…) B. When node i has no outgoing links due to a link reversal following reception of an Update message and the reference levels (τ j, oid j, r j ) are not equal for all j є N i : 1. (τ i, oid i, r i ) := max{(τ j, oid j, r j ) I j є N i ) 2. δ i := min{δ j I j є N i and (τ j, oid j, r j ) = (τ i, oid i, r i )} - 1

The Algorithm (cont’d…) C. When node i has no outgoing links due to a link reversal following reception of an Update message and the reference levels (τ j, oid j, r j ) are equal with r j = 0 for all j є N i : 1. (τ i, oid i, r i ) := (τ j, oid j, r j ) for any j є N i ) 2. δ i := 0

The Algorithm (cont’d…) D. When node i has no outgoing links due to a link reversal following reception of an Update message and the reference levels (τ j, oid j, r j ) are equal with r j = 1 for all j є N i : 1. lid i = i 2. (τ i, oid i, r i ) := (-1, -1, -1) 3. δ i := 0

The Algorithm (cont’d…) E. When node i receives an Update message from neighboring node j such that lid i ≠ lid j 1. if lid i > lid j or (oidi = lid j and r i = 1) then 2. lid i = lid j 3. (τ i, oid i, r i ) := (0, 0, 0) 4. δ i := δ j + 1

Example (A, -1, -1, -1, 0, A)(F, 2, A, 1, -1, D) (F, 2, A, 1, 0, B) (F, 0, 0, 0, 1, E) (F, -1, -1, -1, 0, F) (F, 0, 0, 0, 1, H) (F, 0, 0, 0, 2, G) fig.1 Node A detects a partition and elects itself as leader

Example (cont’d…) (A, -1, -1, -1, 0, A)(A, 0, 0, 0, 1, D) (A, 0, 0, 0, 1, B) (F, 0, 0, 0, 1, E) (F, -1, -1, -1, 0, F) (F, 0, 0, 0, 1, H) (F, 0, 0, 0, 2, G) fig.2 Nodes B and D update their heights Update

Example (cont’d…) (A, -1, -1, -1, 0, A) (A, 0, 0, 0, 1, D) (A, 0, 0, 0, 1, B) (A, 0, 0, 0, 2, E) (F, -1, -1, -1, 0, F) (F, 0, 0, 0, 1, H) (F, 0, 0, 0, 2, G) fig.3 Nodes B and E detect link formation and node E changes leader Update

Example (cont’d…) (A, -1, -1, -1, 0, A) (A, 0, 0, 0, 1, D) (A, 0, 0, 0, 1, B) (A, 0, 0, 0, 2, E) (A, 0, 0, 0, 3, F) (F, 0, 0, 0, 1, H) (F, 0, 0, 0, 2, G) fig.4 Node F propagates leader change Update

Example (cont’d…) (A, -1, -1, -1, 0, A) (A, 0, 0, 0, 1, D) (A, 0, 0, 0, 1, B) (A, 0, 0, 0, 2, E) (A, 0, 0, 0, 3, F) (A, 0, 0, 0, 4, H) (F, 0, 0, 0, 2, G) fig.5 Node H propagates leader change Update

Example (cont’d…) (A, -1, -1, -1, 0, A) (A, 0, 0, 0, 1, D) (A, 0, 0, 0, 1, B) (A, 0, 0, 0, 2, E) (A, 0, 0, 0, 3, F) (A, 0, 0, 0, 4, H) (A, 0, 0, 0, 5, G) fig.6 Node G propagates leader change Update

Proof of Correctness We believe the proof that each component is a leader – oriented DAG with the assumption of one change at a time can be converted to simple graph-theoretic proof and we are working on it.

Problem To solve mutual exclusion problem in wireless ad hoc networks, Nodes communicate with each other by message passing over unreliable communication channels, No shared objects.

Solution Approach Solution Approach : Maintaining a token Node having the token enters critical section. Previous solutions Raymond's algorithm not resilient to link failures. Chang's solution does not consider link recovery. Dhamdhere and Kulkarni's solution suffer from starvation

Mobile Node Architecture Application Process RequestCS ReleaseCS EnterCS Mutual Exclusion Process LinkUP Send(m) Recv(m) LinkDown Network

Notion of Height Each node maintains a 3-tuple height – (h1,h2,i) Heights for each node are distinct. The node identifier i achieves this. Heights are compared lexicographically. Links are logically considered to be directed from higher height node to lower hieght node. Initially node 0 has (0,0,0) and heights for other nodes are initialized to form a DAG.

Overview of Algorithm Algorithm is event-driven, Token-holder node enters the critical section, The token holder ensures lowest height in the system, Request for tokens from non-token holding nodes are directed towards the token- holder.

Data Structures Each node i maintains : status N myHeight height[j], j ∈ N tokenHolder Next Q receivedLI [j] Forming [j] formHeight [j]

Application requests or releases Application Process RequestCS ReleaseCS Mutual Exclusion Process Network

Request for CS Application Process I Q

Request for CS Application Process RequestCS I i Q

Request for CS Application Process RequestCS I i Q tokenHolder = False tokenHolder = True & |Q i | = 1 ForwardRequest() EnterCS

Release the CS Application Process I Q

Release the CS Application Process ReleaseCS I... Q

Release the CS Application Process ReleaseCS I... Q |Q i | > 0 GiveTokenToNext()

Request (h) message received Application Process Mutual Exclusion Process Recv(m) Request(h) Network

Request (h) msg received Network I Q

Request (h) msg received Network Request (h) from j I Q

Request (h) msg received Network Request (h) from j I Q ReceivedLI(j) = false ReceivedLI(j) = true Ignore Update : height[j] = h

Request (h) msg received Network Request (h) from j I j Q j is higher node

Request (h) msg received Network Request (h) from j I j Q tokenHolder = True & ∣ Q ∣ > 0 & status = Remainder GiveTokenToNext()

Request (h) msg received Network Request (h) from j I j Q tokenHolder = false tokenHolder = True & ∣ Q ∣ > 0 no links & status = Remainder outgoing GiveTokenToNext() RaiseHeight()

Request (h) msg received Network Request (h) from j I j Q tokenHolder = false tokenHolder = True & ∣ Q ∣ > 0 Q = [j] & status = Remainder no links ForwardRequest() outgoing GiveTokenToNext() RaiseHeight()

Token (h) message received Application Process Mutual Exclusion Process Recv(m) Token(h) Network

Token (h) msg received Token(h) I Q J

Token (h) msg received Token(h) I Q J tokenHolder = True ; height[j] = h

Token (h) msg received J myHeight.h1 = h.h1 ; myHeight.h2 - 1 I Q

Token (h) msg received J myHeight.h1 = h.h1 ; myHeight.h2 - 1 I Q LinkInfo()

Token (h) msg received J myHeight.h1 = h.h1 ; myHeight.h2 - 1 I Q ∣ Q i ∣ = 0 ∣ Q i ∣ > 0 next i = i GiveTokenToNext()

LinkInfo (h) message received Application Process Mutual Exclusion Process Recv(m) LinkInfo(h) Network

LinkInfo (h) recvd from j Network LinkInfo(h) I

LinkInfo (h) recvd from j Network LinkInfo(h) I receivedLI[j] = True height[j] = h

LinkInfo (h) recvd from j Network LinkInfo(h) I receivedLI[j] = True height[j] = h height[j] = h receivedLI[j] = True

LinkInfo (h) recvd from j Network LinkInfo(h) I forming[j] = false forming[j] is True and (myHeight ≠ formHeight[j]) LinkInfo(myHeight) to j

LinkInfo (h) recvd from j Network LinkInfo(h) I no outgoing links and tokenHolder = False height[j] = h

LinkInfo (h) recvd from j Network LinkInfo(h) I no outgoing links ∣ Q i ∣ > 0 and and tokenHolder = False myHeight < height[next] height[j] = h ForwardRequest()

Procedure GiveTokenToNext I calls GiveTokenToNext I x Q

Procedure GiveTokenToNext I calls GiveTokenToNext I Q next = x

Procedure GiveTokenToNext I calls GiveTokenToNext I Q next = x next = i EnterCS

Procedure GiveTokenToNext I calls GiveTokenToNext I Q next = x tokenHolder = false; receivedLI=F next = i next ≠ i height[next] = (myHeight.h1, myHeight.h2-1, next) EnterCS Token (myHeight)

Procedure GiveTokenToNext I calls GiveTokenToNext I..... Q |Q i | > 0 Request (myHeight)

Procedure ForwardRequest () Called when a node i does not hold the token and a request message arrives at i. Next is set to node i's lowest height neighbor i.e. next = l ∈ N : height[l] ≤ height[j], ∀ j ∈ N. Send Request(myHeight) to next.

Procedure RaiseHeight() h2 = m+1 h1 = k+2 h2 = m h1 = k+1 h1 = k

Procedure RaiseHeight() h2 = m+1 h1 = k+2 h2 = m h1 = k+1 h1 = k

Procedure RaiseHeight() h2 = m+1 h1 = k+2 h2 = m h2 = m-1 h1 = k+1 h1 = k

Link Failures (link to j detected at i) N i = N i – {j} Delete (Q, j) ; receivedLI[j] = True; If (not tokenHolder) then If (no outgoing links) then CallRaiseHeight() ElseIf (( |Q i | > 0 ) and (next ∉ N i )) then ForwardRequest () // If next has failed send a request

Link formation Node i detects a new link to node j, Send LinkInfo(myHeight) to j, Set forming[j] to True, Set formHeight[j] to myHeight.

Correctness Proof To Prove : Algorithm ensures mutual exclusion Algorithm does not suffer from starvation : no node is starved from entering the critical section.

Correctness Proof (Mutual Exclusion) Theorem 1 : The algorithm ensures mutual exclusion This is because there exists only one token in the system at any time.

Correctness Proof contd.. (No Starvation) To prove no starvation After link changes cease, the system will reach a “good” configuration. Variant function is applied to this “good” configuration to show that eventually the node will enter CS “Good configuration” = Token-Oriented DAG Token-Oriented DAG : If ∀ node i, i ∈ {0,....,n-1}, ∃ a directed path originating at node i and terminating at token-holder.

Proof Sketch Lemma1 : In every configuration, a DAG is token oriented iff there are no sinks. ( Definitioin 1: A node i is sink if (tokenHolder i = false) and ((myHeight i < height i [j]), for all j ∈ N i ) + Lemma 2 : In every execution with a finite number of link changes, there are finite number of calls to RaiseHeight (). ↓ Lemma 3 : After link change ceases, the logical direction on links imparted by height values will eventually form a token oriented DAG.

Proof Sketch contd.. Definition 2: A request chain for node l is defined to be the maximal length list of nodes through which request has passed. p 1 = l → p 2 →.... → p j is a request chain. p j is either token-holder, or a Token messageis in transit to p j, or a Request message is in transit from p j to next pj, or a LinkInfo message is in transit from p j to next pj Lemma 4: Once link changes and calls to RaiseHeight() cease, if a node l's request chain does not include a token holder, then eventually l's request chain will include the token holder.

Proof Sketch contd.. Definition 3: A function V l for l is defined to be a vector of integers having m or m+1 elements such that v 1 is position of p 1 in Q p1, and for 1 < j ≤ m, v j is the position of p j-1 in Q pj. If a request message is in transit then v m+1 = n+1. Lemma 5: V l is a variant function; When V l equals, l enters CS. V l never has more than n entries. Request and Token messages decrease V l Theorem 2: When V l equals, l enters CS.

References [1] E. Gafni and D. Bertsekas, “Distributed algorithms for generating loop-free routes in networks with frequently changing topology,” IEEE Transactions on Communications, C-29(1):11-18, [2] Vincent D. Park and M. Scott Corson, “A Highly Adaptive Distributed Routing Algorithm for Mobile Wireless Networks,” Proc. IEEE INFOCOM, April 7-11, [3] N. Malpani, J.L. Welch, N. Vaidya, “Leader Election Algorithms for Mobile Ad Hoc Networks,” Proc. of the 4 th International Workshop on Discrete Algorithms and Methods for Mobile Computing and Communications, August 2000 [4] J. E. Walter, J. L. Welch, and N. H. Vaidya, “A Mutual Exclusion Algorithm for Ad Hoc Mobile Networks,” ACM and Baltzer Wireless Networks journal, special issue on DialM papers, [5] J.E. Walter, G. Cao, M. Mohanty, “A K-Mutual Exclusion Algorithm for Wireless Ad Hoc Networks,” POMC 2001, Newport Rhode Island, USA

Thank You !