Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run iperf in ns3 DCE #298

Closed
teto opened this issue Sep 2, 2015 · 18 comments
Closed

run iperf in ns3 DCE #298

teto opened this issue Sep 2, 2015 · 18 comments
Assignees
Labels

Comments

@teto
Copy link
Contributor

teto commented Sep 2, 2015

Hi,

I would like to load iperf3 in the network simulator ns3 with DCE. Thus I tried compiling it with the flags described here: https://www.nsnam.org/docs/dce/manual/html/dce-user-newapps.html such as

$ make CFLAGS="-fPIC -U_FORTIFY_SOURCE" LDFLAGS="-pie -rdynamic" 
libtool: link: gcc -pg -g -fPIC -U_FORTIFY_SOURCE -pg -g -pie -rdynamic -o .libs/iperf3_profile iperf3_profile-main.o iperf3_profile-cjson.o iperf3_profile-iperf_api.o iperf3_profile-iperf_error.o iperf3_profile-iperf_client_api.o iperf3_profile-iperf_locale.o iperf3_profile-iperf_server_api.o iperf3_profile-iperf_tcp.o iperf3_profile-iperf_udp.o iperf3_profile-iperf_sctp.o iperf3_profile-iperf_util.o iperf3_profile-net.o iperf3_profile-tcp_info.o iperf3_profile-tcp_window_size.o iperf3_profile-timer.o iperf3_profile-units.o  ./.libs/libiperf.so
/usr/bin/ld.bfd.real: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/gcrt1.o: relocation R_X86_64_32S against `__libc_csu_fini' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/gcrt1.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:784: recipe for target 'iperf3_profile' failed
make[2]: *** [iperf3_profile] Error 1
make[2]: Leaving directory '/home/teto/iperf3/src'
Makefile:632: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/teto/iperf3/src'
Makefile:381: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Would it be possible to fix this please ?

@bmah888 bmah888 self-assigned this Sep 4, 2015
@bmah888
Copy link
Contributor

bmah888 commented Sep 4, 2015

I haven't played with ns since version 1, and have no familiarity with ns3 or "DCE". It sounds like a way to run third-party applications inside ns?

You can run without iperf3_profile...that's just a profiled version of the iperf3 binary that isn't even used in normal usage.

@teto
Copy link
Contributor Author

teto commented Sep 4, 2015

DCE converts POSIX calls into ns3 calls so that you can run the linux kernel or real applications like vlc/ip/iperf2 on top of the simulator. It improves the realism of the simulations compared to CPU-limited simulations such as mininet.

How can I disable iperf3_profile please ? I don't see the flag in ./configure --help .

Btw good job updating iperf, it badly needed the changes you made.

@bmah888
Copy link
Contributor

bmah888 commented Sep 4, 2015

Thanks! Most of the iperf3 work was done before I joined the project.

If you let the make job run to the end (where it errors out on iperf3_profile) has it already built the iperf3 executable?

If not...hrm. You could try removing iperf3_profile from the definition of noinst_PROGRAMS, and then regenerating the build infrastructure by running bootstrap.sh. Effectively this removes iperf3_profile from the set of things that make will try to build.

In December, someone else tried something similar, and we traded a few emails on the iperf-dev list. I wasn't able to help him, but maybe he was able to figure this out on his own (I didn't learn the end story). May you can post something on the iperf-dev list and see if anyone else succeeded with this.

Wish I had some more help for you!

@teto
Copy link
Contributor Author

teto commented Sep 4, 2015

I found the topic:
https://groups.google.com/forum/#!topic/iperf-dev/BwMM2lFgw2U but can't answer it yet since one needs approval to get into the group.
The iperf program seems to be built. I will confirm if I can load it into DCE later.
My guess would be that iperf does not pass the same flags to every file it compiles. There must be a lacking $(CFLAGS) somewhere in the makefile.

@bmah888
Copy link
Contributor

bmah888 commented Sep 5, 2015

I approved you for the group (and I found some other people who slipped through the cracks, so to speak). It's very strange that Google sent me the notification of your request to join in French...that was completely unexpected (je ne parle pas français).

@teto
Copy link
Contributor Author

teto commented Sep 7, 2015

I suppose Google must have guessed you were fluent in French :)
Merci beaucoup.
I managed to load iperf3 via hacking a bit with DCE though for now there is a connection problem between the client and the server I guess due to some DCE fiddling.
I leave the ticket open since it would be nice to be able to run the first post compilation command without problems. Feel free to close it otherwise.

@teto
Copy link
Contributor Author

teto commented Sep 8, 2015

Apparently removing the "-pg" flag makes the compilation successful:
https://github.com/teto/iperf/tree/dce_fix
Something that puzzles me is that in my previous attempts src/iperf3 seemed to be a shared library but now that I've made a make clean, iperf3 is a bash wrapper that calls the shared library .libs/iperf3. I would like to get rid of the wrapper. I guess I forgot the flag I used during my first configure.

@Ruvaak
Copy link

Ruvaak commented Aug 11, 2016

Hello Teto

I am having the same issue you were experiencing. I downloaded the iperf you uploaded on the link above https://github.com/teto/iperf/tree/dce_fix and configured with these flags as follows:
./configure CFLAGS=" -fPIC" LDFLAGS="-pie -rdynamic" --prefix=/home/ruva/sctp/dce_sctp/source/iperf3/iperf-dce_fix/src

Then I get the followoing error:
libtool: link: gcc -pg -g -fPIC -Wall -pg -g -pie -rdynamic -o .libs/iperf3_profile iperf3_profile-main.o iperf3_profile-cjson.o iperf3_profile-iperf_api.o iperf3_profile-iperf_error.o iperf3_profile-iperf_client_api.o iperf3_profile-iperf_locale.o iperf3_profile-iperf_server_api.o iperf3_profile-iperf_tcp.o iperf3_profile-iperf_udp.o iperf3_profile-iperf_sctp.o iperf3_profile-iperf_util.o iperf3_profile-net.o iperf3_profile-tcp_info.o iperf3_profile-tcp_window_size.o iperf3_profile-timer.o iperf3_profile-units.o ./.libs/libiperf.so /usr/lib/libsctp.so -Wl,-rpath -Wl,/home/ruva/sctp/dce_sctp/source/iperf3/iperf-dce_fix/src/lib
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/gcrt1.o: relocation R_X86_64_32S against __libc_csu_fini' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/gcrt1.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [iperf3_profile] Error 1 make[2]: Leaving directory/home/ruva/sctp/dce_sctp/source/iperf3/iperf-dce_fix/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ruva/sctp/dce_sctp/source/iperf3/iperf-dce_fix/src'
make: *** [all-recursive] Error 1

One interesting observation is in your make file you have removed -pg however from my output you can see the -pg flag. How can I remove it? Any assistance will be greatly appreciated.

Cheers
Ruva

@teto
Copy link
Contributor Author

teto commented Aug 11, 2016

The command I have noted which should work:
./configure CFLAGS="-g -U_FORTIFY_SOURCE -fPIC" LDFLAGS="-pie -rdynamic" --with-pic --disable-shared --disable-static

If you plan to use it in DCE, you can use
direct-code-execution/ns-3-dce#43
as well

@Ruvaak
Copy link

Ruvaak commented Aug 11, 2016

Wonderful thanks! You're a life saver. That worked like a charm!!

Much appreciated :0)

Cheers
Ruva

On Thu, Aug 11, 2016 at 4:27 PM, Matthieu Coudron [email protected]
wrote:

The command I have noted which should work:
./configure CFLAGS="-g -U_FORTIFY_SOURCE -fPIC" LDFLAGS="-pie -rdynamic"
--with-pic --disable-shared --disable-static

If you plan to use it in DCE, you can use
direct-code-execution/ns-3-dce#43
direct-code-execution/ns-3-dce#43
as well


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#298 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ARpT8ng9s1wy8gPKzd7CGPwZh6OCc0uhks5qez9zgaJpZM4F2YJq
.

@Ruvaak
Copy link

Ruvaak commented Aug 12, 2016

Hello Mattthieu

I am trying to use the dce-mptp-lte-wifi.cc example
https://github.com/direct-code-execution/ns-3-dce/blob/
master/example/dce-mptcp-lte-wifi.cc, but instead of running the simulation
using the default iperf I use iperf3 so that I can test it with SCTP.
Iperf3 seems to only run over WiFi but before I try to even introduce other
paths to this topology I cannot get iperf3 to generate data when I run the
simulation over LTE alone. Do you know why it works over Wifi but not over
LTE? I have attached my log file and it seems to not be able to find the
client node.

Client setup
// Launch iperf client on node 0
dce.SetBinary ("iperf3");
dce.ResetArguments ();
dce.ResetEnvironment ();
dce.AddArgument ("--sctp");
dce.AddArgument ("-c");
dce.AddArgument ("10.2.0.1");
dce.ParseArguments ("-y C");
dce.AddArgument ("-i");
dce.AddArgument ("1");
dce.AddArgument ("--time");
dce.AddArgument ("40");

//Server setup
// Launch iperf server on node 1
dce.SetBinary ("iperf3");
dce.ResetArguments ();
dce.ResetEnvironment ();
dce.AddArgument ("-s");
dce.AddArgument ("-P");
dce.AddArgument ("1");

On Thu, Aug 11, 2016 at 4:27 PM, Matthieu Coudron [email protected]
wrote:

The command I have noted which should work:
./configure CFLAGS="-g -U_FORTIFY_SOURCE -fPIC" LDFLAGS="-pie -rdynamic"
--with-pic --disable-shared --disable-static

If you plan to use it in DCE, you can use
direct-code-execution/ns-3-dce#43
direct-code-execution/ns-3-dce#43
as well


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#298 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ARpT8ng9s1wy8gPKzd7CGPwZh6OCc0uhks5qez9zgaJpZM4F2YJq
.


Client connecting to 10.1.1.2, TCP port 5001

TCP window size: 128 KByte (default)

[ 3] local 10.1.1.1 port 49153 connected with 10.1.1.2 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 640 KBytes 5.24 Mbits/sec
[ 3] 1.0- 2.0 sec 512 KBytes 4.19 Mbits/sec
[ 3] 2.0- 3.0 sec 512 KBytes 4.19 Mbits/sec
[ 3] 3.0- 4.0 sec 640 KBytes 5.24 Mbits/sec
[ 3] 4.0- 5.0 sec 512 KBytes 4.19 Mbits/sec
[ 3] 5.0- 6.0 sec 512 KBytes 4.19 Mbits/sec
[ 3] 6.0- 7.0 sec 640 KBytes 5.24 Mbits/sec
[ 3] 7.0- 8.0 sec 512 KBytes 4.19 Mbits/sec
[ 3] 8.0- 9.0 sec 512 KBytes 4.19 Mbits/sec
[ 3] 9.0-10.0 sec 640 KBytes 5.24 Mbits/sec
[ 3] 0.0-10.2 sec 5.62 MBytes 4.64 Mbits/sec
1: lo: mtu 16436 qdisc noop state DOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0: mtu 1480 qdisc noop state DOWN
link/sit 0.0.0.0 brd 0.0.0.0
3: ip6tnl0: mtu 1460 qdisc noop state DOWN
link/tunnel6 :: brd ::
4: sim0: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 00:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
10.0.0.0/24 dev sim0 proto kernel scope link src 10.0.0.1
local 10.0.0.1 dev sim0 table local proto kernel scope host src 10.0.0.1
broadcast 10.0.0.0 dev sim0 table local proto kernel scope link src 10.0.0.1
broadcast 10.0.0.255 dev sim0 table local proto kernel scope link src 10.0.0.1
fe80::/64 dev sim0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
unreachable default dev lo table 0 proto kernel metric -1 error -101 hoplimit 255
local fe80::200:ff:fe00:1 via :: dev lo table local proto none metric 0 mtu 16436 advmss 16376 hoplimit 0
ff00::/8 dev sim0 table local metric 256 mtu 1500 advmss 1440 hoplimit 0
unreachable default dev lo table 0 proto kernel metric -1 error -101 hoplimit 255
1: lo: mtu 16436 qdisc noop state DOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0: mtu 1480 qdisc noop state DOWN
link/sit 0.0.0.0 brd 0.0.0.0
3: ip6tnl0: mtu 1460 qdisc noop state DOWN
link/tunnel6 :: brd ::
4: sim0: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 00:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 scope global sim0
inet6 fe80::200:ff:fe00:1/64 scope link
valid_lft forever preferred_lft forever
Addresses binded: 1
Address 1: 10.0.0.1:4135
0: from all lookup local
32765: from 7.0.0.2 lookup 1
32766: from all lookup main
32767: from all lookup default
7.0.0.0/8 dev sim0 proto kernel scope link src 7.0.0.2
default via 7.0.0.1 dev sim0
default via 7.0.0.1 dev sim0 table 1
local 7.0.0.2 dev sim0 table local proto kernel scope host src 7.0.0.2
broadcast 7.0.0.0 dev sim0 table local proto kernel scope link src 7.0.0.2
broadcast 7.255.255.255 dev sim0 table local proto kernel scope link src 7.0.0.2
fe80::/64 dev sim0 proto kernel metric 256 mtu 30000 advmss 29940 hoplimit 0
unreachable default dev lo table 0 proto kernel metric -1 error -101 hoplimit 255
local fe80::200:ff:fe00:0 via :: dev lo table local proto none metric 0 mtu 16436 advmss 16376 hoplimit 0
ff00::/8 dev sim0 table local metric 256 mtu 30000 advmss 29940 hoplimit 0
unreachable default dev lo table 0 proto kernel metric -1 error -101 hoplimit 255
0: from all lookup local
32764: from 10.1.0.1 lookup 2
32765: from 7.0.0.2 lookup 1
32766: from all lookup main
32767: from all lookup default
10.1.0.0/24 dev sim1 table 2 scope link
default via 10.1.0.2 dev sim1 table 2
10.1.0.0/24 dev sim1 proto kernel scope link src 10.1.0.1
7.0.0.0/8 dev sim0 proto kernel scope link src 7.0.0.2
default via 7.0.0.1 dev sim0
default via 7.0.0.1 dev sim0 table 1
local 7.0.0.2 dev sim0 table local proto kernel scope host src 7.0.0.2
broadcast 7.0.0.0 dev sim0 table local proto kernel scope link src 7.0.0.2
local 10.1.0.1 dev sim1 table local proto kernel scope host src 10.1.0.1
broadcast 10.1.0.0 dev sim1 table local proto kernel scope link src 10.1.0.1
broadcast 7.255.255.255 dev sim0 table local proto kernel scope link src 7.0.0.2
broadcast 10.1.0.255 dev sim1 table local proto kernel scope link src 10.1.0.1
fe80::/64 dev sim0 proto kernel metric 256 mtu 30000 advmss 29940 hoplimit 0
fe80::/64 dev sim1 proto kernel metric 256 mtu 2296 advmss 2236 hoplimit 0
unreachable default dev lo table 0 proto kernel metric -1 error -101 hoplimit 255
local fe80::200:ff:fe00:0 via :: dev lo table local proto none metric 0 mtu 16436 advmss 16376 hoplimit 0
local fe80::200:ff:fe00:6 via :: dev lo table local proto none metric 0 mtu 16436 advmss 16376 hoplimit 0
ff00::/8 dev sim0 table local metric 256 mtu 30000 advmss 29940 hoplimit 0
ff00::/8 dev sim1 table local metric 256 mtu 2296 advmss 2236 hoplimit 0
unreachable default dev lo table 0 proto kernel metric -1 error -101 hoplimit 255

@bmah888
Copy link
Contributor

bmah888 commented Aug 12, 2016

I (still) have no insights about issues related to DCE.

I can say that iperf3 is agnostic to whether it runs over Wi-Fi, Ethernet, LTE, or avian carriers. Some LTE carriers have a NAT between their LTE network and the rest of the Internet; depending on how you're running iperf3 that could be interfering with your setup.

@teto
Copy link
Contributor Author

teto commented Aug 12, 2016

@bmah888 I close this ticket since I've been able to run iperf3 in DCE already (patches are available though not merged yet). IIRC there is an infinite loop (because it relies on time elapsing while in discrete simulators, time doesn't advance within the loop) that could be fixed or modified upstream. We'll see if someone volunteers :)

@Ruvaak open a thread on ns3 mailing list but no one can help you without more details. Just look into stdout/stderr files to get the proper error message.

@teto teto closed this as completed Aug 12, 2016
@Ruvaak
Copy link

Ruvaak commented Aug 17, 2016

Hello Matt

My iperf3 has stopped working. I had configured it and made it exactly as
you suggested and successfully generated data (please see attachment 1).
All I did was restart my virtual machine and run the standard updates but
now when I run my simulation I get My iperf3 reports the following:
msg="Executable 'iperf3' not found ! Please check your DCE_PATH and
DCE_ROOT environment variables.

I can confirm that my environment variables are set correctly to show the
DCE_PATH where the iperf 3binaries are located.
No command 'iperf3' found, did you mean Command 'iperf' from package
'iperf' (universe).
I have tried to reconfigure and rebuild it again, which I can do with no
errors but despite that it looks like it is not installed.

The sad part is that it worked once after I had configured it as you
suggested and now its died again. Any assistance or advice would be greatly
appreciated.

On Thu, Aug 11, 2016 at 4:27 PM, Matthieu Coudron [email protected]
wrote:

The command I have noted which should work:
./configure CFLAGS="-g -U_FORTIFY_SOURCE -fPIC" LDFLAGS="-pie -rdynamic"
--with-pic --disable-shared --disable-static

If you plan to use it in DCE, you can use
direct-code-execution/ns-3-dce#43
direct-code-execution/ns-3-dce#43
as well


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#298 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ARpT8ng9s1wy8gPKzd7CGPwZh6OCc0uhks5qez9zgaJpZM4F2YJq
.

@teto
Copy link
Contributor Author

teto commented Aug 21, 2016

DCE_PATH works as PATH, make sure the folder that contians the iperf3 binary is in it.

@parksjin01
Copy link

parksjin01 commented Jan 11, 2019

@teto
I want to use iperf3 in DCE and I found your iperf3 repository.
I clone your iperf3 repository and build with make program
I used below command to build iperf3

./configure CFLAGS="-g -U_FORTIFY_SOURCE -fPIC" LDFLAGS="-pie -rdynamic" --with-pic --disable-shared --disable-static
make
make install

I have problem when entering make install command. I got error like below

/bin/bash ../libtool  --tag=CC   --mode=link gcc -pg -g -g -U_FORTIFY_SOURCE -fPIC -Wall -pg -g -pie -rdynamic   -o iperf3_profile iperf3_profile-main.o iperf3_profile-cjson.o iperf3_profile-iperf_api.o iperf3_profile-iperf_error.o iperf3_profile-iperf_auth.o iperf3_profile-iperf_client_api.o iperf3_profile-iperf_locale.o iperf3_profile-iperf_server_api.o iperf3_profile-iperf_tcp.o iperf3_profile-iperf_udp.o iperf3_profile-iperf_sctp.o iperf3_profile-iperf_util.o iperf3_profile-dscp.o iperf3_profile-net.o iperf3_profile-tcp_info.o iperf3_profile-timer.o iperf3_profile-units.o libiperf.la -lssl -lcrypto   -lm 
libtool: link: gcc -pg -g -g -U_FORTIFY_SOURCE -fPIC -Wall -pg -g -pie -rdynamic -o iperf3_profile iperf3_profile-main.o iperf3_profile-cjson.o iperf3_profile-iperf_api.o iperf3_profile-iperf_error.o iperf3_profile-iperf_auth.o iperf3_profile-iperf_client_api.o iperf3_profile-iperf_locale.o iperf3_profile-iperf_server_api.o iperf3_profile-iperf_tcp.o iperf3_profile-iperf_udp.o iperf3_profile-iperf_sctp.o iperf3_profile-iperf_util.o iperf3_profile-dscp.o iperf3_profile-net.o iperf3_profile-tcp_info.o iperf3_profile-timer.o iperf3_profile-units.o  ./.libs/libiperf.a -lssl -lcrypto -lm
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/gcrt1.o: relocation R_X86_64_32S against `__libc_csu_fini' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/gcrt1.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [iperf3_profile] Error 1
make[1]: Leaving directory `/home/parksjin01/dce/source/iperf3/src'
make: *** [install-recursive] Error 1

I want to know how can I solve this problem?
Thanks

@teto
Copy link
Contributor Author

teto commented Jan 11, 2019

did you run $ make clean beforehand ? which version ?

@parksjin01
Copy link

parksjin01 commented Jan 11, 2019

@teto
I'm using Ubuntu 14.04.5 LTS, ns-3.28, DCE-1.10
I didn't run make clean, Does make clean command required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants