僕の備忘録(PC、UN*X、ネットワーク関連が中心)なんです。
自分の書いたところは適当(な時とか)に書き換えますので御了承を。
BittoradeのREADMEにWebサーバとの連携が書いてあった。
httpd.conf に
AddType application/x-bittorrent .torrent と書き添えてapacheを
再起動してみた。
torrentをリンクしたwebページ (LAN内でのみ見える) も作ってみた。
本家ページからWinやMacOSXのクライアントを貰って試す。 .torrentファイルの生成もGUIでできるようになっていた。
あとは、普段ログインしていない鯖でオリジンダウンローダを
起動しっ放しにする方法を確認しなければ。
それから、LANの外へのアップロードもやってみるべし。
仕様書の和訳(Thanks!)をちょっと。
"オリジンダウンローダ"をあらかじめ起動する必要があったようだ。
オリジンのダウンロード(必要か?)が終った途端、
待ち構えていた他のホストが、ダウンロードをすぐ始めた。
LANのホスト(FreeBSD-5.4,Tiger,Woody,Plamo4)いくつかでダウンローダを起動してみる。
全部sshでリモートログインしているせいか、
それともseedが一つしかないせいかどうか、
ともかくさほど速い感じがしない。
----------------------------------------------------------- | file: myfile | | size: 664,403,968 (634 MiB) | | dest: /origin/myfile | | progress: _______________________________________________ | | status: download succeeded! | | dl speed: --- | | ul speed: 163.3 KB/s | | sharing: oo (211.9 MB up / 0.0 MB down) | | seeds: 0 seen recently, plus 0.331 distributed copies | | peers: 3 seen now, 33.1% done at 470.5 kB/s | -----------------------------------------------------------
あと、ダウンローダをうんと後から割り込ませてみたが、 他に追い付くまでは勢いよくダウンロードしていた。
------------------------------------------------------ | file: myfile | | size: 664,403,968 (634 MiB) | | dest: /path/myfile | | progress: #######___________________________________ | | status: finishing in 0:04:36 (12.2%) | | dl speed: 2092.3 KB/s | | ul speed: 104.2 KB/s | | sharing: 0.057 (4.4 MB up / 77.5 MB down) | | seeds: 1 seen now, plus 0.708 distributed copies | | peers: 3 seen now, 51.8% done at 740.2 kB/s | ------------------------------------------------------
他のダウンローダも懸命にアップロードしている。
------------------------------------------------------ | file: myfile | | size: 664,403,968 (634 MiB) | | dest: /path/myfile | | progress: ###############################___________ | | status: finishing in 0:19:14 (71.5%) | | dl speed: 153.1 KB/s | | ul speed: 1156.0 KB/s | | sharing: 1.751 (792.7 MB up / 452.8 MB down) | | seeds: 1 seen now, plus 0.714 distributed copies | | peers: 3 seen now, 35.0% done at 1007.8 kB/s | ------------------------------------------------------
適当な.torrentをとって、接続開始をEterealでキャプチャしてみた。
名前解決が済んで、目的のIPと3ハンドシェーク。
の後 PSH と ACK の立ったパケットを送信。
これには GET /announce?info_hash=%hoge%hoge...が含まれている
相手側からACKが返り、ついで PSH と ACK に HTTP/1.0 200 OK...
な返信。
その後 FIN と ACK を交わして、くだんのIPとの通信は途切れた。
コネクションが切れるのを待たず、新たに 8つものIPに向けて一斉に
TCPコネクションを張っていた。それらと Bittorrent のハンドシェークを始め、
しかるのちにアップダウン、さらにその間にゲットした別のIPとも同じく...なのか?
proftpd-1.3.0-rc2を入れた。
/etc/ftpuser に気に染まないのを目一杯入れておく(anonymousもとりあえず禁止)。
standalone で動作確認して、すぐ閉めた。
ついでにカーネルを2.6.12.5 に上げた。
$ ./btdownloadcurses.py myfile.torrent ----------------------------------------------------- | file: myfile | | size: 664,403,968 (634 MiB) | | dest: /path/myfile | | progress: _________________________________________ | | status: connecting to peers (0.0%) | | dl speed: 0.0 KB/s | | ul speed: 0.0 KB/s | | sharing: 0.000 (0.0 MB up / 0.0 MB down) | | seeds: 0 seen now, plus 0.000 distributed copies | | peers: 0 seen now, 0.0% done at 0.0 kB/s | -----------------------------------------------------
myfile はいくら待っても0KBのまんま。
$ btmakemetafile.py http://torrent.kuzuore.com:$port_num/announce \ myfile 16.8% complete (ry $ ls -a myfile myfile.torrent
TRACKER:$ ./bttrack.py --port 6969 --dfile dstate TRACKER:$ nmap localhost Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at \ 2005-08-23 01:34 JST Interesting ports on localhost (127.0.0.1): (The XXXX ports scanned but not shown below are in state: closed) PORT STATE SERVICE (ry 6969/tcp open acmsoda
自分の持つドメインに、ホスト名をひとつ追加しておいた。
リンクはご自由にどうぞ。でもURLや内容が変った場合はあしからず。