Introduction

SWAT (Stanford Wireless Analysis Tool) is a software tool that automates gathering and analysis of network measurements. SWAT provides an interface for configuring experimental parameters in a network. It collects raw packet statistics such as the received signal strength and chip error, and provides modules for calculating and visualizing various metrics derived from these statistics.

SWAT is an open-source, platform-independent tool. The user interface portions and the communication interface between SWAT and the wireless sensor network uses Python. Platform-specific code that runs on the sensor motes is written in nesC, an extension to the C programming language for TinyOS. We use SQL to create the database, making it easy to execute custom queries. The computation intensive component of SWAT is the metric calculation. It consists of a number of python programs, each responsible for computing one metric. SWAT is extensible so users can write their own python modules.

Install SWAT for 802.15.4
Install SWAT for 802.11
Install SWAT for both 802.15.4 and 802.11


Why use SWAT?

Benefits of SWAT include, but are not limited to, the following:
  • A user interface makes running tests and gathering metrics easy, without getting into code intricacies
  • Allows researchers to identify and calculate new metrics relevant to specific protocols
  • The insights provided by SWAT enable deeper understanding of protocol behavior
  • Link layer statistics help identify failure points and causes in the network
  • A better description of link behavior provides better protocol performance indicators
  • Enables meaningful comparison of protocols across different environments.
  • Automated collection and storage of network data makes sharing of data with the community easier
  • SWAT metrics may be used as simulation parameters to enable test repeatability
  • Allows users to observe low level charactistics of a network, giving further insight into its behaviors
  • Currently, only highlevel metrics such as throughput and latency are measured
  • Testbeds and actual deployments with similar metric values show performance variations
  • Observing lower level metrics is important to better understand these variations
  • Will help facilitate future protocol design
  • Extensible, opensource framework for characterizing lowlevel wireless network properties
  • Easily visualize network behavior at the physical and link layers

  • How it works

    SWAT allows researchers to easily gather network data, distill that data into relevant metrics, and visually display the results.

  • Enter configuration parameters, testbed information and desired reports
  • Users specify the experimental parameters through a configuration UI. These parameters define the settings for which packet and link data will be collected. They include link-layer type (802.15.4/802.11), node list, number of packets, inter-packet interval, type of transmission i.e. broadcast or unicast, CSMA on/off, channel, transmission power, link layer acknowledge-ments on/off, link layer retransmissions on/off (for uni-casts), maximum retransmission count, bit rate (for 802.11), noise sampling on/off and noise sampling rate.

  • SWAT runs the experiment for you
  • SWAT uses the appropriate interface to program the nodes, send commands and receive packet statistics through a wired or wireless back-channel. SWAT stores the collected data into a database using an SQL server

  • SWAT calculates the metrics and displays the reports
  • The reporting UI component allows users to specify which of the supported metrics they would like to calculate from the stored data. SWAT creates reports that consist of the experimental parameters, computed metrics and pertinent figures. Currently, supported metrics include packet delivery temporal and spatial correlations, noise floor distribution, received signal strength to reception ratio correlation, link asymmetries, and reception ratio distribution over time.

    Stanford Information Networks Group Stanford Information Networks Group Stanford Information Networks Group Stanford Information Networks Group

    Installing swat for 802.11

    Minimum System Requirements

  • Linux OS on host machine
  • We tested on Linux version 2.6.25.17
  • OpenWRT or Linux OS on 802.11-communicating nodes
  • Python 2.5
  • Matplotlib module
  • MySQLdb module
  • MySQL 5.0
  • networkx, pygraphviz, and graphviz
  • Instructions

    On your host machine:
  • Download the SWAT software package using the link located below. Extract the files.
  • Create a public-private key (unless you already have one) using ssh-keygen
  • put the private key on each of the nodes and the public key on the host machine (in the .ssh folders).
  • Download and extract installation.tar.gz. There should be two files of the form "installation-*"
  • If you want OpenWRT running on the nodes,
    • Download the OpenWRT source code at http://openwrt.org
    • Extract the source code from the tar file
    • Download swat_cfg_pkg.tar.gz
    • Move the tar file into the OpenWRT root directory, and execute "tar -zxf swat_cfg_pkg.tar.gz"
    • You might need to install additional packages. In most cases, you can easily find the package that's missing, but there are a few that are hard to find:
      • check that you have installed the "build-essential" package
      • ncurses: install "libncurses5-dev"
      • GNU awk: install "gawk"
      • zlib: install "zlib1g-dev"
    • In the OpenWRT root directory, execute "make menuconfig"
    • The kernel image is in the bin directory; copy it to the nodes and install the OS
  • If the nodes run regular OSes,
  • Run installation-node with a file, containing data of the form "user@hostname" separated by newlines representing the 802.11 nodes, as the first parameter, and the path to the ssh key on the host machine as the second parameter
  • Run installation-client with the path to the SWAT software package root directory as the first parameter.
  • Install all required python and MySQL packages. Instructions are located below

  • Installing swat for 802.15.4

    Minimum System Requirements

  • Linux OS on host machine
  • We tested on Linux version 2.6.25.17
  • TinyOS 2.0.2 on 802.15.4-communicating motes
  • Python 2.5
  • Matplotlib module
  • MySQLdb module
  • MySQL 5.0
  • networkx, pygraphviz, and graphviz
  • Instructions

  • Download the SWAT software package using the link located below. Extract the files.
  • Install all required python and MySQL packages. Instructions are located below

  • Installing swat for both 802.15.4 and 802.11

    Minimum System Requirements

  • you need to meet the requirements of both 802.15.4 and 802.11
  • Instructions

  • Follow the 802.11 instructions

  • Installing the required packages and creating the SWAT database

    To install the MySQL packages on Linux, open a terminal and type the following:

  • sudo apt-get install mysql-client
  • sudo apt-get install mysql-server
  • sudo apt-get install python-mysqldb (This is the the MySQLdb module for mySQL/Python integration)
  • To create the SWAT database on Linux, open a terminal and type the following:

  • sudo mysql (Once this is done, you should see the MySQL command prompt)
  • CREATE DATABASE swat;
  • Instructions to install the other required packages:

  • Extract the tar file of the latest version of pygraphviz from source. In the resulting folder, execute "python setup.py"
  • Extract networkx.tar.gz and in the networkx folder, execute "python setup.py"
  • Install the graphviz development files from the synaptic package manager

  • Running Experiments

  • Start the MySQL database
  • You must make swat the active database before every run. To do this, open a terminal and type the following:
  • sudo mysql (you should see the MySQL command prompt)
  • USE swat;
  • Start the SWAT backend server
  • Open a terminal and run "python webserver.py" from the /swat-code/ui directory
  • Open a webrowser and go to localhost:8080
  • Configure the experiment parameters (or select a previous configuration) and report options
  • Have the node text file ready which includes the node ports and the respective IDs
  • Start the experiment

  • Downloads



    Resources


    SWAT Team

    1. Kannan Srinivasan
    2. Maria Kazandjieva
    3. Mayank Jain
    4. Jung Il Choi
    5. Edward Kim
    6. Philip Levis (faculty)
    7. Juan Batiz-Benet
    8. Jonathan Chu

    Contact

    support4swat[at]lists[dot]stanford[dot]edu