Node Energy Level in NS2

  • 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.