Sei sulla pagina 1di 6

2015 International Conference on Computer and Computational Sciences (ICCCS)

Location Based Coordinator Election Algorithm inDistributed


Environment
Sheenu Chhabra1, Gajendra Tyagi2, Ankit Mundra3, Nitin Rakesh4
1,2

Department of Computer Science and Engineering, Jaypee University of Information Technology


Waknaghat, Himachal Pradesh-173215
1
sheenu.chhabra21@gmail.com, 2gajendratyagi007@gmail.com
3
Department of Computer Science and Engineering, Central University of Rajasthan, Ajmer
4
Department of Computer Science and Engineering,
Amity School of Engineering and Technology, Amity University, Noida-201313
3
ankit_cse@curaj.ac.in, 4nitin.rakesh@gmail.com

coordinator election algorithm which is bully algorithm [1]


followed by some of the well-known other algorithms. In
this paper we have presented a new approach, which elect
the coordination node by adopting the concept of
localization. In the proposed approach we have some
assumptions which are taken into consideration.

Abstract: In distributed computing, a task is divided into subtasks


and each task is processed by one of the computers available in
the network. These computers communicate with each other
through message passing. Also, it is necessary to achieve
synchronization between these multiple nodes. In order to
achieve the same and coordination, there is a need of coordinator
node also known as leader node. Now, to elect node we have
several algorithms proposed by various researchers and over the
past years several changes have been take place over these
algorithms to optimize the algorithmic complexity (in term of
time, number of messages and robustness). In this paper we
propose a location and priority based approach to select the
coordinator node among diverse nodes present in a distributed
environment. Based on our experimental results, the proposed
approach reducesthe network traffic by reducing number of
messages in the network. Furthermore, this approach is justified
by comparing it with previously proposed election algorithmswith
respect tothe number of messages passed for election process.

1.

It is a synchronous system and each node will have the


unique id number.

2.

Each node is having the information of all the nodes


present in the system in the terms of their ids.

3.

Nodes dont know which node is currently up and


which is down.

4.

Each node is having the priority list according to the


priority which will lead to selection of coordinator and
co-coordinator (explained in section III).

5.

Whenever an election starts, node with highest priority


among the live nodes will be elected as new
coordinator and the process with next highest priority
will be the co-coordinator.

6.

A failed node can rejoin the system again.

Keywords: Bully algorithm; Consensus Algorithm; Priority;


Proximity; Coordinator.

I.

INTRODUCTION

Leader node election is an important area of distributed


computing. As distributed network is a collection of several
independent nodes connected and communicate with each
other to achieve a common complex task assign to the
network. Further in order to achieve a common and
consistent solution synchronization is needed between the
multiple nodes [1]. As a result one node is elected as
coordinator node in the distributed environment which takes
care of all the activities performed by different live nodes
and maintains consistency among them. In order to elect a
node as coordinator election algorithms have introduced [2].

Further, the layout of the paper is as follows: this paper is


divided into seven sections. In section 1, introduction to
various election algorithms is given. Section 2 introduces
the related work in the field of leader election in distributed
environment and also includes the discussion about bully
algorithm and consensus algorithm. Section 3 presents the
proposed approach in which the priority assignment
procedure and then coordinator and co-coordinator selection
mechanism according to the priority list are proposed.
Section 4 presents the comparative analysis of the proposed
work with previous approach. Section 5 concludes the work
along with future scope.

Coordinator election is one of the main processes in


centralized mutual exclusion algorithms. In every node
election algorithm it is assumed that any node can start the
election process. And election is needed whenever the
system is initialized or if the current coordinator crashes to
elect the new coordinator as soon as possible. In the above
mention context this paper discusses one of the well-known

978-1-4799-1819-5/15/$31.00 2015 IEEE

183

2015 International Conference on Computer and Computational Sciences (ICCCS)

II. RELATED WORK

1.

Node 3 detects the crash of current coordinator.

Several election algorithms have been proposed for leader


election among various nodes present in a distributed
environment [1-20].In this section we are going to elaborate
two significant election algorithms i.e. Bully algorithm
which is one of the basic and well known election
algorithms [1], and second is consensus based leader
election algorithm [2].

2.

It starts the election procedure and sends election


message to nodes with higher ids that is node no 4, 5,
and 6.

3.

Node 4, 5, and 6 reply to node 3 with ok message so as


to inform it that they will take care of the election.

4.

Node 4, 5 and 6 starts election message and lastly


node 6 which has the highest id will take care of the
election and inform to node 4 and 5 about the election.

5.

Node 6 sends coordinator message to all the nodes


present in the system.

A. Bully Algorithm
In Bully Algorithm, when the system is initialized, node
with highest id is elected as current coordinator. When any
random node detects the failure of current coordinator, it
waits for a timeout period after which it starts the election
algorithm [1].
1

Bully algorithm is very popular algorithm, but one of the


main disadvantages is number of messages generated during
the election procedure which increase the network traffic

B. Consensus Based Leader Election Algorithm


6

3
Election

In this algorithm, node id is assigned by the process of


residual power and node degree [2]. Then node with the
highest Id is elected as group leader. In the Figure 2, node 7
is the current group leader.

Election

Election

5
(b)

(a)

1
1

6
6

OK

E
3
OK

E = Election

6
Check Exist

OK

(a)

(b)

(c)
(d)
1

6
C

OK
2

3
5
(e)

GRANT

PROPOSAL

4
3
OK

C
2

3
C = Coordinator

7
6

2
5

3
5

(c)

(d)

(f)

Figure. 1. Steps of Bully Algorithm

In the Figure 1, Node no 7 is the current coordinator as it


has the highest id in the system.
184

2015 International Conference on Computer and Computational Sciences (ICCCS)

ACCEPT

Coordinator

the centroid will be assigned highest priority and the node


which is very far from the centroid has least priority. Now,
according to above method coordinator node is placed at
central position which will approximate the communication
latency for all the nodes [11]. Here, we are going to use
several messages i.e.VERIFY, PROPOSAL, NOTIFY,
ACCEPT, IS-ALIVE, ELECTION-STOP, ALIVE, QUERY,
FREE, ALERT(explanation is shown in table 1)

C
2

(e)

(f)

TABLE I: Different Message Types Used in Algorithm

MESSAGE
TYPE

FUNCTION

Node 3 founds the coordinator failure and it


immediately sends the election message to the highest
priority nodes which are node 4, 5, 6 and 7.

PROPOSAL

To propose the co-coordinator node to be the


new coordinator.

VERIFY

To verify the failure of current coordinator


node by co-coordinator node.

After receiving the election message, all the higher


priority nodes will send a CHECK-EXIST message to
the group leader to confirm the failure.

IS_ALIVE

To elect the new co-coordinator by new


coordinator.

NOTIFY

To broadcast the information about new


coordinator and co-coordinator.

ACCEPT

To acknowledge the new coordinator by all the


nodes

ELECTION
STOP

To stop the simultaneous election procedure by


low priority nodes.

ALERT

To notify the coordinator about its existence by


co-coordinator node by a time-out procedure.

Figure. 2. Steps of Consensus Algorithm

1.

2.

3.

After a waiting period, all the higher nodes with no


response from failed group leader will send an OK
message to finder node and the finder node will send
aproposal message to the node 6 which having the
highest id.

4.

Node 6 sends the proposal message to all the nodes in


the system.

QUERY

To inform the coordinator about the recovered


coordinator.

5.

All the nodes will respond with the accept message to


the node 6.

FREE

To release the co-coordinator when old


coordinator recovers and reelected as the new
coordinator.

6.

After receiving accept message from more than half


the nodes, node 6 will declare itself as the current
group leader and send coordinator message to all the
nodes.

A. Algorithm

In this approach number of messages passed for election is


less than to the bully algorithm, but still this number is very
large. In the proposed algorithm, we have shown a further
improvement in terms of number of messages and
robustness is discussed in next section and a comparison of
all approaches is also discussed in section 4.

B. Procedure

Here we are explaining the algorithm which is use for


coordinator node election.

Whenever the system is initialized, each node will have a


priority list and this list will be updated as timeout
mechanism. Each node is having the information of
coordinator and co-coordinator of the system. Node with
priority 1 is the coordinator node and node with priority 2 is
the co-coordinator. Assume that there is a system of seven
nodes. When the system is initialized, each node will know
the priority list and this priority list will be updated as a
timeout mechanism. Consider each node will have the
following priority list. In figure 3 Node 6 with the priority 1
is the current coordinator of the system and the node 2 with
priority 2 is the co-coordinator of the system.

III. PROPOSED APPROACH AND EXECUTION


This paper proposes a new election algorithm(LCE) based
on the Locational priority of the nodes in a distributed
environment. The priority of each node is determined by the
distance of node from the centroid location. For this we
considered the distributed system as coordinate system
(each node has a physical location which is based on
coordination system). Than we calculate the centroid of the
system. Then, the node which has minimum distance from

Node id
Priority

6
1

2
2

1
3

4
4

3
5

Figure. 3. All nodes with their priorities

185

5
6

7
7

2015 International Conference on Computer and Computational Sciences (ICCCS)


is-alive message to the node 1, and wait for the response. If
node 1 is alive, it will send the ok message to node 2. After
this, node 2 will broadcast a NOTIFY message which
notifies all the nodes about coordinator and co-coordinator.

Procedure: Priority Assignment


1. Initialize the system and assign each node a set of coordinates.
2. Find the centroid for the system as:[12]
*/ k is total number of nodes present in network*/

 

 

 

3.
4.
5.

COORDINATOR

COORDINATOR

CO-COORDINATOR

For each node calculate Distance between ( and


( , using Euclidean distance formula.
For each node process: the node with least distance have highest
priority and elect as coordinator and Next highest as co-coordinator.
Return. /* coordinator and co-coordinator node*/

Procedure: Coordinator-Selection (next priority node)


1. Sends IS-LIVE message to new co-coordinator from priority
list
2. If (Response is OK)
Then Broadcast NOTIFY message and waits for ACCEPT
message /*NOTIFY message contains the ids of both new
coordinator and co-coordinator*/
Receive ACCEPT from all the nodes.
End If
Else
Checks the next priority node in its Priority List
And calls COORDINATOR-SELECTION (next priority node)
procedure
End Else
3. Exit.

Assume that at any instant of time, node 6 which is current


coordinator got crashed, and this failure is detected by node
3. Node 3 will send the PROPOSAL message to node 2
which is co-coordinater. Node 2 will send a VERIFY
message to node 6 to confirm the failure. If no response is
received with in predefined time, node 2 will confirm the
failure of the coordinator. Now node 2 will check the
priority list to find the new co-coordinator, it will send the

CO-COORDINATOR

3 PROPOSAL 2

(a)

(b)

CASE 1:
/* A node detects that leader node is crashed and starts the Election
Procedure. */
Election (VERIFY, PROPOSAL, NOTIFY, ACCEPT, IS-ALIVE,
COORDINATOR-ALIVE)
{
Detector node sends the PROPOSAL message to the co-coordinator.
If (co-coordinator is alive)
Then Co-coordinator sends VERIFY message to the coordinator
and waits
If (time-out)
Calls COORDINATOR-SELECTION
(next
priority node)
/*for selecting new co-coordinator it
checks its priority list and picks the one with next
highest priority */
End If
Else
Sends COORDINATOR-ALIVE message to
detector node to stop the election}
End Else
End If
}

COORDINATOR

COORDINATOR

4
IS_ALIVE

VERIFY

CO-COORDINATOR

(d)

(c)

NEW CO-COORDINATOR

COORDINATOR

COORDINATOR

NOTIFY

ACCEPT

5
CO-COORDINATOR

(e)

NEW

(f)

Figure. 4. Steps of LCE algorithm

In figure 4, node 6 is the current coordinator


1.

Node 3 detects the failure of current coordinate.

2.

Node 3 is sending the PROPOSAL message to the


node 2 which is current co-coordinator.

3.

Node 2 is sending the VERIFY message to confirm the


failure of current coordinator.

4.

Node 2 is sending the IS-ALIVE message to check that


the next co-coordinator is up or down.

5.

Node 2 broadcast the NOTIFY message to declare


thenew coordinator and co-coordinator.

All the nodes will respond with ACCEPT message to


confirm the election.

186

2015 International Conference on Computer and Computational Sciences (ICCCS)


C. Execution

coordinator node sends an ALERT message to the


coordinator node after a time out period to confirm its
existence. If the ALERT message is not received
within the timeout period, the coordinator will send an
IS-ALIVEmessage to the co-coordinator to externally
check its existence.

In figure 5, we have shown the implementation of LCE


algorithm by considering 10 node network in a 60 by 70
area.All the nodes are circularly arranged and having the
priorities in incremental order, further to assign the priority
Centroid is calculate using equation (1, 2, 3) after thiswe
have calculated the distance of all the nodes from the
centroid. We have found that Node 1 is closest to the
centroid hencedesignated as coordinator whereas node 2 is
the co-coordinator as it is having the second minimum
distance to the centroid. Further the election execution phase
is explained in section III (B).

This is also possible that there is problem of network


congestion or any other reason. So to rectify this
problem coordinator externally checks the failure. If
the failure of co-coordinator is confirmed, then
coordinator will send the co-coordinator message to
the node with next highest priority.

Prioritywise Node Placement


70

4.

When both coordinator and co-coordinator nodes get


fails. Then detector node will send an electionmessage
to the node which has the maximum priority in its list.
Then the recipient node will verify the failure of both
nodes and also check its priority list. If this node has
the highest priority in its own list after the
confirmation of failure of both coordinator and ccoordinator, this node will declare itself as the
coordinator and also select the co-coordinator as
before.

5.

When a failed coordinator node recovers, it will send a


QUERY message to any node in the system to find the
current coordinator. After the response, it will
compare the priority on its own list, if its priority is
high, it will send the PROPOSAL message to current
coordinator. After verification, current coordinator
will send it a ACCEPT message then this new
coordinator will broadcast the NOTIFY message to
declare it as a new coordinator and accordingly cocoordinator. It will also send a FREE message to the
previous co-coordinator to make him free from the
responsibility of sending the ALERT message to the
coordinator.

60

Distance(Y-axis)

50

5
4

40

1
Coordinator

30

Centroid
2
Co-coordinator

20
10

6
7

0
-10
-10

10

20
30
40
Distance(X-axis)

50

60

Figure. 5. Nodes distributed in distancewise manner from the centroid

D. Possible Cases

IV. PERFORMANCE ANALYSIS

Further we have considered several situations in which


coordinator election algorithm (described above)works.
Some of these cases are discussed below:
1.

2.

In this section we have discussed the performance analysis


of the LCE algorithm by considering total number of
messages passed in the network.To present this analysis we
have performed comparative study among Bully algorithm,
consensus based algorithm and LCE algorithm. For this we
have considered different size of networks i.e. 10, 100 and
1000 nodes (in distributed environment), and calculate the
number of messages passed during election process.

When more than one node detects the failure of


coordinator, all of them can send the election message
to the current co-coordinator. Then co-coordinator
node will send the ELECTION-STOP message to the
low priority nodes to stop the simultaneous elections.
The nodes which receive the ELECTION-STOP
message will stop the election process immediately.

The results are shown in table 2which demonstrates the


number of message passing in different approaches. Now, it
is clear from table 2 that LCE algorithm requires less
number of messages for performing election process. Also,
the performance of algorithm becomesbetter when number
of nodes increases in the Network.

When the co-coordinator node gets fails. This failure


is detected by the current coordinator of the system by
a timeout procedure. In this scenario, the co187

2015 International Conference on Computer and Computational Sciences (ICCCS)


coordinator. Our experimental result shows that in proposed
approach the number of messages is very less as compared to
previous approaches.Further the comparative analysis also
shows the proximity relationship in proposed approach will
help to choose the coordinator which is located near to the
central position which leads to less communication latency.
In future we will implement the proposed approach on real
time distributed scenario and will study the real time results.

In Figure 6 we have shown the graphical representation of


comparative study to make it more understandable.
TABLE II: Number Of messages passed in each approach

Nodes

Bully
Algorithm
(no. of
Messages)

10
100
1000

45
4950
499500

Consensus
Based Election
Algorithm
(no. of
Messages)
36
351
3501

Bully

Consensus

LCE
Algorithm
(no. of
Messages)

REFERENCES

21
201
2001

[1]

H Garcia-Molina,Elections in a Distributed Computing System,


Computers, IEEE Transactions, volume:C-31 ,Issue: 1, Jan. 1982.
[2] Mostefaoui and M. Raynal, leader-based consensus, Parallel
Processing Letters, 2001.
[3] Arghavani, A., Ahmadi, E. ; Haghighat, A.T., Improved bully
election algorithm in distributed systems,Information Technology
and Multimedia (ICIM), 2011 International Conference on 14-16
Nov. 2011.
[4] Muhammad Mahbubur Rahman, Afroza Nahar, Modified Bully
Algorithm using Election Commission, MASAUM Journal of
Computing(MJC),Vol.1 No.3,pp.439-446,October 2009.
[5] Vasudevan, S., Kurose, J. ; Towsley, D. , Design and analysis of a
leader election algorithm for mobile ad hoc networks, Network
Protocols, 2004. ICNP 2004. Proceedings of the 12th IEEE
International Conference on 5-8 Oct. 2004.
[6] Melit, L., Badache, N., An energy efficient leader election algorithm
for mobile ad hoc networks , Programming and Systems (ISPS),
10th International Symposium on 25-27 April 2011.
[7] Ajoy K. Datta, Lawrence L. Larmore, Priyanka Vemula, An O(n)time self-stabilizing leader election algorithm, Journal of Parallel
and Distributed ComputingVolume 71, Issue 11, November 2011.
[8] ChongGun Kim, Mary Wu, Leader election on tree-based centrality
in ad hoc networks, Telecommunication SystemsVolume 52, Issue
2,February 2013 .
[9] Rebecca Ingram, Tsvetomira Radeva, Patrick Shields, Saira Viqar,
Jennifer E. Walter, Jennifer L. Welch, A leader election algorithm
for dynamic networks with causal clocks, Distributed
ComputingVolume 26, Issue 2, April 2013.
[10] Vaskar Raychoudhury, Jiannong Cao, Rajdeep Niyogi, Weigang Wu,
Yi Lai, Top K-leader election in mobile ad hoc networks, Pervasive
and Mobile Computing, Volume 13, August 2014.
[11] Gajendra Tyagi, Ankit Mundra, Jitendra Tyagi, Nitin Rakesh, CoLeader Based Leader Election Algorithm in Distributed
Environment, ICC-2014, pp 261-266
[12] Ankit Mundra, Nitin Rakesh, Vipin Tyagi, Query centric Cyber
Physical System (QCPS) Approach for multiple Heterogeneous
Systems International Journal of Computer Science and Technology
(IJCST)) Volume 4, Issue Spl, pp. 23-27, April 2013.

Proposed

1000000

No. of Messages

100000
10000
1000
100
10
1
10

100

1000

Number of Nodes
Fig. 6. Number of messages passed with different number of nodes.

V. CONCLUSION AND FUTURE WORK


In this paper, we have proposed a location based coordinator
election algorithm, which provide the relationship between
nodes by assigning them set of coordinates and calculating
centroid. This relationship helps us to create the priority list
which is the basis of selection coordinator and co-

188

Potrebbero piacerti anche