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.
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.
12 \section pls_simgrid_configuration_ns3 NS3 as a SimGrid model
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.
18 \subsection pls_simgrid_configuration_ns3_install Installing NS3
20 The easiest is to install it with the package manager. Under
21 Debian/Ubuntu, simply type as root:
24 apt-get install libns3-dev ns3
27 You can also install it from scratch with the following commands:
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"
40 For more information, please refer to the NS-3 documentation.
42 \subsection pls_simgrid_configuration_ns3_config Enabling SimGrid's support for NS3
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
49 cmake . -Denable_ns3=ON -Dns3_path=<ns3_path>
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.
57 (several tests should be run)
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
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.
72 \subsection pls_simgrid_configuration_ns3_use Using NS3 from SimGrid
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.
79 The following should work from the examples/msg/ns3 folder (ns3 here
80 is the name of our example binary).
83 ./ns3 ./3hosts_2links_p.xml 3hosts_2links_d.xml --cfg=network/model:NS3 --log=root.threshold:info
86 A ns-3 platform is automatically created from the SimGrid platform
87 file that you will provide. There is some caveats to know:
90 <li>The default values (e.g., TCP parameters) are the ns3
91 values. Don't blame us for them.</li>
93 <li>NS3 networks are routed using the shortest path algorithm, using
94 ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables.</li>
96 <li>End hosts cannot have more than one interface card (so, only one
97 <link> in your SimGrid platform should link an end host to
98 the platform ; if not, your end host will be considered as a
103 More about ns-3 simulator <a href="http://www.nsnam.org/">(Official website)</a>