wifi: Initial frame exchange support for GCR-UR

This commit is contained in:
Sébastien Deronne
2025-01-08 18:39:26 +01:00
parent f756e8c39a
commit a595a6f0f3
3 changed files with 36 additions and 7 deletions

View File

@@ -9,6 +9,7 @@
#include "frame-exchange-manager.h"
#include "ap-wifi-mac.h"
#include "gcr-manager.h"
#include "snr-tag.h"
#include "sta-wifi-mac.h"
#include "wifi-mac-queue.h"
@@ -523,8 +524,18 @@ FrameExchangeManager::SendMpdu()
if (m_txParams.m_acknowledgment->method == WifiAcknowledgment::NONE)
{
if (!m_mpdu->GetHeader().IsQosData() ||
m_mpdu->GetHeader().GetQosAckPolicy() == WifiMacHeader::NO_ACK)
const auto isGcr = m_mac->GetTypeOfStation() == AP && m_apMac->UseGcr(m_mpdu->GetHeader());
if (isGcr && m_apMac->GetGcrManager()->KeepGroupcastQueued(m_mpdu))
{
// keep the groupcast frame in the queue for future retransmission
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();
});
}
else if (!m_mpdu->GetHeader().IsQosData() ||
m_mpdu->GetHeader().GetQosAckPolicy() == WifiMacHeader::NO_ACK)
{
// No acknowledgment, hence dequeue the MPDU if it is stored in a queue
DequeueMpdu(m_mpdu);

View File

@@ -943,10 +943,20 @@ HtFrameExchangeManager::ReleaseSequenceNumbers(Ptr<const WifiPsdu> psdu) const
{
NS_LOG_FUNCTION(this << *psdu);
auto tids = psdu->GetTids();
const auto tids = psdu->GetTids();
const auto isGcr = IsGcr(m_mac, psdu->GetHeader(0));
auto agreementEstablished =
!tids.empty() /* no QoS data frame included */ &&
(isGcr ? GetBaManager(*tids.begin())
->IsGcrAgreementEstablished(
psdu->GetHeader(0).GetAddr1(),
*tids.begin(),
m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(
psdu->GetHeader(0).GetAddr1()))
: m_mac->GetBaAgreementEstablishedAsOriginator(psdu->GetAddr1(), *tids.begin())
.has_value());
if (tids.empty() || // no QoS data frames included
!m_mac->GetBaAgreementEstablishedAsOriginator(psdu->GetAddr1(), *tids.begin()))
if (!agreementEstablished)
{
QosFrameExchangeManager::ReleaseSequenceNumbers(psdu);
return;
@@ -963,7 +973,15 @@ HtFrameExchangeManager::ReleaseSequenceNumbers(Ptr<const WifiPsdu> psdu) const
if (hdr.IsQosData())
{
uint8_t tid = hdr.GetQosTid();
NS_ASSERT(m_mac->GetBaAgreementEstablishedAsOriginator(hdr.GetAddr1(), tid));
agreementEstablished =
isGcr ? GetBaManager(tid)->IsGcrAgreementEstablished(
psdu->GetHeader(0).GetAddr1(),
tid,
m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(
psdu->GetHeader(0).GetAddr1()))
: m_mac->GetBaAgreementEstablishedAsOriginator(psdu->GetAddr1(), tid)
.has_value();
NS_ASSERT(agreementEstablished);
if (!hdr.IsRetry() && !(*mpduIt)->IsInFlight())
{

View File

@@ -1121,7 +1121,7 @@ WifiRemoteStationManager::GetMpdusToDropOnTxFailure(Ptr<WifiPsdu> psdu)
{
NS_LOG_FUNCTION(this << *psdu);
auto* station = Lookup(psdu->GetHeader(0).GetAddr1());
auto* station = Lookup(GetIndividuallyAddressedRecipient(m_wifiMac, psdu->GetHeader(0)));
DoIncrementRetryCountOnTxFailure(station, psdu);
return DoGetMpdusToDropOnTxFailure(station, psdu);