Posts Tagged ‘bittorrent’

Using Opentracker – a free, small, fast and powerful tool

Sunday, February 22nd, 2009

What is a tracker in this context? In order to expain that, i need to explain the bittorrent protocoll a little.

Bittorrent as a great and fully legal concept to exchange data. The bad things you hear in the media are cases where people used this concept to exchange data which has copyright on itself.

The principle is quite easy. You install a bittorrent client, download a small file which contains all the necessary data (ending normally .torrent), tell your client to process that information and it will start to transfer files with other people who want or have that file. So if you made your own movie and want to share it, but are short on bandwidth and/or transferlimit you could make a torrent and in the best case have to share the movie once. Then after taking it down, other peers (people who take part in the sharing) will exchange the parts they have and need. So with higher distribution of your file, new leechers (people who download stuff) will face higher availibilty and probably more downspeed.

But how do peers know which others peers have and offer parts? Thats where the tracker joins the game. The tracker is a central point of communcation (its adress is located in the .torrent file, mentioned above) where all clients connect to (via http) and receive information about other clients. There are some so called “open trackers” that allow everybody to announce their files but this article is about the software “opentracker” which allows you to run your own tracker.

In order to get your own tracker you need to download, configure, compile and run the software. All ressources and steps can be found here: opentracker homepage. In short: check out from cvs, edit the Makefile to enable/disable features (for example whitelisting), make, run. You need the libowfat library in order to build opentracker.

Now to run your tracker you need to call the binary. Along can be passed some arguments, that will change its behavior. To tell the tracker to listen on the port 4321 (instead of 6969 by default) and use whitelist.txt as whitelist run:

./opentracker -p 4321 -P 4321 -w whitelist.txt

The file “whitelist.txt” contains the hash of each torrent you want to allow, seperated by a newline.

If you are running your tracker behind a router of firewall, be sure to forward/allow the port you have your tracker listening to.

Opentracker also supports some stats. The URL for stats is

http://trackerdomain:port/stats?mode=

followed by the mode you want to know. It could be: peer, conn, scrp, udp4, busy, torr, fscr, herr, top10, renew, syncs, version, startstop, toraddrem.

This information is taken from ot_http.c at about line 160, look for “static ssize_t http_handle_stats(“. If you want to restrict access to your stats, remove the comment (#) in the Makefile in front of “FEATURES+=-DWANT_RESTRICT_STATS”. Opentracker also supports mrtg for visualisation of statistic data.

To quit opentracker, just kill it (ctrl+c or kill -9 <pid>).

Too bad there is only little to no documentation about this great piece of software. But its so efficient with ressources that even The Pirate Bay uses it for their trackers, and they are the “worlds biggest tracker”.