BitFountain

BitFountain is a peer-to-peer file distribution system built on BitTorrent that replaces its piece-by-piece download model with Digital Fountain erasure codes.

The problem with BitTorrent’s piece model Link to heading

BitTorrent splits a file into numbered pieces and tracks which specific pieces each peer has and needs. This works well but creates a well-known bottleneck: as a download nears completion, the last few pieces become scarce, and the final stretch slows to a crawl.

Think of it like going to a bank and asking for specific banknotes by serial number — tedious, slow, and unnecessarily rigid. What if any banknote of the right denomination would do?

How erasure codes change the picture Link to heading

Raptor erasure codes let BitFountain generate an effectively unlimited stream of encoded blocks from the original file. Any sufficiently large subset of those blocks — regardless of which ones — can reconstruct the original data.

Each peer in the network both encodes and decodes blocks, so there is no “last missing piece.” Blocks are interchangeable, the swarm never gets stuck waiting for a specific chunk, and the system degrades gracefully under packet loss (using UDP instead of TCP) and peer churn.

Results Link to heading

The main benefit shows up at scale. When the peer-to-peer network exceeds 100 nodes, BitFountain achieves a measurably smaller average download completion time than standard BitTorrent:

Background Link to heading

BitFountain was presented as my M.Sc. thesis in December 2008. I then continued the research at the Network Research Lab at UCLA, which led to a published technical paper.

Source code is available in the BitFountain repository on GitHub.