Home >
other > The sixth chapter P2P principle and practice
The sixth chapter P2P principle and practice
1. Summary of peer-to-peer (P2P)
1.1 concept
P2P is the abbreviation of Peer - to - Peer, means "point to point" or "end-to-end", the academics often call it "peer-to-peer computing, peer-to-peer (P2P) is a kind of in a centralized way using distributed resources to complete some of the key tasks of system and the application of P2P technology has broken the traditional C/S mode, in P2P network, all nodes are equal, each node is both when the server, and ACTS as the client, so reduce the stress of a central server, diversification of resources or task processing,
1.2 technical characteristics
Decentralization, scalability, robustness, high cost performance, privacy protection, load balance
2. The classification of P2P networks
(1)中心化拓扑结构 中心化拓扑结构指的是网络中资源和服务的索引都存储在中心服务器目录中,而资源和服务本身则存储在网络中的各结点中,若一个客户需要访问某资源,则需要先直接 或间接地访问中心服务器,中心服务器通过索引检索存有该资源的具体结点的信息,然后请求者与这些存有所需资源的结点连接,最后实现对资源的访问, (2)全分布式非结构化拓扑结构 采用全分布式结构化拓扑结构的P2P网络是一种重叠网络,重叠网络是在现有的网络 体系架构上新加一层虚拟网络,并将虚拟网络中的每个结点与实际网络中的一些结 点相连,从而实现与实际网络中个结点的联通, (3)全分布式结构化拓扑结构 全分布式结构拓扑采用分布式哈希表(DHT)来组织网络中的各结点,因此这种拓扑结构 的网络也称为DHT网络,在DHT网络中,由广域范围大量结点共同维护庞大的哈希表,散 列表被分割成不连续的块,每个结点被分配一个属于自己的哈希块,并成为这个哈希块的 管理者,网络中每个结点有一个唯一标识自己的ID,且通过哈希函数,为网络中资源分配 唯一的ID,然后将资源存储在资源ID与结点ID相等或相近的结点中,当需要查找资源时,可以采用类似资源散列的方法定位到存储资源的结点上,
(4) distributed topology and distributed topology learned the centralized topology structure and the advantages of the fully distributed unstructured topology, select nodes as a high performance, super nodes in each store the information of the other parts of the nodes in the system, the retrieval algorithm only between super node forwarding, super node and then query request is forwarded to the appropriate leaf node,
P2P (Peer to Peer) peer-to-peer networks
P2P technology belongs to Overlay Network (Overlay Network) category, is relative to the client/server (C/S) model is a way of the Network information exchange, in the C/S model, the data distribution using dedicated server, multiple clients are from the server to get data,
Advantages are: the consistency of the data is easy to control, the system is easy to manage,
The disadvantage is that: because the number of servers only one (even if there are multiple also very limited), system vulnerable to single point failure; A single server in the face of numerous clients, due to the ability of CPU, memory size, the limitation of network bandwidth, can the client service is very limited at the same time, poor scalability,
P2P technology is to solve these problems and put forward a peer-to-peer network structure, in P2P network, each node can get service from other nodes, can also provide services to other nodes, so that large terminal resources being used up, solve the two disadvantages of C/S mode,
P2P applications mainly include files to distribute software, voice services, software, and streaming media software, many P2P applications at present and in a variety of forms, no unified standard of network protocol, the architecture and the organizational form also has a growing,
P2P technology application
(1) distributed scientific computing
P2P technology can make many terminal CPU resources together, in the service of a common calculation, this calculation is usually large amount of calculation and data, takes a long scientific computing, in each calculation process, tasks (including logic and data, etc.) is divided into multiple pieces, was assigned to participate in scientific computing machines, P2P node without affecting the original computer use under the premise of scattered people use of CPU resources to complete the computing tasks, and return the results to one or more servers, integrating many results, in order to get the final result,
(2) the file sharing
BitTorrent is a kind of structure of the network protocol, besides BitTorrent, there are many famous without a structured P2P file sharing agreement, a typical Gnutella [8] and KaZaA [6],
(3) live streaming
(4) streaming media on demand
(5) the IP layer voice communication
Skype take similar topology structure of KaZaA, choose some super node in the network, the communication both sides when direct effect is not good, some suitable super node take on the role of transfer nodes, to create a transfer between two communication parties, and forward the corresponding voice communications package,