View
231
Download
0
Tags:
Embed Size (px)
Citation preview
1
Prioritized h-out of-k Resource Allocation for
Mobile Ad Hoc Networks and Distributed Systems
Jehn-Ruey JiangHsuan Chuang University
HsinChu, Taiwan
2
OutlineMobile Ad hoc NetworkDistributed SystemPrioritized h-out of-k Mutual ExclusionProposed AlgorithmConcluding Remarks
3
OutlineMobile Ad hoc NetworkDistributed SystemPrioritized h-out of-k Mutual ExclusionProposed AlgorithmConcluding Remarks
4
Mobile Ad hoc Network MANET (by IETF) No Infrastructure, an anytime, anywhere
network Multi-hop communication Link formations occur when nodes move
within transmission range Link failures occur when nodes move out of
transmission range Frequent and unpredictable topology changes
5
Mobile Node A
Mobile Node B
Mobile Node D
Mobile Node C
Mobile Node F
Mobile Node E
A-B: Communicate directlyA-F: Communicate via intermediate nodes B and D or via intermediate nodes E and D
6
OutlineMobile Ad hoc NetworkDistributed SystemPrioritized h-out of-k Mutual ExclusionProposed AlgorithmConcluding Remarks
7
Distributed SystemA set of stationary, autonomous sitesConnected by wired linksCommunicated by message passing
A collection of independent computers that appear to the users as a single computer (by Andrew Tannenbaun)
8
Source: Prof. Harondi
9
Merits of Distributed SystemResource Sharing:
data, service, devicesComputation Speedup:
PVM, Grid, MetaComputer 10000 CPUs, each running at 50 MIPS, yields 500000 MIPS → instruction to be executed in 0.002 nsec → equivalent to light distance of 0.6 mm → any processor chip of that size would melt immediately
Fault-toleranceto resist failures or to recover when failures occur
10
OutlineMobile Ad hoc NetworkDistributed SystemPrioritized h-out of-k Mutual ExclusionProposed AlgorithmConcluding Remarks
11
h-out of-k Mutual Exclusion (1/3)
There are k (k1) identical shared resources.
The node may require to access h (1hk) copies out of the k shared resources at a time.
The total number of resources simultaneously accessed by nodes should not exceed k.
12
h-out of-k Mutual Exclusion (2/3)
Application:CSCW (Computer Supported Cooperative Work)
Examples:•Multi-pen E-whiteboard
•Mutual driving group
•Cooperative robotics and nanorobotics
13
h-out of-k Mutual Exclusion (3/3)
Application:IPAD (Inter-Personal Awareness Devices)
Examples:•Hummingbirds System
•Generalized Hummingbirds System
•Hocman System
14
Prioritized h-out of-k MEUsing HPFS (highest priority first se
rve) instead of FCFS (first come first serve)
Can be applied to systems with real time or prioritized applications, where each node is associated with a deadline or a priority
15
MANET and Distributed Primitives (1/2)
General approach to implement distributed primitives ( such as mutual exclusion mechanism)
User Applications
Distributed Primitives
Routing Protocol
Mobile Ad Hoc Network
16
Our approach to implement distributed primitives ( such as mutual exclusion mechanism)
User Applications
Distributed Primitives Routing Protocol
Mobile Ad Hoc Network
MANET and Distributed Primitives (2/2)
17
OutlineMobile Ad hoc NetworkDistributed SystemPrioritized h-out of-k Mutual ExclusionProposed AlgorithmConcluding Remarks
18
Proposed Algorithm Overview
Each node has 3 states: ES, CS, NCS Token-based: to maintains a token-oriented DA
G (directed acyclic graph) where the token holder is the sink
the node holding token to check whether
th to enter the CS (Critical Section)
The counter in TOKEN storing the number of available resources
The number of requested resources
19
Data Structure state: Indicates node’s state( ES, CS, or NCS) N: The set of all neighbors. height: A triplet (h1, h2, i). hVector: An array of triplets representing node i's v
iew of height of node j, jN . next: Indicates the location of the token from node
i's viewpoint. tokenHolder: Indicates whether or not node i holds
the token. Q: a queue which contains requests of neighbors.
20
An ExampleA 5-node system (i.e., n=5), where
each node is labeled 0,…,4.There are 3 resources (i.e., k=3).The TOKEN is held by node 0
initially.The height values form a DAG
initially.
3height=(0, 2, 3) h=0
10
24
height=(0, 1, 1) h=0
height=(0, 2, 4) h=0
height=(0, 1, 2) h=0
height=(0, 0, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3 TOKEN(3)
Q:
Q:
Q:
Q:
Q:
Initially
3height=(0, 2, 3) h=0
10
24
height=(0, 1, 1) h=2
height=(0, 2, 4) h=0
height=(0, 1, 2) h=0
height=(0, 0, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3 TOKEN(3)
Q:
Q:
Q:
Q:
Q:
Node 1 requests 2 resources
(1,2)
3height=(0, 2, 3) h=1
10
24
height=(0, 1, 1) h=2
height=(0, 2, 4) h=0
height=(0, 1, 2) h=0
height=(0, 0, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3 TOKEN(3)
Q:
Q:
Q:
Q:
Q:
Node 3 requests 1 resourceNode 1’s request is sent to node 0
(1,2)
(1,2)(3,1)
3height=(0, 2, 3) h=1
10
24
height=(0, 1, 1) h=2
height=(0, 2, 4) h=2
height=(0, 1, 2) h=0
height=(0, 0, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3 TOKEN(3)
Q:
Q:
Q:
Q:
Q:
Node 3’s request is sent to node 1Node 0 sends token to node 1Node 4 requests 2 resources
(3,1)(1,2)
(3,1)
(4,2)
3height=(0, 2, 3) h=1
10
24
height=(0, -1, 1) h=2
height=(0, 2, 4) h=2
height=(0, 1, 2) h=0
height=(0, 0, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3
Q:
Q:
Q:
Q:
Q:
Node 1 sends token to node 3Node 4’s request is sent to nodes 2, 0, 1
(1,2)(4,2)
(3,1)(1,2)
TOKEN(3)
(4,2)
(4,2)
(4,2)
3height=(0,-2, 3) h=1
10
24
height=(0, -1, 1) h=2
height=(0, 2, 4) h=2
height=(0, 1, 2) h=0
height=(0, 0, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3
Q:
Q:
Q:
Q:
Q:
Node 3 enters the CS
(1,2)(4,2)
(1,2)TOKEN(2)
CS
(4,2)
(4,2)
(4,2)
3height=(0, -2, 3) h=1
10
24
height=(0, -3, 1) h=2
height=(0, 2, 4) h=2
height=(0, 1, 2) h=0
height=(0, 0, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3
Q:
Q:
Q:
Q:
Q:
Node 3 sends token to node 1
(1,2)(4,2)
TOKEN(2)
CS
(4,2)
(4,2)
(4,2)
3height=(0, -2, 3) h=1
10
24
height=(0, -3, 1) h=2
height=(0, 2, 4) h=2
height=(0, 1, 2) h=0
height=(0, 0, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3
Q:
Q:
Q:
Q:
Q:
Node 1 enters the CS
TOKEN(0)
CS
CS
(4,2)
(4,2)
(4,2)
(4,2)
3height=(0, -2, 3) h=1
10
24
height=(0, -3, 1) h=2
height=(0, -6, 4) h=2
height=(0, -5, 2) h=0
height=(0, -4, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3
Q:
Q:
Q:
Q:
Q:
Node 1 sends token to nodes 0, 2, 4
TOKEN(0)
CS
CS
(4,2)
3height=(0, -2, 3) h=0
10
24
height=(0, -3, 1) h=2
height=(0, -6, 4) h=2
height=(0, -5, 2) h=0
height=(0, -4, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3
Q:
Q:
Q:
Q:
Q:
Node 3 leaves the CSNode 3 sends release msg to node 4
TOKEN(1)
CS
(4,2)
3height=(0, -2, 3) h=0
10
24
height=(0, -3, 1) h=0
height=(0, -6, 4) h=2
height=(0, -5, 2) h=0
height=(0, -4, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3
Q:
Q:
Q:
Q:
Q:
Node 1 leaves the CSNode 1 sends release msg to node 4 via node 2
TOKEN(3)
(4,2)
3height=(0, -2, 3) h=0
10
24
height=(0, -3, 1) h=0
height=(0, -6, 4) h=2
height=(0, -5, 2) h=0
height=(0, -4, 0) h=0
next varibale
direct link(from higher height to lower height)
k=3
Q:
Q:
Q:
Q:
Q:
Node 2 enters the CS
TOKEN(1)
CS
33
(cont. 1)
3(0, 2, 3) h=0
10
24
1
(0, 1, 1)h=1
(0, 2, 4) h=0
(0, 1, 2) h=0
1
(0, 0, 0) h=0
k=3
TOKEN(3)
34
(cont. 2)
3(0, 2, 3) h=0
10
24
1
(0, 1, 1)h=1
4
(0, 2, 4) h=1
4
(0, 1, 2) h=0
12
(0, 0, 0) h=0
k=3
TOKEN(3)
35
(cont. 3)
33
(0, 2, 3) h=2
10
24
13
(0, 1, 1)h=1
4
(0, 2, 4) h=1
4
(0, 1, 2) h=0
12
(0, 0, 0) h=0
k=3
TOKEN(3)
36
(cont. 4)
3(0, 2, 3) h=2
10
2
13
(0, 1, 1)h=1
4
(0, 2, 4) h=1
4
(0, 1, 2) h=0
12
(0, 0, 0) h=0
k=3
TOKEN(3)
4
3
37
(cont. 5)
334
(0, 2, 3) h=2
10
2
13
(0, 1, 1)h=1
4
(0, 2, 4) h=1
4
(0, 1, 2) h=0
12
(0, 0, 0) h=0
k=3
TOKEN(3)
4
=
38
(cont. 6)
334
(0, 2, 3) h=2
10
2
13
(0, 1, 1)h=1
4
(0, 2, 4) h=1
(0, 1, 2) h=0
12
(0, 0, 0) h=0
k=3
TOKEN(3)
4
39
(cont. 7)
334
(0, 2, 3) h=2
10
2
130
(0, -1, 1)h=1
4
(0, 2, 4) h=1
(0, 1, 2) h=0
12
(0, 0, 0) h=0
k=3 TOKEN(3)
4
=
40
(cont. 8)
334
(0, 2, 3) h=2
10
2
130
(0, -1, 1)h=1
4
(0, 2, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3 TOKEN(3)
4
41
(cont. 9)
334
(0, 2, 3) h=2
10
2
30
(0, -1, 1)h=1
4
(0, 2, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3 TOKEN(2)
4
CS
42
(cont. 10)
3341
(0, -2, 3) h=2
10
2
30
(0, -1, 1)h=1
4
(0, 2, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(2)
4
CS
=
43
(cont. 11)
3341
(0, -2, 3) h=2
10
2
0
(0, -1, 1)h=1
4
(0, 2, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(2)
4
CS
44
(cont. 12)
341
(0, -2, 3) h=2
10
2
0
(0, -1, 1)h=1
4
(0, 2, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(0)
4
CS
CS
45
(cont. 13)
31
(0, -2, 3) h=2
10
2
0
(0, -1, 1)h=1
43
(0, -3, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(0)4
CS
CS
node 4 can’t enter CSsince h(=1) > k (=0)
46
(cont. 14)
31
(0, -2, 3) h=2
10
2
0
(0, -1, 1)h=0
43
(0, -3, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(0)4
CS
RELEASE(1)
47
(cont. 15)
31
(0, -2, 3) h=2
10
2
0
(0, -1, 1)h=0
43
(0, -3, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(0)4
CS
RELEASE(1)
48
(cont. 16)
31
(0, -2, 3) h=2
10
2
0
(0, -1, 1)h=0
43
(0, -3, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(1)4
CS
RELEASE(1)
node 4 can enter CSsince h(=1) k (=1)
49
(cont. 17)
31
(0, -2, 3) h=2
10
2
0
(0, -1, 1)h=0
43
(0, -3, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(0)4
CS
CS=
50
(cont. 18)
31
(0, -2, 3) h=2
10
2
0
(0, -1, 1)h=0
3
(0, -3, 4) h=1
(0, 1, 2) h=0
2
(0, 0, 0) h=0
k=3
TOKEN(0)4
CS
CS
51
Concluding Remarks Initially, there is a token holder node i with
height=(0, 0, i). All nodes will eventually form a token-oriented DAG.
The algorithm is sensitive to link forming and link breaking.
If h is always chosen to be 1 k-Mutual Exclusion
If h and k are both chosen to be 1 Mutual Exclusion
52
Concluding Remarks (cont.)Restrictions No node failure is allowed (It can be loosed to
be that the token holder and nodes in CS cannot fail.)
The field of height may be unbounded (the breaking and forming of links may help readjust the height value) .
No partition is allowed.
53
Concluding Remarks (cont.)Future Work Compare to the Mutual Exclusion Algorithm
[Walter et. al. 1998] and the k-Mutual Exclusion Algorithm [Walter et. al. 2001].
Develop prioritized h-out of-k mutual exclusion algorithm.
Make use of the concept of self-stabilizing.
54
The End