12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 23Changes made to the IEEE 802.15.4Implement<strong>at</strong>ion in NS-2.31In the following, changes made to the IEEE 802.15.4 WPAN module in as of <strong>ns</strong> release 2.31 are described along with thereaso<strong>ns</strong> for the modific<strong>at</strong>io<strong>ns</strong> <strong>and</strong> a list of files affected. This file was authored by Iyappan Ramach<strong>and</strong>ran.23.1 Radio shutdownAbility to put a WPAN node to sleep has been added in this release.1. A macro called SHUTDOWN has been defined in ./wpan/p802_15_4def.h th<strong>at</strong> provides the capability to shut a nodedown when it does not have any packet to tra<strong>ns</strong>mit. Currently, there is no provision to enable/disable radio shutdownfrom the tcl interface directly, but an indirect way exists (see point 4).2. Two functio<strong>ns</strong> Phy802_15_4::wakeupNode() <strong>and</strong> Phy802_15_4::putNodeToSleep() have been added th<strong>at</strong> can be calledto shutdown <strong>and</strong> wake up the radio. <strong>The</strong>se functio<strong>ns</strong> primarily serve to decrement the correct amount of energy co<strong>ns</strong>umedin sleep st<strong>at</strong>e.File affected: ./wpan/p802_15_4phy.cc, ./wpan/p802_15_4phy.h3. A new timer called macWakeupTimer has been added to serve as an alarm clock for the node to wake itself up (forbeacon reception, etc.) before it shuts down. <strong>The</strong> 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.h4. Variables P_sleep_ (sleep st<strong>at</strong>e power co<strong>ns</strong>umption), P_tra<strong>ns</strong>ition_ (power co<strong>ns</strong>umption in sleep-wakeup tra<strong>ns</strong>ition)<strong>and</strong> T_tra<strong>ns</strong>ition_ (time taken for sleep-wakeup tra<strong>ns</strong>ition) already exist in mac/wireless-phy.h. T_tra<strong>ns</strong>ition_ was notinitialized earlier <strong>and</strong> now has been. In addition, a new vew variable named T_sleep_ has been added to wireless-phyto indic<strong>at</strong>e the time <strong>at</strong> which radio shutdown is to be enabled. This can be set from the tcl interface using the variablename sleepTime (see ./tcl/ex/wpan_demo_sleep.tcl). Thus, it is possible to keep the SHUTDOWN macro #defined, butset sleepTime to a very large value to keep radio shutdown disabled throughout the simul<strong>at</strong>io<strong>ns</strong>. This provides a mea<strong>ns</strong>to turn on/off radio shutdown from the tcl interface.Files affected: mac/wireless-phy.h212

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!