CSCI 7143-001: Sensor Networks
Programming Assignment
Fall
2002
Build a packet flooding protocol on sensor Motes. This protocol should:
enable a basestation to send a request for sensor data to a specifically addressable sensor Mote. This will be demonstrated by lighting a green LED on the destination sensor Mote. The basestation will broadcast/flood this request, such that all Motes will receive this request, but only the destination sensor Mote will reply. All other sensor Motes will ignore this request packet. Note that you will have to briefly toggle on the green LED and then turn it off.
enable the destination sensor Mote to respond to the basestation's request and send back to the basestation its reply packet containing its current sensor reading. Each reply will be sent by broadcasting/flooding the packet. All other sensor Motes will ignore this reply packet.
The sensor readings will be collected by an application at the basestation and then plotted on screen, to verify the correctness of your protocol. You should write a C program to print these values to the screen.
be efficient in both directions, such that packets should not be repeated unnecessarily, e.g. in a cyclical loop. To accomplish this, you will need to create state, or a cache, on each Mote, that stores a history of the recently received packets. Each packet should only be broadcast once. If a Mote receives a duplicate packet, then the Mote should not rebroadcast that packet, and should simply drop that packet. We will verify efficiency in two ways: first by the behavior of the red & yellow LEDs on the Motes; second, by inspecting a packet trace of network behavior.
Each Mote should light up a red LED when it receives any packet, either a request or reply. Each Mote should light up a yellow LED when it transmits/forwards any packet, either a request or reply. Note that you will have to briefly toggle on the red/yellow LEDs and then turn them off. The lighting of red/yellow LEDs should eventually disappear if your protocol is efficiently designed, i.e. no loops.
Your program should create this trace by logging all received packets while also printing each packet received by the basestation to the screen. Based on the number of received packets per request, we will be able to judge the efficiency of your protocol. For example, if there are 2 immediate neighbors to the basestation, then a flooded reply should only generate 2 reply packets arriving at the basestation.
Due date for the mini-project on the Motes is Oct. 30.
You need to request a metal key for the new room ECCS 102 from Stephanie Morris in ECOT 722. She will require you to fill out a form, which you then need to take down to the stadium to obtain the key. We should have the workstations, laptops, and Motes installed in the room by sometime tomorrow afternoon, ready for you to begin your programming assignments. If you want access to the 102 lab during Fall Break, you should obtain the keys either Wednesday morning or early afternoon.
Laptops
and Motes are available for you to build your flooding protocol
upon. Currently, we will be using ECCS 123, but may transition to
the PostPC lab in the new DLC building in mid-October. I will be
notifying CSOps to permit each student in the class to have card key
access to ECCS 123. This may take a few days. In the
meantime, you can begin by building code for the TinyOS simulator. However,
this simulator is confined to testing your code on a single Mote.
The simulator is not capable of testing the overall protocol distributed
across multiple Motes. For that, you will need the hardware
Motes. These Motes should be
shared, and we will provide a policy for sharing them at a later time.
More information on TinyOS can be found at:
We will be using the older version of TinyOS,
not the new version promised on Sept. 6. This has already been
installed for you on the laptops and desktop in ECCS 123. We
will be creating accounts on these Linux machines. Temporarily,
you should be able to login as username=sensornet,
password=sensornet and create your own subdirectory for your programming
assignment.. We intend to create individual accounts where
username=firstname, and password=lastname, all lowercase.
You should change the password after logging in. The installed TinyOS software
should be located in /usr/local/src/nest the home directory for the sensornet
user. Make a copy in your own directory.
A good place to start are the TinyOS tutorials available online at http://webs.cs.berkeley.edu/tos/support.html
Signing up for time slots to use the Motes in ECCS 102:
We'll be using a Yahoo Groups Calendar called sensornet_fall2002 to reserve time slots for the workstation/Motes in ECCS 102.
First, sign up for a Yahoo ID at www.yahoo.com.
Second, go to http://groups.yahoo.com/group/sensornet_fall2002 and click "Join This Group!". Fill out this form and click "Join". As moderator (rhan_sensornet@yahoo.com), I'll receive a message and will manually add you to the group. You might want to send me email at rhan@cs.colorado.edu to remind me to add you immediately. Otherwise, I'll check maybe once per day (forwarding can't be set up from the Yahoo account to my CU account).
Third, after I subscribe you, you should then receive an OK subscription message, and can then go back to the group Web link, then click on "Calendar" to reserve a time slot to use the Motes in ECCS 102. Since there are two workstations, then only two reservations should be made per time slot.
Rules for time slot reservation:
Though time slots can be reserved every half hour, you cannot sign up for more than a two hour block of time . You should also leave at least two hours between your previous reservation and your next reservation, to allow other students to work with either of the two Mote kits. And no more than four hours total reserved per day per student. Because of the limited # of workstations and time slots, I'd suggest you start EARLY.
Yahoo Group Calendar allows more than one reservation per time slot. Since there are two workstations, the first two reservations will constitute the reservations for the two workstations.
Reservations have priority over those who show up without reservations.
If the new batch of Motes arrive, we'll try to set up more workstations.
What to hand in:
In your account, you should leave a clearly identified directory like program1_flood_Motes/ that contains all of your code. I'll also set up times in early November for you to demonstrate your flooding protocol.
More details will be provided as the need arises.