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