Presentation is loading. Please wait.

Presentation is loading. Please wait.

Peer-to-Peer (P2P) networks and applications. What is P2P? r “the sharing of computer resources and services by direct exchange of information”

Similar presentations


Presentation on theme: "Peer-to-Peer (P2P) networks and applications. What is P2P? r “the sharing of computer resources and services by direct exchange of information”"— Presentation transcript:

1 Peer-to-Peer (P2P) networks and applications

2 What is P2P? r “the sharing of computer resources and services by direct exchange of information”

3 What is P2P? r “P2P is a class of applications that take advantage of resources – storage, cycles, content, human presence – available at the edges of the Internet. Because accessing these decentralized resources means operating in an environment of unstable and unpredictable IP addresses P2P nodes must operate outside the DNS system and have significant, or total autonomy from central servers”

4 What is P2P? r “A distributed network architecture may be called a P2P network if the participants share a part of their own resources. These shared resources are necessary to provide the service offered by the network. The participants of such a network are both resource providers and resource consumers”

5 What is P2P? r Various definitions seem to agree on  sharing of resources  direct communication between equals (peers)  no centralized control

6 What is a peer? r “…an entity with capabilities similar to other entities in the system.”

7 Client/Server Architecture r Well known, powerful, reliable server is a data source r Clients request data from server r Very successful model  WWW (HTTP), FTP, Web services, etc. Server Client Internet * Figure from http://project-iris.net/talks/dht-toronto-03.ppt

8 Client/Server Limitations r Scalability is hard to achieve r Presents a single point of failure r Requires administration r Unused resources at the network edge r P2P systems try to address these limitations

9 P2P Architecture r All nodes are both clients and servers  Provide and consume data  Any node can initiate a connection r No centralized data source  “The ultimate form of democracy on the Internet”  “The ultimate threat to copy-right protection on the Internet” * Content from http://project-iris.net/talks/dht-toronto-03.ppt Node Internet

10 P2P Network Characteristics r Clients are also servers and routers  Nodes contribute content, storage, memory, CPU r Nodes are autonomous (no administrative authority) r Network is dynamic: nodes enter and leave the network “frequently” r Nodes collaborate directly with each other (not through well-known servers) r Nodes have widely varying capabilities

11 P2P Goals and Benefits r Efficient use of resources  Unused bandwidth, storage, processing power at the “edge of the network” r Scalability  No central information, communication and computation bottleneck  Aggregate resources grow naturally with utilization r Reliability  Replicas  Geographic distribution  No single point of failure r Ease of administration  Nodes self-organize  Built-in fault tolerance, replication, and load balancing  Increased autonomy r Anonymity – Privacy  not easy in a centralized system r Dynamism  highly dynamic environment  ad-hoc communication and collaboration

12 What is Peer-to-Peer (P2P)?

13 P2P Applications r File sharing (Napster, Gnutella, Kazaa) r Multiplayer games (Unreal Tournament, DOOM) r Collaborative applications (ICQ, shared whiteboard) r Distributed computation (Seti@home) r Ad-hoc networks

14 P2P System Taxonomy r Historic r Data-centric r Computation-centric r User-centric r Network-centric r Platforms

15 Computation-centric

16 User-centric sendMessagereceiveMessagesendMessagereceiveMessage

17 User-centric (Common implementation) sendMessagereceiveMessagesendMessagereceiveMessage

18 Network-centric

19

20 Platforms Find Peers…Send Messages GnutellaInstant Messaging

21 P2P Goals/Benefits r Cost sharing r Resource aggregation r Improved scalability/reliability r Increased autonomy r Anonymity/privacy r Dynamism r Ad-hoc communication

22 P2P Challenges r Decentralization r Scalability and Performance r Anonymity r Fairness r Dynamism r Security r Transparency r Fault Resilience and Robustness

23 Peer-to-Peer Content Sharing

24 Popular file sharing P2P Systems r Napster, Gnutella, Kazaa, Freenet r Large scale sharing of files.  User A makes files (music, video, etc.) on their computer available to others  User B connects to the network, searches for files and downloads files directly from user A r Issues of copyright infringement

25 Research Areas r Peer discovery and group management r Data placement and searching r Reliable and efficient file exchange r Security/privacy/anonymity/trust

26 Design Concerns r Group Management  Per-node state  Load balancing  Fault tolerance/resiliency r Search  Bandwidth usage  Time to locate item  Success rate  Fault tolerance/resiliency

27 Approaches r Centralized r Unstructured r Structured (Distributed Hash Tables)

28 Centralized index original “Napster” design 1) when peer connects, it informs central server:  IP address  content 2) Alice queries for “Hey Jude” 3) Alice requests file from Bob centralized directory server peers Alice Bob 1 1 1 1 2 3

29 Centralized model BobAlice JaneJudy file transfer is decentralized, but locating content is highly centralized

30 Centralized r Benefits:  Low per-node state  Limited bandwidth usage  Short location time  High success rate  Fault tolerant r Drawbacks:  Single point of failure  Limited scale  Possibly unbalanced load r copyright infringement BobAlice JaneJudy

31 Napster r program for sharing files over the Internet r a “disruptive” application/technology? r history:  5/99: Shawn Fanning (freshman, Northeasten U.) founds Napster Online music service  12/99: first lawsuit  3/00: 25% UWisc traffic Napster  2000: est. 60M users  2/01: US Circuit Court of Appeals: Napster knew users violating copyright laws  7/01: # simultaneous online users: Napster 160K, Gnutella: 40K, Morpheus: 300K

32 Napster: how does it work Application-level, client-server protocol over point-to- point TCP Four steps: r Connect to Napster server r Upload your list of files (push) to server. r Give server keywords to search the full list with. r Select “best” of correct answers. (pings)

33 Napster napster.com users File list is uploaded 1.

34 Napster napster.com user Request and results User requests search at server. 2.

35 Napster napster.com user pings User pings hosts that apparently have data. Looks for best transfer rate. 3.

36 Napster napster.com user Retrieves file User retrieves file 4.

37 Napster r Central Napster server  Can ensure correct results  Fast search  Bottleneck for scalability  Single point of failure  Susceptible to denial of service Malicious users Lawsuits, legislation r Hybrid P2P system – “all peers are equal but some are more equal than others”  Search is centralized  File transfer is direct (peer-to-peer)

38 Unstructured r fully distributed  no central server r used by Gnutella r Each peer indexes the files it makes available for sharing (and no other files) overlay network: graph r edge between peer X and Y if there’s a TCP connection r all active peers and edges form overlay net r edge: virtual (not physical) link r given peer typically connected with < 10 overlay neighbors

39 Gnutella: Query flooding Query QueryHit Query QueryHit Query QueryHit File transfer: HTTP r Query message sent over existing TCP connections r peers forward Query message r QueryHit sent over reverse path

40 Gnutella: Peer joining 1. joining peer Alice must find another peer in Gnutella network: use list of candidate peers 2. Alice sequentially attempts TCP connections with candidate peers until connection setup with Bob 3. Flooding: Alice sends Ping message to Bob; Bob forwards Ping message to his overlay neighbors (who then forward to their neighbors….) r peers receiving Ping message respond to Alice with Pong message 4. Alice receives many Pong messages, and can then setup additional TCP connections

41 Unstructured Bob Alice Jane Judy Carl Scalability: limited scope flooding

42 Unstructured r Gnutella model r Benefits:  Limited per-node state  Fault tolerant r Drawbacks:  High bandwidth usage  Long time to locate item  No guarantee on success rate  Possibly unbalanced load Bob Alice Jane Judy Carl

43 Gnutella Searching by flooding: r If you don’t have the file you want, query 7 of your neighbors. r If they don’t have it, they contact 7 of their neighbors, for a maximum hop count of 10. r Requests are flooded, but there is no tree structure. r No looping but packets may be received twice. r Reverse path forwarding * Figure from http://computer.howstuffworks.com/file-sharing.htm

44 Gnutella fool.* ? TTL = 2

45 Gnutella TTL = 1 IP X :fool.her fool.her X TTL = 1

46 Gnutella fool.you fool.me Y IP Y :fool.me fool.you

47 Gnutella IP Y :fool.me fool.you

48 Gnutella: strengths and weaknesses r pros:  flexibility in query processing  complete decentralization  simplicity  fault tolerance/self-organization r cons:  severe scalability problems  susceptible to attacks r Pure P2P system

49 Gnutella: initial problems and fixes r 2000: avg size of reachable network only 400-800 hosts. Why so small?  modem users: not enough bandwidth to provide search routing capabilities: routing black holes r Fix: create peer hierarchy based on capabilities  previously: all peers identical, most modem black holes  preferential connection: favors routing to well-connected peers favors reply to clients that themselves serve large number of files: prevent freeloading

50 Structured r FreeNet, Chord, CAN, Tapestry, Pastry model 001 012 212 305 332 212 ?

51 Structured r FreeNet, Chord, CAN, Tapestry, Pastry model r Benefits:  Manageable per-node state  Manageable bandwidth usage and time to locate item  Guaranteed success r Drawbacks:  Possibly unbalanced load  Harder to support fault tolerance 001 012 212 305 332 212 ?

52 Unstructured vs Structured P2P r The systems we described do not offer any guarantees about their performance (or even correctness) r Structured P2P  Scalable guarantees on numbers of hops to answer a query  Maintain all other P2P properties (load balance, self-organization, dynamic nature) r Approach: Distributed Hash Tables (DHT)

53 Distributed Hash Tables (DHT) r Distributed version of a hash table data structure r Stores (key, value) pairs  The key is like a filename  The value can be file contents, or pointer to location r Goal: Efficiently insert/lookup/delete (key, value) pairs r Each peer stores a subset of (key, value) pairs in the system r Core operation: Find node responsible for a key  Map key to node  Efficiently route insert/lookup/delete request to this node r Allow for frequent node arrivals/departures

54 DHT Desirable Properties r Keys should mapped evenly to all nodes in the network (load balance) r Each node should maintain information about only a few other nodes (scalability, low update cost) r Messages should be routed to a node efficiently (small number of hops) r Node arrival/departures should only affect a few nodes

55 DHT Routing Protocols r DHT is a generic interface r There are several implementations of this interface  Chord [MIT]  Pastry [Microsoft Research UK, Rice University]  Tapestry [UC Berkeley]  Content Addressable Network (CAN) [UC Berkeley]  SkipNet [Microsoft Research US, Univ. of Washington]  Kademlia [New York University]  Viceroy [Israel, UC Berkeley]  P-Grid [EPFL Switzerland]  Freenet [Ian Clarke]

56 Basic Approach In all approaches: r keys are associated with globally unique IDs  integers of size m (for large m) r key ID space (search space) is uniformly populated - mapping of keys to IDs using (consistent) hashing r a node is responsible for indexing all the keys in a certain subspace (zone) of the ID space r nodes have only partial knowledge of other node’s responsibilities

57 Improvements: SuperPeers r KaZaA model r Hybrid centralized and unstructured r Advantages and disadvantages?

58 Hierarchical Overlay r between centralized index, query flooding approaches r each peer is either a super node or assigned to a super node  TCP connection between peer and its super node.  TCP connections between some pairs of super nodes. r Super node tracks content in its children

59 Kazaa (Fasttrack network) r Hybrid of centralized Napster and decentralized Gnutella  hybrid P2P system r Super-peers act as local search hubs  Each super-peer is similar to a Napster server for a small portion of the network  Super-peers are automatically chosen by the system based on their capacities (storage, bandwidth, etc.) and availability (connection time) r Users upload their list of files to a super-peer r Super-peers periodically exchange file lists r You send queries to a super-peer for files of interest

60 File Distribution: Server-Client vs P2P Question : How much time to distribute file from one server to N peers? usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) File, size F u s : server upload bandwidth u i : peer i upload bandwidth d i : peer i download bandwidth

61 File distribution time: server-client usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) F r server sequentially sends N copies:  NF/u s time r client i takes F/d i time to download increases linearly in N (for large N) = d cs = max { NF/u s, F/min(d i ) } i Time to distribute F to N clients using client/server approach

62 File distribution time: P2P usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) F r server must send one copy: F/u s time r client i takes F/d i time to download r NF bits must be downloaded (aggregate)  fastest possible upload rate: u s +  u i d P2P = max { F/u s, F/min(d i ), NF/(u s +  u i ) } i

63 Server-client vs. P2P: example Client upload rate = u, F/u = 1 hour, u s = 10u, d min ≥ u s

64 File distribution: BitTorrent tracker: tracks peers participating in torrent torrent: group of peers exchanging chunks of a file obtain list of peers trading chunks peer r P2P file distribution

65 BitTorrent (1) r file divided into 256KB chunks. r peer joining torrent:  has no chunks, but will accumulate them over time  registers with tracker to get list of peers, connects to subset of peers (“neighbors”) r while downloading, peer uploads chunks to other peers. r peers may come and go r once peer has entire file, it may (selfishly) leave or (altruistically) remain

66 BitTorrent (2) Pulling Chunks r at any given time, different peers have different subsets of file chunks r periodically, a peer (Alice) asks each neighbor for list of chunks that they have. r Alice sends requests for her missing chunks  rarest first Sending Chunks: tit-for-tat r Alice sends chunks to four neighbors currently sending her chunks at the highest rate  re-evaluate top 4 every 10 secs r every 30 secs: randomly select another peer, starts sending chunks  newly chosen peer may join top 4  “optimistically unchoke”

67 BitTorrent: Tit-for-tat (1) Alice “optimistically unchokes” Bob (2) Alice becomes one of Bob’s top-four providers; Bob reciprocates (3) Bob becomes one of Alice’s top-four providers With higher upload rate, can find better trading partners & get file faster!

68 P2P: searching for information File sharing (eg e-mule) r Index dynamically tracks the locations of files that peers share. r Peers need to tell index what they have. r Peers search index to determine where files can be found Instant messaging r Index maps user names to locations. r When user starts IM application, it needs to inform index of its location r Peers search index to determine IP address of user. Index in P2P system: maps information to peer location (location = IP address & port number).

69 P2P Case study: Skype r inherently P2P: pairs of users communicate. r proprietary application-layer protocol (inferred via reverse engineering) r hierarchical overlay with SNs r Index maps usernames to IP addresses; distributed over SNs Skype clients (SC) Supernode (SN) Skype login server

70 Anonymity r Napster, Gnutella, Kazaa don’t provide anonymity  Users know who they are downloading from  Others know who sent a query r Freenet  Designed to provide anonymity among other features

71 Freenet r Keys are mapped to IDs r Each node stores a cache of keys, and a routing table for some keys  routing table defines the overlay network r Queries are routed to the node with the most similar key r Data flows in reverse path of query  Impossible to know if a user is initiating or forwarding a query  Impossible to know if a user is consuming or forwarding data  Keys replicated in (some) of the nodes along the path

72 Freenet routing

73

74

75

76

77

78 N01 N02 N03 N04 N07 N06 N05 N08 K117 N08 K124 N02 K317 N08 K613 N05 K514 N01 K117 N08 K100 N07 K222 N06 K617 N05 117 Inserts are performed similarly – they are unsuccessful queries

79 Freenet strengths and weaknesses r pros:  complete decentralization  fault tolerance/self-organization  anonymity  scalability (to some degree) r cons:  questionable efficiency & performance  rare keys disappear from the system  improvement of performance requires high overhead (maintenance of additional information for routing)

80 P2P Review r Two key functions of P2P systems  Sharing content  Finding content r Sharing content  Direct transfer between peers All systems do this  Structured vs. unstructured placement of data  Automatic replication of data r Finding content  Centralized (Napster)  Decentralized (Gnutella)  Probabilistic guarantees (DHTs)

81 Issues with P2P r Free Riding (Free Loading)  Two types of free riding Downloading but not sharing any data Not sharing any interesting data  On Gnutella 15% of users contribute 94% of content 63% of users never responded to a query –Didn’t have “interesting” data r No ranking: what is a trusted source?  “spoofing”


Download ppt "Peer-to-Peer (P2P) networks and applications. What is P2P? r “the sharing of computer resources and services by direct exchange of information”"

Similar presentations


Ads by Google