[Ns-developers] user-space code integration update
Raj Bhattacharjea
raj.b at gatech.edu
Wed Aug 6 12:13:59 PDT 2008
On Tue, Aug 5, 2008 at 7:53 PM, Mathieu Lacage
<mathieu.lacage at sophia.inria.fr> wrote:
> 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
When this branch is eventually merged into ns-3-dev, if we ship this
type of "example", we need to identify a different place to put this
kind of code, since it uses native system/socket APIs, and is in fact
not an ns-3 example at all, but a sockets programming example.
Perhaps an examples sub-directory with an appropriate name could be
chosen in the future.
>
> 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.
AFAIK we've never stated what ns-3's supported platforms should be,
only what it works on now. Since our stated "supported" platforms in
the README include cygwin and Mac OS X at present, it'd be great to
have the binary-loader code work for these eventually. Do you foresee
any insurmountable hurdles to making this kind of binary-loader and
real code integration for these other systems?
--
Raj Bhattacharjea
Georgia Institute of Technology
School of Electrical and Computer Engineering
Systems Analyst
404.894.2955
More information about the Ns-developers
mailing list