A Distributed Algorithm for Minimum

Download Report

Transcript A Distributed Algorithm for Minimum

SOFSEM 07
A Software Architecture for
Shared Resource
Management in Mobile Ad
hoc Networks
by Orhan Dagdeviren, Kayhan Erciyes
Izmir Institute of Technology
presented by
Orhan Dagdeviren
January 2007, Harrachov
Outline
• Introduction
• Layer 1: Merging Clustering Algorithm(in
brief)
• Layer 2: Backbone Formation Algorithm(in
brief)
• Layer 3: Mobile Ricart-Agrawala Algorithm
• Conclusions
Introduction
Wireless communication is growing fast in last few years.
Future information technology will be mainly based on
wireless technology. [STOJMENOVIC02a]
GSM World’s Research
shows the cellular
phone usage exceeds 2
billion.
Introduction
Traditional Cellular and Mobile Networks
Base Stations, access points
Wi-Fi ad hoc mode
• Traditional cellular
and mobile networks
are limited by their
need for infrastructure.
This final limitation is
eliminated in
MANETs.
Introduction
Applications of Mobile Ad hoc Networks
-Battlefields
-Mobile Sensor Network
-Rescue Operations
-Personal Area
Network
Introduction
Cluster
• Virtual Group which provides
1. Energy control by
clusterheads.
2. Routing by clusterheads
and gateways.
3. Construction of a backbone
architecture( Dominating set
based algorithms )
Backbone: Path which
connects
clusterheads
Introduction
Distributed Mutual Exclusion
The mutual exclusion problem involves a
group of process, each of which requires
access to a resource or a piece of code
called the critical section.
It is an one of fundamental computer
science problem and a relatively new
research area for the mobile ad hoc
environment.
Introduction
The steps of this study
1. Partition the MANET into balanced, nonoverlapped clusters by MCA
[Dagdeviren06].
2. Provide a ring backbone for a clustered
MANET by BFA
.
[Dagdeviren06-2]
3. Implement the Mobile Ricart-Agrawala
algorithm
.
[ERCIYES04,ERCIYES05]
Layer 1: Merging Clustering
Algorithm
[Dagdeviren05, Dagdeviren06]
1. General Idea
2. Description of the Algorithm
3. An Example Operation
General Idea of the Algorithm
Algorithm merges clusters to higher
level clusters like Gallagher’s distributed
MST algorithm. However ;
1. First idea is to focus on clustering
operation by discarding spanning tree. This
reduces message complexity from
O(nlogn) to O(n) (also time complexity is
O(n).
2. Second idea is to use upper(2K) and
lower(K) bound heuristics for clustering.
Description of the Algorithm
1. Each node has distinct node_id.
2. Each node knows its cluster_leader_id,
cluster_level.
3. Leader node of a cluster is the node with
maximum node_id.
Description of the Algorithm
• Algorithm consists of sending receving
messages over adjoining links, waiting for
incoming messages and processing
messages.
• We assume no packet loss, if any loss
occurs tout occurs in sender and sends the
packet again. (Discussed Later)
An Example Operation
K=7
Layer 2: Backbone Formation
Algorithm
1. General Idea
2. Description of the Algorithm
3. An Example Operation
General Idea of the Algorithm
MCA
•
Balanced clusters.
•
No backbone construction.
DS-based algorithms
•
•
Backbone is constructed.
Clusters may be overlapping and
balancing is not mentioned
General Idea of the Algorithm
The backbone formation algorithm
constructs a backbone of clusterheads on a
clustered MANET.
General Idea of the Algorithm
Contributions
1.
Since our backbone is directed ring
architecture, better services can be given to
middleware (traversing of message)
2.
Two essential needs of clustering,
balanced clustering and backbone formation
3.
Partial Fault-tolerant
Description of the Algorithm
Each clusterhead floods Leader_Info
message to network which consists of their
id and if needed their position.( O(cn)
message and time complexity where c is
the total number of clusterheads )
In this phase, cluster member nodes are
acting as router to transmit Leader_Info
messages.
Description of the Algorithm
•
The main idea is maintaining of same
minimum spanning tree between clusterheads
to construct a directed ring architecture.
• Minimum Spanning Tree can be obtained in
two ways.
Minimum Spanning Tree
Construction
1. Hop–based minimum spanning tree
construction
Minimum number of hops between
clusterheads are considered.
For highly mobile scenarios, an
agreement between clusterheads must be
maintained.
Hop-based mst construction
2 hops
clusterhead id=13
clusterhead id=13
member id=5
member id=5
member id=6
clusterhead id=20
member id=6
clusterhead id=20
3 hops
Hop information can rapidly change for high mobile scenarios.
Agreement between clusterheads must be maintained.
Minimum Spanning Tree
Construction
2. Position–based minimum spanning tree
construction:
Positions of clusterheads are used.
Velocity and the direction information can be
appended with a timestamp to the Leader_Info
message.
Position-tracker like a GPS Receiver must be
maintained.
Directed Ring Construction
After constructing mst, clusterheads are classified into two groups:
LEAF: Clusterheads with degree 1 in mst.
BACKBONE: Other clusterheads than LEAFs.
LEAFs are filled with white.
BACKBONEs are filled
with black.
An Example Ring construction
27
13
52
Starting BACKBONE
34
45
25
67
29
76
18
61
55
1. BACKBONE leaders are connected
to each other.
Starting BACKBONE is selected with
minimum connectivity to other
BACKBONE leaders. If there are more
than one, select the one with minimum
id.
Connect each other from starting to
end, last BACKBONE leader is
connected to its LEAF with minimum
node_id.
Ring construction
27
13
connected to each other from smallest
node_id to greater.
52
34
45
25
67
29
76
18
2. LEAF leaders of same parent are
61
55
Ring construction
27
13
connected to each other from LEAF
leader with maximum node_id to other
LEAF leaders with minimum node_id
of previous BACKBONE clusterheads.
52
34
45
25
67
29
76
18
3. LEAF leaders of different parents are
61
55
4.Last leaf is connected to starting
BACKBONE leader.
Advantages :
+ Connection of BACKBONE leaders
+ LEAF leaders of same parent are connected.
+ LEAF leaders of different parents connected on
BACKBONE leaders.
Fault Tolerance of Algorithm
•
Clusterheads can maintain the list of member
nodes during clustering operation.
•
Clusterheads can maintain the list of all nodes
in MANET during backbone formation.
If a clusterhead detects the crash of its next
clusterhead:
1.
It can update its next clusterhead to next-next
clusterhead.
2.
It can multicast a Leader_Dead message to
cluster members of crashed clusterhead to initate
clustering.
Example
Cluster 1
A leader election must be
maintained
Leader_Dead
New_Leader
leader
1
leader
1, is
crashed
new
leader
selected
leader
leader4,
4detected
leader
4,updated
leader 2
Cluster 2
Cluster 4
leader 3
Cluster 3
Distributed Mutual Exclusion
Performance Metrics
Metrics
1. Number of Messages per Request(M): Total messages for CS.
2. Response Time(R): Interval between requesting and finishing CS.
3. Synchronization Delay(S): Time to enter a node to CS after another
finishes.
System can be lightly or heavily loaded. In lightly
loaded system, when a process makes a request, no
other process is in CS. Other situation of system is
heavily loaded.
Classification of distributed mutual
exclusion algorithms
• Token-based mutual exclusion algorithms
[SUZUKI85] [RAYMOND89].
• Permission based mutual exclusion algorithms
[LAMPORT78][RICART81][MAEKAWA85].
Permission based algorithms:
Ricart-Agrawala Algorithm
executing CS
wants to enter CS
N-1 request
N-1 replay
Total Messages: N-1 + N-1 = 2N-2
Ricart-Agrawala Algorithm
wants to enter CS
3 N-1 request
executing CS or
have a request with
5
lower timestamp
request is deferred and
enqueued
Ricart-Agrawala Algorithm
• MUTEX is charecterized by the permission.
• Fairness, liveness and safety is ensured.
• Crash of a single node is a big problem, they propose
a timeout solution for this problem.
• System must provide clock synchronization.
Mutual Exclusion Algorithms on
MANETs
• Permission based mutual exclusion algorithms:
Look-ahead technique: Singhal
[SINGHAL97 ],
Wu et. al’s
[WU05 ]
which is based on construction of a competing set of
CS requesting processses.
• Token-based mutual exclusion algorithms:
Walter
[WALTER01b ],
Baldoni
[BALDONI02 ]
Layer 3: Mobile Ricart-Agrawala
Algorithm
1. General Idea
2. Description of the Algorithm
3. An Example Operation
4. Analysis
5. Results
General Idea of the Algorithm
The main idea is to make coordinators
interface to other nodes to the ring for
Ricart-Agrawala Algorithm.
Requests are processed according to
their timestamps.
Mobile Ricart-Agrawala Algorithm
Cluster 1
3
leader 1
leader 3
leader 2
Cluster 2
Cluster 3
13
leader 4
Cluster 4
Finite State Machine for leaders of
Mobile_RA
6
9
15
19
18
4
3
13
0
14
17
5
11
10
16
7
1
2
12
8
An Example Operation
Node 6 makes a CS request at 3.75s.
Node 4 makes a CS request at 3.85s.
Node 16 makes a CS request at 3.90s.
CS execution time is 350ms.
Enters the mutex
6
Clock:3,78s
Clock:3,81s
Clock:3,80s
Clock:3,76s
Clock:3,82s
Clock:3,83s
Node_Req 6
9
15
19
Coord_Rep 6
Coord_Req 6
IDLE
WAIT_RP
IDLE 18
3
4
Coord_Req 6
13
Coord_Req 6
0
IDLE
14
IDLE
Coord_Req 6
17
5
11
10
16
7
1
2
12
8
Executing CS
Clock:3,85s
Clock:3,87s
Clock:3,90s
Clock:3,93s
6
9
15
19
Req 4
Coord_Req 4
Node_Req 4
18
4
3
Req 16
Coord_Req 16
13
0
14
17
5
Node_Req 16
11
10
16
7
1
2
12
8
Finished CS Execution
Node_Rel
6
9
Clock:4,18s
Clock:4,26s
15
19
Req 4
Coord_Rep
18
3
4
Coord_Req 4
Req 16
13
0
Enters Mutex
14
17
5
11
10
16
7
1
2
12
8
Finished CS Execution
6
Clock:5,03s
Clock:4,61s
9
15
19
Node_Rel
18
3
4
Req 16
Coord_Req 16
13
0
14
Node_Rel
17
5
11
Coord_Rep
10
16
7
1
Enters the mutex
12
8
2
Analysis
Theorem:Total number of messages per CS:
k+3d
k  number of elements on the ring
d  upperbound diameter a cluster
Analysis
Proof:
d * Node_Req + k * Coord_Req + d * Coord_Rep + d * Node_Rel
= k+3d
Cluster 1
Cluster 3
d
k
Cluster 2
Cluster 4
Analysis
Corollary:Synchronization Delay varies from
2dT to (k+2d-1)T.
Analysis
Proof:
Lower bound( In same cluster): d*Node_Rel+ d*Coord_Rep = 2dT
Upper bound(In different clusters): d*Node_Rel+ (k-1)*Coord_Req+
d*Coord_Rep = (2d+k-1)T.
Cluster 1
Cluster 3
d
k
Cluster 2
Cluster 4
Analysis
Corollary:Response Time in lightly load
system is (k+3d)T+E.
Analysis
Proof:
d*Node_Req+k*Coord_Req+ d* Coord_Rep+Execution Time+
d*Node_Rel = (k+3d)T+E
Cluster 1
Cluster 3
d
k
Cluster 2
Cluster 4
Analysis
Corollary:Response Time in heavily load
system varies from
w(2dT+E) to
w((k-1+2d)T+E).
Analysis
Proof:
Lower bound(In the same cluster):
( (d*Node_Rel+ d* Coord_Rep)*T+Execution Time) * Waiting request Number
Upper bound(In different clusters):
( (d*Node_Rel+ (k-1)*Coord_Req+ d* Coord_Rep)*T+Execution Time) * Waiting
request Number
Cluster 1
Cluster 3
d
k
Cluster 2
Cluster 4
Results and Implementation
•
Protocol is implemented in ns2. Protocol
Stack is as follows;
Distributed Mutual Exclusion Layer
Backbone Formation Layer
Clustering Layer
UDP and Routing Layer
IP
Queing Layer
MAC and Link Layer
Physical Layer
Results and Implementation
•
Mobility , Surface Area , K parameters
are changed
Mobility Types
• High Mobility: 10 m/s – 20 m/s
• Medium Mobility: 5 m/s – 10 m/s
• Low Mobility: 1 m/s – 5 m/s
Results and Implementation
•
Mobility , Surface Area , K parameters
are changed
Surface Area Types
• Medium Surface Area: 675m2
• Small Surface Area: 500m2
• Very Small Surface Area: 350m2
Solution of Packet Loss Problem
•
In MAC Layer of IEEE 802.11g, for
each succesful packet transfer, an ACK
message is sent by destination.
•
We can notify our protocol layers from
MAC for each successful transfer. If our
protocol is not notified for an amount of
time TOUT occurs and packet send again.
Response Time against Load (CS execution is 100ms)
Linear increase in
high load values.
Sycnhronization Delay against Load
When the load is
increased, the waiting
time of requests in queues
and routing delays
increase. These increase
response time and
syncronization delay.
Response Time against Surface Area
Very small surface
area results in
approximately 20ms
lower response
times.
Synchronization delay against Surface Area
Synchronization delay is
lower in scenarios with
small surface area.
Response Time against Mobility
Synchronization Delay against Mobility
Response time
and Synchronization
delay values are
stable against
mobility.
Response Time against K
Sychronization Delay against K
Response time and
synchronization delay
values are decreasing
slowly with K for a
MANET with 50
nodes.
Conclusions
A three layer architecture is designed and implemented to solve three
problems : Balanced Clustering, Backbone Construction, Distributed
Mutual Exclusion
Conclusions
We show the results against well-known MANET
parameters like
* mobility
* surface area (gain stable results)
Also
* total number of nodes
* cluster heads
* load type. (gain results parallel to analysis)
Future Works and some drawbacks
of these protocols
Drawbacks
•
Needs clock syn. – Lamport or Vector clocks, a cluster-based clock synchronization
protocol.
•
A solution must be proposed to process request messages just before clustering and
backbone forming.
•
No simulation is supported for on top of a large surface area like 1000m*1000m not
to deal with lots of isolated nodes and destruction of the ring architecture. – A
problem of clustering.
•
More Fault tolerance issues must be studied.
Future studies
•
Total order multicast
•
Sensor network environment
Presentation finished…
Questions?
Thanks for your
Attendance
Orhan Dagdeviren
SOFSEM 07
Presentation