Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add model Reno, NewReno and Tahoe with ns3
[simgrid.git] / doc / ns3.doc
1 /*! \page ns3 SimGrid and NS3
2
3 \section ns3_simgrid_configuration_ns3 Using NS3
4
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. 
7
8 <i>
9 To use ns3 model inside SimGrid you have to install at least the version 3.10 of ns3 simulator.
10 </i>
11
12 - <b>Download and enter the lateast release (here the 3.12.1)</b>
13
14 \verbatim
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/
18 \endverbatim
19
20 - <b>Configure, make and install ns3</b>
21
22 \verbatim
23 ./waf configure --prefix="ns-3_install_directory"
24 ./waf
25 ./waf install
26 \endverbatim
27
28 After install ns-3 you should have directories into your "ns-3_install_directory":
29         \li include/ns3/ 
30         \li lib/ 
31         \li bin/ (with 3.12)
32         
33 You also need to add to the LD_LIBRARY_PATH : "ns-3_install_directory/lib".
34
35 - <b>Enable ns-3 support on SimGrid</b>
36
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)
38
39 \verbatim
40 navarrop@caraja:~/workspace/simgrid/build$cmake . -Dns3_path=<ns3_path>
41 \endverbatim
42
43 With the output of the configuration you can see if ns-3 is detected by included the directory to flags.
44
45 \verbatim
46 Configuration of package `simgrid' on arch (=4):
47              BUILDNAME :        UNIX
48              SITE      :        Linux_2.6.38-11-generic_x86_64
49              Release   :        simgrid-3.6.1
50
51          Compiler: c++ :        /usr/bin/c++
52                 version:        4.6.1
53          Compiler: c   :        /usr/bin/gcc
54                 version:        4.6.1
55
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 
59
60         Compile Gtnets :        0
61         Compile NS-3   :        1 ---------------------> Be sure this option is "1" otherwise ns-3 is not activated
62         Gtnets path    :        
63         NS-3 path      :        /home/navarrop/Install/ns3-3.10
64         Compile Lua    :        
65         Compile Smpi   :        OFF
66         Compile Static :        OFF
67         Compile pcre   :        AUTO
68
69         Maintainer mode:        OFF
70         Supernovae mode:        OFF
71         Model checking :        OFF
72         Tracing mode   :        OFF
73         Jedule  mode   :        OFF
74         Latency bound  :        OFF
75         Graphviz mode  :        
76
77         Simgrid dependencies:   -lm -lpcre -lpthread -lns3 -lrt
78         Gras dependencies   :   -lm -lpthread -lrt
79         Smpi dependencies   :   
80
81         INSTALL_PREFIX:         /usr/local
82 -- Configuring done
83 -- Generating done
84 -- Build files have been written to: /home/navarrop/workspace/simgrid/build
85 \endverbatim
86
87 Now you can compile SimGrid
88 \verbatim
89 navarrop@caraja:~/workspace/simgrid/build$make
90 \endverbatim
91
92 Then you can see if ns-3 is well activated by testing
93 \verbatim
94 navarrop@caraja:~/workspace/simgrid/build$ctest -R ns3
95 \endverbatim
96
97 You should see
98 \verbatim
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
105 \endverbatim
106
107 More about ns-3 simulator <a href="http://www.nsnam.org/">(Official website)</a>
108
109 */