From bc9ddaa453258cd212c7c186e7961dcfd1973494 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Thu, 7 Jan 2021 14:41:43 +0100 Subject: [PATCH] wifi: Improve tracing of ACKed/NACKed MPDUs --- CHANGES.html | 1 + RELEASE_NOTES | 1 + src/aodv/model/aodv-routing-protocol.cc | 13 ++++-- src/aodv/model/aodv-routing-protocol.h | 12 ++++++ .../dot11s/peer-management-protocol-mac.cc | 12 +++--- .../dot11s/peer-management-protocol-mac.h | 11 +++-- src/wifi/model/ap-wifi-mac.cc | 15 +++---- src/wifi/model/ap-wifi-mac.h | 10 +++-- src/wifi/model/block-ack-manager.cc | 4 +- src/wifi/model/block-ack-manager.h | 10 ++--- src/wifi/model/frame-exchange-manager.cc | 13 +++++- src/wifi/model/frame-exchange-manager.h | 11 +++++ src/wifi/model/qos-txop.cc | 22 ---------- src/wifi/model/qos-txop.h | 13 ------ src/wifi/model/regular-wifi-mac.cc | 42 ++++++++++--------- src/wifi/model/regular-wifi-mac.h | 21 +++------- src/wifi/model/txop.cc | 14 ------- src/wifi/model/txop.h | 22 ---------- 18 files changed, 107 insertions(+), 140 deletions(-) diff --git a/CHANGES.html b/CHANGES.html index 117bb38d2..2a22a7355 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -71,6 +71,7 @@ us a note on ns-developers mailing list.

  • The default TCP congestion control has been changed from NewReno to CUBIC.
  • The PHY layer of the wifi module has been refactored: the amendment-specific logic has been ported to PhyEntity classes and WifiPpdu classes.
  • The MAC layer of the wifi module has been refactored. The MacLow class has been replaced by a hierarchy of FrameExchangeManager classes, each adding support for the frame exchange sequences introduced by a given amendment.
  • +
  • The TxOkHeader and TxErrHeader trace sources of RegularWifiMac have been obsoleted and replaced by trace sources that better capture the result of a transmission: AckedMpdu (fired when an MPDU is successfully acknowledged, via either a Normal Ack or a Block Ack), NAckedMpdu (fired when an MPDU is negatively acknowledged via a Block Ack), DroppedMpdu (fired when an MPDU is dropped), MpduResponseTimeout (fired when a CTS is missing after an RTS or a Normal Ack is missing after an MPDU) and PsduResponseTimeout (fired when a BlockAck is missing after an A-MPDU or a BlockAckReq).
  • The 802.11a-like PHY configuration known as Holland has been removed from the wifi module. It was added in the 2005 timeframe for Wi-Fi rate control research but hasn't been used for quite some time.
  • Support for Greenfield mode (aka HT_GF) has been dropped from wifi.
  • Some wifi/src/model files were moved to non-ht, ht, vht, he, and rate-control subfolders.
  • diff --git a/RELEASE_NOTES b/RELEASE_NOTES index f6f8ab53d..a43ceb5a9 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -35,6 +35,7 @@ New user-visible features - (wifi) Some wifi/src/model files were moved to the relevant subfolders (non-ht, ht, vht, he, and rate-control) - (wifi) Stations perform TXOP recovery if the transmission of a non-initial MPDU in a TXOP fails - (wifi) Stations keep track of the TXOP holder and ignore the NAV when they receive an RTS frame from the TXOP holder +- (wifi) The TxOkHeader and TxErrHeader trace sources of RegularWifiMac have been obsoleted and replaced by trace sources that better capture the result of a transmission (AckedMpdu, NAckedMpdu, DroppedMpdu, MpduResponseTimeout and PsduResponseTimeout) - (traffic-control) Added FqCobalt queue disc with L4S features and set associative hash. - (traffic-control) Added FqPIE queue disc with L4S mode. diff --git a/src/aodv/model/aodv-routing-protocol.cc b/src/aodv/model/aodv-routing-protocol.cc index 24b753b29..2687dd01e 100644 --- a/src/aodv/model/aodv-routing-protocol.cc +++ b/src/aodv/model/aodv-routing-protocol.cc @@ -39,6 +39,7 @@ #include "ns3/udp-header.h" #include "ns3/wifi-net-device.h" #include "ns3/adhoc-wifi-mac.h" +#include "ns3/wifi-mac-queue-item.h" #include "ns3/string.h" #include "ns3/pointer.h" #include @@ -725,7 +726,13 @@ RoutingProtocol::NotifyInterfaceUp (uint32_t i) return; } - mac->TraceConnectWithoutContext ("TxErrHeader", m_nb.GetTxErrorCallback ()); + mac->TraceConnectWithoutContext ("DroppedMpdu", MakeCallback (&RoutingProtocol::NotifyTxError, this)); +} + +void +RoutingProtocol::NotifyTxError (WifiMacDropReason reason, Ptr mpdu) +{ + m_nb.GetTxErrorCallback ()(mpdu->GetHeader ()); } void @@ -742,8 +749,8 @@ RoutingProtocol::NotifyInterfaceDown (uint32_t i) Ptr mac = wifi->GetMac ()->GetObject (); if (mac != 0) { - mac->TraceDisconnectWithoutContext ("TxErrHeader", - m_nb.GetTxErrorCallback ()); + mac->TraceDisconnectWithoutContext ("DroppedMpdu", + MakeCallback (&RoutingProtocol::NotifyTxError, this)); m_nb.DelArpCache (l3->GetInterface (i)->GetArpCache ()); } } diff --git a/src/aodv/model/aodv-routing-protocol.h b/src/aodv/model/aodv-routing-protocol.h index fb8e3320e..a22164c08 100644 --- a/src/aodv/model/aodv-routing-protocol.h +++ b/src/aodv/model/aodv-routing-protocol.h @@ -42,6 +42,10 @@ #include namespace ns3 { + +class WifiMacQueueItem; +enum WifiMacDropReason : uint8_t; // opaque enum declaration + namespace aodv { /** * \ingroup aodv @@ -180,6 +184,14 @@ public: protected: virtual void DoInitialize (void); private: + /** + * Notify that an MPDU was dropped. + * + * \param reason the reason why the MPDU was dropped + * \param mpdu the dropped MPDU + */ + void NotifyTxError (WifiMacDropReason reason, Ptr mpdu); + // Protocol parameters. uint32_t m_rreqRetries; ///< Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route uint16_t m_ttlStart; ///< Initial TTL value for RREQ. diff --git a/src/mesh/model/dot11s/peer-management-protocol-mac.cc b/src/mesh/model/dot11s/peer-management-protocol-mac.cc index f1f3f7695..0a2ed5323 100644 --- a/src/mesh/model/dot11s/peer-management-protocol-mac.cc +++ b/src/mesh/model/dot11s/peer-management-protocol-mac.cc @@ -49,18 +49,18 @@ void PeerManagementProtocolMac::SetParent (Ptr parent) { m_parent = parent; - m_parent->TraceConnectWithoutContext ("TxErrHeader", MakeCallback (&PeerManagementProtocolMac::TxError, this)); - m_parent->TraceConnectWithoutContext ("TxOkHeader", MakeCallback (&PeerManagementProtocolMac::TxOk, this)); + m_parent->TraceConnectWithoutContext ("DroppedMpdu", MakeCallback (&PeerManagementProtocolMac::TxError, this)); + m_parent->TraceConnectWithoutContext ("AckedMpdu", MakeCallback (&PeerManagementProtocolMac::TxOk, this)); } void -PeerManagementProtocolMac::TxError (WifiMacHeader const &hdr) +PeerManagementProtocolMac::TxError (WifiMacDropReason reason, Ptr mpdu) { - m_protocol->TransmissionFailure (m_ifIndex, hdr.GetAddr1 ()); + m_protocol->TransmissionFailure (m_ifIndex, mpdu->GetHeader ().GetAddr1 ()); } void -PeerManagementProtocolMac::TxOk (WifiMacHeader const &hdr) +PeerManagementProtocolMac::TxOk (Ptr mpdu) { - m_protocol->TransmissionSuccess (m_ifIndex, hdr.GetAddr1 ()); + m_protocol->TransmissionSuccess (m_ifIndex, mpdu->GetHeader ().GetAddr1 ()); } bool PeerManagementProtocolMac::Receive (Ptr const_packet, const WifiMacHeader & header) diff --git a/src/mesh/model/dot11s/peer-management-protocol-mac.h b/src/mesh/model/dot11s/peer-management-protocol-mac.h index b6b4b2acf..6635a2652 100644 --- a/src/mesh/model/dot11s/peer-management-protocol-mac.h +++ b/src/mesh/model/dot11s/peer-management-protocol-mac.h @@ -25,6 +25,8 @@ namespace ns3 { class MeshWifiInterfaceMac; +class WifiMacQueueItem; +enum WifiMacDropReason : uint8_t; // opaque enum declaration namespace dot11s { class PeerManagementProtocol; class IeConfiguration; @@ -146,14 +148,15 @@ private: // \} /** * Closes link when a proper number of successive transmissions have failed - * \param hdr the header + * \param reason the reason why the MPDU was dropped + * \param mpdu the dropped MPDU */ - void TxError (WifiMacHeader const &hdr); + void TxError (WifiMacDropReason reason, Ptr mpdu); /** * Transmit OK function - * \param hdr the header + * \param mpdu the MPDU */ - void TxOk (WifiMacHeader const &hdr); + void TxOk (Ptr mpdu); // BCA functionality /** * Set beacon shift function diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index cd354ea16..3c6ef41ea 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -97,7 +97,6 @@ ApWifiMac::ApWifiMac () m_beaconTxop->SetMaxCw (0); m_beaconTxop->SetChannelAccessManager (m_channelAccessManager); m_beaconTxop->SetTxMiddle (m_txMiddle); - m_beaconTxop->SetTxOkCallback (MakeCallback (&ApWifiMac::TxOk, this)); //Let the lower layers know that we are acting as an AP. SetTypeOfStation (AP); @@ -863,10 +862,10 @@ ApWifiMac::SendOneBeacon (void) } void -ApWifiMac::TxOk (const WifiMacHeader &hdr) +ApWifiMac::TxOk (Ptr mpdu) { - NS_LOG_FUNCTION (this); - RegularWifiMac::TxOk (hdr); + NS_LOG_FUNCTION (this << *mpdu); + const WifiMacHeader& hdr = mpdu->GetHeader (); if ((hdr.IsAssocResp () || hdr.IsReassocResp ()) && m_stationManager->IsWaitAssocTxOk (hdr.GetAddr1 ())) { @@ -876,10 +875,10 @@ ApWifiMac::TxOk (const WifiMacHeader &hdr) } void -ApWifiMac::TxFailed (const WifiMacHeader &hdr) +ApWifiMac::TxFailed (uint8_t timeoutReason, Ptr mpdu, const WifiTxVector& txVector) { - NS_LOG_FUNCTION (this); - RegularWifiMac::TxFailed (hdr); + NS_LOG_FUNCTION (this << +timeoutReason << *mpdu << txVector); + const WifiMacHeader& hdr = mpdu->GetHeader (); if ((hdr.IsAssocResp () || hdr.IsReassocResp ()) && m_stationManager->IsWaitAssocTxOk (hdr.GetAddr1 ())) @@ -1433,6 +1432,8 @@ ApWifiMac::DoInitialize (void) m_beaconEvent = Simulator::ScheduleNow (&ApWifiMac::SendOneBeacon, this); } } + NS_ABORT_IF (!TraceConnectWithoutContext ("AckedMpdu", MakeCallback (&ApWifiMac::TxOk, this))); + NS_ABORT_IF (!TraceConnectWithoutContext ("MpduResponseTimeout", MakeCallback (&ApWifiMac::TxFailed, this))); RegularWifiMac::DoInitialize (); } diff --git a/src/wifi/model/ap-wifi-mac.h b/src/wifi/model/ap-wifi-mac.h index d7e719b85..9d9e9dbc1 100644 --- a/src/wifi/model/ap-wifi-mac.h +++ b/src/wifi/model/ap-wifi-mac.h @@ -167,18 +167,20 @@ private: * was an association response to the receiver, we record that * the receiver is now associated with us. * - * \param hdr the header of the packet that we successfully sent + * \param mpdu the MPDU that we successfully sent */ - void TxOk (const WifiMacHeader &hdr); + void TxOk (Ptr mpdu); /** * The packet we sent was successfully received by the receiver * (i.e. we did not receive an Ack from the receiver). If the packet * was an association response to the receiver, we record that * the receiver is not associated with us yet. * - * \param hdr the header of the packet that we failed to sent + * \param timeoutReason the reason why the TX timer was started (\see WifiTxTimer::Reason) + * \param mpdu the MPDU that we failed to sent + * \param txVector the TX vector used to send the MPDU */ - void TxFailed (const WifiMacHeader &hdr); + void TxFailed (uint8_t timeoutReason, Ptr mpdu, const WifiTxVector& txVector); /** * This method is called to de-aggregate an A-MSDU and forward the diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index 49de49082..0553a4c45 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -517,7 +517,7 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4 nSuccessfulMpdus++; if (!m_txOkCallback.IsNull ()) { - m_txOkCallback ((*queueIt)->GetHeader ()); + m_txOkCallback (*queueIt); } } else if (!QosUtilsIsOldPacket (currentStartingSeq, currentSeq)) @@ -525,7 +525,7 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4 nFailedMpdus++; if (!m_txFailedCallback.IsNull ()) { - m_txFailedCallback ((*queueIt)->GetHeader ()); + m_txFailedCallback (*queueIt); } InsertInRetryQueue (*queueIt); } diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index f883f119a..02b9ee9d3 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -364,15 +364,13 @@ public: uint16_t GetOriginatorStartingSequence (Mac48Address recipient, uint8_t tid) const; /** - * typedef for a callback to invoke when a - * packet transmission was completed successfully. + * typedef for a callback to invoke when an MPDU is successfully ack'ed. */ - typedef Callback TxOk; + typedef Callback > TxOk; /** - * typedef for a callback to invoke when a - * packet transmission was failed. + * typedef for a callback to invoke when an MPDU is negatively ack'ed. */ - typedef Callback TxFailed; + typedef Callback > TxFailed; /** * \param callback the callback to invoke when a * packet transmission was completed successfully. diff --git a/src/wifi/model/frame-exchange-manager.cc b/src/wifi/model/frame-exchange-manager.cc index b3ea7b987..7573f1250 100644 --- a/src/wifi/model/frame-exchange-manager.cc +++ b/src/wifi/model/frame-exchange-manager.cc @@ -197,6 +197,13 @@ FrameExchangeManager::SetDroppedMpduCallback (DroppedMpdu callback) m_droppedMpduCallback = callback; } +void +FrameExchangeManager::SetAckedMpduCallback (AckedMpdu callback) +{ + NS_LOG_FUNCTION (this << &callback); + m_ackedMpduCallback = callback; +} + void FrameExchangeManager::SetPromisc (void) { @@ -776,7 +783,6 @@ FrameExchangeManager::NormalAckTimeout (Ptr mpdu, const WifiTx NS_LOG_DEBUG ("Missed Ack, discard MPDU"); NotifyPacketDiscarded (mpdu); m_mac->GetWifiRemoteStationManager ()->ReportFinalDataFailed (mpdu); - m_mac->TxFailed (mpdu->GetHeader ()); m_dcf->ResetCw (); } else @@ -1117,7 +1123,10 @@ FrameExchangeManager::NotifyReceivedNormalAck (Ptr mpdu) NS_LOG_FUNCTION (this << *mpdu); // inform the MAC that the transmission was successful - m_mac->TxOk (mpdu->GetHeader ()); + if (!m_ackedMpduCallback.IsNull ()) + { + m_ackedMpduCallback (mpdu); + } } void diff --git a/src/wifi/model/frame-exchange-manager.h b/src/wifi/model/frame-exchange-manager.h index 58b0c68b5..645d97f7d 100644 --- a/src/wifi/model/frame-exchange-manager.h +++ b/src/wifi/model/frame-exchange-manager.h @@ -61,6 +61,10 @@ public: * typedef for a callback to invoke when an MPDU is dropped. */ typedef Callback > DroppedMpdu; + /** + * typedef for a callback to invoke when an MPDU is successfully acknowledged. + */ + typedef Callback > AckedMpdu; /** * Request the FrameExchangeManager to start a frame exchange sequence. @@ -149,6 +153,12 @@ public: * \param callback the callback to invoke when an MPDU is dropped */ virtual void SetDroppedMpduCallback (DroppedMpdu callback); + /** + * Set the callback to invoke when an MPDU is successfully acked. + * + * \param callback the callback to invoke when an MPDU is successfully acked + */ + void SetAckedMpduCallback (AckedMpdu callback); /** * Enable promiscuous mode. */ @@ -369,6 +379,7 @@ protected: Time m_navEnd; //!< NAV expiration time bool m_promisc; //!< Flag if the device is operating in promiscuous mode DroppedMpdu m_droppedMpduCallback; //!< the dropped MPDU callback + AckedMpdu m_ackedMpduCallback; //!< the acknowledged MPDU callback /** * Forward an MPDU down to the PHY layer. diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 42b6fce26..af62a92fa 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -102,8 +102,6 @@ QosTxop::QosTxop () m_baManager->SetQueue (m_queue); m_baManager->SetBlockDestinationCallback (MakeCallback (&QosBlockedDestinations::Block, m_qosBlockedDestinations)); m_baManager->SetUnblockDestinationCallback (MakeCallback (&QosBlockedDestinations::Unblock, m_qosBlockedDestinations)); - m_baManager->SetTxOkCallback (MakeCallback (&QosTxop::BaTxOk, this)); - m_baManager->SetTxFailedCallback (MakeCallback (&QosTxop::BaTxFailed, this)); } QosTxop::~QosTxop () @@ -740,26 +738,6 @@ QosTxop::DoInitialize (void) GenerateBackoff (); } -void -QosTxop::BaTxOk (const WifiMacHeader &hdr) -{ - NS_LOG_FUNCTION (this << hdr); - if (!m_txOkCallback.IsNull ()) - { - m_txOkCallback (hdr); - } -} - -void -QosTxop::BaTxFailed (const WifiMacHeader &hdr) -{ - NS_LOG_FUNCTION (this << hdr); - if (!m_txFailedCallback.IsNull ()) - { - m_txFailedCallback (hdr); - } -} - void QosTxop::AddBaResponseTimeout (Mac48Address recipient, uint8_t tid) { diff --git a/src/wifi/model/qos-txop.h b/src/wifi/model/qos-txop.h index 907f99703..0104a9bc5 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -400,19 +400,6 @@ public: */ void AssignSequenceNumber (Ptr mpdu) const; - /** - * The packet we sent was successfully received by the receiver. - * - * \param hdr the header of the packet that we successfully sent. - */ - void BaTxOk (const WifiMacHeader &hdr); - /** - * The packet we sent was successfully received by the receiver. - * - * \param hdr the header of the packet that we failed to sent. - */ - void BaTxFailed (const WifiMacHeader &hdr); - /** * Set the Queue Size subfield of the QoS Control field of the given QoS data frame. * diff --git a/src/wifi/model/regular-wifi-mac.cc b/src/wifi/model/regular-wifi-mac.cc index 0a5f62684..2822676d1 100644 --- a/src/wifi/model/regular-wifi-mac.cc +++ b/src/wifi/model/regular-wifi-mac.cc @@ -60,8 +60,6 @@ RegularWifiMac::RegularWifiMac () m_txop = CreateObject (); m_txop->SetChannelAccessManager (m_channelAccessManager); m_txop->SetTxMiddle (m_txMiddle); - m_txop->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this)); - m_txop->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this)); m_txop->SetDroppedMpduCallback (MakeCallback (&DroppedMpduTracedCallback::operator(), &m_droppedMpduCallback)); @@ -159,6 +157,8 @@ RegularWifiMac::SetupFrameExchangeManager (void) &m_psduResponseTimeoutCallback)); m_feManager->SetDroppedMpduCallback (MakeCallback (&DroppedMpduTracedCallback::operator(), &m_droppedMpduCallback)); + m_feManager->SetAckedMpduCallback (MakeCallback (&MpduTracedCallback::operator(), + &m_ackedMpduCallback)); m_channelAccessManager->SetupFrameExchangeManager (m_feManager); if (GetQosSupported ()) { @@ -468,8 +468,10 @@ RegularWifiMac::SetupEdcaQueue (AcIndex ac) Ptr edca = CreateObject (); edca->SetChannelAccessManager (m_channelAccessManager); edca->SetTxMiddle (m_txMiddle); - edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this)); - edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this)); + edca->GetBaManager ()->SetTxOkCallback (MakeCallback (&MpduTracedCallback::operator(), + &m_ackedMpduCallback)); + edca->GetBaManager ()->SetTxFailedCallback (MakeCallback (&MpduTracedCallback::operator(), + &m_nackedMpduCallback)); edca->SetDroppedMpduCallback (MakeCallback (&DroppedMpduTracedCallback::operator(), &m_droppedMpduCallback)); edca->SetAccessCategory (ac); @@ -1088,11 +1090,25 @@ RegularWifiMac::GetTypeId (void) .AddTraceSource ("TxOkHeader", "The header of successfully transmitted packet.", MakeTraceSourceAccessor (&RegularWifiMac::m_txOkCallback), - "ns3::WifiMacHeader::TracedCallback") + "ns3::WifiMacHeader::TracedCallback", + TypeId::OBSOLETE, + "Use the AckedMpdu trace instead.") .AddTraceSource ("TxErrHeader", "The header of unsuccessfully transmitted packet.", MakeTraceSourceAccessor (&RegularWifiMac::m_txErrCallback), - "ns3::WifiMacHeader::TracedCallback") + "ns3::WifiMacHeader::TracedCallback", + TypeId::OBSOLETE, + "Depending on the failure type, use the NAckedMpdu trace, the " + "DroppedMpdu trace or one of the traces associated with TX timeouts.") + .AddTraceSource ("AckedMpdu", + "An MPDU that was successfully acknowledged, via either a " + "Normal Ack or a Block Ack.", + MakeTraceSourceAccessor (&RegularWifiMac::m_ackedMpduCallback), + "ns3::WifiMacQueueItem::TracedCallback") + .AddTraceSource ("NAckedMpdu", + "An MPDU that was negatively acknowledged via a Block Ack.", + MakeTraceSourceAccessor (&RegularWifiMac::m_nackedMpduCallback), + "ns3::WifiMacQueueItem::TracedCallback") .AddTraceSource ("DroppedMpdu", "An MPDU that was dropped for the given reason (see WifiMacDropReason).", MakeTraceSourceAccessor (&RegularWifiMac::m_droppedMpduCallback), @@ -1173,18 +1189,4 @@ RegularWifiMac::ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax) } } -void -RegularWifiMac::TxOk (const WifiMacHeader &hdr) -{ - NS_LOG_FUNCTION (this << hdr); - m_txOkCallback (hdr); -} - -void -RegularWifiMac::TxFailed (const WifiMacHeader &hdr) -{ - NS_LOG_FUNCTION (this << hdr); - m_txErrCallback (hdr); -} - } //namespace ns3 diff --git a/src/wifi/model/regular-wifi-mac.h b/src/wifi/model/regular-wifi-mac.h index 07b742e20..76bead986 100644 --- a/src/wifi/model/regular-wifi-mac.h +++ b/src/wifi/model/regular-wifi-mac.h @@ -89,21 +89,6 @@ public: // Should be implemented by child classes virtual void Enqueue (Ptr packet, Mac48Address to) = 0; - /** - * The packet we sent was successfully received by the receiver - * (i.e. we received an Ack from the receiver). - * - * \param hdr the header of the packet that we successfully sent - */ - virtual void TxOk (const WifiMacHeader &hdr); - /** - * The packet we sent was successfully received by the receiver - * (i.e. we did not receive an Ack from the receiver). - * - * \param hdr the header of the packet that we failed to sent - */ - virtual void TxFailed (const WifiMacHeader &hdr); - /** * Get the Frame Exchange Manager * @@ -466,6 +451,12 @@ private: TracedCallback m_txOkCallback; ///< transmit OK callback TracedCallback m_txErrCallback; ///< transmit error callback + /// TracedCallback for acked/nacked MPDUs typedef + typedef TracedCallback> MpduTracedCallback; + + MpduTracedCallback m_ackedMpduCallback; ///< ack'ed MPDU callback + MpduTracedCallback m_nackedMpduCallback; ///< nack'ed MPDU callback + /** * TracedCallback signature for MPDU drop events. * diff --git a/src/wifi/model/txop.cc b/src/wifi/model/txop.cc index 887991ef1..220cc661d 100644 --- a/src/wifi/model/txop.cc +++ b/src/wifi/model/txop.cc @@ -135,20 +135,6 @@ Txop::SetWifiRemoteStationManager (const Ptr remoteMan m_stationManager = remoteManager; } -void -Txop::SetTxOkCallback (TxOk callback) -{ - NS_LOG_FUNCTION (this << &callback); - m_txOkCallback = callback; -} - -void -Txop::SetTxFailedCallback (TxFailed callback) -{ - NS_LOG_FUNCTION (this << &callback); - m_txFailedCallback = callback; -} - void Txop::SetDroppedMpduCallback (DroppedMpdu callback) { diff --git a/src/wifi/model/txop.h b/src/wifi/model/txop.h index 37daa648b..3cb725776 100644 --- a/src/wifi/model/txop.h +++ b/src/wifi/model/txop.h @@ -76,16 +76,6 @@ public: */ static TypeId GetTypeId (void); - /** - * typedef for a callback to invoke when a - * packet transmission was completed successfully. - */ - typedef Callback TxOk; - /** - * typedef for a callback to invoke when a - * packet transmission was failed. - */ - typedef Callback TxFailed; /** * typedef for a callback to invoke when an MPDU is dropped. */ @@ -127,16 +117,6 @@ public: */ void SetTxMiddle (const Ptr txMiddle); - /** - * \param callback the callback to invoke when a - * packet transmission was completed successfully. - */ - void SetTxOkCallback (TxOk callback); - /** - * \param callback the callback to invoke when a - * packet transmission was completed unsuccessfully. - */ - void SetTxFailedCallback (TxFailed callback); /** * \param callback the callback to invoke when an MPDU is dropped */ @@ -342,8 +322,6 @@ protected: void UpdateBackoffSlotsNow (uint32_t nSlots, Time backoffUpdateBound); Ptr m_channelAccessManager; //!< the channel access manager - TxOk m_txOkCallback; //!< the transmit OK callback - TxFailed m_txFailedCallback; //!< the transmit failed callback DroppedMpdu m_droppedMpduCallback; //!< the dropped MPDU callback Ptr m_queue; //!< the wifi MAC queue Ptr m_txMiddle; //!< the MacTxMiddle