Successfully reported this slideshow.

P2P Seminar

3,524 views

Published on

Published in: Technology
  • Be the first to comment

P2P Seminar

  1. 1. Peer to Peer NETWORKING David Tacconi
  2. 2. Outline <ul><li>What is P2P: </li></ul><ul><ul><li>Definitions and basic </li></ul></ul><ul><ul><li>History </li></ul></ul><ul><li>Principal P2P applications </li></ul><ul><li>P2P goes mobile </li></ul>
  3. 3. What is P2P <ul><li>The term P2P refers to &quot;peer-to-peer&quot; networking </li></ul><ul><li>A peer-to-peer network allows computer hardware and software to function without the need for special server device </li></ul><ul><li>&quot;P2P&quot; as &quot;people-to-people“: </li></ul><ul><ul><li>help individuals on the Internet meet each other and share common interests </li></ul></ul><ul><ul><li>social networking technology is an example of this concept </li></ul></ul>
  4. 4. Definition of P2P <ul><li>A P2P network needs these 7 characteristics (according to Dave Winer UserLand): </li></ul><ul><ul><li>The user interface runs outsides of a Web browser </li></ul></ul><ul><ul><li>computers in the system can act as both clients and servers </li></ul></ul><ul><ul><li>the software is easy to use and well-integrated </li></ul></ul><ul><ul><li>the application includes tools to support users wanting to create content or add functionality </li></ul></ul><ul><ul><li>the application makes connections with other users </li></ul></ul><ul><ul><li>the application does something new or exciting </li></ul></ul><ul><ul><li>the software supports &quot;cross-network&quot; protocols like SOAP or XML-RPC </li></ul></ul>
  5. 5. Definition of P2P (Ross&Rubenstein) <ul><li>Autonomy from central servers </li></ul><ul><li>Exploits resources at the edges of the Internet </li></ul><ul><ul><li>storage and content </li></ul></ul><ul><ul><li>CPU cycles </li></ul></ul><ul><ul><li>human presence </li></ul></ul><ul><li>Resources at edge have intermittent connectivity, being added & removed </li></ul>
  6. 6. P2P basic: Overlay Networks <ul><li>Virtual edge </li></ul><ul><ul><li>TCP connection </li></ul></ul><ul><ul><li>or simply a pointer to an IP address </li></ul></ul><ul><li>Overlay maintenance </li></ul><ul><ul><li>Periodically ping to make sure neighbor is alive </li></ul></ul><ul><ul><li>verify liveness while messaging </li></ul></ul><ul><li>If neighbor goes down, may want to establish new edge </li></ul><ul><li>New node needs to bootstrap </li></ul>Overlay Edge
  7. 7. P2P basic: typical problems <ul><li>Scalability </li></ul><ul><ul><li>Search queries </li></ul></ul><ul><ul><li>Download and uploads </li></ul></ul><ul><ul><li>Graph theory can help… </li></ul></ul><ul><li>Free riding </li></ul><ul><ul><li>Nodes consumes resources without sharing </li></ul></ul><ul><li>Several works </li></ul><ul><ul><li>analyzing factors affecting the degree of free-riding </li></ul></ul><ul><ul><li>finding incentive mechanisms to encourage user cooperation </li></ul></ul><ul><ul><li>Defining challenges in the design of incentive mechanisms for P2P systems (economic models) </li></ul></ul><ul><li>Security issues </li></ul><ul><ul><li>Distributed systems => easy to be attacked </li></ul></ul><ul><li>Copyright issues </li></ul><ul><ul><li>Mp3 and videos shared without control </li></ul></ul>
  8. 8. P2P Applications <ul><li>P2P file sharing </li></ul><ul><ul><li>Napster, Gnutella, Kazaa, BitTorrent,… </li></ul></ul><ul><li>Instant messaging / voice over IP </li></ul><ul><ul><li>Skype and many others… </li></ul></ul><ul><li>P2P distributed computing </li></ul><ul><ul><li>Seti Project </li></ul></ul>
  9. 9. File Sharing <ul><li>Roberto runs P2P client application on his notebook computer </li></ul><ul><ul><li>Intermittently connects to Internet </li></ul></ul><ul><ul><li>gets new IP address for each connection </li></ul></ul><ul><ul><li>Registers her content in P2P system </li></ul></ul><ul><li>Asks for “Non amarmi” di A. Baldi </li></ul><ul><li>Application displays other peers that have copy of “Non amarmi” </li></ul><ul><ul><li>Roberto chooses one of the peers, Franz </li></ul></ul><ul><ul><li>File is copied from Franz’s PC to Roberto’s laptop: P2P </li></ul></ul><ul><li>While Roberto downloads, other users uploading from Roberto </li></ul>
  10. 10. History of file sharing <ul><li>File sharing and legacy is the main problem </li></ul><ul><li>Napster: </li></ul><ul><ul><li>First P2P software started in 90s for mp3 file sharing </li></ul></ul><ul><ul><li>Big internet breakthrough in 2000 </li></ul></ul><ul><ul><li>Sold for 8 milions $ in June 2002 </li></ul></ul><ul><ul><li>Legal controversy; closed in September 2002 </li></ul></ul><ul><li>When Napster was shut down: </li></ul><ul><ul><li>Napster users migrated to the Kazaa and Kazaa Lite </li></ul></ul><ul><ul><li>FastTrack grew to become even larger than the original Napster network. </li></ul></ul><ul><li>Kazaa suffered from legal troubles </li></ul><ul><li>Other systems, like eDonkey/ Overnet, have continued the legacy of free P2P file sharing software. </li></ul>
  11. 11. Napster: how did it work <ul><li>Application-level, client-server protocol over point-to-point TCP </li></ul><ul><li>Centralized directory server </li></ul><ul><li>Steps: </li></ul><ul><ul><li>connect to Napster server </li></ul></ul><ul><ul><li>upload your list of files to server. </li></ul></ul><ul><ul><li>give server keywords to search the full list with. </li></ul></ul><ul><ul><li>select “best” of correct answers. (pings) </li></ul></ul>
  12. 12. Napster: the cycle 1 2 3 4
  13. 13. Gnutella <ul><li>decentralized method of searching for files </li></ul><ul><ul><li>central directory server no longer the bottleneck </li></ul></ul><ul><ul><li>more difficult to “pull plug” </li></ul></ul><ul><li>each application instance serves to: </li></ul><ul><ul><li>store selected files </li></ul></ul><ul><ul><li>route queries from and to its neighboring peers </li></ul></ul><ul><ul><li>respond to queries if file stored locally </li></ul></ul><ul><ul><li>serve files </li></ul></ul>
  14. 14. Gnutella: how it works <ul><li>Searching by (controlled) flooding: </li></ul><ul><ul><li>if you don’t have the file you want, query 7 of your neighbors. </li></ul></ul><ul><ul><li>if they don’t have it, they contact 7 of their neighbors, for a maximum hop count of 10. </li></ul></ul><ul><ul><li>reverse path forwarding for responses (not files) </li></ul></ul><ul><li>Node join: </li></ul><ul><ul><li>New node uses bootstrap node to get IP addresses of existing Gnutella nodes </li></ul></ul><ul><ul><li>New node establishes neighboring relations by sending join messages </li></ul></ul>
  15. 15. KaZaa <ul><li>More than 3 million up peers sharing over 3,000 terabytes of content </li></ul><ul><ul><li>more popular than Napster ever was </li></ul></ul><ul><ul><li>more than 50% of Internet traffic </li></ul></ul><ul><ul><li>MP3s & entire albums, videos, games </li></ul></ul><ul><li>optional parallel downloading of files </li></ul><ul><li>automatically switches to new download server when current server becomes unavailable </li></ul><ul><li>provides estimated download times </li></ul><ul><li>User can configure max number of simultaneous uploads and max number of simultaneous downloads </li></ul><ul><li>From user’s perspective, service resembles Google, but provides links to MP3s and videos rather than Web pages </li></ul>
  16. 16. KaZaa architecture <ul><li>Each peer is either a supernode or is assigned to a supernode </li></ul><ul><li>Nodes that have more connection bandwidth and are more available are designated as supernodes </li></ul><ul><li>Each supernode has TCP connections with 30-50 supernodes </li></ul><ul><li>Each supernode acts as a mini-Napster hub, tracking the content and IP addresses of its descendants </li></ul><ul><li>A KaZaA SN track only the content of its children </li></ul>
  17. 17. KaZaa overlay maintance <ul><li>List of potential supernodes included within software download </li></ul><ul><li>New peer goes through list until it finds operational supernode </li></ul><ul><ul><li>Connects, obtains more up-to-date list, with 200 entries </li></ul></ul><ul><ul><li>Nodes in list are “close” to ON </li></ul></ul><ul><ul><li>Node then pings 5 nodes on list and connects with the one </li></ul></ul><ul><li>If supernode goes down, node obtains updated list and chooses new supernode </li></ul>
  18. 18. KaZaa Queries <ul><li>Node first sends query to supernode </li></ul><ul><li>Supernode responds with matches </li></ul><ul><ul><li>If x matches found, done. </li></ul></ul><ul><li>Otherwise, supernode forwards query to subset of supernodes </li></ul><ul><ul><li>If total of x matches found, done. </li></ul></ul><ul><li>Otherwise, query further forwarded </li></ul><ul><ul><li>Probably by original supernode rather than recursively </li></ul></ul>
  19. 19. KaZaa finally <ul><li>KaZaa-lite is a freeware version of KaZaa </li></ul><ul><li>Lesson learned from KaZaa </li></ul><ul><ul><li>KaZaA provides powerful file search and transfer service without server infrastructure </li></ul></ul><ul><li>Exploit heterogeneity </li></ul><ul><li>Provide automatic recovery for interrupted downloads </li></ul><ul><li>Powerful, intuitive user interface </li></ul>
  20. 20. BitTorrent <ul><li>BitTorrent terms: </li></ul><ul><ul><li>Leeches - People who download files but do not share files on their own computer with others </li></ul></ul><ul><ul><li>Seed or seeder - A computer with a complete copy of a BitTorrent file (At least one seed computer is necessary for a BitTorrent download to operate.) </li></ul></ul><ul><ul><li>Swarm - A group of computers simultaneously sending (uploading) or receiving (downloading) the same file </li></ul></ul><ul><ul><li>.torrent - A pointer file that directs your computer to the file you want to download </li></ul></ul><ul><ul><li>Tracker - A server that manages the BitTorrent file-transfer process </li></ul></ul><ul><li>A node gets file.torrent info and then </li></ul><ul><li>file.torrent info: </li></ul><ul><ul><li>length </li></ul></ul><ul><ul><li>name </li></ul></ul><ul><ul><li>hash </li></ul></ul><ul><ul><li>url of tracker </li></ul></ul>
  21. 21. BitTorrent: file broken in pieces <ul><li>File is broken into pieces </li></ul><ul><ul><li>Typically piece is 256 KBytes </li></ul></ul><ul><ul><li>Upload pieces while downloading pieces </li></ul></ul><ul><li>Piece selection </li></ul><ul><ul><li>Select rarest piece </li></ul></ul><ul><ul><li>Except at beginning, select random pieces </li></ul></ul><ul><li>Tit-for-tat </li></ul><ul><ul><li>Bit-torrent uploads to at most four peers </li></ul></ul><ul><ul><li>Among the uploaders, upload to the four that are downloading to you at the highest rates </li></ul></ul><ul><ul><li>A little randomness too, for probing </li></ul></ul>
  22. 22. BitTorrent cycle <ul><li>Click on a link for the file you want </li></ul><ul><li>communicates with a tracker to find other computers running BitTorrent that have the complete file ( seed computers) and those with a portion of the file </li></ul><ul><li>The tracker identifies the swarm , which is the connected computers that have all of or a portion of the file and are in the process of sending or receiving it </li></ul><ul><li>Trading process: </li></ul><ul><ul><li>your computer receives multiple pieces of the file simultaneously. </li></ul></ul><ul><li>Keep BitTorrent client software alive: </li></ul><ul><ul><li>your future download rates improve because you are ranked higher in the &quot;tit-for-tat&quot; system </li></ul></ul>
  23. 23. Distributed P2P: DHT <ul><li>DHT service and issues </li></ul><ul><li>CARP </li></ul><ul><li>Consistent Hashing </li></ul><ul><li>Chord </li></ul><ul><li>CAN </li></ul><ul><li>Pastry/Tapestry </li></ul><ul><li>Hierarchical lookup services </li></ul><ul><li>Topology-centric lookup service </li></ul>
  24. 24. DHT in a nutshell CAN Pastry Chord
  25. 25. P2P 4 VoIP: Skype <ul><li>Hierarchical architecture </li></ul><ul><ul><li>Central login server </li></ul></ul><ul><ul><li>supernodes </li></ul></ul><ul><li>Any node with a public IP address having sufficient CPU, memory and network bandwidth is a candidate to become a super node </li></ul><ul><li>An ordinary host must connect to a super node and must register itself with the Skype login server </li></ul>
  26. 26. Skype: some details… <ul><li>Skype search </li></ul><ul><ul><li>Skype uses Global Index technology to search for a user </li></ul></ul><ul><ul><li>Skype claims that search is distributed and is guaranteed to find a user if it exists and has logged in during last 72 hours </li></ul></ul><ul><ul><li>Search results are observed to be cached at intermediate nodes </li></ul></ul><ul><li>Call establishment and teardown </li></ul><ul><ul><li>Call signaling is always carried over TCP </li></ul></ul><ul><ul><li>For user not present in buddy list, call placement is equal to user search plus call signaling </li></ul></ul><ul><ul><li>If caller is behind port-restricted NAT and callee is on public IP, signaling and media flow through an onlineSkype node which forwards signaling to callee over TCP and routes media over UDP </li></ul></ul><ul><ul><li>If both users are behind port-restricted NAT and UDP restricted firewall, both caller and callee SCs exchange signaling over TCP with another online Skype node, which also forwards media between caller and callee </li></ul></ul>
  27. 27. Distributed computing <ul><li>[email_address] </li></ul><ul><li>Search for ET intelligence </li></ul><ul><li>Central site collects radio telescope data </li></ul><ul><li>Data is divided into work chunks of 300 Kbytes </li></ul><ul><li>User obtains client, which runs in background </li></ul><ul><li>Peer sets up TCP connection to central computer, downloads chunk </li></ul><ul><li>Peer does FFT on chunk, uploads results, gets new chunks </li></ul><ul><li>Not peer to peer, but exploits resources at network edge </li></ul>
  28. 28. P2P goes mobile 1/3 <ul><li>JXTA for ad-hoc networks </li></ul><ul><ul><li>Introduced by Sun Microsystems is a set of open, generalized peer-to-peer protocols that allows any connected device (cell phone to PDA, PC to server) on the network to communicate and collaborate </li></ul></ul><ul><ul><li>Open source project </li></ul></ul><ul><ul><li>Several attempts to bring it on ad hoc networks </li></ul></ul><ul><ul><li>Difficult to port it on real mobile devices </li></ul></ul><ul><li>Peer2ME </li></ul><ul><ul><li>A j2me framework for developing mobile P2P applications </li></ul></ul><ul><ul><li>Similar to U-Hopper in the basic ideas </li></ul></ul><ul><ul><li>Include real file sharing </li></ul></ul>
  29. 29. P2P goes mobile 2/3 <ul><li>BEDD </li></ul><ul><ul><li>Started in 2001 as commercial BT P2P </li></ul></ul><ul><ul><li>Now BT + WiFi + GPRS </li></ul></ul><ul><ul><li>More than 250000 BEDD buddies </li></ul></ul><ul><ul><li>Downloads, chatting, socializing </li></ul></ul><ul><li>U-Hopper </li></ul><ul><ul><li>Well known middleware for P2P applications… </li></ul></ul>
  30. 30. P2P goes mobile 3/3 <ul><li>Difficult to export the P2P classic model to mobile decentralized environment </li></ul><ul><ul><li>Different operating systems </li></ul></ul><ul><ul><li>Different user interfaces </li></ul></ul><ul><li>Incentives for file exchange needs to be found </li></ul><ul><li>Economic models for classical P2P can work? </li></ul><ul><li>Few successfull examples can be found </li></ul>
  31. 31. Conclusions <ul><li>How can we use the lesson learned from classical P2P systems in extremely mobile systems? </li></ul><ul><ul><li>From a technological prospective… </li></ul></ul><ul><ul><li>From an economical point of view… </li></ul></ul><ul><li>How can we contribute in the P2P research community? </li></ul>

×