440 likes | 577 Views
Efficient Algorithms for Leader Election in Radio Networks. Tomasz Jurdziński Mirosław Kutyłowski Jan Zatopiański. Adversary Immune Leader Election in Ad Hoc RN. Mirosław Kutyłowski Wojciech Rutkowski. Introduction. What are Radio networks? Why elect a leader? Who is the adversary?.
E N D
Efficient Algorithms for Leader Election in Radio Networks Tomasz Jurdziński Mirosław Kutyłowski Jan Zatopiański
Adversary Immune Leader Election in Ad Hoc RN Mirosław Kutyłowski Wojciech Rutkowski
Introduction What are Radio networks? Why elect a leader? Who is the adversary?
Radio Networks (RN) • Hand-held devices running on batteries with no central control. • The set of activated stations is unknown - the network has to organize itself • No infrastructure - useful in disaster-relief, law-enforcement, logistics, etc. • Crucial to design efficient algorithms for fundamental tasks.
RN Model • Stations are computers equipped with radio transceivers. The stations of a RN are identical and execute the same code • They work synchronously (GPS): We split the execution time into time slots, called steps • There is a single communication channel available to all stations
Collisions • During a step a station may either send (broadcast) a message or listen to the channel • If exactly one station sends, then all stations that listen at this moment receive the message sent • If at least two stations send, then a collision occurs • A collision is indistinguishable from the situation when no station is sending: no collision-detection (no-CD)
Messages • The size of the message sent by a station in one step is not limited. • If a station sends a message during step i and no other station is sending at this moment, then we say that the station succeeds and that step i is successful • An active station might be either awake or asleep: In the first case, a station sends a message or listens to the communication channel
Leader Election Problem • A RN network is given, such that each active station has no knowledge which stations are active (except itself). Initialize the network so that exactly one station gets status leader and the rest of the active stations receive the status nonleader.
Randomized Leader Election • Two kinds of randomized RN algorithms are considered: • Either The number of active stations is unknown, or • This number is known or can be approximated • The stations have no ID's or serial numbers - these have to be assigned during initialization process
Deterministic Leader Election • Station ID's are necessary for symmetry breaking • We assume The stations have unique ID numbers from the range [1...n] • An arbitrary number of ID's might be used by active stations
Complexity measures • There are two main complexity measures for RN algorithms: time complexity and energy cost • Time complexity is the number of steps executed • Energy cost is the maximum over all stations of the number of steps in which the station is awake • In the case of probabilistic algorithms we require that the prescribed energy or time bound is satisfied with high probability (1/n)
The Adversary • We cannot defend against an adversary which jams all communications • We assume that the adversary has energy capacity of O(logN) • But he knows our protocol, and will try to defeat it’s goals: • Have no leader elected • Have more than one leader elected
Example of leader election • The simplest leader election algorithm is used by Ethernet: with a certain probability each candidate sends a message (a trial). If a station sends a message and there is no collision, then it becomes the leader. The step is repeated until a leader is elected. • The adversary may: • Cause collisions all the time (block) • Pretend to win, than disappear (no leader)
Tree Leader Election Algorithm 1 2 3 4 5 6 7 8
Adversary Failing Leader Election X 1 2 3 4 5 6 7 8
Cryptographic Assumptions • We will assume that the adversary cannot hear our encrypted messages, and cannot participate in the algorithm. • It does know our protocol, and may try to damage it by interfering with communications at strategic instances
Resisting the Adversary • A participant becomes a sender or a receiver. It participates in d rounds: during a round a participant decides to be active with probability N-1, only one attempt • The round consists of 3 communication steps: • sender broadcasts a message, receiver listens • receiver repeats the message while sender listens • if sender gets its own message, it repeats it, while receiver is listening (collision detection)
Results • In case there was no collision we say that the pair of participants succeeds, and we assign to them the round number as a temporary ID • the initial selection is resistant against an adversary: since we assume that its energy capacity is O(logN), for a sufficiently large r = Θ(logN), the adversary can only reduce probability of success in a trial if r trials are performed.
Log* deterministic leader election for special cases
Sharing the Load • Large energy consumption occurs only at these stations that come close to being a leader, The worst one occurs for the leader. • In our algorithm the stations that loose, called slaves, take over the tasks of the stations that have won with them, their masters,and thereby reduce the number of steps in which they are awake • We assume that at the beginning each active station has 2/c (virtual)slaves
Initial Parameters • Our algorithm consists of O(log* n) stages. at the beginning of each stage i: • there are xistations called masters participating in the phase, some are rich, the rest are passive (nonexistent or with not enough slaves) • there are at least ci·xirich masters • each rich master has a group of at least si slaves – stations that serve this master
Stage Process • during stage i: • the masters are split into groups of size 2^si, every group of masters elects a leader that becomes a master for the next stage • after electing a leader in a group all other masters and slaves of the group become slaves of the leader; leaders with less than Si+1slaves become passive
Tree Leader Election Algorithmwith Slaves 1 2 3 4 5 6 7 8
Efficiency • Let x1 = n, s1 = 2/c, c1 = C, and the following condition be fulfilled for each i (may be except the last phase): ci+1 = ci/2 , xi+1 = xi/2^si , si+1 = ci+1 · si · 2^si • sigrows so that for i = O(log*n) we end up with a single group and perform the last phase. Energy cost is O(log*n), since each station is awake for O(1) steps during each phase. The execution time of the algorithm is O(n)
Sublogarithmic Leader Election for general cases
Initial State • A group of size n stations with unique IDs in the range [1..n] • The number of active stations among them is arbitrary • The parameter k (which is an increasing function k : N N) is responsible for divide and conquer feature of the algorithm and can be tuned separately
Algorithm Sn(k) – Phase 1 • The stations are split into groups of size k = k(n)based on the IDs of the stations. • During step i every active station of the group i sends a message: • no active stations in a group, nothing happens • one active station in a group, it can hear its own message • at least two active stations, they recognize that their messages have been scrambled
Algorithm Sn(k) – Phase 2 • In the groups, where there was one active station, the only active station is a leader. These leaders wait until phase 4.
Algorithm Sn(k) – Phase 3 • Each group of size k(n), which during phase 1 had more than one active station, runs recursively algorithm Sk(n)(k) • When it is finished, then each leader elected has a slave that is used in Phase 4 for reducing the energy cost of its master by half.
Algorithm Sn(k) – Phase 4 • A leader is elected from the leaders of Phases 2 and 3, by an execution of Sn/k(n)(k)(with IDs equal to the numbers of the groups to which appropriate leaders belong)
Efficiancy • The energy cost of the algorithm S satisfies the following relation: E(Sn(k))= O(1)+max{ E(Sn/k(n)(k)), E(Sk(n)(k)) + ½E(Sn/k(n)(k)) } • Let t N and δ = 2-t. For a parameter k(n) = nδwe can check that a solution to this relation satisfies E(Sn(k)) = 0((logn)-t)
Fast randomized leader election Logarithmic time, high probability, log* energy cost
Two Phases • there are k trial steps: in each one, each station that has not sent a message yet decides to send with probability 1/n • Only the stations that have succeeded during trial steps participate in the second phase of the algorithm. Each of them has a temporary ID, which is the number of a trial step during which it succeeded • During this phase, the stations execute the first algorithm
Efficiency • Each station is awake for O(1) steps during the first phase and O(log*n) steps during the second phase: energy cost is O(log* n) • The algorithm may fail to elect a leader if the number of stations that participate in the second phase is too small
Probability of Success • The probability that some station succeeds during the each trial step equals: N·1/n·(1 – 1/n)N-1 N·(1 – 1/N)max(N,n) = Θ(1) • Based on Chernoff Bounds, the number of successes is Θ(k) with probability at least 1 – 1/n
Adversary Resistant Leader Election for a cryptographically safe network
Preprocessing • Initial selection seen earlier is executed for d = v·k turns, where v = Θ(logN) and k = O(logN) • If a round j of initial selection succeeds, then the stations chosen are denoted by Pj and P'j • The station Pj is a candidate for the leader in our algorithm, P'j is required for auxiliary purposes. • Each of the v groups has Θ(logN) pairs of stations (high probability)
Building Chains • Current Agent tries to contact the next one • If Current Agent succeeds, the next station becomes the Current Agent • Otherwise it keeps trying, until energy runs low • If there is no active Agent - the first active pair becomes Current Agent and starts a new chain.
Building Comunication • We use communication slots to hinder the Adversary • Pa and P’a are the agents, trying to communicate with Pj and P’j • The agent Pa of the current chain transmits the string encoding status of the current chain • P’a repeats the previous message • Pj acknowledges that it exists • P’j repeats the previous message of Pj
Messages Get Scrambled • 1st or 2nd: Padoes not receive its message back, Pj, P’jare aware that either there was no agent or at least one message was scrambled. Pjstarts a new chain. Paterminates the current chain • 3rd: Pjdoes not receive its own message, Pjand P’jare aware of the attack. Pjand P’j “commit suicide” • 4th: Pjbehaves the same, P’jwill never hear its partner, so will never respond with a message
Merging Chains • We begin to group the Chains to longer chains, while spreading information about active stations • Once a large enough Chain is collected, it prevents other chains from uniting by "interfering" in reserved positions • The one large group elects a leader
The adversary • Must guess the transmission slots • IDs are hashed and rotated • Cannot stop all candidates • Must keep guessing correctly at second stage to cause real damage • Almost impossible to prevent the success of the internal attack
Thank You Ran Arad