1 /*! \page pls Packet level simulation
5 It is possible to use a packet-level network simulator instead of the default flow-based models. You may want to use
6 this feature if you have doubts about the validity of the default model or want to perform some validation experiments.
8 At the moment, we support the well-known <a href="http://www.nsnam.org/"><b>ns-3</b></a> packet-level simulator. Earlier
9 releases of SimGrid did support the <b>GTNetS</b> simulator. Its support could possibly be revived by someone who would
12 \section pls_simgrid_configuration_ns3 ns-3 as a SimGrid model
14 This section explains how to replace the SimGrid network models by those of the well-known
15 <a href="http://www.nsnam.org/">ns-3</a> packet-level network simulator.
17 \subsection pls_simgrid_configuration_ns3_install Installing ns-3
19 The easiest is to install it with the package manager. Under Debian/Ubuntu, simply type as root:
22 apt-get install libns3-dev ns3
25 You can also install it from scratch with the following commands:
29 wget http://www.nsnam.org/release/ns-allinone-3.22.tar.bz2
30 tar -xf ns-allinone-3.22.tar.bz2
31 cd ns-allinone-3.22/ns-3.22/
32 # Configure, build and install
33 ./waf configure --prefix="ns-3_install_directory"
38 For more information, please refer to the ns-3 documentation.
40 \subsection pls_simgrid_configuration_ns3_config Enabling SimGrid's support for ns-3
42 Normally, you just have to enable ns-3 in ccmake or cmake as follows. If you installed ns-3 in a regular path, just
43 drop the ns3_path configuration item.
46 cmake . -Denable_ns3=ON -Dns3_path=<ns3_path>
49 By the end of the configuration, cmake reports whether ns-3 was found. You can also double-check by executing the tests
50 after the compilation.
54 (test(s) should be run)
57 If you have a ns-3 version that is not known to SimGrid (yet), the detection may fail. In that case, edit the
58 tools/cmake/Modules/FindNS3.cmake file in your SimGrid tree. The required changes are very easy, and documented at the
59 beginning of this file.
61 If the compilation fails when linking the library because of some .a file that cannot be used dynamically, this is
62 probably because you only installed the libns3-dev library on your Debian, where you also need libns3-3. This is
63 probably a bug of the libns3-dev package that should depend on the dynamic libraries corresponding to its .so files.
65 \subsection pls_simgrid_configuration_ns3_use Using ns-3 from SimGrid
67 A working example of ns-3/SimGrid interactions can be found in examples/msg/network-ns3/. Basically, you just have to
68 run your SimGrid simulation with the configuration option "network/model" set to "NS3". The rest remains unchanged.
70 The following should work from the examples/msg/network-ns3 folder (nestwork-ns3 is the name of our example binary).
73 ./network-ns3 ./3hosts_2links_p.xml 3hosts_2links_d.xml --cfg=network/model:NS3 --log=root.threshold:info
76 A ns-3 platform is automatically created from the provided SimGrid platform file. However, there are some known caveats:
79 <li>The default values (e.g., TCP parameters) are the ns3 values. Don't blame us for them.</li>
81 <li>ns-3 networks are routed using the shortest path algorithm, using
82 ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables.</li>
84 <li>End hosts cannot have more than one interface card (so, only one <link> in your SimGrid platform should
85 link an end host to the platform ; if not, your end host will be considered as a router. </li>
88 More about ns-3 simulator <a href="http://www.nsnam.org/">(Official website)</a>
90 \subsection pls_examples Examples
92 There is an example in the \c examples/ folder, that shows how to use the bindings. See also the \ref MSG_ex_PLS
93 "documentation for this example".