<< Chapter < Page Chapter >> Page >
The source code is too long to be put on this web page. You will have to download it. Open source_code/iar_v4.11/lab_ezwsn.eww with IAR. The project corresponding to this section is called txrx_wsn .

Project txrx_wsn is a complete WSN example which implements a complete communication stack for WSNs, using gradient multi-hop routing. A gradient routing protocol assigns a scalar value to each node, which we call its height . Heights are assigned in such a way that they increase with distance to a central node. Distance is calculated using a cumulative cost function based here on hop count. The forwarding process selects the next hop as the neighbor which offers the largest gradient, i.e.the neighbor with lowest height.

In the implemented protocol stack, the application layer generates sensed data to be sent to a sink node, by using on-board Analog-to-Digital Conversion. The routing layer is responsible for updating the node's myHeight ; the MAC layer performs on-demand neighbor discovery and uses preamble sampling for energy-efficiency.

The execution timeline of the implemented protocol is presented in the figure below, for an example topology of 3 nodes. By default, nodes perform preamble sampling. When a node wants to send a message (here A ), it starts by sending a preamble as long as the check interval ( CI ) to make sure all neighbors hear that preamble. For efficient handling by a packet radio, the preamble is cut into a series of micro-frames UF , each containing a counter indicating the number of UF still to come. Upon hearing a UF , a receiving node turns its radio off and sets a timer to switch into receive mode after the last UF . At that moment, the sender indicates the duration of the neighbor announcement window to follow in a CW packet.

A dog sitting on a bed
Timeline illustrating the execution of the protocol stack. The x-axis represents time; a box above the line indicates that the radio is transmitting; a gray/white box under the axes means that the radio in receiving/idle listening, resp.; no box means the radio is turned off.

Receivers choose a random backoff for sending an ACK message inside the neighbor announcement window and sleep the rest of the time; the sender listens for the complete announcement window and populates the initially empty neighbor table as it receives ACK messages.

After the neighbor announcement window, the sender updates its myHeight by the minimum value of its neighbors', incremented by one, and select its neighbor with smallest Height . It inserts this information into the DATA packet header which it transmits. The destination node receives the whole packet while the non-destination neighbor switches to sleep after the header. The destination replies with a final acknowledgment FIN ; all nodes resume preamble sampling.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Ezwsn: experimenting with wireless sensor networks using the ez430-rf2500. OpenStax CNX. Apr 26, 2009 Download for free at http://cnx.org/content/col10684/1.10
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ezwsn: experimenting with wireless sensor networks using the ez430-rf2500' conversation and receive update notifications?

Ask