Leader Election and Mutual Exclusion Algorithms for Wireless
- Slides: 103
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 Gabriel Ian
Wireless Ad Hoc Networks Routing Abhishek Alok Lisa Gabriel Ian
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. lidi = 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]: 1981 Temporally Ordered Routing Algorithm (TORA) [2]: 1997
Leader Oriented DAG Reference 2 Height 1 Height 2 > Height 1 Reference 2 > Reference 1 fig. A Leader Oriented DAG
Leader Election Algorithm - An Overview A B D C E fig. C is in trouble (It has no outgoing link)
Leader Election Algorithm - An Overview (cont’d…) C A B D E fig. C becomes originator of a new higher reference level
Leader Election Algorithm - An Overview (cont’d…) C A B D E fig. E is in trouble and sees that neighbors have different levels
Leader Election Algorithm - An Overview (cont’d…) C A E D B fig. E goes to new reference level and selects height just below C
Leader Election Algorithm - An Overview (cont’d…) C A E D B fig. Link from C to E is not reversed, but link from D to E is reversed
Leader Election Algorithm - An Overview (cont’d…) C A E D B fig. D in trouble
Leader Election Algorithm - An Overview (cont’d…) C E D A B fig. D goes to new reference level and selects height just below E
Leader Election Algorithm - An Overview (cont’d…) C E D A B Everyone is happy fig. Links C to D and E to D are intact but A to D reverse
Leader Election Algorithm - An Overview (cont’d…) C E D A B Alas!! fig. Link Break disconnects the component from leader
Leader Election Algorithm - An Overview (cont’d…) C E D A B fig. B is in trouble since it has lost all outgoing links
Leader Election Algorithm - An Overview (cont’d…) C E B D A fig. B selects new height in new (highest) reference level
Leader Election Algorithm - An Overview (cont’d…) C E B D A A sees something different !! – All neighbors are in higher level fig. A is in trouble
Leader Election Algorithm - An Overview (cont’d…) A C E B D {φ} fig. A creates higher sublevel within the new sub-level
Leader Election Algorithm - An Overview (cont’d…) A C E B D {φ} fig. All links to A are reversed
Leader Election Algorithm - An Overview (cont’d…) A C E B D C knows that there is no route to the leader fig. Higher Sub-level is reflected back to C (originator)
Leader Election Algorithm - An Overview (cont’d…) A C E B D All nodes adjust their height w. r. t. leader fig. C elects itself the leader and propagates the message
Leader Election Algorithm - An Overview (cont’d…) A C E B D Everyone is happy again fig. The separated component becomes a leader-oriented DAG
Node Height in LE The height of node i is an ordered six-tuple (lidi, τi, oidi, ri, δi, i) lidi: 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 oidi: the unique id of the node that defined the reference level ri: 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, oidi, ri) represents the reference level and (δi, i) represents the “delta” or offset w. r. t. reference level. The reference level (-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 Ni: to store its neighbors' ids. When an incident link fails, i updates Ni. When an incident link forms, i updates Ni 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. 1. 2. 3. 4. 5. 6. 7. When node i has no outgoing links due to a link failure: if node i has no incoming links as well then lidi : = i (τi, oidi, ri) : = (-1, -1) δi : = 0 else (τi, oidi, ri) : = (t, i, 0) // t is the current time δ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, oidj, rj) are not equal for all j є Ni: 1. (τi, oidi, ri) : = max{(τj, oidj, rj) I j є Ni) 2. δi : = min{δj I j є Ni and (τj, oidj, rj) = (τi, oidi, ri)} - 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, oidj, rj) are equal with rj = 0 for all j є N i: 1. (τi, oidi, ri) : = (τj, oidj, rj) for any j є Ni) 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, oidj, rj) are equal with rj = 1 for all j є N i: 1. lidi = i 2. (τi, oidi, ri) : = (-1, -1) 3. δi : = 0
The Algorithm (cont’d…) E. When node i receives an Update message from neighboring node j such that lidi ≠ lidj 1. if lidi > lidj or (oidi = lidj and ri = 1) then 2. lidi = lidj 3. (τi, oidi, ri) : = (0, 0, 0) 4. δi : = δj + 1
Example (A, -1, -1, 0, A) (F, 2, A, 1, -1, D) (F, 0, 0, 0, 1, E) (F, 2, A, 1, 0, B) (F, -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, 0, A) Update (A, 0, 0, 0, 1, D) (F, 0, 0, 0, 1, E) Update (A, 0, 0, 0, 1, B) (F, -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
Example (cont’d…) (A, 0, 0, 0, 1, D) (A, -1, -1, 0, A) Update (A, 0, 0, 0, 2, E) (A, 0, 0, 0, 1, B) (F, -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
Example (cont’d…) (A, 0, 0, 0, 1, D) (A, -1, -1, 0, A) (A, 0, 0, 0, 2, E) (A, 0, 0, 0, 1, B) Update (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
Example (cont’d…) (A, 0, 0, 0, 1, D) (A, -1, -1, 0, A) (A, 0, 0, 0, 2, E) (A, 0, 0, 0, 1, B) (A, 0, 0, 0, 3, F) Update (A, 0, 0, 0, 4, H) (F, 0, 0, 0, 2, G) fig. 5 Node H propagates leader change
Example (cont’d…) (A, 0, 0, 0, 1, D) (A, -1, -1, 0, A) (A, 0, 0, 0, 2, E) (A, 0, 0, 0, 1, B) (A, 0, 0, 0, 3, F) Update (A, 0, 0, 0, 4, H) (A, 0, 0, 0, 5, G) fig. 6 Node G propagates leader change
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, l Nodes communicate with each other by message passing over unreliable communication channels, l No shared objects. l
Solution Approach l Solution Approach : Maintaining a token l l Node having the token enters critical section. Previous solutions l l l 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 Request. CS Release. CS Enter. CS Mutual Exclusion Process Link. UP Send(m) Recv(m) Network Link. Down
Notion of Height Each node maintains a 3 -tuple height – (h 1, h 2, i) l Heights for each node are distinct. The node identifier i achieves this. l Heights are compared lexicographically. l Links are logically considered to be directed from higher height node to lower hieght node. l Initially node 0 has (0, 0, 0) and heights for other nodes are initialized to form a DAG. l
Overview of Algorithm is event-driven, l Token-holder node enters the critical section, l The token holder ensures lowest height in the system, l Request for tokens from non-token holding nodes are directed towards the tokenholder. l
Data Structures Each node i maintains : l l l status N my. Height height[j], j ∈ N token. Holder l l l Next Q received. LI [j] Forming [j] form. Height [j]
Application requests or releases Application Process Request. CS Release. CS Mutual Exclusion Process Network
Request for CS Application Process I Q
Request for CS Application Process Request. CS I i Q
Request for CS Application Process Request. CS I token. Holder = False & |Qi| = 1 Forward. Request() i Q token. Holder = True Enter. CS
Release the CS Application Process I Q
Release the CS Application Process Release. CS I . . . Q
Release the CS Application Process Release. CS I . . . |Qi| > 0 Give. Token. To. Next() Q
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 Received. LI(j) = false Ignore Q Received. LI(j) = true 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 token. Holder = True & ∣Q∣ > 0 & status = Remainder Give. Token. To. Next()
Request (h) msg received Network Request (h) from j I j Q token. Holder = false no links outgoing token. Holder = True & ∣Q∣ > 0 & status = Remainder Give. Token. To. Next() Raise. Height()
Request (h) msg received Network Request (h) from j I j Q token. Holder = false token. Holder = True & ∣Q∣ > 0 & status = Remainder Q = [j] Forward. Request() no links outgoing Give. Token. To. Next() Raise. Height()
Token (h) message received Application Process Mutual Exclusion Process Recv(m) Network Token(h)
Token (h) msg received Token(h) J I Q
Token (h) msg received Token(h) J I Q token. Holder = True ; height[j] = h
Token (h) msg received J my. Height. h 1 = h. h 1 ; my. Height. h 2 - 1 I Q
Token (h) msg received J my. Height. h 1 = h. h 1 ; my. Height. h 2 - 1 I . . . . Link. Info() Q
Token (h) msg received J my. Height. h 1 = h. h 1 ; my. Height. h 2 - 1 I ∣Qi∣ = 0 nexti = i Q ∣Qi∣ > 0 Give. Token. To. Next()
Link. Info (h) message received Application Process Mutual Exclusion Process Recv(m) Network Link. Info(h)
Link. Info (h) recvd from j Network Link. Info(h) I
Link. Info (h) recvd from j Network Link. Info(h) I received. LI[j] = True height[j] = h
Link. Info (h) recvd from j Network Link. Info(h) I received. LI[j] = True height[j] = h received. LI[j] = True
Link. Info (h) recvd from j Network Link. Info(h) I forming[j] = false forming[j] is True and (my. Height ≠ form. Height[j]) Link. Info(my. Height) to j
Link. Info (h) recvd from j Network Link. Info(h) I no outgoing links and token. Holder = False height[j] = h
Link. Info (h) recvd from j Network Link. Info(h) I no outgoing links and token. Holder = False height[j] = h ∣Qi∣ > 0 and my. Height < height[next] Forward. Request()
Procedure Give. Token. To. Next I calls Give. Token. To. Next I x Q
Procedure Give. Token. To. Next I calls Give. Token. To. Next I next = x Q
Procedure Give. Token. To. Next I calls Give. Token. To. Next I next = x next = i Enter. CS Q
Procedure Give. Token. To. Next I calls Give. Token. To. Next I next = x next = i Q token. Holder = false; received. LI=F next ≠ i height[next] = (my. Height. h 1, my. Height. h 2 -1, next) Enter. CS Token (my. Height)
Procedure Give. Token. To. Next I calls Give. Token. To. Next I . . . |Qi| > 0 Request (my. Height) Q
Procedure Forward. Request () Called when a node i does not hold the token and a request message arrives at i. l Next is set to node i's lowest height neighbor i. e. next = l ∈ N : height[l] ≤ height[j], ∀ j ∈ N. l Send Request(my. Height) to next. l
Procedure Raise. Height() h 2 = m+1 h 1 = k+2 h 1 = k+1 h 1 = k h 2 = m
Procedure Raise. Height() h 2 = m+1 h 1 = k+2 h 1 = k+1 h 1 = k h 2 = m
Procedure Raise. Height() h 2 = m+1 h 1 = k+2 h 2 = m-1 h 1 = k+1 h 1 = k
Link Failures (link to j detected at i) Ni = Ni – {j} l Delete (Q, j) ; received. LI[j] = True; l If (not token. Holder) then If (no outgoing links) then Call. Raise. Height() Else. If (( |Qi| > 0 ) and (next ∉ Ni)) then Forward. Request () // If next has failed l send a request
Link formation Node i detects a new link to node j, l Send Link. Info(my. Height) to j, l Set forming[j] to True, l Set form. Height[j] to my. Height. l
Correctness Proof l To Prove : l l 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) l To prove no starvation After link changes cease, the system will reach a “good” configuration. l Variant function is applied to this “good” configuration to show that eventually the node will enter CS “Good configuration” = Token-Oriented DAG : If ∀ node i, i ∈ {0, . . , n-1}, ∃ a directed path originating at node i and terminating at token-holder. l l l
Proof Sketch Lemma 1 : In every configuration, a DAG is token oriented iff there are no sinks. (Definitioin 1: A node i is sink if (token. Holderi = false) and ((my. Heighti < heighti[j]), for all j ∈ Ni) + Lemma 2 : In every execution with a finite number of link changes, there are finite number of calls to Raise. Height (). ↓ 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 →. . → pj is a request chain. pj is either token-holder, or a Token messageis in transit to pj, or a Request message is in transit from pj to nextpj, or a Link. Info message is in transit from pj to nextpj Lemma 4: Once link changes and calls to Raise. Height() 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 Vl for l is defined to be a vector of integers <v 1, v 2, . . . > having m or m+1 elements such that v 1 is position of p 1 in Qp 1, and for 1 < j ≤ m, vj is the position of pj-1 in Qpj. If a request message is in transit then vm+1 = n+1. Lemma 5: Vl is a variant function; When Vl equals <1>, l enters CS. l V never has more than n entries. l l Request and Token messages decrease V l Theorem 2: When Vl equals <1>, 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 , 1981. [2] Vincent D. Park and M. Scott Corson, “A Highly Adaptive Distributed Routing Algorithm for Mobile Wireless Networks, ” Proc. IEEE INFOCOM, April 7 -11, 1997. [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 Dial. M papers, 2001. [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 ! gaurav@cpsc. ucalgary. ca madhukar@cpsc. ucalgary. ca
- Singhal heuristic algorithm
- Design fifo and non fifo execution
- Mutual exclusion.
- Suzuki kasami broadcast algorithm
- Pengertian mutual exclusion
- Mutual exclusion principle
- Dijkstra mutual exclusion algorithm
- Mutual exclusion in distributed systems
- Hirschberg sinclair algorithm
- What are wireless devices and the wireless revolution
- Transactional leadership
- Literature review problem statement example
- Systematic review definition
- What is the inclusion and exclusion criteria in research
- Exclusion crisis in absalom and achitophel
- State and explain pauli's exclusion principle
- Cobra election form sample
- Brainpop political parties
- The election of 1860 definition
- What measures were contained in the alien and sedition acts
- The election of 1800 showed that
- Lincolns election date
- Abraham lincoln's election
- Lincolns election
- British election study
- Election of 1852 apush
- Election day political cartoon
- 1796 election
- Maysville veto
- 1932 presidential election
- 1932 presidential election
- Machine selection
- Aqutium
- Higher modern studies voting behaviour essay
- Duties of polling officer in election 2014
- Thomas county election results
- Election duty certificate for teachers
- Economic protest parties definition
- George caleb bingham the county election
- Election process in the bahamas
- 1960 election
- John breckinridge opinion on slavery
- Which statement best describes apartheid
- Tn dams
- Clarity election night reporting
- What is the main idea?
- Esuchi
- Election of 1824
- Key club election questions
- Election of 1824
- Eci dashboard
- Election of 1896
- Dcrc full form in election
- Cfdt safran
- Arizona multistate service provider election
- Kontinuitetshantering i praktiken
- Novell typiska drag
- Nationell inriktning för artificiell intelligens
- Vad står k.r.å.k.a.n för
- Varför kallas perioden 1918-1939 för mellankrigstiden
- En lathund för arbete med kontinuitetshantering
- Särskild löneskatt för pensionskostnader
- Tidbok för yrkesförare
- A gastrica
- Densitet vatten
- Datorkunskap för nybörjare
- Tack för att ni lyssnade bild
- Hur skriver man en tes
- Delegerande ledarstil
- Nyckelkompetenser för livslångt lärande
- Påbyggnader för flakfordon
- Formel för lufttryck
- Svenskt ramverk för digital samverkan
- I gullregnens månad
- Presentera för publik crossboss
- Jiddisch
- Vem räknas som jude
- Treserva lathund
- Epiteltyper
- Bästa kameran för astrofoto
- Centrum för kunskap och säkerhet
- Lågenergihus nyproduktion
- Bra mat för unga idrottare
- Verktyg för automatisering av utbetalningar
- Rutin för avvikelsehantering
- Smärtskolan kunskap för livet
- Ministerstyre för och nackdelar
- Tack för att ni har lyssnat
- Hur ser ett referat ut
- Redogör för vad psykologi är
- Stål för stötfångarsystem
- Atmosfr
- Borra hål för knoppar
- Vilken grundregel finns det för tronföljden i sverige?
- Fr formel
- Tack för att ni har lyssnat
- Steg för steg rita
- Ledningssystem för verksamhetsinformation
- Tobinskatten för och nackdelar
- Toppslätskivling effekt
- Handledning reflektionsmodellen
- Egg för emanuel
- Elektronik för barn
- Mantel för kvinnor i antikens rom