Upload
wei-tsang-ooi
View
519
Download
0
Embed Size (px)
Citation preview
Lecture 7Peer-to-Peer
Interest Management
8 March 2010
1
Point-to-Point Architecture
2
2
Problem: Communication between
every pair of peers
3
3
Idea (old): A peer p only needs to communicate with another peer q if p is relevant to q
4
4
Recall: In C/S Architecture, the server has global information and decide who is relevant to who.
5
5
Problem: No global information in P2P architecture.
6
6
Naive Solution: Every peer keeps global information about all other peers and make individual decision.
7
7
Maintaining global information is expensive (and that’s what we want to avoid in the first place!)
8
8
Smarter solution: exchange position, then decide when should the next position exchange be.
9
9
Idea: Assume B is static. If A knows B’s position, A can compute the region which is irrelevant to B. Need not update B if A moves within that region.
10
10
what if B moves?
11
11
It still works if B also knows A position and computes the region that is irrelevant to A.
12
12
Position exchanges occur once initially, and when a player moves outside of its irrelevant region wrt another player.
13
13
Frontier Setscell-based, visibility-based IM
14
14
Previously, we learnt how to compute cell-to-cell visibility.
15
15
Frontier for cells X and Y consists of
two sets FXY and FYX
16
16
No cell in FXY is visible from a cell in FYX, and vice versa.
17
17
FXY and FYX are disjoint if X and Y are not mutually visible.
18
18
FXY and FYX are empty if X and Y are mutually visible.
19
19
Suppose X and Y are not mutually visible, then a simple frontier is
FXY = {X} FYX = {Y}
(many others are possible)
20
20
A B C
D E F
G H I
21
21
A B C
D E F
G H I
22
22
A B C
D E F
G H I
23
23
A B C
D E F
G H I
24
24
A B C
D E F
G H I
NOT a frontier for A and I (D is visible from B).
25
25
Position exchanges occur once initially, and when a player moves outside of its irrelevant region wrt another player.
26
26
Initialize: Let player P be in cell XFor each player Q Let cell of Q be Y Compute FXY (or simply FQ)
27
27
Move to new cell:Let X be new cellFor each player Q If X not in FQ
Send location to Q
28
28
Receive Update: (location from Q)Send location to QRecompute FQ
29
29
A B C
D E F
G H I
Update is triggered.
30
30
A B C
D E F
G H I
New Frontier.
31
31
A B C
D E F
G H I
Update triggered.
32
32
A B C
D E F
G H I
New frontier (empty since E can see G)
33
33
How to compute frontier?
34
34
A good frontier is as large as possible, with two almost
equal-size sets.
35
35
A B C
D E F
G H I
Build a visibility graph. Cells are vertices. Two cells areconnected by an edge if they are visible to each other
(EVEN if they don’t share a boundary)
36
36
Let dist(X,Y) be the shortest distance between two cells X and Y on the visibility graph.
37
37
A B C
D E F
G H I
0 1 2
212
2 3 3
38
38
TheoremFXY = { i | dist(X,i) <= dist(Y,i) - 1}FYX = { j | dist(Y,j) < dist(X,j) - 1}
are valid frontiers.
39
39
A B C
D E F
G H I
0 1 2
212
2 3 3 0
0
11
2 2
33 3
4
40
40
A B C
D E F
G H I
0 1 2
212
2 3 3 0
0
11
2 2
33 3
4
41
41
H
A B C
D E F
G I
0 1 2
212
2 3 3 0
0
11
2 2
33 3
4
42
42
A B C
D E F
G H I
43
43
TheoremFXY = { i | dist(X,i) <= dist(Y,i) - 1}FYX = { j | dist(Y,j) < dist(X,j) - 1}
are valid frontiers.
44
44
FXY = { i |dist(X,i) <= dist(Y,i) - 1}FYX = { j |dist(Y,j) < dist(X,j) - 1}
Proof (by contradiction)Suppose there are two cells, C in FXY and D in FYX, that can see each other.
45
45
FXY = { i |dist(X,i) <= dist(Y,i) - 1}FYX = { j |dist(Y,j) < dist(X,j) - 1}
dist(X,C) <= dist(Y,C) - 1dist(Y,D) < dist(X,D) - 1dist(C,D) = dist(D,C) = 1
46
46
dist(X,C) <= dist(Y,C) - 1dist(Y,D) < dist(X,D) - 1dist(C,D) = dist(D,C) = 1
We also know thatdist(X,D) <= dist(X,C) + dist(C,D)dist(Y,C) <= dist(Y,D) + dist(D,C)
47
47
1. dist(X,C) <= dist(Y,C) - 12. dist(Y,D) < dist(X,D) - 13. dist(C,D) = 14. dist(X,D) <= dist(X,C) + dist(C,D)5. dist(Y,C) <= dist(Y,D) + dist(D,C)
From 4, 1, and 3:dist(X,D) <= dist(Y,C) - 1 + 1From 5:dist(X,D) <= dist(Y,D) + 1
48
48
1. dist(X,C) <= dist(Y,C) - 12. dist(Y,D) < dist(X,D) - 13. dist(C,D) = 14. dist(X,D) <= dist(X,C) + dist(C,D)5. dist(Y,C) <= dist(Y,D) + dist(D,C)
We have dist(X,D) <= dist(Y,D) + 1Which contradict 2 dist(X,D) > dist(Y,D) + 1
49
49
How good is the idea?
(How many messages can we save by using Frontier Sets?)
50
50
q2dm3 q2dm4 q2dm8
Max dist()
Num of cells
4 5 8
666 1902 966
51
51
Frontier Density: % of player-pairs with non-empty frontiers.
52
52
q2dm3 q2dm4 q2dm8
Frontier Density 83.9 93.0 84.2
53
53
Frontier Size: % of cells in the frontier on average
54
54
q2dm3 q2dm4 q2dm8
Frontier Size 38.3% 67.3% 68.2%
55
55
Compare with1. Naive P2P2. Perfect P2P
56
56
Naive P2PAlways send update to 15 other players.
57
57
Perfect P2PHypothetical protocol that sends messages only to visible players.
58
58
q2dm3 q2dm4 q2dm8
NPP
PPP
Frontier
15 15.7 14.4
3.7 1.9 4.2
5.4 2.6 5.9
Number of messages per frame per player.
59
59
Space ComplexityLet N be the number of cells. If we precompute Frontier for every pair of cells, we need
O(N3) space.
60
60
If we store visibility graph and compute frontier as needed, we only need
O(N2) space.
61
61
Frontier Setscell-based, visibility-based IM
62
62
Limitations
63
63
Works badly if there’s little occlusion in the
virtual world.
64
64
Still need to exchange locations with every other
players occasionally.
65
65
Frontier Setscell-based, visibility-based IM
66
66
Voronoi Overlay Network: Aura-based Interest Management
67
67
Diagrams and plots in the sections are taken from presentation slides by
Shun-yun Hu, available on http://vast.sf.net
68
68
Keep a list of AOI-neighbors and exchange messages with AOI-neighbors.
69
69
Q: How to initialize AOI-neighbors?
70
70
Q: How to update AOI-neighbors?
71
71
Problem: No global information in P2P architecture.
72
72
Idea: Find closest node and ask for introductions
73
73
Idea: New AOI-neighbors will likely be neighbors of my existing AOI-neighbors.
74
74
Challenge: Need to discover new neighbors even if current node has no neighbor
75
75
Question: How to find closest node?
76
76
Every node is in charge of a region in the virtual world.
The region contains points closest to the node.
77
77
Voronoi Diagram
78
78
AOI Neighbors:Neighbors in AOI
79
79
Enclosing Neighbors:Neighbors in adjacent region.
(may or may not be in AOI)
80
80
Boundary Neighbors:Neighbors whose region intersect with AOI.
(may or may not be in AOI)
81
81
Boundary andEnclosingNeighbor
82
82
Regular AOI Neighbor:Non-boundaryand non-enclosingneighbor in AOI
83
83
Unknown nodes (not neighbors!)
84
84
Type in AOI? intersect? adjacent?
Regular yes no no
Enclosing maybe no yes
Boundary maybe yes no
Enclosing+Boundary
maybe yes yes
85
A node always connect to its enclosing neigbours, regardless of whether they are in the AOI.
86
86
A node connects to exchanges updates with all neighbors.
87
87
A node maintains Voronoi of all neighbors(regardless of inside AOI or not)
88
88
Suppose a player X wants to join. X sends its location to any node in the system.
89
89
90
X join request is forwarded to the node in charge of the region (i.e., closest node to X), called acceptor.
90
91
Forwarding is done greedily (at every step, forward to neighbor closest to X)
91
92
Acceptor informs the joining node X of its neighbors. Acceptor, X, and the neighbors update their Voronoi diagram to include the new node.
92
True or false:
Enclosing neighbors of X are also enclosing neighbors of acceptor.
93
93
94
When X moves, X learns about new neighbors from the boundary neighbors.
94
95
Boundary neighbors’ enclosing neighbors may become new neighbors of X.
95
96
When a node disconnects, Voronoi diagrams areupdated by the affected nodes. New boundary
neighbors may be discovered.
96
Advantages of VON:
Number of connections depends on size of AOI, not size of virtual world
97
97
We can bound number of connections by adjusting AOI radius (smaller AOI is crowded area).
98
98
Advantages of VON:
Maintain a minimal number of enclosing neighbors when the world is sparse to ensure connectivity.
99
99
Advantages of VON:
Boundary neighbors ensure that new neighbors are discovered.
100
100
Problems with VON:
Inconsistency may occur (e.g. with fast moving nodes)
101
101
No rigorous proof
Working on evaluation with realistic traces
102
102
For now, simulation only
103
World Size
Players
AOI
Connection Limit
Movement
Velocity
1200x1200
100 to 1000
100
20
Random Waypoint
Constant 5 units /step
103
0
2
4
6
8
10
12
14
16
0 200 400 600 800 1000Number of Nodes
Size
(kb)
basicdAOIbasic (fixed density after 500 nodes)dAOI (fixed density after 500 nodes)
Average Transmission per Second
104
Average Neighbor Size
0
5
10
15
20
25
30
35
40
45
50
0 200 400 600 800 1000Number of Nodes
Nei
ghbo
r Si
ze
connected neighbors (basic)AOI neighbors (basic)connected neighbors (dAOI)AOI neighbors (dAOI)
105
Observed/Actual AOI Neighbors
99.90
99.91
99.92
99.93
99.94
99.95
99.96
99.97
99.98
99.99
100.00
100 200 300 400 500 600 700 800 900 1000Number of Nodes
Topo
logy
Con
sist
ency
(%
)
basicdAOI
106
actual - observed position (average over all nodes)
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
0.45
0.50
100 200 300 400 500 600 700 800 900 1000Number of Nodes
Ave
rage
Drif
t Dis
tanc
e
basicdAOI
107
Responsive
Consistent
Cheat-Free
Fair
Scalable
Efficient
Robust
Simple
108