1 Slides from Richard Yang with minor modification Peer-to-Peer Systems: DHT and Swarming.

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
Peer-to-Peer Systems Chapter 25. What is Peer-to-Peer (P2P)? Napster? Gnutella? Most people think of P2P as music sharing.
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.
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.
Robert Morris, M. Frans Kaashoek, David Karger, Hari Balakrishnan, Ion Stoica, David Liben-Nowell, Frank Dabek Chord: A scalable peer-to-peer look-up protocol.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Robert Morris Ion Stoica, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT.
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.
CompSci 356: Computer Network Architectures Lecture 21: Content Distribution Chapter 9.4 Xiaowei Yang
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.
1 Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Robert Morris Ion Stoica, David Karger, M. Frans Kaashoek, Hari Balakrishnan.
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.
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.
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.
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.
Peer To Peer Distributed Systems Pete Keleher. Why Distributed Systems? l Aggregate resources! –memory –disk –CPU cycles l Proximity to physical stuff.
Peer-to-Peer Networks Slides largely adopted from Ion Stoica’s lecture at UCB.
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.
Lecture 10 Naming services for flat namespaces. EECE 411: Design of Distributed Software Applications Logistics / reminders Project Send Samer and me.
1CS 6401 Peer-to-Peer Networks Outline Overview Gnutella Structured Overlays BitTorrent.
Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp, Scott Shenker A Scalable, Content- Addressable Network ACIRI U.C.Berkeley Tahoe Networks 1.
CSE 461 University of Washington1 Topic Peer-to-peer content delivery – Runs without dedicated infrastructure – BitTorrent as an example Peer.
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.
Content Overlays (Nick Feamster). 2 Content Overlays Distributed content storage and retrieval Two primary approaches: –Structured overlay –Unstructured.
Introduction of P2P systems
Using the Small-World Model to Improve Freenet Performance Hui Zhang Ashish Goel Ramesh Govindan USC.
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Xiaozhou Li COS 461: Computer Networks (precept 04/06/12) Princeton University.
1 Distributed Hash Tables (DHTs) Lars Jørgen Lillehovde Jo Grimstad Bang Distributed Hash Tables (DHTs)
Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT and Berkeley presented by Daniel Figueiredo Chord: A Scalable Peer-to-peer.
A Scalable Content-Addressable Network (CAN) Seminar “Peer-to-peer Information Systems” Speaker Vladimir Eske Advisor Dr. Ralf Schenkel November 2003.
1 2/4/2008 Network Applications: P2P Applications.
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.
1 Peer-to-Peer Technologies Seminar by: Kunal Goswami (05IT6006) School of Information Technology Guided by: Prof. C.R.Mandal, School of Information Technology.
Structured P2P Overlays. Consistent Hashing – the Basis of Structured P2P Intuition: –We want to build a distributed hash table where the number of buckets.
1 Distributed Hash Table CS780-3 Lecture Notes In courtesy of Heng Yin.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 2: Distributed Hash.
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.
INTERNET TECHNOLOGIES Week 10 Peer to Peer Paradigm 1.
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.
CS694 - DHT1 Distributed Hash Table Systems Hui Zhang University of Southern California.
Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications * CS587x Lecture Department of Computer Science Iowa State University *I. Stoica,
Chapter 29 Peer-to-Peer Paradigm Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Chord P2P Network Some slides taken from the original presentation by the authors.
BitTorrent Vs Gnutella.
CS 268: Lecture 22 (Peer-to-Peer Networks)
(slides by Nick Feamster)
EE 122: Peer-to-Peer (P2P) Networks
CS 268: Peer-to-Peer Networks and Distributed Hash Tables
DHT Routing Geometries and Chord
A Scalable, Content-Addressable Network
CS 162: P2P Networks Computer Science Division
P2P Systems and Distributed Hash Tables
The BitTorrent Protocol
Peer-to-Peer Networks and Distributed Hash Tables
Y. Richard Yang 10/23/2018 Network Applications: Multi-Server Request Routing; Distributed Content Distribution.
MIT LCS Proceedings of the 2001 ACM SIGCOMM Conference
Consistent Hashing and Distributed Hash Table
Presentation transcript:

1 Slides from Richard Yang with minor modification Peer-to-Peer Systems: DHT and Swarming

2 Recap: Objectives of P2P r Share the resources (storage and bandwidth) of individual clients to improve scalability/robustness r Find clients with resources! Internet

Recap: The Lookup Problem Internet N1N1 N2N2 N3N3 N6N6 N5N5 N4N4 Publisher Key=“title” Value=data… Client Lookup(“title”) ? find where a particular document is stored

Recap: The Lookup Problem r Napster (central query server) r Gnutella (decentralized, flooding) r Freenet (search by routing) 4

5 Recap: Kleinberg’s Result on Distributed Search r Question: how many long distance links to maintain so that distributed (greedy) search is effective? r Assume that the probability of a long link is some (  ) inverse-power of the number of lattice steps r Distributed algorithm exists only when probability is proportional to (lattice steps) -d, where d is the dimension of the space

6 Recap: Distributed Search r In other words, a node connects to roughly the same number of nodes in each region A1, A2, A4, A8, where A1 is the set of nodes who are one lattice step away, A2 is those two steps away, …

7 DHT: API

8

Key Issues in Understanding a DHT Design r How does the design map keys to internal representation (typically a metric space)? r Which space is a node responsible? r How are the nodes linked? 9

10 Outline  Admin. and review  P2P  the lookup problem  Napster (central query server; distributed data server)  Gnutella (decentralized, flooding)  Freenet (search by routing)  Content Addressable Network

11 CAN r Abstraction m map a key to a “point” in a multi-dimensional Cartesian space m a node “owns” a zone in the overall space m route from one “point” to another

12 CAN Example: Two Dimensional Space r Space divided among nodes r Each node covers either a square or a rectangular area of ratios 1:2 or 2:1 1

13 CAN Example: Two Dimensional Space r Space divided among nodes r Each node covers either a square or a rectangular area of ratios 1:2 or 2:1 1 2

14 CAN Example: Two Dimensional Space r Space divided among nodes r Each node covers either a square or a rectangular area of ratios 1:2 or 2:

15 CAN Example: Two Dimensional Space r Space divided among nodes r Each node covers either a square or a rectangular area of ratios 1:2 or 2:

16 CAN Example: Two Dimensional Space r Space divided among nodes r Each node covers either a square or a rectangular area of ratios 1:2 or 2:1

17 CAN Insert: Example (1) node I::insert(K,V) I

18 CAN Insert: Example (2) node I::insert(K,V) (1) a = h x (K) b = h y (K) I x = a y = b Example: Key=“Matrix3” h(Key)=60

19 CAN Insert: Example (3) node I::insert(K,V) (1) a = h x (K) b = h y (K) (2) route(K,V) -> (a,b) I x = a y = b

20 CAN Insert: Routing r A node maintains state only for its immediate neighboring nodes r Forward to neighbor which is closest to the target point m a type of greedy, local routing scheme

21 CAN Insert: Example (4) node I::insert(K,V) (1) a = h x (K) b = h y (K) (2) route(K,V) -> (a,b) (3) (K,V) is stored at (a,b) I x = a y = b

22 CAN Retrieve: Example node J::retrieve(K) J

23 CAN Retrieve: Example node J::retrieve(K) (1) a = h x (K) b = h y (K) (2) route “retrieve(K)” to (a,b) J x = a y = b

24 CAN Insert: Join (1) 1) Discover some node “J” already in CAN J 2) pick a random point (p,q) in space new node

25 CAN Insert: Join (2) 3) J routes to (p,q), discovers node N J new node N

26 CAN Insert: Join (3) 4) split N’s zone in half… new node owns one half J new node N Inserting a new node affects only a single other node and its immediate neighbors

27 CAN Evaluations r Guarantee to find an item if in the network r Load balancing m hashing achieves some load balancing m overloaded node replicates popular entries at neighbors r Scalability m for a uniform (regularly) partitioned space with n nodes and d dimensions m storage: per node, number of neighbors is 2d m routing average routing path is (dn 1/d )/3 hops (due to Manhattan distance routing, expected hops in each dimension is dimension length * 1/3) a fixed d can scale the network without increasing per-node state

28 Outline  Admin. and review  P2P  the lookup problem  Napster (central query server; distributed data server)  Gnutella (decentralized, flooding)  Freenet (search by routing)  Content addressable networks  Chord (search by routing/consistent hashing)

29 Chord r Space is a ring r Consistent hashing: m bit identifier space for both keys and nodes m key identifier = SHA-1(key), where SHA-1() is a popular hash function, Key=“Matrix3”  ID=60 m node identifier = SHA-1(IP address) IP=“ ”  ID=123

30 Chord: Storage using a Ring r A key is stored at its successor: node with next higher or equal ID N32 N10 N123 N90 Circular 7-bit ID Space K11, K20 K125, K5, K10 K60 K101 IP=“ ” Key=“Matrix 3” N55

31 How to Search: One Extreme r Every node knows of every other node r Routing tables are large O(N) r Lookups are fast O(1)

32 How to Search: the Other Extreme r Every node knows its successor in the ring r Routing tables are small O(1) r Lookups are slow O(N)

33 Chord Solution: “finger tables” r Node K knows the node that is maintaining K + 2 i, where K is mapped id of current node m increase distance exponentially N80 K+64 K+32 K+16 K+8 K+4 K+2 K+1

34 Joining the Ring r use a contact node to obtain info r transfer keys from successor node to new node r updating fingers of existing nodes

DHT: Chord Node Join r Assume an identifier space [0..8] r Node n1 joins i id+2 i succ Succ. Table

DHT: Chord Node Join r Node n2 joins i id+2 i succ Succ. Table i id+2 i succ Succ. Table

DHT: Chord Node Join r Node n6 joins i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table

DHT: Chord Node Join r Node n0 starts join i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table

DHT: Chord Node Join r After Nodes n0 joins i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table

DHT: Chord Insert Items r Nodes: n1, n2, n0, n6 r Items: f7, f i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table Items 17 i id+2 i succ Succ. Table

7 DHT: Chord Routing r Upon receiving a query for item id, a node: r checks whether stores the item locally r if not, forwards the query to the largest node in its successor table that does not exceed id i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table Items 1 i id+2 i succ Succ. Table query(7)

42 Chord/CAN Summary r Each node “owns” some portion of the key-space m in CAN, it is a multi-dimensional “zone” m in Chord, it is the key-id-space between two nodes in 1-D ring r Files and nodes are assigned random locations in key-space m provides some load balancing probabilistically equal division of keys to nodes r Routing/search is local (distributed) and greedy m node X does not know of a path to a key Z m but if it appears that node Y is the closest to Z among all of the nodes known to X m so route to Y

43 There are other DHT algorithms r Kadmelia r Tapestry (Zhao et al) –Keys interpreted as a sequence of digits –Incremental suffix routing »Source to target route is accomplished by correcting one digit at a time »For instance: (to route from 0312  1643) »0312  2173  3243  2643  1643 –Each node has a routing table r Skip Graphs (Aspnes and Shah)

44 Summary: DHT r Underlying metric space. r Nodes embedded in metric space r Location determined by key r Hashing to balance load r Greedy routing r Typically m O(log n) space at each node m O(log n) routing time

Summary: the Lookup Problem  Unstructured P2P design  Napster (central query server)  Gnutella (decentralized, flooding)  Freenet (search by routing) r Structured P2P design (search by routing) m Chord (a ring) m CAN (zones) 45

46 Outline  Recap  P2P  the lookup problem  Napster (central query server; distributed data server)  Gnutella (decentralized, flooding)  Freenet (search by routing)  Content Addressable Network (virtual zones)  Chord (search by routing on a virtual ring)  the scalability problem

An Upper Bound on Scalability r Assume m need to achieve same rate to all clients m only uplinks can be bottlenecks r What is an upper bound on scalability? 47 server C0C0 client 1 client 2 client 3 client n C1C1 C2C2 C3C3 CnCn

The Scalability Problem  Maximum throughput R = min{C 0, (C 0 +  C i )/n}  The bound is theoretically approachable 48 server C0C0 client 1 client 2 client 3 client n C1C1 C2C2 C3C3 CnCn

Theoretical Capacity: upload is bottleneck  Assume c 0 > ( C 0 +  C i )/n r Tree i: server  client i: c i /(n-1) client i  other n-1 clients r Tree 0: server has remaining c m = c0 – (c1 + c2 + … cn)/(n-1) send to client i: cm/n 49 C0C0 C1C1 C2C2 CiCi CnCn c0c0 cici c1c1 c2c2 cncn c i /(n-1) c m /n R = min{C 0, (C 0 +  C i )/n}

Why not Building the Trees? 50 servers C0C0 client 1 client 2 client 3 client n C1C1 C2C2 C3C3 CnCn  Clients come and go (churn): maintaining the trees is too expensive

Key Design Issues r Robustness m Resistant to churn and failures r Efficiency m A client has content that others need; otherwise, its upload capacity may not be utilized r Incentive: clients are willing to upload m 70% of Gnutella users share no files, m nearly 50% of all responses are returned by the top 1% of sharing hosts r Lookup problem 51 servers C0C0 client 1 client 2 client 3 client n C1C1 C2C2 C3C3 CnCn

Discussion: How to handle the issues? r Robustness r Efficiency r Incentive 52 servers/ seeds C0C0 client 1 client 2 client 3 client n C1C1 C2C2 C3C3 CnCn

53 Outline  Recap  P2P  the lookup problem  the scalability problem  BitTorrent

BitTorrent r A P2P file sharing protocol r Created by Bram Cohen in 2004 r A peer can download pieces concurrently from multiple locations 54

55 File Organization Piece 256KB Block 16KB File Incomplete Piece Piece: unit of information exchange among peers Block: unit of download

56 Outline  Recap  P2P  the lookup problem  the scalability problem  BitTorrent  Lookup

BitTorrent r Mostly tracker based r Tracker-less mode; based on the Kademlia DHT 57

58 BitTorrent: Initialization webserver user HTTP GET MYFILE.torrent S3F5YHG6FEB FG5467HGF367 F456JI9N5FF4E … MYFILE.torrent

Metadata File Structure r Meta info contains information necessary to contact the tracker and describes the files in the torrent m announce URL of tracker m file name m file length m piece length (typically 256KB) m SHA-1 hashes of pieces for verification m also creation date, comment, creator, …

60 Tracker Protocol tracker webserver user “register” ID :6881 ID :5692 ID :4545 … ID :6882 list of peers Peer 40 Peer 2 Peer 1 …

Tracker Protocol r Communicates with clients via HTTP/HTTPS r Client GET request m info_hash: uniquely identifies the file m peer_id: chosen by and uniquely identifies the client m client IP and port m numwant: how many peers to return (defaults to 50) m stats: e.g., bytes uploaded, downloaded r Tracker GET response m interval: how often to contact the tracker m list of peers, containing peer id, IP and port m stats

62 Outline  Recap  P2P  the lookup problem  the scalability problem  BitTorrent  Lookup  Robustness

Robustness r A swarming protocol m Peers exchange info about other peers in the system m Peers exchange piece availability and request blocks from peers 63

64 Peer Protocol (Over TCP) Local PeerRemote Peer ID/Infohash Handshake BitField 1001

Peer Protocol r Unchoke: indicate if a allows b to download r Interest/request: indicate which block to send from b to a 65 requests/ interests

Optional Slides 66

67 Skip List