Lecture 7
    Peer-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
                  ...
Recall: In C/S Architecture, the
server has global information
and decide who is relevant to
who.


               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
...
Maintaining global
information is expensive
(and that’s what we want
to avoid in the first place!)


              8
      ...
Smarter solution:
exchange position, then
decide when should the
next position exchange be.


              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...
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
         ...
Position exchanges occur once
initially, and when a player
moves outside of its irrelevant
region wrt another player.


  ...
Frontier Sets
cell-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
                                    ...
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 po...
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
NOT a frontier for A and I (D is visible from B).


            A           B         C


            D           E       ...
Position exchanges occur once
initially, and when a player
moves outside of its irrelevant
region wrt another player.


  ...
Initialize:
Let player P be in cell X
For each player Q
    Let cell of Q be Y
	

 Compute FXY (or simply FQ)


          ...
Move to new cell:
Let X be new cell
For each player Q
	

 If X not in FQ
	

 Send location to Q



               28
     ...
Receive Update:
(location from Q)
Send location to Q
Recompute FQ


             29
                     29
Update is triggered.


A        B         C


D        E             F


G        H             I



          30
        ...
New Frontier.


A         B         C


D         E         F


G        H          I



           31
                   ...
Update triggered.


A           B           C


D           E           F


G          H            I



             32
 ...
New frontier (empty since E can see G)


        A         B         C


        D         E         F


        G        ...
How to compute frontier?




           34
                           34
A good frontier is as large as
 possible, with two almost
      equal-size sets.



              35
                     ...
Build a visibility graph. Cells are vertices. Two cells are
connected by an edge if they are visible to each other
       ...
Let dist(X,Y) be the shortest
distance between two cells X
 and Y on the visibility graph.



               37
          ...
0       1        2
    A       B    C

2       1        2
    D       E     F

2       3        3
    G       H        I

...
Theorem
FXY = { i | dist(X,i) <= dist(Y,i) - 1}
FYX = { j | dist(Y,j) < dist(X,j) - 1}

are valid frontiers.


           ...
0       3   1        3   2 3
    A           B        C

2       2   1        2   2 4
    D           E         F

2      ...
0       3   1        3   2 3
    A           B        C

2       2   1        2   2 4
    D           E         F

2      ...
0       3   1        3   2 3
    A           B        C

2       2   1        2   2 4
    D           E         F

2      ...
A   B    C


D   E    F


G   H    I



    43
             43
Theorem
FXY = { i | dist(X,i) <= dist(Y,i) - 1}
FYX = { j | dist(Y,j) < dist(X,j) - 1}

are valid frontiers.


           ...
FXY = { i |dist(X,i) <= dist(Y,i) - 1}
FYX = { j |dist(Y,j) < dist(X,j) - 1}


Proof (by contradiction)
Suppose there are ...
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...
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) +...
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(...
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(...
How good is the idea?

(How many messages can we save
    by using Frontier Sets?)



              50
                   ...
q2dm3     q2dm4   q2dm8

  Max dist()    4         5       8
Num of cells   666 1902 966

                    51
         ...
Frontier Density:
% of player-pairs with
non-empty frontiers.


            52
                         52
q2dm3        q2dm4   q2dm8
Frontier
Density    83.9 93.0 84.2


                   53
                                    ...
Frontier Size:
% of cells in the frontier
on average


             54
                             54
q2dm3        q2dm4   q2dm8
Frontier
    Size   38.3% 67.3% 68.2%


                   55
                                 ...
Compare with
1. Naive P2P
2. Perfect P2P


         56
                 56
Naive P2P
Always send update to
15 other players.


           57
                        57
Perfect P2P
Hypothetical protocol
that sends messages
only to visible players.

             58
                          ...
Number of messages per frame per player.


           q2dm3           q2dm4     q2dm8

   NPP       15            15.7    ...
Space Complexity
Let N be the number of cells. If
we precompute Frontier for
every pair of cells, we need
           O(N  ...
If we store visibility graph and
compute frontier as needed,
we only need
           O(N       2)
space.

                ...
Frontier Sets
cell-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 Sets
cell-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....
Keep a list of AOI-neighbors and
exchange messages with AOI-neighbors.




                  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
                 ...
Challenge: Need to discover new neighbors
   even if current node has no neighbor




                    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.

              ...
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
           ...
Boundary
     Neighbors:
     Neighbors whose
     region intersect
     with AOI.

     (may or may not
     be in AOI)

...
Boundary and
     Enclosing
     Neighbor




82
                    82
Regular AOI
     Neighbor:
     Non-boundary
     and non-enclosing
     neighbor in AOI




83
                         83
Unknown nodes
     (not neighbors!)




84
                        84
Type        in AOI?   intersect?   adjacent?

Regular     yes       no           no

Enclosing   maybe     no           ye...
A node always
connect to its
enclosing neigbours,
regardless of whether
they are in the AOI.

     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
                   ...
X join request is forwarded to the node
in charge of the region (i.e., closest node
to X), called acceptor.




          ...
Forwarding is done greedily
(at every step, forward to neighbor closest to X)




                        91
             ...
Acceptor informs the joining node X of its neighbors.
Acceptor, X, and the neighbors update their Voronoi
diagram to inclu...
True or false:

Enclosing neighbors of X are
also enclosing neighbors of
acceptor.

                 93
                  ...
When X moves, X learns about new
neighbors from the boundary neighbors.




                  94
                         ...
Boundary neighbors’ enclosing neighbors
   may become new neighbors of X.




                  95
                       ...
When a node disconnects,Voronoi diagrams are
updated by the affected nodes. New boundary
        neighbors may be discover...
Advantages of VON:

Number of connections
depends on size of AOI, not
size of virtual world


              97
           ...
We can bound number of
connections by adjusting AOI
radius (smaller AOI is crowded
area).



              98
            ...
Advantages of VON:

Maintain a minimal number of
enclosing neighbors when the
world is sparse to ensure
connectivity.

   ...
Advantages of VON:

Boundary neighbors ensure
that new neighbors are
discovered.


             100
                      ...
Problems with VON:

Inconsistency may occur (e.g.
with fast moving nodes)


              101
                            ...
No rigorous proof

Working on evaluation with
realistic traces



             102
                             102
For now, simulation only

     World Size 1200x1200

         Players 100 to 1000

            AOI 100

Connection Limit 2...
Average Transmission per Second

            16
                       basic
            14         dAOI
                 ...
Average Neighbor Size
                50
                         connected neighbors (basic)
                45       AOI...
Observed/Actual AOI Neighbors

                           100.00

                            99.99

                     ...
actual - observed position (average over all nodes)

                          0.50
                          0.45
       ...
Responsive
Consistent
Cheat-Free
   Fair
 Scalable
 Efficient
 Robust
  Simple
             108
Upcoming SlideShare
Loading in …5
×

CS4344 09/10 Lecture 7: P2P Interest Management

755 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
755
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CS4344 09/10 Lecture 7: P2P Interest Management

  1. 1. Lecture 7 Peer-to-Peer Interest Management 8 March 2010 1
  2. 2. Point-to-Point Architecture 2 2
  3. 3. Problem: Communication between every pair of peers 3 3
  4. 4. Idea (old): A peer p only needs to communicate with another peer q if p is relevant to q 4 4
  5. 5. Recall: In C/S Architecture, the server has global information and decide who is relevant to who. 5 5
  6. 6. Problem: No global information in P2P architecture. 6 6
  7. 7. Naive Solution: Every peer keeps global information about all other peers and make individual decision. 7 7
  8. 8. Maintaining global information is expensive (and that’s what we want to avoid in the first place!) 8 8
  9. 9. Smarter solution: exchange position, then decide when should the next position exchange be. 9 9
  10. 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
  11. 11. what if B moves? 11 11
  12. 12. It still works if B also knows A position and computes the region that is irrelevant to A. 12 12
  13. 13. Position exchanges occur once initially, and when a player moves outside of its irrelevant region wrt another player. 13 13
  14. 14. Frontier Sets cell-based, visibility-based IM 14 14
  15. 15. Previously, we learnt how to compute cell-to-cell visibility. 15 15
  16. 16. Frontier for cells X and Y consists of two sets FXY and FYX 16 16
  17. 17. No cell in FXY is visible from a cell in FYX, and vice versa. 17 17
  18. 18. FXY and FYX are disjoint if X and Y are not mutually visible. 18 18
  19. 19. FXY and FYX are empty if X and Y are mutually visible. 19 19
  20. 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. 21. A B C D E F G H I 21 21
  22. 22. A B C D E F G H I 22 22
  23. 23. A B C D E F G H I 23 23
  24. 24. A B C D E F G H I 24 24
  25. 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. 26. Position exchanges occur once initially, and when a player moves outside of its irrelevant region wrt another player. 26 26
  27. 27. Initialize: Let player P be in cell X For each player Q Let cell of Q be Y Compute FXY (or simply FQ) 27 27
  28. 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
  29. 29. Receive Update: (location from Q) Send location to Q Recompute FQ 29 29
  30. 30. Update is triggered. A B C D E F G H I 30 30
  31. 31. New Frontier. A B C D E F G H I 31 31
  32. 32. Update triggered. A B C D E F G H I 32 32
  33. 33. New frontier (empty since E can see G) A B C D E F G H I 33 33
  34. 34. How to compute frontier? 34 34
  35. 35. A good frontier is as large as possible, with two almost equal-size sets. 35 35
  36. 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. 37. Let dist(X,Y) be the shortest distance between two cells X and Y on the visibility graph. 37 37
  38. 38. 0 1 2 A B C 2 1 2 D E F 2 3 3 G H I 38 38
  39. 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. 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. 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. 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. 43. A B C D E F G H I 43 43
  44. 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. 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. 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. 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. 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. 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. 50. How good is the idea? (How many messages can we save by using Frontier Sets?) 50 50
  51. 51. q2dm3 q2dm4 q2dm8 Max dist() 4 5 8 Num of cells 666 1902 966 51 51
  52. 52. Frontier Density: % of player-pairs with non-empty frontiers. 52 52
  53. 53. q2dm3 q2dm4 q2dm8 Frontier Density 83.9 93.0 84.2 53 53
  54. 54. Frontier Size: % of cells in the frontier on average 54 54
  55. 55. q2dm3 q2dm4 q2dm8 Frontier Size 38.3% 67.3% 68.2% 55 55
  56. 56. Compare with 1. Naive P2P 2. Perfect P2P 56 56
  57. 57. Naive P2P Always send update to 15 other players. 57 57
  58. 58. Perfect P2P Hypothetical protocol that sends messages only to visible players. 58 58
  59. 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. 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. 61. If we store visibility graph and compute frontier as needed, we only need O(N 2) space. 61 61
  62. 62. Frontier Sets cell-based, visibility-based IM 62 62
  63. 63. Limitations 63 63
  64. 64. Works badly if there’s little occlusion in the virtual world. 64 64
  65. 65. Still need to exchange locations with every other players occasionally. 65 65
  66. 66. Frontier Sets cell-based, visibility-based IM 66 66
  67. 67. Voronoi Overlay Network: Aura-based Interest Management 67 67
  68. 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. 69. Keep a list of AOI-neighbors and exchange messages with AOI-neighbors. 69 69
  70. 70. Q: How to initialize AOI-neighbors? 70 70
  71. 71. Q: How to update AOI-neighbors? 71 71
  72. 72. Problem: No global information in P2P architecture. 72 72
  73. 73. Idea: Find closest node and ask for introductions 73 73
  74. 74. Idea: New AOI-neighbors will likely be neighbors of my existing AOI-neighbors. 74 74
  75. 75. Challenge: Need to discover new neighbors even if current node has no neighbor 75 75
  76. 76. Question: How to find closest node? 76 76
  77. 77. Every node is in charge of a region in the virtual world. The region contains points closest to the node. 77 77
  78. 78. Voronoi Diagram 78 78
  79. 79. AOI Neighbors: Neighbors in AOI 79 79
  80. 80. Enclosing Neighbors: Neighbors in adjacent region. (may or may not be in AOI) 80 80
  81. 81. Boundary Neighbors: Neighbors whose region intersect with AOI. (may or may not be in AOI) 81 81
  82. 82. Boundary and Enclosing Neighbor 82 82
  83. 83. Regular AOI Neighbor: Non-boundary and non-enclosing neighbor in AOI 83 83
  84. 84. Unknown nodes (not neighbors!) 84 84
  85. 85. Type in AOI? intersect? adjacent? Regular yes no no Enclosing maybe no yes Boundary maybe yes no Enclosing maybe yes yes +Boundary 85
  86. 86. A node always connect to its enclosing neigbours, regardless of whether they are in the AOI. 86 86
  87. 87. A node connects to exchanges updates with all neighbors. 87 87
  88. 88. A node maintains Voronoi of all neighbors (regardless of inside AOI or not) 88 88
  89. 89. Suppose a player X wants to join. X sends its location to any node in the system. 89 89
  90. 90. X join request is forwarded to the node in charge of the region (i.e., closest node to X), called acceptor. 90 90
  91. 91. Forwarding is done greedily (at every step, forward to neighbor closest to X) 91 91
  92. 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
  93. 93. True or false: Enclosing neighbors of X are also enclosing neighbors of acceptor. 93 93
  94. 94. When X moves, X learns about new neighbors from the boundary neighbors. 94 94
  95. 95. Boundary neighbors’ enclosing neighbors may become new neighbors of X. 95 95
  96. 96. When a node disconnects,Voronoi diagrams are updated by the affected nodes. New boundary neighbors may be discovered. 96 96
  97. 97. Advantages of VON: Number of connections depends on size of AOI, not size of virtual world 97 97
  98. 98. We can bound number of connections by adjusting AOI radius (smaller AOI is crowded area). 98 98
  99. 99. Advantages of VON: Maintain a minimal number of enclosing neighbors when the world is sparse to ensure connectivity. 99 99
  100. 100. Advantages of VON: Boundary neighbors ensure that new neighbors are discovered. 100 100
  101. 101. Problems with VON: Inconsistency may occur (e.g. with fast moving nodes) 101 101
  102. 102. No rigorous proof Working on evaluation with realistic traces 102 102
  103. 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. 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. 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. 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. 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
  108. 108. Responsive Consistent Cheat-Free Fair Scalable Efficient Robust Simple 108

×