Lecture 7c: Peer to Peer Networking


Published on

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Lecture 7c: Peer to Peer Networking

  1. 1. Peer to Peer Networking
  2. 2. P2P Overview <ul><li>One possible classification of peer-to-peer networks is according to their degree of centralisation: </li></ul><ul><li>Pure peer-to-peer: </li></ul><ul><li>Peers act as equals, merging the roles of clients and server </li></ul><ul><li>There is no central server managing the network </li></ul><ul><li>There is no central router </li></ul><ul><li>Hybrid peer-to-peer: </li></ul><ul><li>Has a central server that keeps information on peers and responds to requests for that information. </li></ul><ul><li>Peers are responsible for hosting available resources (as the central server does not have them), for letting the central server know what resources they want to share, and for making its shareable resources available to peers that request it. </li></ul><ul><li>Route terminals are used addresses, which are referenced by a set of indices to obtain an absolute address. </li></ul><ul><li>Some examples of &quot;pure&quot; peer-to-peer application layer networks designed for file sharing are Gnutella and Freenet. </li></ul>
  3. 3. P2P Advantages An important goal in peer-to-peer networks is that all clients provide resources, including bandwidth, storage space, and computing power. Thus, as nodes arrive and demand on the system increases, the total capacity of the system also increases. This is not true of a client-server architecture with a fixed set of servers, in which adding more clients could mean slower data transfer for all users. The distributed nature of peer-to-peer networks also increases robustness in case of failures by replicating data over multiple peers, and -- in pure P2P systems -- by enabling peers to find the data without relying on a centralized index server. In the latter case, there is no single point of failure in the system. When the term peer-to-peer was used to describe the Napster network, it implied that the peer protocol was important, but, in reality, the great achievement of Napster was the empowerment of the peers (i.e., the fringes of the network) in association with a central index, which made it fast and efficient to locate available content. The peer protocol was just a common way to achieve this. (see wikipedia for more)
  4. 4. Napster <ul><li>Original program for sharing files over the Internet </li></ul><ul><li>a “disruptive” application/technology? </li></ul><ul><li>history: </li></ul><ul><ul><li>5/99: Shawn Fanning (freshman, Northeasten U.) founds Napster Online music service </li></ul></ul><ul><ul><li>12/99: first lawsuit </li></ul></ul><ul><ul><li>3/00: 25% UWisc traffic Napster </li></ul></ul><ul><ul><li>2000: est. 60M users </li></ul></ul><ul><ul><li>2/01 : US Circuit Court of </li></ul></ul><ul><ul><li>Appeals: Napster knew users </li></ul></ul><ul><ul><ul><li>violating copyright laws </li></ul></ul></ul><ul><ul><li>7/01: # simultaneous online users: </li></ul></ul><ul><ul><ul><li>Napster 160K, Gnutella: 40K, Morpheus: 300K </li></ul></ul></ul>
  5. 5. Napster: how does it work <ul><li>Application-level, client-server protocol over point-to-point TCP </li></ul><ul><li>Four steps: </li></ul><ul><li>Connect to Napster server </li></ul><ul><li>Upload your list of files (push) to server. </li></ul><ul><li>Give server keywords to search the full list with. </li></ul><ul><li>Select “best” of correct answers. (pings) </li></ul>
  6. 6. Napster mechanisms <ul><li>Napster acts as a discovery server on a P2P Network, a client logs onto Napster and supplies a directory that can be shared with other users. The content of this directory is then used to fulfil requests from other users for particular files. </li></ul><ul><li>It can be seen in the Figure above that if the requested file is located on another client, a connection is established between the client requesting the file and the machine on which the file resides. A direct peer-to-peer download from one machine to another is then possible. By using this method the workload on the server is greatly reduced as the communication is between both clients from this point forward. </li></ul>
  7. 7. Napster napster.com users File list is uploaded 1.
  8. 8. Napster napster.com user Request and results User requests search at server. 2.
  9. 9. Napster napster.com user pings pings User pings hosts that apparently have data. Looks for best transfer rate. 3.
  10. 10. Napster napster.com user Retrieves file User retrieves file 4.
  11. 11. Napster: architecture notes <ul><li>centralized server: </li></ul><ul><ul><li>single logical point of failure </li></ul></ul><ul><ul><li>can load balance among servers using DNS rotation </li></ul></ul><ul><ul><li>potential for congestion </li></ul></ul><ul><ul><li>Napster “in control” (freedom is an illusion) </li></ul></ul><ul><li>no security: </li></ul><ul><ul><li>passwords in plain text </li></ul></ul><ul><ul><li>no authentication </li></ul></ul><ul><ul><li>no anonymity </li></ul></ul>
  12. 12. Gnutella <ul><li>peer-to-peer networking: applications connect to peer applications </li></ul><ul><li>focus: decentralized method of searching for files </li></ul><ul><li>each application instance serves to: </li></ul><ul><ul><li>store selected files </li></ul></ul><ul><ul><li>route queries (file searches) from and to its neighboring peers </li></ul></ul><ul><ul><li>respond to queries (serve file) if file stored locally </li></ul></ul><ul><li>Gnutella history: </li></ul><ul><ul><li>3/14/00: release by AOL, almost immediately withdrawn </li></ul></ul><ul><ul><li>too late: 23K users on Gnutella at 8 am this AM </li></ul></ul><ul><ul><li>many iterations to fix poor initial design (poor design turned many people off) </li></ul></ul><ul><li>What we care about: </li></ul><ul><ul><li>How much traffic does one query generate? </li></ul></ul><ul><ul><li>how many hosts can it support at once? </li></ul></ul><ul><ul><li>What is the latency associated with querying? </li></ul></ul><ul><ul><li>Is there a bottleneck? </li></ul></ul>
  13. 13. Gnutella <ul><li>Searching by flooding: </li></ul><ul><li>If you don’t have the file you want, query 7 of your partners. </li></ul><ul><li>If they don’t have it, they contact 7 of their partners, for a maximum hop count of 10. </li></ul><ul><li>Requests are flooded, but there is no tree structure. </li></ul><ul><li>No looping but packets may be received twice. </li></ul><ul><li>Reverse path forwarding(?) </li></ul>
  14. 14. Gnutella <ul><li>Gnutella defines the way peers communicate by the use of descriptors for communication and rules overseeing the servant exchange of these descriptors. In Gnutella there are currently five descriptors defined as shown below: </li></ul><ul><li>Ping: To discover neighbours on the network. </li></ul><ul><li>Pong: The reply sent for a Ping. </li></ul><ul><li>Query: Used for searching a network. A client will respond to the Query if a match is found within its local data set. Figure 5 shows a computer placing a query to the network. This is passed to its neighbours who in turn pass it onto their neighbours (and send a response if necessary). This continues until the Query has reached the end of its lifespan – its Time to Live (TTL) has reached zero. </li></ul><ul><li>Query Hit: The response sent to the origin of the query using the address supplied found within the original query. </li></ul><ul><li>Push: Allows clients behind a firewall to contribute to the network. </li></ul>
  15. 15. Gnutella
  16. 16. Pure P2P & Super-Peers Technically, a completely pure peer-to-peer application must implement only peering protocols that do not recognize the concepts of &quot;server&quot; and &quot;client&quot;. Such pure peer applications and networks are rare. Most networks and applications described as peer-to-peer actually contain or rely on some non-peer elements, such as DNS. Also, real world applications often use multiple protocols and act as client, server, and peer simultaneously, or over time. Completely decentralized networks of peers have been in use for many years: two examples are Usenet (1979) and FidoNet (1984). Many P2P systems use stronger peers (super-peers, super-nodes) as servers and client-peers are connected in a star-like fashion to a single super-peer. Sun added classes to the Java technology to speed the development of peer-to-peer applications quickly in the late 1990s so that developers could build decentralized real time chat applets and applications before Instant Messaging networks were popular. This effort is now being continued with the JXTA project.
  17. 17. JXTA - Introduction <ul><li>“ JXTA” - pronounced as “ juxta ” as in “ juxtaposition ” </li></ul><ul><li>started by Sun's Chief Scientist Bill Joy </li></ul><ul><li>an effort to create a common platform for building distributed services and applications </li></ul><ul><li>Napster, Gnutella, and Freenet provide users with limited ability to share resources and are unable to share data with other, similar applications </li></ul>
  18. 18. Goal/Purpose <ul><li>enable a wide range of distributed computing applications by developing a common set of general purpose P2P protocols </li></ul><ul><li>achieve platform independence - any language, any OS, any hardware </li></ul><ul><li>overcome the limitations found in many today's P2P applications </li></ul><ul><li>enable new applications to run on any device that has a digital heartbeat (desktop computers, servers, PDAs, cell phones, and other connected devices) </li></ul>
  19. 19. Technology <ul><li>JXTA technology is based on XML, Java technology, and key concepts of UNIX operating system </li></ul><ul><li>Transmitted information is packaged as messages. Messages define an XML envelop to transfer any kind of data. </li></ul><ul><li>The use of Java language is not required - JXTA protocols can be implemented in C, C++, Perl, or any other programming language </li></ul>
  20. 20. Structure JXTA Core JXTA Services JXTA Applications Any Peer on the Web (Desktop, cell phone, PDA, Server) Security Peer Groups Peer Pipes Peer Monitoring JXTA Community Services Sun JXTA Services JXTA Community Applications Sun Applications JXTA Shell Peer Commands
  21. 21. Potential Applications <ul><li>Search the entire web and all its connected devices (not just servers) for needed information </li></ul><ul><li>Save files and information to distributed locations on the network </li></ul><ul><li>Connect game systems so that multiple people in multiple locations </li></ul><ul><li>Participate in auctions among selected groups of individuals </li></ul><ul><li>Collaborate on projects from anywhere using any connected device </li></ul><ul><li>Share compute services, such as processor cycles or storage systems, regardless of where the systems or the users are located </li></ul>
  22. 22. <ul><li>Windows Peer-to-Peer Networking is a developer platform to create peer-to-peer applications for computers running Windows XP with Service Pack 2, Windows XP Professional x64 Edition, Windows XP with Service Pack 1 and the Advanced Networking Pack for Windows XP, or Windows Vista. </li></ul><ul><li>Computers running Windows Vista already have Windows Peer-to-Peer Networking installed. </li></ul><ul><li>For computers running Windows XP with SP2, do the following to install Windows Peer-to-Peer Networking: </li></ul><ul><li>1.Click Start, click Control Panel, and then click Add or Remove Programs.2.Click Add/Remove Windows Components.3.In Components, click Networking Services (but do not select its check box), and then click Details.4.Select the Peer-to-Peer check box, and then click OK.5.Click Next, and then follow the instructions in the wizard. </li></ul><ul><li>For computers running Windows XP with Service Pack 1 (SP1), you can install Windows Peer-to-Peer Networking with the Advanced Networking Pack for Windows XP, a free download. </li></ul>Windows P2P Networking
  23. 23. <ul><li>The architecture of Windows Peer-to-Peer Networking in Windows XP is shown below. </li></ul>Windows P2P Architecture
  24. 24. <ul><li>Windows Peer-to-Peer Networking architecture consists of the following components: </li></ul><ul><li>• Graphing The Graphing component is responsible for maintaining a set of connected nodes known as a graph and providing flooding and replication of data across the graph. The Graphing component uses the Flood & Synchronization, Store, and Graph Maintenance subcomponents. </li></ul><ul><li>• Grouping The Grouping component is the security layer provided by default on top of a graph. The security layer defines the security model behind group creation, invitation, and connection to the group. In addition, Grouping leverages PNRP as the name resolution protocol - and enables multiple applications to share the same graph. </li></ul><ul><li>• NSP The Name Service Provider (NSP) component provides a mechanism to access an arbitrary name service provider. In the case of Windows Peer-to-Peer Networking, peer-to-peer applications use the NSP interface to access PNRP. </li></ul><ul><li>• PNRP The PNRP component provides peer-to-peer name resolution. </li></ul><ul><li>• Identity Manager Identity manager enables the creation and management of peer-to-peer identities. </li></ul><ul><li>• Microsoft TCP/IP version 6 protocol The Microsoft TCP/IP v6 protocol (IPv6) provides the transport over which Windows Peer-to-Peer Networking operates. </li></ul>Windows P2P Components
  25. 25. <ul><li>Windows Peer-to-Peer Networking is a new platform supported by Windows XP and Windows Vista that allows better utilization of PC computing resources and the creation of a new wave of peer applications for RTC, collaboration, content distribution, distributed processing, and improved Internet technologies. </li></ul><ul><li>Windows Peer-to-Peer Networking uses IPv6, which restores the end-to-end computing model. With Teredo, IPv6 nodes can even communicate across one or more IPv4 NATs. For a serverless name resolution and peer discovery mechanism, Windows Peer-to-Peer Networking uses PNRP. </li></ul><ul><li>To associate peer members together to securely share data, Windows Peer-to-Peer Networking uses graphing (for an efficient flooding topology) and grouping (for authentication and secure communication). </li></ul><ul><li>Group members maintain a replicated store containing all the shared data of the group and can search the store using keywords, attributes, and common logical operators. </li></ul>Windows P2P Summary
  26. 26. Finally…. P2P Applications Education and Academic : Due to the fast distribution and large storage space features, many organizations are trying to apply P2P network for educational and academic purposes. Military : In May, 2003 Dr. Tether. Director of Defense Advanced Research Project Agency has testified that U.S. Military is using P2P network. Due to security reasons, many files are still kept in confidential. Business : Besides File Sharing, companies are also interested in Distributing Computing, Content Distribution, e-market place, Distributed Search engines, Groupware and Office Automation via P2P network. There are several reasons why companies prefer P2P sometimes such as: Real-time collaboration, a server cannot manage with increasing volume of contents, a process requires strong computing power, a process needs high-speed communications etc. At the same time, P2P is not fully used as it still confronts a lot of security issues. Telecommunication : Nowadays, people are not just satisfied with “can hear a person from another side of the earth”, instead, the demands of clearer voice in real-time are increasing globally. Just like the TV network, there are already cables built. It’s not very likely for companies to change all the cables. Many of them turn to use internet, more specifically, P2P network. For instance, Skype, one of the most widely used phone software is using P2P technology. Furthermore, many research organizations are trying to apply P2P network on cellular network (see wikipedia for more…).