Logo AND Algorithmique Numérique Distribuée

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