IMP Info

Latest things in Softwares,Freewares,Open Source,Internet,Programming…

Peer-to-Peer (P2P) Network Explained…

Posted by Parth Barot on January 3, 2006

by: Parth Barot
Instant-messaging systems and document-sharing applications such as AOL Instant Mes-senger and Gnutella have exploded in popularity, transforming the way users interactwith one another over networks. In a peer-to-peer (P2P) application, each node performsboth client and server functions. Such applications distribute processing responsibilitiesand information to many computers, thus reclaiming otherwise wasted computing powerand storage space, and eliminating central points of failure.

Many network applications operate on the principle that computers should be segregatedby function. Some computers—called servers—offer common stores of programs and data.Other computers—called clients—access the data provided by the servers. The Yahoo!™search engine ( is an example of a client/server application. Clientsend queries to the central servers, which have pre-compiled catalogs of the Internet. Thecentral servers refer to their databases and respond with the requested information.

P2P applications are different than client/server applications. Instead of segregatingcomputers by function, all computers act as both clients and servers. P2P applications aresimilar to the telephone system—a single user can both speak (send information) and listen(receive information)
An application that uses a centralized server exemplifies the client/server relationship. Onemajor weakness of this centralized system is the dependency on the central server. If thecentral node (i.e., server) fails, the entire application also fails. The server’s capabilitieslimit the application’s overall performance. For instance, Web sites can fail when malicioususers overload the Web server(s) with an excessive number of requests. However, central-ized architectures also have advantages, such as simplifying management tasks (e.g., mon-itoring user access by providing single points of network control).

True P2P applications are completely decentralized and do not suffer from the samedeficiencies as applications that depend on centralized servers. If nodes in a P2P applicationfail, well-designed P2P applications continue to function. P2P applications often leveragedistributed computational power. Freenet, for instance, allows users to share documents ina way that precludes censorship. Peer-to-peer architectures allow real-time searches thatreturn up-to-date results. Centralized search engines today are slow to incorporate recentlycreated Web data into these catalogs. Peer-to-peer searches accurately reflect the networkstatus at the time of the query.

Gnutella:- A P2P technology that does not use any central servers. There is no authentication, and peers search for files via a distributed-search mech-anism.

KaZaA:- A file-sharing application that is a hybrid between Gnutella and cen-tralized applications. A central server authenticates all users. Certain peers serve as search hubs, which catalog the files of peers connected to them. Searches are distributed to each search hub, which then respond with results that allow direct connections for file transfers.

Instant Messengers:- Peer-to-peer applications that enable users to send short text messages and files to one another. Most instant messengers use central servers that authenticate all users and route messages between peers.

Telephone System:- A peer-to-peer application that enables users to conduct voice conver-sations remotely.

Peer-to-peer applications have disadvantages as well. Anyone with the appropriatesoftware can join the network of peers and often remain anonymous—for this reason, deter-mining who is on the network at any instant is difficult. Also, the lack of a central serverhinders the enforcement of copyright and intellectual-property laws. Real-time searchescan be slow and increase network traffic, because every query must propagate throughoutthe entire network.

True client/server applications are completely centralized, whereas true peer-to-peerapplications are completely decentralized. Many applications adopt aspects of both toachieve specific goals. For example, some file-sharing applications are not true peer-to-peer applications, because they use central servers to authenticate users and index eachpeer’s shared files. However, peers connect directly to one another to transfer files. Insuch a system, centralization increases search performance but makes the network depen-dent on a central server. Performing file transfers between peers decreases the load on thecentral server.

Peer discovery is the act of finding peers in a P2P application. Decentralizing an applica-tion often slows peer discovery and information searching. Gnutella presents one approachfor circumventing these problems. Gnutella is a true peer-to-peer technology that enablesdistributed information storage and retrieval. Users can search for and download files fromany peer on the network. Users first join a Gnutella network by specifying the network ad-dress of a known Gnutella peer. Without knowing of at least one peer on the network, a usercannot join the network. Each user’s Gnutella software functions as a server and uses theHTTP protocol to search for and transfer files.
To perform a search, a peer sends search criteria to several nearby peers. Those peersthen propagate the search throughout the network of peers. If a particular peer can satisfythe search, that peer passes this information back to the originator. The originator then con-nects directly to the target peer and downloads the information. The peer that made the orig-inal query loses anonymity only when it connects directly to the peer with the requested fileto begin file transfer.

In the Freenet P2P application, files also propagate throughout the network of peers.Each peer that uses Freenet forwards search requests to only one other peer. If the searchfails, the peer that received the request forwards the request to the next known peer. If weview the searching peer as the root of a hierarchical structure that represents the Gnutellanetwork, each search request traverses in a breadth-first fashion, because peers forwardeach search request to several peers at once. Freenet works essentially like Gnutella, exceptthat each search request traverses depth-first.

Searches conducted in both Gnutella and Freenet are called distributed searches. Dis-tributed searches make networks more robust by removing single points of failure, such ascentral servers. Information found via distributed searches is current because it reflects thecurrent state of the network. Not only can peers find information in this way, but peers cansearch for other peers via distributed searches as well.

we can make a P2P Application using java.rmi package.


Sorry, the comment form is closed at this time.

%d bloggers like this: