108
Lecture 7 Peer-to-Peer Interest Management 8 March 2010 1

CS4344 09/10 Lecture 7: P2P Interest Management

Embed Size (px)

Citation preview

Page 1: CS4344 09/10 Lecture 7: P2P Interest Management

Lecture 7Peer-to-Peer

Interest Management

8 March 2010

1

Page 2: CS4344 09/10 Lecture 7: P2P Interest Management

Point-to-Point Architecture

2

2

Page 3: CS4344 09/10 Lecture 7: P2P Interest Management

Problem: Communication between

every pair of peers

3

3

Page 4: CS4344 09/10 Lecture 7: P2P Interest Management

Idea (old): A peer p only needs to communicate with another peer q if p is relevant to q

4

4

Page 5: CS4344 09/10 Lecture 7: P2P Interest Management

Recall: In C/S Architecture, the server has global information and decide who is relevant to who.

5

5

Page 6: CS4344 09/10 Lecture 7: P2P Interest Management

Problem: No global information in P2P architecture.

6

6

Page 7: CS4344 09/10 Lecture 7: P2P Interest Management

Naive Solution: Every peer keeps global information about all other peers and make individual decision.

7

7

Page 8: CS4344 09/10 Lecture 7: P2P Interest Management

Maintaining global information is expensive (and that’s what we want to avoid in the first place!)

8

8

Page 9: CS4344 09/10 Lecture 7: P2P Interest Management

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

9

9

Page 10: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 11: CS4344 09/10 Lecture 7: P2P Interest Management

what if B moves?

11

11

Page 12: CS4344 09/10 Lecture 7: P2P Interest Management

It still works if B also knows A position and computes the region that is irrelevant to A.

12

12

Page 13: CS4344 09/10 Lecture 7: P2P Interest Management

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

13

13

Page 14: CS4344 09/10 Lecture 7: P2P Interest Management

Frontier Setscell-based, visibility-based IM

14

14

Page 15: CS4344 09/10 Lecture 7: P2P Interest Management

Previously, we learnt how to compute cell-to-cell visibility.

15

15

Page 16: CS4344 09/10 Lecture 7: P2P Interest Management

Frontier for cells X and Y consists of

two sets FXY and FYX

16

16

Page 17: CS4344 09/10 Lecture 7: P2P Interest Management

No cell in FXY is visible from a cell in FYX, and vice versa.

17

17

Page 18: CS4344 09/10 Lecture 7: P2P Interest Management

FXY and FYX are disjoint if X and Y are not mutually visible.

18

18

Page 19: CS4344 09/10 Lecture 7: P2P Interest Management

FXY and FYX are empty if X and Y are mutually visible.

19

19

Page 20: CS4344 09/10 Lecture 7: P2P Interest Management

Suppose X and Y are not mutually visible, then a simple frontier is

FXY = {X} FYX = {Y}

(many others are possible)

20

20

Page 21: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

21

21

Page 22: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

22

22

Page 23: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

23

23

Page 24: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

24

24

Page 25: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

NOT a frontier for A and I (D is visible from B).

25

25

Page 26: CS4344 09/10 Lecture 7: P2P Interest Management

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

26

26

Page 27: CS4344 09/10 Lecture 7: P2P Interest Management

Initialize: Let player P be in cell XFor each player Q Let cell of Q be Y Compute FXY (or simply FQ)

27

27

Page 28: CS4344 09/10 Lecture 7: P2P Interest Management

Move to new cell:Let X be new cellFor each player Q If X not in FQ

Send location to Q

28

28

Page 29: CS4344 09/10 Lecture 7: P2P Interest Management

Receive Update: (location from Q)Send location to QRecompute FQ

29

29

Page 30: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

Update is triggered.

30

30

Page 31: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

New Frontier.

31

31

Page 32: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

Update triggered.

32

32

Page 33: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

New frontier (empty since E can see G)

33

33

Page 34: CS4344 09/10 Lecture 7: P2P Interest Management

How to compute frontier?

34

34

Page 35: CS4344 09/10 Lecture 7: P2P Interest Management

A good frontier is as large as possible, with two almost

equal-size sets.

35

35

Page 36: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 37: CS4344 09/10 Lecture 7: P2P Interest Management

Let dist(X,Y) be the shortest distance between two cells X and Y on the visibility graph.

37

37

Page 38: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

0 1 2

212

2 3 3

38

38

Page 39: CS4344 09/10 Lecture 7: P2P Interest Management

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

are valid frontiers.

39

39

Page 40: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 41: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 42: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 43: CS4344 09/10 Lecture 7: P2P Interest Management

A B C

D E F

G H I

43

43

Page 44: CS4344 09/10 Lecture 7: P2P Interest Management

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

are valid frontiers.

44

44

Page 45: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 46: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 47: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 48: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 49: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 50: CS4344 09/10 Lecture 7: P2P Interest Management

How good is the idea?

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

50

50

Page 51: CS4344 09/10 Lecture 7: P2P Interest Management

q2dm3 q2dm4 q2dm8

Max dist()

Num of cells

4 5 8

666 1902 966

51

51

Page 52: CS4344 09/10 Lecture 7: P2P Interest Management

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

52

52

Page 53: CS4344 09/10 Lecture 7: P2P Interest Management

q2dm3 q2dm4 q2dm8

Frontier Density 83.9 93.0 84.2

53

53

Page 54: CS4344 09/10 Lecture 7: P2P Interest Management

Frontier Size: % of cells in the frontier on average

54

54

Page 55: CS4344 09/10 Lecture 7: P2P Interest Management

q2dm3 q2dm4 q2dm8

Frontier Size 38.3% 67.3% 68.2%

55

55

Page 56: CS4344 09/10 Lecture 7: P2P Interest Management

Compare with1. Naive P2P2. Perfect P2P

56

56

Page 57: CS4344 09/10 Lecture 7: P2P Interest Management

Naive P2PAlways send update to 15 other players.

57

57

Page 58: CS4344 09/10 Lecture 7: P2P Interest Management

Perfect P2PHypothetical protocol that sends messages only to visible players.

58

58

Page 59: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 60: CS4344 09/10 Lecture 7: P2P Interest Management

Space ComplexityLet N be the number of cells. If we precompute Frontier for every pair of cells, we need

O(N3) space.

60

60

Page 61: CS4344 09/10 Lecture 7: P2P Interest Management

If we store visibility graph and compute frontier as needed, we only need

O(N2) space.

61

61

Page 62: CS4344 09/10 Lecture 7: P2P Interest Management

Frontier Setscell-based, visibility-based IM

62

62

Page 63: CS4344 09/10 Lecture 7: P2P Interest Management

Limitations

63

63

Page 64: CS4344 09/10 Lecture 7: P2P Interest Management

Works badly if there’s little occlusion in the

virtual world.

64

64

Page 65: CS4344 09/10 Lecture 7: P2P Interest Management

Still need to exchange locations with every other

players occasionally.

65

65

Page 66: CS4344 09/10 Lecture 7: P2P Interest Management

Frontier Setscell-based, visibility-based IM

66

66

Page 67: CS4344 09/10 Lecture 7: P2P Interest Management

Voronoi Overlay Network: Aura-based Interest Management

67

67

Page 68: CS4344 09/10 Lecture 7: P2P Interest Management

Diagrams and plots in the sections are taken from presentation slides by

Shun-yun Hu, available on http://vast.sf.net

68

68

Page 69: CS4344 09/10 Lecture 7: P2P Interest Management

Keep a list of AOI-neighbors and exchange messages with AOI-neighbors.

69

69

Page 70: CS4344 09/10 Lecture 7: P2P Interest Management

Q: How to initialize AOI-neighbors?

70

70

Page 71: CS4344 09/10 Lecture 7: P2P Interest Management

Q: How to update AOI-neighbors?

71

71

Page 72: CS4344 09/10 Lecture 7: P2P Interest Management

Problem: No global information in P2P architecture.

72

72

Page 73: CS4344 09/10 Lecture 7: P2P Interest Management

Idea: Find closest node and ask for introductions

73

73

Page 74: CS4344 09/10 Lecture 7: P2P Interest Management

Idea: New AOI-neighbors will likely be neighbors of my existing AOI-neighbors.

74

74

Page 75: CS4344 09/10 Lecture 7: P2P Interest Management

Challenge: Need to discover new neighbors even if current node has no neighbor

75

75

Page 76: CS4344 09/10 Lecture 7: P2P Interest Management

Question: How to find closest node?

76

76

Page 77: CS4344 09/10 Lecture 7: P2P Interest Management

Every node is in charge of a region in the virtual world.

The region contains points closest to the node.

77

77

Page 78: CS4344 09/10 Lecture 7: P2P Interest Management

Voronoi Diagram

78

78

Page 79: CS4344 09/10 Lecture 7: P2P Interest Management

AOI Neighbors:Neighbors in AOI

79

79

Page 80: CS4344 09/10 Lecture 7: P2P Interest Management

Enclosing Neighbors:Neighbors in adjacent region.

(may or may not be in AOI)

80

80

Page 81: CS4344 09/10 Lecture 7: P2P Interest Management

Boundary Neighbors:Neighbors whose region intersect with AOI.

(may or may not be in AOI)

81

81

Page 82: CS4344 09/10 Lecture 7: P2P Interest Management

Boundary andEnclosingNeighbor

82

82

Page 83: CS4344 09/10 Lecture 7: P2P Interest Management

Regular AOI Neighbor:Non-boundaryand non-enclosingneighbor in AOI

83

83

Page 84: CS4344 09/10 Lecture 7: P2P Interest Management

Unknown nodes (not neighbors!)

84

84

Page 85: CS4344 09/10 Lecture 7: P2P Interest Management

Type in AOI? intersect? adjacent?

Regular yes no no

Enclosing maybe no yes

Boundary maybe yes no

Enclosing+Boundary

maybe yes yes

85

Page 86: CS4344 09/10 Lecture 7: P2P Interest Management

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

86

86

Page 87: CS4344 09/10 Lecture 7: P2P Interest Management

A node connects to exchanges updates with all neighbors.

87

87

Page 88: CS4344 09/10 Lecture 7: P2P Interest Management

A node maintains Voronoi of all neighbors(regardless of inside AOI or not)

88

88

Page 89: CS4344 09/10 Lecture 7: P2P Interest Management

Suppose a player X wants to join. X sends its location to any node in the system.

89

89

Page 90: CS4344 09/10 Lecture 7: P2P Interest Management

90

X join request is forwarded to the node in charge of the region (i.e., closest node to X), called acceptor.

90

Page 91: CS4344 09/10 Lecture 7: P2P Interest Management

91

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

91

Page 92: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 93: CS4344 09/10 Lecture 7: P2P Interest Management

True or false:

Enclosing neighbors of X are also enclosing neighbors of acceptor.

93

93

Page 94: CS4344 09/10 Lecture 7: P2P Interest Management

94

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

94

Page 95: CS4344 09/10 Lecture 7: P2P Interest Management

95

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

95

Page 96: CS4344 09/10 Lecture 7: P2P Interest Management

96

When a node disconnects, Voronoi diagrams areupdated by the affected nodes. New boundary

neighbors may be discovered.

96

Page 97: CS4344 09/10 Lecture 7: P2P Interest Management

Advantages of VON:

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

97

97

Page 98: CS4344 09/10 Lecture 7: P2P Interest Management

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

98

98

Page 99: CS4344 09/10 Lecture 7: P2P Interest Management

Advantages of VON:

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

99

99

Page 100: CS4344 09/10 Lecture 7: P2P Interest Management

Advantages of VON:

Boundary neighbors ensure that new neighbors are discovered.

100

100

Page 101: CS4344 09/10 Lecture 7: P2P Interest Management

Problems with VON:

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

101

101

Page 102: CS4344 09/10 Lecture 7: P2P Interest Management

No rigorous proof

Working on evaluation with realistic traces

102

102

Page 103: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 104: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 105: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 106: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 107: CS4344 09/10 Lecture 7: P2P Interest Management

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

Page 108: CS4344 09/10 Lecture 7: P2P Interest Management

Responsive

Consistent

Cheat-Free

Fair

Scalable

Efficient

Robust

Simple

108