CS219 BitTorrent Talk

download CS219 BitTorrent Talk

of 24

Transcript of CS219 BitTorrent Talk

  • 8/18/2019 CS219 BitTorrent Talk

    1/24

     

    The BitTorrentcontent distribution system

     Nikitas Liogkas

    CS219 – P2P SystemsUniversity o Ca!iornia" Los #nge!es

  • 8/18/2019 CS219 BitTorrent Talk

    2/24

     

    $otivation

    !ash cro%d &aka s!ashdot' eect many c!ients" e% servers

    Prob!em( servers cannot hand!e !oad

    So!ution( s%arming c!ients do%n!oad )ieces o the i!e

    rom each other  has been )roven to have good sca!ing and

     )erormance )ro)erties

  • 8/18/2019 CS219 BitTorrent Talk

    3/24

     

    Presentation out!ine

    *oining the system

    +ncoding , metadata i!e

    Tracker )rotoco!

    Peer %ire )rotoco!

    Piece se!ection

    Peer se!ection

    C!ient im)!ementations

    -esources

  • 8/18/2019 CS219 BitTorrent Talk

    4/24

     

    ne% !eecher 

    *oining a torrent

    Peers divided into(  seeds( have the entire i!e

    leechers( sti!! do%n!oading

    data

    re.uest

     )eer !ist

    metadata i!e

     /oin

    1

    2 0

    seed,!eecher 

    %ebsite

    tracker 

    1 obtain the metadata file &out o band'2 contact the tracker  0 obtain a peer  list  &contains seeds 3 !eechers' contact )eers rom that !ist or data

  • 8/18/2019 CS219 BitTorrent Talk

    5/24

     

    4

    +5changing data

    6 have!eecher #

    8eriy pieces  using hashes7 o%n!oad sub:)ieces &b!ocks' in parallel 

    7 Advertise received )ieces to the entire )eer !ist

    7 interested ( need )ieces that a given )eer has

    seed

      !eecher B

    !eecher C

  • 8/18/2019 CS219 BitTorrent Talk

    6/24

     

    Bencoding

    encoding ormat o a!! e5changed messages

    our ty)es

     byte strings integers

    !ists

    dictionaries &ma))ing keys to va!ues'

    e5am)!es (s)am re)resents the string ;s)am<

    i1=e re)resents the integer 1=

  • 8/18/2019 CS219 BitTorrent Talk

    7/24 

    $etadata i!e structure

    contains inormation necessary to contact the

    tracker and describes the i!es in the torrent

    announce U-L o tracker  i!e name

    i!e !ength

     )iece !ength &ty)ica!!y 2>?@B'

    SA#:1 hashes o )ieces or veriication

    and creation date" comment" creator"

  • 8/18/2019 CS219 BitTorrent Talk

    8/24 

    Tracker )rotoco!

    communicates %ith c!ients via ATTP,ATTPS c!ient +T re.uest

    inoDhash( uni.ue!y identiies the i!e

     )eerDid( uni.ue!y identiies the c!ient c!ient 6P and )ort &ty)ica!!y ?EE1:?EE9' num%ant( ho% many )eers to return &deau!ts to >=' stats( bytes u)!oaded" do%n!oaded" !et

    tracker +T res)onse interva!( ho% oten to contact the tracker  !ist o )eers" containing )eer id" 6P and )ort stats( com)!ete" incom)!ete

    tracker:!ess modeF based on the @adem!ia AT

  • 8/18/2019 CS219 BitTorrent Talk

    9/24 

    Presentation out!ine

    *oining the system

    +ncoding , metadata i!e

    Tracker )rotoco!

    Peer %ire )rotoco!

    Piece se!ection

    Peer se!ection

    C!ient im)!ementations

    -esources

  • 8/18/2019 CS219 BitTorrent Talk

    10/24 

    Peer %ire )rotoco!

    im)!emented on to) o TCP

    messages handshake &maybe %ith bitie!d' kee):a!ive choke , unchoke interested , not interested

    have &advertisement o a ne%!y:ac.uired )iece' re.uest , )iece cance! &on!y used in ;endgame mode

  • 8/18/2019 CS219 BitTorrent Talk

    11/24 

    Piece se!ection

    %hen do%n!oading starts( choose at random get com)!ete )ieces as .uick!y as )ossib!e obtain something to trade

    ater %e have )ieces( &!oca!' rarest irst achieves the astest re)!ication o rare )ieces obtain something o va!ue to trade get uni.ue )ieces rom the seed

    endgame mode deense against the ;!ast:b!ock )rob!em< send re.uests or missing sub:)ieces to a!!

     )eers in our )eer !ist

    send cance! messages u)on recei)t o a sub:)iece

  • 8/18/2019 CS219 BitTorrent Talk

    12/24 

    Last:b!ock )rob!em

    at the end o the do%n!oad" a )eer may have

    troub!e inding the missing )ieces

     based on anecdota! evidence

    other )ro)osa!s net%ork coding Gkantsidis et al " 6nocomH=>I

     )reer to u)!oad to )eers %ith simi!ar i!ecom)!etenessF unair or the )eers %ith most

    o the )ieces GTian et al." 6nocomH=?I

  • 8/18/2019 CS219 BitTorrent Talk

    13/24 

    Last:b!ock )rob!em – a mythJ

    is it a )rob!em ater a!!J

    igure rom GLegout et al., 6N-6#:T-:2==?I" %ith )ermission

  • 8/18/2019 CS219 BitTorrent Talk

    14/24 

    Peer se!ection : unchoking

    !eecher #

    seed

      !eecher B

    !eecher C

    K ca!cu!ate data:receiving rates

    K u)!oad to &unchoke' the astestK rate ca!cu!ation is )erormed )eriodica!!y&a round occurs ty)ica!!y every 1= seconds'

    K constant number o unchoking s!ots

    K attem)t to achieve Pareto efficiency

  • 8/18/2019 CS219 BitTorrent Talk

    15/24 

    )timistic unchoking

     )eriodica!!y se!ect a )eer at random

    and u)!oad to it ty)ica!!y )erormed every 0 rounds &0= seconds'

    mu!ti:)ur)ose mechanism a!!o% bootstra))ing o ne% c!ients

    continuous!y !ook or the astest )artners

    kee) the net%ork connectedF every )eer has a

    non:Mero chance o interacting %ith any other )eer 

  • 8/18/2019 CS219 BitTorrent Talk

    16/24

     

    Seed unchoking

    o!d a!gorithm unchoke the astest do%n!oaders

     )rob!em( astest )eers may mono)o!iMe seeds

    ne% a!gorithm  )eriodica!!y sort a!! !eechers according to

    their !ast unchoke time

     )reer the most recent!y unchoked !eechersF

    on a tie" )reer the astest

     &)resumab!y' achieves e.ua! s)read o seed band%idth

  • 8/18/2019 CS219 BitTorrent Talk

    17/24

     

    ne% !istre.uest

     )eer !ist

    o%n!oading on!y rom seeds

    !eecher #

    seed

      !eecher B

    !eecher C

    tracker 

    7 -e)eated!y .uery the tracker or )eer !ists7 istinguish the seeds" and receive data rom them

    7 8io!ates airness mode!F may be harmu! to honest )eers

  • 8/18/2019 CS219 BitTorrent Talk

    18/24

     

    +va!uation in )rivate torrents

    Limit band%idth o !eechers 1 to ?" no !imit on seed $odest airness vio!ation &22 better rate'

    %hen se!ish )eer is ast

    -obustness does not suer( most honest s!o%er by O1> min

    median

    ma5

    2>i!e

    >i!e

    22

    o%n!oad rates or a!! )eers

  • 8/18/2019 CS219 BitTorrent Talk

    19/24

  • 8/18/2019 CS219 BitTorrent Talk

    20/24

     

    -ate: vs vo!ume:based se!ection

    Pro)onents o rate:based decision metrics(

    GCohen" P2P+CNH=0I and

    G6N-6# T-H2==?I Pro)onents o vo!ume:based metrics(

    GBharambe et al." $S-:T-:2==>I"

    Gkantsidis et al " 6nocomH=>I"

    G*un et al." P2P+CNH=>I" and

    eonkey i!e:sharing system

     No c!ear %inner yet4

  • 8/18/2019 CS219 BitTorrent Talk

    21/24

     

    C!ient im)!ementations

    main!ine( %ritten in PythonF right no%" the on!yone em)!oying the ne% seed unchoking a!gorithm

    #Mureus( the most )o)u!ar" %ritten in *avaF

    im)!ements a s)ecia! )rotoco! bet%een c!ients&eg )eers can e5change )eer !ists'

    other )o)u!ar c!ients( #BC" BitComet" BitLord"BitTornado" QTorrent" )era bro%ser 

    various non:standard e5tensions reta!iation mode( detect com)romised,ma!icious )eers anti:snubbing( ignore a )eer %ho ignores us su)er seeding( mas.ueraded seed

  • 8/18/2019 CS219 BitTorrent Talk

    22/24

     

    -esources R1

    Basic BitTorrent mechanisms

    GCohen" P2P+CNH=0I

    BitTorrent s)eciication ikihtt)(,,%ikitheoryorg,BitTorrentS)eciication

    $easurement studies

    G6Ma! et al., P#$H=I"GPou%e!se et al " e!t T- 2== and 6PTPSH=>I"

    Guo et al., 6$CH=>I" and

    GLegout et al." 6N-6#:T-:2==?I

  • 8/18/2019 CS219 BitTorrent Talk

    23/24

     

    -esources R2

    Theoretica! ana!ysis and mode!ing

    Giu et al." S6C$$H=I" and

    GTian et al." 6nocomH=?I Simu!ations

    GBharambe et al." $S-:T-:2==>I

    6ncentives and e5)!oiting themGShneidman et al." P6NSH=I"

    G*un et al." P2P+CNH=>I" and

    GLiogkas et al." 6PTPSH=?I

  • 8/18/2019 CS219 BitTorrent Talk

    24/24

    Conc!usion and ood or thought

    BitTorrent is ast and robust

    et" many )arameters are arbitrari!y set number o unchoking s!ots round duration siMe o )ieces,sub:)ieces

    hat can %e !earn rom BitTorrent orthe design o uture P2P content

    distribution )rotoco!sJ