Friday 29 March 2013

Energy Model in NS2

The energy model is used through the node-config API. An example is shown as follows

      $ns_ node-config -adhocRouting DumbAgent \
    -llType $opt(ll) \
    -macType Mac/SMAC \
    -ifqType $opt(ifq) \
    -ifqLen $opt(ifqlen) \
    -antType $opt(ant) \
    -propType $opt(prop) \
    -phyType $opt(netif) \
    -channelType $opt(chan) \
    -topoInstance $topo_ \
    -agentTrace ON \
    -routerTrace ON \
    -macTrace ON \
    -energyModel $opt(energymodel) \
    -idlePower 1.0 \
    -rxPower 1.0 \
    -txPower 2.0 \
             -sleepPower 0.001 \
             -transitionPower 0.2 \
             -transitionTime 0.005 \
    -initialEnergy $opt(initialenergy)
The following parameters are newly added:
-sleepPower: power consumption (Watt) in sleep state
-transitionPower: power consumption (Watt) in state transition from sleep to idle (active)
-transitionTime: time (second) used in state transition from sleep to idle (active)



Analysis through Trace files


In addition to the total energy, now users will be able to see the energy consumption in different states at a given time. Following is an example from a trace file on energy.

 [energy 979.917000 ei 20.074 es 0.000 et 0.003 er 0.006]
The meaning of each item is as follows:
energy: total remaining energy
ei: energy consumption in IDLE state
es: energy consumption in SLEEP state
et: energy consumed in transmitting packets
er: energy consumed in receiving packets

Sample TCL script : Click Here

No comments:

Post a Comment