Vous êtes sur la page 1sur 6

Introduction The Opportunistic Network Environment (ONE) is a Java based simulator targeted f or research in Delay Tolerant Networks (DTNs).

Apart from letting an user to sim ulate different scenarios quickly and in a flexible manner, it also provides an easy way to generate statistics from the simulation performed.The ONE simulator could be run on Linux, Windows, or any other platform supporting Java. Details about ONE, including how to download and run, can be found from the official sit e. A list of common questions and their answers are listed here. Why? ONE is quite young a simulator, which is not surprising considering the fact tha t DTN itself is still evolving. ONE has been used by many researchers as a part of their work. However, apart from the README that comes with this software, it' s website and mailing lists, there is not much information about the simulator a vailable publicly. As a beginner, I myself stumbled over a lot while trying to c reate a simple scenario with a few mobile nodes! This prompted me to write this tutorial, so that others shouldn't face the same trouble. This tutorial does not intend to discuss in details about ONE, but attempts to g uide you to simulate a simple network scenario using ONE. The scope of this tuto rial could be extended in future to include not-so-simple, and complex scenarios as I explore this software more. Target Audience This tutorial is aimed for the beginners who quickly want to gain experience wit h the ONE simulator through a easy and simple example! Pre-conditions This tutorial assumes that you have downloaded the ONE source code, and have exe cuted the compile.bat file to generate all the related Java classes successfully . The version that we would be using is 1.4.1. Instructions regarding how to do this can be found in the official site of the ONE listed above. The Scenario Simulate a network of five nodes moving randomly inside a rectangular region wit h certain speed. General Steps Below are the steps that we will be following to perform our simulation. In fact , these are some steps that every simulation would involve. Specify the general settings for the scenario to be simulated Specify the network interface(s) of the nodes Create a group of nodes Specify the motion patterns Specify the traffic pattern Specify a set of reports to be generated Configuration File(s) Configuration file(s) define various settings for our simulation. If you are fam iliar to ns2, configuration files would serve similar purpose that TCL scripts w ould do there. For example, in this(these) file(s) we would specify the number o f nodes that our simulation would consist of, dimensions of the bounding region, how long the simulation would run, and so on. ONE comes with a default_settings.txt file. It is important to note here that th is file is read (used) for every simulation. Thus, we would, in general, be modi fying this file to suit our purpose. However, when one goes for simulating a ver

y complex scenario, it is better to take a modular approach. In that case we can have multiple configuration files. To reflect on this consider a few group of n odes with each group using different routing algorithms. To make life simple, we can store parameters for each such algorithms in different files. We just need to specify names of these files while running the simulation, as shown below: ./one.sh epidemic.txt Note that we never need to mention about default_settings.txt -- it is read auto matically! Specify Scenario Settings The first step of a simulation is to setup the scenario. For example, how long w ould the simulation run, how many groups of nodes would it consist of, a name fo r the current scenario, and so on. The listing below shows some of the specifica tions together with their explanations as comment lines. Note: In this tutorial all the configuration would be written in the default_set tings.txt file. The contents of the entire file would be shown at the end. ## Scenario settings # A name to identify the present scenario Scenario.name = Test-5-nodes # Whether to create connections among nodes Scenario.simulateConnections = true # How frequently to sample the simulation Scenario.updateInterval = 1.0 # 43200s == 12h # How long the simulation will run (in seconds) Scenario.endTime = 5000 # How many groups of nodes to be created (atleast one) Scenario.nrofHostGroups = 1 We can create multiple groups of nodes, with each group possibly having it s own cha racteristics. Even if such a scenario is not required, we would create a single logical group and put all the nodes under it. Specify Network Interfaces for Nodes We have to instruct the simulator about how the different nodes will communicate . For example, two computers can communicate over, say, Ethernet or P2P links. I n our case, all the nodes would exchange messages using Bluetooth as shown below . # "Bluetooth" interface for all nodes btInterface.type = SimpleBroadcastInterface # Transmit speed of 2 Mbps = 250kBps btInterface.transmitSpeed = 250k # Range of transmission (in meter) btInterface.transmitRange = 10 NOTE: ONE does not implement link or physical layer features. Create a Group of Nodes As mentioned earlier, we can have multiple logical groups of nodes in ONE. For e xample, consider a rescue operation (after a disaster) performed by close coordi nation of army, health, fire brigade, and civil organizations. We can represent this situation with four groups, and define individual behaviour of a group. How ever, in this example, we will consider only a single group, as shown below.

# Common settings for all groups # Mobility model for all the nodes Group.movementModel = RandomWaypoint # Routing protocol to be used by a node in the group Group.router = EpidemicRouter # Buffer size of any node Group.bufferSize = 5M # All nodes have the bluetooth interface Group.nrofInterfaces = 1 Group.interface1 = btInterface # Walking speeds Group.speed = 0.5, 1.5 # Message TTL of 300 minutes (5 hours) Group.msgTtl = 300 # No. of nodes present in this group Group.nrofHosts = 5 # Identifier for the nodes in this group Group.groupID = n Thus, we ask ONE to create five nodes with each of them moving randomly, and com municating with each other using Bluetooth. Specify Motion Patterns Individual groups can have their own mobility model. We have already specified i n the previous section that all nodes would move randomly (RandomWaypoint model) . However, we also need to specify the system boundary i.e. area of the (2D) spa ce within which motion of nodes would remain confined to. We do that in the foll owing way. ## Movement model settings # seed for movement models' pseudo random number generator (default = 0) MovementModel.rngSeed = 1 # World's size for Movement Models without implicit size (width, height; in mete rs) MovementModel.worldSize = 450, 340 Specify Traffic Pattern A network simulation is not of any practical use unless nodes exchange messages. ONE allow us to do this in two possible ways: Let ONE itself generate messages Load an external file containing a list of messages to be created (with time stamp, source node #, destination node #) We will use the first method here. The second method is quite useful if we wish to import data generated by any other application. ONE, however, also provides a PERL script to generate such traffics. ## Message creation parameters # How many event generators Events.nrof = 1 # Class of the first event generator Events1.class = MessageEventGenerator # (Following settings are specific for the MessageEventGenerator class) # Creation interval in seconds (one new message every 25 to 35 seconds) Events1.interval = 25,35

# Message sizes (500kB - 1MB) Events1.size = 500k,1M # Range of message source/destination addresses # Note: This shouldn t be greater than # of nodes Events1.hosts = 0,4 # Message ID prefix Events1.prefix = M Specify Reports to be Generated ONE makes our work of network analysis simplified by generating a set of reports . For example, from MessageStatsReport we can find out the number of messages cr eated, delivered, dropped, average buffer time, and so on. We will generate only this report for our simulation, as shown below. ## Reports - all report names have to be valid report classes # How many reports to load Report.nrofReports = 1 # Directory where reports would be created Report.reportDir = reports/Test-5-nodes # Report classes to load Report.report1 = MessageStatsReport Thus, we are all set to run our first simple simulation of five randomly moving nodes. The contents of the entire default_settings file is given below. # # Default settings for the simulation # ## Scenario settings Scenario.name = Test-5-nodes Scenario.simulateConnections = true Scenario.updateInterval = 1.0 # 43200s == 12h Scenario.endTime = 5000 Scenario.nrofHostGroups = 1 ## Interface-specific settings: # type : which interface class the interface belongs to # For different types, the sub-parameters are interface-specific # For SimpleBroadcastInterface, the parameters are: # transmitSpeed : transmit speed of the interface (bytes per second) # transmitRange : range of the interface (meters) # "Bluetooth" interface for all nodes btInterface.type = SimpleBroadcastInterface # Transmit speed of 2 Mbps = 250kBps btInterface.transmitSpeed = 250k btInterface.transmitRange = 10 ## Group-specific settings: # groupID : Group's identifier. # nrofHosts: number of hosts in # movementModel: movement model kage) # waitTime: minimum and maximum

Used as the prefix of host names the group of the hosts (valid class name from movement pac wait times (seconds) after reaching destination

# speed: minimum and maximum speeds (m/s) when moving on a path # bufferSize: size of the message buffer (bytes) # router: router used to route messages (valid class name from routing package) # activeTimes: Time intervals when the nodes in the group are active (start1, en d1, start2, end2, ...) # msgTtl : TTL (minutes) of the messages created by this host group, default=inf inite ## Group and movement model specific settings # pois: Points Of Interest indexes and probabilities (poiIndex1, poiProb1, poiIn dex2, poiProb2, ... ) # for ShortestPathMapBasedMovement # okMaps : which map nodes are OK for the group (map file indexes), default=all # for all MapBasedMovent models # routeFile: route's file path - for MapRouteMovement # routeType: route's type - for MapRouteMovement # Common settings for all groups Group.movementModel = RandomWaypoint Group.router = EpidemicRouter Group.bufferSize = 5M # All nodes have the bluetooth interface Group.nrofInterfaces = 1 Group.interface1 = btInterface # Walking speeds Group.speed = 0.5, 1.5 # Message TTL of 300 minutes (5 hours) Group.msgTtl = 300 Group.nrofHosts = 5 Group.groupID = n ## Movement model settings # seed for movement models' pseudo random number generator (default = 0) MovementModel.rngSeed = 1 # World's size for Movement Models without implicit size (width, height; meters) MovementModel.worldSize = 450, 340 # How long time to move hosts in the world before real simulation ## Message creation parameters # How many event generators Events.nrof = 1 # Class of the first event generator Events1.class = MessageEventGenerator # (following settings are specific for the MessageEventGenerator class) # Creation interval in seconds (one new message every 25 to 35 seconds) Events1.interval = 25,35 # Message sizes (500kB - 1MB) Events1.size = 500k,1M # range of message source/destination addresses Events1.hosts = 0,4 # Message ID prefix Events1.prefix = M ## Reports - all report names have to be valid report classes # how many reports to load Report.nrofReports = 1 Report.reportDir = reports/Test-5-nodes

# Report classes to load Report.report1 = MessageStatsReport ## Optimization settings -- these affect the speed of the simulation ## see World class for details. Optimization.cellSizeMult = 5 Optimization.randomizeUpdateOrder = true Running the Simulation Once our settings file is ready we can go ahead and run the simulation. The step s for doing this in Linux: Open a command prompt, change to the directory contai ning the ONE source code, and type: bash ./one.sh -b The above will run the ONE in batch mode for a single time. If it doesn t throw any error, a report files can be found in the reports/Test-5-nodes directory. The re port file obtained by running this simulation is attached at the end of the page . Alternatively, we can simply execute one.bat without the -b argument. That will open the visualizer of ONE, where we can view motion of nodes , data exchange, and o ther different related events. A screenshot of ONE's GUI, showing five nodes, ca n be seen in figure-01. The nodes are prefixed with 'n' since we had earlier spe cified. Group.groupID = n Figure-01: Visualization of network simulation with ONE

Vous aimerez peut-être aussi