Sometimes nodes in MANETs may rely on batteries or other exhaustible means for their energy. For such nodes, an important system design criteria for optimization may be energy conservation.

Open NetSim and Select Examples-> Mobile Adhoc Network ->Power model in MANETsthen click on the tile in the middle panel to load the example as show in below screenshot Figure 4.21.


The following network diagram illustrates, what the NetSim UI displays when you open the example configuration file see Figure 4.22


Settings done in sample network#

  1. Grid length β†’ 500m*500m.

  2. Open Wireless node Interface properties and set the following properties under Physical Layer as shown below.

    • Idle Mode Current (mA) = 20,
    • Initial Energy (mAH) = 0.1 and
    • Energy harvesting to Off


  3. Click on the Application icon present in the top ribbon/toolbar

    • Create CBR Application from Wireless_Node_1 to Wireless_Node_3.
    • Set application start time as 0s and accept default for other parameters.
  4. Set DSR routing protocol under network layer properties in all nodes.

  5. Set DCF as the medium access layer protocol under datalink layer properties of all wireless node.
  6. Enable Packet Trace.
  7. In NetSim GUI Plots are Enabled.
  8. Run simulation for 50 secs.

Theoretical calculation for battery life:

The battery life can be calculated by using the formula below:

$$Battery life (Hours)= \frac{πΈπ‘›π‘’π‘Ÿπ‘”π‘¦(π‘šπ΄π»)}{πΏπ‘œπ‘Žπ‘‘ π‘π‘’π‘Ÿπ‘Ÿπ‘’π‘›π‘‘(π‘šπ΄)}= \frac{0.1}{20} \ Hours = 0.005 \ Hours \ or \ 18 \ secs$$


After simulation, open Battery model metrics and observe the consumed energy would beapproximately equal to initial energy for Wireless node_1 and Wireless node_3 since these nodes are communicating with each other and hence there is battery consumption. We can also observe that the Remaining energy is approximately 0 for Wireless node_1 and Wireless node_3. i.e., the battery is completely drained as shown below Figure


Open Packet animation and check the battery level of wireless nodes 1 and 3 would reduce with time and packet animation stops at 18.8 seconds approximately since the batteries of wireless nodes 1 and 3 dies as shown in the below screenshot.