Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ab415b2bab45a24771eb06a80f7b79a508a6203a
[simgrid.git] / doc / doxygen / pls.doc
1 /*! \page pls Packet level simulation
2
3 It is possible to use a packet-level network simulator
4 instead of the default flow-based simulation. You may want to use such
5 an approach if you have doubts about the validity of the default model
6 or if you want to perform some validation experiments. 
7
8 At the moment, we only support the NS3 simulator. Previous versions of
9 SimGrid did support the GTNetS simulator and that support could
10 possibly be revived by someone who would need it.
11
12 \section pls_simgrid_configuration_ns3 NS3 as a SimGrid model
13
14 You may want to replace the SimGrid network models by the ones of the
15 well known packet-level network simulator <a href="http://www.nsnam.org/">NS-3</a> instead.
16 This section explains how to do so.
17
18 \subsection pls_simgrid_configuration_ns3_install Installing NS3
19
20 The easiest is to install it with the package manager.  Under
21 Debian/Ubuntu, simply type as root:
22
23 \verbatim
24 apt-get install libns3-dev ns3
25 \endverbatim
26
27 You can also install it from scratch with the following commands:
28
29 \verbatim
30 # Download the source
31 wget http://www.nsnam.org/release/ns-allinone-3.22.tar.bz2
32 tar -xf ns-allinone-3.22.tar.bz2
33 cd ns-allinone-3.22/ns-3.22/
34 # Configure, build and install
35 ./waf configure --prefix="ns-3_install_directory"
36 ./waf
37 ./waf install
38 \endverbatim
39
40 For more information, please refer to the NS-3 documentation.
41
42 \subsection pls_simgrid_configuration_ns3_config Enabling SimGrid's support for NS3
43
44 Normally, you just have to enable NS3 in ccmake or cmake as follows.
45 If you installed NS3 in a regular path, just drop the ns3_path
46 configuration item.
47
48 \verbatim
49 cmake . -Denable_ns3=ON -Dns3_path=<ns3_path>
50 \endverbatim
51
52 By the end of the configuration, cmake reports whether NS-3 was found.
53 You can also double-check by executing the tests after the compilation.
54
55 \verbatim
56 $ ctest -R ns3
57 (several tests should be run)
58 \endverbatim
59
60 If you have a NS3 version that is not known (yet) to SimGrid, the
61 detection may fail. In that case, edit  the file
62 tools/cmake/Modules/FindNS3.cmake in your SimGrid tree. The
63 required changes are very easy, and documented at the beginning of
64 this file.
65
66 If the compilation fails when linking the library because of some .a
67 file that cannot be used dynamically, that's probably because you only
68 installed the libns3-dev library on your Debian, where you also need
69 libns3-3. That's probably a bug of the libns3-dev package that should
70 depend on the dynamic libraries corresponding to its .so files.
71
72 \subsection pls_simgrid_configuration_ns3_use Using NS3 from SimGrid
73
74 A working example of NS3/SimGrid interactions can be found in
75 examples/msg/ns3. Basically, you just have to run your SimGrid
76 simulation with the configuration option "network/model" set to the
77 value "NS3". The rest remains unchanged.
78
79 The following should work from the examples/msg/ns3 folder (ns3 here
80 is the name of our example binary).
81
82 \verbatim
83 ./ns3 ./3hosts_2links_p.xml 3hosts_2links_d.xml --cfg=network/model:NS3 --log=root.threshold:info
84 \endverbatim
85
86 A ns-3 platform is automatically created from the SimGrid platform
87 file that you will provide. There is some caveats to know:
88
89 <ul>
90   <li>The default values (e.g., TCP parameters) are the ns3
91     values. Don't blame us for them.</li>  
92
93   <li>NS3 networks are routed using the shortest path algorithm, using
94     ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables.</li>
95
96   <li>End hosts cannot have more than one interface card (so, only one
97    &lt;link&gt; in your SimGrid platform should link an end host to
98    the platform ; if not, your end host will be considered as a
99    router.  </li>
100 </ul>
101
102
103 More about ns-3 simulator <a href="http://www.nsnam.org/">(Official website)</a>
104
105 */