wifi: First group addressed frame might be transmitted using No-Ack/No-Retry policy before retransmitting it to the concealment address

This commit is contained in:
Sébastien Deronne
2023-12-03 14:34:02 +01:00
parent 128e5039c4
commit 345a3ec95f
4 changed files with 28 additions and 9 deletions

View File

@@ -532,9 +532,12 @@ FrameExchangeManager::SendMpdu()
Simulator::Schedule(txDuration + m_phy->GetSifs(), [=, this, mpdu = m_mpdu]() {
NS_LOG_DEBUG("Prepare groupcast MPDU for retry");
mpdu->ResetInFlight(m_linkId);
mpdu->GetHeader().SetRetry();
// restore addr1 to the group address instead of the concealment address
mpdu->GetHeader().SetAddr1(mpdu->begin()->second.GetDestinationAddr());
if (m_apMac->GetGcrManager()->UseConcealment(mpdu->GetHeader()))
{
mpdu->GetHeader().SetAddr1(mpdu->begin()->second.GetDestinationAddr());
}
mpdu->GetHeader().SetRetry();
});
}
else

View File

@@ -1137,9 +1137,12 @@ HtFrameExchangeManager::SendPsdu()
for (const auto& mpdu : *PeekPointer(psdu))
{
mpdu->ResetInFlight(m_linkId);
mpdu->GetHeader().SetRetry();
// restore addr1 to the group address instead of the concealment address
mpdu->GetHeader().SetAddr1(mpdu->begin()->second.GetDestinationAddr());
if (m_apMac->GetGcrManager()->UseConcealment(mpdu->GetHeader()))
{
mpdu->GetHeader().SetAddr1(mpdu->begin()->second.GetDestinationAddr());
}
mpdu->GetHeader().SetRetry();
}
});
}
@@ -1278,7 +1281,8 @@ HtFrameExchangeManager::FinalizeMacHeader(Ptr<const WifiPsdu> psdu)
hdr.SetQosQueueSize(queueSizeForTid[tid].value());
}
if (m_mac->GetTypeOfStation() == AP && m_apMac->UseGcr(hdr))
if (m_mac->GetTypeOfStation() == AP && m_apMac->UseGcr(hdr) &&
m_apMac->GetGcrManager()->UseConcealment(mpdu->GetHeader()))
{
const auto& gcrConcealmentAddress =
m_apMac->GetGcrManager()->GetGcrConcealmentAddress();

View File

@@ -109,6 +109,13 @@ MsduAggregator::GetNextAmsdu(Ptr<WifiMpdu> peekedItem,
// if GCR, A-MSDU is always used with a single A-MSDU subframe
if (IsGcr(m_mac, header))
{
auto apMac = DynamicCast<ApWifiMac>(m_mac);
NS_ASSERT(apMac);
auto gcrManager = apMac->GetGcrManager();
if (!gcrManager->UseConcealment(peekedItem->GetHeader()))
{
return nullptr;
}
auto msdu = peekedItem->GetOriginal();
auto gcrAmsdu =
Create<WifiMpdu>(msdu->GetPacket(), msdu->GetHeader(), msdu->GetTimestamp());

View File

@@ -14,6 +14,7 @@
#include "ap-wifi-mac.h"
#include "channel-access-manager.h"
#include "ctrl-headers.h"
#include "gcr-manager.h"
#include "mac-tx-middle.h"
#include "mgt-action-headers.h"
#include "mpdu-aggregator.h"
@@ -556,10 +557,14 @@ QosTxop::GetNextMpdu(uint8_t linkId,
GetBaBufferSize(peekedItem->GetOriginal()->GetHeader().GetAddr1(), tid)));
// try A-MSDU aggregation if the MPDU does not contain an A-MSDU and does not already
// have a sequence number assigned (may be a retransmission)
if (m_mac->GetHtConfiguration() && !recipient.IsBroadcast() &&
!peekedItem->GetHeader().IsQosAmsdu() && !peekedItem->HasSeqNoAssigned() &&
!peekedItem->IsFragment())
// have a sequence number assigned (may be a retransmission) unless it is a concealed GCR
// MPDU:
if (auto apMac = DynamicCast<ApWifiMac>(m_mac);
m_mac->GetHtConfiguration() && !recipient.IsBroadcast() &&
!peekedItem->GetHeader().IsQosAmsdu() && !peekedItem->IsFragment() &&
(!peekedItem->HasSeqNoAssigned() ||
(IsGcr(m_mac, peekedItem->GetHeader()) &&
(apMac->GetGcrManager()->UseConcealment(peekedItem->GetHeader())))))
{
auto htFem = StaticCast<HtFrameExchangeManager>(qosFem);
mpdu = htFem->GetMsduAggregator()->GetNextAmsdu(peekedItem, txParams, availableTime);