Merge tag 'ns-3.40' into unison
ns-3.40 release
This commit is contained in:
@@ -161,7 +161,7 @@ PrintGnuplottableBuildingListToFile(std::string filename)
|
||||
return;
|
||||
}
|
||||
uint32_t index = 0;
|
||||
for (BuildingList::Iterator it = BuildingList::Begin(); it != BuildingList::End(); ++it)
|
||||
for (auto it = BuildingList::Begin(); it != BuildingList::End(); ++it)
|
||||
{
|
||||
++index;
|
||||
Box box = (*it)->GetBoundaries();
|
||||
|
||||
@@ -289,9 +289,7 @@ main(int argc, char* argv[])
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Run();
|
||||
|
||||
for (DeviceEnergyModelContainer::Iterator iter = deviceModels.Begin();
|
||||
iter != deviceModels.End();
|
||||
iter++)
|
||||
for (auto iter = deviceModels.Begin(); iter != deviceModels.End(); iter++)
|
||||
{
|
||||
double energyConsumed = (*iter)->GetTotalEnergyConsumption();
|
||||
NS_LOG_UNCOND("End of simulation ("
|
||||
|
||||
@@ -354,9 +354,7 @@ main(int argc, char* argv[])
|
||||
Simulator::Stop(Seconds(10.0));
|
||||
Simulator::Run();
|
||||
|
||||
for (DeviceEnergyModelContainer::Iterator iter = deviceModels.Begin();
|
||||
iter != deviceModels.End();
|
||||
iter++)
|
||||
for (auto iter = deviceModels.Begin(); iter != deviceModels.End(); iter++)
|
||||
{
|
||||
double energyConsumed = (*iter)->GetTotalEnergyConsumption();
|
||||
NS_LOG_UNCOND("End of simulation ("
|
||||
|
||||
@@ -164,8 +164,7 @@ main(int argc, char** argv)
|
||||
routerInterface->SetMaxRtrAdvInterval(2000);
|
||||
routerInterface->SetMinRtrAdvInterval(1000);
|
||||
RadvdInterface::RadvdPrefixList prefixList = routerInterface->GetPrefixes();
|
||||
for (RadvdInterface::RadvdPrefixListI iter = prefixList.begin(); iter != prefixList.end();
|
||||
iter++)
|
||||
for (auto iter = prefixList.begin(); iter != prefixList.end(); iter++)
|
||||
{
|
||||
(*iter)->SetPreferredLifeTime(3);
|
||||
(*iter)->SetValidLifeTime(5);
|
||||
@@ -179,8 +178,7 @@ main(int argc, char** argv)
|
||||
routerInterface->SetMaxRtrAdvInterval(2000);
|
||||
routerInterface->SetMinRtrAdvInterval(1000);
|
||||
prefixList = routerInterface->GetPrefixes();
|
||||
for (RadvdInterface::RadvdPrefixListI iter = prefixList.begin(); iter != prefixList.end();
|
||||
iter++)
|
||||
for (auto iter = prefixList.begin(); iter != prefixList.end(); iter++)
|
||||
{
|
||||
(*iter)->SetPreferredLifeTime(3);
|
||||
(*iter)->SetValidLifeTime(5);
|
||||
|
||||
@@ -163,7 +163,7 @@ main(int argc, char* argv[])
|
||||
{
|
||||
for (size_t j = 0; j < Adj_Matrix[i].size(); j++)
|
||||
{
|
||||
if (Adj_Matrix[i][j] == 1)
|
||||
if (Adj_Matrix[i][j])
|
||||
{
|
||||
NodeContainer n_links = NodeContainer(nodes.Get(i), nodes.Get(j));
|
||||
NetDeviceContainer n_devs = p2p.Install(n_links);
|
||||
|
||||
@@ -350,9 +350,7 @@ main(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
for (std::vector<std::string>::const_iterator ploc = pcapLocationVec.begin();
|
||||
ploc != pcapLocationVec.end();
|
||||
++ploc)
|
||||
for (auto ploc = pcapLocationVec.begin(); ploc != pcapLocationVec.end(); ++ploc)
|
||||
{
|
||||
NS_LOG_INFO("PCAP capture at: <" + *ploc + ">");
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ main(int argc, char* argv[])
|
||||
Time simulationEndTime = Seconds(5);
|
||||
DataRate bottleneckBandwidth("10Mbps"); // value of x as shown in the above network topology
|
||||
Time bottleneckDelay = MilliSeconds(40);
|
||||
DataRate regLinkBandwidth = DataRate(4 * bottleneckBandwidth.GetBitRate());
|
||||
DataRate regLinkBandwidth(4 * bottleneckBandwidth.GetBitRate());
|
||||
Time regLinkDelay = MilliSeconds(5);
|
||||
DataRate maxPacingRate("4Gbps");
|
||||
|
||||
@@ -324,9 +324,7 @@ main(int argc, char* argv[])
|
||||
monitor->CheckForLostPackets();
|
||||
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier>(flowmon.GetClassifier());
|
||||
FlowMonitor::FlowStatsContainer stats = monitor->GetFlowStats();
|
||||
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin();
|
||||
i != stats.end();
|
||||
++i)
|
||||
for (auto i = stats.begin(); i != stats.end(); ++i)
|
||||
{
|
||||
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow(i->first);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ cpp_examples = [
|
||||
("wifi-eht-network --simulationTime=0.1 --frequency=5 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=547", "True", "True"),
|
||||
("wifi-eht-network --simulationTime=0.1 --frequency=2.4 --useRts=0 --useExtendedBlockAck=1 --frequency2=5 --minExpectedThroughput=12 --maxExpectedThroughput=500", "True", "True"),
|
||||
("wifi-eht-network --simulationTime=0.1 --frequency=2.4 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=212", "True", "True"),
|
||||
("wifi-eht-network --simulationTime=0.22 --udp=0 --downlink=1 --useRts=0 --nStations=4 --dlAckType=ACK-SU-FORMAT --enableUlOfdma=1 --enableBsrp=0 --mcs=4 --frequency2=6 --minExpectedThroughput=35 --maxExpectedThroughput=280", "True", "True"),
|
||||
("wifi-eht-network --simulationTime=0.23 --udp=0 --downlink=1 --useRts=0 --nStations=4 --dlAckType=ACK-SU-FORMAT --enableUlOfdma=1 --enableBsrp=0 --mcs=4 --frequency2=6 --minExpectedThroughput=35 --maxExpectedThroughput=280", "True", "True"),
|
||||
("wifi-eht-network --simulationTime=0.25 --frequency=2.4 --udp=0 --downlink=1 --useRts=0 --nStations=5 --dlAckType=MU-BAR --enableUlOfdma=1 --enableBsrp=1 --mcs=5 --frequency2=5 --useExtendedBlockAck=1 --minExpectedThroughput=40 --maxExpectedThroughput=100", "True", "True"),
|
||||
("wifi-eht-network --simulationTime=0.3 --udp=0 --downlink=1 --useRts=1 --nStations=5 --dlAckType=AGGR-MU-BAR --enableUlOfdma=1 --enableBsrp=0 --mcs=6 --muSchedAccessReqInterval=50ms --frequency2=2.4 --minExpectedThroughput=50 --maxExpectedThroughput=140", "True", "True"),
|
||||
("wifi-eht-network --simulationTime=0.2 --udp=1 --downlink=0 --useRts=0 --nStations=5 --dlAckType=AGGR-MU-BAR --enableUlOfdma=1 --enableBsrp=1 --mcs=5 --muSchedAccessReqInterval=50ms --frequency2=6 --minExpectedThroughput=70 --maxExpectedThroughput=715", "True", "True"),
|
||||
|
||||
@@ -96,8 +96,8 @@ main(int argc, char* argv[])
|
||||
uint32_t payloadSize = 1472; // bytes
|
||||
double simulationTime = 10; // seconds
|
||||
double distance = 5; // meters
|
||||
bool enablePcap = 0;
|
||||
bool verifyResults = 0; // used for regression
|
||||
bool enablePcap = false;
|
||||
bool verifyResults = false; // used for regression
|
||||
Time txopLimit = MicroSeconds(4096);
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
|
||||
@@ -84,9 +84,9 @@ main(int argc, char* argv[])
|
||||
uint32_t payloadSize = 1472; // bytes
|
||||
double simulationTime = 10; // seconds
|
||||
double distance = 5; // meters
|
||||
bool enableRts = 0;
|
||||
bool enablePcap = 0;
|
||||
bool verifyResults = 0; // used for regression
|
||||
bool enableRts = false;
|
||||
bool enablePcap = false;
|
||||
bool verifyResults = false; // used for regression
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("payloadSize", "Payload size in bytes", payloadSize);
|
||||
|
||||
@@ -85,7 +85,7 @@ ns.cppyy.cppdef("""
|
||||
def main(argv):
|
||||
ns.core.CommandLine().Parse(argv)
|
||||
|
||||
ns.network.Packet.EnablePrinting();
|
||||
ns.network.Packet.EnablePrinting()
|
||||
|
||||
wifi = ns.wifi.WifiHelper()
|
||||
mobility = ns.mobility.MobilityHelper()
|
||||
@@ -110,7 +110,10 @@ def main(argv):
|
||||
|
||||
# setup stas.
|
||||
wifiMac.SetType("ns3::StaWifiMac",
|
||||
"Ssid", ns.wifi.SsidValue(ssid))
|
||||
"ActiveProbing",
|
||||
ns.core.BooleanValue(True),
|
||||
"Ssid",
|
||||
ns.wifi.SsidValue(ssid))
|
||||
staDevs = wifi.Install(wifiPhy, wifiMac, stas)
|
||||
# setup ap.
|
||||
wifiMac.SetType("ns3::ApWifiMac",
|
||||
|
||||
@@ -35,7 +35,7 @@ using namespace ns3;
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
uint32_t FrameSize = 1500; // bytes
|
||||
uint32_t frameSizeBytes = 1500;
|
||||
std::ofstream file("frame-success-rate-dsss.plt");
|
||||
|
||||
const std::vector<std::string> modes{
|
||||
@@ -46,7 +46,7 @@ main(int argc, char* argv[])
|
||||
};
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("FrameSize", "The frame size in bytes", FrameSize);
|
||||
cmd.AddValue("FrameSize", "The frame size in bytes", frameSizeBytes);
|
||||
cmd.Parse(argc, argv);
|
||||
|
||||
Gnuplot plot = Gnuplot("frame-success-rate-dsss.eps");
|
||||
@@ -56,27 +56,27 @@ main(int argc, char* argv[])
|
||||
Ptr<TableBasedErrorRateModel> table = CreateObject<TableBasedErrorRateModel>();
|
||||
WifiTxVector txVector;
|
||||
|
||||
for (uint32_t i = 0; i < modes.size(); i++)
|
||||
{
|
||||
std::cout << modes[i] << std::endl;
|
||||
Gnuplot2dDataset dataset(modes[i]);
|
||||
txVector.SetMode(modes[i]);
|
||||
uint32_t frameSizeBits = frameSizeBytes * 8;
|
||||
|
||||
for (double snr = -10.0; snr <= 20.0; snr += 0.1)
|
||||
for (const auto& mode : modes)
|
||||
{
|
||||
std::cout << mode << std::endl;
|
||||
Gnuplot2dDataset dataset(mode);
|
||||
txVector.SetMode(mode);
|
||||
|
||||
WifiMode wifiMode(mode);
|
||||
|
||||
for (double snrDb = -10.0; snrDb <= 20.0; snrDb += 0.1)
|
||||
{
|
||||
double psYans = yans->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
double snr = std::pow(10.0, snrDb / 10.0);
|
||||
|
||||
double psYans = yans->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (psYans < 0.0 || psYans > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
double psNist = nist->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
double psNist = nist->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (psNist < 0.0 || psNist > 1.0)
|
||||
{
|
||||
std::cout << psNist << std::endl;
|
||||
@@ -87,10 +87,7 @@ main(int argc, char* argv[])
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
double psTable = table->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
double psTable = table->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (psTable < 0.0 || psTable > 1.0)
|
||||
{
|
||||
std::cout << psTable << std::endl;
|
||||
@@ -101,7 +98,7 @@ main(int argc, char* argv[])
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
dataset.Add(snr, psYans);
|
||||
dataset.Add(snrDb, psYans);
|
||||
}
|
||||
|
||||
plot.AddDataset(dataset);
|
||||
|
||||
@@ -86,66 +86,61 @@ main(int argc, char* argv[])
|
||||
mode << format << "Mcs" << +endMcs;
|
||||
modes.push_back(mode.str());
|
||||
|
||||
for (uint32_t i = 0; i < modes.size(); i++)
|
||||
for (const auto& mode : modes)
|
||||
{
|
||||
std::cout << modes[i] << std::endl;
|
||||
Gnuplot2dDataset yansdataset(modes[i]);
|
||||
Gnuplot2dDataset nistdataset(modes[i]);
|
||||
Gnuplot2dDataset tabledataset(modes[i]);
|
||||
txVector.SetMode(modes[i]);
|
||||
std::cout << mode << std::endl;
|
||||
Gnuplot2dDataset yansdataset(mode);
|
||||
Gnuplot2dDataset nistdataset(mode);
|
||||
Gnuplot2dDataset tabledataset(mode);
|
||||
txVector.SetMode(mode);
|
||||
|
||||
for (double snr = -5.0; snr <= (endMcs * 5); snr += 0.1)
|
||||
WifiMode wifiMode(mode);
|
||||
|
||||
for (double snrDb = -5.0; snrDb <= (endMcs * 5); snrDb += 0.1)
|
||||
{
|
||||
double ps = yans->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
size);
|
||||
double snr = std::pow(10.0, snrDb / 10.0);
|
||||
|
||||
double ps = yans->GetChunkSuccessRate(wifiMode, txVector, snr, size);
|
||||
if (ps < 0 || ps > 1)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
yansdataset.Add(snr, 1 - ps);
|
||||
ps = nist->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
size);
|
||||
yansdataset.Add(snrDb, 1 - ps);
|
||||
ps = nist->GetChunkSuccessRate(wifiMode, txVector, snr, size);
|
||||
if (ps < 0 || ps > 1)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
nistdataset.Add(snr, 1 - ps);
|
||||
ps = table->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
size);
|
||||
nistdataset.Add(snrDb, 1 - ps);
|
||||
ps = table->GetChunkSuccessRate(wifiMode, txVector, snr, size);
|
||||
if (ps < 0 || ps > 1)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snr, 1 - ps);
|
||||
tabledataset.Add(snrDb, 1 - ps);
|
||||
}
|
||||
|
||||
if (tableErrorModelEnabled)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Table-" << modes[i];
|
||||
ss << "Table-" << mode;
|
||||
tabledataset.SetTitle(ss.str());
|
||||
plot.AddDataset(tabledataset);
|
||||
}
|
||||
if (yansErrorModelEnabled)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Yans-" << modes[i];
|
||||
ss << "Yans-" << mode;
|
||||
yansdataset.SetTitle(ss.str());
|
||||
plot.AddDataset(yansdataset);
|
||||
}
|
||||
if (nistErrorModelEnabled)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Nist-" << modes[i];
|
||||
ss << "Nist-" << mode;
|
||||
nistdataset.SetTitle(ss.str());
|
||||
plot.AddDataset(nistdataset);
|
||||
}
|
||||
|
||||
@@ -163,9 +163,7 @@ experiment(bool enableCtsRts, std::string wifiManager)
|
||||
monitor->CheckForLostPackets();
|
||||
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier>(flowmon.GetClassifier());
|
||||
FlowMonitor::FlowStatsContainer stats = monitor->GetFlowStats();
|
||||
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin();
|
||||
i != stats.end();
|
||||
++i)
|
||||
for (auto i = stats.begin(); i != stats.end(); ++i)
|
||||
{
|
||||
// first 2 FlowIds are for ECHO apps, we don't want to display them
|
||||
//
|
||||
|
||||
@@ -118,7 +118,7 @@ main(int argc, char* argv[])
|
||||
double previous = 0;
|
||||
for (int channelWidth = 20; channelWidth <= 40;)
|
||||
{
|
||||
for (int sgi = 0; sgi < 2; sgi++)
|
||||
for (auto sgi : {false, true})
|
||||
{
|
||||
uint32_t payloadSize; // 1500 byte IP packet
|
||||
if (udp)
|
||||
@@ -283,11 +283,11 @@ main(int argc, char* argv[])
|
||||
|
||||
Simulator::Destroy();
|
||||
|
||||
std::cout << mcs << "\t\t\t" << channelWidth << " MHz\t\t\t" << sgi << "\t\t\t"
|
||||
<< throughput << " Mbit/s" << std::endl;
|
||||
std::cout << mcs << "\t\t\t" << channelWidth << " MHz\t\t\t" << std::boolalpha
|
||||
<< sgi << "\t\t\t" << throughput << " Mbit/s" << std::endl;
|
||||
|
||||
// test first element
|
||||
if (mcs == 0 && channelWidth == 20 && sgi == 0)
|
||||
if (mcs == 0 && channelWidth == 20 && !sgi)
|
||||
{
|
||||
if (throughput < minExpectedThroughput)
|
||||
{
|
||||
@@ -295,7 +295,7 @@ main(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
// test last element
|
||||
if (mcs == 7 && channelWidth == 40 && sgi == 1)
|
||||
if (mcs == 7 && channelWidth == 40 && sgi)
|
||||
{
|
||||
if (maxExpectedThroughput > 0 && throughput > maxExpectedThroughput)
|
||||
{
|
||||
|
||||
@@ -370,7 +370,7 @@ main(int argc, char* argv[])
|
||||
params.payloadSize = 1472; // bytes
|
||||
params.simulationTime = 10; // seconds
|
||||
|
||||
bool verifyResults = 0; // used for regression
|
||||
bool verifyResults = false; // used for regression
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("payloadSize", "Payload size in bytes", params.payloadSize);
|
||||
|
||||
@@ -116,7 +116,7 @@ class Experiment
|
||||
*/
|
||||
bool IsRouting() const
|
||||
{
|
||||
return (m_enableRouting == 1) ? 1 : 0;
|
||||
return m_enableRouting;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,7 +126,7 @@ class Experiment
|
||||
*/
|
||||
bool IsMobility() const
|
||||
{
|
||||
return (m_enableMobility == 1) ? 1 : 0;
|
||||
return m_enableMobility;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,7 +239,7 @@ class Experiment
|
||||
uint32_t m_gridSize; //!< Grid size.
|
||||
uint32_t m_nodeDistance; //!< Node distance.
|
||||
uint32_t m_port; //!< Listening port.
|
||||
uint32_t m_scenario; //!< Scnario number.
|
||||
uint32_t m_scenario; //!< Scenario number.
|
||||
|
||||
bool m_enablePcap; //!< True if PCAP output is enabled.
|
||||
bool m_enableTracing; //!< True if tracing output is enabled.
|
||||
|
||||
@@ -37,7 +37,7 @@ using namespace ns3;
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
uint32_t FrameSize = 1500; // bytes
|
||||
uint32_t frameSizeBytes = 1500;
|
||||
std::ofstream yansfile("yans-frame-success-rate-be.plt");
|
||||
std::ofstream nistfile("nist-frame-success-rate-be.plt");
|
||||
std::ofstream tablefile("table-frame-success-rate-be.plt");
|
||||
@@ -60,7 +60,7 @@ main(int argc, char* argv[])
|
||||
};
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("FrameSize", "The frame size", FrameSize);
|
||||
cmd.AddValue("FrameSize", "The frame size", frameSizeBytes);
|
||||
cmd.Parse(argc, argv);
|
||||
|
||||
Gnuplot yansplot = Gnuplot("yans-frame-success-rate-be.eps");
|
||||
@@ -72,48 +72,45 @@ main(int argc, char* argv[])
|
||||
Ptr<TableBasedErrorRateModel> table = CreateObject<TableBasedErrorRateModel>();
|
||||
WifiTxVector txVector;
|
||||
|
||||
for (uint32_t i = 0; i < modes.size(); i++)
|
||||
uint32_t frameSizeBits = frameSizeBytes * 8;
|
||||
|
||||
for (const auto& mode : modes)
|
||||
{
|
||||
std::cout << modes[i] << std::endl;
|
||||
Gnuplot2dDataset yansdataset(modes[i]);
|
||||
Gnuplot2dDataset nistdataset(modes[i]);
|
||||
Gnuplot2dDataset tabledataset(modes[i]);
|
||||
txVector.SetMode(modes[i]);
|
||||
std::cout << mode << std::endl;
|
||||
Gnuplot2dDataset yansdataset(mode);
|
||||
Gnuplot2dDataset nistdataset(mode);
|
||||
Gnuplot2dDataset tabledataset(mode);
|
||||
txVector.SetMode(mode);
|
||||
|
||||
for (double snr = -5.0; snr <= 55.0; snr += 0.1)
|
||||
WifiMode wifiMode(mode);
|
||||
|
||||
for (double snrDb = -5.0; snrDb <= 55.0; snrDb += 0.1)
|
||||
{
|
||||
double ps = yans->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
yansdataset.Add(snr, ps);
|
||||
double snr = std::pow(10.0, snrDb / 10.0);
|
||||
|
||||
ps = nist->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
double ps = yans->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
nistdataset.Add(snr, ps);
|
||||
yansdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
ps = nist->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snr, ps);
|
||||
nistdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snrDb, ps);
|
||||
}
|
||||
|
||||
yansplot.AddDataset(yansdataset);
|
||||
|
||||
@@ -35,7 +35,7 @@ using namespace ns3;
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
uint32_t FrameSize = 1500; // bytes
|
||||
uint32_t frameSizeBytes = 1500;
|
||||
std::ofstream yansfile("yans-frame-success-rate-ax.plt");
|
||||
std::ofstream nistfile("nist-frame-success-rate-ax.plt");
|
||||
std::ofstream tablefile("table-frame-success-rate-ax.plt");
|
||||
@@ -56,7 +56,7 @@ main(int argc, char* argv[])
|
||||
};
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("FrameSize", "The frame size", FrameSize);
|
||||
cmd.AddValue("FrameSize", "The frame size", frameSizeBytes);
|
||||
cmd.Parse(argc, argv);
|
||||
|
||||
Gnuplot yansplot = Gnuplot("yans-frame-success-rate-ax.eps");
|
||||
@@ -68,48 +68,45 @@ main(int argc, char* argv[])
|
||||
Ptr<TableBasedErrorRateModel> table = CreateObject<TableBasedErrorRateModel>();
|
||||
WifiTxVector txVector;
|
||||
|
||||
for (uint32_t i = 0; i < modes.size(); i++)
|
||||
uint32_t frameSizeBits = frameSizeBytes * 8;
|
||||
|
||||
for (const auto& mode : modes)
|
||||
{
|
||||
std::cout << modes[i] << std::endl;
|
||||
Gnuplot2dDataset yansdataset(modes[i]);
|
||||
Gnuplot2dDataset nistdataset(modes[i]);
|
||||
Gnuplot2dDataset tabledataset(modes[i]);
|
||||
txVector.SetMode(modes[i]);
|
||||
std::cout << mode << std::endl;
|
||||
Gnuplot2dDataset yansdataset(mode);
|
||||
Gnuplot2dDataset nistdataset(mode);
|
||||
Gnuplot2dDataset tabledataset(mode);
|
||||
txVector.SetMode(mode);
|
||||
|
||||
for (double snr = -5.0; snr <= 40.0; snr += 0.1)
|
||||
WifiMode wifiMode(mode);
|
||||
|
||||
for (double snrDb = -5.0; snrDb <= 40.0; snrDb += 0.1)
|
||||
{
|
||||
double ps = yans->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
yansdataset.Add(snr, ps);
|
||||
double snr = std::pow(10.0, snrDb / 10.0);
|
||||
|
||||
ps = nist->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
double ps = yans->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
nistdataset.Add(snr, ps);
|
||||
yansdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
ps = nist->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snr, ps);
|
||||
nistdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snrDb, ps);
|
||||
}
|
||||
|
||||
yansplot.AddDataset(yansdataset);
|
||||
|
||||
@@ -35,7 +35,7 @@ using namespace ns3;
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
uint32_t FrameSize = 1500; // bytes
|
||||
uint32_t frameSizeBytes = 1500;
|
||||
std::ofstream yansfile("yans-frame-success-rate-n.plt");
|
||||
std::ofstream nistfile("nist-frame-success-rate-n.plt");
|
||||
std::ofstream tablefile("table-frame-success-rate-n.plt");
|
||||
@@ -52,7 +52,7 @@ main(int argc, char* argv[])
|
||||
};
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("FrameSize", "The frame size in bytes", FrameSize);
|
||||
cmd.AddValue("FrameSize", "The frame size in bytes", frameSizeBytes);
|
||||
cmd.Parse(argc, argv);
|
||||
|
||||
Gnuplot yansplot = Gnuplot("yans-frame-success-rate-n.eps");
|
||||
@@ -64,48 +64,45 @@ main(int argc, char* argv[])
|
||||
Ptr<NistErrorRateModel> nist = CreateObject<NistErrorRateModel>();
|
||||
Ptr<TableBasedErrorRateModel> table = CreateObject<TableBasedErrorRateModel>();
|
||||
|
||||
for (uint32_t i = 0; i < modes.size(); i++)
|
||||
uint32_t frameSizeBits = frameSizeBytes * 8;
|
||||
|
||||
for (const auto& mode : modes)
|
||||
{
|
||||
std::cout << modes[i] << std::endl;
|
||||
Gnuplot2dDataset yansdataset(modes[i]);
|
||||
Gnuplot2dDataset nistdataset(modes[i]);
|
||||
Gnuplot2dDataset tabledataset(modes[i]);
|
||||
txVector.SetMode(modes[i]);
|
||||
std::cout << mode << std::endl;
|
||||
Gnuplot2dDataset yansdataset(mode);
|
||||
Gnuplot2dDataset nistdataset(mode);
|
||||
Gnuplot2dDataset tabledataset(mode);
|
||||
txVector.SetMode(mode);
|
||||
|
||||
for (double snr = -5.0; snr <= 30.0; snr += 0.1)
|
||||
WifiMode wifiMode(mode);
|
||||
|
||||
for (double snrDb = -5.0; snrDb <= 30.0; snrDb += 0.1)
|
||||
{
|
||||
double ps = yans->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
yansdataset.Add(snr, ps);
|
||||
double snr = std::pow(10.0, snrDb / 10.0);
|
||||
|
||||
ps = nist->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
double ps = yans->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
nistdataset.Add(snr, ps);
|
||||
yansdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
ps = nist->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snr, ps);
|
||||
nistdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snrDb, ps);
|
||||
}
|
||||
|
||||
yansplot.AddDataset(yansdataset);
|
||||
|
||||
@@ -37,7 +37,7 @@ using namespace ns3;
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
uint32_t FrameSize = 1500; // bytes
|
||||
uint32_t frameSizeBytes = 1500;
|
||||
std::ofstream yansfile("yans-frame-success-rate-ofdm.plt");
|
||||
std::ofstream nistfile("nist-frame-success-rate-ofdm.plt");
|
||||
std::ofstream tablefile("table-frame-success-rate-ofdm.plt");
|
||||
@@ -54,7 +54,7 @@ main(int argc, char* argv[])
|
||||
};
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("FrameSize", "The frame size in bytes", FrameSize);
|
||||
cmd.AddValue("FrameSize", "The frame size in bytes", frameSizeBytes);
|
||||
cmd.Parse(argc, argv);
|
||||
|
||||
Gnuplot yansplot = Gnuplot("yans-frame-success-rate-ofdm.eps");
|
||||
@@ -66,48 +66,45 @@ main(int argc, char* argv[])
|
||||
Ptr<TableBasedErrorRateModel> table = CreateObject<TableBasedErrorRateModel>();
|
||||
WifiTxVector txVector;
|
||||
|
||||
for (uint32_t i = 0; i < modes.size(); i++)
|
||||
uint32_t frameSizeBits = frameSizeBytes * 8;
|
||||
|
||||
for (const auto& mode : modes)
|
||||
{
|
||||
std::cout << modes[i] << std::endl;
|
||||
Gnuplot2dDataset yansdataset(modes[i]);
|
||||
Gnuplot2dDataset nistdataset(modes[i]);
|
||||
Gnuplot2dDataset tabledataset(modes[i]);
|
||||
txVector.SetMode(modes[i]);
|
||||
std::cout << mode << std::endl;
|
||||
Gnuplot2dDataset yansdataset(mode);
|
||||
Gnuplot2dDataset nistdataset(mode);
|
||||
Gnuplot2dDataset tabledataset(mode);
|
||||
txVector.SetMode(mode);
|
||||
|
||||
for (double snr = -5.0; snr <= 30.0; snr += 0.1)
|
||||
WifiMode wifiMode(mode);
|
||||
|
||||
for (double snrDb = -5.0; snrDb <= 30.0; snrDb += 0.1)
|
||||
{
|
||||
double ps = yans->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
yansdataset.Add(snr, ps);
|
||||
double snr = std::pow(10.0, snrDb / 10.0);
|
||||
|
||||
ps = nist->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
double ps = yans->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
nistdataset.Add(snr, ps);
|
||||
yansdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
ps = nist->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snr, ps);
|
||||
nistdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snrDb, ps);
|
||||
}
|
||||
|
||||
yansplot.AddDataset(yansdataset);
|
||||
|
||||
@@ -36,7 +36,7 @@ using namespace ns3;
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
uint32_t FrameSize = 1500; // bytes
|
||||
uint32_t frameSizeBytes = 1500;
|
||||
std::ofstream yansfile("yans-frame-success-rate-ac.plt");
|
||||
std::ofstream nistfile("nist-frame-success-rate-ac.plt");
|
||||
std::ofstream tablefile("table-frame-success-rate-ac.plt");
|
||||
@@ -54,7 +54,7 @@ main(int argc, char* argv[])
|
||||
};
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("FrameSize", "The frame size in bytes", FrameSize);
|
||||
cmd.AddValue("FrameSize", "The frame size in bytes", frameSizeBytes);
|
||||
cmd.Parse(argc, argv);
|
||||
|
||||
Gnuplot yansplot = Gnuplot("yans-frame-success-rate-ac.eps");
|
||||
@@ -66,48 +66,45 @@ main(int argc, char* argv[])
|
||||
Ptr<TableBasedErrorRateModel> table = CreateObject<TableBasedErrorRateModel>();
|
||||
WifiTxVector txVector;
|
||||
|
||||
for (uint32_t i = 0; i < modes.size(); i++)
|
||||
uint32_t frameSizeBits = frameSizeBytes * 8;
|
||||
|
||||
for (const auto& mode : modes)
|
||||
{
|
||||
std::cout << modes[i] << std::endl;
|
||||
Gnuplot2dDataset yansdataset(modes[i]);
|
||||
Gnuplot2dDataset nistdataset(modes[i]);
|
||||
Gnuplot2dDataset tabledataset(modes[i]);
|
||||
txVector.SetMode(modes[i]);
|
||||
std::cout << mode << std::endl;
|
||||
Gnuplot2dDataset yansdataset(mode);
|
||||
Gnuplot2dDataset nistdataset(mode);
|
||||
Gnuplot2dDataset tabledataset(mode);
|
||||
txVector.SetMode(mode);
|
||||
|
||||
for (double snr = -5.0; snr <= 30.0; snr += 0.1)
|
||||
WifiMode wifiMode(mode);
|
||||
|
||||
for (double snrDb = -5.0; snrDb <= 30.0; snrDb += 0.1)
|
||||
{
|
||||
double ps = yans->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
yansdataset.Add(snr, ps);
|
||||
double snr = std::pow(10.0, snrDb / 10.0);
|
||||
|
||||
ps = nist->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
double ps = yans->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
nistdataset.Add(snr, ps);
|
||||
yansdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(WifiMode(modes[i]),
|
||||
txVector,
|
||||
std::pow(10.0, snr / 10.0),
|
||||
FrameSize * 8);
|
||||
ps = nist->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snr, ps);
|
||||
nistdataset.Add(snrDb, ps);
|
||||
|
||||
ps = table->GetChunkSuccessRate(wifiMode, txVector, snr, frameSizeBits);
|
||||
if (ps < 0.0 || ps > 1.0)
|
||||
{
|
||||
// error
|
||||
exit(1);
|
||||
}
|
||||
tabledataset.Add(snrDb, ps);
|
||||
}
|
||||
|
||||
yansplot.AddDataset(yansdataset);
|
||||
|
||||
@@ -253,7 +253,7 @@ NodeStatistics::SetupPhy(Ptr<WifiPhy> phy)
|
||||
txVector.SetMode(mode);
|
||||
txVector.SetPreambleType(WIFI_PREAMBLE_LONG);
|
||||
txVector.SetChannelWidth(phy->GetChannelWidth());
|
||||
DataRate dataRate = DataRate(mode.GetDataRate(phy->GetChannelWidth()));
|
||||
DataRate dataRate(mode.GetDataRate(phy->GetChannelWidth()));
|
||||
Time time = phy->CalculateTxDuration(packetSize, txVector, phy->GetPhyBand());
|
||||
NS_LOG_DEBUG(mode.GetUniqueName() << " " << time.GetSeconds() << " " << dataRate);
|
||||
m_timeTable.emplace_back(time, dataRate);
|
||||
@@ -263,7 +263,7 @@ NodeStatistics::SetupPhy(Ptr<WifiPhy> phy)
|
||||
Time
|
||||
NodeStatistics::GetCalcTxTime(DataRate rate)
|
||||
{
|
||||
for (TxTime::const_iterator i = m_timeTable.begin(); i != m_timeTable.end(); i++)
|
||||
for (auto i = m_timeTable.begin(); i != m_timeTable.end(); i++)
|
||||
{
|
||||
if (rate == i->second)
|
||||
{
|
||||
|
||||
@@ -274,7 +274,7 @@ NodeStatistics::SetupPhy(Ptr<WifiPhy> phy)
|
||||
txVector.SetMode(mode);
|
||||
txVector.SetPreambleType(WIFI_PREAMBLE_LONG);
|
||||
txVector.SetChannelWidth(phy->GetChannelWidth());
|
||||
DataRate dataRate = DataRate(mode.GetDataRate(phy->GetChannelWidth()));
|
||||
DataRate dataRate(mode.GetDataRate(phy->GetChannelWidth()));
|
||||
Time time = phy->CalculateTxDuration(packetSize, txVector, phy->GetPhyBand());
|
||||
NS_LOG_DEBUG(mode.GetUniqueName() << " " << time.GetSeconds() << " " << dataRate);
|
||||
m_timeTable.emplace_back(time, dataRate);
|
||||
@@ -284,7 +284,7 @@ NodeStatistics::SetupPhy(Ptr<WifiPhy> phy)
|
||||
Time
|
||||
NodeStatistics::GetCalcTxTime(DataRate rate)
|
||||
{
|
||||
for (TxTime::const_iterator i = m_timeTable.begin(); i != m_timeTable.end(); i++)
|
||||
for (auto i = m_timeTable.begin(); i != m_timeTable.end(); i++)
|
||||
{
|
||||
if (rate == i->second)
|
||||
{
|
||||
@@ -667,9 +667,7 @@ main(int argc, char* argv[])
|
||||
|
||||
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier>(flowmon.GetClassifier());
|
||||
std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats();
|
||||
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin();
|
||||
i != stats.end();
|
||||
++i)
|
||||
for (auto i = stats.begin(); i != stats.end(); ++i)
|
||||
{
|
||||
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow(i->first);
|
||||
if ((t.sourceAddress == "10.1.1.3" && t.destinationAddress == "10.1.1.1"))
|
||||
|
||||
@@ -403,8 +403,8 @@ main(int argc, char* argv[])
|
||||
std::ofstream outfile("throughput-" + outputFileName + ".plt");
|
||||
Gnuplot gnuplot = Gnuplot("throughput-" + outputFileName + ".eps", "Throughput");
|
||||
gnuplot.SetTerminal("post eps color enhanced");
|
||||
gnuplot.SetLegend("Time (seconds)", "Throughput (Mb/s)");
|
||||
gnuplot.SetTitle("Throughput (AP to STA) vs time");
|
||||
gnuplot.SetLegend("Distance (meters)", "Throughput (Mb/s)");
|
||||
gnuplot.SetTitle("Throughput (AP to STA) vs distance");
|
||||
gnuplot.AddDataset(atpCounter.GetDatafile());
|
||||
gnuplot.GenerateOutput(outfile);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ main(int argc, char* argv[])
|
||||
double simulationTime = 10; // seconds
|
||||
uint32_t nMpdus = 1;
|
||||
uint32_t maxAmpduSize = 0;
|
||||
bool enableRts = 0;
|
||||
bool enableRts = false;
|
||||
double minExpectedThroughput = 0;
|
||||
double maxExpectedThroughput = 0;
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ main(int argc, char* argv[])
|
||||
DoubleValue(eta));
|
||||
|
||||
// install an energy source on each node
|
||||
for (NodeContainer::Iterator n = c.Begin(); n != c.End(); n++)
|
||||
for (auto n = c.Begin(); n != c.End(); n++)
|
||||
{
|
||||
eSources.Add(basicSourceHelper.Install(*n));
|
||||
|
||||
|
||||
@@ -111,9 +111,9 @@ main(int argc, char* argv[])
|
||||
double simulationTime = 10; // seconds
|
||||
double txopLimit = 3520; // microseconds
|
||||
double distance = 5; // meters
|
||||
bool enableRts = 0;
|
||||
bool enablePcap = 0;
|
||||
bool verifyResults = 0; // used for regression
|
||||
bool enableRts = false;
|
||||
bool enablePcap = false;
|
||||
bool verifyResults = false; // used for regression
|
||||
|
||||
CommandLine cmd(__FILE__);
|
||||
cmd.AddValue("payloadSize", "Payload size in bytes", payloadSize);
|
||||
|
||||
@@ -117,7 +117,7 @@ main(int argc, char* argv[])
|
||||
channelWidth *= 2;
|
||||
continue;
|
||||
}
|
||||
for (int sgi = 0; sgi < 2; sgi++)
|
||||
for (auto sgi : {false, true})
|
||||
{
|
||||
uint32_t payloadSize; // 1500 byte IP packet
|
||||
if (udp)
|
||||
@@ -265,11 +265,11 @@ main(int argc, char* argv[])
|
||||
|
||||
Simulator::Destroy();
|
||||
|
||||
std::cout << mcs << "\t\t\t" << channelWidth << " MHz\t\t\t" << sgi << "\t\t\t"
|
||||
<< throughput << " Mbit/s" << std::endl;
|
||||
std::cout << mcs << "\t\t\t" << channelWidth << " MHz\t\t\t" << std::boolalpha
|
||||
<< sgi << "\t\t\t" << throughput << " Mbit/s" << std::endl;
|
||||
|
||||
// test first element
|
||||
if (mcs == 0 && channelWidth == 20 && sgi == 0)
|
||||
if (mcs == 0 && channelWidth == 20 && !sgi)
|
||||
{
|
||||
if (throughput < minExpectedThroughput)
|
||||
{
|
||||
@@ -278,7 +278,7 @@ main(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
// test last element
|
||||
if (mcs == 9 && channelWidth == 160 && sgi == 1)
|
||||
if (mcs == 9 && channelWidth == 160 && sgi)
|
||||
{
|
||||
if (maxExpectedThroughput > 0 && throughput > maxExpectedThroughput)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user