1 /*! \page ns3 SimGrid and NS3
3 \section ns3_simgrid_configuration_ns3 Using NS3
5 It is possible to use discrete-event network simulator <a href="http://www.nsnam.org/">(ns-3)</a> for Internet systems
6 instead of the default one.
9 To use ns3 model inside SimGrid you have to install at least the version 3.10 of ns3 simulator.
12 - <b>Download and enter the lateast release (here the 3.12.1)</b>
15 http://www.nsnam.org/release/ns-allinone-3.12.1.tar.bz2
16 tar -xf ns-allinone-3.12.1.tar.bz2
17 cd ns-allinone-3.12.1/ns-3.12.1/
20 - <b>Configure, make and install ns3</b>
23 ./waf configure --prefix="ns-3_install_directory"
28 After install ns-3 you should have directories into your "ns-3_install_directory":
33 You also need to add to the LD_LIBRARY_PATH : "ns-3_install_directory/lib".
35 - <b>Enable ns-3 support on SimGrid</b>
37 In order to enable ns-3 with simgrid you have to give where is ns-3 to the simgrid configuration command. (path to \<ns3_path\>/lib and \<ns3_path\>/include)
40 navarrop@caraja:~/workspace/simgrid/build$cmake . -Dns3_path=<ns3_path>
43 With the output of the configuration you can see if ns-3 is detected by included the directory to flags.
46 Configuration of package `simgrid' on arch (=4):
48 SITE : Linux_2.6.38-11-generic_x86_64
49 Release : simgrid-3.6.1
51 Compiler: c++ : /usr/bin/c++
53 Compiler: c : /usr/bin/gcc
56 CFlags : -O3 -finline-functions -funroll-loops -fno-strict-aliasing -L/usr/lib/x86_64-linux-gnu -I/usr/include
57 -L/home/navarrop/Install/ns3-3.10/lib -I/home/navarrop/Install/ns3-3.10/include -g3 -D_NS3_3_10
58 CPPFlags: -I/home/navarrop/Install/ns3-3.10/include -L/home/navarrop/Install/ns3-3.10/lib
61 Compile NS-3 : 1 ---------------------> Be sure this option is "1" otherwise ns-3 is not activated
63 NS-3 path : /home/navarrop/Install/ns3-3.10
77 Simgrid dependencies: -lm -lpcre -lpthread -lns3 -lrt
78 Gras dependencies : -lm -lpthread -lrt
81 INSTALL_PREFIX: /usr/local
84 -- Build files have been written to: /home/navarrop/workspace/simgrid/build
87 Now you can compile SimGrid
89 navarrop@caraja:~/workspace/simgrid/build$make
92 Then you can see if ns-3 is well activated by testing
94 navarrop@caraja:~/workspace/simgrid/build$ctest -R ns3
99 Start 182: msg-ns3-thread
100 1/3 Test #182: msg-ns3-thread ................... Passed 0.35 sec
101 Start 183: msg-ns3-ucontext
102 2/3 Test #183: msg-ns3-ucontext ................. Passed 0.22 sec
103 Start 184: msg-ns3-raw
104 3/3 Test #184: msg-ns3-raw ...................... Passed 0.23 sec
107 More about ns-3 simulator <a href="http://www.nsnam.org/">(Official website)</a>