A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
 ~HwmpProtocolMac () override
 
int64_t AssignStreams (int64_t stream) override
 Assign a fixed random variable stream number to the random variables used by this model.
 
bool Receive (Ptr< Packet > packet, const WifiMacHeader &header) override
 Process received frame.
 
void SetParent (Ptr< MeshWifiInterfaceMac > parent) override
 Each plugin must be installed on an interface to work.
 
void UpdateBeacon (MeshWifiBeacon &beacon) const override
 Update beacon before it will be formed and sent.
 
bool UpdateOutcomingFrame (Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to) override
 Update frame before it will be forwarded down.
 
- Public Member Functions inherited from ns3::MeshWifiInterfaceMacPlugin
virtual ~MeshWifiInterfaceMacPlugin ()
 This is for subclasses.
 
virtual int64_t AssignStreams (int64_t stream)=0
 Assign a fixed random variable stream number to the random variables used by this model.
 
virtual bool Receive (Ptr< Packet > packet, const WifiMacHeader &header)=0
 Process received frame.
 
virtual void SetParent (Ptr< MeshWifiInterfaceMac > parent)=0
 Each plugin must be installed on an interface to work.
 
virtual void UpdateBeacon (MeshWifiBeacon &beacon) const =0
 Update beacon before it will be formed and sent.
 
virtual bool UpdateOutcomingFrame (Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)=0
 Update frame before it will be forwarded down.
 
- Public Member Functions inherited from ns3::SimpleRefCount< MeshWifiInterfaceMacPlugin >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 

Private Member Functions

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

Static Private Member Functions

static WifiActionHeader GetWifiActionHeader ()
 

Private Attributes

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

Friends

class HwmpProtocol
 allow HwmpProtocol class friend access
 

Detailed Description

Interface MAC plugin for HWMP – 802.11s routing protocol.

Definition at line 44 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 44 of file hwmp-protocol-mac.cc.

References NS_LOG_FUNCTION.

◆ ~HwmpProtocolMac()

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

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

Member Function Documentation

◆ AssignStreams()

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

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 563 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 502 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 496 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 242 of file hwmp-protocol-mac.cc.

References ns3::WifiActionHeader::MESH, 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 425 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 
)
overridevirtual

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 193 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()

bool ns3::dot11s::HwmpProtocolMac::ReceiveData ( Ptr< Packet packet,
const WifiMacHeader header 
)
private

◆ Report()

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

Report statistics.

Parameters
osThe output stream on which to report

Definition at line 547 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 292 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 556 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 481 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, ns3::Simulator::Schedule(), and SendMyPerr().

Referenced by InitiatePerr(), and SendMyPerr().

+ 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 323 of file hwmp-protocol-mac.cc.

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

Referenced by RequestDestination(), and SendMyPreq().

+ 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 252 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()

void ns3::dot11s::HwmpProtocolMac::SendPreqVector ( std::vector< IePreq preq)
private

◆ SetParent()

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

Each plugin must be installed on an interface to work.

Parameters
parentthe parent object

Implements ns3::MeshWifiInterfaceMacPlugin.

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

References m_parent, and NS_LOG_FUNCTION.

◆ UpdateBeacon()

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

Update beacon before it will be formed and sent.

Parameters
beacon
Todo:
define when MAC call this

Implements ns3::MeshWifiInterfaceMacPlugin.

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

◆ UpdateOutcomingFrame()

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

Update frame before it will be forwarded down.

Parameters
packet
header
from
to
Returns
false if (and only if) frame should be dropped
Todo:
define when MAC call this, preconditions & postconditions

Implements ns3::MeshWifiInterfaceMacPlugin.

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

References ns3::dot11s::HwmpTag::GetAddress(), ns3::dot11s::HwmpTag::GetSeqno(), ns3::dot11s::HwmpTag::GetTtl(), ns3::WifiMacHeader::IsData(), m_stats, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr1(), ns3::dot11s::MeshHeader::SetMeshSeqno(), ns3::dot11s::MeshHeader::SetMeshTtl(), ns3::WifiMacHeader::SetQosMeshControlPresent(), ns3::dot11s::HwmpProtocolMac::Statistics::txData, and ns3::dot11s::HwmpProtocolMac::Statistics::txDataBytes.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ HwmpProtocol

friend class HwmpProtocol
friend

allow HwmpProtocol class friend access

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

Member Data Documentation

◆ m_ifIndex

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

IF index.

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

Referenced by ReceiveAction(), and SendPreqVector().

◆ m_myPerr

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

PERR.

Definition at line 161 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 147 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 152 of file hwmp-protocol-mac.h.

Referenced by SendMyPerr().

◆ m_preqTimer

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

Timer for PREQs.

Definition at line 146 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: