Simulation and Analysis of Opportunistic Routing Protocols 1 The Purpose The purpose of this assignment is to gain familiarity with a network simulation tool and to get experience in basic data analysis. The simulator that will be used is called ONE [2] and is common within the opportunistic networking research community. You will run the simulation using a simple network scenario and investigate the influence of the mobility model and performance of different routing protocols. 2 Simulator Overview ONE is a discrete event simulator, which means that events (e.g., packets to send, timeouts, etc.) are scheduled in a global event queue according to their time of execution. When a simulation is run the simulator removes events from the head of the queue, moves the simulator time to that of the currently removed event and executes it. When done, it continues to the next event and so forth. The simulator reads a configuration file that specifies the network, i.e., the movement of the nodes 1 and settings of the nodes in the network. Each simulation run generates a trace file containing all the data packets that are sent between the nodes during the course of the simulated scenario. By analyzing this file it is possible to determine the performance effect of parameter variations, different routing protocols and more. A simulation can be very useful since it is possible to scale the networks easily and therefore eliminate the need for time consuming and costly real 1 Each simulated computer or device is called a node. 1
world experiments. While the simulator is a powerful tool, it is important to remember that the ability to do predictions about the performance in the real world is dependent on the accuracy of the models in the simulator. 2.1 Grading This lab can give you at most 3 points in the course point system. Each of the 3 tasks in this lab can give you 1 point each. Only by answering ALL the questions in each specific task can you get 1 point for that task. So only by answering all the questions of this lab you have the possibly of getting 3 points. Many of the question does not have one correct answer but are instead designed to show us that you have understood and can reason about different concepts. 2.2 Running the Simulation The simulator is written in Java and with our scripts it can run on Unix, Linux, and Mac OS X. For further instructions on how to use the simulator we refer to the README file in the ONE directory. The steps you have to perform to get going with the lab are the following: 1. Download the ONE simulator through the link on the lab homepage. 2. Extract the zip file. 3. Download the lab code from the lab homepage. 4. Extract the lab code in the ONE simulator directory. For ease of use, we have created scripts that will run and analyze (most) of the scenarios that you are going to study. Your assignment is to interpret the analyzed data. 2.3 Simulator output When running the simulator with the provided scripts there is a lot of output in the form of log files and plots. You need to read and interpret these files correctly to be able to answer some of the questions. Everything you need to look at can be found in the downloaded lab directory. The following folders are of interest: 2
config - here you find the configuration files for the different task. Do not edit except for in Task 3. plots - here.eps files of plots are generated. Used in Task 2 and Task 3. reports - here log files for each of the three tasks can be found. On the top level there is an example file containing additional infer to help you understand the output. Make sure you read the provided example file! TaskX ABC MessageStatsReport.txt - summarized info on the overall performance. TaskX ABC EventLogReport.txt - shows every connection made and all the events within that connection. There are three different events that are logged. CONN, S and DE. CONN indicate that a connection goes up or down. S indicates message sent and DE message successfully delivered. 3 Assignment There are three main tasks to be solved in this lab. First, you will familiarize yourself with a two different mobility models. Second, you will investigate the behavior of two opportunistic routing protocols. Last, you will perform a simulation where you configure some parameters and analyze the result based on the knowledge you have acquired from the first two tasks. You are supposed to write the answers to the questions in the provided answers.txt file. NOTE! You will have to read the references to be able to answer the questions at the end of each task. 3.1 Task #1: Mobility models Mobility models represent the movement of mobile users, and how their location, velocity and acceleration change over time. 3
3.2 Simulation Scenario In this task you are going to use two different mobility models and compare the results they yield. The data that is generated during the experiment is always sent from a randomly chosen node to a randomly chosen receiver. The first task is to run the simulator with the GUI and observe how nodes move using the different mobility models. A common mobility model used in research on opportunistic networks is Random Waypoint (RWP) [1]. RWP is a artificial mobility model that try to capture the movement of humans. The second model you are to try out is map based and called Shortest Path Map-Based Movement (SPMBM) [2]. The map you will see in the GUI shows the city roads in Helsinki, Finland. Run the simulation for RWP by typing the following command in the ONE directory by typing: $./task1.sh rwp Press play in the GUI and zoom if necessary. You should be able to see nodes move around. You should run the simulation until you see a popup window with Simulation done. You can fast forward to speed up the simulation. Observe the movement of the nodes. Now, run a simulation with SPMBM. $./task1.sh map Question 1. Briefly describe how RWP and SPMBM works? Question 2. What are the advantages and disadvantages with the two models? Question 3. Suggest a different mobility model that address one or more of the shortcomings of the other two. What does it improve? 3.3 Task #2: Opportunistic Routing In this task, you are going to look at the behavior of two routing protocols. The first routing protocol is very simple, it sends a copy of each message in the buffer to every node it meets, this is called epidemic routing [4]. The second protocol called Spray-and-Wait [3] is a variant of epidemic routing but with some additional constraints. The source sends the message 4
to the first F number of nodes it comes in contact with where F is a configurable number that is set to 5 in this task. A node that has received the message is then only allowed to forward the message directly to the destination. This results in that there are at most 2 hops between source and destination. We will be using the RWP mobility model from Task 1 to model the movement in the network. Run the simulation for epidemic routing. $./task2.sh -b 1 epidemic Follow how data is routed in the network. Now, run a simulation with Spray-and-Wait. $./task2.sh -b 1 saw Question 4. How many copies does epidemic and spray-and-wait respectively generate? Why does it look this way? Question 5. How does end-to-end delay differ in the two routing protocols? Two diagrams that will help you answer can be found in the subdirectory plots. Question 6. Using the generated logs found in reports/task2/task2 ABC EventLogReport follow message with id M95. How many message replications are there of M95 using each of the two protocols? (Hint: using the unix command grep on a file with the -w flag might help you. Type man grep for details.) Question 7. What is is the delivery ratio in epidemic and spray-andwait? Why is it lower when spray-and-wait is used? 3.4 Task #3: Comparing simulation results Now you are going to look at how routing protocols interact and behave with different mobility models. We will use the two mobility models and routing protocols already introduced in this lab. You will also get an insight into how different parameter assumptions can greatly influence the behavior and results. In Figure 1 you see four different simulations with different protocols and mobility models. There are four scripts used in Task 3 (found in the config 5
folder). Note that there is one script for each of the four configurations. They contain additional information that might be useful. If you want to generate the graph in Figure 1, run the following command. 25000 20000 # of transmissions 15000 10000 5000 RwpEpidemicRouting MapEpidemicRouting RwpSprayAndWaitRouting MapSprayAndWaitRouting 0 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Average delay Figure 1: $./task3.sh Question 8. What are your conclusions regarding mobility models and routing protocols based on Figure 1? Now you are to edit the scripts, remember that you need to edit all four files in the exact same way! In turn configure the wifi and bluetooth scenario from Table 1 and edit the config scripts accordingly. You need to save the two generated.eps plots and provide them with your hand-in. Run the simulation. $./task3.sh Question 9. What can you observe when running the bluetooth scenario? Question 10. What can you observe when running the wifi scenario? 6
Configuration bluetooth wifi Transmission range (m) 10 50 Bit rate (Mbps) 0.7 11 Buffer size (MB) 50 500 Packet size (MB) 1 1 Table 1: Simulation parameters. 4 Hand-in Instructions To pass the assignment follow the hand-in instructions below. You only need to do one hand-in for each group. Upload the two uncompressed files to the file area in the Studentportal. You should provide us with the following files 1. The provided answers.txt filled out with your answers to the lab questions. 2. The two.eps plots you produced in Task 3. One for bluetooth and one for wifi. 7
References [1] D. B. Johnson and D. A. Maltz. Dynamic source routing in ad hoc wireless networks. Mobile Computing, pages 153 181, 1996. [2] A. Keränen, J. Ott, and T. Kärkkäinen. The ONE Simulator for DTN Protocol Evaluation. In SIMUTools 09: Proceedings of the 2nd International Conference on Simulation Tools and Techniques, New York, NY, USA, 2009. ICST. [3] T. Spyropoulos, K. Psounis, and C. S. Raghavendra. Spray and wait: an efficient routing scheme for intermittently connected mobile networks. In Proceedings of the 2005 ACM SIGCOMM workshop on Delay-tolerant networking, WDTN 05, pages 252 259, New York, NY, USA, 2005. ACM. [4] A. Vahdat and D. Becker. Epidemic routing for partially-connected ad hoc networks. Technical report, 2000. 8