Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'Adrien.Gougeon/simgrid-master'
authorAugustin Degomme <adegomme@gmail.com>
Tue, 15 Dec 2020 09:44:33 +0000 (10:44 +0100)
committerAugustin Degomme <adegomme@gmail.com>
Tue, 15 Dec 2020 09:44:33 +0000 (10:44 +0100)
1  2 
MANIFEST.in
examples/s4u/CMakeLists.txt
src/kernel/routing/RoutedZone.cpp
src/surf/network_ns3.cpp
tools/cmake/DefinePackages.cmake

diff --combined MANIFEST.in
@@@ -254,6 -254,7 +254,6 @@@ include examples/deprecated/java/trace/
  include examples/deprecated/java/trace/pingpong/Receiver.java
  include examples/deprecated/java/trace/pingpong/Sender.java
  include examples/deprecated/java/trace/pingpong/trace-pingpong.tesh
 -include examples/deprecated/msg/README.doc
  include examples/deprecated/msg/mc/bugged2-liveness.tesh
  include examples/deprecated/msg/mc/bugged2_liveness.c
  include examples/deprecated/msg/mc/centralized_mutex.c
@@@ -261,6 -262,18 +261,6 @@@ include examples/deprecated/msg/mc/cent
  include examples/deprecated/msg/mc/deploy_bugged2_liveness.xml
  include examples/deprecated/msg/mc/deploy_centralized_mutex.xml
  include examples/deprecated/msg/mc/promela_bugged2_liveness
 -include examples/deprecated/msg/trace-categories/trace-categories.c
 -include examples/deprecated/msg/trace-categories/trace-categories.tesh
 -include examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.c
 -include examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.tesh
 -include examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.c
 -include examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.tesh
 -include examples/deprecated/msg/trace-masterworker/trace-masterworker.c
 -include examples/deprecated/msg/trace-masterworker/trace-masterworker.tesh
 -include examples/deprecated/msg/trace-process-migration/trace-process-migration.c
 -include examples/deprecated/msg/trace-process-migration/trace-process-migration.tesh
 -include examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.c
 -include examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.tesh
  include examples/deprecated/simdag/dag-dotload/dag.dot
  include examples/deprecated/simdag/dag-dotload/dag_with_cycle.dot
  include examples/deprecated/simdag/dag-dotload/sd_dag-dotload.c
@@@ -460,6 -473,8 +460,8 @@@ include examples/s4u/mc-electric-fence/
  include examples/s4u/mc-electric-fence/s4u-mc-electric-fence.tesh
  include examples/s4u/mc-failing-assert/s4u-mc-failing-assert.cpp
  include examples/s4u/mc-failing-assert/s4u-mc-failing-assert.tesh
+ include examples/s4u/network-ns3-wifi/s4u-network-ns3-wifi.cpp
+ include examples/s4u/network-ns3-wifi/s4u-network-ns3-wifi.tesh
  include examples/s4u/network-ns3/3hosts_2links_d.xml
  include examples/s4u/network-ns3/3links-timer_d.xml
  include examples/s4u/network-ns3/3links_d.xml
@@@ -506,20 -521,8 +508,20 @@@ include examples/s4u/synchro-mutex/s4u-
  include examples/s4u/synchro-mutex/s4u-synchro-mutex.tesh
  include examples/s4u/synchro-semaphore/s4u-synchro-semaphore.cpp
  include examples/s4u/synchro-semaphore/s4u-synchro-semaphore.tesh
 +include examples/s4u/trace-categories/s4u-trace-categories.cpp
 +include examples/s4u/trace-categories/s4u-trace-categories.tesh
 +include examples/s4u/trace-host-user-variables/s4u-trace-host-user-variables.cpp
 +include examples/s4u/trace-host-user-variables/s4u-trace-host-user-variables.tesh
 +include examples/s4u/trace-link-user-variables/s4u-trace-link-user-variables.cpp
 +include examples/s4u/trace-link-user-variables/s4u-trace-link-user-variables.tesh
 +include examples/s4u/trace-masterworkers/s4u-trace-masterworkers.cpp
 +include examples/s4u/trace-masterworkers/s4u-trace-masterworkers.tesh
  include examples/s4u/trace-platform/s4u-trace-platform.cpp
  include examples/s4u/trace-platform/s4u-trace-platform.tesh
 +include examples/s4u/trace-process-migration/s4u-trace-process-migration.cpp
 +include examples/s4u/trace-process-migration/s4u-trace-process-migration.tesh
 +include examples/s4u/trace-route-user-variables/s4u-trace-route-user-variables.cpp
 +include examples/s4u/trace-route-user-variables/s4u-trace-route-user-variables.tesh
  include examples/smpi/NAS/DGraph.c
  include examples/smpi/NAS/DGraph.h
  include examples/smpi/NAS/README.install
@@@ -738,9 -741,6 +740,9 @@@ include teshsuite/s4u/trace-integration
  include teshsuite/s4u/trace-integration/test-hbp2.5-hbp1.5.xml
  include teshsuite/s4u/trace-integration/trace-integration.cpp
  include teshsuite/s4u/trace-integration/trace-integration.tesh
 +include teshsuite/s4u/vm-live-migration/platform.xml
 +include teshsuite/s4u/vm-live-migration/vm-live-migration.cpp
 +include teshsuite/s4u/vm-live-migration/vm-live-migration.tesh
  include teshsuite/s4u/wait-any-for/wait-any-for.cpp
  include teshsuite/s4u/wait-any-for/wait-any-for.tesh
  include teshsuite/simdag/availability/availability.c
@@@ -1892,6 -1892,7 +1894,6 @@@ include examples/c/CMakeLists.tx
  include examples/deprecated/java/.classpath
  include examples/deprecated/java/.project
  include examples/deprecated/java/CMakeLists.txt
 -include examples/deprecated/msg/CMakeLists.txt
  include examples/deprecated/msg/mc/CMakeLists.txt
  include examples/deprecated/simdag/CMakeLists.txt
  include examples/platforms/bypassRoute.xml
@@@ -1969,6 -1970,7 +1971,7 @@@ include examples/platforms/two_peers.xm
  include examples/platforms/vivaldi.xml
  include examples/platforms/wifi.xml
  include examples/platforms/wifi_energy.xml
+ include examples/platforms/wifi_ns3.xml
  include examples/python/CMakeLists.txt
  include examples/python/actor-create/actor-create_d.xml
  include examples/python/actor-lifetime/actor-lifetime_d.xml
@@@ -2027,6 -2029,7 +2030,6 @@@ include include/simgrid/plugins/energy.
  include include/simgrid/plugins/file_system.h
  include include/simgrid/plugins/live_migration.h
  include include/simgrid/plugins/load.h
 -include include/simgrid/plugins/load_balancer.h
  include include/simgrid/s4u.hpp
  include include/simgrid/s4u/Activity.hpp
  include include/simgrid/s4u/Actor.hpp
@@@ -2244,8 -2247,6 +2247,8 @@@ include src/kernel/resource/profile/Fut
  include src/kernel/resource/profile/Profile.cpp
  include src/kernel/resource/profile/Profile.hpp
  include src/kernel/resource/profile/Profile_test.cpp
 +include src/kernel/resource/profile/StochasticDatedValue.cpp
 +include src/kernel/resource/profile/StochasticDatedValue.hpp
  include src/kernel/routing/ClusterZone.cpp
  include src/kernel/routing/DijkstraZone.cpp
  include src/kernel/routing/DragonflyZone.cpp
@@@ -2267,6 -2268,7 +2270,6 @@@ include src/mc/Session.hp
  include src/mc/Transition.hpp
  include src/mc/VisitedState.cpp
  include src/mc/VisitedState.hpp
 -include src/mc/checker/Checker.cpp
  include src/mc/checker/Checker.hpp
  include src/mc/checker/CommunicationDeterminismChecker.cpp
  include src/mc/checker/CommunicationDeterminismChecker.hpp
@@@ -2295,11 -2297,10 +2298,11 @@@ include src/mc/inspect/mc_member.cp
  include src/mc/inspect/mc_unw.cpp
  include src/mc/inspect/mc_unw.hpp
  include src/mc/inspect/mc_unw_vmread.cpp
 +include src/mc/mc_api.cpp
 +include src/mc/mc_api.hpp
  include src/mc/mc_base.cpp
  include src/mc/mc_base.h
  include src/mc/mc_client_api.cpp
 -include src/mc/mc_comm_pattern.cpp
  include src/mc/mc_comm_pattern.hpp
  include src/mc/mc_config.cpp
  include src/mc/mc_config.hpp
@@@ -2310,7 -2311,6 +2313,7 @@@ include src/mc/mc_hash.cp
  include src/mc/mc_hash.hpp
  include src/mc/mc_ignore.hpp
  include src/mc/mc_mmu.hpp
 +include src/mc/mc_pattern.hpp
  include src/mc/mc_private.hpp
  include src/mc/mc_record.cpp
  include src/mc/mc_record.hpp
@@@ -2582,6 -2582,9 +2585,6 @@@ include src/smpi/plugins/ampi/ampi.cp
  include src/smpi/plugins/ampi/ampi.hpp
  include src/smpi/plugins/ampi/instr_ampi.cpp
  include src/smpi/plugins/ampi/instr_ampi.hpp
 -include src/smpi/plugins/load_balancer/LoadBalancer.cpp
 -include src/smpi/plugins/load_balancer/load_balancer.hpp
 -include src/smpi/plugins/sampi_loadbalancer.cpp
  include src/smpi/smpi_main.c
  include src/smpi/smpi_replay_main.cpp
  include src/smpi/smpicc.in
@@@ -27,11 -27,14 +27,11 @@@ foreach (example mc-bugged1 mc-bugged2 
    set(_${example}_factories "ucontext;raw;boost")
  endforeach()
  
 -set(_mc-bugged1-liveness_disable 1) 
  if(SIMGRID_HAVE_MC)
     add_executable       (s4u-mc-bugged1-liveness  EXCLUDE_FROM_ALL mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp)
     target_link_libraries(s4u-mc-bugged1-liveness  simgrid)
     set_target_properties(s4u-mc-bugged1-liveness PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness)
     add_dependencies(tests s4u-mc-bugged1-liveness)
 -   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp)
 -   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness.tesh)
   
    if(HAVE_C_STACK_CLEANER)
      add_executable       (s4u-mc-bugged1-liveness-cleaner-on  EXCLUDE_FROM_ALL s4u-mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp)
@@@ -44,6 -47,7 +44,6 @@@
      set_target_properties(s4u-mc-bugged1-liveness-cleaner-off PROPERTIES COMPILE_FLAGS "-DGARBAGE_STACK -fno-stack-cleaner")
      add_dependencies(tests s4u-mc-bugged1-liveness-cleaner-off)
    endif()
 -
  endif()
  
  if(SIMGRID_HAVE_NS3)
    target_link_libraries(s4u-network-ns3 simgrid)
    set_target_properties(s4u-network-ns3  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3)
    add_dependencies(tests s4u-network-ns3)
+   add_executable       (s4u-network-ns3-wifi EXCLUDE_FROM_ALL network-ns3-wifi/s4u-network-ns3-wifi.cpp)
+   target_link_libraries(s4u-network-ns3-wifi simgrid)
+   set_target_properties(s4u-network-ns3-wifi  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3-wifi)
+   add_dependencies(tests s4u-network-ns3-wifi)
  endif()
  
  # Deal with each example
@@@ -66,7 -74,7 +70,7 @@@ foreach (example actor-create actor-dae
                   engine-filtering
                   exec-async exec-basic exec-dvfs exec-ptask exec-remote exec-waitany exec-waitfor exec-dependent
                   maestro-set
 -                 mc-bugged1 mc-bugged1-liveness mc-bugged2 mc-electric-fence mc-failing-assert
 +                 mc-bugged1 mc-bugged2 mc-electric-fence mc-failing-assert
                 network-wifi
                   io-async io-file-system io-file-remote io-disk-raw io-dependent
                   platform-failures platform-profile platform-properties
                                        ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example}/s4u-${example}.tesh)
    else()
      message(STATUS "Example ${example} disabled, thus not compiled.")
 -    unset(_${example}_disabled)
 +    unset(_${example}_disable)
    endif()
  
    set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-${example}.tesh)
@@@ -179,12 -187,16 +183,17 @@@ if(SIMGRID_HAVE_NS3
                                       --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u
                                       --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
                                       ${CMAKE_HOME_DIRECTORY}/examples/s4u/network-ns3/s4u-network-ns3.tesh)
+   ADD_TESH_FACTORIES(s4u-network-ns3-wifi "thread;ucontext;raw;boost"
+                                      --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/s4u
+                                      --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u
+                                      --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+                                      ${CMAKE_HOME_DIRECTORY}/examples/s4u/network-ns3-wifi/s4u-network-ns3-wifi.tesh)
  endif()
  # Examples not accepting factories
  ##################################
  
 -foreach (example trace-platform)
 +foreach (example trace-categories trace-masterworkers trace-platform trace-process-migration
 +                 trace-host-user-variables trace-link-user-variables trace-route-user-variables)
    add_executable       (s4u-${example} EXCLUDE_FROM_ALL ${example}/s4u-${example}.cpp)
    target_link_libraries(s4u-${example} simgrid)
    set_target_properties(s4u-${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
    set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-${example}.cpp)
    
    ADD_TESH(s4u-${example} --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example}
 +                          --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example}
                            --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
 +                          --cd ${CMAKE_CURRENT_BINARY_DIR}/${example}
                            ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example}/s4u-${example}.tesh)
  endforeach()
  
@@@ -206,21 -216,15 +215,23 @@@ if (NOT enable_memcheck AND NOT WIN32
                              ${CMAKE_CURRENT_SOURCE_DIR}/app-pingpong/simix-breakpoint.tesh)
  endif()
  
 +if(enable_coverage AND SIMGRID_HAVE_MC)
 +  foreach (example mc-bugged1 mc-bugged2 mc-electric-fence mc-failing-assert)
 +    ADD_TEST(cover-${example} ${CMAKE_CURRENT_BINARY_DIR}/${example}/s4u-${example} ${CMAKE_HOME_DIRECTORY}/examples/platforms/model_checker_platform.xml)
 +  endforeach()
 +  ADD_TEST(cover-mc-bugged1-liveness ${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness ${CMAKE_HOME_DIRECTORY}/examples/platforms/small_platform.xml 1 1001)
 +endif()
 +
  # Add all extra files to the archive
  ####################################
 -
 -set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/s4u-network-ns3.cpp
 +set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/s4u-network-ns3.cpp              PARENT_SCOPE)
++                                  ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/s4u-network-ns3.cpp              
+                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3-wifi/s4u-network-ns3-wifi.cpp              PARENT_SCOPE)
  set(tesh_files    ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/app-pingpong/simix-breakpoint.tesh
 +                                  ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness.tesh
                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness-visited.tesh
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/s4u-network-ns3.tesh             PARENT_SCOPE)
+                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/s4u-network-ns3.tesh
+                                   ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3-wifi/s4u-network-ns3-wifi.tesh             PARENT_SCOPE)
  set(xml_files     ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-actor-create_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actor-yield/s4u-actor-yield_d.xml
@@@ -68,9 -68,9 +68,9 @@@ void RoutedZone::get_graph(const s_xbt_
        if (my_src == my_dst)
          continue;
  
 -      auto* route = new RouteCreationArgs();
 +      RouteCreationArgs route;
  
 -      get_local_route(my_src, my_dst, route, nullptr);
 +      get_local_route(my_src, my_dst, &route, nullptr);
  
        XBT_DEBUG("get_route_and_latency %s -> %s", my_src->get_cname(), my_dst->get_cname());
  
        const char *previous_name;
        const char *current_name;
  
 -      if (route->gw_src) {
 -        previous      = new_xbt_graph_node(graph, route->gw_src->get_cname(), nodes);
 -        previous_name = route->gw_src->get_cname();
 +      if (route.gw_src) {
 +        previous      = new_xbt_graph_node(graph, route.gw_src->get_cname(), nodes);
 +        previous_name = route.gw_src->get_cname();
        } else {
          previous      = new_xbt_graph_node(graph, my_src->get_cname(), nodes);
          previous_name = my_src->get_cname();
        }
  
 -      for (auto const& link : route->link_list) {
 +      for (auto const& link : route.link_list) {
          const char* link_name = link->get_cname();
          current               = new_xbt_graph_node(graph, link_name, nodes);
          current_name          = link_name;
          previous_name = current_name;
        }
  
 -      if (route->gw_dst) {
 -        current      = new_xbt_graph_node(graph, route->gw_dst->get_cname(), nodes);
 -        current_name = route->gw_dst->get_cname();
 +      if (route.gw_dst) {
 +        current      = new_xbt_graph_node(graph, route.gw_dst->get_cname(), nodes);
 +        current_name = route.gw_dst->get_cname();
        } else {
          current      = new_xbt_graph_node(graph, my_dst->get_cname(), nodes);
          current_name = my_dst->get_cname();
        }
        new_xbt_graph_edge(graph, previous, current, edges);
        XBT_DEBUG("  %s -> %s", previous_name, current_name);
 -
 -      delete route;
      }
    }
  }
@@@ -172,6 -174,7 +172,7 @@@ void RoutedZone::add_route_check_params
      xbt_assert(not dst->is_netzone(),
                 "When defining a route, dst cannot be a netzone such as '%s'. Did you meant to have a NetzoneRoute?",
                 dstName);
+     s4u::NetZone::on_route_creation(symmetrical, src, dst, gw_src, gw_dst, link_list);
    } else {
      XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", srcName, gw_src->get_cname(), dstName, gw_dst->get_cname());
      xbt_assert(src->is_netzone(), "When defining a NetzoneRoute, src must be a netzone but '%s' is not", srcName);
                 gw_dst->get_cname(), dstName);
      xbt_assert(not link_list.empty(), "Empty route (between %s@%s and %s@%s) forbidden.", srcName, gw_src->get_cname(),
                 dstName, gw_dst->get_cname());
+     s4u::NetZone::on_route_creation(symmetrical,  gw_src, gw_dst, gw_src, gw_dst, link_list);
    }
-   s4u::NetZone::on_route_creation(symmetrical, src, dst, gw_src, gw_dst, link_list);
  }
  } // namespace routing
  } // namespace kernel
diff --combined src/surf/network_ns3.cpp
@@@ -28,6 -28,7 +28,7 @@@
  #include "ns3/ns3_simulator.hpp"
  
  #include "simgrid/kernel/routing/NetPoint.hpp"
+ #include "simgrid/kernel/routing/WifiZone.hpp"
  #include "simgrid/plugins/energy.h"
  #include "simgrid/s4u/Engine.hpp"
  #include "simgrid/s4u/NetZone.hpp"
@@@ -71,60 -72,88 +72,88 @@@ NetPointNs3::NetPointNs3() : ns3_node_(
    stack.Install(ns3_node_);
  }
  
- WifiZone::WifiZone(const std::string& name_, simgrid::s4u::Host* host_, ns3::Ptr<ns3::Node> ap_node_,
-                    ns3::Ptr<ns3::YansWifiChannel> channel_, int mcs_, int nss_, int network_, int link_)
-     : name(name_)
-     , host(host_)
-     , ap_node(ap_node_)
-     , channel(channel_)
-     , mcs(mcs_)
-     , nss(nss_)
-     , network(network_)
-     , link(link_)
- {
-   n_sta_nodes       = 0;
-   wifi_zones[name_] = this;
- }
+ /*************
+  * Callbacks *
+  *************/
  
- bool WifiZone::is_ap(ns3::Ptr<ns3::Node> node)
- {
-   for (std::pair<std::string, WifiZone*> zone : wifi_zones)
-     if (zone.second->get_ap_node() == node)
-       return true;
-   return false;
- }
+ static void zoneCreation_cb(simgrid::s4u::NetZone const& zone) {
+     simgrid::kernel::routing::WifiZone* wifizone = dynamic_cast<simgrid::kernel::routing::WifiZone*> (zone.get_impl());
+     if (wifizone == nullptr) return;
+     wifi.SetStandard(ns3::WIFI_PHY_STANDARD_80211n_5GHZ);
+     std::string ssid = wifizone->get_name();
+     const char* mcs = wifizone->get_property("mcs");
+     const char* nss = wifizone->get_property("nss");
+     int mcs_value = mcs ? atoi(mcs) : 3;
+     int nss_value = nss ? atoi(nss) : 1;
+     wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
+                                  "ControlMode", ns3::StringValue("HtMcs0"),
+                                  "DataMode", ns3::StringValue("HtMcs" + std::to_string(mcs_value)));
+     wifiPhy.SetChannel(wifiChannel.Create());
+     wifiPhy.Set("Antennas", ns3::UintegerValue(nss_value));
+     wifiPhy.Set("MaxSupportedTxSpatialStreams", ns3::UintegerValue(nss_value));
+     wifiPhy.Set("MaxSupportedRxSpatialStreams", ns3::UintegerValue(nss_value));
+     wifiMac.SetType("ns3::ApWifiMac",
+                     "Ssid", ns3::SsidValue(ssid));
  
- WifiZone* WifiZone::by_name(const std::string& name)
- {
-   WifiZone* zone;
-   try {
-     zone = wifi_zones.at(name);
-   } catch (const std::out_of_range& oor) {
-     return nullptr;
-   }
-   return zone;
- }
+     mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
+     ns3::Ptr<ns3::ListPositionAllocator> positionAllocS = ns3::CreateObject<ns3::ListPositionAllocator>();
+     positionAllocS->Add(ns3::Vector(0, 0, 255 * 100 * number_of_networks + 100 * number_of_links));
  
- std::unordered_map<std::string, WifiZone*> WifiZone::wifi_zones;
+     ns3::NetDeviceContainer netDevices;
+     NetPointNs3* access_point_netpoint_ns3 = wifizone->get_access_point()->extension<NetPointNs3>();
  
- static void initialize_ns3_wifi()
- {
-   wifi.SetStandard(ns3::WIFI_PHY_STANDARD_80211n_5GHZ);
+     ns3::Ptr<ns3::Node> access_point_ns3_node = access_point_netpoint_ns3->ns3_node_;
+     ns3::NodeContainer nodes = {access_point_ns3_node};
+     std::vector<NetPointNs3*> hosts_netpoints = {access_point_netpoint_ns3};
+     netDevices.Add(wifi.Install(wifiPhy, wifiMac,access_point_ns3_node));
  
-   for (auto host : simgrid::s4u::Engine::get_instance()->get_all_hosts()) {
-     const char* wifi_link = host->get_property("wifi_link");
-     const char* wifi_mcs  = host->get_property("wifi_mcs");
-     const char* wifi_nss  = host->get_property("wifi_nss");
+     wifiMac.SetType ("ns3::StaWifiMac",
+                      "Ssid", ns3::SsidValue(ssid),
+                      "ActiveProbing", ns3::BooleanValue(false));
  
-     if (wifi_link)
-       new WifiZone(wifi_link, host, host->get_netpoint()->extension<NetPointNs3>()->ns3_node_, wifiChannel.Create(),
-                    wifi_mcs ? atoi(wifi_mcs) : 3, wifi_nss ? atoi(wifi_nss) : 1, 0, 0);
-   }
- }
+     NetPointNs3* station_netpoint_ns3 = nullptr;
+     ns3::Ptr<ns3::Node> station_ns3_node = nullptr;
+     double distance;
+     double angle = 0;
+     int nb_stations = wifizone->get_all_hosts().size() - 1;
+     double step = 2 * M_PI / nb_stations;
+     for (auto station_host : wifizone->get_all_hosts()) {
+         station_netpoint_ns3 = station_host->get_netpoint()->extension<NetPointNs3>();
+         if (station_netpoint_ns3 == access_point_netpoint_ns3)
+             continue;
+         hosts_netpoints.push_back(station_netpoint_ns3);
+         distance = station_host->get_property("wifi_distance") ? atof(station_host->get_property("wifi_distance")) : 10.0;
+         positionAllocS->Add(ns3::Vector(distance * std::cos(angle), distance * std::sin(angle), 255 * 100 * number_of_networks + 100 * number_of_links));
+         angle += step;
+         station_ns3_node = station_netpoint_ns3->ns3_node_;
+         nodes.Add(station_ns3_node);
+         netDevices.Add(wifi.Install(wifiPhy, wifiMac, station_ns3_node));
+     }
  
- /*************
-  * Callbacks *
-  *************/
+     ns3::Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", ns3::UintegerValue(40));
+     mobility.SetPositionAllocator(positionAllocS);
+     mobility.Install(nodes);
+     ns3::Ipv4AddressHelper address;
+     std::string addr = simgrid::xbt::string_printf("%d.%d.0.0", number_of_networks, number_of_links);
+     address.SetBase(addr.c_str(), "255.255.0.0");
+     XBT_DEBUG("\tInterface stack '%s'", addr.c_str());
+     ns3::Ipv4InterfaceContainer addresses = address.Assign(netDevices);
+     for (int i = 0; i < hosts_netpoints.size(); i++) {
+         hosts_netpoints[i]->ipv4_address_ = transformIpv4Address(addresses.GetAddress(i));
+     }
+     if (number_of_links == 255) {
+       xbt_assert(number_of_networks < 255, "Number of links and networks exceed 255*255");
+       number_of_links = 1;
+       number_of_networks++;
+     } else {
+       number_of_links++;
+     }
+ }
  
  static void clusterCreation_cb(simgrid::kernel::routing::ClusterCreationArgs const& cluster)
  {
@@@ -271,6 -300,7 +300,7 @@@ NetworkNS3Model::NetworkNS3Model() : Ne
    });
    routing::on_cluster_creation.connect(&clusterCreation_cb);
    s4u::NetZone::on_route_creation.connect(&routeCreation_cb);
+   s4u::NetZone::on_seal.connect(&zoneCreation_cb);
  }
  
  LinkImpl* NetworkNS3Model::create_link(const std::string& name, const std::vector<double>& bandwidths, double latency,
@@@ -327,7 -357,7 +357,7 @@@ void NetworkNS3Model::update_actions_st
      ns3_socket                = elm.first;
      SgFlow* sgFlow            = elm.second;
      NetworkNS3Action * action = sgFlow->action_;
 -    XBT_DEBUG("Processing socket %p (action %p)",sgFlow,action);
 +    XBT_DEBUG("Processing flow %p (socket %s, action %p)", sgFlow, ns3_socket.c_str(), action);
      // Because NS3 stops as soon as a flow is finished, the other flows that ends at the same time may remains in an
      // inconsistent state (i.e. remains_ == 0 but finished_ == false).
      // However, SimGrid considers sometimes that an action with remains_ == 0 is finished.
@@@ -384,57 -414,6 +414,6 @@@ LinkNS3::LinkNS3(NetworkNS3Model* model
    bandwidth_.peak = bandwidth;
    latency_.peak   = latency;
  
-   /* If wifi, create the wifizone now. If not, don't do anything: the links will be created in routeCreate_cb */
-   if (policy == simgrid::s4u::Link::SharingPolicy::WIFI) {
-     static bool wifi_init = false;
-     if (!wifi_init) {
-       initialize_ns3_wifi();
-       wifi_init = true;
-     }
-     ns3::NetDeviceContainer netA;
-     WifiZone* zone = WifiZone::by_name(name);
-     xbt_assert(zone != nullptr, "Link name '%s' does not match the 'wifi_link' property of a host.", name.c_str());
-     auto* netpoint_ns3 = zone->get_host()->get_netpoint()->extension<NetPointNs3>();
-     wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "ControlMode", ns3::StringValue("HtMcs0"), "DataMode",
-                                  ns3::StringValue("HtMcs" + std::to_string(zone->get_mcs())));
-     wifiPhy.SetChannel(zone->get_channel());
-     wifiPhy.Set("Antennas", ns3::UintegerValue(zone->get_nss()));
-     wifiPhy.Set("MaxSupportedTxSpatialStreams", ns3::UintegerValue(zone->get_nss()));
-     wifiPhy.Set("MaxSupportedRxSpatialStreams", ns3::UintegerValue(zone->get_nss()));
-     wifiMac.SetType("ns3::ApWifiMac",
-                     "Ssid", ns3::SsidValue(name));
-     netA.Add(wifi.Install(wifiPhy, wifiMac, zone->get_ap_node()));
-     ns3::Ptr<ns3::ListPositionAllocator> positionAllocS = ns3::CreateObject<ns3::ListPositionAllocator>();
-     positionAllocS->Add(ns3::Vector(0, 0, 0));
-     mobility.SetPositionAllocator(positionAllocS);
-     mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
-     mobility.Install(zone->get_ap_node());
-     ns3::Ipv4AddressHelper address;
-     std::string addr = simgrid::xbt::string_printf("%d.%d.0.0", number_of_networks, number_of_links);
-     address.SetBase(addr.c_str(), "255.255.0.0");
-     XBT_DEBUG("\tInterface stack '%s'", addr.c_str());
-     auto addresses = address.Assign(netA);
-     zone->set_network(number_of_networks);
-     zone->set_link(number_of_links);
-     netpoint_ns3->ipv4_address_ = transformIpv4Address(addresses.GetAddress(1));
-     if (number_of_links == 255) {
-       xbt_assert(number_of_networks < 255, "Number of links and networks exceed 255*255");
-       number_of_links = 1;
-       number_of_networks++;
-     } else {
-       number_of_links++;
-     }
-   }
    s4u::Link::on_creation(*this->get_iface());
  }
  
@@@ -482,7 -461,7 +461,7 @@@ NetworkNS3Action::NetworkNS3Action(Mode
      }
    }
  
 -  static int port_number = 1025; // Port number is limited from 1025 to 65 000
 +  static uint16_t port_number = 1;
  
    ns3::Ptr<ns3::Node> src_node = src->get_netpoint()->extension<NetPointNs3>()->ns3_node_;
    ns3::Ptr<ns3::Node> dst_node = dst->get_netpoint()->extension<NetPointNs3>()->ns3_node_;
    sink_from_sock.insert({transform_socket_ptr(sock), apps});
  
    sock->Bind(ns3::InetSocketAddress(port_number));
 -
    ns3::Simulator::ScheduleNow(&start_flow, sock, addr.c_str(), port_number);
  
 -  port_number++;
 -  if(port_number > 65000){
 -    port_number = 1025;
 +  port_number = 1 + (port_number % UINT16_MAX);
 +  if (port_number == 1)
      XBT_WARN("Too many connections! Port number is saturated. Trying to use the oldest ports.");
 -  }
  
    s4u::Link::on_communicate(*this);
  }
@@@ -561,46 -543,7 +540,7 @@@ void ns3_add_direct_route(simgrid::kern
    xbt_assert(host_dst != nullptr, "Network element %s does not seem to be ns-3-ready", dst->get_cname());
  
    if (policy == simgrid::s4u::Link::SharingPolicy::WIFI) {
-     auto a = host_src->ns3_node_;
-     auto b = host_dst->ns3_node_;
-     xbt_assert(WifiZone::is_ap(a) != WifiZone::is_ap(b),
-                "A wifi route can only exist between an access point node and a station node.");
-     ns3::Ptr<ns3::Node> apNode  = WifiZone::is_ap(a) ? a : b;
-     ns3::Ptr<ns3::Node> staNode = apNode == a ? b : a;
-     WifiZone* zone = WifiZone::by_name(link_name);
-     wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "ControlMode", ns3::StringValue("HtMcs0"), "DataMode",
-                                  ns3::StringValue("HtMcs" + std::to_string(zone->get_mcs())));
-     wifiPhy.SetChannel(zone->get_channel());
-     wifiPhy.Set("Antennas", ns3::UintegerValue(zone->get_nss()));
-     wifiPhy.Set("MaxSupportedTxSpatialStreams", ns3::UintegerValue(zone->get_nss()));
-     wifiPhy.Set("MaxSupportedRxSpatialStreams", ns3::UintegerValue(zone->get_nss()));
-     wifiMac.SetType ("ns3::StaWifiMac",
-                      "Ssid", ns3::SsidValue(link_name),
-                      "ActiveProbing", ns3::BooleanValue(false));
-     netA.Add(wifi.Install(wifiPhy, wifiMac, staNode));
-     ns3::Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", ns3::UintegerValue(40));
-     simgrid::kernel::routing::NetPoint* sta_netpoint = WifiZone::is_ap(host_src->ns3_node_) ? dst : src;
-     const char* wifi_distance    = simgrid::s4u::Host::by_name(sta_netpoint->get_name())->get_property("wifi_distance");
-     ns3::Ptr<ns3::ListPositionAllocator> positionAllocS = ns3::CreateObject<ns3::ListPositionAllocator>();
-     positionAllocS->Add(ns3::Vector(wifi_distance ? atof(wifi_distance) : 10.0, 0, 0));
-     mobility.SetPositionAllocator(positionAllocS);
-     mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
-     mobility.Install(staNode);
-     std::string addr = simgrid::xbt::string_printf("%d.%d.0.0", zone->get_network(), zone->get_link());
-     address.SetBase(addr.c_str(), "255.255.0.0", ("0.0.0." + std::to_string(zone->get_n_sta_nodes() + 2)).c_str());
-     zone->add_sta_node();
-     XBT_DEBUG("\tInterface stack '%s'", addr.c_str());
-     auto addresses          = address.Assign(netA);
-     host_dst->ipv4_address_ = transformIpv4Address(addresses.GetAddress(1));
+       xbt_die("The wifi sharing policy is not supported for links. You want to use a wifi zone (see documentation).");
    } else {
      ns3::PointToPointHelper pointToPoint;
  
      std::string addr = simgrid::xbt::string_printf("%d.%d.0.0", number_of_networks, number_of_links);
      address.SetBase(addr.c_str(), "255.255.0.0");
      XBT_DEBUG("\tInterface stack '%s'", addr.c_str());
      auto addresses = address.Assign(netA);
  
      host_src->ipv4_address_ = transformIpv4Address(addresses.GetAddress(0));
@@@ -132,10 -132,13 +132,10 @@@ set(SMPI_SR
    src/smpi/include/smpi_status.hpp
    src/smpi/include/smpi_topo.hpp
    src/smpi/include/smpi_win.hpp
 -  src/smpi/plugins/sampi_loadbalancer.cpp
    src/smpi/plugins/ampi/ampi.cpp
    src/smpi/plugins/ampi/ampi.hpp
    src/smpi/plugins/ampi/instr_ampi.cpp
    src/smpi/plugins/ampi/instr_ampi.hpp
 -  src/smpi/plugins/load_balancer/LoadBalancer.cpp
 -  src/smpi/plugins/load_balancer/load_balancer.hpp
    src/surf/network_smpi.cpp
    src/surf/network_ib.cpp
    src/smpi/bindings/smpi_mpi.cpp
@@@ -326,8 -329,6 +326,8 @@@ set(SURF_SR
    src/kernel/resource/profile/FutureEvtSet.hpp
    src/kernel/resource/profile/Profile.cpp
    src/kernel/resource/profile/Profile.hpp
 +  src/kernel/resource/profile/StochasticDatedValue.cpp
 +  src/kernel/resource/profile/StochasticDatedValue.hpp
  
    src/kernel/routing/ClusterZone.cpp
    src/kernel/routing/DijkstraZone.cpp
@@@ -599,6 -600,7 +599,6 @@@ set(MC_SRC_BAS
    )
  
  set(MC_SRC
 -  src/mc/checker/Checker.cpp
    src/mc/checker/Checker.hpp
    src/mc/checker/CommunicationDeterminismChecker.cpp
    src/mc/checker/CommunicationDeterminismChecker.hpp
    src/mc/checker/SimcallInspector.hpp
    src/mc/checker/LivenessChecker.cpp
    src/mc/checker/LivenessChecker.hpp
 -  
 +
    src/mc/inspect/DwarfExpression.hpp
    src/mc/inspect/DwarfExpression.cpp
    src/mc/inspect/Frame.hpp
    src/mc/mc_forward.hpp
    src/mc/Session.cpp
    src/mc/Session.hpp
 -  src/mc/mc_comm_pattern.cpp
    src/mc/mc_comm_pattern.hpp
 +  src/mc/mc_pattern.hpp
    src/mc/compare.cpp
 +  src/mc/mc_api.cpp
 +  src/mc/mc_api.hpp
    src/mc/mc_hash.hpp
    src/mc/mc_hash.cpp
    src/mc/mc_ignore.hpp
@@@ -693,6 -693,7 +693,6 @@@ set(headers_to_instal
    include/simgrid/plugins/file_system.h
    include/simgrid/plugins/live_migration.h
    include/simgrid/plugins/load.h
 -  include/simgrid/plugins/load_balancer.h
    include/simgrid/smpi/replay.hpp
    include/simgrid/instr.h
    include/simgrid/mailbox.h
@@@ -1034,6 -1035,7 +1034,6 @@@ set(CMAKEFILES_TX
    examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt
    examples/python/CMakeLists.txt
    examples/deprecated/java/CMakeLists.txt
 -  examples/deprecated/msg/CMakeLists.txt
    examples/deprecated/msg/mc/CMakeLists.txt
    examples/deprecated/simdag/CMakeLists.txt
  
@@@ -1212,6 -1214,7 +1212,7 @@@ set(PLATFORMS_EXAMPLE
    examples/platforms/two_peers.xml
    examples/platforms/vivaldi.xml
    examples/platforms/wifi_energy.xml
+   examples/platforms/wifi_ns3.xml
    examples/platforms/wifi.xml
    )