Changes between Initial Version and Version 1 of Fair


Ignore:
Timestamp:
Sep 17, 2010, 11:36:56 AM (14 years ago)
Author:
ugus
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Fair

    v1 v1  
     1= FAIR- Resilient Data Aggregation Cookbook =
     2
     3This document includes instructions how to install and to run the resilient data aggregation protocol FAIR.
     4
     5
     6
     7[[PageOutline(2-3,Table of Contents,inline)]]
     8== Introduction ==
     9Irregularities occurred in a wireless sensor network may cause the data aggregation process to fail such that no response is provided by the sensor island. FAIR is a robust and secure data aggregation protocol that ensures continuity of service even in case of  attacks and hardware failures. Instead of requiring waiting for a failure free protocol run, FAIR uses a quality of information to indicate how many failures occurred and what quality can be expected from the response of sensor nodes. The response is then sent together with the quality of information to the initiator of the query. By looking at the quality of information and depending on the application scenario, the initiator of query decides to use the response of FAIR or not. The response can may ignored for example in a critical application if the quality of information is low. Having continuous service from a sensor island and the knowledge on the quality of data provides a great flexibility in wireless sensor network applications.
     10
     11== Architectural Overview ==
     12
     13The SENSEI architecture with a wireless sensor network (WSN) running the FAIR protocol is depicted in the figure below.
     14
     15[[Image(fair_arch.png, 40%, center)]]
     16
     17The architecture above is composed of three main components '''Sensei Framework, Gateway, and a WSN island'''.
     18
     19* Sensei Framework: This component represents the core SENSEI architecture.
     20* Gateway: This component interconnects the WSAN island with the SENSEI architecture by implementing RPI and RAI interfaces. RPI (Resource Publication) interface is used for publishing FAIR as a SENSEI resource in the resource directory (RD) of the SENSEI architecture. RAI (Resource Access) allows Resource Users to access the services of FAIR over Internet.
     21* WSN island: This is component is a sensor island running the FAIR protocol.
     22
     23== Installation ==
     24=== Hardware and Software Requirements
     25To install and run the FAIR protocol requires the following hardware tools and software packages:
     26
     27 * Linux PC
     28 * [http://docs.tinyos.net/index.php/Getting_started#Installing_TinyOS_2.1.1 TinyOS-2.1.1]
     29 * At least 3 TelosB sensor nodes
     30 * [http://localhost/trac/sensei/wiki/cpp_gatway C++ Gateway]
     31
     32We assume the installation PC is running a linux operating system has the [http://docs.tinyos.net/index.php/Getting_started#Installing_TinyOS_2.1.1 TinyOS-2.1.1] installed and configured properly. We skip the installation of TinyOS here. We describe the installation and configuration steps in the following for a Ubuntu operating system.
     33
     34For simplicity all required software packages are archived in to a single file. Please download it from [https://ncit-cluster.grid.pub.ro/trac/Sensei-WP5/export/1759/BillingPrivacy/Phase-3/pb_firefox_plugin.tar.g here] and extract in to the into e.g., {{{ ~/tmp}}} directory.
     35
     36{{{
     37$ cd ~/tmp
     38$ tar -xvf fair.tar.gz
     39}}}
     40
     41You will see three subdirectories {{{FAIR/CPP_GATEWAY, FAIR/FAIR_CPP_GATEWAY_PLUGIN, and FAIR/FAIR_WSN}}}.
     42 
     43
     44=== Compiling C++ Gateway
     45We need to install some packages prior to compilation of the C++ Gateway with FAIR support. Please install the following packages from the Ubuntu repository if you did not do already so. 
     46
     47{{{
     48$ sudo apt-get install gcc g++ libssl-dev libxml2-dev
     49}}}
     50
     51Sockets library also needs to be installed:
     52{{{
     53$ cd ~/tmp/FAIR/CPP_GATEWAY/lib/Sockets-2.3.6
     54$ make
     55$ sudo make install
     56}}}
     57
     58Now, you can compile the C++ Gateway including FAIR support by running the following commands:
     59
     60{{{
     61$ cd ~/tmp/FAIR/CPP_GATEWAY
     62$ make
     63}}}
     64
     65A successful compilation creates a binary file '''sensei-gateway''' which can be used for starting the gateway in the {{{ ~/tmp/FAIR/CPP_GATEWAY/bin}}} directory as shown below.
     66{{{
     67...
     68...
     69...
     70strip sensei-gateway
     71cp sensei-gateway ../bin
     72make[1]: Leaving directory `/home/ugus/tmp/FAIR/CPP_GATEWAY/src
     73}}}
     74
     75=== Installing FAIR on Sensor Nodes
     76Following installation process assumes a WSN that is composed of '''three''' TelosB sensor nodes. One of the sensor nodes will be used as the '''Aggregator node'''. This node will aggregate the sensor readings from other nodes and also implement the interface between FAIR and the C++ Gateway. Other two sensor nodes will be the '''Sensing nodes''' and be responsible for measuring the temperature and light level of the environment.
     77
     78 
     79The files implementing FAIR in TinyOS-2.1.1 for TelosB sensor platform is located in the FAIR_WSN directory. Please change into this directory
     80{{{
     81$ cd ~/tmp/FAIR/FAIR_WSN
     82}}}
     83
     84We will start with compiling the FAIR for sensing nodes. To do so, please plug-in one of the sensing nodes to the USB port on your machine.  If your TinyOS has been configured properly, you should be able to see the sensor node in the output of the motelist command as shown below.
     85{{{
     86$ motelist
     87Reference  Device           Description
     88---------- ---------------- ---------------------------------------------
     89M4AN7DJZ   /dev/ttyUSB0     Moteiv tmote sky
     90}}}
     91
     92This output shows that the sensor node is connected to the device '''/dev/ttyUSB0'''. Now, please run the following command to install the FAIR protocol for sensing nodes:
     93{{{
     94$ cd ~/tmp/FAIR/FAIR_WSN
     95$ make -f Makefile.Sensor telosb install.1 bsl,/dev/ttyUSB0
     96}}}
     97
     98The '''1''' in the '''install.1''' will give the '''ID = 1''' to this node in the network. ''''''install.X'''''' compiles a sensor node with '''ID = X'''.
     99'''Please compile each sensor node with a unique ID'''. Repeat the steps above for the other sensing nodes.
     100
     101In order to compile the Aggregator node with '''ID = 0''', please run the following command:
     102{{{
     103$ cd ~/tmp/FAIR/FAIR_WSN
     104$ make -f Makefile.Aggregator telosb install.0 bsl,/dev/ttyUSB0
     105}}}
     106
     107Please note that you can of course choose an another ID for the aggregation node. But, it should be '''unique''' for the whole network.
     108
     109=== Compiling Serial Forwarder
     110The Aggregator node will be the bridge between the Gateway and the WSN. The gateway will send its request to the WSN via the aggregator node. The response of the WSN to the gateway will be send via the aggregator node. The communication between the aggregator node and the gateway will be over the serial port.
     111
     112To enable the communication via the serial port, the serial forwarder application of TinyOS needs to be compiled.
     113To do so, please run the following command:
     114
     115{{{
     116$ cd ~/tmp/FAIR/FAIR_CPP_GATEWAY_PLUGIN/tinyos_lib/sf
     117$ make
     118}}}
     119
     120This will create a binary executable '''sf''' in the directory.
     121 
     122
     123== Running the Test Application ==
     124FAIR provides aggregation of the temperature and light values measured in the WSN as SENSEI resource. To run the demo, please start the C++ Gateway by giving the following commands in a console:
     125
     126{{{
     127$ cd ~/tmp/FAIR/CPP_GATEWAY
     128$ make
     129$ ./bin/sensei-gateway
     130}}}
     131
     132This will start the gateway which runs a http server at '''localhost:8000'''.
     133
     134Now, connect the '''Aggregator node''' on which you installed the FAIR protocol above to the USB port of the Gateway machine. Assuming that the Aggregator node is connected to the device '''/dev/ttyUSB0''', you can start the serial forwarder at port '''9002''' for TelosB motes as follows:
     135
     136{{{
     137$ cd ~/tmp/FAIR/CPP_GATEWAY/bin
     138$ ./sf
     139>> Starting sf-control.
     140>> Accepting commands on standard input...
     141start 9002 /dev/ttyUSB0 115200
     142}}}
     143
     144FAIR is now ready for providing its resources to the SENSEI resource users. The temperature and light resources can be accessed from the following URIs:
     145
     146 * Temperatur (in RDF format):   http://localhost:8000/fair/wsan/temp
     147 * Temperatur (in HTML format):  http://localhost:8000/fair/wsan/temp/html
     148 * Light (in RDF format):        http://localhost:8000/fair/wsan/light
     149 * Light (in HTML format):       http://localhost:8000/fair/wsan/light/html
     150
     151As an example, the responses of the light and temperature resources in HTML is shown in the figures below:
     152
     153Temperature:
     154
     155 [[Image(light_res_html.png, 50%, center)]]
     156
     157Light:
     158
     159 [[Image(temp_res_html.png, 50%, center)]]
     160
     161