A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
struct  Statistics

Public Member Functions

 HwmpProtocolMac (uint32_t, Ptr< HwmpProtocol >)
 ~HwmpProtocolMac ()
Inherited from MAC plugin
void SetParent (Ptr< MeshWifiInterfaceMac > parent)
 Each plugin must be installed on interface to work.
bool Receive (Ptr< Packet > packet, const WifiMacHeader &header)
 Process received frame.
bool UpdateOutcomingFrame (Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
 Update frame before it will be forwarded down.
void UpdateBeacon (MeshWifiBeacon &beacon) const
 Update beacon is empty, because HWMP does not know anything about beacons.
int64_t AssignStreams (int64_t stream)
- Public Member Functions inherited from ns3::MeshWifiInterfaceMacPlugin
virtual ~MeshWifiInterfaceMacPlugin ()
 This is for subclasses.
- Public Member Functions inherited from ns3::SimpleRefCount< MeshWifiInterfaceMacPlugin >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const

Private Member Functions

uint16_t GetChannelId () const
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 &) const
 Report statistics.
void ResetStats ()
void SendMyPerr ()
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)
void SendPreq (std::vector< IePreq > preq)
void SendPrep (IePrep prep, Mac48Address receiver)
void ForwardPerr (std::vector< HwmpProtocol::FailedDestination > destinations, std::vector< Mac48Address > receivers)
void InitiatePerr (std::vector< HwmpProtocol::FailedDestination > destinations, std::vector< Mac48Address > receivers)
void RequestDestination (Mac48Address dest, uint32_t originator_seqno, uint32_t dst_seqno)
 Request a destination. If can not send preq immediately - add a destination to existing PREQ generated by me and stored in PREQ queue.

Static Private Member Functions

static WifiActionHeader GetWifiActionHeader ()

Private Attributes

uint32_t m_ifIndex
Ptr< MeshWifiInterfaceMacm_parent
Ptr< HwmpProtocolm_protocol
my PREQ and PREQ timer:
EventId m_preqTimer
std::vector< IePreqm_myPreq
PERR timer and stored path error
EventId m_perrTimer
MyPerr m_myPerr
Statistics:
Statistics m_stats

Friends

class HwmpProtocol

Additional Inherited Members

- Static Public Member Functions inherited from ns3::SimpleRefCount< MeshWifiInterfaceMacPlugin >
static void Cleanup (void)

Detailed Description

Interface MAC plugin for HWMP – 802.11s routing protocol.

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

Constructor & Destructor Documentation

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

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

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

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

Member Function Documentation

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

References ns3::dot11s::HwmpProtocol::AssignStreams(), and m_protocol.

+ Here is the call graph for this function:

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

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

References ns3::MeshWifiInterfaceMac::GetFrequencyChannel(), and m_parent.

+ Here is the call graph for this function:

uint32_t ns3::dot11s::HwmpProtocolMac::GetLinkMetric ( Mac48Address  peerAddress) const
private
Returns
metric to HWMP protocol, needed only by metrics to add

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

References ns3::MeshWifiInterfaceMac::GetLinkMetric(), and m_parent.

+ Here is the call graph for this function:

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

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

References ns3::WifiActionHeader::MESH_PATH_SELECTION, ns3::WifiActionHeader::PATH_SELECTION, ns3::WifiActionHeader::ActionValue::pathSelection, and ns3::WifiActionHeader::SetAction().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

+ Here is the call graph for this function:

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

Process received frame.

Returns
false if (and only if) frame should be dropped TODO define when MAC call this

Implements ns3::MeshWifiInterfaceMacPlugin.

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

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

+ Here is the call graph for this function:

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

Report statistics.

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

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

+ Here is the call graph for this function:

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

Request a destination. If can not 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 253 of file hwmp-protocol-mac.cc.

References ns3::dot11s::IePreq::AddDestinationAddressElement(), ns3::dot11s::HwmpProtocol::GetActivePathLifetime(), ns3::dot11s::HwmpProtocol::GetAddress(), ns3::dot11s::HwmpProtocol::GetDoFlag(), ns3::dot11s::HwmpProtocol::GetMaxTtl(), ns3::dot11s::HwmpProtocol::GetNextPreqId(), ns3::dot11s::HwmpProtocol::GetRfFlag(), m_myPreq, m_protocol, NS_ASSERT, NS_LOG_FUNCTION_NOARGS, 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:

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

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

References m_stats.

void ns3::dot11s::HwmpProtocolMac::SendMyPerr ( )
private
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 277 of file hwmp-protocol-mac.cc.

References ns3::dot11s::HwmpProtocol::GetPreqMinInterval(), ns3::EventId::IsRunning(), m_myPreq, m_preqTimer, m_protocol, NS_ASSERT, NS_LOG_FUNCTION_NOARGS, ns3::Simulator::Schedule(), and SendPreq().

Referenced by RequestDestination().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References NS_LOG_FUNCTION_NOARGS.

Referenced by SendMyPreq().

+ Here is the caller graph for this function:

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

Each plugin must be installed on interface to work.

Implements ns3::MeshWifiInterfaceMacPlugin.

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

References m_parent.

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

Update beacon is empty, because HWMP does not know anything about beacons.

Implements ns3::MeshWifiInterfaceMacPlugin.

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

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

Friends And Related Function Documentation

friend class HwmpProtocol
friend

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

Member Data Documentation

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

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

Referenced by ReceiveAction(), and SendPreq().

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

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

Referenced by InitiatePerr(), and SendMyPerr().

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

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

Referenced by RequestDestination(), and SendMyPreq().

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

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

Referenced by SendMyPerr().

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

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

Referenced by SendMyPreq().

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

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