Ability to put a WPAN node to sleep has been added in this release.
- A macro called SHUTDOWN has been defined in ./wpan/p802_15_4def.h
that provides the capability to shut a node down when it does not
have any packet to transmit. Currently, there is no provision to enable/disable radio shutdown from the tcl interface directly, but an indirect way exists (see point 4).
- Two functions Phy802_15_4::wakeupNode() and
Phy802_15_4::putNodeToSleep() have been added that can be
called to shutdown and wake up the radio. These functions primarily
serve to decrement the correct amount of energy consumed in sleep
state.
File affected: ./wpan/p802_15_4phy.cc, ./wpan/p802_15_4phy.h
- A new timer called macWakeupTimer has been added to serve as an alarm clock
for the node to wake itself up (for beacon reception, etc.) before it shuts down. The timer on expiry calls
Phy802_15_4::wakeupNode().
Files changed: ./wpan/p802_15_4mac.cc, ./wpan/p802_15_4mac.h,
./wpan/p802_15_4timer.cc, ./wpan/p802_15_4timer.h,
./wpan/p802_15_4csmaca.h
- Variables P_sleep_ (sleep state power consumption), P_transition_ (power consumption in sleep-wakeup transition) and T_transition_ (time taken for sleep-wakeup transition)
already exist in mac/wireless-phy.h. T_transition_ was not initialized earlier and now has been.
In addition, a new vew variable named T_sleep_ has been added to wireless-phy to indicate the time at which radio shutdown is to be enabled. This can be set from the tcl interface using the variable name sleepTime (see ./tcl/ex/wpan_demo_sleep.tcl). Thus, it is possible to keep the SHUTDOWN macro #defined, but set sleepTime to a very large value to keep radio shutdown disabled throughout the simulations. This provides a means to turn on/off radio shutdown from the tcl interface.
Files affected: mac/wireless-phy.h
- The radio if asleep should be woken up when MAC receives a packet to
transmit. Similarly, a sleeping radio needs to be woken up to
receive beacons whenever they are expected to arrive. If radio
shutdown is activated, the radio needs to be put to sleep after
transmission of a packet. Mac802_15_4::recv() does this by
calling functions Phy802_15_4::wakeupNode() and
Phy802_15_4::putNodeToSleep(), which decrement energy spent sleeping.
Files affected: ./wpan/p802_15_4mac.cc
- After every beacon reception, the node can shut itself down if it doesn't
have a packet pending to be transmitted when radio shutdown has been
activated. This is done by Mac802_15_4::recvBeacon() by
calling Phy802_15_4::putNodeToSleep().
Files affected: ./wpan/p802_15_4mac.cc
- If the node is being put to sleep when not in use, the sleep-to-idle transition
needs to be accounted for. This is done in CsmaCA802_15_4::start(). The backoff time
for the first backoff stage is calculated as wtime=MAX(wtime,ceil(phyT_transition_local_/bPeriod)*bPeriod).
Files affected: ./wpan/p802_15_4csmaca.cc
Tom Henderson
2011-11-05