Skip to main content

A Simple Epidemic Routing Scenario

Today, we will play around a bit with the ONE simulator, specifically with the Epidemic routing protocol. We will simulate two scenarios and look at the results. Detailed analysis of the results are left out for the time being.


Here are few common parameters for the simulations.
  • Group.movementModel = RandomWaypoint
  • Group.msgTtl = 300 (5 hours)
  • MovementModel.worldSize = 450, 340
  • Scenario.endTime = 14400 (4 hours)

Stats are collected from MessageStatsReport from a single run.

Scenario #1 

In the  first scenario, we vary the density of the nodes for a single speed range. In particular, we consider:
  • Epidemic routing with (10, 50, 100, 150, 200, 250, 300) nodes
  • Speed: 0.5, 1.5
It may be noted here that node density in a simulation can be controlled in different ways, e.g., by varying
  1. The number of nodes keeping the simulation geography (usually rectangular) size constant
  2. The geography size keeping the number of nodes constant
  3. Both the number of nodes and the size of the geography
In this case, we take the first approach. Certain results from this simulation scenario are presented below.

At first we look at the average delivery latency (in seconds) of the messages as a function of the number of nodes. As it can be observed from the data and the adjoining plot, the latency decreases with the increasing node density. This is due to the reason that with increased number of nodes, a message gets more chance to be delivered and that too quickly. Indeed, the latter set of data and the corresponding plot indicates that the delivery ratio increases with the node density.

Average Latency
10  1032.6966
50  887.4016
100  773.9650
150  653.5246
200  610.9147
250  617.7339
300  573.6033


Delivery Probability
10  0.1813
50  0.2587
100  0.2912
150  0.2485
200  0.2627
250  0.2525
300  0.2464

Scenario #2

In the second scenario, we consider a constant number of nodes, but vary their speeds in different ranges, as enumerated below:
  • Speeds: [0.5,1.5; 1.5,2.5; 2.5,3.5; 3.5,4.5; 4.5,5.5; 5.5,6.5; 6.5,7.5]
  • # of nodes: 100  
Avg latency
1  773.9650
2  440.8467
3  453.5573
4  582.5417
5  678.5824
6  899.6848
7  985.1136

Delivery probability
1  0.2912
2  0.3055
3  0.2668
4  0.2444
5  0.1853
6  0.1874
7  0.1792

The corresponding results -- average delivery latency and delivery probability -- are shown above.

What can you infer from these results?

Revision history:

12 Feb 2014: Expanded the discussion


Popular posts from this blog

Specifying Source and Destination of Messages

One of the frequently asked questions in the community is how to specify which particular nodes would act as source(s) and destination(s) of the messages created in the ONE simulator. The simulator, in fact, provides a pair of settings (shown below in bold face) aimed for this particular purpose.

Let us consider that there are $n + 1$ nodes in an OMN.  Further, let the nodes with addresses from $x$ to $y$, both inclusive, would create messages. The nodes in the range $w$ to $z$, both inclusive, would be the destinations of those messages, where $0 \le x \le y \le n$, and $0 \le w \le z \le n$. Then, the corresponding simulation scenario can be configured as follows.

## 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 # Me…

Effects of Buffer Size on Delay Tolerant Routing

In this post, we look at how buffer size affects, if at all, the performance of the routing protocols in DTNs. For this purpose, we will consider the following five routing protocols:
EpidemicPROPHETSpray-and-Wait (SnW) First Contact (FC) Direct Delivery (DD)  Detailed discussion of these protocols is scoped out here. We just note that in case of Epidemic, there is unlimited replication of the messages. In PROPHET, however, the replication is usually less than that of Epidemic. On the other hand, SnW has a fixed limit (L) on possible number of replications of a message. Finally, FC and DD involve message forwarding -- not replication. So, in the latter cases, there is always a single copy of any message in the DTN.

We will consider the buffer sizes from 20 MB to 180 MB, both inclusive, in steps of 20 MB so that we have total 9 different buffer sizes. We will use the real-life connection traces from Infocom'06. Therefore, we will need to simulate 5 * 9 = 45 scenarios to get the rel…

Controlling Transmission Range from within the Simulation

While simulating scenarios with the ONE simulator, one typically defines one or more network interfaces, and add them to the nodes as required. This use case prevails in most of the scenarios. However, a drawback here is that different network interfaces are mutually incompatible — an interface of type 1 can't communicate with any interface not of type 1.

Under certain circumstances, it might be required to control the transmission range of one or more network interfaces dynamically from within the simulation. For example, in one of my works, "On emotional aspects in Mission-Oriented Opportunistic Networks", I have considered the case where users occasionally turn off their device radios based on their contemporary emotions. In particular, the following shows how to set the radio range to 0: ModuleCommunicationBus comBus = host.getComBus(); // Store the original radio range the first time it is reset if (this.originalRadioRange == -1) { this.originalRadioRange = Double…