P2R2 Implementation Sections I. Setup II. Configuration III. Execution ############################################################################### I. Setup Once you've gotten this code, you will need the following components: ant 1.7.1 or later java 1.6 or later Also, only unix-based (mac os included) systems are supported for the server side due to the use of shell scripts. Once you've installed those, make sure you also set the following environment variables: JAVA_HOME - pointing to your java folder, such that $JAVA_HOME/bin/javac is found ANT_HOME - such that $ANT_HOME/bin/ant resolves to the ant build system Once these two have been set, you can execute the following ant projects - all (this is the default project) this project will build the project and upload the needed files to the aeolus framework (such as p2r2.jar and config files) - local builds the project, does not perform upload - usage prints help on the available projects Ant uses the following (default) folders for its output (which can be configured in the build.properties file) - build this is a scratch folder that will contain temporary state information - dist contains the generated p2r2.jar You don't need to update any of the values provided in build.properties, the defaults will work fine as long as you have set up properly ant and java. ############################################################################### II. Configuration The p2r2 implementation program can be configured via the configs/app.properties, the following are the recommended values to update: CLIENT SIDE PROPERTIES - query.wait.time: specifies how long (milliseconds) a peer will wait for a query to be discarded. - query.concurrence: specifies how many concurrent queries can a peer send - query.ttl: specifies query time to live (hops) - zipf.alpha: clients will generate a frequency table based on a zipf distribution. the alpha value of that distrbution is configured through this value - peer.sleepbeforefirst.min/max: specifies the time (milliseconds) before a peer will wait before send its first query, this is in order to allow for set-up time - peer.capacity.min/max: specifies the storage capacity of a peer, which will be a value in the [min, max] interval - update.step: peers generate messages to the server. this parameter configures how often (measured by sent queries) they send update information ITEM DOWNLOAD SIMULATION PROPERTIES - item.download.bitrate: bitrate at which files are downloaded (this is to simulate item download) - item.search.time.min/max: time to wait before starting a download of a file actual time will be in the [min, max] - item.find.probability: after search time has elapsed, items have a probability of finding a file SERVER SIDE PROPERTIES - topology.size: number of nodes in the network - topology.edge.probability: specifies the probability of an edge to exist between two nodes - item.total: specifies the total number of items that exist in the network - item.maxsize and item.minsize: specify the minimum and maximum size that an item will have. the value for each item will be [item.minsize, item.maxsize] - report.output.folder: path where csv reports are written - graphml.output.folder: path where topology files will be saved Two additional configuration files exist, and it is highly recommended not to modify them. They are configs/peer-services.txt and configs/server-services.txt. They specify the services (jxta applications) that clients/servers will execute. ############################################################################### III. Execution Once everything has been set-up and configured, there are two scripts to be used in order to start the application on the server side (client-side is managed by aeolus). - generate-instances.sh generates clients / server instances on a local machine, accepts the following command line parameters + - how many clients will be run on the machine where this script is invoked + - network port to use. if clients are also run, each instance will have its own port. say you want to run 20 clients and a server on a machine, and you specify 9700 as a vlue for this parameter, this will generate clients using ports 9700, 9701, ... 9719 and a server on port 9720 + - name to be preppended to the ip address of the local computer, this is used to identify peers + - specifies whether a server will be started or not - stop-instances.sh does not take any parameters. it stops the instances run on the local machine A typical run of the implementation would be: your-shell$ ant your-shell$ ./generate-instances 0 9700 my-computer true This will: 1) build the project and upload the needed files to the aeolus framework 2) generate a server using the "my-computer" id on port 9700 The aeolus-instances/server and aeolus-instances/node_N contain the stdout.log and stderr.log files that can be tailed in order to analyze problems. On the server side a UI interface will be displayed, showing charts and a control console.