Más contenido relacionado La actualidad más candente (18) Similar a CS4344 09/10 Lecture 7: P2P Interest Management (15) Más de Wei Tsang Ooi (20) CS4344 09/10 Lecture 7: P2P Interest Management1. Lecture 7
Peer-to-Peer
Interest Management
8 March 2010
1
4. Idea (old): A peer p only
needs to communicate
with another peer q
if p is relevant to q
4
4
5. Recall: In C/S Architecture, the
server has global information
and decide who is relevant to
who.
5
5
10. 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
12. It still works if B also knows A
position and computes the
region that is irrelevant to A.
12
12
13. Position exchanges occur once
initially, and when a player
moves outside of its irrelevant
region wrt another player.
13
13
17. No cell in FXY is visible from
a cell in FYX, and vice versa.
17
17
18. FXY and FYX are disjoint
if X and Y are not mutually visible.
18
18
19. FXY and FYX are empty
if X and Y are mutually visible.
19
19
20. Suppose X and Y are not
mutually visible, then
a simple frontier is
FXY = {X} FYX = {Y}
(many others are possible)
20
20
21. A B C
D E F
G H I
21
21
22. A B C
D E F
G H I
22
22
23. A B C
D E F
G H I
23
23
24. A B C
D E F
G H I
24
24
25. NOT a frontier for A and I (D is visible from B).
A B C
D E F
G H I
25
25
26. Position exchanges occur once
initially, and when a player
moves outside of its irrelevant
region wrt another player.
26
26
28. Move to new cell:
Let X be new cell
For each player Q
If X not in FQ
Send location to Q
28
28
35. A good frontier is as large as
possible, with two almost
equal-size sets.
35
35
36. Build a visibility graph. Cells are vertices. Two cells are
connected by an edge if they are visible to each other
(EVEN if they don’t share a boundary)
A B C
D E F
G H I
36
36
37. Let dist(X,Y) be the shortest
distance between two cells X
and Y on the visibility graph.
37
37
38. 0 1 2
A B C
2 1 2
D E F
2 3 3
G H I
38
38
39. Theorem
FXY = { i | dist(X,i) <= dist(Y,i) - 1}
FYX = { j | dist(Y,j) < dist(X,j) - 1}
are valid frontiers.
39
39
40. 0 3 1 3 2 3
A B C
2 2 1 2 2 4
D E F
2 1 3 1 3 0
G H I
40
40
41. 0 3 1 3 2 3
A B C
2 2 1 2 2 4
D E F
2 1 3 1 3 0
G H I
41
41
42. 0 3 1 3 2 3
A B C
2 2 1 2 2 4
D E F
2 1 3 1 3 0
G H I
42
42
43. A B C
D E F
G H I
43
43
44. Theorem
FXY = { i | dist(X,i) <= dist(Y,i) - 1}
FYX = { j | dist(Y,j) < dist(X,j) - 1}
are valid frontiers.
44
44
45. 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
46. FXY = { i |dist(X,i) <= dist(Y,i) - 1}
FYX = { j |dist(Y,j) < dist(X,j) - 1}
dist(X,C) <= dist(Y,C) - 1
dist(Y,D) < dist(X,D) - 1
dist(C,D) = dist(D,C) = 1
46
46
47. dist(X,C) <= dist(Y,C) - 1
dist(Y,D) < dist(X,D) - 1
dist(C,D) = dist(D,C) = 1
We also know that
dist(X,D) <= dist(X,C) + dist(C,D)
dist(Y,C) <= dist(Y,D) + dist(D,C)
47
47
48. 1. dist(X,C) <= dist(Y,C) - 1
2. dist(Y,D) < dist(X,D) - 1
3. dist(C,D) = 1
4. 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 + 1
From 5:
dist(X,D) <= dist(Y,D) + 1
48
48
49. 1. dist(X,C) <= dist(Y,C) - 1
2. dist(Y,D) < dist(X,D) - 1
3. dist(C,D) = 1
4. 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) + 1
Which contradict 2
dist(X,D) > dist(Y,D) + 1
49
49
50. How good is the idea?
(How many messages can we save
by using Frontier Sets?)
50
50
51. q2dm3 q2dm4 q2dm8
Max dist() 4 5 8
Num of cells 666 1902 966
51
51
53. q2dm3 q2dm4 q2dm8
Frontier
Density 83.9 93.0 84.2
53
53
55. q2dm3 q2dm4 q2dm8
Frontier
Size 38.3% 67.3% 68.2%
55
55
59. Number of messages per frame per player.
q2dm3 q2dm4 q2dm8
NPP 15 15.7 14.4
PPP 3.7 1.9 4.2
Frontier 5.4 2.6 5.9
59
59
60. Space Complexity
Let N be the number of cells. If
we precompute Frontier for
every pair of cells, we need
O(N 3)
space.
60
60
61. If we store visibility graph and
compute frontier as needed,
we only need
O(N 2)
space.
61
61
64. Works badly if there’s
little occlusion in the
virtual world.
64
64
68. Diagrams and plots in the
sections are taken from
presentation slides by
Shun-yun Hu, available on
http://vast.sf.net
68
68
69. Keep a list of AOI-neighbors and
exchange messages with AOI-neighbors.
69
69
70. Q: How to initialize AOI-neighbors?
70
70
77. Every node is in charge of a
region in the virtual world.
The region contains points
closest to the node.
77
77
80. Enclosing
Neighbors:
Neighbors in
adjacent region.
(may or may not
be in AOI)
80
80
81. Boundary
Neighbors:
Neighbors whose
region intersect
with AOI.
(may or may not
be in AOI)
81
81
83. Regular AOI
Neighbor:
Non-boundary
and non-enclosing
neighbor in AOI
83
83
85. Type in AOI? intersect? adjacent?
Regular yes no no
Enclosing maybe no yes
Boundary maybe yes no
Enclosing
maybe yes yes
+Boundary
85
89. 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
90
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
92
94. When X moves, X learns about new
neighbors from the boundary neighbors.
94
94
96. When a node disconnects,Voronoi diagrams are
updated by the affected nodes. New boundary
neighbors may be discovered.
96
96
98. We can bound number of
connections by adjusting AOI
radius (smaller AOI is crowded
area).
98
98
103. For now, simulation only
World Size 1200x1200
Players 100 to 1000
AOI 100
Connection Limit 20
Movement Random Waypoint
Velocity Constant 5 units /step
103
103
104. Average Transmission per Second
16
basic
14 dAOI
basic (fixed density after 500 nodes)
12 dAOI (fixed density after 500 nodes)
10
Size (kb)
8
6
4
2
0
0 200 400 600 800 1000
Number of Nodes
104
105. Average Neighbor Size
50
connected neighbors (basic)
45 AOI neighbors (basic)
40 connected neighbors (dAOI)
AOI neighbors (dAOI)
35
Neighbor Size
30
25
20
15
10
5
0
0 200 400 600 800 1000
Number of Nodes
105
106. Observed/Actual AOI Neighbors
100.00
99.99
99.98
Topology Consistency (%)
99.97
99.96
99.95
99.94
99.93
99.92 basic
99.91 dAOI
99.90
100 200 300 400 500 600 700 800 900 1000
Number of Nodes
106
107. actual - observed position (average over all nodes)
0.50
0.45
basic
0.40
Average Drift Distance
dAOI
0.35
0.30
0.25
0.20
0.15
0.10
0.05
0.00
100 200 300 400 500 600 700 800 900 1000
Number of Nodes
107