# Survey of Network Coding Based P2P File Sharing in Large Scale Networks
## 4 Network Coding Based P2P File Sharing Systems
### Generation Based Coding
In addition, the results show that BitTorrent without coding is the most affected by churn even when the churn rate is very small (close to zero). [PERSON] et al. [73] execute a wide range of P2P file sharing simulations including both with and without network coding schemes for the sake of comparison and analysis. Results show that utilizing generation network coding for a P2P file sharing network incurs only a relatively small overhead and could perform much better than trivial routing approaches as long as the following conditions are met--first, using DRLNC [51] to avoid unlucky combinations; second, the selection of the size and the number of coding pieces should be done carefully such that the coding speed is no longer slower than the transmission speed; and, third, applying Gauss-Jordan elimination for early decoding to avoid long delay in the decoding process. [PERSON] et al. [74] propose P2P File sharing based on nEtwork coDing (PPFEED). PPFEED studies network coding by utilizing a special network topology called a combination network [75; 76], which can be modeled by a graph that contains three types of nodes: one source, relays, and receiver nodes. The authors claim that such a topology has a good level of performance in terms of network coding gain. In contrast to RLNC, a deterministic network coding scheme is proposed based on [77] such that the encoded pieces are always innovative. For \(n\) pieces, generation size \(g\), and \(GF(q)\) with \(q\) different symbols such that \(q\geq n\), pieces of a generation are encoded \(n\) times and for each row vector only one coefficient, \(c_{i}\), is randomly selected from \(GF(q)\) and then the encoding is done as follows: the 1 st piece's value is multiplied by 1, the 2 nd piece's value is multiplied by the selected coefficient, the 3 rd piece's value is multiplied by the same coefficient squared, and so on until the \(kth\) piece is multiplied by the same coefficient raised to a power of \(g-1\). For instance, for \(g=3\), coefficients vectors are selected as follows: \((1,c_{1},c_{1}^{2}modq)\), \((1,c_{2},c_{2}^{2}modq)\),..., \((1,c_{n},c_{n}^{2}modq)\). By this scheme, any \(g\) pieces of these \(n\) pieces can be used to decode the original \(g\) pieces. Moreover, relay and receiver nodes no longer need to re-code pieces, and just need to forward them properly such that a peer doesn't receive the same coefficient vector two times. To evaluate the performance of this scheme, simulation comparisons are conducted against Narada [78], a P2P multicast system, and Avalanche. The results show that the overall download time of PPFEED is shorter than Narada and Avalanche by 15%-20% and 8%-10%, respectively. [PERSON] et al. [79] propose Network Coding Messaging Extension (NCME). NCME is not an alternative for BitTorrent; it only extends the features of BitTorrent and backward compatibility while the baseline BitTorrent is kept. The peer must decide which optimal communication paradigm to use, either pure BiTorrent or NCME. After encoded pieces are received and a generation becomes fully downloaded and decoded, BitTorrent pieces can be restored and shared with a non-NCME compatible BitTorrent. For evaluation purposes, a comparison between NCME and standard BitTorrent is conducted. Results show that NCME distributes the file among the peers 20% faster. Moreover, to maintain NCME's superior performance over BitTorrent, it is suggested to keep a generation size of 43 pieces. However, neither is the best piece size mentioned nor an experimental work provided to support this suggestion. From the aforementioned studies, we can conclude that generation network coding can be applied practically. However, to get the best gain of generation network coding, parameters such that generation size and piece/generation selection policy should be perfectly selected. Table 4 summarizes the most important studies related to generation Network coding.