I am new to NetSim and want help regarding energy in MANET networks. How can I get the rest energy consumed by a Node in MANET? And also compare total energy consumed when running different routing protocols.
The energy level of a node can be obtained during the simulation (NS 2) by using following command :
set energy [$node_(0) energy]
The energy of the mobile node is fixed in ns2 using energy model. The components required for designing for energy model includes initialEnergy, txPower, rxPower, and idlePower.
set variablename EnergyModel ; #Energy set up #configure nodes -energyModel variablename \ -initialEnergy 10 \ -rxPower 0.5 \ -txPower 1.0 \ -idlePower 0.0 \ -sensePower 0.3 \ where, initial Energy → level of energy node has at the initial stage of the simulation. rxPower → energy consumed for receiving the packets. txPower → energy consumed for transmitting the packets. sensePower → energy consumed for sensing operation. IdlePower → energy consumed for node the in idle state.
NetSim provides a dedicated power model for each MANET node, where users can further choose between battery and mainline. If set to battery, the user can configure various options such as the initial energy, voltage, and various current values based on which energy consumption will be computed during runtime. At the end of the simulation, a dedicated Energy consumption metrics table showing energy consumed by each device in different modes and total energy consumed will be provided. This can be used to get the energy consumed by each node and summed up to obtain the total energy consumed by the entire network respectively. Following are some of the articles related to the energy model in NetSim, applicable to MANETs/IoT:
1. Per packet energy consumption - transmit, receive, idle and sleep - can be obtained by cross referencing NetSim's packet trace and energy log
2. The energy consumption is given by V*I*T
where V is the battery voltage, I is the current drawn and is the time for which the node is in a particular mode.
3. V and I are user inputs in the GUI. The time for which the node is in each state (transmit, receive, idle and sleep) as well as the energy consumed can be seen from the energy log.
4. Then use the packet trace to determine the packet type i.e., Data packet, WLAN ACK, MANET Control packet (DSR or ADV Route request, Route replies) etc.