Docsity

Lecture 24: Peer to Peer Data Management - CS4420 by Ling Liu, Georgia Tech, Study notes of Computer Science

Partial preview of the text

Download Lecture 24: Peer to Peer Data Management - CS4420 by Ling Liu, Georgia Tech and more Study notes Computer Science in PDF only on Docsity!

1

CS

©Ling Liu©Ling Liu

Lecture 24

Peer to Peer

Data Management

Ling Liu

Associate Professor

Georgia Tech

Extracted from CHORD slides, Hector Garcia-Molina [ICDE’ Keynote slides], Calton Pu Gnutella Slides

CS4420 Database Implementation

2

CS Lecture

Lecture 24 Outline

z What and why Peer to Peer

z Gnutella P2P Network

3

CS

©Ling Liu©Ling Liu

Introduction

z P2P Vs client-server architecture

‹All machines are equal <=> PEERS.

‹No distinction between powerful servers

and resource poor clients.

z Why P2P?

‹Utilize all resources available on a WAN.

‹Distributed systems are inherently fault

tolerant.

4

CS Lecture

A peer-to-peer storage problem

z 1000 scattered music enthusiasts

z Willing to store and serve replicas

z How do you find the data?

Internet

N 1

N 2 N

3

N N^4

5

N (^1000) ……

7

CS

©Ling Liu©Ling Liu

Distributed Solution

Robust, but worst case O( N ) messages per lookup

Publisher@N 4

Client

N 6

N 9

N 7 N^8

N 3

N 1 N^2

Key=“title” Value=MP3 data…

Lookup(“title”)

„ Flooded queries (Gnutella, Morpheus, etc.)

8

CS Lecture

Distributed Data Management

z Distribution is expensive

z If you must distribute:

‹build centralized directory, index

„ use backups for reliability

‹for replicated data, use primary copy

„ use backups for reliability

9

CS

©Ling Liu©Ling Liu

Computational Efficiency is NOT Main Goal

z Main driving force in a P2P system:

‹exploiting existing (often free) resources

‹sharing costs among many

‹legal protection

‹autonomy

‹anonymity

10

CS Lecture

Why peer-to-peer?

Reducing:

  1. Cost of dedicated web servers

No additional hardware

  1. Administrative costs

Self-organizing

  1. Scaling needs upgrading

Resources grow with clients

  1. Single point of failure

Fault-tolerant by design

13

CS

©Ling Liu©Ling Liu

Gnutella History

z AOL acquires Nullsoft

‹Justin Frankel and Tom Pepper wrote the

original software called Gnutella

‹Gnutella is posted for one day (2000/03)

z Gnutella reverse-engineered and

refined

‹“Pure” Peer-to-Peer (no servers)

14

CS Lecture

P2P case study - Gnutella

z P2P file sharing application on top of an overlay network ‹ Nodes join network via a known peer. ‹ Nodes maintain open TCP Conn. ‹ Queries are broadcasted (flooded). ‹ Queries have a Time to live (TTL). ‹ Queries have a unique ID. ‹ When a peer receives a duplicate query, it is simply dropped.

15

CS

©Ling Liu©Ling Liu

Gnutella

query

16

CS Lecture

Current Techniques: Gnutella

= forward query = processed query

= source

= found result = forward response

Breadth-First Search (BFS)

19

CS

©Ling Liu©Ling Liu

Search Protocol

z Gnutella request by a peer A creates ‹ Search String S ‹ (Unique) Request ID N ‹ Time-to-Live T (and hops passed)

z Check local system, if not found ‹ Sends ( A, S, N, T ) to all Gnutella neighbors ‹ Flooding is not scalable

20

CS Lecture

z 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.

z Stop flooding by checking

‹Unique ID (stop when seen twice)

‹Hop count exceeded

Flooding Protocol

21

CS

©Ling Liu©Ling Liu

Propagation (forwarding) Protocol

z B Receives Gnutella request (A, S, N, T). ‹ If B has already received request N or T=0, B drops this request and does nothing. z B looks up S locally, and if results found B sends (N, Result) to A. z If not found locally, ‹ B sends ( B, S, N, T-1 ) to all of its Gnutella neighbors, and it records the fact that A has made the request N z When B receives a response of the form (N, Result) from one of its neighbors, it forwards this response to A.

22

CS Lecture

Group Membership

z Join with a PING to announce self ‹ Receivers forward the PING to neighbors ‹ Receivers back-propagate a PONG to announce self: IP address, number/size of shared files

z Periodic refresher of network state ‹ PING again ‹ Well-known root nodes if starting from scratch

25

CS

©Ling Liu©Ling Liu

Some Statistics

z Network size growth in 7 months ‹ From 2K to 48K nodes

z Network instability ‹ About 40% of nodes live less then 4 hours ‹ About 25% of nodes live more than 24 hours

z Message types in June 2001 ‹ About 91% queries ‹ About 8% PING messages

26

CS Lecture

Network Diameter

27

CS

©Ling Liu©Ling Liu

Power-Law Hypothesis

z Self-organizing networks follow power-law

‹# Nodes with L links is proportional to L-K

‹Many nodes with a few links

‹A few nodes with many links

z Gnutella network seems more resilient

‹Nodes have more than a few links

28

CS Lecture

Node Connectivity

31

CS

©Ling Liu©Ling Liu

Analysis of Gnutella

z Routing scalability

‹Mapping of overlay network on physical

infrastructure (awareness)

z Other issues

‹Security and survivability

‹Personalization (Zipf distribution of

queries)

‹Caching for skewed query distribution

32

CS Lecture

P2P Challenges

z Search

z Resource Management

z Security & Privacy

33

CS

©Ling Liu©Ling Liu

P2P Search

z Develop search techniques for “loose” systems that are ‹ Efficient ‹ Simple (easy to implement, no hidden costs) ‹ Realistically and thoroughly evaluated

z Open issues: ‹ More efficient! ‹ Make intelligent use of topology, replication ‹ Take advantage of heterogeneity (e.g., super-peers)

34

CS Lecture

P2P Search: Outline

z Search Techniques ‹ Breadth First Search (BFS) ‹ Iterative Deepening (RDFS) ‹ Random Walk ‹ Probabilistic Broadening (PBBFS) z Handling Peer Heterogeneity ‹ Short-Cut Effect ‹ Structuring Overlay Topologies. z Result Caching

37

CS

©Ling Liu©Ling Liu

Results: BW Consumption

  • RDFS after n iterations: dn
  • PBBFS after n iterations: nTTL
  • RDFS is better for smaller values of n => suitable when number of results required is small.
  • PBBFS is better for larger values of n , because it performs informed search.

38

CS Lecture

Results: Latency

  • BFS – Maximum Parallelism => least latency.
  • PBBFS – Informed choices => terminates in smaller number of iterations when compared with RDFS.
  • Both iterative schemes perform badly when threshold > Avg results returned by BFS.

39

CS

©Ling Liu©Ling Liu

Peer Heterogeneity

z Peers by definition are equal. But, in

reality, all peers are not equal.

z Routing anomalies due to differences in network bandwidth (high speed

DSL Vs Dial-up Connection)

‹Short-cut effect: Node receives a message

with lower TTL value first.

‹Bottle-neck link deteriorates TCP throughput.

40

CS Lecture

Short-Cut Effect

1 2

3

4

5

6

7 A

  • Node 2 queries for file A with TTL = 2.
  • Query reaches 4 via 3 earlier than 2 Æ 4.
  • 4 drops query as its TTL is now zero.
  • Now, query from 2 Æ 4 is considered duplicate by 4 and hence dropped.

high speed

low speed