[Ns-developers] user-space code integration update

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Tue Aug 5 16:53:15 PDT 2008


hi,

Recently, I resumed work on the ns-3-simu branch with a focus towards
helping liu merge his code back into ns-3 and starting to port quagga.
The biggest change in http://code.nsnam.org/mathieu/ns-3-simu is that I
added support for loading in memory unmodified executables with an elf
loader and running them over ns-3. This is implemented in the
src/process/elf-loader.h|cc files through a bunch of tricks to force the
libc elf loader to load the same binary multiple times in memory.

I also added a lot of code to the libc replacement and have gotten
sufficiently far to run the example programs in examples/process.cc and
examples/process-udp-server.cc and examples/process-udp-client.cc. 

The summary is that you can write code such as:
http://code.nsnam.org/mathieu/ns-3-simu/file/fa3ab215a4b1/examples/process-udp-client.cc
http://code.nsnam.org/mathieu/ns-3-simu/file/fa3ab215a4b1/examples/process-udp-server.cc

which compiles as normal executables:
mathieu at ns-test:~/code/ns-3-simu
$ ./build/debug/examples/process-udp-server &
[1] 18125
mathieu at ns-test:~/code/ns-3-simu
$ ./build/debug/examples/process-udp-client localhost
send 1001 bytes
got bytes n=1001
[1]+  Done                    ./build/debug/examples/process-udp-server
mathieu at ns-test:~/code/ns-3-simu$

but which can also be executed within ns-3 itself through the simulation
script:
http://code.nsnam.org/mathieu/ns-3-simu/file/fa3ab215a4b1/examples/process.cc

The output, is quite similar:

mathieu at ns-test:~/code/ns-3-simu$ ./build/debug/examples/process 
send 1001 bytes
got bytes n=1001
mathieu at ns-test:~/code/ns-3-simu$ 

What are the next steps ?
-------------------------

1) need to figure out some c++ initialization problems which make it
impossible to load a c++ program in ns-3 for simulation.

2) need to test the code on more platforms. Right now, the code runs on
my x86-64 ubuntu 7.10 system. I tested it on a fedora 9 32bit x86 system
and on an ubuntu 8.04 x86 32 bit system. I have got reports that it does
not work on debian sid and on fedora 8. Need to setup test systems for
that.

3) figure out a practical plan to go forward with liu's code and quagga.

What will not work and what might work:
---------------------------------------

This code will not work on win32 or osx and I have no plans to add the
code needed to make it work there (patches welcome, though). It could be
made to work on solaris and, more generally, any reasonable elf unix
system (I suspect it won't work on aix) but, clearly, my main target is
linux elf x86 and x86-64.

Mathieu



More information about the Ns-developers mailing list