initdata
d{i}
: Initial data for peeri
populate.py
: Utility script to add a file and keyword to a directory
src
Main
: Entrypoint to programConstants
: Contains port number configurationsFileDirectory
: Processes contents of data directory to generate list of available files and keywordstasks
: Background tasks running on each nodeNode
: Interface to entire peer network, including join/leave, discovery, and file transfersPeerDiscoveryTransceiver
: Task for transmitting and receiving data to/from a particular neighborTrackerServer
: Server for tracking all nodes in networkListenerTask
: Base class for servers
messages
: Message formatsMessage
: Base class for messages, with utility methods for serializing byte arraysHangupMessage
: Represents hangup messages (for disconnecting from neighbors)DiscoveryMessage
: Base class containing common data to all discovery messagesDiscoveryQueryMessage
: Represents discovery query messagesDiscoveryReplyMessage
: Represents discovery reply messages
Compile the Java source files into class files:
./compile.sh
Start a tracker server on any host (note the hostname down) with:
./tracker.sh
For each integer i
from 1 to 15, pick a unique host and start peer i
with:
./node.sh {trackerhostname} {i}
*curly braces {} indicates substitution with the appropriate variable
*the tracker server can run on the same host as a peer, for example peer 1
Each peer will log the following items:
- CONNECT TO : Peer is sending a connection request to specified hostname
- CONNECT FROM : Peer is receiving a connection request from specified hostname
- NEIGHBORS : Peer currently connected to the following hostnames (logged on connection request sent/received)
- SEND <details...>: Sending a message
- RECV <details...>: Receiving a message