您的位置:首页 > 其它

BT protocl 集中式与分布式应用实例分析

2011-09-09 16:16 169 查看
 
1、集中方式

GET /announce?info_hash=%0cn%ba%3d%c7%d4u%bb%82%d4%28%b6%00_%be~F%cebr&peer_id=-UT2210-%d6b%b90l%14%e1%0d%ee%db%5e%2f&port=24573&uploaded=0&downloaded=0&left=8712977&corrupt=0&key=9A34E9B9&event=started&numwant=200&compact=1&no_peer_id=1&ipv6=3333%3a%3a1%3abd23%3aca90%3a9989%3a4826
HTTP/1.1

Host: 58.251.159.101:8080

User-Agent: uTorrent/2210(25302)

Accept-Encoding: gzip

Connection: Close

HTTP/1.1 200 OK

Connection: close

Content-Length: 90

d8:intervali435e5:peers18::..c_.:..e..:..c`.17:tracker_alias_urll20:udp://:8080/announceee

0070  64 38 3a 69 6e 74 65 72  76 61 6c 69 34 36 35 65   d8:inter vali465e

0080  35 3a 70 65 65 72 73 31  38 3a 3a fb 9f 63 5f fd   5:peers1 8::..c_.

0090  3a fb 9f 65 82 91 3a fb  9f 63 60 01 31 37 3a 74   :..e..:. .c`.17:t

00a0  72 61 63 6b 65 72 5f 61  6c 69 61 73 5f 75 72 6c   racker_a lias_url

00b0  6c 32 30 3a 75 64 70 3a  2f 2f 3a 38 30 38 30 2f   l20:udp: //:8080/

00c0  61 6e 6e 6f 75 6e 63 65  65 65                     announce ee 

Peer信息如下:

3a fb 9f 63 5f fd

58 251 159 99 24573

3a fb 9f 65 82 91

58 251 159 130 33425

 

3a fb  9f 63 60 01

58 251 159 99 24577

2、分布式

p1-p2 ping p1id

p2-p1  R p2id

p1-p2 findnodes p2id

p2-p1  R p2id nodes(离p2最近的节点值)

p1-nodes get_peers infohash

nodes-p1  R p2id nodes(离p2最近的节点值) 或Values(peers信息)

p1和peer连接下载文件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  分布式应用 bt c url