Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
test failure fix for #45.
authorAugustin Degomme <adegomme@gmail.com>
Tue, 15 Dec 2020 14:50:28 +0000 (15:50 +0100)
committerAugustin Degomme <adegomme@gmail.com>
Tue, 15 Dec 2020 14:50:28 +0000 (15:50 +0100)
On NS3 < 3.30 there was a constraint on NSS value vs MCS value, which was lifted since.
Add an explicit message and bail out before crashing.
And use a supported value for the example file, in order not to fail tests. This does not seem to affect tests.

examples/platforms/wifi_ns3.xml
src/surf/network_ns3.cpp

index b737608..4e633b6 100644 (file)
@@ -8,7 +8,7 @@
                <zone id="SSID_1" routing="WIFI">
                        <prop id="access_point" value="alice"/>
                        <prop id="mcs" value="2"/> <!-- Optionnal: default = 3 -->
-                       <prop id="nss" value="2"/> <!-- Optionnal: default = 1 -->
+                       <prop id="nss" value="1"/> <!-- Optionnal: default = 1 -->
 
                        <host id="alice" speed="1Gf"/>
 
index 999e63e..21698f7 100644 (file)
@@ -91,6 +91,10 @@ static void zoneCreation_cb(simgrid::s4u::NetZone const& zone) {
     const char* nss = wifizone->get_property("nss");
     int mcs_value = mcs ? atoi(mcs) : 3;
     int nss_value = nss ? atoi(nss) : 1;
+#if NS3_MINOR_VERSION < 30
+    if(nss_value != 1+(mcs_value/8))
+      xbt_die("On NS3 < 3.30, NSS value has to satisfy NSS == 1+(MCS/8) constraint. Bailing out");
+#endif
     wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
                                  "ControlMode", ns3::StringValue("HtMcs0"),
                                  "DataMode", ns3::StringValue("HtMcs" + std::to_string(mcs_value)));