how bit torrent works.pptx

Upload: -

Post on 03-Apr-2018

239 views

Category:

Documents


1 download

TRANSCRIPT

  • 7/28/2019 How Bit Torrent works.pptx

    1/24

    How Bit Torrent Works?A PRESENTATION BY

    ADITYA MISRA (10ECE035) RAJESH LIRIA (10ECE064)

  • 7/28/2019 How Bit Torrent works.pptx

    2/24

    Bit Torrentan introduction

    Consumed about 40% of the world bandwidth in 2012

    No requirement of large capacity server or expensive bandwidth

    Works on a p2p network basis

    Data is much more secure over such a p2p network

    The possibility of a server crash or timeout is exterminated.

    In a nut shell, bit torrent is a setup to extend the number of file sourcesexponentially.

  • 7/28/2019 How Bit Torrent works.pptx

    3/24

    Popular Terms

    AVAILABILITY

    CLIENT

    HASH/HASH SUM

    HIT AND RUN

    LEECH

    LURKER

    SEED

    PEER

    P2P (PEER TO PEER)

    SWARM

    TRACKER

    METADATA

  • 7/28/2019 How Bit Torrent works.pptx

    4/24

    Why Bit Torrent?

    Used for replication of large amounts of static data.

    Scalability : the speed of data transfer or throughput increases with theincrease of peers and seeds to a swarm.

    Efficientutilizes a large amount of available network bandwidth

    Tolerant to dropping peers

    Ability to verify data integrity (SHA-1 Hashes)

    Minimise piece overlap among peers to allow each peer to exchangepieces with as many other peers as possible

  • 7/28/2019 How Bit Torrent works.pptx

    5/24

    File SplittingThe file to be distributed is spl it up in pieces and an SHA-1 hash is calculated for each piece.

  • 7/28/2019 How Bit Torrent works.pptx

    6/24

    Metadata File

    A metadata file (commonly known as .torrent file) is distributed to all thepeers in a swarm, using a different protocol.(Generally, http or ftp)

    The metadata contains

    The SHA-1 hashes of all pieces (Secure Hash Algorithm)

    A mapping of the pieces to files

    A tracker reference

    URL of tracker

    Name

    Length of file

  • 7/28/2019 How Bit Torrent works.pptx

    7/24

    Tracker

    The tracker is a central server keeping a list of all peers participating in theswarm

    A swarm is the set of peers that are participating in distributing the samefiles

    A peer joins a swarm by asking the tracker for a peer list and connects tothose peers.

  • 7/28/2019 How Bit Torrent works.pptx

    8/24

    Graphic VisualizationThe above visualization shows a set of swarm with the pieces they have. The node connected with an arrow is a newpeer to the swarm requesting for the list of ip of its peers.

  • 7/28/2019 How Bit Torrent works.pptx

    9/24

    Graphic VisualizationThe above visualization shows a set of swarm with the pieces they have. The node connected with an arrow is a ne

    peer to the swarm requesting for the list of ip of its peers.

  • 7/28/2019 How Bit Torrent works.pptx

    10/24

    DHT distributed hash table

    Works as a hash table with sha1-hashes as keys.

    The key is the info-hash, the hash of the metadata. It uniquely identifies atorrent.

    The data is a peer list of the peers in the swarm.

    Each node is assigned an ID

    in the key space (160 bit numbers)

    Nodes order themselves in a defined topography

    Makes it possible to search for Ids by traversing the node topography

    Bittorrent uses kademlia as DHT.

  • 7/28/2019 How Bit Torrent works.pptx

    11/24

    Kademlia Bootstrap

    Each node bootstraps by looking for its own ID

    The search is done recursively until no closer nodes can be found

    The nodes passed on the way are stored in the routing table

    The routing table have more room forclose nodes than distant nodes

  • 7/28/2019 How Bit Torrent works.pptx

    12/24

    Kademlia Routing Table

    Each node knows much more about close nodes than distant nodes

    The key space each bucket represents is growing with the power of 2 with

    the distance

    Querying a node for a specific ID will on average halve the distance to thtarget ID each step

  • 7/28/2019 How Bit Torrent works.pptx

    13/24

    Visualization of Kademlia Bootsrap RoutingNode Bucket gives us the list of neighborhood peers. Farther you are on the Node ID bit, the closer you are to you

    neighbors.

  • 7/28/2019 How Bit Torrent works.pptx

    14/24

    Visualization of Kademlia Node IDEach bit level represents a node bucket. Higher on the node bucket, more the no. of neighborhood peers.

  • 7/28/2019 How Bit Torrent works.pptx

    15/24

    Pieces and Sub-pieces

    A piece is broken into sub-pieces typically 16KB in size.

    Until a piece is assembled, only download the sub-pieces of that pieceonly

    This policy lets pieces assemble quickly.

  • 7/28/2019 How Bit Torrent works.pptx

    16/24

    Piece overlap

    Small overlap Big overlap

  • 7/28/2019 How Bit Torrent works.pptx

    17/24

    Piece Selection

    The order in which pieces are selected by different peers is critical forgood performance

    If an inefficient policy is used, then peers may end up in a situation where

    each has all identical set of easily available pieces, and none of themissing ones.

    If the original seed is prematurely taken down, then the file cannot becompletely downloaded!

  • 7/28/2019 How Bit Torrent works.pptx

    18/24

    Piece Selection Algorithms

    Strict Priority

    First priority (commonly in a sequential order, otherwise can be reconfigured toour own choice)

    Rarest First

    General Rule (preset in all the torrent clientsBit Torrent, Torrent, Vuze,

    Transmission)

    Random First Piece

    Special Case, at the beginning

    Endgame Mode

    Special Case for end of data transmission.

  • 7/28/2019 How Bit Torrent works.pptx

    19/24

    Bit Torrent : Internal Mechanism

    Built in Incentive mechanism

    Choking Algorithm

    Optimistic Unchoking

  • 7/28/2019 How Bit Torrent works.pptx

    20/24

    Choking Algorithm

    Choking is a temporary refusal to upload. It is one of BitTorrents mostpowerful idea to deal with free riders (those who only download but neverupload).

    Tit-for-tat strategy is based on game-theoretic concepts. A good choking algorithm caps the number of simultaneous uploads for

    good TCP performance.

    Avoids choking and unchoking too quickly, known as fibrillation).

  • 7/28/2019 How Bit Torrent works.pptx

    21/24

    Optimistic Unchoking

    A BitTorrent peer has a single optimistic unchoke to which it uploadsregardless of the current download rate from it. This peer rotates every 30s

    Reasons: To discover currently unused connections are better than the ones being used

    To provide minimal service to new peers

  • 7/28/2019 How Bit Torrent works.pptx

    22/24

    Upload only mode

    Transition from a peer to a seed.

    Once download is complete, a peer has no download rates to use for

    comparison nor has any need to use them. Upload to those with the best upload rate. This ensures that pieces get

    replicated faster, and new seeders are created fast.

  • 7/28/2019 How Bit Torrent works.pptx

    23/24

    Optimization of Bit Torrent - Canwe further push the limits?

    A centrally monitored and controlled uplink and downlink of data between two nodes may theoreprovide a larger throughput, but in real environment that has to deal with - non responsive nodes, aasymmetrical upload and download bandwidth; Bit Torrent might be the most efficient p2p sharingnetwork in the entire course of file exchange protocols.

    CANACENTRALLY SCHEDULED FILE DISTRIBUTION PROTOCOL GIVEAN ANSWERTOTHE BIT TORRENT LAG ?

  • 7/28/2019 How Bit Torrent works.pptx

    24/24

    Summary and Queries.

    Well go through a quick revision on what we learnt. You may ask anyquestions post summary.

    Thank you for your attention !