P2P Systems and Distributed Hash Tables

Slides:



Advertisements
Similar presentations
P2P data retrieval DHT (Distributed Hash Tables) Partially based on Hellerstein’s presentation at VLDB2004.
Advertisements

Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT and Berkeley presented by Daniel Figueiredo Chord: A Scalable Peer-to-peer.
Peer to Peer and Distributed Hash Tables
Scalable Content-Addressable Network Lintao Liu
P2P Systems and Distributed Hash Tables Section COS 461: Computer Networks Spring 2011 Mike Freedman
Precept 6 Hashing & Partitioning 1 Peng Sun. Server Load Balancing Balance load across servers Normal techniques: Round-robin? 2.
Chord: A Scalable Peer-to- Peer Lookup Service for Internet Applications Ion StoicaRobert Morris David Liben-NowellDavid R. Karger M. Frans KaashoekFrank.
The Chord P2P Network Some slides have been borowed from the original presentation by the authors.
CHORD: A Peer-to-Peer Lookup Service CHORD: A Peer-to-Peer Lookup Service Ion StoicaRobert Morris David R. Karger M. Frans Kaashoek Hari Balakrishnan Presented.
Chord: A scalable peer-to- peer lookup service for Internet applications Ion Stoica, Robert Morris, David Karger, M. Frans Kaashock, Hari Balakrishnan.
Distributed Hash Tables CPE 401 / 601 Computer Network Systems Modified from Ashwin Bharambe and Robert Morris.
Chord A Scalable Peer-to-peer Lookup Service for Internet Applications
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Ion StoicaRobert Morris David Liben-NowellDavid R. Karger M. Frans KaashoekFrank.
Common approach 1. Define space: assign random ID (160-bit) to each node and key 2. Define a metric topology in this space,  that is, the space of keys.
Peer to Peer File Sharing Huseyin Ozgur TAN. What is Peer-to-Peer?  Every node is designed to(but may not by user choice) provide some service that helps.
Topics in Reliable Distributed Systems Lecture 2, Fall Dr. Idit Keidar.
Introduction to Peer-to-Peer (P2P) Systems Gabi Kliot - Computer Science Department, Technion Concurrent and Distributed Computing Course 28/06/2006 The.
Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications Stoica et al. Presented by Tam Chantem March 30, 2007.
Distributed Lookup Systems
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 2: Peer-to-Peer.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek and Hari alakrishnan.
Chord-over-Chord Overlay Sudhindra Rao Ph.D Qualifier Exam Department of ECECS.
Topics in Reliable Distributed Systems Fall Dr. Idit Keidar.
1 CS 194: Distributed Systems Distributed Hash Tables Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
File Sharing : Hash/Lookup Yossi Shasho (HW in last slide) Based on Chord: A Scalable Peer-to-peer Lookup Service for Internet ApplicationsChord: A Scalable.
INTRODUCTION TO PEER TO PEER NETWORKS Z.M. Joseph CSE 6392 – DB Exploration Spring 2006 CSE, UT Arlington.
Content Overlays (Nick Feamster). 2 Content Overlays Distributed content storage and retrieval Two primary approaches: –Structured overlay –Unstructured.
Chord & CFS Presenter: Gang ZhouNov. 11th, University of Virginia.
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Xiaozhou Li COS 461: Computer Networks (precept 04/06/12) Princeton University.
Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT and Berkeley presented by Daniel Figueiredo Chord: A Scalable Peer-to-peer.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
SIGCOMM 2001 Lecture slides by Dr. Yingwu Zhu Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
Peer to Peer A Survey and comparison of peer-to-peer overlay network schemes And so on… Chulhyun Park
1 Secure Peer-to-Peer File Sharing Frans Kaashoek, David Karger, Robert Morris, Ion Stoica, Hari Balakrishnan MIT Laboratory.
Lecture 12 Distributed Hash Tables CPE 401/601 Computer Network Systems slides are modified from Jennifer Rexford.
1 Distributed Hash Table CS780-3 Lecture Notes In courtesy of Heng Yin.
Chord Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach, Mike Burrows, Tushar Chandra, Andrew Fikes, Robert E. Gruber Google,
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 2: Distributed Hash.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Distributed Hash Tables Steve Ko Computer Sciences and Engineering University at Buffalo.
Algorithms and Techniques in Structured Scalable Peer-to-Peer Networks
LOOKING UP DATA IN P2P SYSTEMS Hari Balakrishnan M. Frans Kaashoek David Karger Robert Morris Ion Stoica MIT LCS.
Two Peer-to-Peer Networking Approaches Ken Calvert Net Seminar, 23 October 2001 Note: Many slides “borrowed” from S. Ratnasamy’s Qualifying Exam talk.
P2P Search COP6731 Advanced Database Systems. P2P Computing  Powerful personal computer Share computing resources P2P Computing  Advantages: Shared.
CS694 - DHT1 Distributed Hash Table Systems Hui Zhang University of Southern California.
CSE 486/586 Distributed Systems Distributed Hash Tables
Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications * CS587x Lecture Department of Computer Science Iowa State University *I. Stoica,
1 Distributed Hash tables. 2 Overview r Objective  A distributed lookup service  Data items are distributed among n parties  Anyone in the network.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 24 – Introduction to Peer-to-Peer (P2P) Systems Klara Nahrstedt (presented by Long Vu)
The Chord P2P Network Some slides taken from the original presentation by the authors.
Peer-to-Peer Information Systems Week 12: Naming
Ion Stoica, Robert Morris, David Liben-Nowell, David R. Karger, M
CSE 486/586 Distributed Systems Distributed Hash Tables
The Chord P2P Network Some slides have been borrowed from the original presentation by the authors.
Distributed Hash Tables
A Scalable Peer-to-peer Lookup Service for Internet Applications
Peer-to-Peer Data Management
(slides by Nick Feamster)
COS 461: Computer Networks
Distributed Hash Tables
EE 122: Peer-to-Peer (P2P) Networks
CS 268: Peer-to-Peer Networks and Distributed Hash Tables
EECS 498 Introduction to Distributed Systems Fall 2017
COS 461: Computer Networks
MIT LCS Proceedings of the 2001 ACM SIGCOMM Conference
Consistent Hashing and Distributed Hash Table
P2P: Distributed Hash Tables
CSE 486/586 Distributed Systems Distributed Hash Tables
A Scalable Peer-to-peer Lookup Service for Internet Applications
Peer-to-Peer Information Systems Week 12: Naming
Presentation transcript:

P2P Systems and Distributed Hash Tables COS 561: Advanced Networking Fall 2012 Mike Freedman http://www.cs.princeton.edu/courses/archive/fall12/cos561/

P2P as Overlay Networking P2P applications need to: Track identities & IP addresses of peers May be many and may have significant churn Route messages among peers If you don’t keep track of all peers, this is “multi-hop” Overlay network Peers doing both naming and routing IP becomes “just” the low-level transport

Early P2P

Early P2P I: Client-Server Napster Client-server search “P2P” file xfer 1. insert 2. search xyz.mp3 xyz.mp3 ? 3. transfer

Early P2P II: Flooding on Overlays search xyz.mp3 xyz.mp3 ? Flooding

Early P2P II: Flooding on Overlays xyz.mp3 xyz.mp3 ? Flooding search

Early P2P II: Flooding on Overlays transfer

Early P2P II: “Ultra/super peers” Ultra-peers can be installed (KaZaA) or self-promoted (Gnutella) Also useful for NAT circumvention, e.g., in Skype

Lessons and Limitations Client-Server performs well But not always feasible: Performance not often key issue! Things that flood-based systems do well Organic scaling Decentralization of visibility and liability Finding popular stuff Fancy local queries Things that flood-based systems do poorly Finding unpopular stuff Fancy distributed queries Vulnerabilities: data poisoning, tracking, etc. Guarantees about anything (answer quality, privacy, etc.)

Structured Overlays: Distributed Hash Tables

Basic Hashing for Partitioning? Consider problem of data partition: Given document X, choose one of k servers to use Suppose we use modulo hashing Number servers 1..k Place X on server i = (X mod k) Problem? Data may not be uniformly distributed Place X on server i = hash (X) mod k Problem? What happens if a server fails or joins (k  k±1)? What is different clients has different estimate of k? Answer: All entries get remapped to new nodes!

Consistent Hashing Consistent hashing partitions key-space among nodes lookup(key1) insert(key1,value) key1=value key1 key2 key3 Consistent hashing partitions key-space among nodes Contact appropriate node to lookup/store key Blue node determines red node is responsible for key1 Blue node sends lookup or insert to red node

Consistent Hashing Partitioning key-space among nodes 0000 0010 0110 1010 1111 1100 1110 URL1 URL2 URL3 0001 0100 1011 Partitioning key-space among nodes Nodes choose random identifiers: e.g., hash(IP) Keys randomly distributed in ID-space: e.g., hash(URL) Keys assigned to node “nearest” in ID-space Spreads ownership of keys evenly across nodes

Consistent Hashing Construction Desired features 14 Consistent Hashing Construction Assign n hash buckets to random points on mod 2k circle; hash key size = k Map object to random position on circle Hash of object = closest clockwise bucket successor (key)  bucket 14 12 4 Bucket 8 Desired features Balanced: No bucket has disproportionate number of objects Smoothness: Addition/removal of bucket does not cause movement among existing buckets (only immediate buckets) Spread and load: Small set of buckets that lie near object

Consistent hashing and failures 15 Consistent hashing and failures Consider network of n nodes If each node has 1 bucket Owns 1/nth of keyspace in expectation Says nothing of request load per bucket If a node fails: Its successor takes over bucket Achieves smoothness goal: Only localized shift, not O(n) But now successor owns 2 buckets: keyspace of size 2/n Instead, if each node maintains v random nodeIDs, not 1 “Virtual” nodes spread over ID space, each of size 1 / vn Upon failure, v successors take over, each now stores (v+1) / vn 14 12 4 Bucket 8

Consistent hashing vs. DHTs Distributed Hash Tables Routing table size O(n) O(log n) Lookup / Routing O(1) Join/leave: Routing updates Join/leave: Key Movement

Distributed Hash Table 0000 0010 0110 1010 1100 1110 1111 0001 0100 1011 Nodes’ neighbors selected from particular distribution Visual keyspace as a tree in distance from a node

Distributed Hash Table 0000 0010 0110 1010 1100 1110 1111 Nodes’ neighbors selected from particular distribution Visual keyspace as a tree in distance from a node At least one neighbor known per subtree of increasing size /distance from node

Distributed Hash Table 0000 0010 0110 1010 1100 1110 1111 Nodes’ neighbors selected from particular distribution Visual keyspace as a tree in distance from a node At least one neighbor known per subtree of increasing size /distance from node Route greedily towards desired key via overlay hops

The Chord DHT Chord ring: ID space mod 2160 Routing correctness: nodeid = SHA1 (IP address, i) for i=1..v virtual IDs keyid = SHA1 (name) Routing correctness: Each node knows successor and predecessor on ring Routing efficiency: Each node knows O(log n) well-distributed neighbors

Basic lookup in Chord Routing Route hop by hop via successors lookup (id): if ( id > me.pred.id && id <= me.id ) return me.id; else return my.succ.lookup (id); Route hop by hop via successors O(n) hops to find destination id Routing

Efficient lookup in Chord lookup (id): if ( id > me.pred.id && id <= me.id ) return me.id; else n = closest_preceding (id); return n.lookup (id); closest_preceding (id): for finger in fingers (): // in decreasing distance if (finger.id <= id) return finger; return me; Routing

Efficient lookup in Chord lookup (id): if ( id > me.pred.id && id <= me.id ) return me.id; else n = closest_preceding (id) return n.lookup (id); Route greedily via distant “finger” nodes O(log n) hops to find destination id Routing

Building routing tables For i in 1...log n: finger[i] = successor ( (my.id + 2i ) mod 2160 )

Joining and managing routing Choose nodeid Lookup (my.id) to find place on ring During lookup, discover future successor Learn predecessor from successor Update succ and pred that you joined Find fingers by lookup ((my.id + 2i ) mod 2160 ) Monitor: If doesn’t respond for some time, find new Leave: Just go, already! (Warn your neighbors if you feel like it)

DHT Design Goals An “overlay” network with: Flexible mapping of keys to physical nodes Small network diameter Small degree (fanout) Local routing decisions Robustness to churn Routing flexibility Decent locality (low “stretch”) Different “storage” mechanisms considered: Persistence w/ additional mechanisms for fault recovery Best effort caching and maintenance via soft state

Storage models Store only on key’s immediate successor Churn, routing issues, packet loss make lookup failure more likely Store on k successors When nodes detect succ/pred fail, re-replicate Cache along reverse lookup path Provided data is immutable …and performing recursive responses

Summary Peer-to-peer systems Distributed hash tables Unstructured systems Finding hay, performing keyword search Structured systems (DHTs) Finding needles, exact match Distributed hash tables Based around consistent hashing with views of O(log n) Chord, Pastry, CAN, Koorde, Kademlia, Tapestry, Viceroy, … Lots of systems issues Heterogeneity, storage models, locality, churn management, underlay issues, … DHTs deployed in wild: Vuze (Kademlia) has 1M+ active users