MITATE Tutorial
MITATE Tutorial for Beginners
This tutorial will provide you step-by-step instructions to execute a basic experiment with MITATE. This tutorial assumes that you have read and understood the MITATE User Manual, you have MySQL and JAVA installed on your computer, and you are working in a UNIX environment.
Step 1: Initialization
1. Go to the registration page (now defunct) and create an account with MITATE system. After the registration process, you will
receive an email with a verification link to verify your email. The email might get
delivered to your spam folder. Click on the link in the email to complete the registration
process with the MITATE system. You will not be able to proceed without verifying
your account.
2. From your terminal, run
$ mkdir MITATE
followed by
$ cd MITATE
3. Download the MITATE Command Line API:
$ wget https://github.com/msu-netlab/MITATE/blob/master/WebServer/sample/mitate.sh
4. Run
$ chmod 777 mitate.sh
5. To see all possible API calls, run
$ ./mitate.sh help
6. Now, authenticate yourself by executing
$ ./mitate.sh login
After you execute this command, you will be asked to enter MITATE username and password.
You will then get a message You are now authenticated if the login is successful.
7. The next few steps create a local instance of a MySQL database to store data returned
by MITATE. If you don't have a local instance of a MySQL database installed, here's
a to a tutorial on how to set up mysql. To run the following commands that will set your database, you'll need MySQL root
user credentials.
8. Connect to the MySQL database using:
$ mysql -u root -p
9. Now, create a database schema in your local MySQL instance by using the following command from the mysql prompt.
mysql> CREATE DATABASE m_schema;
10. Now create a database user and grant it all privileges, run
mysql> CREATE USER 'm_user' IDENTIFIED BY 'm_pass';
followed by
mysql> GRANT ALL PRIVILEGES ON m_schema . * TO 'm_user';.
11. Now, exit the MySQL command prompt by using:
mysql> EXIT;
12. Generate SQL scripts to setup your local MySQL database, run
$ ./mitate.sh init localdb.sql
13. Create and initialize tables in m_schema, run
$ mysql --user=m_user --password=m_pass m_schema < localdb.sql
Step 2: Uploading an experiment
14. Now, download a sample MITATE XML configuration file by using
$ wget https://raw.githubusercontent.com/msu-netlab/MITATE/master/WebServer/sample/exp_conf.xml
15. Now, validate the XML file against MITATE XML Schema Definition file by using
$ ./mitate.sh validate exp_conf.xml
If the validation is successful, you will see a message XML experiment is valid.
16. Now submit your experiment to MITATE system by using
$ ./mitate.sh upload exp_conf.xml
If successful, you will receive an experiment ID for the experiment you just uploaded.
17. Now downloadthe MITATE Android Application from your mobile phone. After downloading and installing the application on your
mobile phone, connect your mobile phone to a Wi-Fi network, as this experiment is
configured to execute on a Wi-Fi network.
18. Now open the application and enter the MIATE login credentials and press the Start Service button. It may take upto a minute for the experiment to execute.
Step 3: Getting results
19. To check the status of your uploaded experiment, run
$ ./mitate.sh getExpStatus experiment_ID
where experiment_ID is the experiment ID you received in step 16.
20. Once the experiment has executed, pull the results the executed transfer from
MITATE database by using
$ ./mitate.sh query results.sql
This will create a file results.sql in the directory where mitate.sh resides.
21. Now populate tables in m_schema by using
$ mysql --user=m_user --password=m_pass m_schema < results.sql
22. Now, download the Per Packet Network Metrics file, which will get you the per packet network metrics containing throughput and latency for every packet in your experiment, by using:
$ wget https://github.com/msu-netlab/MITATE/raw/master/WebServer/sample/MITATE.jar
23. Execute the jar file to populate the table packetmetrics in your local database by using:
$ java -jar MITATE.jar -u m_user -p m_pass -s localhost -d m_schema -t 3306
where m_user is the database username, m_pass is the database password, localhost is your database server address, m_schema is the database name, and 3306 is the port number on which your MySQL service is running. You may want to change these parameters.
Step 4: Querying local database
24. To query data for TCP Uplink Throughput, download the SQL file for TCP Uplink Throughput by using:
$ wget https://raw.githubusercontent.com/msu-netlab/MITATE/master/WebServer/sample/tcp_uplink_throughput.sql
followed by (replace the experiment ID in the SQL file with the experiment ID you got in step 16 before executing the command below)
$ mysql --user=m_user --password=m_pass m_schema < tcp_uplink_throughput.sql
25. To query data for minimum, mean, and maximum TCP Uplink Latency, download the SQL file for TCP Uplink Latency by using:
$ wget https://raw.githubusercontent.com/msu-netlab/MITATE/master/WebServer/sample/tcp_uplink_latency.sql
followed by (replace the experiment ID in the SQL file with the experiment ID you got in step 16 before executing the command below)
$ mysql --user=m_user --password=m_pass m_schema < tcp_uplink_latency.sql
26. To query data for TCP Uplink Jitter, download the SQL file for TCP Uplink Jitter by using:
$ wget https://raw.githubusercontent.com/msu-netlab/MITATE/master/WebServer/sample/tcp_uplink_jitter.sql
followed by (replace the experiment ID in the SQL file with the experiment ID you got in step 16 before executing the command below)
$ mysql --user=m_user --password=m_pass m_schema < tcp_uplink_jitter.sql
27. To query data for TCP Uplink Packet Loss, download the SQL file for TCP Uplink Packet Loss by using:
$ wget https://raw.githubusercontent.com/msu-netlab/MITATE/master/WebServer/sample/tcp_uplink_packet_loss.sql
followed by (replace the experiment ID in the SQL file with the experiment ID you got in step 16 before executing the command below)
$ mysql --user=m_user --password=m_pass m_schema < tcp_uplink_packet_loss.sql
28. To query data for Device Travel Speed in (Km/hr), Device Signal Strength, download the SQL file for Device Metrics by using:
$ wget https://raw.githubusercontent.com/msu-netlab/MITATE/master/WebServer/sample/device_metric.sql
followed by (replace the experiment ID in the SQL file with the experiment ID you got in step 16 before executing the command below)
$ mysql --user=m_user --password=m_pass m_schema < device_metric.sql
29. To query data like the unique deviceid, the network carrier name, and the model name, for the mobile device that executed your experiment, download the SQL file for Device Details by using:
$ wget https://raw.githubusercontent.com/msu-netlab/MITATE/master/WebServer/sample/device_detail.sql
followed by (replace the experiment ID in the SQL file with the experiment ID you got in step 16 before executing the command below)
$ mysql --user=m_user --password=m_pass m_schema < device_detail.sql