LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


Distributing Content with BitTorrent
Pages: 1, 2, 3

Using Other People's Trackers

Yes, that's right, you can jump onto other people's trackers instead of relying on one of your own! You can share your documents without having either a web server or a tracker. Suppose I want to use the postgresql.org tracker: all I need to do is download one of their latest postgresql torrents and read the first couple of lines to identify the tracker URL:



$ wget http://bt.postgresql.org/postgresql-8.0.1.zip.torrent
$ cat bt.postgresql.org:6969 | less

In this case, the URL turns out to be http//bt.postgresql.org:6969/announce. I can reannounce the tracker of my existing torrent by using the torrent utility btreannounce (btreannounce.py).

Here's the general format:

btreannounce url torrent [ torrent ... ]

I can choose this tracker for my torrent with:

$ btreannounce http://bt.postgresql.org:6969/announce \
	pg_live.1.3.3-SRAA.iso.torrent

The postgresql.org tracker will now manage all subsequent connections to the pg_live ISO. You can review the tracker's statistics by using your browser and going to http://bt.postrgresql.org:6969. (Some sites list only the md5 checksum without naming the file, but you can compare it with the checksum generated by your own tracker).

It's good etiquette to request permission for using other people's trackers. You can prevent other people from using your tracker--as postgresql.org does, by the way--by telling bttrack to track only those torrents of which it has copies in a user-defined directory. For example, if I place a copy of the pg_live torrent file in a directory where bttrack can see it, it will limit the tracker to file sharing for just pg_live. That's the purpose of the --show_names and --allowed_dir switches:

$ bttrack --port 8099 --show_names 1 --allowed_dir ~/mytorrents \
	--dfile downloadinfo.txt

Another advantage of using this particular invocation is the detailed report that the tracker supplies.

  • tracker version: 3.4.2
  • server time: 2005-03-29 14:36 UTC
info hash torrent name size complete down-
loading
down-
loaded
trans-
ferred
4e98ea442573f5b88685
37e970fd3ce6321e9e81
pg_live.1.3.3-SRAA.iso 382MiB 2 0 0 0B
  1 files 382MiB 1/2 0/0 0/0 0B
  • Info hash: SHA1 hash of the "info" section of the meta info (*.torrent)
  • Complete: number of connected clients with the complete file (total: unique IPs/total connections)
  • Downloading: number of connected clients still downloading (total: unique IPs/total connections)
  • Downloaded: reported complete downloads (total: current/all)
  • Transferred: torrent size * total downloaded (does not include partial transfers)

Conclusion

I always seem to be ending articles when I say this, but ... I've only just scratched the surface of what you can do. I guess you'll just have to play with it to learn more. I recommend reading the man pages for apt-get, wget, cat, btmakemetafile, bttrack, bittorrent-downloader, and btreannounce.

Have fun.

Robert Bernier is the PostgreSQL business intelligence analyst for SRA America, a subsidiary of Software Research America (SRA).


Return to the Linux DevCenter.


Linux Online Certification

Linux/Unix System Administration Certificate Series
Linux/Unix System Administration Certificate Series — This course series targets both beginning and intermediate Linux/Unix users who want to acquire advanced system administration skills, and to back those skills up with a Certificate from the University of Illinois Office of Continuing Education.

Enroll today!


Linux Resources
  • Linux Online
  • The Linux FAQ
  • linux.java.net
  • Linux Kernel Archives
  • Kernel Traffic
  • DistroWatch.com


  • Sponsored by: