For those with all the proper dependencies installed (see below) NOX can be configured and built using standard autoconf procedure:
mkdir nox cd nox git clone git://noxrepo.org/openflow git clone git://noxrepo.org/noxcore cd noxcore/ ./boot.sh mkdir build/ cd build/ ../configure --with-python=`which python2.5` make make check
If building from the source tarfile, you don’t need to run boot.sh.
It is not absolutely necessary that you build with Python, though we highly recommend it.
By default, NOX builds with C++ STL debugging checks, which slows down execution speeds by at least a factor of 10. For an optimized build, you’ll want to turn this off:
./configure --with-python=`which python2.5` --enable-ndebug
Once compiled, the nox_core binary will be built in the src/ directory. Note that nox_core must be run from the src/ build directory, and that the build directory must not be moved to a different place in the file system. You can verify that it has built properly by printing out the usage information:
cd src/ ./nox_core -h
If you’ve gotten this far, then you’re ready to test your build (Testing your build) or get right to using it (Using NOX).
The NOX team’s internal development environment is standardized around Debian unstable. While we test releases on other Linux distributions (CentOS, Fedora, Gentoo, Ubuntu), FreeBSD and NetBSD, using Debian unstable is certain to provide the least hassle.
NOX relies on the following software packages. All are available under Debian as apt packages. Other distributions may require them to be separately installed from source:
For Twisted Python support (highly recommended) the following additional packages are required.
The user interface (web management console) requires
Warning
Older versions of swig may have incompatibilities with newer gcc/g++ versions. This is known to be a problem with g++4.1 and swig v1.3.29
You may also wish to install libpcap (http://tcpdump.org) for testing and debugging though it isn’t strictly necessary.
The following options are commonly used in NOX configuration. Use ./configure —-help for a full listing:
--with-python=[yes|no|/path/to/python] This will build NOX with support for Twisted Python bindings. Many NOX applications require Twisted support and it provides the simplest API for new developers. We highly recommend building NOX with Twisted for new users.
--enable-ndebug This will turn off debugging (STL debugging in particular) and increase performance significantly. Use this whenever running NOX operationally.
--with-openflow=/path/to/openflow Provide NOX with a path to the OpenFlow source tree. This only needs to be done if you want to compile against a different version than is included with the NOX distribution (see src/include/openflow/openflow.h).
Debian unstable:
NOX should compile with the following packages:
apt-get install autoconf automake1.10 g++-4.2 gcc-4.2 libboost-dev libtool libboost-filesystem-dev libpcap-dev libssl-dev make python-dev python-twisted swig libxerces-c2-dev libboost-serialization-dev python-mako libboost-test-dev openssl python-simplejson python-openssl
Fedora Core 8:+
From a standard development install, you can build after installing the following packages:
yum install xerces-c-devel python-twisted libpcap-devel
Gentoo 2008.0-rc1
To compile without twisted python you’ll need the following packages:
- emerge -av boost - emerge -av xerces-c
OpenSUSE 10.3 :
The boost distribution that comes with OpenSuse is too old. You’ll have to install this from the source:
To build NOX (with twisted python) you’ll have to installed the following packages from a base install:
gcc gcc-c++ make libXerces-c-27 libXerces-c-devel libpcap-devel libopenssl-devel swig sqlite-devel python-devel python-twisted python-curses
Mandriva One 2008:
NOX compiled on Mandriva with the following packages installed:
libboost-devel boost-1.35.0 libxerces-c-devel libopenssl0.9.8-devel libsqlite3-devel libpython2.5-devel python-twisted swig-devel
If the swig and swig-devel packages are not available from the repository, you will have to build swig from source.
CentOS 5:
From the standard development install you need to install the following packages from source
Warning
NOX relies heavily on loading shared librares which can cause problems if SELinux is enabled, resulting in the following error:
lt-nox: error while loading shared libraries: ..../libvigil.so.0: cannot restore segment prot after reloc: Permission denied
To deal with this you’ll either have to disable SELinux in /etc/selinux/config (SELINUX=disabled), or change the default security context of each shared library
chcon -t texrel_shlid_t /path/to/.so
Warning
Be sure to add /usr/local/lib to ld.so.conf and run ldconfig once python is installed
You can verify that NOX built correct by running:
make check
From the build directory. Unittests can be run independently through the test application:
cd src ./nox_core tests
As a simple example, if you’ve compiled with Twisted try running packetdump using generated traffic:
cd src/ ./nox_core -v -i pgen:10 packetdump
This should print out a description of ten identical packets, and then wait for you to terminate nox_core with ‘Ctrl-c’.
There currently is no simple way to test the build if it was not compiled with Python support, besides running it (Using NOX).