{{{#!comment [[Include(wiki:802.11/beta-note)]] }}} [[TracNav(802.11/TOC)]] = 802.11 Reference Design: Experiment Framework Setup = The basic steps to setup and use the 802.11 Reference Design Experiments Framwork are listed below, and explained in detail in the following sections. 1. Install a suitable version of Python 1. Install the wlan_exp Python package 1. Configure and connect WARP v3 nodes via Ethernet 1. Test the hardware and setup There are two sets of instructions below- one for Python beginners, one for Python experts. == For Python Beginners == New Python users should start with the [https://store.continuum.io/cshop/anaconda/ Anaconda Scientific Python Distribution] from [http://www.continuum.io/ Continuum Analytics]. This distribution bundles known-good versions of Python, third-party packages for data processing and great IDE tools. The installers for Mac OS X, Windows and Linux are available on the '''[http://continuum.io/downloads Anaconda downloads page]'''. We strongly recommend a 64-bit Python installation to fully utilize the 802.11 Reference Design logging framework. A 32-bit Python cannot handle the large log files generated by nodes during long experiments. The Anaconda Mac OS X distribution is always 64-bit. If your Windows PC and OS is 64-bit, you should use the 64-bit Anaconda distribution. == Install wlan_exp Package == A core component of 802.11 Reference Design Experiments Framework is the wlan_exp Python package. You must use a wlan_exp version that matches the 802.11 Reference Design version running in your WARP v3 nodes. We '''strongly recommend''' using the wlan_exp package bundled in the reference design .zip archive. This version of the package is tested with the C code, FPGA designs and pre-compiled bitstreams bundled in the same release. The wlan_exp package is located in the '''/Python_Reference''' folder in the reference design .zip archive. To install the wlan_exp package in your Python environment: 1. Launch the Spyder IDE in your Anaconda installation (Start Menu -> Anaconda (64-bit) -> Spyder) 1. Select Tools -> PYTHONPATH Manager 1. If the PYTHONPATH window shows any existing '''wlan_exp''' entries, remove them 1. Click Add 1. Navigate to the '''wlan_exp''' folder in the expanded reference design archive (for example "C:\work\Mango_802.11_RefDes_v0.9_beta\Python_Reference\wlan_exp") 1. Click Select Folder 1. Click Synchronize, then Yes 1. Click Close == Configure and Connect WARP v3 Nodes == The 802.11 Reference Design Experiments Framework communicates with WARP v3 nodes via Ethernet. Your PC (with Python and the wlan_exp package) and all WARP v3 nodes must be connected to the same Ethernet switch. We recommend using a dedicated NIC for wlan_exp experiments. This NIC should have a static IP address in the 10.0.0.x subnet. This is the same recommended setup as for WARPLab. '''Ethernet Setup:''' 1. Set your PC NIC IP address to 10.0.0.250 and subnet mask to 255.255.255.0 1. Connect the NIC to a 1Gb Ethernet switch 1. Connect '''ETH_B''' of each WARP v3 node to the same switch '''Important:''' do '''not''' connect '''ETH_A''' of multiple WARP v3 nodes to the same switch. The 802.11 Reference Design wired-wireless portal will attempt to bridge ETH_A to the wireless interface. Mixing this behavior with wlan_exp traffic will have unpredictable results. '''Nodes Configuration:''' 1. If you have one WARP v3 node, configure this node as an 802.11 AP using the AP bitstream from the Bitstream_Reference folder 1. If you have multiple WARP v3 nodes, configure one as an AP (AP bitstream) and the rest as stations (STA bitstream) '''Testing the Setup:''' 1. Launch a Python shell (Start Menu -> Anaconda (64-bit) -> Anaconda Command Prompt) 1. Change directory to the Python_Reference/Examples folder ({{{cd C:\work\Mango_802.11_RefDes_v0.9_beta\Python_Reference\examples}}}) 1. Run the blink_node_leds.py example: {{{python blink_node_leds.py}}} All of your WARP v3 nodes should blink their green LEDs for 5 seconds. ---- == For Python Experts == The wlan_exp package requires '''Python 2 (version 2.7.5 or later)''' or '''Python 3 (version 3.3.5 or later)'''. Most functions of the wlan_exp package only require the Python standard library. These functions include node initialization, control, monitoring and retrieval of log data. The wlan_exp package supports Python 2.7+ and 3.3+. A 32-bit Python installation will work for all wlan_exp usage '''except''' processing large (multi-gigabyte) log files. When possible we recommend a 64-bit installation. Some of the log parsing utilities and examples use third-party packages. To run all of our examples, your Python installation must have: * NumPy (version 1.8 or later) * Pandas (version 0.13 or later) * matplotlib (version 1.3.1 or later) * h5py (version 2.2 or later) In our testing the wlan_exp examples that use these packages work in both Python 2.7 and 3.3. ---- '''OLD''' == Quick Start == * Install a suitable Python distribution (may be already be installed on your PC; see below) * Download the 802.11 Reference Design Python packages and examples from the repository: [browser:/ReferenceDesigns/w3_802.11/python /ReferenceDesigns/w3_802.11/python] * Choose an example script ([source:/ReferenceDesigns/w3_802.11/python/warpnet_example_wlan_throughput.py warpnet_example_wlan_throughput.py] for example) * Edit the script header to match your setup (IP address of your PC and serial numbers of your WARP nodes) * Connect ETH_B of each WARP v3 node to the same gigabit Ethernet switch as your PC * Open a terminal to the directory containing the example script * Run the script with Python; for example {{{python warpnet_example_wlan_throughput.py}}} == System Requirements == * '''802.11 Reference Design''': warpnet support was added to the reference design in v0.8. * '''Python''': the warpnet framework supports both Python 2 (2.7+) and Python 3 (3.3+). No third-party Python packages are required. See the Python recommendations below for more details. * '''Connectivity''': the framework requires the host PC and every WARP v3 node be connected to a common gigabit Ethernet switch. We recommend you use a dedicated NIC on your PC to avoid superfluous traffic on the experimental network. The WARP v3 nodes must use their '''ETH B''' interfaces for wlan_exp. * '''WARP v3 hardware''': warpnet requires at least one WARP v3 node running the 802.11 Reference Design. The framework supports up to 253 nodes. == Python Versions == The warpnet framework supports Python 2 (2.7.4+) and Python 3 (3.3+). The core warpnet and wlan_exp scripts require only the core Python packages. We have tested the framework and example scripts using the operating systems and Python distributions listed below. '''Mac OS X''' * Python 2.7.4 bundled with Mac OS X 10.9 Mavericks * Python 2.7.5 in [https://code.google.com/p/spyderlib/wiki/Installation Spyder] * Python 2.7.6 in [http://continuum.io/downloads Anaconda] '''Windows''': * Python 2.7.6.2 (64 bit) in [http://winpython.sourceforge.net/ WinPython] * Python 3.3.3.2 (64 bit) in [http://winpython.sourceforge.net/ WinPython] === Useful Packages === * '''[https://code.google.com/p/spyderlib/ Spyder]''': this IDE for Python code development is extremely useful when editing code / developing scripts. Besides automatic syntax checking / highlighting, it integrates the python and ipython consoles to allow interactive debug of code. * '''[http://ipython.org/ ipython]''': this interactive Python environment is great for testing experiment scripts and exploring experiment results. Many integrated Python distributions (Anaconda, Spyder, WinPython, etc) integrate the ipython shell. * '''numpy''': Some of the wlan_exp_log examples use [http://www.numpy.org/ numpy 1.7] for processing large arrays of node log entries. numpy is included in many Python distributions. You can check by running this on your command line: {{{python -c "import numpy; print numpy.version.version"}}}. This will print a version number if numpy is installed or an error if it is not. Our examples assume numpy 1.7 or later. * '''pandas''': The pandas library provides some very useful tools for dealing with large datasets, especially those where time is a dimension (like log entries).