240 likes | 264 Views
Learn about the benefits and various areas of application for peer-to-peer (P2P) networks, including file sharing, telephony, media streaming, and more. Understand how P2P networks work and the advantages they offer over client-server architectures.
E N D
Category of P2P • ‘Pure' P2P networks: • Peers act as equals, merging the roles of clients and server • There is no central server managing the network • Decentralized, nodes have equal role/capability and peer communication is symmetric. • truly dynamic and less vulnerable to downtown time since there is no critical component. • Hybrid P2P systems: • super nodes keep keeps information on peers, index of the resources or allocating tasks in the system. • Peers host resources, letting the super nodes know what resources they want to share • Hybrid has better performance than pure, but limited by the availability of the indexing servers.
Advantages of P2P networks • Easily scale up or down • Total capacity of the system increases as the number of participates increases. • not true of a client-server architecture with a fixed set of servers, more clients could mean slower data transfer for all users. • Better bandwidth utilization since the peers communicate directly with each other
Advantages of P2P networks • The distributed nature of P2P networks also increases robustness in case of failures, • in pure P2P systems, no single point of failure in the system. • Richness and diversity in services/resource available in the network
Areas of application • File sharing (e.g. BitTorrent) • Telephony (e.g. Skype) • Media (audio/video) streaming (e.g. iPlayer Download Manager)
P2P File distribution • Distributing a large file from a single server to a large number of hosts (peers) • In client-server, the server sends the file to each peer. Hence enormous amount of server’s bandwidth • In P2P, each peer can redistribute any portion of the file, assisting in distributing the file. Hence scalable • Example: BitTorrent • Popular P2P protocol for file distribution • http://www.bittorrent.org/introduction.html
BitTorrent application • BitTorrent protocol, designed by Bram Cohen • http://en.wikipedia.org/wiki/BitTorrent_(protocol) • A BitTorrent client is a program that implements the BitTorrent protocol. • Each client can prepare, request, and transmit any type of computer file over a network • A peer is any computer running an instance of a client.
BitTorrent overview • Peers download files by participating in a file swarm which is an ad-hoc network of peers that are temporarily assembled to distribute a particular resource. • Peers in a swarm download equal size chunks of the file from one another.
BitTorrent Overview • The protocol works when a file provider makes his file the first seed, which allows others peers, to download their data. • Each peer who downloads the data also uploads it to other peers • Peers are encouraged to continue making data available after the download has completed, and becoming additional seeds. • Peers that provide a complete file are called seeders, and the peer providing the initial copy is called the initial seeder.
BitTorrent Model Referenece: http://www.medianet.kent.edu/surveys/IAD06S-P2PArchitectures-chibuike/P2P%20App.%20Survey%20Paper.htm#_2.2_Bittorrent
BitTorrent Index • A BitTorrent index is a list of .torrent files (usually including descriptions of the file and other information) • Managed by a website, that is available for searching files to download
Torrent (.torrent) files • This refers to the small metadata file that contains information about the data you want to download, not the data itself. • Typically, a torrent file specifies the URL of the tracker, and contains names for the files, their lengths, etc. • Torrent files are typically published on websites.
BitTorrent Tracker • A tracker is a server which assists in the communication between the peers • The tracker maintains lists of clients currently participating in the collection of clients uploading and downloading. • When you open a torrent file, your machine contacts the tracker and asks for a list of peers to contact. • Periodically, throughout the transfer, your machine will inform the tracker about your status: e.g. how much downloaded and uploaded.
Tracker and indexing website • Many BitTorrent websites act as both tracker and index. • They publish the tracker's URL so that users can embed the tracker's URL in the torrent file. • Provide all the features necessary to initiate a download.
BitTorrent Operation • To share a file, a peer first creates a small file called a "torrent" (e.g. MyFile.torrent). • This file contains metadata about the files to be shared and about the tracker. • Peers that want to download the file must first obtain a torrent file for it, and connect to the specified tracker, • which tells them from which other peers to download the pieces of the file from.
BitTorrent Operation • Trackers is responsible to help downloader locate one another in the system by keeping track of the seeders and downloaders. • Each peer polls the tracker for information about other peers to find suitable peers to trade pieces. • Tracker responds with a random list of peers that are participating in the transfer.
BitTorrent Operation • Peers report to the tracker information about • what pieces it has, • its download and upload rate, • its IP address and port the Bittorrent client application is running on.
BitTorrent Operation • Peers continuously trade piece with other peers until they have obtained the complete set of file pieces. • The order in which pieces are request from other peers is optimized to improve their download rates. • Once a peer has at least one complete piece to trade, it uses a strategy of piece selection by choosing to download rare pieces in the network
BitTorrent Operation • For file downloads to be successful, at least one peer (seeder) with the complete file must participate in the transfer • As more peers in the system complete their download and remain as seeders in the network, request for file start to complete quickly since each new peer participating in a file swarm adds additional upload bandwidth.
peer Tracker peer Alice A Scenario of File Distribution Obtain list of peers peer
Alice gets connected • Alice joins the swarm • Tracker randomly selects a list of peers, sends the IP addresses to Alice • Alice attempts to establish TCP connections with the peers • Alice successfully connects to some peers (“neighbouring peers”) • Neighbouring peers fluctuate over time as some leave and other peers attempt to connect to Alice. • Periodically, Alice asks each of her neighbouring peers for the list of chunks they have
Alice’s decisions • Which chunk to request first from her neighbours? • Rarest first, i.e. the chunk with fewest copies among the neighbours • Increase copies of the rarest chunks • To which of her neighbours to send requested chunks? • Give priority to neighbours supplying her at the highest rate. • Every 30 seconds Alice randomly choose a new trading partner • Peers uploading at compatible rates tend to find each other. • Reduce free-riding.
BitTorrent download vs client server download • BitTorrent makes many small data requests over different TCP sockets, while web browsers typically make a single HTTP GET request over a single TCP socket. • BitTorrent downloads in a random or in a "rarest-first" approach that ensures high availability, while HTTP downloads in a sequential manner.
Refereneces • http://en.wikipedia.org/wiki/BitTorrent_(protocol) • A clip by on BitTorrent • http://www.youtube.com/watch?v=fWBXhiGGEPk