Cookbook for Your First Directed Diffusion on ISI WSN Testbed


Introduction

In this page you will find a detailed example of running a directed diffusion sample application on our testbed. We assume that the user already has an ISI account and has nodes 22 and 36 assigned to him, as briefly stated in our guideline page.

Build directed diffusion binaries

Check out the diffusion source code from scadds cvs repository.

>$ mkdir cvs
>$ cd cvs
>$ cvs co microteers/diffusion3

After reading the README file accompanying the source code files, you can build the binaries as simple as

>$ cd microteers/diffusion3
>$ make

In this example, there are 4 executable files to be installed on pc104 nodes:

·        “diffusion”:        main diffusion routing module.

·        “apps/gradient”:  routing module using gradient

·        “apps/agent1”: sample sink application

·        “apps/agent2”: sample source application

Install binaries to pc104 testbed

Check out your own copy of linux distribution on testbed.

>$ mkdir ~/pc104
>$ cd ~/pc104
>$ rsync-pc104 co

After these steps, there should be an image of the default PC-104 file system that looks like:
~/pc104/{bin, boot, etc, lib, sbin, usr}

Copy all the binaries to the appropriate places in the distribution.

>$ cp ~/cvs/microteers/diffusion3/diffusion ~/pc104/bin
>$ ……
>$ cp ~/cvs/mictoeers/diffusion3/apps/agent{1,2} ~/pc104/bin

Once you copy all the binaries you want, you commit your personalized distribution by doing:
>$ cd /pc104
>$ rsync-pc104 ci

Restart nodes to load the new code

You can reboot node 22 and node 36 remotely from scadds.isi.edu

>$ rsh –l root scadds22 /sbin/reboot
>$ rsh –l root scadds36 /sbin/reboot

Start the application using telnet or rsh

You can telnet to node 22 and node 36 to interactively running the applications

>$ telnet scadds22

login: root
scadds22>$ diffusion&; gradient&; agent2;

Alternatively, you can also start the applications unsing rsh

>$ rsh –l root scadds36 /bin/diffusion

>$ rsh –l root scadds36 /bin/gradient

>$ rsh –l root scadds36 /bin/agent1

You may see that the source node 36 periodically sending out simulated sensor data, and the sink application at node 22 receive those data in this single hop network. You can also start diffusion/gradient/agent{1,2} in different terminals to see the interactions between diffusion routing modules.

Start the application automatically

As an example, you can put the following in /usr/bin/userapp.sh

diffusion&
gradient&
if [ $ID == “22” ]; then
agent1 &
fi
if [ $ID == “36” ]; then
agent2 &
fi



Last modified by Jerry Zhao: 1/2/2002