From 6cf080d88528924906f317ce386f57ddf543cba1 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 15 Jun 2019 23:13:41 +0200 Subject: [PATCH] Cosmetics around ns-3 This is why I don't convert the rest of the doc. Each time I start an easy task in this area, I get swamped in cleanups with no end. --- CMakeLists.txt | 8 +- ChangeLog | 1 + docs/source/index.rst | 2 +- docs/source/ns3.rst | 121 ++++++++---------- examples/deprecated/msg/README.doc | 2 +- .../msg/network-ns3/network-ns3.tesh | 34 ++--- examples/platforms/dogbone.xml | 2 +- .../small_platform_one_link_routes.xml | 4 +- include/simgrid/config.h.in | 2 +- include/simgrid/kernel/resource/Model.hpp | 2 +- src/surf/network_ns3.cpp | 37 +++--- src/surf/ns3/ns3_simulator.cpp | 6 +- src/surf/surf_interface.cpp | 29 +++-- tools/cmake/Modules/FindNS3.cmake | 25 ++-- tools/cmake/Option.cmake | 2 +- tools/jenkins/project_description.sh | 4 +- 16 files changed, 141 insertions(+), 140 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed680f238c..ea2368a59f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,7 +226,7 @@ if(enable_ns3) 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() @@ -405,7 +405,7 @@ mark_as_advanced(PATH_LIBDW_H) 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) @@ -918,9 +918,9 @@ message(" with LTO ....................: ${enable_lto}") 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}) diff --git a/ChangeLog b/ChangeLog index 9680036ca2..f853bce634 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ General: - 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. diff --git a/docs/source/index.rst b/docs/source/index.rst index e2ec137a73..37a0dfecb3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -31,11 +31,11 @@ Welcome to SimGrid's documentation!    The Java Bindings Describing the Simulated Platform    Modeling Hints -    ns-3 as a SimGrid model    DTD Reference Describing the Experimental Scenario    Configuring SimGrid The SimGrid Models +    ns-3 as a SimGrid model Simulation Outcomes Use Cases and Howto The SimGrid Community diff --git a/docs/source/ns3.rst b/docs/source/ns3.rst index 5e3cb563aa..b7a53397fd 100644 --- a/docs/source/ns3.rst +++ b/docs/source/ns3.rst @@ -3,28 +3,29 @@ ns-3 as a SimGrid model ####################### -You can use the well-known `ns-3 `_ 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 +`_ 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 @@ -33,12 +34,11 @@ You can also install it from scratch with the following commands: For more information, please refer to the ns-3 documentation (`official website `_). -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 @@ -47,26 +47,36 @@ NS3_HINT configuration item. 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 @@ -82,14 +92,14 @@ example of invalid 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 @@ -112,25 +122,25 @@ ns-3 will find the path from point to point. Once your platform is OK, just change the :ref:`network/model -` configuration option to "NS3" as follows. The rest +` 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 `_. Check the file `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 @@ -138,39 +148,16 @@ platform. However, there are some known caveats: 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. diff --git a/examples/deprecated/msg/README.doc b/examples/deprecated/msg/README.doc index e2ffbeb8c0..29f3a75545 100644 --- a/examples/deprecated/msg/README.doc +++ b/examples/deprecated/msg/README.doc @@ -95,7 +95,7 @@ They have to be run with the following options: @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 diff --git a/examples/deprecated/msg/network-ns3/network-ns3.tesh b/examples/deprecated/msg/network-ns3/network-ns3.tesh index 812d1b1b51..61400ac4b3 100644 --- a/examples/deprecated/msg/network-ns3/network-ns3.tesh +++ b/examples/deprecated/msg/network-ns3/network-ns3.tesh @@ -1,24 +1,24 @@ #!/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 @@ -26,16 +26,16 @@ $ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_route 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 @@ -43,14 +43,14 @@ $ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/dogbone.xml ${srcdir}/network 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 diff --git a/examples/platforms/dogbone.xml b/examples/platforms/dogbone.xml index f8f73613c1..1b909387b7 100644 --- a/examples/platforms/dogbone.xml +++ b/examples/platforms/dogbone.xml @@ -10,7 +10,7 @@ -- 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. -- diff --git a/examples/platforms/small_platform_one_link_routes.xml b/examples/platforms/small_platform_one_link_routes.xml index a7490b016e..c0c79d99f4 100644 --- a/examples/platforms/small_platform_one_link_routes.xml +++ b/examples/platforms/small_platform_one_link_routes.xml @@ -1,8 +1,8 @@ - + diff --git a/include/simgrid/config.h.in b/include/simgrid/config.h.in index bbb7aa0355..37ce3633ed 100644 --- a/include/simgrid/config.h.in +++ b/include/simgrid/config.h.in @@ -39,7 +39,7 @@ SG_END_DECL() #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 */ diff --git a/include/simgrid/kernel/resource/Model.hpp b/include/simgrid/kernel/resource/Model.hpp index a45f4ef5e8..5d4990a27a 100644 --- a/include/simgrid/kernel/resource/Model.hpp +++ b/include/simgrid/kernel/resource/Model.hpp @@ -93,7 +93,7 @@ public: /** @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; } diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index b481aae544..36b798db18 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -30,7 +30,7 @@ #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 IPV4addr; @@ -74,9 +74,9 @@ static void clusterCreation_cb(simgrid::kernel::routing::ClusterCreationArgs con // 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(); - 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; @@ -104,15 +104,15 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin NetPointNs3* host_src = src->extension(); NetPointNs3* host_dst = dst->extension(); - 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 " @@ -142,7 +142,7 @@ void surf_network_model_init_NS3() } static simgrid::config::Flag - 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 { @@ -151,7 +151,7 @@ namespace resource { 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); @@ -161,7 +161,7 @@ NetworkNS3Model::NetworkNS3Model() : NetworkModel(Model::UpdateAlgo::FULL) routing::NetPoint::on_creation.connect([](routing::NetPoint& pt) { pt.extension_set(new NetPointNs3()); - XBT_VERB("SimGrid's %s is known as node %d within NS3", pt.get_cname(), pt.extension()->node_num); + XBT_VERB("SimGrid's %s is known as node %d within ns-3", pt.get_cname(), pt.extension()->node_num); }); surf::on_cluster.connect(&clusterCreation_cb); @@ -210,7 +210,7 @@ void NetworkNS3Model::update_actions_state(double now, double delta) { static std::vector 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)) @@ -283,11 +283,11 @@ void LinkNS3::apply_event(profile::Event* event, double value) } 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"); } /********** @@ -307,10 +307,10 @@ NetworkNS3Action::NetworkNS3Action(Model* model, double totalBytes, s4u::Host* s ns3::Ptr src_node = src->pimpl_netpoint->extension()->ns3_node_; ns3::Ptr dst_node = dst->pimpl_netpoint->extension()->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()); @@ -360,8 +360,7 @@ void ns3_simulator(double maxSeconds) ns3::Simulator::Run (); } - -// initialize the NS3 interface and environment +// initialize the ns-3 interface and environment void ns3_initialize(std::string TcpProtocol) { // tcpModel are: @@ -405,9 +404,9 @@ void ns3_add_cluster(const char* id, double bw, double lat) { 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"); @@ -448,7 +447,7 @@ void ns3_add_link(NetPointNs3* src, NetPointNs3* dst, double bw, double lat) { 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; diff --git a/src/surf/ns3/ns3_simulator.cpp b/src/surf/ns3/ns3_simulator.cpp index 19297c65d7..019ef94cb4 100644 --- a/src/surf/ns3/ns3_simulator.cpp +++ b/src/surf/ns3/ns3_simulator.cpp @@ -57,7 +57,7 @@ static void send_cb(ns3::Ptr sock, uint32_t txSpace) /* 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, @@ -102,7 +102,7 @@ static void errorClose_callback(ns3::Ptr socket) { 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 socket) @@ -115,7 +115,7 @@ static void failedConnect_callback(ns3::Ptr 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 sock, const char* to, uint16_t port_number) diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 13fb7de2e7..b657ce6380 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -54,21 +54,26 @@ XBT_PUBLIC void simgrid_add_plugin_description(const char* name, const char* des /* Don't forget to update the option description in smx_config when you change this */ const std::vector 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 @@ -81,7 +86,7 @@ void surf_network_model_init_IB() { #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 @@ -250,9 +255,9 @@ void sg_version() #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 diff --git a/tools/cmake/Modules/FindNS3.cmake b/tools/cmake/Modules/FindNS3.cmake index 1d5adfa3d9..27b80e7386 100644 --- a/tools/cmake/Modules/FindNS3.cmake +++ b/tools/cmake/Modules/FindNS3.cmake @@ -1,18 +1,18 @@ -# 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 @@ -20,7 +20,16 @@ set(SIMGRID_HAVE_NS3 0) 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} @@ -28,7 +37,7 @@ find_library(NS3_LIBRARIES 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} ) @@ -82,5 +91,5 @@ if(SIMGRID_HAVE_NS3) 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() diff --git a/tools/cmake/Option.cmake b/tools/cmake/Option.cmake index 08bd1e957f..3295e0b538 100644 --- a/tools/cmake/Option.cmake +++ b/tools/cmake/Option.cmake @@ -24,7 +24,7 @@ option(enable_debug "Turn this off to remove all debug messages ### 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) diff --git a/tools/jenkins/project_description.sh b/tools/jenkins/project_description.sh index 4cd5829d38..afc1a8c2f4 100755 --- a/tools/jenkins/project_description.sh +++ b/tools/jenkins/project_description.sh @@ -17,7 +17,7 @@ get_cmake(){ } get_ns3(){ - found=$(grep -c "NS-3 found" ./consoleText) + found=$(grep -c "ns-3 found" ./consoleText) if [ $found != 0 ]; then echo "✔" else @@ -123,7 +123,7 @@ function sortTable(n, type) { } } -" +" for node in "${nodes[@]}" do -- 2.20.1
Name of the BuilderOSCompilerBoostJavaCmakeNS3Python
Name of the BuilderOSCompilerBoostJavaCmakens-3Python