23 #include "ns3/attribute-container.h"
24 #include "ns3/boolean.h"
26 #include "ns3/integer.h"
29 #include "ns3/string.h"
30 #include "ns3/uinteger.h"
52 using TidLinkMapValue =
60 .AddAttribute(
"EmlsrActivated",
61 "Whether EMLSR option is activated. If activated, EMLSR mode can be "
62 "enabled on the EMLSR links by an installed EMLSR Manager.",
68 .AddAttribute(
"TransitionTimeout",
69 "The Transition Timeout (not used by non-AP MLDs). "
70 "Possible values are 0us or 2^n us, with n=7..16.",
76 "The duration of the MediumSyncDelay timer (must be a multiple of 32 us). "
77 "The value of this attribute is only used by AP MLDs with EMLSR activated.",
83 "Threshold (dBm) to be used instead of the normal CCA sensitivity for the primary "
84 "20 MHz channel if the MediumSyncDelay timer has a nonzero value. "
85 "The value of this attribute is only used by AP MLDs with EMLSR activated.",
88 MakeIntegerChecker<int8_t>(-72, -62))
91 "Maximum number of TXOPs that an EMLSR client is allowed to attempt to initiate "
92 "while the MediumSyncDelay timer is running (zero indicates no limit). "
93 "The value of this attribute is only used by AP MLDs with EMLSR activated.",
96 MakeUintegerChecker<uint8_t>(0, 15))
98 "TidToLinkMappingNegSupport",
99 "TID-to-Link Mapping Negotiation Support.",
101 MakeEnumAccessor<WifiTidToLinkMappingNegSupport>(
111 "TidToLinkMappingDl",
112 "A list-of-TIDs-indexed map of the list of links where the TIDs are mapped to "
113 "for the downlink direction. "
114 "In case a string is used to set this attribute, the string shall contain the "
115 "(TID list, link list) pairs separated by a semicolon (;); in every pair, the "
116 "TID list and the link list are separated by a blank space, and the elements of "
117 "each list are separated by a comma (,) without spaces. "
118 "E.g., \"0,4 1,2,3; 1 0;2 0,1\" means that TIDs 0 and 4 are mapped on links "
119 "1, 2 and 3; TID 1 is mapped on link 0 and TID 2 is mapped on links 0 and 1. "
120 "An empty map indicates the default mapping, i.e., all TIDs are mapped to all "
121 "setup links. If the map contains the mapping for some TID(s), the mapping "
122 "corresponding to the missing TID(s) remains unchanged. "
123 "A non-AP MLD includes this mapping in the Association Request frame sent to "
124 "an AP MLD, unless the AP MLD advertises a negotiation support of 1 and this "
125 "mapping is such that TIDs are mapped to distinct link sets, in which case "
126 "the default mapping is included.",
128 MakeAttributeContainerAccessor<TidLinkMapValue, ';'>(
130 MakeAttributeContainerChecker<TidLinkMapValue, ';'>(
133 MakeAttributeContainerChecker<UintegerValue>(
134 MakeUintegerChecker<uint8_t>()),
135 MakeAttributeContainerChecker<UintegerValue>(
136 MakeUintegerChecker<uint8_t>()))))
138 "TidToLinkMappingUl",
139 "A list-of-TIDs-indexed map of the list of links where the TIDs are mapped to "
140 "for the uplink direction. "
141 "In case a string is used to set this attribute, the string shall contain the "
142 "(TID list, link list) pairs separated by a semicolon (;); in every pair, the "
143 "TID list and the link list are separated by a blank space, and the elements of "
144 "each list are separated by a comma (,) without spaces. "
145 "E.g., \"0,4 1,2,3; 1 0;2 0,1\" means that TIDs 0 and 4 are mapped on links "
146 "1, 2 and 3; TID 1 is mapped on link 0 and TID 2 is mapped on links 0 and 1. "
147 "An empty map indicates the default mapping, i.e., all TIDs are mapped to all "
148 "setup links. If the map contains the mapping for some TID(s), the mapping "
149 "corresponding to the missing TID(s) remains unchanged. "
150 "A non-AP MLD includes this mapping in the Association Request frame sent to "
151 "an AP MLD, unless the AP MLD advertises a negotiation support of 1 and this "
152 "mapping is such that TIDs are mapped to distinct link sets, in which case "
153 "the default mapping is included.",
155 MakeAttributeContainerAccessor<TidLinkMapValue, ';'>(
157 MakeAttributeContainerChecker<TidLinkMapValue, ';'>(
160 MakeAttributeContainerChecker<UintegerValue>(
161 MakeUintegerChecker<uint8_t>()),
162 MakeAttributeContainerChecker<UintegerValue>(
163 MakeUintegerChecker<uint8_t>()))));
174 for (
const auto& [tids, links] : linkMapping)
176 for (
auto tid : tids)
178 ret[tid] = std::set<uint8_t>(links.cbegin(), links.cend());
186 const std::map<std::list<uint8_t>, std::list<uint8_t>>& mapping)
191 for (
const auto& [tids, links] : mapping)
193 linkMapping.emplace(std::list<uint64_t>(tids.cbegin(), tids.cend()),
194 std::list<uint64_t>(links.cbegin(), links.cend()));
A container for one type of attribute.
static TypeId GetTypeId()
Get the type ID.
Time m_mediumSyncDuration
duration of the MediumSyncDelay timer
void SetTidLinkMapping(WifiDirection dir, const std::map< std::list< uint8_t >, std::list< uint8_t >> &mapping)
Set the TID-to-Link mapping for the given direction.
bool m_emlsrActivated
whether EMLSR option is activated
WifiTidLinkMapping GetTidLinkMapping(WifiDirection dir) const
Time m_transitionTimeout
Transition timeout.
std::map< std::list< uint64_t >, std::list< uint64_t > > m_linkMappingDl
TIDs-indexed Link Mapping for downlink.
WifiTidToLinkMappingNegSupport m_tidLinkMappingSupport
TID-to-Link Mapping Negotiation Support.
uint8_t m_msdMaxNTxops
MediumSyncDelay max number of TXOPs.
std::map< std::list< uint64_t >, std::list< uint64_t > > m_linkMappingUl
TIDs-indexed Link Mapping for uplink.
~EhtConfiguration() override
int8_t m_msdOfdmEdThreshold
MediumSyncDelay OFDM ED threshold.
Hold variables of type enum.
Hold a signed integer type.
A base class which provides memory management and object aggregation.
Hold objects of type std::pair<A, B>.
Hold variables of type string.
a unique identifier for an interface.
@ ATTR_GET
The attribute can be read.
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
static constexpr uint8_t DEFAULT_MSD_MAX_N_TXOPS
default MediumSyncDelay max number of TXOP attempts
@ WIFI_TID_TO_LINK_MAPPING_SAME_LINK_SET
@ WIFI_TID_TO_LINK_MAPPING_NOT_SUPPORTED
@ WIFI_TID_TO_LINK_MAPPING_ANY_LINK_SET
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Ptr< const AttributeChecker > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
WifiDirection
Wifi direction.
static constexpr int8_t DEFAULT_MSD_OFDM_ED_THRESH
default MediumSyncDelay timer OFDM ED threshold
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
std::map< uint8_t, std::set< uint8_t > > WifiTidLinkMapping
TID-indexed map of the link set to which the TID is mapped.
static constexpr uint16_t DEFAULT_MSD_DURATION_USEC
default MediumSyncDelay timer duration (max PPDU TX time rounded to a multiple of 32 us)
Ptr< AttributeChecker > MakePairChecker(const PairValue< A, B > &value)
Make a PairChecker from a PairValue.