examples: Add useRts option in wifi network examples, add frequency selection in he-wifi-network and extend regression

This commit is contained in:
Sébastien Deronne
2018-01-13 12:16:29 +01:00
parent 5bd9704dd0
commit 4e27c5e008
4 changed files with 49 additions and 5 deletions

View File

@@ -36,9 +36,17 @@ cpp_examples = [
("ofdm-vht-validation", "True", "True"),
("ofdm-he-validation", "True", "True"),
("80211n-mimo --simulationTime=0.1 --step=10", "True", "True"),
("ht-wifi-network --simulationTime=0.1 --minExpectedThroughput=5 --maxExpectedThroughput=134", "True", "True"),
("vht-wifi-network --simulationTime=0.1 --minExpectedThroughput=5 --maxExpectedThroughput=555", "True", "True"),
("he-wifi-network --simulationTime=0.25 --minExpectedThroughput=6.35 --maxExpectedThroughput=754", "True", "True"),
("ht-wifi-network --simulationTime=0.1 --frequency=5 --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=134", "True", "True"),
("ht-wifi-network --simulationTime=0.1 --frequency=5 --useRts=1 --minExpectedThroughput=5 --maxExpectedThroughput=130", "True", "True"),
("ht-wifi-network --simulationTime=0.1 --frequency=2.4 --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=132", "True", "True"),
("ht-wifi-network --simulationTime=0.1 --frequency=2.4 --useRts=1 --minExpectedThroughput=4.5 --maxExpectedThroughput=128", "True", "True"),
("vht-wifi-network --simulationTime=0.1 --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=555", "True", "True"),
("vht-wifi-network --simulationTime=0.1 --useRts=1", "False", "False"), # see bug 2853
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=0 --minExpectedThroughput=6.35 --maxExpectedThroughput=754", "True", "True"),
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=0 --minExpectedThroughput=6.35 --maxExpectedThroughput=754", "True", "True"),
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=1", "False", "False"), # see bug 2853
("he-wifi-network --simulationTime=0.25 --frequency=1.4 --useRts=0", "False", "False"), # see bug 2854
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=1", "False", "False"), # see bug 2854
("simple-ht-hidden-stations --simulationTime=1 --minExpectedThroughput=16.5 --maxExpectedThroughput=17", "True", "True"),
("mixed-network --simulationTime=1", "True", "True"),
("wifi-aggregation --simulationTime=1 --verifyResults=1", "True", "True"),

View File

@@ -48,21 +48,30 @@ NS_LOG_COMPONENT_DEFINE ("he-wifi-network");
int main (int argc, char *argv[])
{
bool udp = true;
bool useRts = false;
double simulationTime = 10; //seconds
double distance = 1.0; //meters
double frequency = 5.0; //whether 2.4 or 5.0 GHz
int mcs = -1; // -1 indicates an unset value
double minExpectedThroughput = 0;
double maxExpectedThroughput = 0;
CommandLine cmd;
cmd.AddValue ("frequency", "Whether working in the 2.4 or 5.0 GHz band (other values gets rejected)", frequency);
cmd.AddValue ("distance", "Distance in meters between the station and the access point", distance);
cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
cmd.AddValue ("udp", "UDP if set to 1, TCP otherwise", udp);
cmd.AddValue ("useRts", "Enable/disable RTS/CTS", useRts);
cmd.AddValue ("mcs", "if set, limit testing to a specific MCS (0-7)", mcs);
cmd.AddValue ("minExpectedThroughput", "if set, simulation fails if the lowest throughput is below this value", minExpectedThroughput);
cmd.AddValue ("maxExpectedThroughput", "if set, simulation fails if the highest throughput is above this value", maxExpectedThroughput);
cmd.Parse (argc,argv);
if (useRts)
{
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
}
double prevThroughput [12];
for (uint32_t l = 0; l < 12; l++)
{
@@ -107,9 +116,22 @@ int main (int argc, char *argv[])
// Set guard interval
phy.Set ("GuardInterval", TimeValue (NanoSeconds (gi)));
WifiHelper wifi;
wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
WifiMacHelper mac;
WifiHelper wifi;
if (frequency == 5.0)
{
wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
}
else if (frequency == 2.4)
{
wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ);
Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", DoubleValue (40.046));
}
else
{
std::cout << "Wrong frequency value!" << std::endl;
return 0;
}
std::ostringstream oss;
oss << "HeMcs" << mcs;

View File

@@ -49,6 +49,7 @@ NS_LOG_COMPONENT_DEFINE ("ht-wifi-network");
int main (int argc, char *argv[])
{
bool udp = true;
bool useRts = false;
double simulationTime = 10; //seconds
double distance = 1.0; //meters
double frequency = 5.0; //whether 2.4 or 5.0 GHz
@@ -61,11 +62,17 @@ int main (int argc, char *argv[])
cmd.AddValue ("distance", "Distance in meters between the station and the access point", distance);
cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
cmd.AddValue ("udp", "UDP if set to 1, TCP otherwise", udp);
cmd.AddValue ("useRts", "Enable/disable RTS/CTS", useRts);
cmd.AddValue ("mcs", "if set, limit testing to a specific MCS (0-7)", mcs);
cmd.AddValue ("minExpectedThroughput", "if set, simulation fails if the lowest throughput is below this value", minExpectedThroughput);
cmd.AddValue ("maxExpectedThroughput", "if set, simulation fails if the highest throughput is above this value", maxExpectedThroughput);
cmd.Parse (argc,argv);
if (useRts)
{
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
}
double prevThroughput [8];
for (uint32_t l = 0; l < 8; l++)
{

View File

@@ -48,6 +48,7 @@ NS_LOG_COMPONENT_DEFINE ("vht-wifi-network");
int main (int argc, char *argv[])
{
bool udp = true;
bool useRts = false;
double simulationTime = 10; //seconds
double distance = 1.0; //meters
int mcs = -1; // -1 indicates an unset value
@@ -58,11 +59,17 @@ int main (int argc, char *argv[])
cmd.AddValue ("distance", "Distance in meters between the station and the access point", distance);
cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
cmd.AddValue ("udp", "UDP if set to 1, TCP otherwise", udp);
cmd.AddValue ("useRts", "Enable/disable RTS/CTS", useRts);
cmd.AddValue ("mcs", "if set, limit testing to a specific MCS (0-9)", mcs);
cmd.AddValue ("minExpectedThroughput", "if set, simulation fails if the lowest throughput is below this value", minExpectedThroughput);
cmd.AddValue ("maxExpectedThroughput", "if set, simulation fails if the highest throughput is above this value", maxExpectedThroughput);
cmd.Parse (argc,argv);
if (useRts)
{
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
}
double prevThroughput [8];
for (uint32_t l = 0; l < 8; l++)
{