View Profile
 

programming, design and blahblah

20050520

d-Torrent Hub Simulator

For a torrent website that can't be shut down, I propose the d-Torrent Hub concept. [download simulator here]

News came in one morning early this week that btefnet got shut down along with a few other torrent sites. Dependency on a central server cripples bittorrent distribution with a single point of failure. People out there have been aware of the problem for some time, and trackerless bittorrent files were born. But that only got us halfway out of the problem. There is still the question of distributing the torrent file itself.

Trackerless torents allows us to download a file and find new seeders for the file without a tracker. But we still needed to get the .torrent (or the magnet url) from a web/ftp/nntp server in the first place. When the web server is taken offline, like in btefnet's case, people are left scrambling to find/seed torrents elsewhere.

Distributed tracking makes every bittorrent client a tracker, the concept of d-Torrent Hub makes every client a part of a distributed torrent file directory. So instead of hosting the .torrent files on a web site, they are hosted by every bittorrent client that is connected to the "channel" in a distributed manner. It is a true peer-to-peer-only form of publishing and circulating media by bittorrent. All basic distributed system techniques apply, the Hub also employs a failover technique that keeps all nodes in the same channel linked in one connected tree (since there's no server, you depend on your peers to stay connected with the rest of the network, measures have to be taken when the peers you're connected to go offline for any reason).

The simulator: I'm not good with words so I wrote the simulator to demonstrate how the d-Torrent Hub concept could work. Each dot is a bittorrent client, each bright orange line illustrate an active connection from a child node to a parent node, and each dark gray line (backup connections) signifies knowledge of existence of the neighbour node (but not connected). For a node to communicate with another, the target's network address is required. Every new node joins the channel/tree/network by connecting to an existing node in the channel by its network address. In real life, joining of a channel could be invitation-based (it worked for gmail, so it sure can work here). Every node in the channel contains all or part of the torrents (or magnet URLs) in circulation, and collectively they consititute the entire listing. This method of hosting torrent files is redundant and eliminates the single point of failure. So theoretically the "download page" can't be shut down.



Testing the concept: the simulator allows you to control the environment and the behaviour of the nodes. I would suggest that you start with the default settings. Launch the simulation and right-click on certain nodes. Select "Upload" and enter a filename to simulate someone seeding a new file (repeat several times on different nodes). The objective for d-Hub now is to get everyone to know about the files that have been seeded. When you left-click on a node, it shows you what that client would see when it opens the torrent listing (filenames hilighted on the bottom left). Ultimately, a node should see all the files seeded by the nodes on the same network. The simulator helps you identify the nodes that got the entire listing by turning them green. Next thing you'd want to try is to add new nodes to the channel. Do that by toggling the "Spawn Mode" button on and clicking randomly on the board. A newly added node opens an active connection with a single node on the network, and it starts with an empty repertoire of torrent listings and network addresses of other nodes. I'd suggest you add several nodes and wait a bit to see how they evolve. When there are enough new nodes on the board, seed a new file on one end of the network and quickly use the "Kill Mode" to eliminate all of the original nodes (to simulate the case of clients being closed or shut down by the FBI :), then wait to see whether or not the new file still gets propagated to the entire channel. If the algorithm worked, all the torrents files would be listed on ALL the nodes and every one of them would turn green, and we'd get our "unkillable" download page.

New: there is now a setting for auto-spawn and auto-kill mode. They help simulate people joining and leaving the network. Now all you need to do to test the d-Hub is to seed files from different nodes and wait to see whether or not all nodes eventually become green.