HK241 Assignment 1 Network Application P2P File Sharing
HK241 Assignment 1 Network Application P2P File Sharing
Build a Simple Torrent-like Application (STA) with the protocols defined by each group, using
the TCP/IP protocol stack and must support multi-direction data transfering (MDDT).
APPLICATION DESCRIPTION
Application overview
• The application includes the two types of hosts: tracker and node.
• A centralized tracker keeps track of multiple nodes and stores what pieces of files.
• Through tracker protocol, a node informs the server as to what files are contained in its local
repository but does not actually transmit file data to the server.
• When a node requires a file that does not belong to its repository, a request is sent to the
tracker.
• MDDT: The client can download multiple files from multiple source nodes at once,
simultaneously.
This requires the node code to be a multithreaded implementation.
PEER- Downloading
After you get the list of peers from the Tracker, you now must connect to as many of them as you
can and start downloading from them.
o It is mandatory to support MDDT.
o Your algorithm for choosing which blocks to request from which peer is completely
up to you, with the minimum requirements that you don’t send a request for a piece
the peer does not have, and you don’t send a request for a piece you already have.
For advanced development:
To maximally utilize network bandwidth, you want to have a request queue, which keeps a list of
all blocks you have sent a request message to the peer for.
Since you will have multiple peers for the same torrent, you will need some way to keep current
status progress of which blocks have been requested to all the peers, so you don’t send requests
for the same block to multiple peers and it supports recovery from disconnect on-going file
transfer.
PEER- Uploading
It wouldn't be possible to download files with your client without seeders. Therefore, your
application has to begin seeding the file to other peers who are also interested in downloading it
after you download it.
For advanced development:
The "tit-for-tat" theory underlies peer-to-peer file sharing, implying that the more you share, the
more files will be shared with you. This project is a chance to apply your learned theory.
The currently deployed peer selecting algorithm prevents free-riders by only changing peer
selecting decisions once every ten seconds.
User Interface
This part of the assignment allows for a large room for creativity: you can utilize and implement
any style of client you want, as long as it satisfies the minimum requirements of downloading and
seeding a single torrent to multiple peers, and provides us ability to see all the upload/download
statistics.
In general, http://www.transmissionbt.com/has a complete description. You can support some
fundamental parameters and options of the transmission-client command lines. We keep an in-
depth description for your comprehensive reference in future research if needed.
● transmission-cli - a bittorrent clienthttps://linux.die.net/man/1/transmission-cli
o E.g: transmission-cli <<torrent-file>>
● transmission-create: https://linux.die.net/man/1/transmission-create
● transmission-daemon: https://linux.die.net/man/1/transmission-daemon
● transmission-edit: https://linux.die.net/man/1/transmission-edit
● transmission-remote: https://linux.die.net/man/1/transmission-remote
● transmission-show: https://linux.die.net/man/1/transmission-show
You could even develop a GUI if you have a lot of extra time. Although you probably won't get
extra credit for this, you might earn some Github stars instead.
Extra credit:
You may choose to implement any or all of the following items (or something event not in this list
but it is relevant to bittorrent and networking)
Distributed hash table (DHT): transmit your torrent file without the centralized tracker. Typically,
this is a better source to find more peers here than by using the torrent’s centralized tracker.
Simultaneous torrents: require your client show how to download and upload several torrents
simultaneously (at the same time), as well as access the statistics through your user interface.
Tracker scrape: https://en.wikipedia.org/wiki/Tracker_scrape is the exchange to obtain the
metainfo on behalf of the client. It should be mentioned that a peer's involvement in a data
transmission is unaffected by scrape exchanges.
Download/Seeding strategies: a simple download strategy is required for your client, but if you
choose to apply something fancier (like Super Seeding, Rarest-First, End Game), you need to
document it and provide supplemental materials.
Optimizing peer selection: a simple peer selection strategy is required for your client, meaning
you can just response to all your peers. If you want to use the wiki's actual standards (of only 4+1
peers at a time), please make sure you document it
Grading
The main requirements for this assignment are:
● Download a multi-file torrent from multiple peers concurrently
● Upload a multi-file torrent to multiple peers concurrently
● Show useful statistics of download/upload statistics, that allow us to inspect peer
information, currently used torrents.
You grade breakdown will be as follows:
Tracker Protocol - 15% successfully parse the metainfo, send a request to the tracker, obtain its
response with the list of corresponding peers, and parse the list of peers into useful ’ip’ and ’port’
pairs.
Torrent Download - 30% establish connection to several peers, download the torrent from all of
them simultaneously, and appropriately use the mapping to determine which blocks to request.
You must not send requests for pieces you have stored on disk and you must handle multi-file
downloads correctly.
Torrent Upload - 15% allow several peers to connect to you so that you can serve multiple
request streams simultaneously.
Multiple host deployment - 20% this course is the network connect among computer hosts,
therefore the deployment of demo with more than 3-4 host is mandatory (virtual machine
technique is ready for implementing this requirement)
MDDT feature - 10%
Advance features - 10%
WORKING PLAN
● Work in a team.
● Each group has 2-3 or up to 4 members.
RESULTS
Phase 1 (softcopy):
● Submit the report file of the first phase to BKeL in the predefined section as announced
on BKeL.
● File format (pdf): ASS1_P1_<<Group_Name>>.pdf
E
EVALUATION
Assignment 1 is worth 15% of the course grade.