A Discrete-Event Network Simulator
API
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
ns3::dot11s::HwmpProtocol Class Reference

Hybrid wireless mesh protocol – a mesh routing protocol defined in IEEE 802.11-2012 standard. More...

#include "hwmp-protocol.h"

+ Inheritance diagram for ns3::dot11s::HwmpProtocol:

Classes

struct  FailedDestination
 structure of unreachable destination - address and sequence number More...
 
struct  PathError
 Structure of path error: IePerr and list of receivers: interfaces and MAC address. More...
 
struct  PreqEvent
 PreqEvent structure. More...
 
struct  QueuedPacket
 Packet waiting its routing information. More...
 
struct  Statistics
 Statistics structure. More...
 

Public Types

typedef struct FailedDestination FailedDestination
 
- Public Types inherited from ns3::MeshL2RoutingProtocol
typedef Callback< void, bool, Ptr< Packet >, Mac48Address, Mac48Address, uint16_t, uint32_t > RouteReplyCallback
 Callback to be invoked when route discovery procedure is completed. More...
 

Public Member Functions

 HwmpProtocol ()
 
 ~HwmpProtocol ()
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
void DoDispose ()
 Destructor implementation. More...
 
Ptr< HwmpRtableGetRoutingTable (void) const
 Get pointer to HWMP routing table. More...
 
bool Install (Ptr< MeshPointDevice >)
 Install HWMP on given mesh point. More...
 
void PeerLinkStatus (Mac48Address meshPontAddress, Mac48Address peerAddress, uint32_t interface, bool status)
 Peer link status function. More...
 
bool RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, const Mac48Address destination, Ptr< Packet > packet, uint16_t &protocolType)
 Clean HWMP packet tag from packet; only the packet parameter is used. More...
 
void Report (std::ostream &) const
 Statistics: More...
 
bool RequestRoute (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, Ptr< const Packet > packet, uint16_t protocolType, RouteReplyCallback routeReply)
 Route request, inherited from MeshL2RoutingProtocol. More...
 
void ResetStats ()
 Reset Statistics: More...
 
void SetNeighboursCallback (Callback< std::vector< Mac48Address >, uint32_t > cb)
 This callback is used to obtain active neighbours on a given interface. More...
 
Proactive PREQ mechanism:
void SetRoot ()
 
void UnsetRoot ()
 
- Public Member Functions inherited from ns3::MeshL2RoutingProtocol
virtual ~MeshL2RoutingProtocol ()
 virtual D-tor for subclasses More...
 
Ptr< MeshPointDeviceGetMeshPoint () const
 Each mesh protocol must be installed on the mesh point to work. More...
 
void SetMeshPoint (Ptr< MeshPointDevice > mp)
 Set host mesh point, analog of SetNode (...) methods for upper layer protocols. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::MeshL2RoutingProtocol
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Types

typedef std::map< uint32_t, Ptr< HwmpProtocolMac > > HwmpProtocolMacMap
 HwmpProtocolMacMap typedef. More...
 
typedef TracedCallback< struct RouteChangeRouteChangeTracedCallback
 RouteChangeTracedCallback typedef. More...
 

Private Member Functions

 HwmpProtocol (const HwmpProtocol &)
 type conversion More...
 
virtual void DoInitialize ()
 Initialize() implementation. More...
 
bool ForwardUnicast (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, Ptr< Packet > packet, uint16_t protocolType, RouteReplyCallback routeReply, uint32_t ttl)
 Like RequestRoute, but for unicast packets. More...
 
Mac48Address GetAddress ()
 
HwmpProtocoloperator= (const HwmpProtocol &hwmp)
 assignment operator More...
 
Interaction with HWMP MAC plugin
void ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric)
 Handler for receiving Path Request. More...
 
void ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric)
 Handler for receiving Path Reply. More...
 
void ReceivePerr (std::vector< FailedDestination > destinations, Mac48Address from, uint32_t interface, Mac48Address fromMp)
 Handler for receiving Path Error. More...
 
void SendPrep (Mac48Address src, Mac48Address dst, Mac48Address retransmitter, uint32_t initMetric, uint32_t originatorDsn, uint32_t destinationSN, uint32_t lifetime, uint32_t interface)
 Send Path Reply. More...
 
PathError MakePathError (std::vector< FailedDestination > destinations)
 forms a path error information element when list of destination fails on a given interface More...
 
void ForwardPathError (PathError perr)
 Forwards a received path error. More...
 
void InitiatePathError (PathError perr)
 Passes a self-generated PERR to interface-plugin. More...
 
std::vector< std::pair< uint32_t, Mac48Address > > GetPerrReceivers (std::vector< FailedDestination > failedDest)
 Get PERR receivers. More...
 
std::vector< Mac48AddressGetPreqReceivers (uint32_t interface)
 Get PREQ receivers. More...
 
std::vector< Mac48AddressGetBroadcastReceivers (uint32_t interface)
 Get broadcast receivers. More...
 
bool DropDataFrame (uint32_t seqno, Mac48Address source)
 MAC-plugin asks whether the frame can be dropped. More...
 
Methods related to Queue/Dequeue procedures
bool QueuePacket (QueuedPacket packet)
 
QueuedPacket DequeueFirstPacketByDst (Mac48Address dst)
 
QueuedPacket DequeueFirstPacket ()
 
void ReactivePathResolved (Mac48Address dst)
 
void ProactivePathResolved ()
 
Methods responsible for path discovery retry procedure:
bool ShouldSendPreq (Mac48Address dst)
 checks when the last path discovery procedure was started for a given destination. More...
 
void RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry)
 Generates PREQ retry when retry timeout has expired and route is still unresolved. More...
 
void SendProactivePreq ()
 Proactive Preq routines: More...
 

Private Attributes

Ptr< UniformRandomVariablem_coefficient
 Random variable for random start time. More...
 
Callback< std::vector< Mac48Address >, uint32_t > m_neighboursCallback
 neighbors callback More...
 
std::map< Mac48Address, PreqEventm_preqTimeouts
 PREQ timeouts. More...
 
EventId m_proactivePreqTimer
 proactive PREQ timer More...
 
Time m_randomStart
 Random start in Proactive PREQ propagation. More...
 
TracedCallback< struct RouteChangem_routeChangeTraceSource
 Route change trace source. More...
 
TracedCallback< Timem_routeDiscoveryTimeCallback
 Route discovery time: More...
 
std::vector< QueuedPacketm_rqueue
 Packet Queue. More...
 
Ptr< HwmpRtablem_rtable
 Routing table. More...
 
Sequence number filters

Data sequence number database

std::map< Mac48Address, uint32_t > m_lastDataSeqno
 keeps HWMP seqno (first in pair) and HWMP metric (second in pair) for each address More...
 
std::map< Mac48Address, std::pair< uint32_t, uint32_t > > m_hwmpSeqnoMetricDatabase
 keeps HWMP seqno (first in pair) and HWMP metric (second in pair) for each address More...
 
HWMP-protocol parameters

These are all Attributes

uint16_t m_maxQueueSize
 
uint8_t m_dot11MeshHWMPmaxPREQretries
 
Time m_dot11MeshHWMPnetDiameterTraversalTime
 
Time m_dot11MeshHWMPpreqMinInterval
 
Time m_dot11MeshHWMPperrMinInterval
 
Time m_dot11MeshHWMPactiveRootTimeout
 
Time m_dot11MeshHWMPactivePathTimeout
 
Time m_dot11MeshHWMPpathToRootInterval
 
Time m_dot11MeshHWMPrannInterval
 
bool m_isRoot
 
uint8_t m_maxTtl
 
uint8_t m_unicastPerrThreshold
 
uint8_t m_unicastPreqThreshold
 
uint8_t m_unicastDataThreshold
 
bool m_doFlag
 
bool m_rfFlag
 

Friends

class HwmpProtocolMac
 allow HwmpProtocolMac class friend access More...
 

Methods needed by HwmpMacLugin to access protocol parameters:

Statistics m_stats
 statistics More...
 
HwmpProtocolMacMap m_interfaces
 interfaces More...
 
Mac48Address m_address
 address More...
 
uint32_t m_dataSeqno
 data sequence no More...
 
uint32_t m_hwmpSeqno
 HWMP sequence no. More...
 
uint32_t m_preqId
 PREQ ID. More...
 
bool GetDoFlag ()
 Get do flag function. More...
 
bool GetRfFlag ()
 Get rf flag function. More...
 
Time GetPreqMinInterval ()
 Get PREQ minimum interval function. More...
 
Time GetPerrMinInterval ()
 Get PERR minimum interval function. More...
 
uint8_t GetMaxTtl ()
 Get maximum TTL function. More...
 
uint32_t GetNextPreqId ()
 Get next period function. More...
 
uint32_t GetNextHwmpSeqno ()
 Get next HWMP sequence no function. More...
 
uint32_t GetActivePathLifetime ()
 Get active path lifetime function. More...
 
uint8_t GetUnicastPerrThreshold ()
 Get unicast PERR threshold function. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 
- Protected Attributes inherited from ns3::MeshL2RoutingProtocol
Ptr< MeshPointDevicem_mp
 Host mesh point. More...
 

Detailed Description

Hybrid wireless mesh protocol – a mesh routing protocol defined in IEEE 802.11-2012 standard.


Config Paths

ns3::dot11s::HwmpProtocol is accessible through the following paths with Config::Set and Config::Connect:

Attributes

TraceSources

Size of this type is 384 bytes (on a 64-bit architecture).

Definition at line 62 of file hwmp-protocol.h.

Member Typedef Documentation

◆ FailedDestination

Definition at line 82 of file hwmp-protocol.h.

◆ HwmpProtocolMacMap

typedef std::map<uint32_t, Ptr<HwmpProtocolMac> > ns3::dot11s::HwmpProtocol::HwmpProtocolMacMap
private

HwmpProtocolMacMap typedef.

Definition at line 195 of file hwmp-protocol.h.

◆ RouteChangeTracedCallback

RouteChangeTracedCallback typedef.

Definition at line 314 of file hwmp-protocol.h.

Constructor & Destructor Documentation

◆ HwmpProtocol() [1/2]

ns3::dot11s::HwmpProtocol::HwmpProtocol ( )

Definition at line 179 of file hwmp-protocol.cc.

References m_coefficient, and NS_LOG_FUNCTION.

◆ ~HwmpProtocol()

ns3::dot11s::HwmpProtocol::~HwmpProtocol ( )

Definition at line 206 of file hwmp-protocol.cc.

References NS_LOG_FUNCTION.

◆ HwmpProtocol() [2/2]

ns3::dot11s::HwmpProtocol::HwmpProtocol ( const HwmpProtocol )
private

type conversion

Returns
the HWMP protocol

Member Function Documentation

◆ AssignStreams()

int64_t ns3::dot11s::HwmpProtocol::AssignStreams ( int64_t  stream)

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

Definition at line 1279 of file hwmp-protocol.cc.

References m_coefficient, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

◆ DequeueFirstPacket()

HwmpProtocol::QueuedPacket ns3::dot11s::HwmpProtocol::DequeueFirstPacket ( )
private

◆ DequeueFirstPacketByDst()

HwmpProtocol::QueuedPacket ns3::dot11s::HwmpProtocol::DequeueFirstPacketByDst ( Mac48Address  dst)
private

◆ DoDispose()

void ns3::dot11s::HwmpProtocol::DoDispose ( void  )
virtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 224 of file hwmp-protocol.cc.

References ns3::EventId::Cancel(), m_hwmpSeqnoMetricDatabase, m_interfaces, m_lastDataSeqno, ns3::MeshL2RoutingProtocol::m_mp, m_preqTimeouts, m_proactivePreqTimer, m_rqueue, m_rtable, and NS_LOG_FUNCTION.

◆ DoInitialize()

void ns3::dot11s::HwmpProtocol::DoInitialize ( void  )
privatevirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 212 of file hwmp-protocol.cc.

References ns3::Time::GetSeconds(), ns3::UniformRandomVariable::GetValue(), m_coefficient, m_isRoot, m_proactivePreqTimer, m_randomStart, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::Seconds(), SendProactivePreq(), and ns3::ObjectBase::SetAttribute().

◆ DropDataFrame()

bool ns3::dot11s::HwmpProtocol::DropDataFrame ( uint32_t  seqno,
Mac48Address  source 
)
private

MAC-plugin asks whether the frame can be dropped.

Protocol automatically updates seqno.

Returns
true if frame can be dropped
Parameters
seqnois the sequence number of source
sourceis the source address

Definition at line 815 of file hwmp-protocol.cc.

References GetAddress(), m_lastDataSeqno, and NS_LOG_FUNCTION.

◆ ForwardPathError()

void ns3::dot11s::HwmpProtocol::ForwardPathError ( PathError  perr)
private

Forwards a received path error.

Parameters
perrthe path error

Definition at line 880 of file hwmp-protocol.cc.

References ns3::dot11s::HwmpProtocol::PathError::destinations, m_interfaces, NS_LOG_FUNCTION, and ns3::dot11s::HwmpProtocol::PathError::receivers.

Referenced by ReceivePerr().

◆ ForwardUnicast()

bool ns3::dot11s::HwmpProtocol::ForwardUnicast ( uint32_t  sourceIface,
const Mac48Address  source,
const Mac48Address  destination,
Ptr< Packet packet,
uint16_t  protocolType,
RouteReplyCallback  routeReply,
uint32_t  ttl 
)
private

Like RequestRoute, but for unicast packets.

Parameters
sourceIfacethe source interface
sourcethe source address
destinationthe destination address
packetthe packet to route
protocolTypethe protocol type
routeReplythe route reply callback
ttlthe TTL
Returns
true if forwarded

Definition at line 335 of file hwmp-protocol.cc.

References ns3::Packet::AddPacketTag(), ns3::dot11s::HwmpProtocol::QueuedPacket::dst, GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::MeshL2RoutingProtocol::GetMeshPoint(), GetNextHwmpSeqno(), ns3::Packet::GetSize(), ns3::dot11s::HwmpRtable::GetUnreachableDestinations(), ns3::dot11s::HwmpRtable::LookupResult::ifIndex, ns3::dot11s::HwmpProtocol::QueuedPacket::inInterface, ns3::dot11s::HwmpProtocol::Statistics::initiatedPreq, InitiatePathError(), ns3::dot11s::HwmpRtable::LookupProactive(), ns3::dot11s::HwmpRtable::LookupProactiveExpired(), ns3::dot11s::HwmpRtable::LookupReactive(), ns3::dot11s::HwmpRtable::LookupReactiveExpired(), m_interfaces, m_rtable, m_stats, MakePathError(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::dot11s::HwmpProtocol::QueuedPacket::pkt, ns3::dot11s::HwmpProtocol::QueuedPacket::protocol, QueuePacket(), ns3::dot11s::HwmpProtocol::QueuedPacket::reply, ns3::dot11s::HwmpRtable::LookupResult::retransmitter, ns3::dot11s::HwmpRtable::LookupResult::seqnum, ns3::dot11s::HwmpTag::SetAddress(), ns3::dot11s::HwmpTag::SetTtl(), ShouldSendPreq(), ns3::dot11s::HwmpProtocol::QueuedPacket::src, ns3::dot11s::HwmpProtocol::Statistics::totalDropped, ns3::dot11s::HwmpProtocol::Statistics::totalQueued, ns3::dot11s::HwmpProtocol::Statistics::txBytes, and ns3::dot11s::HwmpProtocol::Statistics::txUnicast.

Referenced by RequestRoute().

◆ GetActivePathLifetime()

uint32_t ns3::dot11s::HwmpProtocol::GetActivePathLifetime ( )
private

Get active path lifetime function.

Returns
the active path lifetime

Definition at line 1199 of file hwmp-protocol.cc.

References ns3::Time::GetMicroSeconds(), and m_dot11MeshHWMPactivePathTimeout.

◆ GetAddress()

Mac48Address ns3::dot11s::HwmpProtocol::GetAddress ( void  )
private
Returns
address of MeshPointDevice

Definition at line 1209 of file hwmp-protocol.cc.

References m_address.

Referenced by DropDataFrame(), ForwardUnicast(), ReceivePerr(), ReceivePrep(), ReceivePreq(), and SendProactivePreq().

◆ GetBroadcastReceivers()

std::vector< Mac48Address > ns3::dot11s::HwmpProtocol::GetBroadcastReceivers ( uint32_t  interface)
private

Get broadcast receivers.

Parameters
interface
Returns
list of addresses where a broadcast should be retransmitted

Definition at line 954 of file hwmp-protocol.cc.

References ns3::Mac48Address::GetBroadcast(), m_neighboursCallback, m_unicastDataThreshold, and NS_LOG_FUNCTION.

Referenced by RequestRoute().

◆ GetDoFlag()

bool ns3::dot11s::HwmpProtocol::GetDoFlag ( )
private

Get do flag function.

Returns
DO flag

Definition at line 1162 of file hwmp-protocol.cc.

References m_doFlag.

◆ GetMaxTtl()

uint8_t ns3::dot11s::HwmpProtocol::GetMaxTtl ( )
private

Get maximum TTL function.

Returns
the maximum TTL

Definition at line 1182 of file hwmp-protocol.cc.

References m_maxTtl.

◆ GetNextHwmpSeqno()

uint32_t ns3::dot11s::HwmpProtocol::GetNextHwmpSeqno ( )
private

Get next HWMP sequence no function.

Returns
the next HWMP sequence number

Definition at line 1193 of file hwmp-protocol.cc.

References m_hwmpSeqno.

Referenced by ForwardUnicast(), ReceivePreq(), RetryPathDiscovery(), and SendProactivePreq().

◆ GetNextPreqId()

uint32_t ns3::dot11s::HwmpProtocol::GetNextPreqId ( )
private

Get next period function.

Returns
the next period

Definition at line 1187 of file hwmp-protocol.cc.

References m_preqId.

Referenced by SendProactivePreq().

◆ GetPerrMinInterval()

Time ns3::dot11s::HwmpProtocol::GetPerrMinInterval ( )
private

Get PERR minimum interval function.

Returns
the PERR minimum interval

Definition at line 1177 of file hwmp-protocol.cc.

References m_dot11MeshHWMPperrMinInterval.

◆ GetPerrReceivers()

std::vector< std::pair< uint32_t, Mac48Address > > ns3::dot11s::HwmpProtocol::GetPerrReceivers ( std::vector< FailedDestination failedDest)
private

◆ GetPreqMinInterval()

Time ns3::dot11s::HwmpProtocol::GetPreqMinInterval ( )
private

Get PREQ minimum interval function.

Returns
the PREQ

Definition at line 1172 of file hwmp-protocol.cc.

References m_dot11MeshHWMPpreqMinInterval.

◆ GetPreqReceivers()

std::vector< Mac48Address > ns3::dot11s::HwmpProtocol::GetPreqReceivers ( uint32_t  interface)
private

Get PREQ receivers.

Parameters
interface
Returns
list of addresses where a PREQ should be sent to

Definition at line 938 of file hwmp-protocol.cc.

References ns3::Mac48Address::GetBroadcast(), m_neighboursCallback, m_unicastPreqThreshold, and NS_LOG_FUNCTION.

◆ GetRfFlag()

bool ns3::dot11s::HwmpProtocol::GetRfFlag ( )
private

Get rf flag function.

Returns
the RF flag

Definition at line 1167 of file hwmp-protocol.cc.

References m_rfFlag.

◆ GetRoutingTable()

Ptr< HwmpRtable > ns3::dot11s::HwmpProtocol::GetRoutingTable ( void  ) const

Get pointer to HWMP routing table.

Returns
pointer to routing table

Definition at line 1287 of file hwmp-protocol.cc.

References m_rtable.

◆ GetTypeId()

TypeId ns3::dot11s::HwmpProtocol::GetTypeId ( void  )
static

◆ GetUnicastPerrThreshold()

uint8_t ns3::dot11s::HwmpProtocol::GetUnicastPerrThreshold ( )
private

Get unicast PERR threshold function.

Returns
the unicast PERR threshold

Definition at line 1204 of file hwmp-protocol.cc.

References m_unicastPerrThreshold.

◆ InitiatePathError()

void ns3::dot11s::HwmpProtocol::InitiatePathError ( PathError  perr)
private

Passes a self-generated PERR to interface-plugin.

Parameters
perrthe path error

Definition at line 863 of file hwmp-protocol.cc.

References ns3::dot11s::HwmpProtocol::PathError::destinations, m_interfaces, NS_LOG_FUNCTION, and ns3::dot11s::HwmpProtocol::PathError::receivers.

Referenced by ForwardUnicast(), and PeerLinkStatus().

◆ Install()

bool ns3::dot11s::HwmpProtocol::Install ( Ptr< MeshPointDevice mp)

Install HWMP on given mesh point.

Returns
true if successful

Installing protocol causes installation of its interface MAC plugins.

Also MP aggregates all installed protocols, HWMP protocol can be accessed via MeshPointDevice::GetObject<dot11s::HwmpProtocol>();

Definition at line 765 of file hwmp-protocol.cc.

References ns3::dot11s::AirtimeLinkMetricCalculator::CalculateMetric(), ns3::Mac48Address::ConvertFrom(), first::interfaces, m_address, m_interfaces, ns3::MeshL2RoutingProtocol::m_mp, third::mac, ns3::MakeCallback(), and NS_LOG_FUNCTION.

◆ MakePathError()

HwmpProtocol::PathError ns3::dot11s::HwmpProtocol::MakePathError ( std::vector< FailedDestination destinations)
private

forms a path error information element when list of destination fails on a given interface

Attention
removes all entries from routing table!
Parameters
destinationsvector of failed destinations
Returns
PathError

Definition at line 838 of file hwmp-protocol.cc.

References ns3::dot11s::HwmpRtable::DeleteReactivePath(), ns3::dot11s::RouteChange::destination, ns3::dot11s::HwmpProtocol::PathError::destinations, GetPerrReceivers(), ns3::dot11s::HwmpProtocol::Statistics::initiatedPerr, m_routeChangeTraceSource, m_rtable, m_stats, NS_LOG_FUNCTION, ns3::dot11s::HwmpProtocol::PathError::receivers, ns3::dot11s::RouteChange::seqnum, and ns3::dot11s::RouteChange::type.

Referenced by ForwardUnicast(), PeerLinkStatus(), and ReceivePerr().

◆ operator=()

HwmpProtocol& ns3::dot11s::HwmpProtocol::operator= ( const HwmpProtocol hwmp)
private

assignment operator

Parameters
hwmpthe HWMP protocol to assign
Returns
the assigned value

◆ PeerLinkStatus()

void ns3::dot11s::HwmpProtocol::PeerLinkStatus ( Mac48Address  meshPontAddress,
Mac48Address  peerAddress,
uint32_t  interface,
bool  status 
)

Peer link status function.

Parameters
meshPontAddressThe MAC address of the mesh point
peerAddressThe MAC address of the peer
interfaceThe interface number
statusThe status of the peer link

Definition at line 798 of file hwmp-protocol.cc.

References ns3::dot11s::HwmpRtable::GetUnreachableDestinations(), InitiatePathError(), m_rtable, MakePathError(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ns3::Dot11sStack::InstallStack().

◆ ProactivePathResolved()

void ns3::dot11s::HwmpProtocol::ProactivePathResolved ( )
private

◆ QueuePacket()

bool ns3::dot11s::HwmpProtocol::QueuePacket ( QueuedPacket  packet)
private

Definition at line 971 of file hwmp-protocol.cc.

References m_maxQueueSize, m_rqueue, and NS_LOG_FUNCTION.

Referenced by ForwardUnicast().

◆ ReactivePathResolved()

void ns3::dot11s::HwmpProtocol::ReactivePathResolved ( Mac48Address  dst)
private

◆ ReceivePerr()

void ns3::dot11s::HwmpProtocol::ReceivePerr ( std::vector< FailedDestination destinations,
Mac48Address  from,
uint32_t  interface,
Mac48Address  fromMp 
)
private

Handler for receiving Path Error.

Parameters
destinationsthe list of failed destinations
fromthe from address
interfacethe interface
fromMpthe from MP address

Definition at line 714 of file hwmp-protocol.cc.

References ForwardPathError(), GetAddress(), ns3::dot11s::HwmpRtable::LookupResult::ifIndex, ns3::dot11s::HwmpRtable::LookupReactiveExpired(), m_rtable, MakePathError(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::dot11s::HwmpRtable::LookupResult::retransmitter, and ns3::dot11s::HwmpRtable::LookupResult::seqnum.

◆ ReceivePrep()

void ns3::dot11s::HwmpProtocol::ReceivePrep ( IePrep  prep,
Mac48Address  from,
uint32_t  interface,
Mac48Address  fromMp,
uint32_t  metric 
)
private

◆ ReceivePreq()

void ns3::dot11s::HwmpProtocol::ReceivePreq ( IePreq  preq,
Mac48Address  from,
uint32_t  interface,
Mac48Address  fromMp,
uint32_t  metric 
)
private

Handler for receiving Path Request.

Parameters
preqthe IE preq
fromthe from address
interfacethe interface
fromMpthe 'from MP' address
metricthe metric

Definition at line 420 of file hwmp-protocol.cc.

References ns3::dot11s::HwmpRtable::AddPrecursor(), ns3::dot11s::HwmpRtable::AddProactivePath(), ns3::dot11s::HwmpRtable::AddReactivePath(), ns3::dot11s::IePreq::DelDestinationAddressElement(), ns3::dot11s::RouteChange::destination, GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::dot11s::IePreq::GetDestCount(), ns3::dot11s::IePreq::GetDestinationList(), ns3::dot11s::IePreq::GetLifetime(), ns3::dot11s::IePreq::GetMetric(), ns3::Time::GetMicroSeconds(), GetNextHwmpSeqno(), ns3::dot11s::IePreq::GetOriginatorAddress(), ns3::dot11s::IePreq::GetOriginatorSeqNumber(), ns3::dot11s::IePreq::IncrementMetric(), ns3::dot11s::RouteChange::interface, ns3::dot11s::IePreq::IsNeedNotPrep(), ns3::dot11s::HwmpRtable::LookupResult::lifetime, ns3::dot11s::RouteChange::lifetime, ns3::dot11s::HwmpRtable::LookupProactive(), ns3::dot11s::HwmpRtable::LookupReactive(), m_hwmpSeqnoMetricDatabase, m_interfaces, m_routeChangeTraceSource, m_rtable, ns3::dot11s::HwmpRtable::LookupResult::metric, ns3::dot11s::RouteChange::metric, ns3::MicroSeconds(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ProactivePathResolved(), ReactivePathResolved(), ns3::dot11s::HwmpRtable::LookupResult::retransmitter, ns3::dot11s::RouteChange::retransmitter, SendPrep(), ns3::dot11s::HwmpRtable::LookupResult::seqnum, ns3::dot11s::RouteChange::seqnum, and ns3::dot11s::RouteChange::type.

◆ RemoveRoutingStuff()

bool ns3::dot11s::HwmpProtocol::RemoveRoutingStuff ( uint32_t  fromIface,
const Mac48Address  source,
const Mac48Address  destination,
Ptr< Packet packet,
uint16_t &  protocolType 
)
virtual

Clean HWMP packet tag from packet; only the packet parameter is used.

Parameters
fromIfacethe from interface
sourcethe source address
destinationthe destination address
packetthe packet to route
protocolTypethe protocol type
Returns
true if successful

Implements ns3::MeshL2RoutingProtocol.

Definition at line 324 of file hwmp-protocol.cc.

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

◆ Report()

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

◆ RequestRoute()

bool ns3::dot11s::HwmpProtocol::RequestRoute ( uint32_t  sourceIface,
const Mac48Address  source,
const Mac48Address  destination,
Ptr< const Packet packet,
uint16_t  protocolType,
MeshL2RoutingProtocol::RouteReplyCallback  routeReply 
)
virtual

◆ ResetStats()

void ns3::dot11s::HwmpProtocol::ResetStats ( )

Reset Statistics:

Definition at line 1268 of file hwmp-protocol.cc.

References m_interfaces, m_stats, and NS_LOG_FUNCTION.

◆ RetryPathDiscovery()

void ns3::dot11s::HwmpProtocol::RetryPathDiscovery ( Mac48Address  dst,
uint8_t  numOfRetry 
)
private

◆ SendPrep()

void ns3::dot11s::HwmpProtocol::SendPrep ( Mac48Address  src,
Mac48Address  dst,
Mac48Address  retransmitter,
uint32_t  initMetric,
uint32_t  originatorDsn,
uint32_t  destinationSN,
uint32_t  lifetime,
uint32_t  interface 
)
private

Send Path Reply.

Parameters
srcthe source address
dstthe destination address
retransmitterthe retransmitter address
initMetricthe initial metric
originatorDsnthe originator DSN
destinationSNthe destination DSN
lifetimethe lifetime
interfacethe interface

Definition at line 740 of file hwmp-protocol.cc.

References ns3::dot11s::HwmpProtocol::Statistics::initiatedPrep, m_interfaces, m_maxTtl, m_stats, NS_ASSERT, ns3::dot11s::IePrep::SetDestinationAddress(), ns3::dot11s::IePrep::SetDestinationSeqNumber(), ns3::dot11s::IePrep::SetHopcount(), ns3::dot11s::IePrep::SetLifetime(), ns3::dot11s::IePrep::SetMetric(), ns3::dot11s::IePrep::SetOriginatorAddress(), ns3::dot11s::IePrep::SetOriginatorSeqNumber(), and ns3::dot11s::IePrep::SetTtl().

Referenced by ReceivePreq().

◆ SendProactivePreq()

void ns3::dot11s::HwmpProtocol::SendProactivePreq ( )
private

◆ SetNeighboursCallback()

void ns3::dot11s::HwmpProtocol::SetNeighboursCallback ( Callback< std::vector< Mac48Address >, uint32_t >  cb)

This callback is used to obtain active neighbours on a given interface.

Parameters
cbis a callback, which returns a list of addresses on given interface (uint32_t)

Definition at line 810 of file hwmp-protocol.cc.

References m_neighboursCallback.

◆ SetRoot()

void ns3::dot11s::HwmpProtocol::SetRoot ( )

Definition at line 1128 of file hwmp-protocol.cc.

References m_address, m_isRoot, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

◆ ShouldSendPreq()

bool ns3::dot11s::HwmpProtocol::ShouldSendPreq ( Mac48Address  dst)
private

checks when the last path discovery procedure was started for a given destination.

Returns
true if should send PREQ
Parameters
dstis the destination address

If the retry counter has not achieved the maximum level - preq should not be sent

Definition at line 1069 of file hwmp-protocol.cc.

References m_dot11MeshHWMPnetDiameterTraversalTime, m_preqTimeouts, ns3::Simulator::Now(), NS_LOG_FUNCTION, RetryPathDiscovery(), and ns3::Simulator::Schedule().

Referenced by ForwardUnicast().

◆ UnsetRoot()

void ns3::dot11s::HwmpProtocol::UnsetRoot ( )

Definition at line 1135 of file hwmp-protocol.cc.

References ns3::EventId::Cancel(), m_proactivePreqTimer, and NS_LOG_FUNCTION.

Friends And Related Function Documentation

◆ HwmpProtocolMac

friend class HwmpProtocolMac
friend

allow HwmpProtocolMac class friend access

Definition at line 158 of file hwmp-protocol.h.

Member Data Documentation

◆ m_address

Mac48Address ns3::dot11s::HwmpProtocol::m_address
private

address

Definition at line 420 of file hwmp-protocol.h.

Referenced by GetAddress(), Install(), Report(), and SetRoot().

◆ m_coefficient

Ptr<UniformRandomVariable> ns3::dot11s::HwmpProtocol::m_coefficient
private

Random variable for random start time.

coefficient

Definition at line 470 of file hwmp-protocol.h.

Referenced by AssignStreams(), DoInitialize(), and HwmpProtocol().

◆ m_dataSeqno

uint32_t ns3::dot11s::HwmpProtocol::m_dataSeqno
private

data sequence no

Definition at line 421 of file hwmp-protocol.h.

Referenced by RequestRoute().

◆ m_doFlag

bool ns3::dot11s::HwmpProtocol::m_doFlag
private

Definition at line 465 of file hwmp-protocol.h.

Referenced by GetDoFlag(), GetTypeId(), and Report().

◆ m_dot11MeshHWMPactivePathTimeout

Time ns3::dot11s::HwmpProtocol::m_dot11MeshHWMPactivePathTimeout
private

Definition at line 457 of file hwmp-protocol.h.

Referenced by GetActivePathLifetime(), GetTypeId(), and Report().

◆ m_dot11MeshHWMPactiveRootTimeout

Time ns3::dot11s::HwmpProtocol::m_dot11MeshHWMPactiveRootTimeout
private

Definition at line 456 of file hwmp-protocol.h.

Referenced by GetTypeId(), Report(), and SendProactivePreq().

◆ m_dot11MeshHWMPmaxPREQretries

uint8_t ns3::dot11s::HwmpProtocol::m_dot11MeshHWMPmaxPREQretries
private

Definition at line 452 of file hwmp-protocol.h.

Referenced by GetTypeId(), Report(), and RetryPathDiscovery().

◆ m_dot11MeshHWMPnetDiameterTraversalTime

Time ns3::dot11s::HwmpProtocol::m_dot11MeshHWMPnetDiameterTraversalTime
private

Definition at line 453 of file hwmp-protocol.h.

Referenced by GetTypeId(), Report(), RetryPathDiscovery(), and ShouldSendPreq().

◆ m_dot11MeshHWMPpathToRootInterval

Time ns3::dot11s::HwmpProtocol::m_dot11MeshHWMPpathToRootInterval
private

Definition at line 458 of file hwmp-protocol.h.

Referenced by GetTypeId(), Report(), and SendProactivePreq().

◆ m_dot11MeshHWMPperrMinInterval

Time ns3::dot11s::HwmpProtocol::m_dot11MeshHWMPperrMinInterval
private

Definition at line 455 of file hwmp-protocol.h.

Referenced by GetPerrMinInterval(), GetTypeId(), and Report().

◆ m_dot11MeshHWMPpreqMinInterval

Time ns3::dot11s::HwmpProtocol::m_dot11MeshHWMPpreqMinInterval
private

Definition at line 454 of file hwmp-protocol.h.

Referenced by GetPreqMinInterval(), GetTypeId(), and Report().

◆ m_dot11MeshHWMPrannInterval

Time ns3::dot11s::HwmpProtocol::m_dot11MeshHWMPrannInterval
private

Definition at line 459 of file hwmp-protocol.h.

Referenced by GetTypeId(), and Report().

◆ m_hwmpSeqno

uint32_t ns3::dot11s::HwmpProtocol::m_hwmpSeqno
private

HWMP sequence no.

Definition at line 422 of file hwmp-protocol.h.

Referenced by GetNextHwmpSeqno().

◆ m_hwmpSeqnoMetricDatabase

std::map<Mac48Address, std::pair<uint32_t, uint32_t> > ns3::dot11s::HwmpProtocol::m_hwmpSeqnoMetricDatabase
private

keeps HWMP seqno (first in pair) and HWMP metric (second in pair) for each address

Definition at line 429 of file hwmp-protocol.h.

Referenced by DoDispose(), ReceivePrep(), and ReceivePreq().

◆ m_interfaces

HwmpProtocolMacMap ns3::dot11s::HwmpProtocol::m_interfaces
private

◆ m_isRoot

bool ns3::dot11s::HwmpProtocol::m_isRoot
private

Definition at line 460 of file hwmp-protocol.h.

Referenced by DoInitialize(), Report(), and SetRoot().

◆ m_lastDataSeqno

std::map<Mac48Address, uint32_t> ns3::dot11s::HwmpProtocol::m_lastDataSeqno
private

keeps HWMP seqno (first in pair) and HWMP metric (second in pair) for each address

Definition at line 427 of file hwmp-protocol.h.

Referenced by DoDispose(), and DropDataFrame().

◆ m_maxQueueSize

uint16_t ns3::dot11s::HwmpProtocol::m_maxQueueSize
private

Definition at line 451 of file hwmp-protocol.h.

Referenced by GetTypeId(), QueuePacket(), and Report().

◆ m_maxTtl

uint8_t ns3::dot11s::HwmpProtocol::m_maxTtl
private

Definition at line 461 of file hwmp-protocol.h.

Referenced by GetMaxTtl(), GetTypeId(), Report(), RequestRoute(), SendPrep(), and SendProactivePreq().

◆ m_neighboursCallback

Callback<std::vector<Mac48Address>, uint32_t> ns3::dot11s::HwmpProtocol::m_neighboursCallback
private

neighbors callback

Definition at line 471 of file hwmp-protocol.h.

Referenced by GetBroadcastReceivers(), GetPreqReceivers(), and SetNeighboursCallback().

◆ m_preqId

uint32_t ns3::dot11s::HwmpProtocol::m_preqId
private

PREQ ID.

Definition at line 423 of file hwmp-protocol.h.

Referenced by GetNextPreqId().

◆ m_preqTimeouts

std::map<Mac48Address, PreqEvent> ns3::dot11s::HwmpProtocol::m_preqTimeouts
private

PREQ timeouts.

Definition at line 441 of file hwmp-protocol.h.

Referenced by DoDispose(), ReactivePathResolved(), RetryPathDiscovery(), and ShouldSendPreq().

◆ m_proactivePreqTimer

EventId ns3::dot11s::HwmpProtocol::m_proactivePreqTimer
private

proactive PREQ timer

Definition at line 442 of file hwmp-protocol.h.

Referenced by DoDispose(), DoInitialize(), SendProactivePreq(), and UnsetRoot().

◆ m_randomStart

Time ns3::dot11s::HwmpProtocol::m_randomStart
private

Random start in Proactive PREQ propagation.

Definition at line 444 of file hwmp-protocol.h.

Referenced by DoInitialize(), and GetTypeId().

◆ m_rfFlag

bool ns3::dot11s::HwmpProtocol::m_rfFlag
private

Definition at line 466 of file hwmp-protocol.h.

Referenced by GetRfFlag(), GetTypeId(), and Report().

◆ m_routeChangeTraceSource

TracedCallback<struct RouteChange> ns3::dot11s::HwmpProtocol::m_routeChangeTraceSource
private

Route change trace source.

Definition at line 316 of file hwmp-protocol.h.

Referenced by GetPerrReceivers(), GetTypeId(), MakePathError(), ReceivePrep(), and ReceivePreq().

◆ m_routeDiscoveryTimeCallback

TracedCallback<Time> ns3::dot11s::HwmpProtocol::m_routeDiscoveryTimeCallback
private

Route discovery time:

Definition at line 312 of file hwmp-protocol.h.

Referenced by GetTypeId(), ReactivePathResolved(), and RetryPathDiscovery().

◆ m_rqueue

std::vector<QueuedPacket> ns3::dot11s::HwmpProtocol::m_rqueue
private

◆ m_rtable

Ptr<HwmpRtable> ns3::dot11s::HwmpProtocol::m_rtable
private

◆ m_stats

Statistics ns3::dot11s::HwmpProtocol::m_stats
private

◆ m_unicastDataThreshold

uint8_t ns3::dot11s::HwmpProtocol::m_unicastDataThreshold
private

Definition at line 464 of file hwmp-protocol.h.

Referenced by GetBroadcastReceivers(), GetTypeId(), and Report().

◆ m_unicastPerrThreshold

uint8_t ns3::dot11s::HwmpProtocol::m_unicastPerrThreshold
private

Definition at line 462 of file hwmp-protocol.h.

Referenced by GetTypeId(), GetUnicastPerrThreshold(), and Report().

◆ m_unicastPreqThreshold

uint8_t ns3::dot11s::HwmpProtocol::m_unicastPreqThreshold
private

Definition at line 463 of file hwmp-protocol.h.

Referenced by GetPreqReceivers(), GetTypeId(), and Report().


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