Installing ns-3-dce

Date of writing: June 29, 2011
Warning: This document may get outdated surprisingly quickly.

This is a short guide to how to install ns-3-dce and how to compile the adjoining applications to test it. The instructions on how to compile the applications correctly is given in the comments section of the file src/dce/model/dce-manager.h . However, they are not very easy to find and not exhaustive. Also, the information on the ns3-dce portability page is also outdated.

Architecture: i386, Ubuntu 10.04.2 (LTS)
libc: 2.11.1

To find the libc version: Execute /lib/

Fetching and installing ns-3-dce

  1. Started with a fresh install of the operating system.
  2. sudo aptitude update
  3. sudo aptitude install build-essentials g++
    These are the prerequisites for compilation.
  4. sudo aptitude install mercurial bzr git-core
    These are the prerequisites for repository management.
  5. sudo aptitude install libc6-dbg
    The debug symbols are required for ns-3-dce.
  6. Following instructions on the ns-3-tutorial:
  7. Fetching ns-3-dce-old to complie:
  8. There are some functions which are not currently present in the libc-ns3 which are required to run iperf and other examples. To use these, we will need to patch the dce module. This is a culmination of thehajime's fix and some code written following Frederic's advice.
  9. After this, ns-3-dce-old can be compiled but we will get the kernel to compile it with support for the kernel's network stack.
  10. Configuring the system:
    ./waf configure --disable-python --with-linux-stack=../ns-3-linux
    The python bindings do not compile currently. The --prefix option can be used to change the default location of final installation.
  11. Building the system:
    ./waf build
  12. Install the system libraries:
    sudo ./waf install
    This puts the libraries by default in /usr/local/lib unless otherwise stated using the --prefix option during configuration.

Compiling iproute2

I will keep all the source code confined to the ˜/repos directory to make the relative references easier.

  1. cd ˜/repos
  2. wget
  3. tar xvf iproute2-2.6.33.tar.bz2
  4. cd iproute2-2.6.33
  5. sudo aptitude install bison flex
    Needed for compilation.
  6. sudo aptitude install libdb4.8-dev
    For dependence on db_185.h
    Apart from these, there are a few other parameters suggested in the file src/dce/doc/doc.rst, which were not required for execution on this system, but may be needed for others:
  8. ln -s /full/path/to/iproute2-2.6.33/ip/ip ../ns-3-allinone/ns-3-dce-old
    This is where ns-3-dce example dce-linux-simple expects the executable to be.

However, to get tc recompiled, it seems that you need to run bison by hand:

Compiling iperf

  1. cd ˜/repos
  2. Download source code for iperf to ˜repos and extract it and change directory.
  3. CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-pie ./configure
    The use of the parameters is as suggested above.
  4. make
  5. ln -s /full/path/to/iperf/src/iperf ../ns-3-allinone/ns-3-dce-old/build/debug/
    This is where ns-3-dce example dce-iperf expects the executable to be.

Compiling iputils

  1. cd ˜/repos
  2. wget
    Download the source code and then extract it.
  3. sudo aptitude install libsysfs-dev libssl-dev
    Required to compile arping and ping6. They provide sysfs/libsysfs.h and openssl/md5.h respectively.
  4. Edit Makefile and replace CFLAGS= with CFLAGS+=
    Options used here are explained above.
  6. ln -s /full/path/to/iputils/ping ˜/repos/ns-3-allinone/ns-3-dce-old/build/debug
    This is where ns-3-dce example dce-linear expects the executable to be.


If you get the error which looks like:

utkarsh@ns3-testbed:~/repos/ns-3-allinone/ns-3-dce-old$ LD_LIBRARY_PATH='/usr/local/lib/' ./build/debug/src/dce/example/dce-linux-simple
./build/debug/src/dce/example/dce-linux-simple: relocation error: /lib/tls/i686/cmov/ symbol __pthread_once, version GLIBC_2.0 not defined in file with link time reference

Then, try to run the programs with LD_LIBRARY_PATH='/lib/:/usr/local/lib/. This could have happened because the path to glibc might have changed to the Thread Local Support libraries (/lib/tls/), which apparently do not play well with the ELF loader. Reverting to the normal libraries in /lib should fix this issue.

Running with GDB

Mathieu recommends running the CVS version of Gdb with ns-3-dce in /src/dce/doc/dce.rst. He also has this very useful advice therein:

If you use gdb (a CVS or stable version), do not forget to execute the following command prior to running any DCE-based program:::

  (gdb) handle SIGUSR1 nostop
  Signal        StopPrintPass to programDescription
  SIGUSR1       NoYesYesUser defined signal 1

An alternate way to do this and avoid having to repeat this command ad-nauseam involves creating a .gdbinit file in your ns-3-dce directory and putting this inside:

handle SIGUSR1 nostop

Running the examples

For all these examples, the LD_LIBRARY_PATH should be set as /usr/local/lib. The output of the processes is stored in the files produced in the folders $files-\left\{ 0, 1 \right\}$ have the output logs of the processes.

  1. ip: ./build/debug/src/dce/examples/dce-linux-simple
    This example also loads the Kernel stack. The execution takes about 4 minutes. The output produced in the folders files{0,1} and is as expected from src/dce/doc/doc.rst

  2. iperf: ./build/debug/src/dce/examples/dce-iperf
    This examples does not seem to terminate, though the output produced in the folders files{0,1} indicate that the iperf processes are started properly on both the client and the server nodes, but no messages are produced.

  3. ping: Running ping is slightly more complicated: This executes fairly quickly.

See also: Using MTCP kernel inplace of the usual kernel stack.

Back to Home

musically_ut 2014-04-03