Welcome to DistribuStream!

DistribuStream is a fully open peercasting system which allows on-demand or live streaming media to be delivered at a fraction of the normal cost.

This README covers the initial public release, known issues, and a general development roadmap.

Contents:

  1. Usage

  2. Known Issues

  3. Development Roadmap

Usage:

The DistribuStream gem includes three config files that can be located in the conf directory of the gem:

example.yml - A standard example file, configuring for 5kB chunks debug.yml - Same as example.yml, but configured for additional debug info bigchunk.yml - An example config file, using 250kB chunks

Chunk size controls how large the segments which are exchanged between peers are. Larger chunk sizes reduce the amount of control traffic the server sends, but increase the probability of errors.

To begin, copy one of these config file and edit it to your choosing. Be sure to set the host address to bind to and optionally the vhost you wish to identify as.

Next, start the DistribuStream server:

dstream –conf myconfig.yml

The DistribuStream server manages traffic on the peer network. It also handles the checksumming of files.

You can see what’s going on through the web interface, which runs one port above the port you configured the server to listen on. If the server is listening on the default port of 6086, you can reach the web interface at:

myserver.url:6087/

To populate the server with files, you need to attach the DistribuStream seed. This works off of the same config file as the server, and must be run on the same system:

dsseed –conf myconfig.yml

At this point your server is ready to go.

To test your server, use the DistribuStream client:

dsclient pdtp://myserver.url/file.ext

This will download file.ext from your DistribuStream server.

The client also supports non-seekable output such as pipes. To play streaming media as it downloads, you can:

dsclient -o pdtp://myserver.url/file.ext | mediaplayer -

Known Issues:

Seeds are presently not authenticated in any way, thus anyone can attach a seed and populate the server with any files of their choosing. However, since file checksumming is done by the server itself, this means that only seeds running on the same system as the server will actually work.

This will be resolved by either incorporating the seed directly into the DistribuStream server, or adding both authentication and commands for checksumming to the server <-> seed protocol.

Development Roadmap:

DistribuStream uses an assemblage of various tools which do not work together particularly well. These include the EventMachine Ruby gem, which provides the I/O layer for the DistribuStream server, and the Mongrel web server, which runs independently of EventMachine and uses threads.

Initial work will focus on converting the existing implementation to a fully EventMachine-based approach which eliminates the use of threads.

Mid-term work will focus on improving the efficiency of peer-to-peer traffic routing, by incorporating all of the following constraints:

  1. Does the potential “giver” peer have chunks the “taker” peer is requesting?

  2. Are the peers in the same prefix? (at least the same /16, if not the same /24)

  3. Are the peers firewalled? (the server could do a connect test as soon as a client registers their listen port)

  4. What is the trust between peers? (the “random” connecting of untrusted peers could be replaced by something that operates on the above two bits of data)

  5. Does the “giver” have enough bandwidth? (modeled over time)

  6. Are total inbound and outbound links minimized? (to improve TCP congestion)

Long-term goals include a move to UDP to reduce protocol latency and overhead as well as encrypting all traffic to ensure privacy and security of the data being transmitted.