The ONE Simulator (6/14)

Vincent Davis
2 min readJun 17, 2020

Last week was not very productive. I spent all of Wednesday driving to Louisville to take my friend to the airport. (Always happy to do it!) The power went out the next day for 7 hours! The internet was on and off all week because of some miscommunications with my ISP.

This week has been much more productive.

I finished my research outline detailing the steps in my experiment (the how). I finished my timeline yesterday (the when). Today I am learning more about the ONE Simulator.

In my research project, I need to be able to import Contact Traces from the MIT Reality Dataset. Luckily, the same website that provided me with the traces also detailed how to use them!

Add the following setting to the settings.txt you will be using:

Scenario.simulateConnections = false
Group.movementModel = StationaryMovement
Group.nodeLocation = 0,1

This prevents the simulator from generating random connections or using a mobility model. Contact traces do not provide location data.

Events.nrof = 2
Events1.class = StandardEventsReader
Events1.filePath = dir/to/mytracefile.txt

Events2.class = MessageEventGenerator
# change interval to have more or less messages, see javadocs for more information.
Events2.interval = 30,40
Events2.size = 1k
# range of message source/destination addresses
Events2.hosts = <<min node ID>>,<<max node ID>>
Events2.prefix = M

This creates 2 events, one for the contact trace and another for random message generation. A message will be generated ever 30 to 40 seconds of size up to 1 kilobyte. The hosts (to,from) will be picked from a range depending on the minimum node ID and the maximum node ID.

There is also a useful feature called batch mode. You can define one settings.txt to test with multiple scenarios. More info on this website.

Scenario.name = %%Group.movementModel%%_%%Group.router%%_%%Group.bufferSize%%
Group.movementModel = [RandomWalk; RandomWaypoint;]
Group.router = [EpidemicRouter; ProphetRouter; SprayAndWaitRouter;]
Group.bufferSize = [2M; 5M; 10M; 15M; 20M;]

Here the percentage signs indicate place holders for the values of variables.

These settings have 2 different movement models, 3 different types of routes and 5 different buffer sizes for a total of 2*3*5 = 30 scenarios. Therefore, to run each of these scenarios, the following command should be used:

./one.sh -b 30 multiple_scenarios.txt

Hosts are not recreated between scenarios. This means that if you create a routing protocol with static members, you need to also create a reset() method to prevent the host from using the same data for each new simulation. For example:

static {
DTNSim.registerForReset(BusControlSystem.class
.getCanonicalName());
reset();
}

public static void reset() {
systems = new HashMap<Integer, BusControlSystem>();
}

--

--