wifi: Add information about the channel width used by the transmitter in ReportAmpduTxStatus

This commit is contained in:
Sébastien Deronne
2020-04-14 12:04:12 +02:00
committed by Sebastien Deronne
parent 2874e810e0
commit b9f1789e31
13 changed files with 38 additions and 27 deletions

View File

@@ -460,9 +460,9 @@ BlockAckManager::NotifyMissedAck (Ptr<WifiMacQueueItem> mpdu)
}
void
BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr)
BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth)
{
NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr);
NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataChannelWidth);
if (!blockAck->IsMultiTid ())
{
uint8_t tid = blockAck->GetTidInfo ();
@@ -546,7 +546,7 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4
queueIt = it->second.second.erase (queueIt);
}
}
m_stationManager->ReportAmpduTxStatus (recipient, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr);
m_stationManager->ReportAmpduTxStatus (recipient, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataChannelWidth);
}
}
else

View File

@@ -187,13 +187,15 @@ public:
* \param recipient Sender of BlockAck frame.
* \param rxSnr received SNR of the BlockAck frame itself
* \param dataSnr data SNR reported by remote station
* \param dataChannelWidth channel width (in MHz) used to send the Data
*
* Invoked upon receipt of a BlockAck frame. Typically, this function, is called
* by ns3::QosTxop object. Performs a check on which MPDUs, previously sent
* with Ack Policy set to Block Ack, were correctly received by the recipient.
* An acknowledged MPDU is removed from the buffer, retransmitted otherwise.
*/
void NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr);
void NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient,
double rxSnr, double dataSnr, uint16_t dataChannelWidth);
/**
* \param recipient Sender of the expected BlockAck frame.
* \param tid Traffic ID.

View File

@@ -273,9 +273,10 @@ IdealWifiManager::DoReportDataOk (WifiRemoteStation *st,
}
void
IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth)
{
NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth);
IdealWifiRemoteStation *station = static_cast<IdealWifiRemoteStation*> (st);
if (dataSnr == 0)
{

View File

@@ -70,7 +70,7 @@ private:
double dataSnr, uint16_t dataChannelWidth);
void DoReportAmpduTxStatus (WifiRemoteStation *station,
uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
double rxSnr, double dataSnr);
double rxSnr, double dataSnr, uint16_t dataChannelWidth);
void DoReportFinalRtsFailed (WifiRemoteStation *station);
void DoReportFinalDataFailed (WifiRemoteStation *station);
WifiTxVector DoGetDataTxVector (WifiRemoteStation *station);

View File

@@ -956,7 +956,7 @@ MacLow::ReceiveOk (Ptr<WifiMacQueueItem> mpdu, double rxSnr, WifiTxVector txVect
packet->RemoveHeader (blockAck);
m_blockAckTimeoutEvent.Cancel ();
NotifyAckTimeoutResetNow ();
m_currentTxop->GotBlockAck (&blockAck, hdr.GetAddr2 (), rxSnr, tag.Get ());
m_currentTxop->GotBlockAck (&blockAck, hdr.GetAddr2 (), rxSnr, tag.Get (), m_currentTxVector.GetChannelWidth ());
// start next packet if TXOP remains, otherwise contend for accessing the channel again
if (m_currentTxop->IsQosTxop () && m_currentTxop->GetTxopLimit ().IsStrictlyPositive ()
&& m_currentTxop->GetTxopRemaining () > GetSifs ())

View File

@@ -628,9 +628,10 @@ MinstrelHtWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st)
}
void
MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth)
{
NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth);
MinstrelHtWifiRemoteStation *station = static_cast<MinstrelHtWifiRemoteStation*> (st);
CheckInit (station);

View File

@@ -238,7 +238,7 @@ private:
WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station);
void DoReportAmpduTxStatus (WifiRemoteStation *station,
uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
double rxSnr, double dataSnr);
double rxSnr, double dataSnr, uint16_t dataChannelWidth);
bool IsLowLatency (void) const;
bool DoNeedRetransmission (WifiRemoteStation *st, Ptr<const Packet> packet, bool normally);

View File

@@ -934,7 +934,7 @@ QosTxop::MissedBlockAck (uint8_t nMpdus)
{
if (GetAmpduExist (m_currentHdr.GetAddr1 ()))
{
m_stationManager->ReportAmpduTxStatus (m_currentHdr.GetAddr1 (), 0, nMpdus, 0, 0);
m_stationManager->ReportAmpduTxStatus (m_currentHdr.GetAddr1 (), 0, nMpdus, 0, 0, 0);
}
// implicit BAR and do not use BAR after missed BlockAck, hence try to retransmit data frames
if (!NeedDataRetransmission (m_currentPacket, m_currentHdr))
@@ -1489,11 +1489,11 @@ QosTxop::GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient)
}
void
QosTxop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr)
QosTxop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth)
{
NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr);
NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataChannelWidth);
NS_LOG_DEBUG ("got block ack from=" << recipient);
m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, dataSnr);
m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, dataSnr, dataChannelWidth);
if (!m_txOkCallback.IsNull ())
{
m_txOkCallback (m_currentHdr);

View File

@@ -117,7 +117,8 @@ public:
void NotifyAccessGranted (void);
void NotifyInternalCollision (void);
void GotAck (void);
void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr);
void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient,
double rxSnr, double dataSnr, uint16_t dataChannelWidth);
void MissedBlockAck (uint8_t nMpdus);
void MissedAck (void);
void StartNextPacket (void);

View File

@@ -869,7 +869,7 @@ Txop::StartNextPacket (void)
}
void
Txop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr)
Txop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth)
{
NS_LOG_WARN ("GotBlockAck should not be called for non QoS!");
}

View File

@@ -275,8 +275,10 @@ public:
* \param recipient address of the recipient.
* \param rxSnr SNR of the BlockAck itself in linear scale.
* \param dataSnr reported data SNR from the peer in linear scale.
* \param dataChannelWidth channel width (in MHz) used to send the Data.
*/
virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr);
virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient,
double rxSnr, double dataSnr, uint16_t dataChannelWidth);
/**
* Event handler when a BlockAck timeout has occurred.
* \param nMpdus the number of MPDUs sent in the A-MPDU transmission that results in a BlockAck timeout.

View File

@@ -795,15 +795,15 @@ WifiRemoteStationManager::ReportRxOk (Mac48Address address, double rxSnr, WifiMo
void
WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address,
uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
double rxSnr, double dataSnr)
double rxSnr, double dataSnr, uint16_t dataChannelWidth)
{
NS_LOG_FUNCTION (this << address << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
NS_LOG_FUNCTION (this << address << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth);
NS_ASSERT (!address.IsGroup ());
for (uint8_t i = 0; i < nFailedMpdus; i++)
{
m_macTxDataFailed (address);
}
DoReportAmpduTxStatus (Lookup (address), nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr);
DoReportAmpduTxStatus (Lookup (address), nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataChannelWidth);
}
bool
@@ -1473,7 +1473,7 @@ WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station,
}
void
WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth)
{
NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
}

View File

@@ -769,18 +769,20 @@ public:
* received or when a BlockAckTimeout has elapsed.
*
* \param address the address of the receiver
* \param nSuccessfulMpdus number of successfully transmitted MPDUs.
* \param nSuccessfulMpdus number of successfully transmitted MPDUs
* A value of 0 means that the Block ACK was missed.
* \param nFailedMpdus number of unsuccessfully transmitted MPDUs.
* \param nFailedMpdus number of unsuccessfully transmitted MPDUs
* \param rxSnr received SNR of the block ack frame itself
* \param dataSnr data SNR reported by remote station
* \param dataChannelWidth the channel width (in MHz) of the A-MPDU initially sent to the remote station
*/
void ReportAmpduTxStatus (Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr);
void ReportAmpduTxStatus (Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth);
/**
* \param address remote address
* \param rxSnr the SNR of the packet received
* \param txMode the transmission mode used for the packet received.
* \param txMode the transmission mode used for the packet received
*
* Should be invoked whenever a packet is successfully received.
*/
@@ -1224,8 +1226,10 @@ private:
* \param nFailedMpdus number of unsuccessfully transmitted MPDUs.
* \param rxSnr received SNR of the block ack frame itself
* \param dataSnr data SNR reported by remote station
* \param dataChannelWidth the channel width (in MHz) of the A-MPDU we sent
*/
virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr);
virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth);
/**
* Return the state of the station associated with the given address.