A Discrete-Event Network Simulator
API
ns3::dot11s::HwmpProtocolMac Class Reference

Interface MAC plugin for HWMP – 802.11s routing protocol. More...

#include "hwmp-protocol-mac.h"

+ Inheritance diagram for ns3::dot11s::HwmpProtocolMac:
+ Collaboration diagram for ns3::dot11s::HwmpProtocolMac:

Classes

struct  MyPerr
 MyPerr structure. More...
 
struct  Statistics
 Statistics structure. More...
 

Public Member Functions

 HwmpProtocolMac (uint32_t ifIndex, Ptr< HwmpProtocol > protocol)
 Constructor. More...
 
 ~HwmpProtocolMac ()
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
bool Receive (Ptr< Packet > packet, const WifiMacHeader &header)
 Process received frame. More...
 
void SetParent (Ptr< MeshWifiInterfaceMac > parent)
 Each plugin must be installed on an interface to work. More...
 
void UpdateBeacon (MeshWifiBeacon &beacon) const
 Update beacon before it will be formed and sent. More...
 
bool UpdateOutcomingFrame (Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
 Update frame before it will be forwarded down. More...
 
- Public Member Functions inherited from ns3::MeshWifiInterfaceMacPlugin
virtual ~MeshWifiInterfaceMacPlugin ()
 This is for subclasses. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< MeshWifiInterfaceMacPlugin >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= ([[maybe_unused]] const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 

Private Member Functions

uint16_t GetChannelId () const
 Get the channel ID. More...
 
uint32_t GetLinkMetric (Mac48Address peerAddress) const
 
bool ReceiveAction (Ptr< Packet > packet, const WifiMacHeader &header)
 Receive action management frame. More...
 
bool ReceiveData (Ptr< Packet > packet, const WifiMacHeader &header)
 Receive data frame. More...
 
void Report (std::ostream &os) const
 Report statistics. More...
 
void ResetStats ()
 Reset statistics. More...
 
void SendMyPerr ()
 Send PERR function. More...
 
void SendMyPreq ()
 Sends one PREQ when PreqMinInterval after last PREQ expires (if any PREQ exists in rhe queue) More...
 
Interaction with HWMP:
void SendPreq (IePreq preq)
 Send PREQ function. More...
 
void SendPreqVector (std::vector< IePreq > preq)
 Send PREQ function for vector of PREQ. More...
 
void SendPrep (IePrep prep, Mac48Address receiver)
 Send PREP function. More...
 
void ForwardPerr (std::vector< HwmpProtocol::FailedDestination > destinations, std::vector< Mac48Address > receivers)
 Forward a path error. More...
 
void InitiatePerr (std::vector< HwmpProtocol::FailedDestination > destinations, std::vector< Mac48Address > receivers)
 initiate my own path error More...
 
void RequestDestination (Mac48Address dest, uint32_t originator_seqno, uint32_t dst_seqno)
 Request a destination. More...
 

Static Private Member Functions

static WifiActionHeader GetWifiActionHeader ()
 

Private Attributes

uint32_t m_ifIndex
 IF index. More...
 
Ptr< MeshWifiInterfaceMacm_parent
 parent More...
 
Ptr< HwmpProtocolm_protocol
 protocol More...
 
my PREQ and PREQ timer:
EventId m_preqTimer
 Timer for PREQs. More...
 
std::vector< IePreqm_myPreq
 container of PREQs More...
 
PERR timer and stored path error
EventId m_perrTimer
 PERR. More...
 
MyPerr m_myPerr
 PERR. More...
 
Statistics
Statistics m_stats
 statistics More...
 

Friends

class HwmpProtocol
 allow HwmpProtocol class friend access More...
 

Detailed Description

Interface MAC plugin for HWMP – 802.11s routing protocol.

Definition at line 43 of file hwmp-protocol-mac.h.

Constructor & Destructor Documentation

◆ HwmpProtocolMac()

ns3::dot11s::HwmpProtocolMac::HwmpProtocolMac ( uint32_t  ifIndex,
Ptr< HwmpProtocol protocol 
)

Constructor.

Parameters
ifIndexinterface index
protocolpointer to HWMP protocol instance

Definition at line 41 of file hwmp-protocol-mac.cc.

References NS_LOG_FUNCTION.

◆ ~HwmpProtocolMac()

ns3::dot11s::HwmpProtocolMac::~HwmpProtocolMac ( )

Definition at line 46 of file hwmp-protocol-mac.cc.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::dot11s::HwmpProtocolMac::AssignStreams ( int64_t  stream)
virtual

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Implements ns3::MeshWifiInterfaceMacPlugin.

Definition at line 497 of file hwmp-protocol-mac.cc.

References m_protocol.

◆ ForwardPerr()

◆ GetChannelId()

uint16_t ns3::dot11s::HwmpProtocolMac::GetChannelId ( ) const
private

Get the channel ID.

Returns
the channel ID

Definition at line 453 of file hwmp-protocol-mac.cc.

References m_parent.

◆ GetLinkMetric()

uint32_t ns3::dot11s::HwmpProtocolMac::GetLinkMetric ( Mac48Address  peerAddress) const
private
Parameters
peerAddresspeer address
Returns
metric to HWMP protocol, needed only by metrics to add peer as routing entry

Definition at line 448 of file hwmp-protocol-mac.cc.

References m_parent.

◆ GetWifiActionHeader()

WifiActionHeader ns3::dot11s::HwmpProtocolMac::GetWifiActionHeader ( )
staticprivate
Returns
a path selection action header

Definition at line 219 of file hwmp-protocol-mac.cc.

References ns3::WifiActionHeader::MESH, ns3::WifiActionHeader::ActionValue::meshAction, ns3::WifiActionHeader::PATH_SELECTION, and ns3::WifiActionHeader::SetAction().

Referenced by ForwardPerr(), SendPrep(), and SendPreqVector().

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

◆ InitiatePerr()

void ns3::dot11s::HwmpProtocolMac::InitiatePerr ( std::vector< HwmpProtocol::FailedDestination destinations,
std::vector< Mac48Address receivers 
)
private

initiate my own path error

Parameters
destinationsvector of failed destinations
receiversvector of receivers

Definition at line 386 of file hwmp-protocol-mac.cc.

References ns3::dot11s::HwmpProtocolMac::MyPerr::destinations, m_myPerr, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::dot11s::HwmpProtocolMac::MyPerr::receivers, and SendMyPerr().

+ Here is the call graph for this function:

◆ Receive()

bool ns3::dot11s::HwmpProtocolMac::Receive ( Ptr< Packet packet,
const WifiMacHeader header 
)
virtual

Process received frame.

Parameters
packet
header
Returns
false if (and only if) frame should be dropped
Todo:
define when MAC call this

Implements ns3::MeshWifiInterfaceMacPlugin.

Definition at line 174 of file hwmp-protocol-mac.cc.

References ns3::WifiMacHeader::IsAction(), ns3::WifiMacHeader::IsData(), NS_LOG_FUNCTION, ReceiveAction(), and ReceiveData().

+ Here is the call graph for this function:

◆ ReceiveAction()

◆ ReceiveData()

◆ Report()

void ns3::dot11s::HwmpProtocolMac::Report ( std::ostream &  os) const
private

Report statistics.

Parameters
osThe output stream on which to report

Definition at line 482 of file hwmp-protocol-mac.cc.

References m_parent, m_stats, and ns3::dot11s::HwmpProtocolMac::Statistics::Print().

+ Here is the call graph for this function:

◆ RequestDestination()

void ns3::dot11s::HwmpProtocolMac::RequestDestination ( Mac48Address  dest,
uint32_t  originator_seqno,
uint32_t  dst_seqno 
)
private

Request a destination.

If cannot send PREQ immediately, add a destination to existing PREQ generated by me and stored in PREQ queue

Parameters
destis the destination to be resolved
originator_seqnois a sequence number that shall be preq originator sequenece number
dst_seqnois a sequence number taken from routing table

Definition at line 266 of file hwmp-protocol-mac.cc.

References ns3::dot11s::IePreq::AddDestinationAddressElement(), m_myPreq, m_protocol, NS_ASSERT, NS_LOG_FUNCTION, SendMyPreq(), ns3::dot11s::IePreq::SetHopcount(), ns3::dot11s::IePreq::SetLifetime(), ns3::dot11s::IePreq::SetOriginatorAddress(), ns3::dot11s::IePreq::SetOriginatorSeqNumber(), ns3::dot11s::IePreq::SetPreqID(), and ns3::dot11s::IePreq::SetTTL().

+ Here is the call graph for this function:

◆ ResetStats()

void ns3::dot11s::HwmpProtocolMac::ResetStats ( )
private

Reset statistics.

Definition at line 490 of file hwmp-protocol-mac.cc.

References m_stats, and NS_LOG_FUNCTION.

◆ SendMyPerr()

void ns3::dot11s::HwmpProtocolMac::SendMyPerr ( )
private

Send PERR function.

Definition at line 435 of file hwmp-protocol-mac.cc.

References ns3::dot11s::HwmpProtocolMac::MyPerr::destinations, ForwardPerr(), ns3::EventId::IsRunning(), m_myPerr, m_perrTimer, m_protocol, NS_LOG_FUNCTION, ns3::dot11s::HwmpProtocolMac::MyPerr::receivers, and ns3::Simulator::Schedule().

Referenced by InitiatePerr().

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

◆ SendMyPreq()

void ns3::dot11s::HwmpProtocolMac::SendMyPreq ( )
private

Sends one PREQ when PreqMinInterval after last PREQ expires (if any PREQ exists in rhe queue)

Definition at line 290 of file hwmp-protocol-mac.cc.

References ns3::EventId::IsRunning(), m_myPreq, m_preqTimer, m_protocol, NS_ASSERT, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendPreqVector().

Referenced by RequestDestination().

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

◆ SendPrep()

◆ SendPreq()

void ns3::dot11s::HwmpProtocolMac::SendPreq ( IePreq  preq)
private

Send PREQ function.

Parameters
preqthe PREQ

Definition at line 228 of file hwmp-protocol-mac.cc.

References NS_LOG_FUNCTION, and SendPreqVector().

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

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

◆ SendPreqVector()

◆ SetParent()

void ns3::dot11s::HwmpProtocolMac::SetParent ( Ptr< MeshWifiInterfaceMac parent)
virtual

Each plugin must be installed on an interface to work.

Parameters
parentthe parent object

Implements ns3::MeshWifiInterfaceMacPlugin.

Definition at line 50 of file hwmp-protocol-mac.cc.

References m_parent, and NS_LOG_FUNCTION.

◆ UpdateBeacon()

void ns3::dot11s::HwmpProtocolMac::UpdateBeacon ( MeshWifiBeacon beacon) const
inlinevirtual

Update beacon before it will be formed and sent.

Parameters
beacon
Todo:
define when MAC call this

Implements ns3::MeshWifiInterfaceMacPlugin.

Definition at line 60 of file hwmp-protocol-mac.h.

◆ UpdateOutcomingFrame()

bool ns3::dot11s::HwmpProtocolMac::UpdateOutcomingFrame ( Ptr< Packet packet,
WifiMacHeader header,
Mac48Address  from,
Mac48Address  to 
)
virtual

Friends And Related Function Documentation

◆ HwmpProtocol

friend class HwmpProtocol
friend

allow HwmpProtocol class friend access

Definition at line 65 of file hwmp-protocol-mac.h.

Member Data Documentation

◆ m_ifIndex

uint32_t ns3::dot11s::HwmpProtocolMac::m_ifIndex
private

IF index.

Definition at line 133 of file hwmp-protocol-mac.h.

Referenced by ReceiveAction(), and SendPreqVector().

◆ m_myPerr

MyPerr ns3::dot11s::HwmpProtocolMac::m_myPerr
private

PERR.

Definition at line 150 of file hwmp-protocol-mac.h.

Referenced by InitiatePerr(), and SendMyPerr().

◆ m_myPreq

std::vector<IePreq> ns3::dot11s::HwmpProtocolMac::m_myPreq
private

container of PREQs

Definition at line 139 of file hwmp-protocol-mac.h.

Referenced by RequestDestination(), and SendMyPreq().

◆ m_parent

Ptr<MeshWifiInterfaceMac> ns3::dot11s::HwmpProtocolMac::m_parent
private

◆ m_perrTimer

EventId ns3::dot11s::HwmpProtocolMac::m_perrTimer
private

PERR.

Definition at line 144 of file hwmp-protocol-mac.h.

Referenced by SendMyPerr().

◆ m_preqTimer

EventId ns3::dot11s::HwmpProtocolMac::m_preqTimer
private

Timer for PREQs.

Definition at line 138 of file hwmp-protocol-mac.h.

Referenced by SendMyPreq().

◆ m_protocol

Ptr<HwmpProtocol> ns3::dot11s::HwmpProtocolMac::m_protocol
private

◆ m_stats

Statistics ns3::dot11s::HwmpProtocolMac::m_stats
private

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