Chapter 10 Peer-To-Peer Systems
Total Page:16
File Type:pdf, Size:1020Kb
CSF661 – Distributed Systems 分散式系統 Chapter 10 Peer-to-Peer Systems 吳俊興 國立高雄大學 資訊工程學系 Chapter 10 Peer-to-Peer Systems 10.1 Introduction 10.2 Napster and its legacy 10.3 Peer-to-peer middleware 10.4 Routing overlays 10.5 Overlay case studies: Pastry, Tapestry 10.6 Application case studies – Squirrel web cache – OceanStore file store – Ivy file system 10.7 Summary 2 10.1 Introduction Paradigm Shift of Computing System Models 1980~ 1990~ 2000~ Terminal-Mainframe Client-Server Peer-to-Peer (Super-computing) (Micro-computing (Macro-computing) /Personal Computer) RS-232 Dialup/10M Ethernet ADSL/100M+ Ethernet VT100/DOS Windows 31/95 Linux/Windows XP 3 Client-server Model Clients and servers each with distinct roles Request Clients Server U11 Service U12 S U13 U21 The server and the network U22 become the bottlenecks and points of failure U32 U31 •DDoS •Flash Crowd 4 Peer-to-peer Model “ Peer-to-Peer (P2P) is a way of structuring distributed applications such that the individual nodes have symmetric roles. Rather than being divided into clients and servers each with quite distinct roles, in P2P applications a node may act as both a client and a server.” Excerpt from the Charter of Peer-to-Peer Research Group, IETF/IRTF, June 24, 2003 http://www.irtf.org/charters/p2prg.html Peers play similar roles No distinction of responsibilities 5 Content Distribution Networks U11 U12 CR1 S U13 CRa CRb U21 Overlay Network CR2 U22 CR3 Hosting + Hierarchical Proxies Content Router + DNS Request Routing CR or Peer Node U32 U31 (Akamai, CacheFlow, etc.) Name: lb1.www.ms.akadns.net Addresses: 207.46.20.60, 207.46.18.30, 207.46.19.30, 207.46.19.60, 207.46.20.30 Aliases: www.microsoft.com, toggle.www.ms.akadns.net, g.www.ms.akadns.net Name: www.yahoo.akadns.net Addresses: 66.94.230.33, 66.94.230.34, 66.94.230.35, 66.94.230.39, 66.94.230.40, … Aliases: www.yahoo.com Name: e96.g.akamaiedge.net Address: 202.177.217.122 Aliases: www.gio.gov.tw, www.gio.gov.tw.edgekey.net Name: a1289.g.akamai.net Addresses: 203.133.9.9, 203.133.9.11 Aliases: www.whitehouse.gov, www.whitehouse.gov.edgesuite.net 6 Characteristics of P2P Systems • Ensures that each user contributes resources to the system • All the nodes have the same functional capabilities and responsibilities • Their correct operation does not depend on the existence of any centrally-administered systems • They can be designed to offer a limited degree of anonymity to the providers and users of resources • A key issue: placement of data across many hosts – efficiency – load balance – availability 7 Generations • Early services – DNS, Netnews/Usenet – Xerox Grapevine name/mail service – Lamport’s part-time parliament algorithm – Bayou replicated storage system – classless inter-domain IP routing algorithm • 1st generation – centralized search – Napster • 2nd generation – decentralized, unstructured – Freenet, Gnutella, Kazaa, BitTorrent • 3rd generation – decentralized, structured – P2P middleware: Pastry, Tapestry, CAN, Chord, Kademlia 8 Example of Centralized P2P Systems: Napster • Announced in January 1999 by Shawn Fanning for sharing MP3 files and pulled plug in July 2001 • Centralized server for search, Directory direct file transfer among peer nodes • Proprietary client-server protocol P P and client-client protocol • Relying on the user to choose a ‘best’ source • Disruptive, proof of concepts • IPR and firewall issues 9 Example of Decentralized P2P Systems: Gnutella • Open source • 3/14/2000: Released by NullSoft/AOL, almost 2 2 2 2 immediately withdrawn, and 1 became open source 1 Client 3 2 • Message flooding: serverless, C S decentralized search by 1 1 Server 3 message broadcast, direct file transfer using HTTP • Limited-scope query Servent (=Serv er + Cli ent) 10 Figure 10.12: Key elements in the Gnutella protocol 11 Example of Unstructured P2P Systems: Freenet • Ian Clarke, Scotland, 2000 • Distributed depth-first search, Exhaustive search • File hash key, lexicographically closest 5 match 6 • Store-and-forward file transfer C S 3 1 2 • Anonymity 4 • Open source 12 Example of Hybrid P2P Systems: FastTrack / KaZaA • Proprietary software developed by FastTrack in Amsterdam and licensed to many companies • Summer 2001, Sharman networks, founded in Vanuatu, acquires FastTrack Supernodes in overlay mesh • Hierarchical supernodes (Ultra- C peers) • Dedicated authentication server and supernode list server S • From user’s perspective, it’s like Google. • Encrypted files and control data transported using HTTP • Parallel download • Automatically switch to new server 13 Example of Structured P2P Systems: Chord 0 15 1 • Frans Kaashoek, et. al., MIT, 14 2 2001 • IRIS: Infrastructure for Resilient 13 3 Internet Systems, 2003 12 4 • Distributed Hashing Table • Scalable lookup service 11 5 • Hyper-cubic structure 10 6 9 8 7 14 Figure 10.11: Structured versus unstructured peer-to-peer systems Benefits from P2P •Theory – Dynamic discovery of information – Better utilization of bandwidth, processor, storage, and other resources – Each user contributes resources to network • Practice examples – Sharing browser cache over 100Mbps lines – Disk mirroring using spare capacity – Deep search beyond the web 16 Figure 10.1 Distinctions between IP and overlay routing for P2P applications IP Application-level routing overlay Scale IPv4 is limited to 232 addressable nodes. The Peer-to-peer systems can address more objects. IPv6 name space is much more generous The GUID name space is very large and flat (2128), but addresses in both versions are (>2128), allowing it to be much more fully hierarchically structured and much of the space occupied. is pre-allocated according to administrative requirements. Load balancing Loads on routers are determined by network Object locations can be randomized and hence topology and associated traffic patterns. traffic patterns are divorced from the network topology. Network dynamics IP routing tables are updated asynchronously on Routing tables can be updated synchronously or (addition/deletion of a best-efforts basis with time constants on the asynchronously with fractions of a second objects/nodes) order of 1 hour. delays. Fault tolerance Redundancy is designed into the IP network by Routes and object references can be replicated its managers, ensuring tolerance of a single n-fold, ensuring tolerance of n failures of nodes router or network connectivity failure. n-fold or connections. replication is costly. Target identification Each IP address maps to exactly one target Messages can be routed to the nearest replica of node. a target object. Security and anonymity Addressing is only secure when all nodes are Security can be achieved even in environments trusted. Anonymity for the owners of addresses with limited trust. A limited degree of is not achievable. anonymity can be provided. 17 Distributed Computation • Only a small portion of the CPU cycles of most computers is utilized. Most computers are idle for the greatest portion of the day, and many of the ones in use spend the majority of their time waiting for input or a response. • A number of projects have attempted to use these idle CPU cycles. The best known is the SETI@home project, but other projects including code breaking have used idle CPU cycles on distributed machines. • SETI@home project: a scientific experiment that uses Internet-connected computers to analyze radio telescope data in the Search for Extraterrestrial Intelligence (SETI) http://setiathome.ssl.berkeley.edu/ 18 Dangers and Attacks on P2P • Poisoning (files with contents different to description) • Polluting (inserting bad packets into the files) • Defection (users use the service without sharing) • Insertion of viruses (attached to other files) • Malware (originally attached to the files) • Denial of Service (slow down or stop the network traffic) • Filtering (some networks don’t allow P2P traffic) • Identity attacks (tracking down users and disturbing them) • Spam (sending unsolicited information) 19 10.2 Napster and its legacy • The first large scale peer-to-peer network was Napster, set up in 1999 to share digital music files over the Internet. While Napster maintained centralized (and replicated) indices, the music files were created and made available by individuals, usually with music copied from CDs to computer files. Music content owners sued Napster for copyright violations and succeeded in shutting down the service. Figure 10.2 documents the process of requesting a music file from Napster. 20 Figure 10.2 Napster: peer-to-peer file sharing peers Napster server Napster server Index 1. File location Index request 3. File request 2. List of peers offering the file 5. Index update 4. File delivered 21 Napster: Lessons Learned • Napster created a network of millions of people, with thousands of files being transferred at the same time. • There were quality issues. While Napster displayed link speeds to allow users to choose faster downloads, the fidelity of recordings varied widely. • Since Napster users were parasites of the recording companies, there was some central control over selection of music. One benefit was that music files did not need updates. • There was no guarantee of availability for a particular item of music. 22 10.3 Middleware for Peer-to-Peer • A key problem in Peer-to-Peer applications is to provide a way for clients to access data resources efficiently. – Similar needs in client/server technology led to solutions like NFS. – However, NFS relies on pre-configuration and is not scalable enough for peer-to-peer. • Peer clients need to locate and communicate with any available resource, even though resources may be widely distributed and configuration may be dynamic, constantly adding and removing resources and connections. 23 Non-Functional Requirements for Peer-to-Peer Middleware • Global Scalability • Load Balancing • Local Optimization • Adjusting to dynamic host availability • Security of data • Anonymity, deniability, and resistance to censorship (in some applications) 24 10.4 Routing Overlays •A routing overlay is a distributed algorithm for a middleware layer responsible for routing requests from any client to a host that holds the object to which the request is addressed.