wifi: Enable preamble detection model by default

This commit is contained in:
Sébastien Deronne
2019-05-14 19:39:07 +02:00
parent 81d5ed7ce0
commit 0afae8ef34
33 changed files with 21 additions and 6 deletions

View File

@@ -64,6 +64,7 @@ us a note on ns-developers mailing list.</p>
<li>Added a new trace source <b>EndOfHePreamble</b> in WifiPhy for tracing end of preamble (after training fields) for received 802.11ax packets.</li>
<li>Added a new helper method to SpectrumWifiPhyHelper and YansWifiPhyHelper to set the frame capture model.</li>
<li>Added a new helper method to SpectrumWifiPhyHelper and YansWifiPhyHelper to set the preamble detection model.</li>
<li>Added a new helper method to WifiPhyHelper to disable the preamble detection model.</li>
<li>Added a method to ObjectFactory to check whether a TypeId has been configured on the factory.</li>
<li>Added a new helper method to WifiHelper to set the 802.11ax OBSS PD spatial reuse algorithm.</li>
</ul>

View File

@@ -23,7 +23,7 @@ requirements (Note: not all features available on all platforms):
New user-visible features
-------------------------
- (wifi) Preamble detection can now be modelled.
- (wifi) Preamble detection can now be modelled and is enabled by default.
- (wifi) 802.11ax spatial reuse is now supported.
- (lte) Radio Link Failure (RLF) functionality is now supported.

View File

@@ -49,7 +49,7 @@ cpp_examples = [
("he-wifi-network --simulationTime=0.25 --frequency=2.4 --useRts=0 --minExpectedThroughput=6 --maxExpectedThroughput=238", "True", "True"),
("he-wifi-network --simulationTime=4 --frequency=2.4 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=224", "True", "True"),
("simple-ht-hidden-stations --simulationTime=1.5 --enableRts=0 --nMpdus=32 --minExpectedThroughput=59 --maxExpectedThroughput=60", "True", "True"),
("simple-ht-hidden-stations --simulationTime=1 --enableRts=1 --nMpdus=32 --minExpectedThroughput=57 --maxExpectedThroughput=58", "True", "True"),
("simple-ht-hidden-stations --simulationTime=1 --enableRts=1 --nMpdus=32 --minExpectedThroughput=56 --maxExpectedThroughput=57", "True", "True"),
("mixed-network --simulationTime=1", "True", "True"),
("wifi-aggregation --simulationTime=1 --verifyResults=1", "True", "True"),
("wifi-txop-aggregation --simulationTime=1 --verifyResults=1", "True", "True"),

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -127,6 +127,7 @@ Bug772ChainTest::CreateDevices ()
WifiMacHelper wifiMac;
wifiMac.SetType ("ns3::AdhocWifiMac");
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
wifiPhy.DisablePreambleDetectionModel ();
// This test suite output was originally based on YansErrorRateModel
wifiPhy.SetErrorRateModel ("ns3::YansErrorRateModel");
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();

View File

@@ -66,12 +66,12 @@ SpectrumWifiPhyHelper::Create (Ptr<Node> node, Ptr<NetDevice> device) const
phy->CreateWifiSpectrumPhyInterface (device);
Ptr<ErrorRateModel> error = m_errorRateModel.Create<ErrorRateModel> ();
phy->SetErrorRateModel (error);
if (m_frameCaptureModel.GetTypeId ().GetUid ())
if (m_frameCaptureModel.IsTypeIdSet ())
{
Ptr<FrameCaptureModel> capture = m_frameCaptureModel.Create<FrameCaptureModel> ();
phy->SetFrameCaptureModel (capture);
}
if (m_preambleDetectionModel.GetTypeId ().GetUid ())
if (m_preambleDetectionModel.IsTypeIdSet ())
{
Ptr<PreambleDetectionModel> capture = m_preambleDetectionModel.Create<PreambleDetectionModel> ();
phy->SetPreambleDetectionModel (capture);

View File

@@ -131,6 +131,7 @@ AsciiPhyReceiveSinkWithoutContext (
WifiPhyHelper::WifiPhyHelper ()
: m_pcapDlt (PcapHelper::DLT_IEEE802_11)
{
SetPreambleDetectionModel ("ns3::ThresholdPreambleDetectionModel");
}
WifiPhyHelper::~WifiPhyHelper ()
@@ -212,6 +213,12 @@ WifiPhyHelper::SetPreambleDetectionModel (std::string name,
m_preambleDetectionModel.Set (n7, v7);
}
void
WifiPhyHelper::DisablePreambleDetectionModel ()
{
m_preambleDetectionModel.SetTypeId (TypeId ());
}
void
WifiPhyHelper::PcapSniffTxEvent (
Ptr<PcapFileWrapper> file,

View File

@@ -161,6 +161,11 @@ public:
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
/**
* Disable the preamble detection model.
*/
void DisablePreambleDetectionModel ();
/**
* An enumeration of the pcap data link types (DLTs) which this helper
* supports. See http://wiki.wireshark.org/Development/LibpcapFileFormat

View File

@@ -156,12 +156,12 @@ YansWifiPhyHelper::Create (Ptr<Node> node, Ptr<NetDevice> device) const
Ptr<YansWifiPhy> phy = m_phy.Create<YansWifiPhy> ();
Ptr<ErrorRateModel> error = m_errorRateModel.Create<ErrorRateModel> ();
phy->SetErrorRateModel (error);
if (m_frameCaptureModel.GetTypeId ().GetUid ())
if (m_frameCaptureModel.IsTypeIdSet ())
{
Ptr<FrameCaptureModel> capture = m_frameCaptureModel.Create<FrameCaptureModel> ();
phy->SetFrameCaptureModel (capture);
}
if (m_preambleDetectionModel.GetTypeId ().GetUid ())
if (m_preambleDetectionModel.IsTypeIdSet ())
{
Ptr<PreambleDetectionModel> capture = m_preambleDetectionModel.Create<PreambleDetectionModel> ();
phy->SetPreambleDetectionModel (capture);

View File

@@ -416,6 +416,7 @@ TestInterBssConstantObssPdAlgo::RunOne (void)
lossModel->SetDefaultLoss (m_txPowerDbm - m_obssRxPowerDbm); //Force received RSSI to be equal to m_obssRxPowerDbm
SpectrumWifiPhyHelper phy = SpectrumWifiPhyHelper::Default ();
phy.DisablePreambleDetectionModel ();
Ptr<MultiModelSpectrumChannel> channel = CreateObject<MultiModelSpectrumChannel> ();
channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
channel->AddPropagationLossModel (lossModel);