i got u!
by soyokaze
카테고리
이글루링크
즐겨찾기
이글루 파인더
라이프로그
이전블로그
최근 등록된 덧글
안녕하세요 바,.다w이..
by 이은주 at 03/25
싸나이 눈물!!
by 산과 들 at 03/01
q
by akxlsfnxm at 09/01
좋은 글 잘 읽고 갑니다. ..
by codewiz at 10/15
hello
by Naomi at 04/06
nice
by Robert at 04/06
lovely
by JJJ at 11/24
수영 12월 기브업 5월~9월..
by soyokaze at 11/20
i found someone to ..
by soyokaze at 11/15
hey, what's up
by JJJ at 11/08
최근 등록된 트랙백
구조적 예외 처리
by 오선쓰 이글루
미국 교포가 한국을 바..
by Just for fun~
rss

skin by 꾸자네
Bittorrent Protocol
BitTorrent System Unit
  • 'metainfo' file ( .torrent)
  • traker
  • original dwonloader
  • downloder


Metainfo file Structure

Tracker HTTP/HTTPS Protocol
  • info_hash : Metainfo File의 info key의 SHA1 hash값 (20byte), urlencode 필요
  • peer_id : client가 실행할때 생성된 client의 unique ID (20byte string)
  • port : client가 listen하는 port (보통 6881~6889 사용)
  • uploaded : 업로드 받은 양의 합 (bytes)
  • downloaded : 다운로드 받은 양의 합 (bytes)
  • left
  • event
    • started : tracker에 첫번째 요청 시
    • stopped : client를 종료 시
    • completed : 다운로드 완료시 (실행시 이미 다운로드 완료되었다면 보내지 않음)
  • ip : (optional) client IP 주소
  • numwant : (optional) client가 tracker로 부터 받고 자 하는 peer의 수('0'도 가능), 기본값 50(numwant key를 사용하지 않을 경우)
  • key : (optional)
  • trakerid : (optional)
  • example
    * Tracker GET requests have the following keys urlencoded -
    req = {
           info_hash => 'hash'
           peer_id => 'random-20-character-name'
           ip => 'ip-address' -or- 'dns-name'
           port => '12345'
           uploaded => '12345'
           downloaded => '12345'
           left => '12345'
           event => 'started', 'completed' -or- 'stopped'
           }


Tracker response Key
  • failure reason : error string (no other keys)
  • interval : client가 tracker에게 요청하는 시간 간격
  • complete : seeder의 수
  • incomplete : leecher의 수
  • peers
    • peer id
    • ip
    • port
  • example
    * Tracker responses are bencoded dictionaries.
    resp = {
           failure reason => 'error text'
                      - or -
           interval => 12345
           peers => {
               peer id => 'identifier'
              ip => 'ip-address' -or- 'hostname'
               port => 12345
           }
      }


Peer Wire protocol (TCP)
  • Handshake
  • handshake:<pstrlen><pstr><reserved><info_hash><peer_id>
  • pstrlen : <pstr>의 문자열 크기
  • pstr : protocol
  • reserved : 8 reserved bytes (현재는 모두 0)
  • info_hash : Metainfo File의 info key의 SHA1 hash값 (20byte)
  • peer_id : tracker에 등록(?)한 client의 unique ID (20byte string)
  • Message
  • From : <length prefix><message ID><payload>
  • keep-alive:<len=0000>
  • choke:<len=0001><id=0>
  • unchoke:<len=0001><id=1>
  • interested:<len=0001><id=2>
  • not interested:<len=0001><id=3>
  • have:<len=0005><id=4><piece index>
  • bitfield:<len=0001+X><id=5><bitfield>
  • request:<len=0013><id=6><index><begin><length>
  • piece:<len=0009+X><id=7><index><begin><block>
  • cancel:<len=0013><id=8><index><begin><length>
  • port:<len=0003><id=9><listen-port>

    • Reference
      http://wiki.theory.org/BitTorrentSpecification
      http://www.bittorrent.com/protocol.html
      http://dessent.net/btfaq/
      http://computer.howstuffworks.com/bittorrent.htm
      http://lists.ibiblio.org/pipermail/bittorrent/

      이 글과 관련있는 글을 자동검색한 결과입니다 [?]

      by soyokaze | 2007/01/09 23:10 | div 2 dev | 트랙백 | 덧글(2)
      트랙백 주소 : http://soyokaze.egloos.com/tb/1487432
      ☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
      Commented by Robert at 2007/04/06 01:28
      nice
      Commented by Naomi at 2007/04/06 01:54
      hello

      :         :

      :

      비공개 덧글

      << 이전 페이지 다음 페이지 >>