A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends 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:

Classes

struct  MyPerr
 
struct  Statistics
 

Public Member Functions

 HwmpProtocolMac (uint32_t, Ptr< HwmpProtocol >)
 
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. More...
 
bool UpdateOutcomingFrame (Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
 Update frame before it will be forwarded down. More...
 
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 (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. More...
 

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.

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.

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.

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

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

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 ReceiveAction(), and ReceiveData().

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(), NS_ASSERT, NS_LOG_FUNCTION_NOARGS, and SendMyPreq().

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

Update frame before it will be forwarded down.

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

Implements ns3::MeshWifiInterfaceMacPlugin.

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

References ns3::Packet::AddHeader(), ns3::Packet::GetSize(), NS_FATAL_ERROR, and ns3::Packet::RemovePacketTag().


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