-
Notifications
You must be signed in to change notification settings - Fork 0
Reproduce MSocket Overhead Numbers
To get started, clone the git repository using the following command.
git clone https://github.com/zaf6862/msocket.git
Change directory to the repo.
cd msocket
Checkout the overheadnumbers branch.
git checkout overheadnumbers
If you want to change the chunk size, navigate to the file MWrappedOutputStream.java and change it at line number 49. Following is a github link to this line.
After setting your desired chunk size, compile the msocket code.
ant jar
At this point you would need to have two separate terminals open, one for running the server code and the other for client code.
For running the server follow this set of instructions:
- change directory to overhead_scripts.
cd overhead_scripts - Compile the server code.
javac -cp ../jars/msocket-1.0.0.jar:. MSocketServer.java - Run the server code.
By default the server will run on (localhost:7777) but you can specify the IP and port by providing them as command line arguments as such
java -cp ../jars/msocket-1.0.0.jar:. MSocketServerjava -cp ../jars/msocket-1.0.0.jar:. MSocketServer 172.10.128.1 7171
Now to run the client code, switch to the second terminal and do the following set of steps (assuming you are at the root folder of the repository).
- change directory to overhead_scripts.
cd overhead_scripts - Compile the client code.
javac -cp ../jars/msocket-1.0.0.jar:. MSocketClient.java - Run the client code. The first argument to MSocketClient code is the IP of the server, second is the port number, third is indicator value that tells the script whether the flow size specified by the user is in "KB" or "MB", fourth argument is the actual flow size, fifth argument is number of rounds. A sample command to run the client that fetches 1 MB from the server for 5 rounds is as follows.
java -cp ../jars/msocket-1.0.0.jar:. MSocketClient localhost 7777 1 1 5
At this point your client will output the total time from sending the request to receiving the corresponding number of bytes. You can save this output to a file and later process it (See the last section for how to save the log file).
To get the transfer times for TCP, again have two terminals open, one for the server and one for the client.
To run the server follow this set of instructions.
- change directory to overhead_scripts.
cd overhead_scripts - Compile the server code.
javac TCPServer.java - Run the server code.
java TCPServer
By default the server will run on (localhost:7778) but you can specify the IP and port by providing them as command line arguments as such
java TCPServer 172.10.128.1 7272
Now to run the client code, switch to the second terminal and do the following set of steps (assuming you are the root folder of the repository).
- change directory to overhead_scripts.
cd overhead_scripts - Compile the client code.
javac TCPClient.java - Run the client code. The first argument to TCPClient code is the IP of the server, second is the port number, third is indicator value that tells the script whether the flow size specified by the user is in "KB" or "MB", fourth argument is the actual flow size, fifth argument is number of rounds. A sample command to run the client that fetches 1 MB from the server for 5 rounds is as follows.
java TCPClient localhost 7778 1 1 5
At this point your client will output the total time from sending the request to receiving the corresponding number of bytes. You can save this output to a file and later process it (See the last section for how to save the log file).
There is a helpful script in this folder by the name of "plot_overhead.py". You can use it to plot the median transfer time ratio or difference. It however needs the log files named in a specific format. So when you are running the client code for MSocket or TCP you can store the output as such.
java TCPClient localhost 7777 16 1 100 > 16mb_tcp.txt
or
java -cp ../jars/msocket-1.0.0.jar:. MSocketClient localhost 7777 1 32 100 > 32mb_msocket.txt
if flow size is in kb then
java TCPClient localhost 7777 0 4 100 > 4kb_tcp.txt
or
java -cp ../jars/msocket-1.0.0.jar:. MSocketClient localhost 7777 0 32 100 > 32kb_msocket.txt
Once you have stored the log files like this you can run the following command to get the plots.
python plot_overhead.py ratio #to get median transfer time ratio
or
python plot_overhead.py difference #to get median transfer time difference
After you are done run the following commands from the root directory of the repo.
ant clean
rm overhead_scripts/*.txt overhead_scripts/*.class