112
1 Peer-peer and Application-level Networking Don Towsley UMass-Amherst with help of lots of others (J. Kurose, B. Levine, J. Crowcroft, CMPSCI 791N class) © Don Towsley 2002

p2p Tutorial - networking

Embed Size (px)

Citation preview

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 1/112

1

Peer-peer and Application-level

Networking

Don Towsley

UMass-Amherstwith help of lots of others (J. Kurose, B. Levine, J.Crowcroft, CMPSCI 791N class)

© Don Towsley 2002

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 2/112

2

0. Introduction

background

motivation outline of the tutorial

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 3/112

3

Peer-peer networking

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 4/112

4

Peer-peer networking Focus at the application level

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 5/112

5

Peer-peer networking

Peer-peer applications

Napster, Gnutella, CAN: file sharing

ad hoc networks

multicast overlays (e.g., video distribution)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 6/112

6

Peer-peer networking

Q: What are the new technical challenges?

Q: What new services/applications enabled?

Q: Is it just “networking at the application-level”? “There is nothing new under the sun” (William Shakespeare)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 7/112

7

Tutorial Contents

introduction client-server v. P2P architectures

centralized search• Napster

distributed search -flooding

• Gnutella

distributed search -

hashing• CAN, CHORD, …

application-levelmulticast

research issues security modeling more general

applications

summary

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 8/112

8

Client Server v. Peer to Peer(1)

RPC/RMI

synchronous assymmetric

emphasis on language

integration and bindingmodels (stubIDL/XDR compilersetc)

Kerberos stylesecurity – accesscontrol, crypto

messages

asynchronous symmetric

emphasis on service

location, contentaddressing, applicationlayer routing.

anonymity, highavailability, integrity.

harder to get right☺

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 9/112

9

Peer to peer systems actually

old IP routers are peer to peer.

routers discover topology, and maintain it routers are neither client nor server

routers continually talk to each other routers inherently fault tolerant

routers are autonomous

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 10/112

10

Peer to peer systems

nodes have no distinguished role

no single point of bottleneck or failure. need distributed algorithms for

service discovery (name, address, route, metric,etc)

neighbour status tracking

application layer routing (based possibly oncontent, interest, etc)

resilience, handing link and node failures

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 11/112

11

Ad hoc networks and peer2peer

wireless ad hoc networks have many

similarities to peer to peer systems no a priori knowledge 

no given infrastructure

have to construct it from “thin air”!

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 12/112

12

Overlays and peer 2 peer

systems P2p technology often used to create

overlays offering services that could beoffered in the IP level

useful deployment strategy

often economically a way around otherbarriers to deployment

IP was an overlay (on telephone coreinfrastructure)

not all overlays are P2P (AKAMAI)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 13/112

13

P2P Architecture Classification

centralized service location (CSL)

Napster distributed service location with flooding

(DSLF) Gnutella

distributed service location with hashing

(DSLH) CAN, Pastry, Tapestry, Chord

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 14/112

14

Centralized Search Architecture

centralized directoryservice

search

directory

Lord of theRings?

 A, C

A

B

C

D

E

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 15/112

15

NAPSTER

the most (in)famous

not the first (c.f. probably Eternity, fromRoss Anderson in Cambridge)

but instructive for what it gets right, and

also wrong…

also has a political message…and economic

and legal…

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 16/112

16

Napster program for sharing files over the Internet

a “disruptive” application/technology?

history: 5/99: Shawn Fanning (freshman, Northeasten U.)

founds Napster Online music service

12/99: first lawsuit

3/00: 25% UWisc traffic Napster

2/01: US Circuit Court of

Appeals: Napster knew users

violating copyright laws 7/01: # simultaneous online users:

Napster 160K, Gnutella: 40K,

Morpheus: 300K

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 17/112

17

 judge orders napsterto stop in July ‘01

other filesharing appstake over!

gnutella

napster 

fastrack

8M

6M

4M

2M

0.0

   b   i   t  s

  p  e  r  s  e  c

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 18/112

18

Napster: how does it work

Application-level, client-server protocol over point-to-point TCP

Four steps:

connect to Napster server upload your list of files (push) to server.

give server keywords to search the full list with.

select “best” of correct answers. (pings)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 19/112

19

Napster

napster.com

users

File list is

uploaded

1.

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 20/112

20

Napster

napster.com

user

Requestand

results

Userrequestssearch atserver.

2.

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 21/112

21

Napster

napster.com

user

pings pings

User pingshosts thatapparentlyhave data.

Looks forbest  transfer

rate.

3.

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 22/112

22

Napster

napster.com

user

Retrievesfile

User

retrieves file

4.

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 23/112

23

Napster: architecture notes

centralized server:

single logical point of failure can load balance among servers using DNS

rotation

potential for congestion Napster “in control” (freedom is an illusion)

no security: passwords in plain text no authentication

no anonymity

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 24/112

24

Distributed Search/Flooding

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 25/112

25

Distributed Search/Flooding

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 26/112

26

Gnutella

peer-to-peer networking: applicationsconnect to peer applications

focus: decentralized method of searchingfor files

each application instance serves to: store selected files route queries (file searches) from and to its

neighboring peers respond to queries (serve file) if file stored

locally

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 27/112

27

Gnutella

Gnutella history:

3/14/00: release by AOL, almost immediatelywithdrawn too late: 23K users on Gnutella at 8 am this AM many iterations to fix poor initial design (poor

design turned many people off)what we care about:

how much traffic does one query generate?

how many hosts can it support at once? what is the latency associated with querying? is there a bottleneck?

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 28/112

28

Gnutella: how it works

Searching by flooding: if you don’t have the file you want, query 7 of your

partners. if they don’t have it, they contact 7 of their

partners, for a maximum hop count of 10. requests are flooded, but there is no tree

structure. no looping but packets may be received twice. reverse path forwarding(?)

Note: Play gnutella animation at:

http://www.limewire.com/index.jsp/p2p

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 29/112

29

Flooding in Gnutella: loop prevention

Seen already list: “A”

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 30/112

30

Gnutella: initial problems and fixes freeloading: WWW sites offering search/retrieval

from Gnutella network without providing file sharing

or query routing. Block file-serving to browser-based non-file-sharing users

prematurely terminated downloads:

long download times over modems modem users run gnutella peer only briefly (Napster

problem also!) or any users becomes overloaded fix: peer can reply “I have it, but I am busy. Try again

later” late 2000: only 10% of downloads succeed 2001: more than 25% downloads successful (is this success

or failure?)

www.limewire.com/index.jsp/net_improvements

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 31/112

31

Gnutella: initial problems and fixes (more) 2000: avg size of reachable network ony 400-800

hosts. Why so smalll? modem users: not enough bandwidth to provide search

routing capabilities: routing black holes

Fix: create peer hierarchy based on capabilities previously: all peers identical, most modem blackholes

connection preferencing:• favors routing to well-connected peers

• favors reply to clients that themselves serve large number offiles: prevent freeloading

Limewire gateway functions as Napster-like central serveron behalf of other peers (for searching purposes)

www.limewire.com/index.jsp/net_improvements

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 32/112

32

Gnutella Discussion:

architectural lessons learned?

anonymity and security? other?

good source for technical info/openquestions:http://www.limewire.com/index.jsp/tech_papers

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 33/112

33

Kazaa

hierarchical Gnutella

supernodes and regular nodesmost popular p2p app

>120M downloads

not well understood binaries

encryptedcommunications

supernodes

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 34/112

34

hash tables essential building block in software systems

Internet-scale distributed hash tables equally valuable to large-scale distributed

systems?• peer-to-peer systems– CAN, Chord, Pastry, …

• large-scale storage management systems

– Publius, OceanStore,, CFS ...• mirroring on the Web

Internet-scale hash tables

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 35/112

35

hash tables essential building block in software systems

Internet-scale distributed hash tables equally valuable to large-scale distributed

systems?• peer-to-peer systems– CAN, Chord, Pastry, …

• large-scale storage management systems

– Publius, OceanStore,, CFS ...• mirroring on the Web

Internet-scale hash tables

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 36/112

36

Content-Addressable Network

[Ratnasamy,etal]

introduction

design evaluation

strengths & weaknesses

ongoing work

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 37/112

37

Content-Addressable Network

(CAN)

CAN: Internet-scale hash table

interface insert(key,value) value = retrieve(key)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 38/112

38

Content-Addressable Network

(CAN)

CAN: Internet-scale hash table

interface insert(key,value) value = retrieve(key)

properties scalable operationally simple good performance (w/ improvement)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 39/112

39

Outline

introduction

design evaluation

strengths & weaknesses

ongoing work

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 40/112

40

K V

CAN: basic idea

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 41/112

41

CAN: basic idea

insert

(K1,V1)

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 42/112

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 43/112

43

CAN: basic idea

(K1,V1)

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 44/112

44

CAN: basic idea

retrieve (K1)

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

K V

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 45/112

45

CAN: solution

virtual Cartesian coordinate space

entire space is partitioned amongst all thenodes

every node “owns” a zone in the overall space

abstraction

can store data at “points” in the space can route from one “point” to another

point = node that owns the enclosing zone

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 46/112

46

CAN: simple example

1

0 1

1

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 47/112

47

CAN: simple example

1 2

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 48/112

48

CAN: simple example

1

2

3

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 49/112

49

CAN: simple example

1

2

3

4

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 50/112

50

CAN: simple example

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 51/112

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 52/112

52

CAN: simple example

node I::insert(K,V)

I

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 53/112

53

(1) a = hx(K)

CAN: simple example

x = a

node I::insert(K,V)

I

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 54/112

54

(1) a = hx(K)b = h y(K)

CAN: simple example

x = a

 y = b

node I::insert(K,V)

I

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 55/112

55

(1) a = hx(K)b = h y(K)

CAN: simple example

(2) route(K,V) -> (a,b)

node I::insert(K,V)

I

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 56/112

56

CAN: simple example

(2) route(K,V) -> (a,b)

(3) (a,b) stores (K,V)

(K,V)

node I::insert(K,V)

I(1) a = hx(K)b = h y(K)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 57/112

57

CAN: simple example

(2) route “retrieve(K)” to (a,b) (K,V)

(1) a = hx(K)b = h y(K)

node J::retrieve(K)

J

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 58/112

58

Data stored in the CAN is addressed byname (i.e. key), not location (i.e. IP

address)

CAN

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 59/112

59

CAN: routing table

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 60/112

60

CAN: routing

(a,b)

(x,y)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 61/112

61

A node only maintains state for itsimmediate neighboring nodes

CAN: routing

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 62/112

62

CAN: node insertion

Bootstrapnode

1) Discover some node “I” already in CANnew node

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 63/112

63

CAN: node insertion

I

new node1) discover some node “I” already in CAN

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 64/112

64

CAN: node insertion

2) pick random

point in space

I

(p,q)

new node

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 65/112

65

CAN: node insertion

(p,q)

3) I routes to (p,q), discovers node J

I

J

new node

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 66/112

66

CAN: node insertion

newJ

4) split J’s zone in half… new owns one half

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 67/112

67

Inserting a new node affects only a singleother node and its immediate neighbors

CAN: node insertion

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 68/112

68

CAN: node failures

Need to repair the space

recover database (weak point)• soft-state updates• use replication, rebuild database from replicas

repair routing• takeover algorithm

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 69/112

69

CAN: takeover algorithm

simple failures know your neighbor’s neighbors when a node fails, one of its neighbors takes over its

zone

more complex failure modes simultaneous failure of multiple adjacent nodes scoped flooding to discover neighbors hopefully, a rare event

d f l

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 70/112

70

Only the failed node’s immediate neighborsare required for recovery

CAN: node failures

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 71/112

71

Design recap

basic CAN completely distributed self-organizing nodes only maintain state for their immediate neighbors

additional design features multiple, independent spaces (realities) background load balancing algorithm

simple heuristics to improve performance

E l

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 72/112

72

Evaluation

scalability low-latency load balancing

robustness

C N l bili

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 73/112

73

CAN: scalability

for a uniformly partitioned space with n nodes and d

dimensions per node, number of neighbors is 2d

average routing path is (dn1/d)/4 hops

simulations show that the above results hold in practice

can scale the network without increasing per-node

state

optimal choice of d for given n yields

~log(n) nbrs with ~log(n) hops

CAN l l

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 74/112

74

CAN: low-latency

#nodes

                                                                                                                                                                  L                                                                                                                       a        

                                                                                                                                                   t                                                                                                                    e      

                                                                                                                   n                                                                                                                        c                                                                                                                      y                                                             

                                                                                                                       s                                                                                                                                                         t       

                                                                                                              r                                                                                                                   e                                                                                                                                                         t       

                                                                                                               c                                                                                                                                                                                 h       

0

20

40

60

80

100

120

140

160

180

16K 32K 65K 131K

w/o heuristics

w/ heuristics

#dimensions = 2

0

2

4

6

8

10

#nodes16K 32K 65K 131K

#dimensions = 10

CAN l d b l i

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 75/112

75

CAN: load balancing

dealing with hot-spots popular (key,value) pairs nodes cache recently requested entries

overloaded node replicates popular entries atneighbors

uniform coordinate space partitioning uniformly spread (key,value) entries

uniformly spread out routing load

U if P titi i

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 76/112

76

Uniform Partitioning

added check at join time, pick a zone

check neighboring zones

pick the largest zone and split that one

CAN d i ti

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 77/112

77

CAN: node insertion

(p,q)

CAN d i ti

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 78/112

78

CAN: node insertion

CAN d i ti

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 79/112

79

CAN: node insertion

U if P titi i

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 80/112

80

0

20

40

60

80

100

Uniform Partitioning

V 2V 4V 8V

Volume

           P                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     e                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

                               r                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       e                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

                             t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 g                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

                     e                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

                           o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                f                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

                     d                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                e                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

                            s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

w/o check

w/ check

V = total volumen

V16 V8 V4 V2

65,000 nodes, 3 dimensions

CAN R b t

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 81/112

81

CAN: Robustness

completely distributed no single point of failure ( not applicable to pieces of

database when node failure happens)

not exploring database recovery (in casethere are multiple copies of database)

resilience of routing

can route around trouble

St th

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 82/112

82

Strengths

more resilient than flooding broadcastnetworks

efficient at locating information

fault tolerant routing

node & Data High Availability (w/improvement)

manageable routing table size & networktraffic

can build variety of services (application

multicast)

M lti st

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 83/112

83

Multicast

associate multicastgroup with index, I

reverse pathforwarding tree

I

M lti st

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 84/112

84

Multicast

associate multicastgroup with index, I

reverse pathforwarding tree

send to (hx(I),h y(I))

I

W kn ss s

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 85/112

85

Weaknesses

impossible to perform a fuzzy search

susceptible to malicious activitymaintain coherence of all the indexed data

(network overhead, efficient distribution)

still relatively higher routing latency poor performance w/o improvement

nodes coming and going?

Summary

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 86/112

86

Summary

CAN

an Internet-scale hash table

potential building block in Internet applications

scalability O(d) per-node state

low-latency routing simple heuristics help a lot

robust

decentralized, can route around trouble

R l t d W k

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 87/112

87

Related Work

Tapestry Zhao, Kubiatowicz, Joseph (UCB)

Chord Stoica, Morris, Karger, Kaashoek,

Balakrishnan (MIT / UCB) Pastry

Druschel and Rowstron

(Rice / Microsoft Research)

Basic Idea of Chord

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 88/112

88

Basic Idea of Chord

m  bit identifier space for both keys and nodes

Key identifier = SHA-1(key)Key=“LetItBe”  ID=60SHA-1

IP=“198.10.10.1”  ID=123SHA-1

node identifier = SHA-1(IP address)

both are uniformly distributed

how to map key IDs to node IDs?

Consistent Hashing [Kar er 97]

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 89/112

89

Consistent Hashing [Karger 97]

A key is stored at its successor: node with next higher ID

N32

N90

N123   K20

K5

Circular 7-bitID space

0IP=“198.10.10.1” 

K101

K60Key=“LetItBe” 

Consistent Hashing

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 90/112

90

Consistent Hashing

every node knows of every other node

requires global information

routing tables are large O(N) lookups are fast O(1)

N32

N90

N123

0

Hash(“LetItBe”) = K60

N10

N55

Where is “LetItBe”?

 “A has K60” 

K60

Chord: Basic Lookup

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 91/112

91

Chord: Basic Lookup

N32

N90

N123

0

Hash(“LetItBe”) = K60

N10

N55

Where is “LetItBe”?

 “A has K60” 

K60

every node knows its successor in the ring

requires O(N) time

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 92/112

“Finger Tables”

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 93/112

93

Finger Tables

finger i  points to successor of n+2 i 

table contains O(log N) entries

N120

N80

80 + 20

N112

N96

N16

80 + 21

80 + 22

80 + 23

80 + 24

80 + 25 80 + 26

Lookups are Faster

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 94/112

94

Lookups are Faster

lookups take O(Log N) hops

N32

N10

N5

N20

N110

N99

N80

N60

Lookup(K19)

K19

Issues

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 95/112

95

Issues

 joins/leaves

load balancing…

Performance

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 96/112

96

Performance

several measurement studies (Napster,Gnutella) highly variable connection times

lots of freeloading

little analysis

Performance Modeling [Ge etal]

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 97/112

97

Performance Modeling [Ge, etal]

evaluation of different architectures

population of users cycle through on-off states

system provides common services (e.g., search) download services

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 98/112

98

1

M

think timecommonservices

file downloadservices

off-line

 µs(Na)

 µs(Na,·)

qf (Na,, )

Download Services

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 99/112

99

Download Services

heavy tailed, Zipf preference distribution,p

i

∝ 1/i α

service capacity proportional to popularity µf(Na,i) = pi Cf

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 100/112

Solution Methods

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 101/112

101

Solution Methods

bounding analysis

fixed point solutions

Comparison of Three

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 102/112

102

Architectures CSL has services

bottleneck

DSLF suffers fromoccasional failure tofind file

DSLH more scalable1

10

100

1000

1.E+04 1.E+05 1.E+06 1.E+07 1.E+08 1.E+09

Total Population: N

   S  y  s   t  e  m    T

  r  o  u  g   h  p  u   t  :   T

CIA

DIFA

DIHA

CSL

DSLF

DSLH

Supernodes (Kazaa)

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 103/112

103

0

500

1000

1500

2000

2500

3000

0 1E+08 2E+08 3E+08 4E+08Total Population: N

   S  y  s   t  e  m    T   h

  r  o  u  g   h  p  u   t  :   T

capacity: supernode/other node = 10/1,

#supernode/#node=1/52.250capacity: supernode/other node = 2/1,

#supernode/#node=1/11.250

capacity: supernode/other node = 1/1,#supernode/#node=1/6.125

Supernodes (Kazaa)

hierarchy helps

placing well-

provisioned nodes attop good idea

Anonymity: Crowds [Reiter98]

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 104/112

104

Anonymity: Crowds [Reiter98]

decentralized P2P solution

anonymous within the Crowd jondo (John Doe)

Proxy

User path based

Path-basedI iti t

Packets passed from initiator, I, to peershi h d li th k t t th

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 105/112

105

Initiator

Anonymity

R

X

Y

Z

I

which deliver the packet to the

responder R.

Crowds • weighted coin flip

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 106/112

106

Paths

R

X

Y

Z

I

g p• spinner

Performance Issues

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 107/112

107

Performance Issues

routing in overlays incurs a performancepenalty can it be quantified?

can it be mitigated?

dynamic nature of user population robustness?

performance?

tradeoff between service location paradigms?

Performance Issues

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 108/112

108

Performance Issues

p2p file sharing vs. CDN/web (Akamai) compare robustness?

compare performance?

handling flash crowds?

p2p measurement kazaa!!

security of p2p how to measure/evaluate security

Wrapup discussion questions (1):

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 109/112

109

Wrapup discussion questions (1): What is a peer-peer network (what is not a peer-to-peer

network?). Necessary:

every node is designed to (but may not by user choice)

 provide some service that helps other nodes in thenetwork get service

each node potentially has the same responsibility,functionality (maybe nodes can be polymorhpic)

some applications (e.g., Napster) are a mix of peer-peerand centralized (lookup is centralized, file service ispeer-peer) [recursive def. of peer-peer]

(logical connectivity rather than physical connectivity)routing will depend on service and data

Overlays?

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 110/112

110

Overlays?

What is the relationship between peer-peer and

application overlay networks? peer-peer and application overlays are different things.

It is possible for an application level overlay to be built

using peer-peer (or vice versa) but not always necessary overlay: in a wired net: if two nodes can communicate in

the overlay using a path that is not the path the networklevel routing would define for them. Logical network on

top of underlying network• source routing?

wireless ad hoc nets – what commonality is thereREALLY?

Wrapup discussion questions (3):

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 111/112

111

Wrapup discussion questions (3)

is ad hoc networking a peer-peer application? Yes (30-1)

why peer-peer over client-server? A well-deigned p2p provides better “scalability” why client-server over peer-peer

peer-peer is harder to make reliable

availability different from client-server (p2p is moreoften only partially “up”) more trust is required

if all music were free in the future (and organized), would we

have peer-peer. Is there another app: ad hoc networking, any copyrighted data,

peer-peer sensor data gathering and retrieval, simulation

evolution #101 – what can we learn about systems?

8/11/2019 p2p Tutorial - networking

http://slidepdf.com/reader/full/p2p-tutorial-networking 112/112

THANKS!

slides can be found athttp://gaia.cs.umass.edu/towsley/p2p-tutorial.pdf