using the small-world model to improve freenet performance hui zhang ashish goel ramesh govindan usc

33
Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Hui Zhang Ashish Goel Ramesh Govindan Govindan USC USC

Upload: lucinda-adams

Post on 12-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

Using the Small-World Model to Improve Freenet Performance

Hui Zhang Ashish Goel Ramesh GovindanHui Zhang Ashish Goel Ramesh Govindan

USCUSC

Page 2: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 2

Peer-to-peer systems

IP overlay networks without any central control or hierarchical organization Each node in the network is equivalent in functionality

A special class: content-addressed networks

a document is accessed using a descriptive title of the content rather than the location where the document is stored.

A data object is represented by a point in a key space.

At the core lies the distributed algorithm for content lookup and dissemination

Page 3: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 3

Structured vs. Unstructured

Structured system

there is global consensus on which network node a document is stored.

Algorithmic mapping between document key and node identifier.

Example CAN, CHORD, Tapestry,

Pastry.

Unstructured system

no such consensus exists Document key and node

identifier are irrelevant.

Example Gnutella, Freenet

Page 4: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 4

Structured vs. Unstructured (cont’d)

Structured system

Advantage Efficient query Guarantee retrieval of

existing documents

Disadvantage Hard to provide

anonymity Problem caused by DoS

and selective attacks

Unstructured system

Advantage Simplicity in network

maintenance Resistant to attacks

Disadvantage Retrieval cost not

bounded Search may fail even if

the requested data exists

Page 5: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 5

Freenet [Clark et al 2001]

A Distributed Anonymous Information Storage and Retrieval System

An adaptive Peer-to-Peer network application

No broadcast search or centralized location index is employed in Freenet

Page 6: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 6

Freenet routing protocol [Clark et al

2001]

Files are identified by binary file keys obtained by applying a hash function.

Each node maintains a datastore and a routing table of <key,pointer> values

LRU (Least Recently Used) route-cache Replacement Scheme

Steepest-ascent hill-climbing search with backtracking.

Page 7: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 7

Our contributions

A new cache replacement scheme for Freenet

A small change to local user behavior leads to a significant global improvement on system performance.

Discovery: A carefully configured unstructured system gives comparable performance as structured systems in terms of the size of the routing table and the average number of hops per request.

Page 8: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 8

An example search in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

Page 9: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 9

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

Key 8?

Page 10: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 10

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

Key 8?

Page 11: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 11

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

No, sorry

Page 12: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 12

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

Key 8?

Page 13: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 13

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

Key 8?

Page 14: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 14

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

Key 8!

Page 15: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 15

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

Key 8!

Page 16: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 16

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D 8 E

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

Key 8!

Page 17: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 17

A searching example in Freenet network

A B

C

D

E

B’s Routing Table Key Pointer

7 C 10 D 8 E

D’s Routing Table Key Pointer

8 E …

E has a copy of key 8

A’s Routing Table Key Pointer

… 8 E

Page 18: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 18

Main premise behind Freenet

The routing in Freenet is expected to run efficiently nodes should come to specialize in

locating sets of similar keys nodes should become similarly

specialized in storing clusters of files having similar keys.

Page 19: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 19

For the original Freenet protocol, there is a steep reduction in the hit ratio with increasing load .

Fig. 1: Hit Ratio vs. Key Size

Ring Topology(300 nodes, cache size=40)

0

0.2

0.4

0.6

0.8

1

1.2

0 10 20 30

# of keys generated per node

Hit

Rat

io

LRU

Simulation Results (I)

Fig.2: Simulation with a larger datastore and routing table.

Ring Topology(300 nodes, cache size=200)

0

0.2

0.4

0.6

0.8

1

1.2

0 10 20 30

# of keys generated per nodeR

equ

est

Hit

Rat

io

LRU

Page 20: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 20

Why can’t Freenet search efficiently under heavy work load?

Hypothesis: Frequent local caching actions could break up clusters caused by the Freenet routing mechanism

Our simulation results showed that Freenet does not achieve clustering with light randomness in its route cache when lots of data items were inserted into the network

Page 21: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 21

Snapshots of Freenet node’s datastore

Key Distribution in Datastore under Light Load

0

1

2

3

4

5

6

0 1E+05

2E+05

3E+05

4E+05

5E+05

6E+05

7E+05

8E+05

9E+05

1E+06

Key Value

Ret

riev

ed T

imes

Fig.3: average number of keys generated per node =2

Key Distribution in Datastore under Heavy Load

0

1

2

3

4

5

6

0 1E+05

2E+05

3E+05

4E+05

5E+05

6E+05

7E+05

8E+05

9E+05

1E+06

Key Value

Ret

riev

ed T

imes

Fig.4: average number of keys generated per node =20

Page 22: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 22

Problem Definition

How can we improve the routing performance of the Freenet protocol efficiently without affecting its design goals?

Two obvious solutions which do not work Increasing the cache-size

the cache-size is locally administered since it depends on individual system resources.

Increasing the HopsToLive value could increase the hit ratio, at the expense of significantly

increased access latency.

Page 23: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 23

Small-world model [Watts et al 1998]

A network between order and randomness short-distance clustering (like regular graph) + long-distance shortcuts (result in short global path

length like random graph)

Local contact

Shortcut

An one-dimensional small-world network example

Page 24: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 24

Kleinberg’s theorem [Kleinberg 1999]

The network model consists of a one-dimensional linear network plus one long-distance shortcut for each node.

The expected steps to delivery a message in the network model is O(log2n) when the shortcut for each node is chosen with the probability inversely proportional to the distance.

Page 25: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 25

Clustering with randomness To improve routing performance, we

want the routing table at node x to conform to the small-world model.

Crucial Observation: Such clustering can be achieved by just changing the route-cache replacement policy

S(x)

Clustered keys

Random key (shortcut)

Key Space

Page 26: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 26

Enhanced-clustering cache replacement scheme

Each node chooses a seed randomly when joining the network

When a new key (file) u is to be cached, the node chooses in the current datastore the key v farthest from the seed

Distance (v, seed) = Max Distance (x, seed)

If Distance (u, seed) < Distance (v, seed), cache u and evict v (clustering)

If Distance (u, seed) > Distance (v, seed), cache u and evict v with probability P (randomness)

Can make P dependent on the two distances

Page 27: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 27

Simulation Results (II)

Fig. 3: Hit Ratio vs. Key Size Fig. 4: Avg. Hops per Successful Request vs. Key Size

Enhanced-clustering with random shortcuts achieves both the highest hit ratio and the lowest avg. hops per successful request.

Ring Topology(300 nodes, cache size=40)

0

0.2

0.4

0.6

0.8

1

1.2

0 10 20 30

# of keys generated per node

Hit

Rat

io

LRU

Enhanced-clustering:P=0

Enhanced-clusteringwith Random shortcuts

Ring Topology(300 nodes, cache size=40)

0

5

10

15

20

0 10 20 30

# of keys generated per nodeA

vg. H

ops

Per

S

ucce

ssfu

l Req

uest

LRU

Enhanced-clustering:P=0

Enhanced-clusteringwith random shortcuts

Page 28: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 28

Network model: transit keys link nodes to nodes

Seed(Y) v

Node X Node Y

2K keys clustering around Seed(Y)

Shortcut of Y

Node X Node Y

Page 29: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 29

An idealized model of Freenet from the node level

Node 1 Node k-1 Node N

N nodes in the Network

Node k Node k+1

Local contact

shortcut

Page 30: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 30

Theorem 1

In the idealized network modelif each node x chooses its random shortcut so that the random shortcut has an endpoint y with probability proportional to 1/d where d = |sx - sy|

E [Number of hops per request] = O(log2n)

using Freenet’s search algorithm.

Page 31: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 31

“misleading” links: two cases

Seed(Y)

Node Y

2K keys clustering around Seed(Y)

Shortcut of Y

Node X Searching direction

(a) A request is passed from X to Y through the shortcut of Y

Seed(Y)

Node Y

2K keys clustering around Seed(Y)

Shortcut of Y

Node X Searching direction

(b) A request is passed from X to Y through the rightmost key of Y

Page 32: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 32

Theorem 2

In the idealized network model considering the effect of “misleading” linksif the routing table size is (log2n) and the shortcuts are chosen in the same way as in Theorem.1

E [Number of hops per request] =

using Freenet’s search algorithm.

O(log2n)O(logn)

Page 33: Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC

INFOCOM 2002 33

Conclusion

System Expected hops per Request

Expected Routing table size

CAN[Ratnaswamy et al 2001] 

O(dn1/d) O(d)

CHORD [Stoica et al 2001]

O(logn) O(logn)

Tapestry [Zhao et al 2000]

O(logn) O(logn)

Kleingbor’s unique Small-world model

O(log2n) O(1)

Freenet in the idealized model

O(logn) O(log2n)

Performance Comparison of several P2P systems