set(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-${lib}${NS3_SUFFIX}")
endforeach()
else()
- message(FATAL_ERROR "Cannot find NS3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option")
+ message(FATAL_ERROR "Cannot find ns-3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option")
endif()
endif()
mark_as_advanced(PATH_LIBDW_LIB)
if (enable_model-checking AND enable_ns3)
- message(FATAL_ERROR "Cannot activate both model-checking and NS3 bindings: NS3 pull too much dependencies for the MC to work")
+ message(FATAL_ERROR "Cannot activate both model-checking and ns-3 bindings: ns-3 pull too much dependencies for the MC to work")
endif()
if(enable_smpi)
message("")
if (SIMGRID_HAVE_NS3)
- message(" Compile NS-3 ................: yes (path: ${NS3_PATH})")
+ message(" Compile ns-3 ................: yes (path: ${NS3_PATH})")
else()
- message(" Compile NS-3 ................: NO (hint: ${NS3_HINT})")
+ message(" Compile ns-3 ................: NO (hint: ${NS3_HINT})")
endif()
if (${Java_FOUND})
- Stop setting random seed with srand48() at initialization.
- Use addr2line as a fallback for stacktraces when backtrace is not available.
- Build option -Denable_documentation is now OFF by default.
+ - Network model 'NS3' was renamed into 'ns-3'.
XBT:
- New log appenders: stdout and stderr. Use stdout for xbt_help.
The Java Bindings <app_java.rst>
Describing the Simulated Platform <platform.rst>
Modeling Hints <platform_howtos.rst>
- ns-3 as a SimGrid model <ns3.rst>
DTD Reference <platform_reference.rst>
Describing the Experimental Scenario <scenario.rst>
Configuring SimGrid <Configuring_SimGrid.rst>
The SimGrid Models <models.rst>
+ ns-3 as a SimGrid model <ns3.rst>
Simulation Outcomes <outcomes.rst>
Use Cases and Howto <howto.rst>
The SimGrid Community <community.rst>
ns-3 as a SimGrid model
#######################
-You can use the well-known `ns-3 <http://www.nsnam.org>`_ packet-level network
-simulator as a SimGrid model, for example to investigate the validity of your
-simulation. Just install ns-3 and recompile SimGrid accordingly.
+You can use the well-known `ns-3 packet-level network simulator
+<http://www.nsnam.org>`_ as a SimGrid model, for example to investigate the
+validity of your simulation. Just install ns-3 and recompile SimGrid
+accordingly.
-Installing ns-3
-***************
-
-The easiest is to install it with the package manager. Under Debian/Ubuntu,
-simply type as root:
-
-.. code-block:: shell
+Compiling the ns-3/SimGrid binding
+**********************************
- apt-get install libns3-dev ns3
+Installing ns-3
+===============
-You can also install it from scratch with the following commands:
+SimGrid requires ns-3 version 3.26 or higher, and you probably want the most
+recent version of both SimGrid and ns-3. While the Debian package of SimGrid
+don't have the ns-3 bindings activated, you can still use the packaged version
+of ns-3 by grabbing the ``libns3-dev ns3`` packages. Alternatively, you can
+install ns-3 from scratch as follows:
.. code-block:: shell
# Download the source
- wget http://www.nsnam.org/release/ns-allinone-3.26.tar.bz2
- tar -xf ns-allinone-3.26.tar.bz2
- cd ns-allinone-3.26/ns-3.26/
+ wget http://www.nsnam.org/release/ns-allinone-3.29.tar.bz2
+ tar -xf ns-allinone-3.29.tar.bz2
+ cd ns-allinone-3.29/ns-3.29/
# Configure, build and install
./waf configure --prefix="/opt/ns3" # or give another path if you prefer
./waf
For more information, please refer to the ns-3 documentation
(`official website <http://www.nsnam.org>`_).
-Enabling SimGrid's support for ns-3
-***********************************
+Enabling ns-3 in SimGrid
+========================
-Normally, you just have to enable ns-3 in ccmake or cmake as
-follows. If you installed ns-3 in a regular path, just drop the
-NS3_HINT configuration item.
+SimGrid must be recompiled with the ``enable_ns3`` option activated in cmake.
+Optionally, use ``NS3_HINT`` to hint cmake about where to find ns-3.
.. code-block:: shell
By the end of the configuration, cmake reports whether ns-3 was found,
and this information is also available in ``include/simgrid/config.h``
If your local copy defines the variable ``SIMGRID_HAVE_NS3`` to 1, then ns-3
-was correctly detected. If it's defined to 0, then something went
-wrong. Explore ``CMakeFiles/CMakeOutput.log`` and
+was correctly detected. Otherwise, explore ``CMakeFiles/CMakeOutput.log`` and
``CMakeFiles/CMakeError.log`` to diagnose the problem.
-Afterward, you can test your installation as follows:
+Test your installation after compilation as follows:
.. code-block:: shell
ctest -R ns3
+Troubleshooting
+===============
+
+If you use a version of ns-3 that is not known to SimGrid yet, edit
+``tools/cmake/Modules/FindNS3.cmake`` in your SimGrid tree, according to the
+comments on top of this file. Conversely, if something goes wrong with an old
+version of either SimGrid or ns-3, try upgrading everything.
+
.. _ns3_use:
Using ns-3 from SimGrid
***********************
-The SimGrid-ns3 binding only contains features that are common to both
+The SimGrid/ns-3 binding only contains features that are common to both
systems: ns-3 wireless models are not available, while SimGrid routes
cannot be longer than 1. Also, the platform built in ns-3 from the
SimGrid description is very basic.
+Platform files compatibility
+============================
+
Any route longer than one will be ignored when using ns-3. They are
harmless, but you still need to connect your hosts using one-hop routes.
The best solution is to add routers to split your route. Here is an
<link id="l2" bw="1Mbps" />
<route src="alice" dst="bob">
- <link_ctn id="l1"/> <!-- INVALID WITH NS-3 -->
- <link_ctn id="l2"/> <!-- length=2 IS TOO MUCH -->
+ <link_ctn id="l1"/> <!-- !!!! INVALID WITH ns-3 !!!! -->
+ <link_ctn id="l2"/> <!-- !!!! length=2 IS TOO MUCH !!!! -->
</route>
</platform>
-Here is the same platform expressed in a way that ns-3 will understand.
+This can be reformulated as follows to make it usable with the ns-3 binding.
There is no direct connexion from alice to bob, but that's OK because
-ns-3 will find the path from point to point.
+ns-3 automatically routes from point to point.
.. code-block:: shell
</platform>
Once your platform is OK, just change the :ref:`network/model
-<options_model_select>` configuration option to "NS3" as follows. The rest
+<options_model_select>` configuration option to "ns-3" as follows. The rest
is unchanged.
.. code-block:: shell
- ./network-ns3 --cfg=network/model:NS3 (other parameters)
+ ./network-ns3 --cfg=network/model:ns-3 (other parameters)
Many other files from the ``examples/platform directory`` are usable with the
ns-3 model, such as `examples/platforms/dogbone.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/dogbone.xml>`_.
Check the file `examples/deprecated/msg/network-ns3/network-ns3.tesh <https://framagit.org/simgrid/simgrid/tree/master/examples/deprecated/msg/network-ns3/network-ns3.tesh>`_
to see which ones are used in our regression tests.
-Shortcomings of the ns-3 bindings in SimGrid
---------------------------------------------
+Limitations
+===========
A ns-3 platform is automatically created from the provided SimGrid
platform. However, there are some known caveats:
- * The default values (e.g., TCP parameters) are the ns3 default values.
+ * The default values (e.g., TCP parameters) are the ns-3 default values.
* ns-3 networks are routed using the shortest path algorithm, using
``ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables``.
* End hosts cannot have more than one interface card. So, your
one link. Otherwise, your SimGrid host will be considered as a
router.
-Our goal is to keep the ns-3 plugin of SimGrid as easy (and hopefully
-readable) as possible. If the current state does not fit your needs,
-you should modify this plugin, and/or create your own plugin from the
-existing one.
-
-Troubleshooting with ns-3 and SimGrid
-*************************************
-
-I fail to compile ns-3 within SimGrid
--------------------------------------
-
-If you have a ns-3 version that is not known to SimGrid yet, edit
-``tools/cmake/Modules/FindNS3.cmake`` in your SimGrid tree, according to
-the comments on top of this file.
-
-If the compilation fails on Debian/Ubuntu when linking the library
-because of some .a file that cannot be used dynamically, then you are
-probably using a very old (and buggy) ``libns3-dev``
-package. Update it, or install ``libns3-3`` manually.
-
-The simulation hangs at some point
-----------------------------------
-
-If your simulation hangs in a communication, this is probably because
-one host is sending data that is not routable in your platform. Make
-sure that you only use routes of length 1, and that any host is
-connected to the platform.
-
-Arguably, SimGrid could detect this situation and report it, but
-unfortunately, this is still to be done.
+Our goal is to keep the ns-3 plugin of SimGrid as easy (and hopefully readable)
+as possible. If the current state does not fit your needs, you should modify
+this plugin, and/or create your own plugin from the existing one. If you come up
+with interesting improvements, please contribute them back
-I get a warning that some routes are ignored
---------------------------------------------
+Troubleshooting
+===============
-Any routes longer than one hop are ignored in ns-3. Please refer to
-:ref:`ns3_use` for details.
+If your simulation hangs in a communication, this is probably because one host
+is sending data that is not routable in your platform. Make sure that you only
+use routes of length 1, and that any host is connected to the platform.
+Arguably, SimGrid could detect this situation and report it, but unfortunately,
+this is still to be done.
@section msg_ex_models Models-related examples
-@subsection msg_ex_ns3 NS3 as a SimGrid Network Model
+@subsection msg_ex_ns3 ns-3 as a SimGrid Network Model
This example demonstrates how to use the bindings to the Network
Simulator, as explained in @ref pls_ns3. The most
#!/usr/bin/env tesh
-p In the NS3 tests, the timings are not shown because the exact values may vary with your NS3 version.
-p We just want to check that the NS3 bindings of SimGrid are working correctly, we don't want to thoroughly test NS3.
+p In the ns-3 tests, the timings are not shown because the exact values may vary with your ns-3 version.
+p We just want to check that the ns-3 bindings of SimGrid are working correctly, we don't want to thoroughly test ns-3.
p 3hosts 2links
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3hosts_2links_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3hosts_2links_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
> [Jupiter:worker(2)] [msg_test/INFO] FLOW[1] : Receive 100 bytes from Tremblay to Jupiter
p 6hosts 3links
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3links_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3links_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
> [Jupiter:worker(2)] [msg_test/INFO] FLOW[1] : Receive 10000 bytes from Tremblay to Jupiter
> [Ginette:worker(4)] [msg_test/INFO] FLOW[2] : Receive 10000 bytes from Fafard to Ginette
> [Lovelace:worker(6)] [msg_test/INFO] FLOW[3] : Receive 10000 bytes from Bourassa to Lovelace
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3links-timer_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3links-timer_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
> [Jupiter:worker(2)] [msg_test/INFO] FLOW[1] : Receive 10000 bytes from Tremblay to Jupiter
> [Ginette:worker(4)] [msg_test/INFO] FLOW[2] : Receive 10000 bytes from Fafard to Ginette
> [Lovelace:worker(6)] [msg_test/INFO] FLOW[3] : Receive 10000 bytes from Bourassa to Lovelace
p One cluster
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/cluster_backbone.xml ${srcdir}/network-ns3/one_cluster_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/cluster_backbone.xml ${srcdir}/network-ns3/one_cluster_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
> [node-6.simgrid.org:worker(2)] [msg_test/INFO] FLOW[1] : Receive 100 bytes from node-2.simgrid.org to node-6.simgrid.org
p Dogbone
! timeout 10
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/dogbone.xml ${srcdir}/network-ns3/dogbone_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
-> [:maestro(0)] [ns3/WARNING] Ignoring a route between S1 and C1 of length 3: Only routes of length 1 are considered with NS3.
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/dogbone.xml ${srcdir}/network-ns3/dogbone_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
+> [:maestro(0)] [ns3/WARNING] Ignoring a route between S1 and C1 of length 3: Only routes of length 1 are considered with ns-3.
> WARNING: You can ignore this warning if your hosts can still communicate when only considering routes of length 1.
> WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently ignored.
> [C1:worker(3)] [msg_test/INFO] FLOW[0] : Receive 10000 bytes from S1 to C1
p 2hosts 1link
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/onelink.xml ${srcdir}/network-ns3/onelink_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/onelink.xml ${srcdir}/network-ns3/onelink_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
> [C1:worker(2)] [msg_test/INFO] FLOW[1] : Receive 10000 bytes from S1 to C1
p Crosstraffic TCP option DISABLED
! output ignore
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/crosstraffic.xml ${srcdir}/network-ns3/crosstraffic_d.xml --cfg=network/model:NS3 --cfg=network/crosstraffic:0
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/crosstraffic.xml ${srcdir}/network-ns3/crosstraffic_d.xml --cfg=network/model:ns-3 --cfg=network/crosstraffic:0
p Crosstraffic TCP option ENABLED
! output ignore
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/crosstraffic.xml ${srcdir}/network-ns3/crosstraffic_d.xml --cfg=network/model:NS3 --cfg=network/crosstraffic:1
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/crosstraffic.xml ${srcdir}/network-ns3/crosstraffic_d.xml --cfg=network/model:ns-3 --cfg=network/crosstraffic:1
-- S2 ---[ 4 ]--- ---[ 5 ]--- C2
--
--
- -- This platform is a valid NS3 platform, even if it exhibits routes of length >1,
+ -- This platform is a valid ns-3 platform, even if it exhibits routes of length >1,
-- because when you only keep the routes of length 1,
-- you get a graph where every host can speak to any other host.
--
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<!-- All routes of this platform are of length 1, so you can use it with the NS3 model
- http://simgrid.gforge.inria.fr/simgrid/latest/doc/pls_ns3.html -->
+<!-- All routes of this platform are of length 1, so you can use it with the ns-3 model.
+ https://simgrid.org/doc/latest/ns3.html -->
<platform version="4.1">
<zone id="AS0" routing="Full">
#cmakedefine01 SIMGRID_HAVE_MALLOCATOR
/* Was the model-checking compiled in? */
#cmakedefine01 SIMGRID_HAVE_MC
-/* Was the NS3 support compiled in? */
+/* Was the ns-3 support compiled in? */
#cmakedefine01 SIMGRID_HAVE_NS3
#endif /* SIMGRID_PUBLIC_CONFIG_H */
/** @brief Returns whether this model have an idempotent share_resource()
*
- * The only model that is not is NS3: computing the next timestamp moves the model up to that point,
+ * The only model that is not is ns-3: computing the next timestamp moves the model up to that point,
* so we need to call it only when the next timestamp of other sources is computed.
*/
virtual bool next_occuring_event_is_idempotent() { return true; }
#include "src/surf/xml/platf_private.hpp"
#include "surf/surf.hpp"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network NS3 module");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network ns-3 module");
std::vector<std::string> IPV4addr;
// Create private link
std::string host_id = cluster.prefix + std::to_string(i) + cluster.suffix;
NetPointNs3* host_src = simgrid::s4u::Host::by_name(host_id)->pimpl_netpoint->extension<NetPointNs3>();
- xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id.c_str());
+ xbt_assert(host_src, "Cannot find a ns-3 host of name %s", host_id.c_str());
- // Any NS3 route is symmetrical
+ // Any ns-3 route is symmetrical
ns3_add_link(host_src, host_dst, cluster.bw, cluster.lat);
delete host_dst;
NetPointNs3* host_src = src->extension<NetPointNs3>();
NetPointNs3* host_dst = dst->extension<NetPointNs3>();
- xbt_assert(host_src != nullptr, "Network element %s does not seem to be NS3-ready", src->get_cname());
- xbt_assert(host_dst != nullptr, "Network element %s does not seem to be NS3-ready", dst->get_cname());
+ xbt_assert(host_src != nullptr, "Network element %s does not seem to be ns-3-ready", src->get_cname());
+ xbt_assert(host_dst != nullptr, "Network element %s does not seem to be ns-3-ready", dst->get_cname());
ns3_add_link(host_src, host_dst, link->get_bandwidth(), link->get_latency());
} else {
static bool warned_about_long_routes = false;
if (not warned_about_long_routes)
- XBT_WARN("Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with NS3.\n"
+ XBT_WARN("Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with ns-3.\n"
"WARNING: You can ignore this warning if your hosts can still communicate when only considering routes "
"of length 1.\n"
"WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently "
}
static simgrid::config::Flag<std::string>
- ns3_tcp_model("ns3/TcpModel", "The ns3 tcp model can be : NewReno or Reno or Tahoe", "default");
+ ns3_tcp_model("ns3/TcpModel", "The ns-3 tcp model can be : NewReno or Reno or Tahoe", "default");
namespace simgrid {
namespace kernel {
NetworkNS3Model::NetworkNS3Model() : NetworkModel(Model::UpdateAlgo::FULL)
{
xbt_assert(not sg_link_energy_is_inited(),
- "LinkEnergy plugin and NS3 network models are not compatible. Are you looking for Ecofen, maybe?");
+ "LinkEnergy plugin and ns-3 network models are not compatible. Are you looking for Ecofen, maybe?");
all_existing_models.push_back(this);
routing::NetPoint::on_creation.connect([](routing::NetPoint& pt) {
pt.extension_set<NetPointNs3>(new NetPointNs3());
- XBT_VERB("SimGrid's %s is known as node %d within NS3", pt.get_cname(), pt.extension<NetPointNs3>()->node_num);
+ XBT_VERB("SimGrid's %s is known as node %d within ns-3", pt.get_cname(), pt.extension<NetPointNs3>()->node_num);
});
surf::on_cluster.connect(&clusterCreation_cb);
{
static std::vector<std::string> socket_to_destroy;
- /* If there are no running flows, advance the NS3 simulator and return */
+ /* If there are no running flows, advance the ns-3 simulator and return */
if (get_started_action_set()->empty()) {
while(double_positive(now - ns3::Simulator::Now().GetSeconds(), sg_surf_precision))
}
void LinkNS3::set_bandwidth_profile(profile::Profile* profile)
{
- xbt_die("The NS3 network model doesn't support bandwidth profiles");
+ xbt_die("The ns-3 network model doesn't support bandwidth profiles");
}
void LinkNS3::set_latency_profile(profile::Profile* profile)
{
- xbt_die("The NS3 network model doesn't support latency profiles");
+ xbt_die("The ns-3 network model doesn't support latency profiles");
}
/**********
ns3::Ptr<ns3::Node> src_node = src->pimpl_netpoint->extension<NetPointNs3>()->ns3_node_;
ns3::Ptr<ns3::Node> dst_node = dst->pimpl_netpoint->extension<NetPointNs3>()->ns3_node_;
- xbt_assert(node2 < IPV4addr.size(), "Element %s is unknown to NS3. Is it connected to any one-hop link?",
+ xbt_assert(node2 < IPV4addr.size(), "Element %s is unknown to ns-3. Is it connected to any one-hop link?",
dst->pimpl_netpoint->get_cname());
std::string& addr = IPV4addr[node2];
- xbt_assert(not addr.empty(), "Element %s is unknown to NS3. Is it connected to any one-hop link?",
+ xbt_assert(not addr.empty(), "Element %s is unknown to ns-3. Is it connected to any one-hop link?",
dst->pimpl_netpoint->get_cname());
XBT_DEBUG("ns3: Create flow of %.0f Bytes from %u to %u with Interface %s", totalBytes, node1, node2, addr.c_str());
ns3::Simulator::Run ();
}
-
-// initialize the NS3 interface and environment
+// initialize the ns-3 interface and environment
void ns3_initialize(std::string TcpProtocol)
{
// tcpModel are:
XBT_DEBUG("Add router %u to cluster", nodes.GetN() - Nodes.GetN() - 1);
Nodes.Add(nodes.Get(nodes.GetN()-Nodes.GetN()-1));
- xbt_assert(Nodes.GetN() <= 65000, "Cluster with NS3 is limited to 65000 nodes");
+ xbt_assert(Nodes.GetN() <= 65000, "Cluster with ns-3 is limited to 65000 nodes");
ns3::CsmaHelper csma;
- csma.SetChannelAttribute("DataRate", ns3::DataRateValue(ns3::DataRate(bw * 8))); // NS3 takes bps, but we provide Bps
+ csma.SetChannelAttribute("DataRate", ns3::DataRateValue(ns3::DataRate(bw * 8))); // ns-3 takes bps, but we provide Bps
csma.SetChannelAttribute("Delay", ns3::TimeValue(ns3::Seconds(lat)));
ns3::NetDeviceContainer devices = csma.Install(Nodes);
XBT_DEBUG("Create CSMA");
XBT_DEBUG("\tAdd PTP from %d to %d bw:'%f Bps' lat:'%fs'", srcNum, dstNum, bw, lat);
pointToPoint.SetDeviceAttribute("DataRate",
- ns3::DataRateValue(ns3::DataRate(bw * 8))); // NS3 takes bps, but we provide Bps
+ ns3::DataRateValue(ns3::DataRate(bw * 8))); // ns-3 takes bps, but we provide Bps
pointToPoint.SetChannelAttribute("Delay", ns3::TimeValue(ns3::Seconds(lat)));
ns3::NetDeviceContainer netA;
/* While not all is buffered and there remain space in the buffers */
while (flow->buffered_bytes_ < flow->total_bytes_ && sock->GetTxAvailable() > 0) {
- // Send at most 1040 bytes (data size in a TCP packet), as NS3 seems to not split correctly by itself
+ // Send at most 1040 bytes (data size in a TCP packet), as ns-3 seems to not split correctly by itself
uint32_t toWrite = std::min({flow->remaining_, sock->GetTxAvailable(), std::uint32_t(1040)});
if (toWrite == 0) { // buffer full
XBT_DEBUG("%f: buffer full on flow %p (still %u to go)", ns3::Simulator::Now().GetSeconds(), flow,
{
SgFlow* flow = getFlowFromSocket(socket);
XBT_DEBUG("errorClose_cb of F[%p, %p, %u]", flow, flow->action_, flow->total_bytes_);
- xbt_die("NS3: a socket was closed anormally");
+ xbt_die("ns-3: a socket was closed anormally");
}
static void succeededConnect_callback(ns3::Ptr<ns3::Socket> socket)
{
SgFlow* mysocket = getFlowFromSocket(socket);
XBT_DEBUG("failedConnect_cb of F[%p, %p, %u]", mysocket, mysocket->action_, mysocket->total_bytes_);
- xbt_die("NS3: a socket failed to connect");
+ xbt_die("ns-3: a socket failed to connect");
}
void start_flow(ns3::Ptr<ns3::Socket> sock, const char* to, uint16_t port_number)
/* Don't forget to update the option description in smx_config when you change this */
const std::vector<surf_model_description_t> surf_network_model_description = {
- {"LV08", "Realistic network analytic model (slow-start modeled by multiplying latency by 13.01, bandwidth by .97; "
- "bottleneck sharing uses a payload of S=20537 for evaluating RTT). ",
+ {"LV08",
+ "Realistic network analytic model (slow-start modeled by multiplying latency by 13.01, bandwidth by .97; "
+ "bottleneck sharing uses a payload of S=20537 for evaluating RTT). ",
&surf_network_model_init_LegrandVelho},
- {"Constant", "Simplistic network model where all communication take a constant time (one second). This model "
- "provides the lowest realism, but is (marginally) faster.",
+ {"Constant",
+ "Simplistic network model where all communication take a constant time (one second). This model "
+ "provides the lowest realism, but is (marginally) faster.",
&surf_network_model_init_Constant},
- {"SMPI", "Realistic network model specifically tailored for HPC settings (accurate modeling of slow start with "
- "correction factors on three intervals: < 1KiB, < 64 KiB, >= 64 KiB)",
+ {"SMPI",
+ "Realistic network model specifically tailored for HPC settings (accurate modeling of slow start with "
+ "correction factors on three intervals: < 1KiB, < 64 KiB, >= 64 KiB)",
&surf_network_model_init_SMPI},
{"IB", "Realistic network model specifically tailored for HPC settings, with Infiniband contention model",
&surf_network_model_init_IB},
- {"CM02", "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of "
- "small messages are thus poorly modeled).",
+ {"CM02",
+ "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of "
+ "small messages are thus poorly modeled).",
&surf_network_model_init_CM02},
- {"NS3", "Network pseudo-model using the NS3 tcp model instead of an analytic model", &surf_network_model_init_NS3},
+ {"ns-3", "Network pseudo-model using the ns-3 tcp model instead of an analytic model",
+ &surf_network_model_init_NS3},
};
#if ! HAVE_SMPI
#endif
#if !SIMGRID_HAVE_NS3
void surf_network_model_init_NS3() {
- xbt_die("Please activate NS3 support in cmake and install the dependencies to use the NS3 network model.");
+ xbt_die("Please activate ns-3 support in cmake and install the dependencies to use the NS3 network model.");
}
#endif
#endif
#if SIMGRID_HAVE_NS3
- XBT_HELP(" NS3 support compiled in.");
+ XBT_HELP(" ns-3 support compiled in.");
#else
- XBT_HELP(" NS3 support disabled at compilation.");
+ XBT_HELP(" ns-3 support disabled at compilation.");
#endif
#if SIMGRID_HAVE_JEDULE
-# Try to find the NS3 library.
+# Try to find the ns-3 library.
#
# The user can hint a path using the NS3_HINT option.
#
# Once done, the following will be defined:
#
-# NS3_INCLUDE_DIRS - the NS3 include directories
+# NS3_INCLUDE_DIRS - the ns-3 include directories
# NS3_LIBRARY_PATH - path to the libs
-# NS3_LIBRARIES - link these to use NS3 (full path to libs)
+# NS3_LIBRARIES - link these to use ns-3 (full path to libs)
#
# This could be improved in many ways (patches welcome):
-# - No way to specify a minimal version (v3.10 is hardcoded).
+# - No way to specify a minimal version (v3.26 is hardcoded).
# - No proper find_package() integration
-## ADDING A NS3 VERSION.
+## ADDING A ns-3 VERSION.
# - Add "ns3.${version}-core ns3.${version}-core-debug ns3.${version}-core-optimized" to the NAME line of the find_library below
# - Add "include/ns3{version}" to the PATH_SUFFIXES line of the find_path below
set(NS3_HINT ${ns3_path} CACHE PATH "Path to search for NS3 lib and include")
find_library(NS3_LIBRARIES
- NAME ns3-core ns3.14-core ns3.15-core ns3.16-core ns3.17-core ns3.18-core ns3.19-core ns3.20-core ns3.21-core ns3.22-core ns3.25-core ns3.26-core ns3.26-core-optimized ns3.26-core-debug ns3.27-core ns3.27-core-optimized ns3.27-core-debug ns3.28-core ns3.28-core-optimized ns3.28-core-debug ns3.29-core ns3.29-core-optimized ns3.29-core-debug
+ NAME ns3-core
+ ns3.26-core ns3.26-core-optimized ns3.26-core-debug
+ ns3.27-core ns3.27-core-optimized ns3.27-core-debug
+ ns3.28-core ns3.28-core-optimized ns3.28-core-debug
+ ns3.29-core ns3.29-core-optimized ns3.29-core-debug
+ ns3.30-core ns3.30-core-optimized ns3.30-core-debug
+ ns3.31-core ns3.31-core-optimized ns3.31-core-debug
+ ns3.32-core ns3.32-core-optimized ns3.32-core-debug
+ ns3.33-core ns3.33-core-optimized ns3.33-core-debug
+ ns3.34-core ns3.34-core-optimized ns3.34-core-debug
PATH_SUFFIXES lib64 lib ns3/lib
PATHS
${NS3_HINT}
find_path(NS3_INCLUDE_DIR
NAME ns3/core-module.h
- PATH_SUFFIXES include ns3/include include/ns3.14 include/ns3.15 include/ns3.16 include/ns3.17 include/ns3.18 include/ns3.19 include/ns3.20 include/ns3.21 include/ns3.22 include/ns3.25 include/ns3.26 include/ns3.27 include/ns3.28 include/ns3.29
+ PATH_SUFFIXES include ns3/include include/ns3.26 include/ns3.27 include/ns3.28 include/ns3.29 include/ns3.30 include/ns3.31 include/ns3.32 include/ns3.33 include/ns3.34
PATHS
${NS3_HINT}
)
link_directories(${NS3_LIBRARY_PATH})
include_directories(${NS3_INCLUDE_DIR})
else()
- message(STATUS "Warning: To use NS-3 Please install ns3 at least version 3.10 (http://www.nsnam.org/releases/)")
+ message(STATUS "Warning: To use ns-3 in SimGrid, please install ns-3 at least version 3.26 (http://www.nsnam.org/releases/)")
endif()
###
option(enable_documentation "Whether to produce documentation" off)
-option(enable_ns3 "Whether ns3 model is activated." off)
+option(enable_ns3 "Whether ns-3 model is activated." off)
option(enable_java "Whether the Java bindings are activated." off)
option(enable_lib_in_jar "Whether the native libraries are bundled in a Java jar file" on)
option(minimal-bindings "Whether to compile the bindings libraries (Java/Python) with the minimal dependency set" off)
}
get_ns3(){
- found=$(grep -c "NS-3 found" ./consoleText)
+ found=$(grep -c "ns-3 found" ./consoleText)
if [ $found != 0 ]; then
echo "✔"
else
}
}</script>
<table id=configuration-matrix>
-<tr class=matrix-row> <td class=matrix-header style=min-width:75px onclick='sortTable(0);'>Name of the Builder</td><td class=matrix-header style=min-width:75px onclick='sortTable(1);'>OS</td><td class=matrix-header style=min-width:75px onclick='sortTable(2);'>Compiler</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(3, 'version');\">Boost</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(4,'version');\">Java</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(5,'version');\">Cmake</td><td class=matrix-header style=min-width:50px onclick='sortTable(6);'>NS3</td><td class=matrix-header style=min-width:50px onclick='sortTable(7);'>Python</td></tr>"
+<tr class=matrix-row> <td class=matrix-header style=min-width:75px onclick='sortTable(0);'>Name of the Builder</td><td class=matrix-header style=min-width:75px onclick='sortTable(1);'>OS</td><td class=matrix-header style=min-width:75px onclick='sortTable(2);'>Compiler</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(3, 'version');\">Boost</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(4,'version');\">Java</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(5,'version');\">Cmake</td><td class=matrix-header style=min-width:50px onclick='sortTable(6);'>ns-3</td><td class=matrix-header style=min-width:50px onclick='sortTable(7);'>Python</td></tr>"
for node in "${nodes[@]}"
do