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 and GTNetS simulators.
10 \section pls_simgrid_configuration_gtnets GTNetS as a SimGrid model
12 \subsection pls_simgrid_configuration_gtnets_compile Compiling a patched version of GTNetS
14 GTNetS needs to be patched to work with SimGrid, so the easiest
15 solution is to run the following commands:
18 # Get the files that we prepared for you
19 svn checkout svn://scm.gforge.inria.fr/svn/simgrid/contrib/trunk/GTNetS/
22 # Unpack and patch the sources
23 unzip gtnets-current.zip
24 tar zxvf gtnets-current-patch.tgz
26 cat ../*.patch | patch -p1
29 ln -sf Makefile.linux Makefile
30 sed -i 's/-fPIC/-fPIC -fpermissive/g' Makefile
32 make opt # compile an optimized version (required)
33 make debug # compile a debug version (optional)
36 mkdir -p /opt/gtnets/include /opt/gtnets/lib
37 cp -fr SRC/*.h /opt/gtnets/include
38 cp libgtsim-opt.so /opt/gtnets/lib/libgtsim.so
46 AMD64-FATAL-Removed-DUL_SIZE_DIFF-Added-fPIC-compillin.patch is
47 only useful if you want to compile on Itanium 64bits (but should be
48 harmless on other architectures). Note that we only provide support
49 for Linux so far. Your patches are welcome to improve this ;)</li>
51 <li>The compilation spits a lot of warnings, but the application
52 should compile by the end. If the makefile insists in compiling
53 some QT libraries please try a make clean before asking for help.</li>
55 <li>If you need to use another version of GTNetS, then you will
56 probably need to modify the patch. Please drop us a line: we will
57 gratefully integrate your work. For the record, the version that we
58 provide were downloaded from <a href="http://www.ece.gatech.edu/research/labs/MANIACS/GTNetS/software/gtnets-current.zip">here</a>
59 on June 12th, 2008.</li>
61 <li>Of course you can install GTNets wherever you want on your hard
62 disk. We provide the commands for /opt just to help you.</li>
65 Add the following to your .bashrc so that it gets defined each time:
68 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}/opt/gtnets/lib/
71 \subsection pls_simgrid_configuration_gtnets_config Enabling SimGrid's support for GTNetS
73 You just have to enable GTNetS in ccmake or cmake as follows, and
77 cmake . -Denable_gtnets=ON -Dgtnets_path=/opt/gtnets
80 By the end of the configuration, cmake reports whether GTNetS was found.
81 You can also double-check by executing the tests after the compilation.
85 (several tests should be run)
88 \subsection pls_simgrid_configuration_gtnets_use Using GTNetS from SimGrid
90 A working example can be found in the folder examples/msg/gtnets.
93 gtnets/gtnets gtnets/onelink-p.xml gtnets/onelink-d.xml --cfg=network/model:GTNets
96 For more information, please refer to the <a
97 href="http://www.ece.gatech.edu/research/labs/MANIACS/GTNetS/index.html">GTNetS
98 Website</a> or to this
99 <a href="http://gforge.inria.fr/docman/view.php/12/6283/GTNetS
100 HowTo.html">possibly outdated longer HowTo</a>
102 \section pls_simgrid_configuration_ns3 NS3 as a SimGrid model
104 You may want to replace the SimGrid network models by the ones of the
105 well known packet-level network simulator <a href="http://www.nsnam.org/">NS-3</a> instead.
106 This section explains how to do so.
108 \subsection pls_simgrid_configuration_ns3_install Installing NS3
110 The easiest is to install it with the package manager. Under
111 Debian/Ubuntu, simply type as root:
114 apt-get install libns3-dev ns3
117 You can also install it from scratch with the following commands:
120 # Download the source
121 wget http://www.nsnam.org/release/ns-allinone-3.22.tar.bz2
122 tar -xf ns-allinone-3.22.tar.bz2
123 cd ns-allinone-3.22/ns-3.22/
124 # Configure, build and install
125 ./waf configure --prefix="ns-3_install_directory"
130 For more information, please refer to the NS-3 documentation.
132 \subsection pls_simgrid_configuration_ns3_config Enabling SimGrid's support for NS3
134 Normally, you just have to enable NS3 in ccmake or cmake as follows.
135 If you installed NS3 in a regular path, just drop the ns3_path
139 cmake . -Denable_ns3=ON -Dns3_path=<ns3_path>
142 By the end of the configuration, cmake reports whether NS-3 was found.
143 You can also double-check by executing the tests after the compilation.
147 (several tests should be run)
150 If you have a NS3 version that is not known (yet) to SimGrid, the
151 detection may fail. In that case, edit the file
152 buildtools/Cmake/Modules/FindNS3.cmake in your SimGrid tree. The
153 required changes are very easy, and documented at the beginning of
156 If the compilation fails when linking the library because of some .a
157 file that cannot be used dynamically, that's probably because you only
158 installed the libns3-dev library on your Debian, where you also need
159 libns3-3. That's probably a bug of the libns3-dev package that should
160 depend on the dynamic libraries corresponding to its .so files.
162 \subsection pls_simgrid_configuration_ns3_use Using NS3 from SimGrid
164 A working example of NS3/SimGrid interactions can be found in
165 examples/msg/ns3. Basically, you just have to run your SimGrid
166 simulation with the configuration option "network/model" set to the
167 value "NS3". The rest remains unchanged.
169 The following should work from the examples/msg/ns3 folder (ns3 here
170 is the name of our example binary).
173 ./ns3 ./3hosts_2links_p.xml 3hosts_2links_d.xml --cfg=network/model:NS3 --log=root.threshold:info
176 A ns-3 platform is automatically created from the SimGrid platform
177 file that you will provide. There is some caveats to know:
180 <li>The default values (e.g., TCP parameters) are the ns3
181 values. Don't blame us for them.</li>
183 <li>NS3 networks are routed using the shortest path algorithm, using
184 ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables.</li>
186 <li>End hosts cannot have more than one interface card (so, only one
187 <link> in your SimGrid platform should link an end host to
188 the platform ; if not, your end host will be considered as a
193 More about ns-3 simulator <a href="http://www.nsnam.org/">(Official website)</a>