15-441 Computer NetworkingP2P Why P2P?• Scaling: system scales with number of clients, by definition• Eliminate centralization:• Eliminate single point of failure• Eliminate single point of control• Use “spare” capacity•Selfmanaging•Self-managing15-441 S'102Lecture 22: P2PP2P example: file-sharing• Lots of different P2P uses, but file sharing is common and useful example• Issues:ShFi d fil•Search: Find a file• Fetch: Downloading the file•Publish: inserting a new file•Publish: inserting a new file• Join: Maintaining network (e.g., dealing with faults, new members, etc.)15-441 S'103Lecture 22: P2PApproaches to P2P• Centralized• Flooding• Supernodes• Routing• Structured•Unstructured•Un-structured15-441 S'104Lecture 22: P2PCentralized• (How is this P2P?)• Search: ask central server• Fetch: download from a peer• Publish: report to central server• Join: contact central server15-441 S'105Lecture 22: P2PFlooding• Search: ask everyone you know, then they ask, …• How to limit search message traffic?• Publish: implicit• Join: let a peer know you exist•Supernodes help with this but in the end still has same•Supernodes help with this, but in the end still has same properties15-441 S'106Lecture 22: P2PStructured routing: e.g, Chord• We saw how this might work with Chord• Search: use hash to find node.Makes none-exact searches hardFthf i l ?•Fetch: from single peer or ?• Publish: implicit in joining•Join: needs one peer in system•Join: needs one peer in system15-441 S'107Lecture 22: P2PUnstructured routing: E.g., Freenet• Freenet is an example of an unstructured overlay using key-based routing.• Goals•Censorship-resistanceCensorshipresistance• Anonymity: for producers and consumers of data• Nodes don’t even know what they are storing•Survivability:no central servers etc•Survivability:no central servers, etc.• Scalability15-441 S'108Lecture 22: P2PBig Idea: Keys as First-Class ObjectsgyjKeys name both the objects being looked up and the content itself• Content Hash Key• SHA-1 hash of the file/filename that is being stored• Produces 160-bit digest• Hash property: should be difficult to find a different file/filename that hashes to same valueFil k•File key• Key is based on human-readable description of the file (SHA-1 hash) • used to search for content•Problem: same name might be selected for different files•Problem: same name might be selected for different files• Encryption of files•Documents can be encrypted: suggested key is unhashed human9•Documents can be encrypted: suggested key is unhashed human-readable description of filePublishing and Querying in Freenet• Process for both operations is the same!• Keys passed through a chain of proxy requests• Nodes make local decisions about routing queries• Queries have hops-to-live and a unique 64-bit IDpq• Two cases• Node has local copy of file•File returned along reverse path•File returned along reverse path• Nodes along reverse path cache file• Node does not have local copy•Forward to neighbor“thought”to know of a key close to the•Forward to neighbor thought to know of a key close to the requested key• First look up nearest key in routing table and forward request to that neighbor, if that fails, try second nearest key, etc.10that neighbor, if that fails, try second nearest key, etc.Routing Queries in FreenetAfter success, node a creates a link in its routing table for the key to noded.11table for the key to node d.Note: alternatively, any node on path from d to a, egecan name itself as originator of dataFreenet Design• StrengthsDtlid•Decentralized• Anonymous•Scalable•Scalable• Weaknesses• Problem: how to find the names of keys in the first yplace?• No guarantee search will succeed• No file lifetime guarantees• No efficient keyword searchNo defense against DoS attacks12•No defense against DoS attacksFreenet Security Mechanisms• Encryption of messages• Prevents eavesdropping•Hopstolive•Hops-to-live • prevents determining originator of query• prevents determining where the file is stored• Hashing checks data integrity•checks data integrity • prevents intentional data corruption13P2P: summary• Many different types: centralized, flooding, routing• Issues:• Failure mode: single point of failure? Search success?• Flooding is onerous• Network Topology different than overlay topology•Nodes aren’tallthesame•Nodes aren t all the same• Search can be hard15-441 S'1014Lecture 22:
View Full Document