From fe141a64d7dc92fe753526c1912c373965470acb Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 12 Jun 2023 17:09:40 +0200 Subject: [PATCH] wifi: Add MediumSyncDelay attributes to EHT configuration --- src/wifi/model/eht/eht-configuration.cc | 24 ++++++++++++++++++++++++ src/wifi/model/eht/eht-configuration.h | 16 ++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/wifi/model/eht/eht-configuration.cc b/src/wifi/model/eht/eht-configuration.cc index 27fe563a1..7689be450 100644 --- a/src/wifi/model/eht/eht-configuration.cc +++ b/src/wifi/model/eht/eht-configuration.cc @@ -23,6 +23,7 @@ #include "ns3/attribute-container.h" #include "ns3/boolean.h" #include "ns3/enum.h" +#include "ns3/integer.h" #include "ns3/log.h" #include "ns3/pair.h" #include "ns3/string.h" @@ -70,6 +71,29 @@ EhtConfiguration::GetTypeId() TimeValue(MicroSeconds(0)), MakeTimeAccessor(&EhtConfiguration::m_transitionTimeout), MakeTimeChecker(MicroSeconds(0), MicroSeconds(65536))) + .AddAttribute( + "MediumSyncDuration", + "The duration of the MediumSyncDelay timer (must be a multiple of 32 us). " + "The value of this attribute is only used by AP MLDs with EMLSR activated.", + TimeValue(MicroSeconds(DEFAULT_MSD_DURATION_USEC)), + MakeTimeAccessor(&EhtConfiguration::m_mediumSyncDuration), + MakeTimeChecker(MicroSeconds(0), MicroSeconds(255 * 32))) + .AddAttribute( + "MsdOfdmEdThreshold", + "Threshold (dBm) to be used instead of the normal CCA sensitivity for the primary " + "20 MHz channel if the MediumSyncDelay timer has a nonzero value. " + "The value of this attribute is only used by AP MLDs with EMLSR activated.", + IntegerValue(DEFAULT_MSD_OFDM_ED_THRESH), + MakeIntegerAccessor(&EhtConfiguration::m_msdOfdmEdThreshold), + MakeIntegerChecker(-72, -62)) + .AddAttribute( + "MsdMaxNTxops", + "Maximum number of TXOPs that an EMLSR client is allowed to attempt to initiate " + "while the MediumSyncDelay timer is running (zero indicates no limit). " + "The value of this attribute is only used by AP MLDs with EMLSR activated.", + UintegerValue(DEFAULT_MSD_MAX_N_TXOPS), + MakeUintegerAccessor(&EhtConfiguration::m_msdMaxNTxops), + MakeUintegerChecker(0, 15)) .AddAttribute( "TidToLinkMappingNegSupport", "TID-to-Link Mapping Negotiation Support.", diff --git a/src/wifi/model/eht/eht-configuration.h b/src/wifi/model/eht/eht-configuration.h index 87284a636..eee68e13c 100644 --- a/src/wifi/model/eht/eht-configuration.h +++ b/src/wifi/model/eht/eht-configuration.h @@ -31,6 +31,15 @@ namespace ns3 { +/// default MediumSyncDelay timer duration (max PPDU TX time rounded to a multiple of 32 us) +static constexpr uint16_t DEFAULT_MSD_DURATION_USEC = 5484 / 32 * 32; + +/// default MediumSyncDelay timer OFDM ED threshold +static constexpr int8_t DEFAULT_MSD_OFDM_ED_THRESH = -72; + +/// default MediumSyncDelay max number of TXOP attempts +static constexpr uint8_t DEFAULT_MSD_MAX_N_TXOPS = 1; + /** * \brief TID-to-Link Mapping Negotiation Support */ @@ -77,8 +86,11 @@ class EhtConfiguration : public Object const std::map, std::list>& mapping); private: - bool m_emlsrActivated; //!< whether EMLSR option is activated - Time m_transitionTimeout; //!< Transition timeout + bool m_emlsrActivated; //!< whether EMLSR option is activated + Time m_transitionTimeout; //!< Transition timeout + Time m_mediumSyncDuration; //!< duration of the MediumSyncDelay timer + int8_t m_msdOfdmEdThreshold; //!< MediumSyncDelay OFDM ED threshold + uint8_t m_msdMaxNTxops; //!< MediumSyncDelay max number of TXOPs WifiTidToLinkMappingNegSupport m_tidLinkMappingSupport; //!< TID-to-Link Mapping Negotiation Support std::map, std::list>