BitTorrent-like P2P Networks

  • Published on
    15-May-2015

  • View
    638

  • Download
    0

Embed Size (px)

Transcript

<ul><li> 1. BitTorrent-like P2P NetworkStudying the average download times withrespect to different piece selection algorithms.</li></ul> <p> 2. Understanding Concepts BitTorrent A protocol that supports P2P file sharing Used to distribute large amount of data over the internet. Uses the tracker once to get the list of peers 3. Understanding Concepts Understanding basic terms of BitTorrent A BitTorrent portal A central server where the .torrent files are made available. A BitTorrent swarm Set of peers that all download a particular content. A BitTorrent tracker Server that keeps track of all the clients that form a swarm for afile A BitTorrent Client Seeder Has the complete file. Leecher Doesnt have the complete file, but instead it mayhave some pieces of the file 4. Understanding Concepts A .torrent file contains:- Content name File Size Chunks Number of chunks &amp; Size of a chunk Torrent infohash Unique identifer of the swarm associated with a .torrent file IP addresses of the trackers managing the swarm Pieces Made of blocks Block might also be divided into sub-blocks Two or more blocks make up a whole piece 5. Peer joining and leaving a swarm User gets a .torrent file and runs it in a BitTorrentclient software software picks one or more tracker Tracker is contacted using the IP address Use of announce started request. Response Received(Peer neighbourhood) Some random seeds and peers(typically between 40 - 200) The IP address associated with each seed and peer returned. Leave the swarm Use of announce stopped request to tracker. 6. File exchange in BitTorrentProtocol Peer Wire Protocol The two communicating peers do a handshake Understanding bitfields Current download information of the file concerned Specifically the pieces of the file, that is, which piece iscomplete and which is not BITFIELD message Exchanged before having any kind of file transfer Content exchanged are bitfields Every peer knows about the file download information of all itsneighbors. 7. File exchange in BitTorrentProtocol Peer Wire Protocol(contd.) HAVE Message When a new piece is completely downloaded by a peer, thepeer has to notify everybody in the peer neighborhood aboutthe same. This notification does not involve the whole bitfields exchangeagain as only the change in bitfields has to be notified. 8. Our hypothesis Weighty piece selection algorithm reduces theaverage download time of a particular file withrespect to the rarest first piece selection algorithm. What is Average Download Time Rarest First Piece Algorithm Weighty Piece Selection Algorithm Source: Chi-Jen Wu; Cheng-Ying Li; Jan-Ming Ho; , "Improving the Download Time of BitTorrent- Like Systems," Communications, 2007. ICC 07. IEEE International Conference on 24-28 June 2007,page 1125-1129, doi: 10.1109/ICC.2007.191 9. Average Download Time The average download time of all the peers in aparticular trial The average download time for individual peeraveraged over the number of trials. 10. Understanding the Algorithms Rarest First Piece Algorithm It favors the download of pieces that are rare in the currentpeer neighborhood. Purpose:- Overcomes the last piece problem by increasing the piece availability of rare pieces. Source: Chi-Jen Wu; Cheng-Ying Li; Jan-Ming Ho; , "Improving the Download Time of BitTorrent- Like Systems," Communications, 2007. ICC 07. IEEE International Conference on 24-28 June 2007,page 1125-1129, doi: 10.1109/ICC.2007.191 11. Understanding the Algorithms Rarest First Piece Algorithm(contd.) Rarest First Piece calculation Every peer maintains the count of copies of all the pieces available in the peer neighborhood The peer having a missing piece, also knows that how low is the availability of the piece in the network Peer chooses a particular missing piece for download - that is available with some other peer(s), but its total availability is relatively very low with respect to other missing pieces. Source: Chi-Jen Wu; Cheng-Ying Li; Jan-Ming Ho; , "Improving the Download Time of BitTorrent- Like Systems," Communications, 2007. ICC 07. IEEE International Conference on 24-28 June 2007,page 1125-1129, doi: 10.1109/ICC.2007.191 12. Understanding the Algorithms Weighty Piece Selection Algorithm Purpose It is designed for the purpose of reducing the average download time. Weight assignment of each missing piece It takes into consideration - all the peers that miss the same piece that a particular peer wants to request. Sum of downloaded pieces of all the peers, selected above, is calculated individually. Sum of individual sums, calculated above, is calculated. The added sum is the weight of the missing piece. Source: Chi-Jen Wu; Cheng-Ying Li; Jan-Ming Ho; , "Improving the Download Time of BitTorrent- Like Systems," Communications, 2007. ICC 07. IEEE International Conference on 24-28 June 2007,page 1125-1129, doi: 10.1109/ICC.2007.191 13. Approach taken to Prove/disprove the hypothesis Simulation of BitTorrent-like peer to peer protocol. First the simulation runs using the rarest first piece selectionalgorithm. Subsequently the simulation runs using the weighty pieceselection algorithm. All other things are kept the same except the piece selectionalgorithm. 14. Measurements Time starts at the beginning of the simulation. Time is measured again when every client has the allthe pieces of the file. 15. Software Design Tracker Design 16. Software Design(contd) Peer Design 17. Software Design(contd) Peer File Design 18. Software Design(contd) Piece Design 19. Software Design(contd) Main Program - Tracker Hold all the peer objects. Simulation of the seeds and leechers The peer objects hold the file object for maintaining thestate of the file being downloaded. We simulate only one file to study the download rates. The peer object hold the information of peer neighborhood. Simulation of the Bandwidth Download and upload rates of each peer are assigned. 20. Software Design(contd) Use of RITs Parallel Java Library Usage of package edu.rit.sim for simulating the downloadof a piece of a file. Achieving the simulation of downloading a piece by the useof simulated time. Future events are set for denoting the completion of thedownload of a particular piece. During the download, the available bandwidth and number ofslots are being affected. No actual file piece transfer is happening. 21. Software Design(contd) Implementation of achieving the effect of Tit-for-TatPolicy The tit-for-tat policy aims at matching the peers according tosimilar bandwidths. Similar bandwidth means the download speed of the peerrequesting a piece and the upload speed of the peer thatprovides the piece should be nearly the same. 22. Software Design(contd) Implementation of strategic peer Strategic peer means that the peer leaves the system as soonas the peer completes downloading its missing pieces. As soon as the peer has no missing piece, it stopscontributing anything to the simulation and no calculationsare hampered:- For Rarest Piece First Algorithm Relatively, it doesnt matter ifevery piece count is one extra for calculation. For Weighty Piece First Algorithm If no pieces are missingwithin a peers file, the weight calculation is independent of thispeer. 23. Software Design(contd) Assumptions No Last piece problem. The reason for the above is that we have provided with oneseed in every peer neighborhood. A peer downloads one piece at a time. Control messages bandwidth is separate and thus does notinterfere with the download and upload bandwidth of thepieces. 24. Software Design(contd) Assumptions(contd.) Download time calculation starts from a snapshot of thesystem Understanding a snapshot of a system:- All the peers and one seed is available before the downloadmeasurements start. This will be a random situation in a real environment where somepeers would be running and at any instant the calculation can begin. No more peers are added or removed once the simulation startsrunning. Peer have some random pieces of the file initially(same piecesfor both the versions) 25. Developers Manual How to compile our source code Download and extract:- RITs Parallel Java Library http://www.cs.rit.edu/~ark/pj.shtml RITs Computer Science Course Library http://www.cs.rit.edu/~ark/cscl.shtml Extract the zip file containing all the programs to adirectory of your choice Set the class path first to the current directory then to theparallel java library and then to the computer science courselibrary. Compile all the programs then by javac *.java 26. Usage of the Software Usage: java Tracker 27. Live Demo Any Questions before the demo 28. Parameters used in collectingmeasurement dataKnobValueNumber of peers 30Neighborhood size 10Number of chunks100Piece size10Seed Upload rate300Peer download rate250Peer upload rate200Peer download slots 10Peer upload slots 10Number of trials30Master seed 123456 29. Measurement Data 1 Rarest Piece First Selection Algorithm: Total average download time of all the peers in a trialTrialTotal Average TrialTotal AverageNumber Download Time Number Download Time15.1116 5.6624.9317 7.0735.2618 6.9445.7619 5.2856.2920 4.4465.4421 6.8577.3122 5.8085.1523 5.1496.7624 6.1610 4.7625 6.3911 6.4426 5.1612 6.2427 5.8013 5.0628 4.8714 5.9729 6.5615 6.6430 5.32 30. Measurement Data 1 Weighty Piece First Selection Algorithm: Total average download time of all the peers in a trialTrialTotal Average TrialTotal AverageNumber Download Time Number Download Time15.2516 5.6024.6917 7.4335.3618 6.6945.2519 5.1256.2120 4.2365.2721 6.9177.5422 5.6385.0123 5.0697.0924 6.4310 5.2125 6.0511 6.1526 5.4312 6.1827 6.0613 4.9828 4.5714 5.5429 6.3515 6.7530 5.35 31. Measurement Data 1 32. Analysis 1 Total average download time of all the peers in a trial The data collected reveals that:- regardless of the number of nodes, the number of trials and thatof the neighbors, the individual average download time in bothcases (rarest first piece and weighty piece selection algorithm)follow a same, quasi-periodic pattern; the average time valuesalternately go up and down. We can observe that the tit-for-tat policy increases the uploadcapacity of the network in a scalable manner. We can alsoobserve that when the tit-for-tat rule is enforced, the pieceselection algorithm matters less. 33. Measurement Data 2 Rarest Piece First Selection Algorithm: Average download time of Individual Peer Over Number of Trials Peer Number Average Peer Average Download Time Number Download Time 0 - 15 0.20 1 0.2016 0.17 2 0.1517 0.18 3 0.1918 0.26 4 0.1819 0.18 5 0.1820 0.19 6 0.1821 0.23 7 0.2522 0.26 8 0.2223 0.19 9 0.1424 0.22 100.2125 0.19 110.1826 0.21 120.1727 0.20 130.1928 0.19 140.1929 0.18 34. Measurement Data 2 Weighty Piece First Selection Algorithm: Average download time of Individual Peer Over Number of Trials Peer Number Average Peer Average Download Time Number Download Time 0 - 15 0.19 1 0.2216 0.16 2 0.1517 0.19 3 0.1918 0.25 4 0.1819 0.16 5 0.1820 0.20 6 0.1721 0.21 7 0.2422 0.27 8 0.2123 0.18 9 0.1524 0.24 100.2225 0.20 110.1726 0.19 120.1727 0.19 130.1828 0.20 140.1929 0.19 35. Measurement Data 2 36. Analysis 2 Average download time of Individual Peer OverNumber of Trials Almost similar pattern; the average time values alternatelygo up and down. This implies two things First, the tit-for-tat policy applies in a scalable manner (for anynumber of peers). The average download time is not a function of the pieceselection strategy. Weighty piece selection algorithm could possibly reduce the averagedownload time of all the peers. However, that would require to notimplement the tit-for-tat policy, which would then decrease the uploadcapacity of the overall network. 37. Result We have disproved our hypothesis. It is necessary that Tit-for-Tat policy is implemented in aBit-Torrent like network. The average download time is not a function of pieceselection strategy. 38. Future Work The possible future work includes the following:- Currently one piece is being downloaded at a time. It has tobe extended to multiple pieces at a time. So the downloadslots dont matter for the current version of the program. Full piece download to block by block download. Provision for storing metadata for piece download block byblock has been provided so that extending the project is easy. Control messages bandwidth is assumed to be separate andthus not interfering with the download and uploadbandwidth of the file transfer. That bandwidth can also bemerged and simulated. 39. Learning from our investigation This team research investigation has allowed us togain a deep insight of BitTorrent-like networks. Understanding the concepts like why BitTorrent isused to distribute large scale data over internet. In addition, weve gained experience on how to readand analyze scientific articles, draw hypothesis andverify them using simulation programs. 40. References Chi-Jen Wu; Cheng-Ying Li; Jan-Ming Ho; , "Improving the Download Time ofBitTorrent- Like Systems," Communications, 2007. ICC 07. IEEE InternationalConference on 24-28 June 2007,page 1125-1129, doi: 10.1109/ICC.2007.191 http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&amp;arnumber=4288862 Amir H. Rasti; Reza Rejaie; , "Understanding Peer-level Performance inBitTorrent: A Measurement Study," Computer Communications and Networks,2007. ICCCN 2007. Proceedings of 16th International Conference on 13-16 Aug.2007,page 109 114 http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&amp;arnumber=4317805 Bharambe, A. R.;Herley, C.; Padmanabhan, V. N.; , "Analyzing and Improving aBitTorrent Networks Performance Mechanisms," INFOCOM 2006. 25th IEEEInternational Conference on Computer Communications. Proceedings, April 2006,page 1-12 http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&amp;arnumber=4146981 RITs Parallel Java Library Developed by Prof. Alan Kaminsky http://www.cs.rit.edu/~ark/pj.shtml RITs Computer Science Course Library Developed by Prof. Alan Kaminsky http://www.cs.rit.edu/~ark/cscl.shtml</p>

Recommended

View more >