The ONE Tutorial
By Mauro Margalho Coutinho
www.margalho.pro.br

If you liked, do the reference of this tutorial in your paper.



Features

1- Linux Ubuntu LTS 12.04

2- Eclipse

In the terminal, type the commands:
$ sudo apt-get install eclipse
$ sudo apt-get build-dep eclipse 

TIPS:

1- copy the one folder to workspace
2- File->New->Java Project
3- Enter "One" in project name and click button next (->)
4- Chose the tab "Libraries"
5 - In Libraries choose "Add External JARs..."
6- Search in folder .../one/lib
7- Select both "DTNConsoleConnection.jar" and "ECLA.jar"
8- Click in "OK"
9- Click in Finish

3- The ONE Simulator


4-Open Jump




Adjusting the node location parameter in the simulator script (Applied to Stationary Movement)

Now I will create two stationary points to use them as source and destination of the messages.

IMPORTANT: If you intend to use stationary points, I suggest strongly you put the "Y" coordinate of the connection lines layer above than map. Why? Because when you need these coordinates (of stationary point), it will be in a wrong position unless you subtract the value of the Y coordinate of the highest point of the map of the Y value of its stationary point.

Example:

Value of connection lines

LINESTRING (0.0 768.4224656527631, 0 0)

LINESTRING (0.0 768.4224656527631, 246.67689264494683 750.7851260978628)

In the simulator there are two lines to describe the stationary points:

Group4.movementModel = StationaryMovement

Group4.nodeLocation = valueX, valueY (require integer values)

Value of source stationary point:

POINT (12.1002765647717 685.5269697447313)

In this case you will use just the integer part.

New Y value = 768- 685

New Y value = 83

So, coordinate that you will use is:

Group4.movementModel = StationaryMovement

Group4.nodeLocation = 12, 83

PS: Don't change the X point.


Now a Complete Code with Comments

Parameter

Value
Comment
Scenario.name
=
MargalhoTutorial
This is the identification of your simulation. You can choose any name.
Scenario.simulateConnections
=
true

Scenario.updateInterval
=
0.1

Scenario.endTime
=
5000
This is the simulation time in seconds. For example 43200s == 24h
WiFi80211.type
=
SimpleBroadcastInterface
This is the type of the Interface that your nodes will use. That's possible that more than one interface can be used by one node
WiFi80211.transmitSpeed
=
1375k
This is the transmission speed of your interface in k. In this case I am using IEEE 802.11b (11Mbps)
WiFi80211.transmitRange
=
100
This is the cover area (range) of your transmission device
Scenario.nrofHostGroups
=
4
This indicate the number of the groups of the hosts. In this case I am using four: Src_, River_, CP_ and Dst_, described bellow
Group.bufferSize
=
50M
Parameters used in format group.parameter are applied to all groups. If you need to use a different parameter in a specific group, use the format group+number of group (Ex. group1 = ). In this case I am using 50 MB for buffer size parameters of all groups
Group.routeType
=
1

Group.router
=
EpidemicRouter
This is the routing protocol used to exchange messages between nodes. Anothet examples:
FirstContactRouter, EpidemicOracleRouter, DirectDeliveryRouter and SprayAndWaitRouter.
In this last case additional Parameters are required
SprayAndWaitRouter.nrofCopies = 2
SprayAndWaitRouter.binaryMode = true
Group.waitTime
=
0, 0
When you use different values in this parameter, the first refers to the time that the node will be in continuously movement.  The second refres to time that the node will stop before restart the movement. (Ex. 10, 20)
Group.speed
=
2, 4
This indicates the range between the minimum is the maximum velocity of the mobile nodes
Group.nrofInterfaces
=
1
This is the number of interfaces of the nodes. One mobile node could have more than one interfaces, for example WiFi and Bluetooth
Group.interface1
=
WiFi80211
Here we associate the interface with the nodes
Group1.groupID
=
Src_
-
Group1.nrofHosts
=
1
-
Group1.movementModel
=
StationaryMovement
-
Group1.nodeLocation
=
356, 383
# Group1.nodeLocation = POINT (356.0413935507689 317.175863384662)
# Y =  (700-317) = 383
Group2.groupID
=
River_
The name of the group. I use the underline after the name because the simulator adds a sequential number after this name. So, in the end you will see River_1
Group2.nrofHosts
=
10
This is the number of hosts for the group. The initial position is choosen radomically
Group2.movementModel
=
ShortestPathMapBasedMovement
Type of movement used. If the node is stopped you can use the Stationary Movement  type
Group2.okMaps
=
1
In this case, I'm using the ShortestPathMapBasedMovement model. So I need to link with the mobile route. The number 1 indicates a connection with the MapBasedMovement.mapFile1 parameter (described bellow) that use the  "data/river/river.wkt" file as route.
Group3.groupID
=
CP_
-
Group3.nrofHosts
=
1
-
Group3.movementModel
=
StationaryMovement
-
Group3.nodeLocation
=
702, 523
# Group3.nodeLocation = POINT (702.3859066820535 177.9589512436555)
# Y =  (702-177) = 523
Group4.groupID
=
Dst_
-
Group4.nrofHosts
=
1
-
Group4.movementModel
=
StationaryMovement
-
Group4.nodeLocation
=
724, 691
# Group4.nodeLocation = POINT (724.4568805580667 9.031112731092673)
# Y = Maior valor do Y do connection point - valor do Y daqui (724-9) = 691
# IMPORTANTE PARA EXPLICAR NO V�DEO: Se voc� for precisar usar pontos estacion�rios para n�s, deve-se colocar
# uma guia de conex�o com o eixo dos Y mais alto do que o ponto mais alto do mapa. Na hora de conectar as coordenadas,
# deve-se subtrair esse valor de Y da coordenada Y do parametro node location
MapBasedMovement.nrofMapFiles
=
2
Number of movement maps described below. In this case 2 related to river.wkt and river_conline.wkt
MapBasedMovement.mapFile1
=
data/river/river.wkt
This is a link to wkt file created in Open Jump Software to guide the movement nodes in the simulation process
MapBasedMovement.mapFile2
=
data/river/river_conline.wkt
The connection lines (conline) is just a reference linking the maps with the center of the Cartesian axes (0,0). It's not mandatory, but but it makes it easier for the user
Events.nrof
=
1
Number of Events described in this simulation
Events1.class
=
MessageEventGenerator
Type of Event
Events1.interval
=
1, 5
This parameter indicates the range (minimum and maximum) of occurrence of the event (in seconds).
Events1.size
=
 75k, 75k
This parameter indicates the range (minimum and maximum) of occurrence of the message size (in kilobytes).
Events1.hosts
=
0, 12
This indicates the source and destination hosts. In this case the message is going from host 0 (Src_0) to the destination 12 (Dst_12_). Tip: Look at the graphical interface to see the number of each host. It came after the name of the host. 
Events1.prefix
=
A
This is just a letter to identify the flow. It's interesting when you have more than one
MovimentModel.rngSeed
=
1
To vary a sequence of random numbers, vary the initial seed.
MovementModel.worldSize
=
4500, 3400
This is the flat grid, in other words, the space in a Cartesian axes where you will move your mobile nodes.
MovimentModel.warmup
=
10
Simulations usually need a warm-up time because your simulation is likely to start empty (no messages at any of the mobile nodes)
Report.nrofReports
=
7
Here the number of reports that you choose to be generated in this simulation
Report.warmup
=
0
This is a warmup for reports
Report.granularity
=
1
-
Report.reportDir
=
relatorios/
Folder where the reports will be placed
Report.report1
=
MessageStatsReport
Type of the first report
Report.report2
=
DeliveredMessagesReport
Type of the second report
Report.report3
=
ContactsPerHourReport
Type of the third report
Report.report4
=
CreatedMessagesReport
Type of the fourth report
Report.report5
=
DistanceDelayReport
Type of the fifth report
Report.report6
=
MessageLocationReport
Type of the sixth report
MessageLocationReport.granularity
=
1
-
MessageLocationReport.messages
=
1
-
Report.report7
=
MessageGraphvizReport
Type of the seventh report
Report.report8
=
MessageDeliveryReport
Type of the eithth report
Report.report9
=
MessageDelayReport
Type of the nineth report
Report.report10
=
MessageReport
Type of the tenth report
Report.report11
=
EventLogReport
Type of the eleventh report
Optimization.cellSizeMult
=
5
-
Optimization.randomizeUpdateOrder
=
true
-
GUI.UnderlayImage.fileName
=
data/my_tutorial/map.png
This is the path of the image file that will be put in background of your simulation
GUI.UnderlayImage.offset
=
64, 20
Parameters for adjust the background image
GUI.UnderlayImage.scale
=
4.75
Parameter for adjust the scale of the background image
GUI.UnderlayImage.rotate
=
-0.015
Parameter for adjust the rotation of the background image
GUI.EventLogPanel.nrofEvents
=
100
-

This code could be downloaded here