1 Distributed Hash Table CS780-3 Lecture Notes In courtesy of Heng Yin.

Slides:



Advertisements
Similar presentations
CAN 1.Distributed Hash Tables a)DHT recap b)Uses c)Example – CAN.
Advertisements

P2P data retrieval DHT (Distributed Hash Tables) Partially based on Hellerstein’s presentation at VLDB2004.
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
Pastry Peter Druschel, Rice University Antony Rowstron, Microsoft Research UK Some slides are borrowed from the original presentation by the authors.
Scalable Content-Addressable Network Lintao Liu
Kademlia: A Peer-to-peer Information System Based on the XOR Metric Petar Mayamounkov David Mazières A few slides are taken from the authors’ original.
Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Schenker Presented by Greg Nims.
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.
Thomas ZahnCST1 Seminar: Information Management in the Web Query Processing Over Peer- to-Peer Data Sharing Systems (UC Santa Barbara)
A Scalable Content Addressable Network (CAN)
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.
Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Shenker A Scalable, Content- Addressable Network (CAN) ACIRI U.C.Berkeley Tahoe Networks.
Topics in Reliable Distributed Systems Lecture 2, Fall Dr. Idit Keidar.
A Scalable Content Addressable Network Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp, and Scott Shenker Presented by: Ilya Mirsky, Alex.
A Scalable Content-Addressable Network Authors: S. Ratnasamy, P. Francis, M. Handley, R. Karp, S. Shenker University of California, Berkeley Presenter:
Distributed Lookup Systems
A Scalable Content- Addressable Network Sections: 3.1 and 3.2 Καραγιάννης Αναστάσιος Α.Μ. 74.
1 A Scalable Content- Addressable Network S. Ratnasamy, P. Francis, M. Handley, R. Karp, S. Shenker Proceedings of ACM SIGCOMM ’01 Sections: 3.5 & 3.7.
Content Addressable Networks. CAN Associate with each node and item a unique id in a d-dimensional space Goals –Scales to hundreds of thousands of nodes.
Chord-over-Chord Overlay Sudhindra Rao Ph.D Qualifier Exam Department of ECECS.
SkipNet: A Scaleable Overlay Network With Practical Locality Properties Presented by Rachel Rubin CS294-4: Peer-to-Peer Systems By Nicholas Harvey, Michael.
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.
Decentralized Location Services CS273 Guest Lecture April 24, 2001 Ben Y. Zhao.
Wide-area cooperative storage with CFS
P2P Course, Structured systems 1 Introduction (26/10/05)
Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Shenker A Scalable, Content- Addressable Network ACIRI U.C.Berkeley Tahoe Networks 1.
A Scalable Content-Addressable Network
Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Shenker A Scalable, Content- Addressable Network ACIRI U.C.Berkeley Tahoe Networks 1.
Structured P2P Network Group14: Qiwei Zhang; Shi Yan; Dawei Ouyang; Boyu Sun.
INTRODUCTION TO PEER TO PEER NETWORKS Z.M. Joseph CSE 6392 – DB Exploration Spring 2006 CSE, UT Arlington.
1 A scalable Content- Addressable Network Sylvia Rathnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Shenker Pirammanayagam Manickavasagam.
Roger ZimmermannCOMPSAC 2004, September 30 Spatial Data Query Support in Peer-to-Peer Systems Roger Zimmermann, Wei-Shinn Ku, and Haojun Wang Computer.
Other Structured P2P Systems CAN, BATON Lecture 4 1.
CONTENT ADDRESSABLE NETWORK Sylvia Ratsanamy, Mark Handley Paul Francis, Richard Karp Scott Shenker.
Chord & CFS Presenter: Gang ZhouNov. 11th, University of Virginia.
Applied Research Laboratory David E. Taylor A Scalable Content-Addressable Network Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Shenker.
Sylvia Ratnasamy (UC Berkley Dissertation 2002) Paul Francis Mark Handley Richard Karp Scott Shenker A Scalable, Content Addressable Network Slides by.
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Xiaozhou Li COS 461: Computer Networks (precept 04/06/12) Princeton University.
1 Peer-to-Peer Systems. 2 Introduction What is peer One that of equal standing with another Peer-to-peer A way of structure distributed applications Each.
1 Distributed Hash Tables (DHTs) Lars Jørgen Lillehovde Jo Grimstad Bang Distributed Hash Tables (DHTs)
Vincent Matossian September 21st 2001 ECE 579 An Overview of Decentralized Discovery mechanisms.
Content Addressable Network CAN. The CAN is essentially a distributed Internet-scale hash table that maps file names to their location in the network.
A Scalable Content-Addressable Network (CAN) Seminar “Peer-to-peer Information Systems” Speaker Vladimir Eske Advisor Dr. Ralf Schenkel November 2003.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
Content Addressable Networks CAN is a distributed infrastructure, that provides hash table-like functionality on Internet-like scales. Keys hashed into.
Scalable Content- Addressable Networks Prepared by Kuhan Paramsothy March 5, 2007.
P2P Group Meeting (ICS/FORTH) Monday, 28 March, 2005 A Scalable Content-Addressable Network Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp,
1 Secure Peer-to-Peer File Sharing Frans Kaashoek, David Karger, Robert Morris, Ion Stoica, Hari Balakrishnan MIT Laboratory.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 2: Distributed Hash.
1. Efficient Peer-to-Peer Lookup Based on a Distributed Trie 2. Complex Queries in DHT-based Peer-to-Peer Networks Lintao Liu 5/21/2002.
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.
1 Distributed Hash Tables and Structured P2P Systems Ningfang Mi September 27, 2004.
P2P Search COP6731 Advanced Database Systems. P2P Computing  Powerful personal computer Share computing resources P2P Computing  Advantages: Shared.
P2P Search COP P2P Search Techniques Centralized P2P systems  e.g. Napster, Decentralized & unstructured P2P systems  e.g. Gnutella.
CSCI 599: Beyond Web Browsers Professor Shahram Ghandeharizadeh Computer Science Department Los Angeles, CA
Fabián E. Bustamante, Fall 2005 A brief introduction to Pastry Based on: A. Rowstron and P. Druschel, Pastry: Scalable, decentralized object location and.
Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications * CS587x Lecture Department of Computer Science Iowa State University *I. Stoica,
Ion Stoica, Robert Morris, David Liben-Nowell, David R. Karger, M
Distributed Hash Tables
A Scalable content-addressable network
CONTENT ADDRESSABLE NETWORK
A Scalable, Content-Addressable Network
Reading Report 11 Yin Chen 1 Apr 2004
A Scalable Content Addressable Network
A Scalable, Content-Addressable Network
Consistent Hashing and Distributed Hash Table
Presentation transcript:

1 Distributed Hash Table CS780-3 Lecture Notes In courtesy of Heng Yin

2 Standard Hashing M-1 i 0 1 H(a)=i List for H(a)=0 List for H(a)=M-1 Hashing function: H = a mod M a: numerical ID M: Hashing table size

3 Basic Hashing Operations Insert (a, S): insert object a to Set S. –Compute h(a); –Search the list pointed by Table[ h(a) ]; if a is not on the list, it is appended in the list. Delete (a, S): delete object a from set S. –Search the list pointed by Table[ h(a) ] and delete object a in the list; Find (a, S): find object a in Set S. –Search the list pointed by Table [ h(a) ]; if a is on the list, returns its location, otherwise returns Null.

4 Distributed Hash Table (DHT) Problem: given an object stored in a node or multiple nodes, find it. The Lookup problem (Find (a, S)): S is distributed and stored in many nodes. –Returns the network location of the node currently responsible for the given key. Take a 2-d CAN as an example (a Ph.D. dissertation at Berkeley)

5 K V k v a. Hash tableb. Distributed hash table From Hash Table to DHT Insert(k1, v1) (k1,v1) Retrive(k1) ?

6 From Hash Table to DHT (cont) Requirements: Data should be identified using unique numeric keys using hash function such as SHA-1 Nodes should be willing to store keys for each other. “Core” questions when introducing “distributed”: How to divide a whole hash table to multiple distributed hash tables? How to reach the hash table who has the key I want, if I cannot find it from the local hash table?

7 Content Addressable Network The overlay nodes are built on a 2-D coordinate space. Join: a new peer node –Chooses a random point P in the 2-D space; –Asks a node in P2P to find node n in P; –Node n splits the zone into two, assigns ½ to the new nodes; Insert: a key is hashed on to a point in the 2-D space, and is stored at the node whose zone contains the point’s space. Routing Table: each node contains the logic locations of all its neighbors in the 2-D space.

8 2-D CAN (continued) Lookup: after a peer joins, it forwards the request (a hashed location) along a routing path to the node storing the key. –a move instruction is made based on the routing table. Each node maintains O(d) states, lookup cost is O(dN^(1/d)), where d = dimension, N = # of nodes.

9 Case Study: CAN CAN: Content- Addressable Network Basic Data Structure: d- dimensional Cartesian coordinate space Every key (k) is mapped to a point (x,y) in the coordinate space x = h1(k), y = h2(k); The coordinate space = key space K1 K3 K4 K2

10 Zone: answer to question 1 This coordinate space is partitioned into distinct zones. Every node holds a distinct zone A node should store all keys that fall into the zone it owns K1 K3 K4 K

11 Routing: answer to question 2 Every node only maintains the states of its neighbors Forward lookup request to a neighbor closer to the key in the coordinate space K1 K3 K4 K2 A B Node A wants to lookup k3

12 Insertion & Retrieval in CAN K1 K3 K4 K2 A B 1. Node A inserts (k3, v3) C 2. x3=h1(k3), y3=h2(k3) x3 y3 3. Route Insertion request to (x3,y3) 4. (x3, y3) is in the zone of node B, so node B should store (k3,v3) in its hash table 5. Node C retrieves k3 6. Computes x3, y3 like A does 7. Route lookup request to (x3,y3) 8. Node B receives lookup request, and retrieves (k3, v3) from its hash table

13 How does a new node join the CAN? Bootstrap –The new node find a node already in the CAN Finding a zone –Find a node randomly whose zone will be split JOIN request message Splitting Hand over part of (key, value) pairs Joining the routing –The neighbors of the split zone is notified so that routing can include the new node 1 1’s coordinate neighbor set = {2, 3, 4, 5}.P.P 1’s coordinate neighbor set = {2, 3, 4, 7} 7’s coordinate neighbor set = {1, 2, 4, 5}

14 One more example K1 K3 K4 K2 1 pick a random point in space

15 One more example K1 K3 K4 K2 12

16 One more example K1 K3 K4 K

17 One more example K1 K3 K4 K

18 How does a node depart? K1 K3 K4 K Node 5 is leaving 7 8 6

19 How does a node depart? K1 K3 K4 K Node 7 is leaving 7 8 6

20 How does a node depart? K1 K3 K4 K

21 Detect failures –Send periodic update message to neighbors Need to repair the space –recover database soft-state updates use replication, rebuild database from replicas –repair routing takeover algorithm CAN: node failures

22 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

23 Why Unstructured P2P Co-exists? When peers are highly dynamic and transient, maintenance and updating of DHT will be too expensive to afford. Little effect to U-P2P. DHT only provides information of ``needles”, not ``hails”, which can only provided by U-P2P. DHT only provides ``key word” search. The search in U-P2P can be very vague, leave a large space for a wide range of development, such as semantic Web.

24 Operation Cost of CAN States of neighbors –2d Average path length –(d/4)(n 1/d ) Note that other algorithms like CHORD, TAPSTRY and PASTRY route in O(log n) hops with each node maintaining O(log n) neighbors. If we select d=(log n)/2, we could achieve the same scaling properties.

25 Design Improvements Goals: Reduce the latency of CAN routing Improve CAN robustness in routing and data availability Load balancing Techniques: Multi-dimensioned coordinate spaces Realities: multiple coordinate spaces Better CAN routing metrics Overloading coordinate zones Multiple hash functions Topologically-sensitive construction of the CAN overlay network More Uniform Partitioning Caching and Replication for “hot spot”

26 Mutiple-dimensioned coordinate spaces Reduces the path length: O(d(n 1/d) ) Improves the routing fault tolerance

27 Realities: multiple coordinate spaces Improves data availability Reduces the average path length

28 Multiple dimension vs. multiple realities Multiple dimensions are more “efficient” than multiple realities in term of reducing packet length Multiple realities offer other benefits such as improved data availability and fault- tolerance.

29 Better CAN routing metrics RTT-weighted routing Choose the neighbor with the maximum ratio of progress to RTT Reduce the latency of individual hopes along the path, rather than the path length

30 Overloading coordinate zones Multiple nodes share the same zone (MAXPEERS = 3, or 4) Split the zone only when zone is full (already MAXPEERS nodes) Check RTT of all nodes in each neighboring zone, and retain closest nodes in its neighbor set. The contents of the hash table may be divided or replicated across the nodes in a zone.

31 Overloading coordinate zones (cont) Advantages: Reduced path length Reduced per-hop latency Improved fault tolerance

32 Multiple hash functions Use k different hash functions to map a single key onto k points in the coordinate space, then k replicas Choose to retrieve an entry closest in the coordinate space, then reducing path latency

33 Topologically-sensitive construction of CAN overlay: Landmark ordering Landmark ordering for U and U’: {L2, L1, L3, L4} L1L2L3L4 Landmark nodes Nodes with same landmark ordering are likely to be close V Landmark ordering for V: {L2,L3,L4,L1} v1v2v3v4 u1u2 u3 u4 UU’

34 Landmark ordering Landmarks (for example, DNS root servers) m Landmarks, m! orderings Partition the coordinate space into m! equal sized portions A node joins CAN at a random point in that portion associate with its ordering

35 Latency savings due to landmark ordering Stretch = latency on the CAN / the average latency on the IP network The coordinate space is no longer uniformly populated

36 More uniform partitioning New node

37 Caching and Replication Caching: cache the data keys it recently accessed. Replication: overloaded node can replicate the data key at its neighbors.

38 Effect of design parameters In no cases do we see a latency stretch of more than 3 for system sizes up to 130,000 nodes.

39 Open questions for DHT Operation costs Path lengths:O(logn) vs. O(dn 1/d ) hops (Others vs. CAN) Neighbors : O(logn) vs. O(d)(Others vs. CAN) Can one achieve O(logn) path lengths (or better) with O(1) neighbors? (Answer: Koorde) Fault tolerance and concurrent changes high cost for simultaneous failures Proximity routing More efficient algorithm? Security Malicious nodes and false routes Indexing and keyword search

40 Discussion: merits & limits of DHT Merits: Decentralized management: relieve managing burden avoid a single point of failure A common interface make implementation of distributed apps much easier Scalability: lookup cost: O(logN), O(dN 1/d ) Fault tolerance routing and data availability Limits: How to implement keyword lookup based on DHT? Requirements on participants: memory and storage size, CPU speed Incompatibility between DHTs Your opinions…

41 Thank you very much! REFERENCES: [1] “Looking Up Data in P2P Systems” [2] “A Scalable Content-Addressable Network”, SIGCOMM’01 [3] “Koorde: A simple degree-optimal distributed hash table”