A Discrete-Event Network Simulator
API
ns3::MultiLinkElement Class Reference

The Multi-Link element. More...

#include "multi-link-element.h"

+ Inheritance diagram for ns3::MultiLinkElement:
+ Collaboration diagram for ns3::MultiLinkElement:

Classes

class  PerStaProfileSubelement
 Per-STA Profile Subelement of Multi-Link element. More...
 

Public Types

enum  SubElementId : uint8_t { PER_STA_PROFILE_SUBELEMENT_ID = 0 }
 SubElement IDs. More...
 
enum  Variant : uint8_t { BASIC_VARIANT = 0 , UNSET }
 Multi-Link element variants. More...
 

Public Member Functions

 MultiLinkElement (Variant variant, WifiMacType frameType)
 Constructor. More...
 
 MultiLinkElement (WifiMacType frameType)
 Construct a Multi-Link Element with no variant set. More...
 
void AddPerStaProfileSubelement ()
 Add a Per-STA Profile Subelement in the Link Info field. More...
 
uint16_t DeserializeInformationField (Buffer::Iterator start, uint16_t length) override
 Deserialize information (i.e., the body of the IE, not including the Element ID and length octets) More...
 
WifiInformationElementId ElementId () const override
 Get the wifi information element ID. More...
 
WifiInformationElementId ElementIdExt () const override
 Get the wifi information element ID extension. More...
 
uint8_t GetBssParamsChangeCount () const
 Return the BSS Parameters Change Count subfield in the Common Info field. More...
 
uint16_t GetInformationFieldSize () const override
 Length of serialized information (i.e., the length of the body of the IE, not including the Element ID and length octets. More...
 
uint8_t GetLinkIdInfo () const
 Return the Link ID Info subfield in the Common Info field. More...
 
Time GetMediumSyncDelayTimer () const
 Get the Medium Synchronization Duration subfield of the Medium Synchronization Delay information in the Common Info field. More...
 
uint8_t GetMediumSyncMaxNTxops () const
 Get the maximum number of TXOPs a non-AP STA is allowed to attempt to initiate while the MediumSyncDelay timer is running at a non-AP STA. More...
 
int8_t GetMediumSyncOfdmEdThreshold () const
 Get the Medium Synchronization OFDM ED Threshold in dBm. More...
 
Mac48Address GetMldMacAddress () const
 Return the MLD MAC Address subfield in the Common Info field. More...
 
std::size_t GetNPerStaProfileSubelements () const
 Return the number of Per-STA Profile Subelement in the Link Info field. More...
 
PerStaProfileSubelementGetPerStaProfile (std::size_t i)
 Get a reference to the i-th Per-STA Profile Subelement in the Link Info field. More...
 
const PerStaProfileSubelementGetPerStaProfile (std::size_t i) const
 Get a reference to the i-th Per-STA Profile Subelement in the Link Info field. More...
 
Variant GetVariant () const
 Get the Multi-Link element variant. More...
 
bool HasBssParamsChangeCount () const
 Return true if the BSS Parameters Change Count subfield in the Common Info field is present and false otherwise. More...
 
bool HasLinkIdInfo () const
 Return true if the Link ID Info subfield in the Common Info field is present and false otherwise. More...
 
bool HasMediumSyncDelayInfo () const
 Return true if the Medium Synchronization Delay Information subfield in the Common Info field is present and false otherwise. More...
 
void SerializeInformationField (Buffer::Iterator start) const override
 Serialize information (i.e., the body of the IE, not including the Element ID and length octets) More...
 
void SetBssParamsChangeCount (uint8_t count)
 Set the BSS Parameters Change Count subfield in the Common Info field. More...
 
void SetLinkIdInfo (uint8_t linkIdInfo)
 Set the Link ID Info subfield in the Common Info field. More...
 
void SetMediumSyncDelayTimer (Time delay)
 Set the Medium Synchronization Duration subfield of the Medium Synchronization Delay information in the Common Info field. More...
 
void SetMediumSyncMaxNTxops (uint8_t nTxops)
 Set the Medium Synchronization Maximum Number of TXOPs subfield of the Medium Synchronization Delay information in the Common Info field. More...
 
void SetMediumSyncOfdmEdThreshold (int8_t threshold)
 Set the Medium Synchronization OFDM ED Threshold subfield of the Medium Synchronization Delay information in the Common Info field. More...
 
void SetMldMacAddress (Mac48Address address)
 Set the MLD MAC Address subfield in the Common Info field. More...
 
- Public Member Functions inherited from ns3::WifiInformationElement
virtual ~WifiInformationElement ()
 
Buffer::Iterator Deserialize (Buffer::Iterator i)
 Deserialize entire IE (which may possibly be fragmented into multiple elements), which must be present. More...
 
virtual WifiInformationElementId ElementId () const =0
 Get the wifi information element ID. More...
 
virtual WifiInformationElementId ElementIdExt () const
 Get the wifi information element ID extension. More...
 
uint16_t GetSerializedSize () const
 Get the size of the serialized IE including Element ID and length fields (for every element this IE is possibly fragmented into). More...
 
virtual bool operator== (const WifiInformationElement &a) const
 Compare two IEs for equality by ID & Length, and then through memcmp of serialised version. More...
 
virtual void Print (std::ostream &os) const
 Generate human-readable form of IE. More...
 
Buffer::Iterator Serialize (Buffer::Iterator i) const
 Serialize entire IE including Element ID and length fields. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< WifiInformationElement >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 

Private Types

using CommonInfo = std::variant< CommonInfoBasicMle, std::monostate >
 Typedef for structure holding a Common Info field. More...
 

Private Member Functions

void SetVariant (Variant variant)
 Set the variant of this Multi-Link Element. More...
 

Private Attributes

CommonInfo m_commonInfo
 Common Info field. More...
 
WifiMacType m_frameType
 type of the frame containing the Multi-Link Element More...
 
std::vector< PerStaProfileSubelementm_perStaProfileSubelements
 Per-STA Profile Subelements. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::WifiInformationElement
template<typename IE , typename... Args>
static Buffer::Iterator DeserializeIfPresent (std::optional< IE > &optElem, Buffer::Iterator i, Args &&... args)
 Deserialize an entire IE (which may possibly be fragmented into multiple elements) that is optionally present. More...
 

Detailed Description

The Multi-Link element.

The 802.11be Multi-Link element (see Sec.9.4.2.312 of 802.11be D1.5)

TODO:

  • Add setters/getters for EML Capabilities and MLD Capabilities subfields of the Common Info field of the Basic variant of a Multi-Link Element.
  • Add support for variants other than the Basic one.

Definition at line 134 of file multi-link-element.h.

Member Typedef Documentation

◆ CommonInfo

using ns3::MultiLinkElement::CommonInfo = std::variant<CommonInfoBasicMle, std::monostate >
private

Typedef for structure holding a Common Info field.

Definition at line 513 of file multi-link-element.h.

Constructor & Destructor Documentation

◆ MultiLinkElement() [1/2]

ns3::MultiLinkElement::MultiLinkElement ( WifiMacType  frameType)

Construct a Multi-Link Element with no variant set.

MultiLinkElement.

Parameters
frameTypethe type of the frame containing the Multi-Link Element

Definition at line 161 of file multi-link-element.cc.

◆ MultiLinkElement() [2/2]

ns3::MultiLinkElement::MultiLinkElement ( Variant  variant,
WifiMacType  frameType 
)

Constructor.

Parameters
variantthe Multi-Link element variant (cannot be UNSET)
frameTypethe type of the frame containing the Multi-Link Element

Definition at line 167 of file multi-link-element.cc.

References NS_ASSERT, SetVariant(), and UNSET.

+ Here is the call graph for this function:

Member Function Documentation

◆ AddPerStaProfileSubelement()

void ns3::MultiLinkElement::AddPerStaProfileSubelement ( )

Add a Per-STA Profile Subelement in the Link Info field.

Definition at line 636 of file multi-link-element.cc.

References GetVariant(), m_frameType, m_perStaProfileSubelements, NS_ABORT_IF, UNSET, and ns3::WIFI_MAC_DATA.

Referenced by DeserializeInformationField(), ns3::StaWifiMac::GetMultiLinkElement(), BasicMultiLinkElementTest::GetMultiLinkElement(), and ns3::ApWifiMac::GetMultiLinkElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeserializeInformationField()

uint16_t ns3::MultiLinkElement::DeserializeInformationField ( Buffer::Iterator  start,
uint16_t  length 
)
overridevirtual

Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)

Parameters
startan iterator which points to where the information should be written.
lengththe expected number of bytes to read
Returns
the number of bytes read

Implements ns3::WifiInformationElement.

Definition at line 719 of file multi-link-element.cc.

References AddPerStaProfileSubelement(), ns3::WifiInformationElement::Deserialize(), ns3::Buffer::Iterator::GetDistanceFrom(), GetNPerStaProfileSubelements(), GetPerStaProfile(), m_commonInfo, ns3::Buffer::Iterator::Next(), NS_ABORT_MSG, ns3::Buffer::Iterator::PeekU8(), PER_STA_PROFILE_SUBELEMENT_ID, ns3::Buffer::Iterator::ReadLsbtohU16(), SetVariant(), and visualizer.core::start().

+ Here is the call graph for this function:

◆ ElementId()

WifiInformationElementId ns3::MultiLinkElement::ElementId ( ) const
overridevirtual

Get the wifi information element ID.

Returns
the wifi information element ID

Implements ns3::WifiInformationElement.

Definition at line 175 of file multi-link-element.cc.

References IE_EXTENSION.

◆ ElementIdExt()

WifiInformationElementId ns3::MultiLinkElement::ElementIdExt ( ) const
overridevirtual

Get the wifi information element ID extension.

Returns
the wifi information element ID extension

Reimplemented from ns3::WifiInformationElement.

Definition at line 181 of file multi-link-element.cc.

References IE_EXT_MULTI_LINK_ELEMENT.

◆ GetBssParamsChangeCount()

uint8_t ns3::MultiLinkElement::GetBssParamsChangeCount ( ) const

Return the BSS Parameters Change Count subfield in the Common Info field.

Make sure that this is a Basic Multi-Link Element and the BSS Parameters Change Count subfield is present.

Returns
the BSS Parameters Change Count subfield in the Common Info field

Definition at line 251 of file multi-link-element.cc.

References m_commonInfo.

◆ GetInformationFieldSize()

uint16_t ns3::MultiLinkElement::GetInformationFieldSize ( ) const
overridevirtual

Length of serialized information (i.e., the length of the body of the IE, not including the Element ID and length octets.

This is the value that will appear in the second octet of the entire IE - the length field - if the IE is not fragmented)

Returns
the length of serialized information

Implements ns3::WifiInformationElement.

Definition at line 663 of file multi-link-element.cc.

References m_commonInfo, m_perStaProfileSubelements, and NS_ABORT_MSG.

◆ GetLinkIdInfo()

uint8_t ns3::MultiLinkElement::GetLinkIdInfo ( ) const

Return the Link ID Info subfield in the Common Info field.

Make sure that this is a Basic Multi-Link Element and the Link ID Info subfield is present.

Returns
the Link ID Info subfield in the Common Info field

Definition at line 233 of file multi-link-element.cc.

References m_commonInfo.

◆ GetMediumSyncDelayTimer()

Time ns3::MultiLinkElement::GetMediumSyncDelayTimer ( ) const

Get the Medium Synchronization Duration subfield of the Medium Synchronization Delay information in the Common Info field.

Make sure that this is a Basic Multi-Link Element and the Medium Synchronization Duration subfield is present.

Returns
the timer duration

Definition at line 272 of file multi-link-element.cc.

References m_commonInfo, and ns3::MicroSeconds().

+ Here is the call graph for this function:

◆ GetMediumSyncMaxNTxops()

uint8_t ns3::MultiLinkElement::GetMediumSyncMaxNTxops ( ) const

Get the maximum number of TXOPs a non-AP STA is allowed to attempt to initiate while the MediumSyncDelay timer is running at a non-AP STA.

Make sure that this is a Basic Multi-Link Element and the Medium Synchronization Duration subfield is present.

Returns
the number of TXOPs

Definition at line 317 of file multi-link-element.cc.

References m_commonInfo.

◆ GetMediumSyncOfdmEdThreshold()

int8_t ns3::MultiLinkElement::GetMediumSyncOfdmEdThreshold ( ) const

Get the Medium Synchronization OFDM ED Threshold in dBm.

Make sure that this is a Basic Multi-Link Element and the Medium Synchronization Duration subfield is present.

Returns
the threshold in dBm

Definition at line 294 of file multi-link-element.cc.

References m_commonInfo.

◆ GetMldMacAddress()

Mac48Address ns3::MultiLinkElement::GetMldMacAddress ( ) const

Return the MLD MAC Address subfield in the Common Info field.

Make sure that this is a Basic Multi-Link Element.

Returns
the MLD MAC Address subfield in the Common Info field.

Definition at line 215 of file multi-link-element.cc.

References m_commonInfo.

◆ GetNPerStaProfileSubelements()

std::size_t ns3::MultiLinkElement::GetNPerStaProfileSubelements ( ) const

Return the number of Per-STA Profile Subelement in the Link Info field.

Returns
the number of Per-STA Profile Subelement in the Link Info field

Definition at line 645 of file multi-link-element.cc.

References m_perStaProfileSubelements.

Referenced by DeserializeInformationField(), ns3::StaWifiMac::GetMultiLinkElement(), and ns3::ApWifiMac::GetMultiLinkElement().

+ Here is the caller graph for this function:

◆ GetPerStaProfile() [1/2]

MultiLinkElement::PerStaProfileSubelement & ns3::MultiLinkElement::GetPerStaProfile ( std::size_t  i)

Get a reference to the i-th Per-STA Profile Subelement in the Link Info field.

Parameters
ithe index of the Per-STA Profile Subelement in the Link Info field
Returns
a reference to the i-th Per-STA Profile Subelement in the Link Info field

Definition at line 651 of file multi-link-element.cc.

References m_perStaProfileSubelements.

Referenced by DeserializeInformationField(), ns3::StaWifiMac::GetMultiLinkElement(), BasicMultiLinkElementTest::GetMultiLinkElement(), and ns3::ApWifiMac::GetMultiLinkElement().

+ Here is the caller graph for this function:

◆ GetPerStaProfile() [2/2]

const MultiLinkElement::PerStaProfileSubelement & ns3::MultiLinkElement::GetPerStaProfile ( std::size_t  i) const

Get a reference to the i-th Per-STA Profile Subelement in the Link Info field.

Parameters
ithe index of the Per-STA Profile Subelement in the Link Info field
Returns
a reference to the i-th Per-STA Profile Subelement in the Link Info field

Definition at line 657 of file multi-link-element.cc.

References m_perStaProfileSubelements.

◆ GetVariant()

MultiLinkElement::Variant ns3::MultiLinkElement::GetVariant ( ) const

Get the Multi-Link element variant.

Returns
the Multi-Link element variant

Definition at line 187 of file multi-link-element.cc.

References m_commonInfo.

Referenced by AddPerStaProfileSubelement(), SerializeInformationField(), and SetVariant().

+ Here is the caller graph for this function:

◆ HasBssParamsChangeCount()

bool ns3::MultiLinkElement::HasBssParamsChangeCount ( ) const

Return true if the BSS Parameters Change Count subfield in the Common Info field is present and false otherwise.

Make sure that this is a Basic Multi-Link Element.

Returns
true if the BSS Parameters Change Count subfield in the Common Info field is present and false otherwise

Definition at line 245 of file multi-link-element.cc.

References m_commonInfo.

◆ HasLinkIdInfo()

bool ns3::MultiLinkElement::HasLinkIdInfo ( ) const

Return true if the Link ID Info subfield in the Common Info field is present and false otherwise.

Make sure that this is a Basic Multi-Link Element.

Returns
true if the Link ID Info subfield in the Common Info field is present and false otherwise

Definition at line 227 of file multi-link-element.cc.

References m_commonInfo.

◆ HasMediumSyncDelayInfo()

bool ns3::MultiLinkElement::HasMediumSyncDelayInfo ( ) const

Return true if the Medium Synchronization Delay Information subfield in the Common Info field is present and false otherwise.

Make sure that this is a Basic Multi-Link Element.

Returns
true if the Medium Synchronization Delay Information subfield in the Common Info field is present and false otherwise

Definition at line 326 of file multi-link-element.cc.

References m_commonInfo.

◆ SerializeInformationField()

void ns3::MultiLinkElement::SerializeInformationField ( Buffer::Iterator  start) const
overridevirtual

Serialize information (i.e., the body of the IE, not including the Element ID and length octets)

Parameters
startan iterator which points to where the information should be written.

Implements ns3::WifiInformationElement.

Definition at line 692 of file multi-link-element.cc.

References GetVariant(), m_commonInfo, m_perStaProfileSubelements, NS_ABORT_MSG, and visualizer.core::start().

+ Here is the call graph for this function:

◆ SetBssParamsChangeCount()

void ns3::MultiLinkElement::SetBssParamsChangeCount ( uint8_t  count)

Set the BSS Parameters Change Count subfield in the Common Info field.

Make sure that this is a Basic Multi-Link Element.

Parameters
countthe BSS Parameters Change Count

Definition at line 239 of file multi-link-element.cc.

References m_commonInfo.

Referenced by BasicMultiLinkElementTest::GetMultiLinkElement(), and ns3::ApWifiMac::GetMultiLinkElement().

+ Here is the caller graph for this function:

◆ SetLinkIdInfo()

void ns3::MultiLinkElement::SetLinkIdInfo ( uint8_t  linkIdInfo)

Set the Link ID Info subfield in the Common Info field.

Make sure that this is a Basic Multi-Link Element.

Parameters
linkIdInfothe link ID information

Definition at line 221 of file multi-link-element.cc.

References m_commonInfo.

Referenced by BasicMultiLinkElementTest::GetMultiLinkElement(), and ns3::ApWifiMac::GetMultiLinkElement().

+ Here is the caller graph for this function:

◆ SetMediumSyncDelayTimer()

void ns3::MultiLinkElement::SetMediumSyncDelayTimer ( Time  delay)

Set the Medium Synchronization Duration subfield of the Medium Synchronization Delay information in the Common Info field.

Make sure that this is a Basic Multi-Link Element.

Parameters
delaythe timer duration (must be a multiple of 32 microseconds)

Definition at line 257 of file multi-link-element.cc.

References ns3::Time::GetMicroSeconds(), m_commonInfo, ns3::CommonInfoBasicMle::MediumSyncDelayInfo::mediumSyncDuration, and NS_ABORT_MSG_IF.

Referenced by BasicMultiLinkElementTest::GetMultiLinkElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetMediumSyncMaxNTxops()

void ns3::MultiLinkElement::SetMediumSyncMaxNTxops ( uint8_t  nTxops)

Set the Medium Synchronization Maximum Number of TXOPs subfield of the Medium Synchronization Delay information in the Common Info field.

Make sure that this is a Basic Multi-Link Element.

Parameters
nTxopsthe maximum number of TXOPs a non-AP STA is allowed to attempt to initiate while the MediumSyncDelay timer is running at a non-AP STA

Definition at line 303 of file multi-link-element.cc.

References m_commonInfo, ns3::CommonInfoBasicMle::MediumSyncDelayInfo::mediumSyncMaxNTxops, and NS_ASSERT.

Referenced by BasicMultiLinkElementTest::GetMultiLinkElement().

+ Here is the caller graph for this function:

◆ SetMediumSyncOfdmEdThreshold()

void ns3::MultiLinkElement::SetMediumSyncOfdmEdThreshold ( int8_t  threshold)

Set the Medium Synchronization OFDM ED Threshold subfield of the Medium Synchronization Delay information in the Common Info field.

Make sure that this is a Basic Multi-Link Element.

Parameters
thresholdthe threshold in dBm (ranges from -72 to -62 dBm)

Definition at line 280 of file multi-link-element.cc.

References m_commonInfo, ns3::CommonInfoBasicMle::MediumSyncDelayInfo::mediumSyncOfdmEdThreshold, NS_ABORT_MSG_IF, and second::value.

Referenced by BasicMultiLinkElementTest::GetMultiLinkElement().

+ Here is the caller graph for this function:

◆ SetMldMacAddress()

void ns3::MultiLinkElement::SetMldMacAddress ( Mac48Address  address)

Set the MLD MAC Address subfield in the Common Info field.

Make sure that this is a Basic Multi-Link Element.

Parameters
addressthe MLD MAC address

Definition at line 209 of file multi-link-element.cc.

References first::address, and m_commonInfo.

Referenced by ns3::StaWifiMac::GetMultiLinkElement(), BasicMultiLinkElementTest::GetMultiLinkElement(), and ns3::ApWifiMac::GetMultiLinkElement().

+ Here is the caller graph for this function:

◆ SetVariant()

void ns3::MultiLinkElement::SetVariant ( Variant  variant)
private

Set the variant of this Multi-Link Element.

Parameters
variantthe variant of this Multi-Link Element

Definition at line 193 of file multi-link-element.cc.

References BASIC_VARIANT, GetVariant(), m_commonInfo, NS_ABORT_MSG, NS_ABORT_MSG_IF, and UNSET.

Referenced by MultiLinkElement(), and DeserializeInformationField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_commonInfo

◆ m_frameType

◆ m_perStaProfileSubelements

std::vector<PerStaProfileSubelement> ns3::MultiLinkElement::m_perStaProfileSubelements
private

The documentation for this class was generated from the following files: