2.5–Peer-to-PeerFileDistribution
- In P2P file distribution, each peer can redistribute any portion of the file it has received to any other peers, thereby assisting the server in the distribution process.
- As of 2016 BitTorrent (by Bram Cohen) was the most popular file distribution protocol.
- Comparing the client-server architecture and the peer-to-peer architecture example:
- Consider a simple quantitative model for distribution a file to a fixed set of peers for both architecture types.
- The server and the peers are connected to the Internet with access links. Denote the upload rate of the server’s access link by $$u_s$$, the upload rate of the $$i^{th}$$ peer’s access link by $$d_i$$. Also denote the size of the file by F and the number of peers that want to obtain a copy of the file by N.
- The distribution time is the time it takes to get a copy of the file to all N peers.
- In this example we suppose that the Internet core has abundant bandwith and that all participants are only downloading this file, no other network activity
- Let’s determine the distribution time for the client-server architecture $$D_{cs}$$:
- The server must transmit one copy of the file to each of the N peers, thus the server must send NF bits which makes the time it takes at least $$\frac{NF}{u_s}$$
- Let $$d{min}=min(d_1,d_2,...,d_N)$$ denote the download rate of the peer with the lowest download rate. The peer cannot obtain the F bits of the file in less than $$\frac{F}{d{min}}$$ seconds.
- These observations gives us $$D{cs} \ge max(\frac{NF}{u_s},\frac{F}{d{min}})$$
- We see that the distribution time increases linearly with the number of peers.
- Let’s determine the distribution time for the Peer-to-Peer architecture $$D_{P2P}$$:
- At the beginning of the distribution, only the server has the file. To get this file into the community of peers, the server must send each bit of the file at least once into the access link. Thus, the minimum distribution time is at least $$\frac{F}{u_s}$$.
- As with the client-server architecture, the peer with the lowest download rate cannot obtain all F bits of the file in less than $$\frac{F}{d_{min}}$$ seconds.
- Finally, observe that the total upload capacity of the system as a whole is equal to the upload rate of the server plus the upload rate of each of the individual peers, that is, $$u_{total} = u_s+u_1+...+u_N$$ . The system must delvier F bits to each of the N peers, thus delivering a total of NF bits.
- These observations gives us
- We have set $$\frac{F}{u}=1 hour, us = 10u, d{min}\ge u_s$$ thus giving us a peer can transmit the entire file in one hour, the server transmission rate is 10 times the peer upload rate and the peer download rates are set large enough so as not have an effect.
- For the P2P architecture, the minimal distribution time is not only always less than the distribution time in the client-server architecture, but it is also less than one hour for any number of peers N. Thus P2P can be self-scaling