An Efficient Leader Election Protocol for Wireless ... - Semantic Scholar

2 downloads 133 Views 166KB Size Report
the first leader election algorithm that takes advantage of a mesh topology and elects a unique leader in a wireless mesh network with a high mobility of mesh ...
This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the ICC 2007 proceedings.

An Efficient Leader Election Protocol for Wireless Quasi-Static Mesh Networks: Proof of Correctness ∗ Azzedine Boukerche Kaouther Abrougui SITE university of Ottawa Email:{boukerch,abrougui}@site.uottawa.ca

Abstract— In this paper, a leader election algorithm for wireless quasi-static mesh network is provided. Our mesh network consists of fixed mesh routers and mobile mesh clients. Our protocol performs well under a high mobility of mesh clients. The main particularity of our protocol is that it takes advantages of the wireless mesh network topology in order to elect a unique leader. It is based on the construction of a spanning tree that includes all static wireless mesh routers. Our protocol elects the node with the highest remaining battery life. It requires less time and messages for the election of a leader than the execution of a Kurose et al. algorithm in a mesh topology (3 × h units of time and O(3 × x × nR) messages for our algorithm, versus T = 3 × x × h units of time and O(4 × x2 × nR) messages in Kurose et al. algorithm).

I. I NTRODUCTION In this paper, we present a leader election algorithm for wireless mesh networks. Our algorithm works under frequent network changes and mesh client mobility. Our algorithm consists of the construction of a spanning tree that includes all mesh routers. It elects the mesh client with the highest battery life, and maintains a unique leader in the mesh network. The leader election problem has been well studied in literature. To the best of our knowledge, this is the first leader election algorithm that takes advantage of a mesh topology and elects a unique leader in a wireless mesh network with a high mobility of mesh clients. In literature, multi-radio, multi-hop wireless mesh networks have been considered in order to resolve routing problems [11]. Besides, many approaches have been considered in order to elect a leader in a network. Leader election is a fundamental control problem in ad hoc networks and a variety of applications such as sensor coordination [23], routing coordination [14], key distribution [21], etc... need a leader to be elected. Some leader election protocols for static networks have been proposed in [13], [19]. Other protocols dealing with clustering and hierarchyconstruction have been presented in [6], [16]. Some algorithms for mobile ad hoc networks have been proposed in [15], [18], [22]. In the following we provide our solution for leader election in a wireless quasi-static mesh network, where some nodes designated as mesh routers are static and other nodes designated as mesh clients are mobile. Our proposed protocol takes advantages of the wireless mesh network topology in order to elect a unique leader. It performs well under the high mobility of mesh clients. It is based on the construction of a spanning tree that includes all the static wireless mesh routers. Our protocol elects the node with the highest remaining battery life. It requires less time and messages for the election of a leader than the execution of a Kurose et al. algorithm [22] in a mesh topology (3 × h units of time and O(3 × x × nR) messages for our algorithm, versus T = 3 × x × h units of time and O(4 × x2 × nR) messages in

* This work is partially supported by Canada Research Chair (CRC) Program, NSERC, Ontario Distinguished Researcher Award (ODRA/OIT), Early Career Research Award, Canada Foundation for Innovation.

[22]). The remainder of this paper is organized as follows. In section 2, we discuss the state of the art in clustering and leader election. In section 3, we present a detailed description of this algorithm. Section 4 proposes a formal description of the algorithm. Section 5 compares our algorithm with the Kurose et al. algorithm [22]. The last section contains our conclusions.

II. R ELATED W ORKS The leader election problem has been well studied in literature [3], [4], [12], [13], [16], [19]. Many protocols have been proposed in order to solve the problem of electing a unique leader in a cluster. The purpose of electing a leader in an interconnected network is to permit the control of the network by a unique node in order to perform a specific action or activity with the other members of the network. Many protocols have resolved this problem but they are restricted to wired networks and cannot work under high node mobility and recurring changes of the network topology. Only a few of the proposed algorithms can be applied to mobile ad hoc networks. In the following, we provide a basic classification of leader election protocols. In [13], [19], leader election protocols have been presented for static networks. In these algorithms, several spanning trees are established. Then, these spanning trees are reduced to a unique spanning tree and the root is considered the leader. These algorithms were designed for static networks and thus cannot be applied to mobile networks. In [4], [6], [12], [16], [20], some protocols dealing with clustering and hierarchy-construction have been provided. These algorithms can be applied to solve the leader election problem. Unfortunately, these schemes do not suit mobile networks and asynchronous systems because they assume static networks and apply to synchronous systems. In [3], [8], leader election protocols designed for wired networks have been provided. The basic particularity of these schemes is that they take on the consideration link failures and node crashes. Thus, these algorithms can be applied to mobile networks since a detected partition can be treated the same way link failures or node crashes are treated. In [2], [5], [10], leader election algorithms dealing with self-stabilizing spanning trees have been proposed. These schemes take advantage of the self-stabilizing systems’ domain [9] in which the system reaches a global stable state from any arbitrary global state in a finite time. In [1], [17], clustering algorithms have been proposed for mobile networks. These protocols elect cluster-heads in their single hop. In [15], [18], [22], some algorithms for mobile ad hoc networks have been proposed. These algorithms can be classified either in the extrema-finding category or the non-extrema-finding category of algorithms. We will use the algorithm in [22] in order to do our comparisons and prove the performance of our algorithm.

III. L EADER E LECTION IN A WIRELESS M ESH N ETWORK System model: We consider a mesh network composed of mesh routers and mesh clients. In this network, mesh routers form a static topology, whereas mesh clients are completely dynamic and can appear and disappear in any of the ranges of static mesh routers.

1-4244-0353-7/07/$25.00 ©2007 IEEE

This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the ICC 2007 proceedings.

The purpose of the algorithm is to elect the mesh client that has the maximum remaining battery life. Description of the protocol at the mesh routers: In the following, we describe our leader election protocol in the wireless mesh network. In our system model, mesh routers are considered static and do not move in the network. In order to take advantage of this static topology, a spanning tree is constructed. This latter includes all mesh routers that are connected in the mesh network. Mesh routers belonging to the same mesh network advertise themselves with a unique identifier. The leader election algorithm is initiated for the first time by a mesh client M C (Step H3). When a mesh client joins the mesh network, it sends a subscription message (subscription msg(ID)) that carries its identifier to mesh routers adverting themselves. When a mesh router M R receives the (subscription msg(ID)) (Case G), it checks through the boolean variable election whether the election process has started in the mesh network yet. If the election process has not started yet, the mesh router M R checks through the boolean variable ST whether the static spanning tree has been constructed yet. If it has not, the mesh router M R initiates the construction of the spanning tree and the boolean variable ST is set to T rue. If the static spanning tree is constructed already but the election has not started yet, then the mesh client holding the identifier ID has to wait for future events at the beginning of the election process. But if the election process has started already, meaning that the mesh router has already broadcast the election message in its range and has received the reply messages from the mesh clients in its range, a new election message is sent especially to the subscribing mesh client. The election message is sent for two main purposes. First, it is sent to the mesh client to inform it about the current leader of the mesh network if a leader has been elected already. Second, it is sent in order to be able to collect the information regarding the battery life of the subscribing M C and to propagate it if this value is the best value that has been seen so far. When the static spanning tree is constructed and its root is identified (Case A), the mesh routers are ready to start the election process. Each mesh router M R initializes its local variables which are election, candSend, leader and leaderBat. The variable election is set to true in order to state the beginning of the election process. The variable candSend is initialized to F alse and it states that the current mesh router M R has not yet sent a candidate message (candidate msg). The variables leader and leaderBat are initialized to null and are used to store respectively the identifier of the leader of the network and the value of its battery life. An election message election msg(leader) is then broadcast by each mesh router in its range. It carries the values of the variables leader and leaderBat and is intercepted by mesh clients in the range of the mesh router M R. When a mesh router M R receives a reply message reply msg(recID, recBat) from a mesh client M C (Case B), it stores the information received from this message in the array vecBat for future use. M R checks whether a candidate message has been sent so far through the boolean variable candSent. If not, but the mesh router has received all reply messages from mesh clients in its range, then it selects from the array vecBat the mesh client with the maximum remaining battery life and stores this value and the identifier of its correspondent mesh client respectively in the variables bestBat and IdBestBat. Then, if this mesh router is a leaf in the static spanning tree, it sends a candidate message carrying the values bestBat and IdBestBat, and sets candSent to T rue. However, if M R has already sent a candidate message in the past, and it receives a reply message after its decision is made, it checks whether the new value of the battery life received in the reply message outperforms the previously selected one. If yes, bestBat and IdBestBat are updated with the new received values and a new candidate message is generated and sent to the parent of M R in the static spanning tree. With this process, we guarantee that the elected leader is always the mesh client with the maximum remaining battery life.

When a mesh router M R receives a candidate message candidate msg(recIdBestBat, recBestBat) (case C) from one of its children in the static spanning tree, it checks whether the received value of the battery life is better that the previously considered one. In this case, it updates the variables bestBat and IdBestBat with the new received values and checks whether it has sent a candidate message already through the boolean variable candSent. If a candidate message has already been sent and the current mesh router is not the root of the static spanning tree, then a candidate message carrying the new values of idBestBat and bestBat is sent to the parent of the current mesh router. However, if the current mesh router is the root of the static spanning tree, a new leader message carrying the new information is sent to the mesh clients in the range of the mesh router and to its children. In case a candidate message has not yet been sent (candSent = f alse) and the current mesh router has received all the candidate messages from its children, a candidate message is generated and is sent to the parent of the current mesh router if it is not the root of the static spanning tree. In case the current mesh router is the root, a leader message is sent to mesh clients and to the children of the mesh router. At this stage, candSent is set to T rue to state that a candidate message has been sent by the current mesh router if it is not the root, or that a leader message has been sent in the other case. When a mesh router receives a leader message leader msg(recIdBestBat, recBestBat) (Case D), it updates the variables leader and leaderBat respectively with recIdBestBat and recBestBat. Then, it forwards the leader message to its mesh clients and to its children in the static spanning tree. When a non root mesh router receives the heartbeat message I am here msg(leaderID) (Case E), it forwards it to the root of the static spanning tree. If the mesh router does not receive any heartbeat message after a period of time p, it concludes that the current leader does not exist anymore and that the process of electing a new leader has to be initiated. Consequently, the root of the spanning tree sends an initiate msg to its children in the static spanning tree and starts the election process again (Go to Step A1). When mesh routers intercept the initiation message initiate msg() (Case F), the initiation process is restarted from Step A1. Description of the protocol at the mesh clients: The mesh clients are mobile nodes that can appear and disappear in the ranges of mesh routers in a mesh network. Initially (Case H), mesh clients listen to advertisements from mesh routers to which they can subscribe by sending a subscription message subscribe msg(ID) to those in their ranges. When a mesh client receives an election message election msg(recLeader, recLeaderBat) (Case I), it checks whether the carried information is not null, which means that a leader has already been elected. In this case, it sets its variables leader and leaderBat respectively to recleader and recleaderBat. Whether or not a leader has been elected yet, the mesh client sends a reply message carrying the value of its remaining battery life to the mesh routers from which it has received an election message. This process guarantees that the elected leader is the mesh router that outperforms all he other clients in the mesh network. When a mesh client receives a leader message leader msg(recIdBestBat, recBestBat) (Case J), it updates its variable leader and leaderBat with the received information. In addition, the current mesh router checks whether the identifier of the elected leader corresponds to its identifier. In this case, it sets itself as a leader, and starts sending periodically heartbeat messages (I am here msg()) to mesh routers in its range. This way, we guarantee that if the current leader has moved out from the current mesh network, a new leader election process is initiated and a new leader is elected.

A. Formal Description of the Algorithm In the following, we provide a formal description of our algorithm. We first explain the variables that are used in our algorithm, then we describe the messages used. Finally, we provide the pseudo-code

This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the ICC 2007 proceedings.

of our algorithm. Description of variables: The following table tion of each variable Variable M Ri M Ci rangei candSent

election

ST vecBatj []

bestBati IdBestBatj p

leader leaderBat

provides used in

the our

significaprotocol.

Description to identify a mesh router i to identify a mesh client i to identify the range of the mesh node i a boolean variable. It is True if a candidate message has been sent by the current MR and False otherwise. a boolean variable. It is True if the election process has started in the wireless mesh network and False otherwise. a boolean variable. It is True if the static spanning tree is constructed and False otherwise. to identify a vector or also an array that stores all the values of the battery lives received in the reply messages from the mesh clients. to store the value of the best remaining battery life among the mesh clients in the range of the mesh router i to store the identifier of the mesh client with the best value of the battery. refers to the waiting period needed to conclude that the current leader is not connected anymore to its mesh router in the mesh network. to store the identifier of the elected leader. to store the value of the battery of the elected leader.

Description of messages: The following table lists all the messages used in our protocol. message election msg(leader, leaderBat) reply msg(ID, Bat) candidate msg (IdBestBatj , bestBatj ) leader msg(id, bat, conn) subscribe msg(ID) I am here msg() initiate msg() •







• • •

Description refers to an election message. refers to a reply message. refers to a candidate message. refers refers refers refers

to to to to

a leader message. a subscription message. an I am here message. an initiation message.

election msg(leader, leaderBat): It is sent by a mesh router in order to elect a leader in the mesh network. It carries the identifier of the leader and the value of its battery. reply msg(ID, Bat): It is sent by a mesh client to the mesh router from which an election message has been received. It carries as its first parameter the identifier of the current mesh client and as its second parameter the value of its remaining battery life. candidate msg(IdBestBatj , bestBatj ): It is sent by a leaf mesh router when it receives all the reply messages from mesh clients in its range. Or, it is sent by an intermediate mesh router when it receives all the candidate messages from its children in the static spanning tree. It carries the identifier of the mesh client having the maximum remaining battery life as well as the value of the battery life. leader msg(id, bat, conn): A leader message is initially sent by the root of the static spanning tree when it receives all the candidate messages from its children. It carries the identifier of the mesh client having the maximum battery life, the value of this battery life, and the boolean variable conn. This message is used to inform the mesh nodes about the elected leader for the mesh network. subscribe msg(ID): It is sent by a mesh client when it joins the mesh network. I am here msg(): It is sent periodically by the elected leader. initiate msg(): It is used when a mesh router decides to initi-

ate a new leader election in the mesh network. It is propagated only in the static spanning tree. Pseudo-code: We now formally describe the algorithm by means of a pseudo-code: Algorithm at the static mesh routers: Preconditions: The mesh routers belonging to the same mesh network are advertising themselves for possible subscriptions of mesh clients. election ← F alse ST ← F alse Case A. The static spanning tree is constructed and its root is determined: Step A1. Initialize local variables election ← T rue candSent ← F alse leader ← null leadeBat ← null Step A2. Broadcast an election msg(leader, leaderBat) to mesh clients M Cs in rangei of M Ri . Case B. Reception of reply msg(recID, recBat) at M Rj : Step B1: Store (recID, recBat) in vecBatj [] Step B2: If not(candSent) Then If M Rj has received reply msg() from all M Cs in rangej Then bestBatj ← M ax(vecBatj []) IdBestBatj ← IdOf (bestBatj ) If isLeaf (M Rj ) Then Send candidate msg(IdBestBatj , bestBatj ) to P arent(M Rj ) candSent ← T rue End If End If Else If isBetter((recBat, recId), ((bestBatj , IdBestBatj ))) Then bestBatj ← recBat IdBestBatj ← recId Send candidate msg(IdBestBatj , bestBatj ) to P arent(M Rj ) End If Case C. Reception of candidate msg(recIdBestBatj , recBestBatj ) from M Rj at M Ri Step C1. If isBetter((recBestBatj , recIdBestBatj ), ((bestBati , IdBestBati ))) Then IdBestBati ← recIdBestBatj bestBati ← recBestBatj If candSent Then If not(isRoot(M Ri )) Then Send candidate msg(IdBestBati , bestBati ) to P arent(M Ri ) Else Send leader msg(IdBestBati , bestBati , conn) to all M Rs and M Cs in rangei End If Exit(Case C) End If End If Step C2. If M Ri has received all candidate msg() from children(M Ri ) Then If not(isRoot(M Ri )) Then Send candidate msg(IdBestBati , bestBati ) to P arent(M Ri ) Else Send leader msg(IdBestBati , bestBati , conn) to all M Rs and M Cs in rangei End If candSent ← T rue End If Case D. Reception of leader msg(recIdBestBat, recBestBat) at M Ri Step D1: leader ← recIdBestBat Step D2: leaderBat ← recBestBat Step D3. Send leader msg(recIdBestBat, recBestBat) to childrenOf (M Ri ) and to M Cs Case E. Reception of I am here msg(leaderID) at M Ri Step E1: If not(isRoot(M Ri )) Then Forward I am here msg() to the root of the static ST . Else If there is no I am here msg() after p Then Send initiate msg() to Children(M Ri ) Go to Step A1.

This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the ICC 2007 proceedings.

End If Case F. Reception of initiate msg() Step F1: Go to Step A1. Case G. Reception of subscribe msg(ID) Step G1: If election = T rue Then Send election msg(leader, leaderBat) Else If ST = F alse Then start constructing the ST ST ← T rue End If End If Algorithm at the dynamic mesh clients: Case H. Initially: Step H1. leader ← null. Step H2. leaderBat ← null. Step H3. Broadcast subscribe msg(ID). Case I. Reception of election msg(recLeader, recLeaderBat) from M Ri : Step I1. If recLeader = null Then leader ← recLeader leaderBat ← recLeaderBat End If Step I2. Send reply msg(curID, curBat) to M Ri Case J. Reception of leader msg(recIdBestBat, recBestBat) from M Ri : Step J1: leader ← recIdBestBat Step J2: leaderBat ← recBestBat Step J3: If recIdBestBat == ID and recBestBat == bat Then become Leader Periodically Send I am here msg() to M Ri End If

IV. M ESSAGE AND TIME COMPLEXITIES In the following section, we compute the message and time complexities of our leader election algorithm in the wireless mesh network. Our algorithm goes through four main phases in order to elect the unique leader of the mesh network: 1) Subscription of mesh clients: At this stage, mobile wireless mesh clients listen to advertisements from mesh routers in the mesh network and subscribe themselves to mesh routers in their ranges. Thus, only subscription messages subscribe msg are counted at this stage. The subscription messages are closely related to the subscribing mesh clients. A subscription message needs only one unit of time to reach a mesh router. 2) Construction of the static spanning tree: This step is performed only once at the beginning of the election process. It helps to build a static spanning tree that includes all mesh routers in the considered mesh network. The static spanning tree that is built helps a lot in electing a leader. The message and time complexities needed for building the spanning tree are computed and counted only once. 3) Election of the leader: The leader of our wireless mesh network is the mesh client with the maximum remaining battery life. The number of messages needed to perform this election is: NM = numberOf (election msg) + numberOf (reply msg) + numberOf (candidate msg) + numberOf (leader msg) The time needed to perform this phase is the number of units of time elapsed from the beginning of the election process by sending the first election message until each mesh client in the mesh network knows the leader. 4) Maintenance: At the maintenance phase, the leader of the mesh network has to inform the root of the static spanning tree about its existence through I am here msg() messages, otherwise a new election process is launched through initiation messages initiate msg(). Thus, the number of messages and units of time at this stage will vary depending on the frequency of changes in the mesh network and the movement of the wireless

mesh clients: M essagecomplexity = numberOf (I am here msg) + numberOf (initiate msg). The time complexity of this phase is the number of units of time needed to notify the root of the spanning tree about the presence of the leader or to initiate a new election.

A. Message Complexity: The election phase is the most important step in determining the leader of the mesh network. Given the following notations, the message complexity is established in Theorem 1 which is preceded by Lemmas 1, 2, 3 and 4. • nR: an integer variable that provides the number of mesh routers in the mesh network. • nC: an integer variable that provides the number of mesh clients in the mesh network. • nCRi : an integer variable that stores the number of mesh clients in the range of a mesh router i. • mR: an integer variable that stores the number of wireless links between routers. Lemma 1: The number of election messages election msg() in our protocol is provided in the following equation. number of (election msg) =

nR 

nCRi

(1)

i=1

Proof: It is the number of messages sent by mesh routers to mesh clients in their ranges at the beginning of the election process. Lemma 2: The number of reply messages reply msg() in our protocol is computed in the following equation. number of (reply msg) =

nR 

nCRi

(2)

i=1

Proof: It is the number of messages sent by mesh clients in response to the received election messages. It is equal to the number of election messages.

Lemma 3: The number of candidate messages candidate msg() in our protocol is computed in the following equation. number of (candidate msg) = nR − 1 (3) Proof: It is the number of messages sent by the mesh routers through the static spanning tree. Lemma 4: The number of leader messages leader msg() in our protocol is computed in the following equation. number of (leader msg) = (nR − 1) +

nR 

nCRi

(4)

i=1

Proof: It is the number of messages sent by mesh routers to their children in the static spanning tree and to the mesh clients in their ranges. Theorem 1: Given a particular mesh network, then the total number of messages exchanged during the election phase is given as follow. total number = (3 × x + 2) × nR − 2 (5) Proof: The total number of messages required to perform the election phase of the algorithm is derived from Lemmas 1, 2, 3 and 4: total number = 3 ×

nR 

nCRi + 2 × nR − 2

(6)

i=1

If we suppose that the average number of wireless mesh clients per mesh nR router is x, nCRi will be equal to x × nR. Consequently, equation i=1 6 can be simplified into the following equation:

Or

total number = 3 × x × nR + 2 × nR − 2

(7)

total number = (3 × x + 2) × nR − 2

(8)

This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the ICC 2007 proceedings.

B. Time Complexity: The time complexity is the total number of units of time needed to elect a leader in the mesh network. Given the following notations, the time complexity is established in Theorem 2 which is preceded by Lemmas 5, 6, 7 and 8. • h: an integer that stores the height of the static spanning tree. • u: represents a unit of time. Lemma 5: The number of units of time needed in our protocol for the propagation of election messages election msg() is computed in the following equation. T (election msg) = h.u (9) Proof: The time needed for the election messages is equal to the number of units u needed from the time that the first election message is sent by the root of the static spanning tree to a mesh client until the farthest leaf of the spanning tree sends an election msg in its range. This number is equal to the height of the static spanning tree. Lemma 6: The number of units of time needed in our protocol for the propagation of reply messages reply msg() is computed in the following equation. T (reply msg) = 1.u (10) Proof: Only one unit of time is needed by a mesh client to send a reply message to a mesh router in its range. Lemma 7: The number of units of time needed in our protocol for the propagation of candidate messages candidate msg() is computed in the following equation. T (candidate msg) = (h − 1).u (11) Proof: The time needed for the propagation of a candidate message is equal to the number of units of time needed to propagate a candidate msg() from the farthest leaf of the static spanning tree to the root. Lemma 8: The number of units of time needed in our protocol for the propagation of leader messages leader msg() is computed in the following equation. T (leader msg) = h.u (12) Proof: The time needed for the propagation of a leader msg() is equal to the number of units of time needed from the time that the election message is sent from the root of the spanning tree until it reaches the farthest leaf and is propagated to the mesh clients of this leaf. Theorem 2: Given a particular mesh network, then the total number of units of time needed to elect a leader and to announce the result to other mesh nodes is computed as follow. T (total) = 3 × h.u (13) Proof: The total number of units of time needed in order to perform the election phase of the algorithm is derived from Lemmas 5, 6, 7 and 8.

V. P ROOF OF C ORRECTNESS : In this section, we present the correctness of our leader election algorithm. The correctness is established in Theorems 3 and 4, the intent of which is to establish that the algorithm elects a unique leader and terminates without deadlocks. Theorem 3: Our algorithm ensures that each mesh node has exactly one unique leader. Proof: We want to prove that our protocol elects one and only one leader. In fact, the election process is started in Step A2 at a mesh router by broadcasting election messages to mesh clients in its range. Each mesh client replies back to the mesh router by a reply message (Step I2) carrying the value of its battery life. When a leaf in the static spanning tree receives all the reply messages from mesh clients in its range, it sends a candidate message to its parent (Step B2) carrying the information regarding the mesh client with highest battery life. In case two mesh clients have the same values for battery life, their identifiers are used to break ties. The mesh client with the minimum identifier is considered better than the one with higher identifier. Consequently, we are sure that a unique mesh client

is considered in the candidate messages. When an intermediate mesh router receives all candidate messages from its children (Step C2), it sends a candidate message to its parent carrying the information of the best valuated mesh client that has been seen so far. Thus, the root of the static spanning tree intercepts candidate messages from its children in which each candidate message carries information regarding the mesh client with the maximum battery life in one of the subtrees of the static spanning tree. Consequently, the root of the spanning tree will have the ultimate decision to select the mesh client having the highest battery life before broadcasting an election message to mesh clients in its range to inform them about the elected leader. In addition, the election message is forwarded in the static spanning tree in order to inform the intermediate and the leaf nodes of the spanning tree. When these nodes receive the leader message (Case D), they send it to mesh clients in their ranges in order to inform them about the elected leader. This way, we guarantee that only one leader is elected since we have only one root of the static spanning tree, and it is the only node that can make a decision regarding the election of the leader. The elected leader starts sending I am here messages in its range (Step J3). These messages are intercepted by mesh routers and are forwarded to the root of the static spanning tree (Case E). If the root does not hear any I am here msg() during a period of time p, it launches a new election process by propagating an initiation message in the static spanning tree initiate msg(). At the reception of this message (Case F), each router initializes its local variables and starts a new election process. This way, we guarantee that our protocol detects the departure of the leader, and launches a new election process when it is needed. Thus, a unique leader is always elected by our protocol. Theorem 4: Our algorithm ensures the avoidance of deadlocks and terminates in the election of a unique leader. Proof: We want to prove that our leader election protocol terminates in electing a leader and does not lead to the creation of cycles or deadlocks. In this protocol, deadlocks can hardly happen because mesh clients are managed by mesh routers, which are connected through a spanning tree and rooted by a unique root. On the other hand, mesh clients communicate directly to their mesh routers. As we proved previously that the protocol succeeds in electing a unique leader, we can conclude that our protocol always terminates and is stabilized when a leader is elected.

VI. L EADER E LECTION F OR M OBILE A D H OC N ETWORKS , VASUDEVAN -K UROSE -T OWSLEY: A C OMPARISON In this section, we provide a comparison of our algorithm with the Kurose et al. algorithm [22]. We first provide the message and time complexity equations of Kurose et al. algorithm general, and then we apply them to our mesh topology. There are more details of the computation of the message and the time complexities in [7]. We assume that: • n stores the total number of nodes in the network. • m stores the total number of links in the network. • h stores the height of the spanning tree relatively to the initiator. Theorem 5: The message-Overhead of the Kurose et al. leader election algorithm is provided in the following equation: 4×m−n+1 (14) Theorem 6: The time complexity of the Kurose et al. leader election algorithm is provided in the following equation: (3 × h + 2).u (15) A comparison with our algorithm: In the following, we provide a comparison of our algorithm with the Kurose et al. algorithm [22]. First, we transform the number of links m and the number of nodes n in terms of the number of mesh routers nR. This way, we can obviously make our comparisons. Then, we adapt the Kurose et

This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the ICC 2007 proceedings.

al. algorithm to the wireless quasi-static mesh network. Finally, we discuss the results. 1) Expression of n in terms of nR: n includes the number of mesh routers nR as well as the number of mesh clients nC. Since we have assumed that every mesh router has in average x mesh clients, nC is equal to x × nR. Consequently, n = nR + x × nR, which is equivalent to nR(1 + x). 2) Expression of m in terms of nR: m includes first the number of links between mesh routers, second the number of links between mesh clients and their correspondent mesh routers, and third, the number of links between mesh clients. Let us suppose that every mesh router is connected to d mesh routers. Thus the number of links between mesh routers is equal to (nR × d) ÷ 2. The number of links between mesh routers and mesh clients is nR×nCR, where nCR is the average number of mesh clients connected to every mesh router which is x. Thus nR × nCR is equivalent to nR × x The number of links between mesh clients is nR × x × (x − 1), because all mesh clients in the range of every mesh router M R are connected to each other. Consequently m = (nR × d) ÷ 2 + nR × x + nR × x × (x − 1) which is equivalent to nR × (x2 + d ÷ 2) 3) Expression of the height of the Kurose et al. algorithm spanning tree H in terms of the height of our constructed spanning tree h: In the worst case, H = x × h, where x is the average number of mesh clients in the range of a mesh router. 4) The message-Overhead of the Kurose et al. leader election algorithm when applied to our mesh topology is: 4 × nR × (x2 + d ÷ 2) − nR(1 + x) + 1

(16)

which is equivalent to 4 × x2 × nR − x × nR + 2 × d × nR − nR + 1 Thus

O(4 × x2 × nR)

(17) (18)

5) The time complexity of the Kurose et al. leader election algorithm when applied to our mesh topology is knowing that H is the height of the Kurose et al. spanning tree and that h is the height of our spanning tree: (3 × H + 2).u

(19)

(3 × x × h + 2).u

(20)

O(3 × x × h)

(21)

Which is equivalent to: Thus

6) Discussion: The number of mesh clients per mesh router x has an important impact on the Kurose et al. algorithm. In fact, the bigger this number is, the larger is the overhead in the mesh network since M is O(4 × x2 × nR) whereas M is only O(3 × x × nR) in our algorithm. Moreover, the higher the value of x, the slower is the time to elect a leader in the Kurose et al. algorithm. In fact, T is3 × x × h in the latter algorithm, whereas it is only 3 × h in our algorithm where it does not depend at all on x.

VII. C ONCLUSION The leader election problem is a very important problem that has been well studied in literature. However, most solutions are applied only in fixed networks and can not be applied to mobile networks. In this paper, we presented a design for a leader election protocol that supports mobile networks and works well under the recurring changes of the network topology. In our algorithm we have taken advantage of the characteristics of a mesh network. We have shown that our algorithm requires less time and messages for the election of a leader than the execution of the Kurose et al. algorithm [22] in a mesh topology (3 × h units of time and O(3 × x × nR) messages for our algorithm, versus T = 3×x×h units of time and O(4×x2 ×nR) messages in [22]). For future works, we plan to enhance our protocol with fault tolerance features, to tolerate static mesh router failures.

R EFERENCES [1] A Mobility Based Metric for Clustering in Mobile Ad Hoc Networks. IEEE Computer Society, Washington, DC, USA, 2001. [2] Yehuda Afek, Shey Kutten, and Moti Yung. The local detection paradigm and its applications to self-stabilization. Theor. Comput. Sci., 186(1-2):199–229, 1997. [3] Marcos Kawazoe Aguilera, Carole Delporte-Gallet, Hugues Fauconnier, and Sam Toueg. Stable leader election. In DISC ’01: Proceedings of the 15th International Conference on Distributed Computing, pages 108–122, London, UK, 2001. Springer-Verlag. [4] Alan D. Amis, Ravi Prakash, Dung Huynh, and Thai Vuong. Max-min d-cluster formation in wireless ad hoc networks. In INFOCOM (1), pages 32–41, 2000. [5] A. Arora and M. Gouda. Distributed reset. IEEE Trans. Comput., 43(9):1026–1038, 1994. [6] Suman Banerjee and Samir Khuller. A clustering scheme for hierarchical control in multi-hop wireless networks. In INFOCOM, pages 1028– 1037, 2001. [7] Azzedine Boukerche. Handbook of algorithms for wireless networking and mobile computing, chapman & hall/crc. 2006. [8] Jacob Brunekreef, Joost-Pieter Katoen, Ron Koymans, and Sjouke Mauw. Design and analysis of dynamic leader election protocols in broadcast networks. Distributed Computing, 9(4):157–171, 1996. [9] Edsger W. Dijkstra. Self-stabilizing systems in spite of distributed control. Commun. ACM, 17(11):643–644, 1974. [10] Shlomi Dolev, Amos Israeli, and Shlomo Moran. Uniform dynamic selfstabilizing leader election. IEEE Trans. Parallel Distrib. Syst., 8(4):424– 440, 1997. [11] Richard Draves, Jitendra Padhye, and Brian Zill. Routing in multiradio, multi-hop wireless mesh networks. In MobiCom ’04: Proceedings of the 10th annual international conference on Mobile computing and networking, pages 114–128. ACM Press, 2004. [12] Deborah Estrin, Ramesh Govindan, John Heidemann, and Satish Kumar. Next century challenges: scalable coordination in sensor networks. In MobiCom ’99: Proceedings of the 5th annual ACM/IEEE international conference on Mobile computing and networking, pages 263–270, New York, NY, USA, 1999. ACM Press. [13] Robert G. Gallager, Pierre A. Humblet, and Philip M. Spira. A distributed algorithm for minimum-weight spanning trees. ACM Trans. Program. Lang. Syst., 5(1):66–77, 1983. [14] Kostas P. Hatzis, George P. Pentaris, Paul G. Spirakis, Vasilis T. Tampakas, and Richard B. Tan. Fundamental control algorithms in mobile networks. In ACM Symposium on Parallel Algorithms and Architectures, pages 251–260, 1999. [15] Kostas P. Hatzis, George P. Pentaris, Paul G. Spirakis, Vasilis T. Tampakas, and Richard B. Tan. Fundamental control algorithms in mobile networks. In SPAA ’99: Proceedings of the eleventh annual ACM symposium on Parallel algorithms and architectures, pages 251– 260, New York, NY, USA, 1999. ACM Press. [16] Wendi Heinzelman, Anantha Chandrakasan, and Hari Balakrishnan. Energy-efficient Communication Protocols for Wireless Microsensor Networks. In International Conference on System Sciences, Maui, HI, January 2000. [17] Chunhung Richard Lin and Mario Gerla. Adaptive clustering for mobile wireless networks. IEEE Journal of Selected Areas in Communications, 15(7):1265–1275, 1997. [18] Navneet Malpani, Jennifer L. Welch, and Nitin Vaidya. Leader election algorithms for mobile ad hoc networks. In DIALM ’00: Proceedings of the 4th international workshop on Discrete algorithms and methods for mobile computing and communications, pages 96–103, New York, NY, USA, 2000. ACM Press. [19] David Peleg. Time-optimal leader election in general networks. J. Parallel Distrib. Comput., 8(1):96–99, 1990. [20] Lakshmi Ramachandran, Manika Kapoor, Abhinanda Sarkar, and Alok Aggarwal. Clustering algorithms for wireless ad hoc networks. In DIALM ’00: Proceedings of the 4th international workshop on Discrete algorithms and methods for mobile computing and communications, pages 54–63, New York, NY, USA, 2000. ACM Press. [21] G. Tel. Introduction to Distributed Algorithms. 2000. [22] Sudarshan Vasudevan, Jim Kurose, and Don Towsley. Design and analysis of a leader election algorithm for mobile ad hoc networks. In ICNP ’04: Proceedings of the Network Protocols, 12th IEEE International Conference on (ICNP’04), pages 350–360, Washington, DC, USA, 2004. IEEE Computer Society. [23] Chung Kei Wong, Mohamed G. Gouda, and Simon S. Lam. Secure group communications using key graphs. pages 68–79, 1998.