From 9bcb63f930aaeacc097bd7bb46d6c3ee85743331 Mon Sep 17 00:00:00 2001 From: adrien gougeon Date: Fri, 25 Sep 2020 15:37:40 +0200 Subject: [PATCH] added ssid for ns3 wifi --- src/surf/network_ns3.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 9c1e8a0f5b..42714294f4 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -103,7 +103,6 @@ std::unordered_map WifiZone::wifi_zones; static void initialize_ns3_wifi() { wifi.SetStandard (ns3::WIFI_PHY_STANDARD_80211n_5GHZ); - 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"); @@ -111,7 +110,7 @@ static void initialize_ns3_wifi() { if (wifi_link) new WifiZone(wifi_link, host, host->get_netpoint()->extension()->ns3_node_, - wifiChannel.Create (), wifi_mcs ? atoi(wifi_mcs) : 3, wifi_nss ? atoi(wifi_nss) : 1, 0, 0); + wifiChannel.Create(), wifi_mcs ? atoi(wifi_mcs) : 3, wifi_nss ? atoi(wifi_nss) : 1, 0, 0); } } @@ -363,8 +362,8 @@ LinkNS3::LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwid 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"); + wifiMac.SetType("ns3::ApWifiMac", + "Ssid", ns3::SsidValue(name)); netA.Add(wifi.Install (wifiPhy, wifiMac, zone->get_ap_node())); @@ -606,7 +605,9 @@ void ns3_add_direct_route(NetPointNs3* src, NetPointNs3* dst, double bw, double wifiPhy.Set("MaxSupportedTxSpatialStreams", ns3::UintegerValue(zone->get_nss())); wifiPhy.Set("MaxSupportedRxSpatialStreams", ns3::UintegerValue(zone->get_nss())); - wifiMac.SetType ("ns3::StaWifiMac"); + wifiMac.SetType ("ns3::StaWifiMac", + "Ssid", ns3::SsidValue(link_name), + "ActiveProbing", ns3::BooleanValue(false)); netA.Add(wifi.Install (wifiPhy, wifiMac, staNode)); -- 2.20.1