From e744136b0b343625d5d52bea403e338bfb18e77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 3 Sep 2024 08:02:58 +0200 Subject: [PATCH] wifi: Allow to add an additional buffer time to protect beyond end of the immediate frame exchange in case of non-zero TXOP limit when a single frame exchange is protected --- RELEASE_NOTES.md | 2 +- src/wifi/model/he/he-frame-exchange-manager.cc | 4 ++-- src/wifi/model/ht/ht-frame-exchange-manager.cc | 2 +- src/wifi/model/qos-frame-exchange-manager.cc | 15 +++++++++++---- src/wifi/model/qos-frame-exchange-manager.h | 3 +++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8085d1c3c..4b55c00d1 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -34,7 +34,7 @@ The required Doxygen version for documentation generation is now version 1.13. - (dsr) !2403 - Reformatted documentation and added a new concept figure. - (flow-monitor) !2387 - Reformatted documentation and added a new concept figure. -- (wifi) Added the `ProtectSingleExchange` attribute to the `QosFrameExchangeManager` to choose whether the NAV protection should cover the entire TXOP or only the current frame exchange when the TXOP limit is non-zero. In that case, the Duration/ID field in frames establishing the protection is set to the time remaining until the end of the current frame exchange. +- (wifi) Added the `ProtectSingleExchange` attribute to the `QosFrameExchangeManager` to choose whether the NAV protection should cover the entire TXOP or only the current frame exchange when the TXOP limit is non-zero. In that case, the Duration/ID field in frames establishing the protection is set to the time remaining until the end of the current frame exchange. It is also possible to select whether the NAV duration should be extended by an additional time to protect beyond end of the immediate frame exchange via the `SingleExchangeProtectionSurplus` attribute of the `QosFrameExchangeManager`. ### Bugs fixed diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index 604e999dc..870123b9b 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -355,7 +355,7 @@ HeFrameExchangeManager::GetMuRtsDurationId(uint32_t muRtsSize, if (m_protectSingleExchange) { - duration = std::min(duration, singleDurationId); + duration = std::min(duration, singleDurationId + m_singleExchangeProtectionSurplus); } return duration; @@ -1745,7 +1745,7 @@ HeFrameExchangeManager::SendMultiStaBlockAck(const WifiTxParameters& txParams, T auto duration = Max(m_edca->GetRemainingTxop(m_linkId) - txDuration, Seconds(0)); if (m_protectSingleExchange) { - duration = std::min(duration, singleDurationId); + duration = std::min(duration, singleDurationId + m_singleExchangeProtectionSurplus); } psdu->SetDuration(duration); } diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index 1cd33d2e2..f52ce8735 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -1052,7 +1052,7 @@ HtFrameExchangeManager::GetPsduDurationId(Time txDuration, const WifiTxParameter if (m_protectSingleExchange) { - duration = std::min(duration, singleDurationId); + duration = std::min(duration, singleDurationId + m_singleExchangeProtectionSurplus); } return duration; diff --git a/src/wifi/model/qos-frame-exchange-manager.cc b/src/wifi/model/qos-frame-exchange-manager.cc index 0f6a5643b..14d1b243b 100644 --- a/src/wifi/model/qos-frame-exchange-manager.cc +++ b/src/wifi/model/qos-frame-exchange-manager.cc @@ -51,7 +51,14 @@ QosFrameExchangeManager::GetTypeId() "when the latter is non-zero", BooleanValue(false), MakeBooleanAccessor(&QosFrameExchangeManager::m_protectSingleExchange), - MakeBooleanChecker()); + MakeBooleanChecker()) + .AddAttribute( + "SingleExchangeProtectionSurplus", + "Additional time to protect beyond end of the immediate frame exchange in case of " + "non-zero TXOP limit when a single frame exchange is protected", + TimeValue(Time(0)), + MakeTimeAccessor(&QosFrameExchangeManager::m_singleExchangeProtectionSurplus), + MakeTimeChecker()); return tid; } @@ -506,7 +513,7 @@ QosFrameExchangeManager::GetFrameDurationId(const WifiMacHeader& header, if (m_protectSingleExchange) { - duration = std::min(duration, singleDurationId); + duration = std::min(duration, singleDurationId + m_singleExchangeProtectionSurplus); } return duration; @@ -544,7 +551,7 @@ QosFrameExchangeManager::GetRtsDurationId(const WifiTxVector& rtsTxVector, if (m_protectSingleExchange) { - duration = std::min(duration, singleDurationId); + duration = std::min(duration, singleDurationId + m_singleExchangeProtectionSurplus); } return duration; @@ -582,7 +589,7 @@ QosFrameExchangeManager::GetCtsToSelfDurationId(const WifiTxVector& ctsTxVector, if (m_protectSingleExchange) { - duration = std::min(duration, singleDurationId); + duration = std::min(duration, singleDurationId + m_singleExchangeProtectionSurplus); } return duration; diff --git a/src/wifi/model/qos-frame-exchange-manager.h b/src/wifi/model/qos-frame-exchange-manager.h index 0543710f9..ca4666872 100644 --- a/src/wifi/model/qos-frame-exchange-manager.h +++ b/src/wifi/model/qos-frame-exchange-manager.h @@ -194,6 +194,9 @@ class QosFrameExchangeManager : public FrameExchangeManager bool m_protectSingleExchange; /**< true if the Duration/ID field in frames establishing protection only covers the immediate frame exchange instead of rest of the TXOP limit when the latter is non-zero */ + Time m_singleExchangeProtectionSurplus; /**< additional time to protect beyond end of the + immediate frame exchange in case of non-zero TXOP + limit when a single frame exchange is protected */ private: /**