Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
A BitTorrent-like application. Contains client and tracker implementations.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
- A BitTorrent-like peer-to-peer application
- Provides "client" and "tracker" implementations. The tracker mediates the exchange of file "chunks" by clients. "Torrents" associate file information with files on the tracker and client.
Describe "Torrent" format. A torrent corresponds to exactly one data file, and contains information about that file:
- the file's size
- the hashes of the file's chunks
- which trackers associate the file with this torrent
Tracker is a cluster of nodes, replicated with Paxos. Tracker maintains a record of clients (identified by host:port) that claim to have chunks for torrents.
Clients maintain a record of which files exist of a local file system, and which torrents correspond to these files. It can exchange chunks of these file with other clients.
- Trackers use Paxos for replication. Paxos implementation is resiliant to failures in which a node crashes as well as failures in which a node stalleds indefinitely before resuming.
- Trackers keep logs of committed operations in order to bring previously stalled nodes back up to speed.
- Torrents are identified by the hash of the associated data file, to make name collisions almost impossible. In the event of a name collision, a tracker will not allow a torrent to be created.
- Torrents contain information about the hashes of chunks of associated data files. Clients check these hashes to ensure chunk integrity.
- Client A has a file
- Client A CREATEs a torrent
- Client A REGISTERs
music.torrent with a tracker cluster. If it is successful, the tracker cluster will never associate other data file chunk hashes with this name.
- Client A OFFERs
music.mp3, which informs the tracker that is has
music.torrent and is ready to serve chunks.
- Client B finds
music.torrent through conventional means.
- Client B DOWNLOADs
music.mp3 by contacting the trackers listed in
music.torrent, getting a list of clients which contain
music.mp3 (possibly including Client A), and fetching chunks of
Progress Since Grading Meeting:
test/end_to_end/multi_client_real_tracker_test.sh: 9 clients serve chunks of a data file to 1 client. A 3-node tracker cluster mediates.
test/end_to_end/multi_client_real_tracker_malicious_clients_test.sh: 4 honest clients and 5 malicious client serve chunks of a data file to 1 client. A 3-node tracker cluster mediates. The malicious nodes serve chunks with invalid hashes, and the received client must reject these chunks.
test/end_to_end/multi_client_real_tracker_fail_stop_test.sh: 9 clients serve chunks of a data file to 1 client. A 3-node tracker cluster mediates. One of the tracker nodes fails while the 9 nodes are informing the tracker cluster that they have chunks of the data file. This node does not recover.
test/end_to_end/multi_client_real_tracker_fail_stall_test.sh: 9 clients serve chunks of a data file to 1 client. A 3-node tracker cluster mediates. One of the tracker nodes goes offline while the 9 nodes are informing the tracker cluster that they have chunks of the data file. This node recovers after 5 seconds and is reintegrated into the cluster.
test/trackertest/trackertest.sh: Runs 11 tests to check that the paxos implementation works correctly. Tests include: a single tracker sending many messages to the cluster; dualing leaders; shutdown nodes for fail-stop testing; pause and resume a node.
- Updated the testClosed and testClosedTwo functions in tests/trackertester/trackertester.go. The tracker now passes every time.