1 /*! \page pls Packet level simulation
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.
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.
14 \section pls_simgrid_configuration_ns3 NS3 as a SimGrid model
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.
20 \subsection pls_simgrid_configuration_ns3_install Installing NS3
22 The easiest is to install it with the package manager. Under
23 Debian/Ubuntu, simply type as root:
26 apt-get install libns3-dev ns3
29 You can also install it from scratch with the following commands:
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"
42 For more information, please refer to the NS-3 documentation.
44 \subsection pls_simgrid_configuration_ns3_config Enabling SimGrid's support for NS3
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
51 cmake . -Denable_ns3=ON -Dns3_path=<ns3_path>
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.
59 (several tests should be run)
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
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.
74 \subsection pls_simgrid_configuration_ns3_use Using NS3 from SimGrid
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.
81 The following should work from the examples/msg/ns3 folder (ns3 here
82 is the name of our example binary).
85 ./ns3 ./3hosts_2links_p.xml 3hosts_2links_d.xml --cfg=network/model:NS3 --log=root.threshold:info
88 A ns-3 platform is automatically created from the SimGrid platform
89 file that you will provide. There is some caveats to know:
92 <li>The default values (e.g., TCP parameters) are the ns3
93 values. Don't blame us for them.</li>
95 <li>NS3 networks are routed using the shortest path algorithm, using
96 ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables.</li>
98 <li>End hosts cannot have more than one interface card (so, only one
99 <link> in your SimGrid platform should link an end host to
100 the platform ; if not, your end host will be considered as a
105 More about ns-3 simulator <a href="http://www.nsnam.org/">(Official website)</a>
107 \subsection pls_examples Examples
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".