wifi: Increment frame retry count on CTS timeout

This commit is contained in:
Stefano Avallone
2024-07-22 22:11:16 +02:00
parent 1a088e0e58
commit 5394ee025d
3 changed files with 27 additions and 50 deletions

View File

@@ -215,12 +215,12 @@ cpp_examples = [
"True",
),
(
"wifi-eht-network --simulationTime=0.3s --frequency=2.4 --frequency2=5 --frequency3=6 --guardInterval=1600 --udp=0 --downlink=1 --useRts=0 --mpduBufferSize=512 --emlsrLinks=0,1,2 --emlsrPaddingDelay=32 --emlsrTransitionDelay=32 --channelSwitchDelay=32 --emlsrAuxSwitch=True --emlsrAuxTxCapable=True --nStations=4 --dlAckType=AGGR-MU-BAR --enableUlOfdma=1 --enableBsrp=0 --mcs=0,3,5,9,10 --minExpectedThroughput=8 --maxExpectedThroughput=300",
"wifi-eht-network --simulationTime=0.3s --frequency=2.4 --frequency2=5 --frequency3=6 --guardInterval=1600 --udp=0 --downlink=1 --useRts=0 --mpduBufferSize=512 --emlsrLinks=0,1,2 --emlsrPaddingDelay=32 --emlsrTransitionDelay=32 --channelSwitchDelay=32 --emlsrAuxSwitch=True --emlsrAuxTxCapable=True --nStations=4 --dlAckType=AGGR-MU-BAR --enableUlOfdma=1 --enableBsrp=0 --mcs=0,3,5,9,10 --minExpectedThroughput=8 --maxExpectedThroughput=300 --RngRun=2",
"True",
"True",
),
(
"wifi-eht-network --simulationTime=0.3s --frequency=2.4 --frequency2=5 --frequency3=6 --guardInterval=1600 --udp=0 --downlink=0 --useRts=1 --mpduBufferSize=512 --emlsrLinks=0,1,2 --emlsrPaddingDelay=64 --emlsrTransitionDelay=64 --channelSwitchDelay=64 --emlsrAuxSwitch=False --emlsrAuxTxCapable=True --nStations=4 --dlAckType=MU-BAR --enableUlOfdma=1 --enableBsrp=1 --mcs=1,4,8,11,13 --minExpectedThroughput=10 --maxExpectedThroughput=260 --RngRun=3",
"wifi-eht-network --simulationTime=0.3s --frequency=2.4 --frequency2=5 --frequency3=6 --guardInterval=1600 --udp=0 --downlink=0 --useRts=1 --mpduBufferSize=512 --emlsrLinks=0,1,2 --emlsrPaddingDelay=64 --emlsrTransitionDelay=64 --channelSwitchDelay=64 --emlsrAuxSwitch=False --emlsrAuxTxCapable=True --nStations=4 --dlAckType=MU-BAR --enableUlOfdma=1 --enableBsrp=1 --mcs=1,4,8,11,13 --minExpectedThroughput=10 --maxExpectedThroughput=260 --RngRun=4",
"True",
"True",
),

View File

@@ -1071,24 +1071,13 @@ FrameExchangeManager::DoCtsTimeout(Ptr<WifiPsdu> psdu)
}
GetWifiRemoteStationManager()->ReportRtsFailed(psdu->GetHeader(0));
if (auto droppedMpdu = DropMpduIfRetryLimitReached(psdu))
{
GetWifiRemoteStationManager()->ReportFinalRtsFailed(droppedMpdu->GetHeader());
}
m_dcf->UpdateFailedCw(m_linkId);
if (!GetWifiRemoteStationManager()->NeedRetransmission(*psdu->begin()))
{
NS_LOG_DEBUG("Missed CTS, discard MPDU(s)");
GetWifiRemoteStationManager()->ReportFinalRtsFailed(psdu->GetHeader(0));
for (const auto& mpdu : *PeekPointer(psdu))
{
// Dequeue the MPDU if it is stored in a queue
DequeueMpdu(mpdu);
NotifyPacketDiscarded(mpdu);
}
m_dcf->ResetCw(m_linkId);
}
else
{
NS_LOG_DEBUG("Missed CTS, retransmit MPDU(s)");
m_dcf->UpdateFailedCw(m_linkId);
}
// Make the sequence numbers of the MPDUs available again if the MPDUs have never
// been transmitted, both in case the MPDUs have been discarded and in case the
// MPDUs have to be transmitted (because a new sequence number is assigned to

View File

@@ -451,45 +451,33 @@ HeFrameExchangeManager::DoCtsAfterMuRtsTimeout(Ptr<WifiMpdu> muRts,
}
}
// NOTE Implementation of QSRC[AC] and QLRC[AC] should be improved...
const auto& hdr = m_psduMap.cbegin()->second->GetHeader(0);
if (!hdr.GetAddr1().IsGroup())
if (const auto& hdr = m_psduMap.cbegin()->second->GetHeader(0); !hdr.GetAddr1().IsGroup())
{
GetWifiRemoteStationManager()->ReportRtsFailed(hdr);
}
if (!hdr.GetAddr1().IsGroup() &&
!GetWifiRemoteStationManager()->NeedRetransmission(*m_psduMap.cbegin()->second->begin()))
{
NS_LOG_DEBUG("Missed CTS, discard MPDUs");
GetWifiRemoteStationManager()->ReportFinalRtsFailed(hdr);
for (const auto& psdu : m_psduMap)
{
// Dequeue the MPDUs if they are stored in a queue
DequeuePsdu(psdu.second);
for (const auto& mpdu : *PeekPointer(psdu.second))
{
NotifyPacketDiscarded(mpdu);
}
}
m_edca->ResetCw(m_linkId);
}
else
{
NS_LOG_DEBUG("Missed CTS, retransmit MPDUs");
if (updateFailedCw)
{
m_edca->UpdateFailedCw(m_linkId);
}
}
// Make the sequence numbers of the MPDUs available again if the MPDUs have never
// been transmitted, both in case the MPDUs have been discarded and in case the
// MPDUs have to be transmitted (because a new sequence number is assigned to
// MPDUs that have never been transmitted and are selected for transmission)
for (const auto& [staId, psdu] : m_psduMap)
{
if (psdu->GetAddr1().IsGroup())
{
continue;
}
if (auto droppedMpdu = DropMpduIfRetryLimitReached(psdu))
{
GetWifiRemoteStationManager()->ReportFinalRtsFailed(droppedMpdu->GetHeader());
}
// Make the sequence numbers of the MPDUs available again if the MPDUs have never
// been transmitted, both in case the MPDUs have been discarded and in case the
// MPDUs have to be transmitted (because a new sequence number is assigned to
// MPDUs that have never been transmitted and are selected for transmission)
ReleaseSequenceNumbers(psdu);
}
if (updateFailedCw)
{
m_edca->UpdateFailedCw(m_linkId);
}
m_psduMap.clear();
TransmissionFailed();
}