Chapter 7: P2P Application Chapter 7: P2P Application development development Chapter goal: Chapter goal P2P applicat P2P application model P2P applicati P2P application design P2P examp P2P example What is Peer-To-Peer?(1/3 What is Peer-To-Peer?(2/3) P2P is a class of applications that P2P computing is etc)-available at the edges of the ine CPu Takes advante The sharing of computer resources and ccessing these decentralized rvices by direct exchange between esources means opera editable Peer-to-peer computing takes advantage DNS system and have significant or total of existing computing power and autonomy from central servers. networking connectivity, allowing collective power to benefit the entire enterprise. What is Peer-To-Peer? (3/3) A Brief History of P2P P2P computing is distributed a P2P is not a new technology computing with the following desirable Resource Sharing As result o de pplrcasied isemortd e aring files nare resources Dual client/server role Decentralization/Autonomy became increasingly powerful Scalabil Robustness/Self-Organization is still P2P 1999-2000, Napster shows the true potential of Pa
1 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 1 Chapter 7: P2P Application development Chapter goal: P2P application model P2P application design P2P example 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 2 Chapter 7: P2P Application development Chapter goal: P2P application model P2P application design P2P example 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 3 What is Peer-To-Peer? (1/3) P2P is a class of applications that: Takes advantage of resources – (storage, CPU, etc,..) – available at the edges of the Internet. Because accessing these decentralized resources means operating in an environment of unstable connectivity and unpredictable IP addresses, P2P nodes must operate outside the DNS system and have significant or total autonomy from central servers. 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 4 What is Peer-To-Peer? (2/3) P2P computing is: The sharing of computer resources and services by direct exchange between systems. Peer-to-peer computing takes advantage of existing computing power and networking connectivity, allowing economical clients to leverage their collective power to benefit the entire enterprise. 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 5 What is Peer-To-Peer? (3/3) P2P computing is distributed computing with the following desirable properties: Resource Sharing Dual client/server role Decentralization/Autonomy Scalability Robustness/Self-Organization 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 6 A Brief History of P2P P2P is not a new technology It has existed since the Internet was taking form in the 1970s Recent changes in technology and the improved computing capability of desktops have brought about P2P’s revival on a larger scale P2P model-based application is confined to sharing files As a result of the increased demand for Web-base services, users felt the need to control, exchange, and share resources directly Meanwhile, in the late 1990s, PCs became increasingly powerful in terms of speed and processing power Software developers realized that they could put server software on individual PCs and initiate a direct two-way data flow between two peers Led to the revival of P2P Interestingly, the IP routing infrastructure is still P2P 1999-2000, Napster shows the true potential of P2P
Application Architecture Client-server architecture Client-server a P2P nt IP address Hybrid clients: communicate with server may be intermittently addresses do not communicate directly Pure p2P architecture Hybrid of client-server and P2P Napster arbitrary end systems File transfer P2P File search centralized: peers are intermittently Peers register content at central serve Peers query same central server to locate content example: Gnutella Instant messaging Chatting between two users is P2P Presence detection/location centralized Highly scalable User registers its IP address with central server User contacts central server to find iP addresses of But difficult to manage From the Client/server Model to P2P Various P2P Models P2P-based models decrease the dependency on the P2P models can be divided into the Some P2P models do not requires servers following categories No single point of failure problems in P2P Pure P2p Both models have advantages as well as P2P with a simple discovery server Another advantage of P2P is that companies can P2P with discovery and lookup servers P2P with discovery, lookup, and content servers terms of sharing resources and costs incurred on servers
2 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 7 Application Architecture Client-server P2P Hybrid 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 8 Client-server architecture server: always-on host permanent IP address server farms for scaling clients: communicate with server may be intermittently connected may have dynamic IP addresses do not communicate directly with each other 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 9 Pure P2P architecture no always on server arbitrary end systems directly communicate peers are intermittently connected and change IP addresses example: Gnutella Highly scalable But difficult to manage 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 10 Hybrid of client-server and P2P Napster File transfer P2P File search centralized: Peers register content at central server Peers query same central server to locate content Instant messaging Chatting between two users is P2P Presence detection/location centralized: User registers its IP address with central server when it comes online User contacts central server to find IP addresses of buddies 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 11 From the Client/Server Model to P2P P2P-based models decrease the dependency on the server Some P2P models do not requires servers No single point of failure problems in P2P Both models have advantages as well as disadvantages Another advantage of P2P is that companies can build collective computing powers P2P has shaken the boundaries of networking in terms of sharing resources and costs incurred on servers 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 12 Various P2P Models P2P models can be divided into the following categories: Pure P2P P2P with a simple discovery server P2P with discovery and lookup servers P2P with discovery, lookup, and content servers
Pure P2P Model P2P with Simple Discovery Server Such P2P models do not actually n computers (clients Peers find other connected eers to the incoming ut ary assistance from a ommunication still remains the job of Pure P2P models provide almost ne chances of working with the Interne a peer has to Pzp problem with the pure cted peer individually May need more tim P2P with a Discovery and Lookup P2P with a Discovery, Lookup Server and Content Server The server dominates as in a list of connected peers along with typical client/server architecture Peers are not permitted to 旦 This model reduces the burden on connect with each other directly The server initiates communication between two peers hat the server slows down if eers establish communication too many requests come up and perform various activities multaneously There is single point of failure in server Existing P2P Applications Centralized Napster a Napste Napster used centralized servers to keep a Gnutella atalog of available files, ( 3rd model) serve The central server
3 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 13 Pure P2P Model Pure P2P model entirely depends on computers (clients in the C/S model) Peers find other connected peers on the network dynamiclly The entire communication occurs among connected peers without any assistance from a server Pure P2P models provide almost plug-and-play features for working with the Internet The only problem with the pure P2P model is finding peers 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 14 P2P with Simple Discovery Server Such P2P models do not actually involve a server The role of the server is restricted to providing the names of already connected peers to the incoming peer The server only assists peers by providing a list of connected peers Establishing connection and communication still remains the job of the peers This model increases the chances of finding a larger number of peers To download a resource, a peer has to approach each connected peer individually May need more time 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 15 P2P with a Discovery and Lookup Server The server is used to provide the list of connected peers along with the resources available This model reduces the burden on peers The server initiates communication between two peers Once again, the two connected peers establish communication, and perform various activities 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 16 P2P with a Discovery, Lookup, and Content Server The server dominates as in a typical client/server architecture Peers are not permitted to connect with each other directly All resources are stored in the database of the server Major disadvantage of this model is that the server slows down if too many requests come up simultaneously There is single point of failure in server 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 17 Existing P2P Applications Napster Gnutella 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 18 Centralized: Napster Napster used centralized servers to keep a catalog of available files. (3rd model) 1. User sends out request Napster searches central database Search request 2. The central server sends back a list of available files for download Search response Napster server user user user user 3. Requesting user downloads the file directly from another Napster user computer Download from user
Centralized: pros and cons Decentralized Every user acts as a client, a server or oth (servent). More effective, comprehensive searches User connects to framework and becomes a s Access is controlled member of the community, allowing others to connect through him/her u cons Users speak directly to other users with no System has single points of entry: one intermediate or central authority fails could bring whole system down Not one entity controls the information Broken links, out of date information. that passes through the community GNUTELLA GNUTELLA Gnutella works more or less like a pure P2P model Key terms: gnutella is downloaded and installed on the Servent: client+server sage is sent to a computer, which passes Firewall: a shield that protects inside the gnutella to the Broadcasting: messaging service between servents in Gnutella is a client-based software that has a file Gnutella sharing service and a mini search engine A machine which installed Gnutel serve the dropped et wk en ges of data that have been lost of content by sending requests Searching on Gnutella is almost like working with request to the servent for uploading the file. This is Gnutella facilitates to share all kinds of fil Port: default port number for Gnutella servents is 6346 Example: GNUTELLA Example: GNUTELLA 习ac
4 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 19 Centralized: pros and cons pros More effective, comprehensive searches Access is controlled cons System has single points of entry; one fails could bring whole system down Broken links, out of date information. 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 20 Decentralized Every user acts as a client, a server or both (servent). User connects to framework and becomes a member of the community, allowing others to connect through him/her Users speak directly to other users with no intermediate or central authority Not one entity controls the information that passes through the community 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 21 GNUTELLA Gnutella works more or less like a pure P2P model Gnutella is downloaded and installed on the computer A message is sent to a computer, which passes it to the other computers Gnutella is a client-based software that has a filesharing service and a mini search engine A machine which installed Gnutella can serve the requests of other users, and can find the desired content by sending requests Searching on Gnutella is almost like working with any other search engine Gnutella facilitates to share all kinds of files 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 22 GNUTELLA Key terms: Servent: client+server Horizon: a group of servents, not entire Gnutella Firewall: a shield that protects users inside the Gnutella Broadcasting: messaging service between servents in Gnutella Dropped Packets: packages of data that have been lost of dropped across the Gnutella nerwork Push Request: whenever a client behind the firewall is unable to download a file from a servent, the firewall send a request to the servent for uploading the file. This is called a push request. Port: default port number for Gnutella servents is 6346 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 23 Example: GNUTELLA 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 24 Example: GNUTELLA
Example: GNUTELLA Example: GNUTELLA by A though omputer A vu the same pathway. chirehttpconnecti Napster vs GNUTELLA Napster Vs GNUTELLA Napster+ s Gnutella Gives material to its customer in the form of MP3 music files all across the continents. This is the key reason fo Truly decentralized network(pure P2P No single point of failure Share all kinds of Has a provision for redirecting the request, and User friendly and easy to download Napster s Gnutella Server presence slows down or brings services to a halt in No provision for stopping the flood of requests Absence of the server makes user feel unsafe Encounters many bugs in its application, such as and the music industr Working of Various P2P Models Tracing out Other Peers The way an application works matters a lot Essential feature of every P2P-based application A typical P2P-based application can be based Discovering other peers in pure P2P-based model eerstine s dhers dynamically and communicate between Some of the key features every model P2P application should have: sescererins peers en P2P with simple discovery the database of the server stores the information related Querying peers for required content Any query for searching a particular peer is processed by Sharing content /resources with other peer Availability of a large number of peers Single point of failure of se
5 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 25 Example: GNUTELLA 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 26 Example: GNUTELLA 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 27 Napster vs GNUTELLA Napster + Gives material to its customer in the form of MP3 music files all across the continents. This is the key reason for its popularity. Provides a protective layer to its user due to the involvement of a server. Fully authenticated data travels on Napster network. User friendly and easy to download on your computer Napster - Server presence slows down or brings services to a halt in case of a technical problem Server can easily become the bottleneck Works for only MP3 files Facing copyright lawyers and the music industry 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 28 Napster vs GNUTELLA Gnutella + Truly decentralized network (pure P2P) No single point of failure Share all kinds of files Has a provision for redirecting the request, and supports HTTP protocol Gnutella - No provision for stopping the flood of requests Absence of the server makes user feel unsafe Encounters many bugs in its application, such as lost packets 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 29 Working of Various P2P Models The way an application works matters a lot A typical P2P-based application can be based on any of the models Some of the key features every model P2P application should have: Tracing out other peers Querying peers for required content Sharing content/resources with other peers 哈工大计算机学院 李全龙 Network Application Development P2P Application Development 30 Tracing out Other Peers Essential feature of every P2P-based application Discovering other peers in pure P2P-based model Peers find others dynamically and communicate between themselves directly Affects security Discovering peers in P2P with simple discovery server-based model The database of the server stores the information related to all registered users Any query for searching a particular peer is processed by the server Enhanced security Availability of a large number of peers Single point of failure of server