There are several implementations of protocols peer to peer (among equals in free translation). In general, they are characterized by:
- Communication of non-linear content: Large contents can be broken into smaller packages, and sent out of order (the client takes charge of organizing the packages);
- Auto-resolution of services: The customer knows, by itself, how to search and initiate communication with other elements equal to himself present in the same logic mesh;
- Unreliability: Client does not assume any external aspect as immutable and reliable (packages can be corrupted, peers can disconnect, or send wrong packets);
- Control routing: The client knows how to pass on requests that he cannot comply with.
Some services also implement the concept of trackers (trackers) which are services where certain information (such as routing tables and correlations between peers and content) is compiled and can be checked for higher resolution speed.
Note that trackers act only as a hint; the client, possession of the list of peers of a certain content, tries to connect to them and validate the information they actually possess. Trackers with a lot of wrong information can enter for a Blacklist, for example.
Let’s take the chart below as a practical description of a peer-to-peer mesh, and simulate some cases:
Resolution of peers: The machine 7 sends a message in style broadcast to the network, without any specific target, asking for members of the same mesh. The machines 5 and 6 reply, and are added to the list of peers that 7 can see.
Content resolution: 7 question both to 6 as to 5 where the content To can be found. 6 responds that the content exists in 2 and 1, while 5 replies that 2 has the contents. Machine 7 then attempts to establish a direct connection with 2 and 1, and marks them as likely repositories of To.
Transmission of content: 7 question to 2 the amount of packages that make up To. The answer, 5 packages, comes along with the statement that 2 has only the packages AP1 and AP2. 7 then requests the package AP1 to 2, while asking the 1 what packages of To he has; 7 will then attempt to coordinate the package request to cover the entire content (AP1-AP5).
- Ads: 4, which also has the content To, enters the net, announcing its presence to 5. 5, in turn, warns the 7 that another customer containing To is available.
Note that at no time does any of the machines treat your peers as a classic server. This type of structure can be implemented on local network, and benefit from the (usually) increased reliability, speed and stability of the environment.
@Felipedoiradinho, I made an update on the question.
– KaduAmaral