wpan.tex
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:6k
- chapter{Changes made to the IEEE 802.15.4 Implementation in NS-2.31}
- label{chap:wpan}
- In the following, changes made to the IEEE 802.15.4 WPAN module in as
- of ns release 2.31
- are described along with the reasons for the modifications and a list
- of files affected. This file was authored by Iyappan Ramachandran.
- section{Radio shutdown}
- Ability to put a WPAN node to sleep has been added in this release.
- \
- begin{enumerate}
- item{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 ref{point_shutdown_from_tcl}). }
- item{Two functions mbox{Phy802_15_4::wakeupNode()} and
- mbox{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}
- item{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
- mbox{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}
- item{label{point_shutdown_from_tcl}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 mbox{./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}
- item{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. mbox{Mac802_15_4::recv()} does this by
- calling functions mbox{Phy802_15_4::wakeupNode()} and
- mbox{Phy802_15_4::putNodeToSleep()}, which decrement energy spent sleeping.\
- Files affected: ./wpan/p802_15_4mac.cc}
- item{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 mbox{Mac802_15_4::recvBeacon()} by
- calling mbox{Phy802_15_4::putNodeToSleep()}.\
- Files affected: ./wpan/p802_15_4mac.cc}
- item{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 mbox{CsmaCA802_15_4::start()}. The backoff time
- for the first backoff stage is calculated as mbox{wtime=MAX(wtime,ceil(phy$rightarrow$T_transition_local_/bPeriod)*bPeriod)}.\
- Files affected: ./wpan/p802_15_4csmaca.cc}
- end{enumerate}
- section{Other changes}
- begin{enumerate}
- item{After backing off textit{macMaxCSMABackoffs} and being unable to transmit a packet,
- the MAC has to report a channel access failure. The older implementation kept attempting to
- transmit the packet indefinitely, instead of reporting channel access failure.
- This has been fixed in the mbox{Mac802_15_4::mcps_data_request()} function.
- Also the node is put to sleep (if need be) at this stage.\
- Files affected: ./wpan/p802_15_4mac.cc}
- item{A new constant called aCCATime has been added, which indicates the CCA
- duration in symbol periods.\
- Files affected: ./wpan/p802_15_4const.h}
- item{CCA duration has been specified to be 8 symbol durations. In the older implementation,
- CCA was being done right at the end of the 8th symbol duration to determine
- channel idleness. As a result, if the channel is busy for the first
- 8 symbol durations and goes idle after that (which is likely), the
- implementation would indicate channel idle while in reality it
- shouldn't. This has been fixed by doing the CCA at the end of the
- 4th symbol duration, but reporting channel status at the 8th. For
- this purpose, a new timer CCAReportH has been added which on expiry calls
- CCAReportHandler that does the reporting.
- Files affected: ./wpan/p802_15_4phy.cc, ./wpan/p802_15_4phy.h}
- item{The mbox{Phy802_15_4::PD_DATA_indication()} function calls
- mbox{WirelessChannel::sendUp()} to check if the packet has been received correctly and
- to decrement the energy consumed in the packet reception. The SendUp() function is already
- being called by recv() and calling it a second time causes energy to be decremented twice.
- This bug has been fixed in mbox{Phy802_15_4::PD_DATA_indication()}.\
- Files affected: ./wpan/p802_15_4phy.cc}
- item{mbox{Phy802_15_4::recv()} function that receives packets from the channel checks
- if the packet has been received correctly using
- mbox{WirelessPhy::sendUp()}, failing which the packet is freed.
- sendUp() returns a 0 either when the node is asleep or when the
- packets received power is less than the CS threshold. In the former
- case, the variables rxTotPower and rxTotNum need to be updated for
- CS purposes before dropping the packet, while in the latter case the
- packet simply needs to be dropped. Zheng's implementation was
- dropping all packets without updating the variables. This has been
- fixed in
- mbox{Phy802_15_4::recv()}.\
- Files affected: ./wpan/p802_15_4phy.cc}
- item{The receiver has to be turned on for the carrier sensing operation and therefore
- receive power $P_r$ is consumed during this period. The earlier implementation did not
- decrement receive energy due to carrier sensing. This has been added in function
- mbox{Phy802_15_4::CarrierSenser()}. Also, energy is spent during the tx-rx
- turnaround. This has been accounted for as well.\
- Files affected: ./wpan/p802_15_4phy.cc}
- end{enumerate}
- endinput