C# .NET Web Developer's Guide

The concept of peer-to-peer (P2P) is becoming more and more important in networks, and P2P Internet applications such as Napster and Gnutella are widely popular. But what exactly is a peer-to-peer application?
Well, first consider client/server applications, the most common model for communication today. A client requests or posts data to or from a server. The client knows how to request or post data and the server knows how to respond. For instance, a Web server listens for incoming connections until a browser requests a page. The Web server reacts only to browsers; it cannot arbitrarily contact a browser. Any communication is initiated by a client.
In P2P communication, on the other hand, all applications act as clients and servers at the same time. When peer A requests data from peer B, A acts like a client and B as a server. However, B can also request data from A, so B acts as a client and A as a server. Every peer adds a bigger amount of value to network. Furthermore, no centralized server is needed, which decreases the effort needed in administrating the data. Another advantage is that if a peer is down, only a small portion of data is unavailable.
This model does require additional functionality from the peer application. First, a peer must be able to find other peers. This is called discovery. There are different strategies for discovery. So-called pure P2P applications can discover other peers directly.