DRAND:
Distributed TDMA Scheduling for Sensor Networks
DRAND has been implemented on NS-2 (version
2.26) as well as the TinyOS platform for sensor networks:
NS-2
- NS-2 installations
instructions:
- Download the source tarball here.
- Untar it in your ns top-level directory:
(NS_INSTALL_DIRECTORY)/ns-2.26.
- Add an entry in the Makefile for DRAND files as
"drandNS2/drandAgent.o" for the OBJ_CC target.
- Add entry for DRAND packet type in
(NS_INSTALL_DIRECTORY)/ns-2.26/tcl/lib/ns-packet.tcl as "DRAND" -
sample here.
- Add entry for DRAND packet type in
(NS_INSTALL_DIRECTORY)/ns-2.26/common/packet.h as "PT_DRAND" - sample here.
- Replace ns2.26/mac/mac-802_11.cc with this
file: There is a small change
to enable broadcast for DRAND packets.
- Replace ns2.26/trace/cmu-trace.cc with with this
file: This adds support for DRAND packets.
- NS-2 execution
instructions:
- Download the tcl script tarball here
- Untar it in any location in your file-system.
- Execute simulation by the follwing command: "ns
simple-wireless.tcl <numNodes> <scenario.tcl>"
- File "simple-wireless.tcl" runs a simulation of
<numNodes> nodes in a 300m x 300m area, distributed according to
the wireless scenario generated by "scenario.tcl". Wireless options
(link speed, antenna characteristics, transmission power, etc.) are in
the "wirelessOpt.tcl" file.
- For generating the scenario file, use the CMU scenario
generator included in the ns2 distribution:
(NS_INSTALL_DIRECTORY)/ns-2.26/indep-utils/cmu-scen-gen/setdest. Also, note that
the scenario should not contain any node motion, so please use the option "-p 0 -s 0"
- DRAND is composed of two phases - a "HELLO" phase, where nodes
send beacons to each other to probe their network neighborhood, and the
"DRAND" phase where the DRAND algorithm is run and a TDMA schedule is
produced (For more details please refer to the paper "Randomized
Dining
Philosophers to TDMA Scheduling in Wireless Sensor Networks".
- DRAND output is as follows:
- MESSAGE sID 82 mCt 15 rReq 0
rGra 0 mTime 27.826388 oneHopCount 7
MESSAGE sID 82 reqCt 1 graCt 7
rejCt 0 relCt 0 twoCt 7
MESSAGE sID 82 Round 20 maxC 0
twoHopMaxC 0 slotNum 11 roundDelay 0.023284 grantDelay 0.018388
- Some of the noteworthy fields are:
- sID = Node ID
- mCt = Total messages transmitted
- mTime = Total time for the node to get its own time slot
- oneHopCount = Total number of nodes within one hop to this
node
- slotNum = TDMA slot assigned by DRAND
- In case of difficulties, contact Ajit Warrier.
TinyOS
- Software will be released soon.