Running iperf with ns-3-dce

373 views
Skip to first unread message

musically_ut

unread,
Jun 16, 2011, 1:38:45 PM6/16/11
to ns-3-users
Hi,

I have been trying to run 'iperf' with ns-3-dce and I am stuck at the
following problem:

------------------------------------------
utkarsh@ns3-testbed:~/repos/ns-3-allinone/ns-3-dce-old$
LD_LIBRARY_PATH=/usr/local/lib/ ./build/debug/src/dce/example/dce-
iperf
assert failed. cond="handle != 0", msg="Could not open elf-cache/0/
iperf elf-cache/0/iperf: symbol sscanf, version GLIBC_2.0 not defined
in file 0001.so.6 with link time reference", file=../src/dce/model/
cooja-loader-factory.cc, line=218
terminate called without an active exception
Aborted
------------------------------------------

This is using the 'mathieu/ns-3-dce-old' branch.

I have been fixing various symbol calls using Hajime's advice:
http://groups.google.com/group/ns-3-users/browse_thread/thread/a4675fec0d7a285f/

However, I do not know how to resolve the call to 'sscanf' function.

Any help?

~
ut.

PS: Hajime's branch 'thehajime/ns-3-dce-quagga-umip' fails to compile
with the following error:

------------------------------------------

[1063/1519] cxx: src/dce/model/linux-socket-fd-factory.cc -> build/
debug/src/dce/model/linux-socket-fd-factory_1.o
../src/dce/model/linux-socket-fd-factory.cc: In member function ‘bool
ns3::LinuxSocketFdFactory::CheckFd(SimSocket*)’:
../src/dce/model/linux-socket-fd-factory.cc:750: error: ‘struct
SimExported’ has no member named ‘sim_check_socket_fd’
Waf: Leaving directory `/home/utkarsh/repos/ns-3-allinone/ns-3-dce-
quagga-umip/build'
Build failed: -> task failed (err #1):
{task: cxx linux-socket-fd-factory.cc -> linux-socket-fd-factory_1.o}
------------------------------------------

Frederic Urbani

unread,
Jun 17, 2011, 4:25:51 AM6/17/11
to ns-3-...@googlegroups.com

However, I do not know how to resolve the call to 'sscanf' function.

Any help?

~
ut.

PS: Hajime's branch 'thehajime/ns-3-dce-quagga-umip' fails to compile
with the following error:

------------------------------------------

[1063/1519] cxx: src/dce/model/linux-socket-fd-factory.cc -> build/
debug/src/dce/model/linux-socket-fd-factory_1.o
../src/dce/model/linux-socket-fd-factory.cc: In member function �bool
ns3::LinuxSocketFdFactory::CheckFd(SimSocket*)�:
../src/dce/model/linux-socket-fd-factory.cc:750: error: �struct
SimExported� has no member named �sim_check_socket_fd�
Waf: Leaving directory `/home/utkarsh/repos/ns-3-allinone/ns-3-dce-
quagga-umip/build'
Build failed:  -> task failed (err #1):
	{task: cxx linux-socket-fd-factory.cc -> linux-socket-fd-factory_1.o}
------------------------------------------

NS3 DCE catch call to libc and should simulate every symbol of libc , but as libc is big not all symbols are present for now,

If you need do add a symbol follow this little guide:

for example to add sscanf emulation first look the man to have the good function prototype :

$ man sscanf

������ int sscanf(const char *str, const char *format, ...);

Then add a function pointer to the same prototype in the struct Libc in the file model/libc.h :

��� int (*sscanf_fn) (const char *str, const char *format, ...);

in file libc.c add the function like the real one :

int sscanf(const char *str, const char *format, ...)
{
� va_list ap;
� va_start (ap, format);
� int retval = glibc.sscanf_fn( str, format, ap);
� va_end (ap);
� return retval;��� ���
}


then in libc-dce.c affect the dce implementation of the new method :

libc->sscan_fn = vsscanf;

In this example sscanf is a function that do not have possible interraction with the simulation world, the implementation
�is done by calling the real vsscanf (not sscanf because of va_list ...).
But for example if you call socket function the implementation is dce_socket with interract much with NS3 simulate world and is more difficult to implement :)

That's All.

-- Frederic

musically_ut

unread,
Jun 17, 2011, 4:48:22 AM6/17/11
to ns-3-users
On Jun 17, 10:25 am, Frederic Urbani <frederic.urb...@inria.fr> wrote:
> On 06/16/2011 07:38 PM, musically_ut wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I have been trying to run 'iperf' with ns-3-dce and I am stuck at the
> > following problem:
>
> > ------------------------------------------
> > utkarsh@ns3-testbed:~/repos/ns-3-allinone/ns-3-dce-old$
> > LD_LIBRARY_PATH=/usr/local/lib/ ./build/debug/src/dce/example/dce-
> > iperf
> > assert failed. cond="handle != 0", msg="Could not open elf-cache/0/
> > iperf elf-cache/0/iperf: symbol sscanf, version GLIBC_2.0 not defined
> > in file 0001.so.6 with link time reference", file=../src/dce/model/
> > cooja-loader-factory.cc, line=218
> > terminate called without an active exception
> > Aborted
> > ------------------------------------------
>
> > This is using the 'mathieu/ns-3-dce-old' branch.
>
> > I have been fixing various symbol calls using Hajime's advice:
> >http://groups.google.com/group/ns-3-users/browse_thread/thread/a4675f...
>
> > However, I do not know how to resolve the call to 'sscanf' function.
>
> > Any help?
>
> > ~
> > ut.
>
> > PS: Hajime's branch 'thehajime/ns-3-dce-quagga-umip' fails to compile
> > with the following error:
>
> > ------------------------------------------
>
> > [1063/1519] cxx: src/dce/model/linux-socket-fd-factory.cc ->  build/
> > debug/src/dce/model/linux-socket-fd-factory_1.o
> > ../src/dce/model/linux-socket-fd-factory.cc: In member function �bool
> > ns3::LinuxSocketFdFactory::CheckFd(SimSocket*)�:
> > ../src/dce/model/linux-socket-fd-factory.cc:750: error: �struct
> > SimExported� has no member named �sim_check_socket_fd�
> > Waf: Leaving directory `/home/utkarsh/repos/ns-3-allinone/ns-3-dce-
> > quagga-umip/build'
> > Build failed:  ->  task failed (err #1):
> >    {task: cxx linux-socket-fd-factory.cc ->  linux-socket-fd-factory_1.o}
> > ------------------------------------------
>
> NS3 DCE catch call to libc and should simulate every symbol of libc ,
> but as libc is big not all symbols are present for now,
>
> If you need do add a symbol follow this little guide:
>
> for example to add *sscanf* emulation first look the man to have the
> good function prototype :
>
> $ man sscanf
>
>         int sscanf(const char *str, const char *format, ...);
>
> Then add a function pointer to the same prototype in the struct Libc in
> the file model/libc.h :
>
>      int (*sscanf_fn) (const char *str, const char *format, ...);
>
> in file libc.c add the function like the real one :
>
> int sscanf(const char *str, const char *format, ...)
> {
>    va_list ap;
>    va_start (ap, format);
>    int retval = glibc.sscanf_fn( str, format, ap);
>    va_end (ap);
>    return retval;
>
> }
>
> then in libc-dce.c affect the dce implementation of the new method :
>
> libc->sscan_fn = vsscanf;
>
> In this example sscanf is a function that do not have possible
> interraction with the simulation world, the implementation
>   is done by calling the real vsscanf (not sscanf because of va_list ...).
> But for example if you call socket function the implementation is
> dce_socket with interract much with NS3 simulate world and is more
> difficult to implement :)
>
> That's All.
>
> -- Frederic

Thanks for the succinct guide!

I'll try this path and post the results back.

~
Ut

musically_ut

unread,
Jun 18, 2011, 2:06:19 PM6/18/11
to ns-3-users
On Jun 17, 10:48 am, musically_ut <musically...@gmail.com> wrote:
> On Jun 17, 10:25 am, Frederic Urbani <frederic.urb...@inria.fr> wrote:
>
>
>
>
>
>
>
>
>
> > On 06/16/2011 07:38 PM, musically_ut wrote:
>
> > > Hi,
>
> > > I have been trying to run 'iperf' with ns-3-dceand I am stuck at the
> > NS3DCEcatch call to libc and should simulate every symbol of libc ,
> > but as libc is big not all symbols are present for now,
>
> > If you need do add a symbol follow this little guide:
>
> > for example to add *sscanf* emulation first look the man to have the
> > good function prototype :
>
> > $ man sscanf
>
> >         int sscanf(const char *str, const char *format, ...);
>
> > Then add a function pointer to the same prototype in the struct Libc in
> > the file model/libc.h :
>
> >      int (*sscanf_fn) (const char *str, const char *format, ...);
>
> > in file libc.c add the function like the real one :
>
> > int sscanf(const char *str, const char *format, ...)
> > {
> >    va_list ap;
> >    va_start (ap, format);
> >    int retval = glibc.sscanf_fn( str, format, ap);
> >    va_end (ap);
> >    return retval;
>
> > }
>
> > then in libc-dce.c affect thedceimplementation of the new method :
>
> > libc->sscan_fn = vsscanf;
>
> > In this example sscanf is a function that do not have possible
> > interraction with the simulation world, the implementation
> >   is done by calling the real vsscanf (not sscanf because of va_list ...).
> > But for example if you call socket function the implementation is
> > dce_socket with interract much with NS3 simulate world and is more
> > difficult to implement :)
>
> > That's All.
>
> > -- Frederic
>
> Thanks for the succinct guide!
>
> I'll try this path and post the results back.
>
> ~
> Ut

Hi,

Thanks to help from Frederic, Hajime and others in this group, I have
been able to successfully compile and run 'ip' ns-3-dce-old using the
examle file ./build/debug/src/dce/example/dce-linux-simple.

The files in the folder `files-0` in case of './ip' is as expected
(taking cue from `mathieu/ns-3-dce/doc/dce.rst`):

------------------------------------------------------------------
utkarsh@ns3-testbed:~/repos/ns-3-allinone/ns-3-dce-old$ cat files-0/
var/log/*/stdout
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
broadcast 127.255.255.255 dev lo table local proto kernel scope
link src 127.0.0.1
broadcast 127.0.0.0 dev lo table local proto kernel scope link src
127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src
127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src
127.0.0.1
did read all buffers
did write all buffers
------------------------------------------------------------------

So that is a milestone and I will write the exact steps I followed and
collect the stumbling blocks together.

However, the simulation does not come to a halt while experimenting
with './iperf'.
I have tried changing the Simulator::Stop(.) parameter to various
values and testing without success.
After killing the simulator, the logs look as if iperf was started
normally, but no output was produced:

-------------------------------------------------------------------------------------------------------------------------
utkarsh@ns3-testbed:~/repos/ns-3-allinone/ns-3-dce-old$ cat files-*/*/
*/*/*
build/debug/iperf -c 10.1.1.2 -y C -i 1
build/debug/iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 0.00 Byte (default)
------------------------------------------------------------
<EOF>
-------------------------------------------------------------------------------------------------------------------------

iperf when run independently seems to work fine.

Any idea what might be causing this behavior and/or how to start
debugging it?

Thanks!

~
Ut

Duy Nguyen

unread,
Aug 17, 2011, 7:22:01 PM8/17/11
to ns-3-...@googlegroups.com
Hi Frederic and everyone, I am facing the same problem. Upon running
ccnx examples, it was complaining about "symbol memchr, version
GLIBC_2.0 not defined in file 0001.so.6" So, I added memchr
function to libc.h, libc.c libc-dce.c. Now there is no more errors or
complains, but there is no output as well. I thought it might be a
related problem. I've tried it on Ubuntu 32-bit machine 10.04, 10.10,
11.04, all with the same results. Do we have to do anything else
after adding memchr to dce? I was looking at utils/elfread and
noticed that there is a comment about libcrypto.so.10? Mine version
is libcrypto.so.0.9.8, is this ok? Am I missing any thing?

Duy

> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To post to this group, send email to ns-3-...@googlegroups.com.
> To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
>
>

Frederic Urbani

unread,
Aug 18, 2011, 4:24:39 AM8/18/11
to ns-3-...@googlegroups.com
>>>>> ../src/dce/model/linux-socket-fd-factory.cc: In member function �bool

>>>>> ns3::LinuxSocketFdFactory::CheckFd(SimSocket*)�:
>>>>> ../src/dce/model/linux-socket-fd-factory.cc:750: error: �struct
>>>>> SimExported� has no member named �sim_check_socket_fd�
Hi,

in fact I never try to run iperf using DCE, also my version of DCE do
not include the iperf sample.
Concerning ccnx it should run well, but I only test it using Fedora 14,
did you read and follow the guide in doc/source/getting-started.rst ?

BR,

Frederic.


Duy Nguyen

unread,
Aug 19, 2011, 1:04:47 AM8/19/11
to ns-3-...@googlegroups.com
Yes, ccnx examples run fine on Fedora, but I couldn't get it running
on Ubuntu Machine.

Duy

Reply all
Reply to author
Forward
0 new messages