Hybrid wireless mesh protocol – a mesh routing protocol defined in IEEE 802.11-2012 standard. More...
#include "hwmp-protocol.h"
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 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< HwmpRtable > | GetRoutingTable (void) const |
Get pointer to HWMP routing table. More... | |
bool | Install (Ptr< MeshPointDevice > mp) |
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... | |
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 | SetNeighboursCallback (Callback< std::vector< Mac48Address >, uint32_t > cb) |
This callback is used to obtain active neighbours on a given interface. More... | |
Proactive PREQ mechanism: | |
Set the current node as root | |
void | SetRoot () |
Unset the current node as root. More... | |
void | UnsetRoot () |
Unset the current node as root. More... | |
void | Report (std::ostream &os) const |
Statistics: More... | |
void | ResetStats () |
Reset Statistics: More... | |
Public Member Functions inherited from ns3::MeshL2RoutingProtocol | |
virtual | ~MeshL2RoutingProtocol () |
virtual D-tor for subclasses More... | |
Ptr< MeshPointDevice > | GetMeshPoint () 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<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. 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[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[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... | |
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 RouteChange > | RouteChangeTracedCallback |
RouteChangeTracedCallback typedef. More... | |
Private Member Functions | |
HwmpProtocol (const HwmpProtocol &hwmp) | |
Copy constructor - defined but not implemented (on purpose) 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 () |
HwmpProtocol & | operator= (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< Mac48Address > | GetPreqReceivers (uint32_t interface) |
Get PREQ receivers. More... | |
std::vector< Mac48Address > | GetBroadcastReceivers (uint32_t interface) |
Get broadcast receivers. More... | |
bool | DropDataFrame (uint32_t seqno, Mac48Address source) |
MAC-plugin asks whether the frame can be dropped. More... | |
bool | QueuePacket (QueuedPacket packet) |
Queue a packet. More... | |
QueuedPacket | DequeueFirstPacketByDst (Mac48Address dst) |
Dequeue the first packet for a given destination. More... | |
QueuedPacket | DequeueFirstPacket () |
Dequeue the first packet in the queue. More... | |
void | ReactivePathResolved (Mac48Address dst) |
Signal the protocol that the reactive path toward a destination is now available. More... | |
void | ProactivePathResolved () |
Signal the protocol that the proactive path is now available. More... | |
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... | |
Methods needed by HwmpMacLugin to access protocol parameters: | |
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... | |
Private Attributes | |
Mac48Address | m_address |
address More... | |
Ptr< UniformRandomVariable > | m_coefficient |
Random variable for random start time. More... | |
uint32_t | m_dataSeqno |
data sequence no More... | |
uint32_t | m_hwmpSeqno |
HWMP sequence no. More... | |
HwmpProtocolMacMap | m_interfaces |
interfaces More... | |
Callback< std::vector< Mac48Address >, uint32_t > | m_neighboursCallback |
neighbors callback More... | |
uint32_t | m_preqId |
PREQ ID. More... | |
std::map< Mac48Address, PreqEvent > | m_preqTimeouts |
PREQ timeouts. More... | |
EventId | m_proactivePreqTimer |
proactive PREQ timer More... | |
Time | m_randomStart |
Random start in Proactive PREQ propagation. More... | |
TracedCallback< struct RouteChange > | m_routeChangeTraceSource |
Route change trace source. More... | |
TracedCallback< Time > | m_routeDiscoveryTimeCallback |
Route discovery time: More... | |
std::vector< QueuedPacket > | m_rqueue |
Packet Queue. More... | |
Ptr< HwmpRtable > | m_rtable |
Routing table. More... | |
Statistics | m_stats |
statistics 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 |
Maximum number of packets we can store when resolving route. More... | |
uint8_t | m_dot11MeshHWMPmaxPREQretries |
Maximum number of retries before we suppose the destination to be unreachable. More... | |
Time | m_dot11MeshHWMPnetDiameterTraversalTime |
Time we suppose the packet to go from one edge of the network to another. More... | |
Time | m_dot11MeshHWMPpreqMinInterval |
Minimal interval between to successive PREQs. More... | |
Time | m_dot11MeshHWMPperrMinInterval |
Minimal interval between to successive PREQs. More... | |
Time | m_dot11MeshHWMPactiveRootTimeout |
Lifetime of proactive routing information. More... | |
Time | m_dot11MeshHWMPactivePathTimeout |
Lifetime of reactive routing information. More... | |
Time | m_dot11MeshHWMPpathToRootInterval |
Interval between two successive proactive PREQs. More... | |
Time | m_dot11MeshHWMPrannInterval |
Lifetime of proactive routing information. More... | |
bool | m_isRoot |
True if the node is a root. More... | |
uint8_t | m_maxTtl |
Initial value of Time To Live field. More... | |
uint8_t | m_unicastPerrThreshold |
Maximum number of PERR receivers, when we send a PERR as a chain of unicasts. More... | |
uint8_t | m_unicastPreqThreshold |
Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts. More... | |
uint8_t | m_unicastDataThreshold |
Maximum number of broadcast receivers, when we send a broadcast as a chain of unicasts. More... | |
bool | m_doFlag |
Destination only HWMP flag. More... | |
bool | m_rfFlag |
Reply and forward flag. More... | |
Friends | |
class | HwmpProtocolMac |
allow HwmpProtocolMac class friend access More... | |
Additional Inherited Members | |
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... | |
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< MeshPointDevice > | m_mp |
Host mesh point. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Hybrid wireless mesh protocol – a mesh routing protocol defined in IEEE 802.11-2012 standard.
ns3::dot11s::HwmpProtocol is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 480 bytes (on a 64-bit architecture).
Definition at line 63 of file hwmp-protocol.h.
|
private |
HwmpProtocolMacMap typedef.
Definition at line 207 of file hwmp-protocol.h.
|
private |
RouteChangeTracedCallback typedef.
Definition at line 327 of file hwmp-protocol.h.
ns3::dot11s::HwmpProtocol::HwmpProtocol | ( | ) |
Definition at line 182 of file hwmp-protocol.cc.
References m_coefficient, and NS_LOG_FUNCTION.
ns3::dot11s::HwmpProtocol::~HwmpProtocol | ( | ) |
Definition at line 209 of file hwmp-protocol.cc.
References NS_LOG_FUNCTION.
|
private |
Copy constructor - defined but not implemented (on purpose)
hwmp | the HWMP protocol |
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.
stream | first stream index to use |
Definition at line 1293 of file hwmp-protocol.cc.
References m_coefficient, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
private |
Dequeue the first packet in the queue.
Definition at line 1015 of file hwmp-protocol.cc.
References m_rqueue, NS_LOG_FUNCTION, and ns3::dot11s::HwmpProtocol::QueuedPacket::pkt.
Referenced by ProactivePathResolved().
|
private |
Dequeue the first packet for a given destination.
dst | the destination |
Definition at line 997 of file hwmp-protocol.cc.
References m_rqueue, NS_LOG_FUNCTION, and ns3::dot11s::HwmpProtocol::QueuedPacket::pkt.
Referenced by ReactivePathResolved(), and RetryPathDiscovery().
|
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 227 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.
|
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 215 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().
|
private |
MAC-plugin asks whether the frame can be dropped.
Protocol automatically updates seqno.
seqno | is the sequence number of source |
source | is the source address |
Definition at line 824 of file hwmp-protocol.cc.
References GetAddress(), m_lastDataSeqno, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
private |
Forwards a received path error.
perr | the path error |
Definition at line 891 of file hwmp-protocol.cc.
References ns3::Time::As(), ns3::dot11s::HwmpProtocol::PathError::destinations, ns3::dot11s::HwmpProtocolMac::ForwardPerr(), ns3::MeshL2RoutingProtocol::GetMeshPoint(), m_interfaces, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::dot11s::HwmpProtocol::PathError::receivers, ns3::Simulator::Schedule(), and ns3::Time::US.
Referenced by ReceivePerr().
|
private |
Like RequestRoute, but for unicast packets.
sourceIface | the source interface |
source | the source address |
destination | the destination address |
packet | the packet to route |
protocolType | the protocol type |
routeReply | the route reply callback |
ttl | the TTL |
Definition at line 340 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::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, test-ns3::result, 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().
|
private |
Get active path lifetime function.
Definition at line 1213 of file hwmp-protocol.cc.
References ns3::Time::GetMicroSeconds(), and m_dot11MeshHWMPactivePathTimeout.
|
private |
Definition at line 1223 of file hwmp-protocol.cc.
References m_address.
Referenced by DropDataFrame(), ForwardUnicast(), ReceivePerr(), ReceivePrep(), ReceivePreq(), and SendProactivePreq().
|
private |
Get broadcast receivers.
interface |
Definition at line 968 of file hwmp-protocol.cc.
References ns3::Mac48Address::GetBroadcast(), m_neighboursCallback, m_unicastDataThreshold, and NS_LOG_FUNCTION.
Referenced by RequestRoute().
|
private |
Get do flag function.
Definition at line 1176 of file hwmp-protocol.cc.
References m_doFlag.
|
private |
Get maximum TTL function.
Definition at line 1196 of file hwmp-protocol.cc.
References m_maxTtl.
|
private |
Get next HWMP sequence no function.
Definition at line 1207 of file hwmp-protocol.cc.
References m_hwmpSeqno.
Referenced by ForwardUnicast(), ReceivePreq(), RetryPathDiscovery(), and SendProactivePreq().
|
private |
Get next period function.
Definition at line 1201 of file hwmp-protocol.cc.
References m_preqId.
Referenced by SendProactivePreq().
|
private |
Get PERR minimum interval function.
Definition at line 1191 of file hwmp-protocol.cc.
References m_dot11MeshHWMPperrMinInterval.
|
private |
Get PERR receivers.
failedDest |
Definition at line 912 of file hwmp-protocol.cc.
References ns3::dot11s::HwmpRtable::DeleteProactivePath(), ns3::dot11s::HwmpRtable::DeleteReactivePath(), ns3::dot11s::RouteChange::destination, ns3::dot11s::HwmpRtable::GetPrecursors(), m_routeChangeTraceSource, m_rtable, NS_LOG_FUNCTION, ns3::dot11s::RouteChange::seqnum, and ns3::dot11s::RouteChange::type.
Referenced by MakePathError().
|
private |
Get PREQ minimum interval function.
Definition at line 1186 of file hwmp-protocol.cc.
References m_dot11MeshHWMPpreqMinInterval.
|
private |
Get PREQ receivers.
interface |
Definition at line 952 of file hwmp-protocol.cc.
References ns3::Mac48Address::GetBroadcast(), m_neighboursCallback, m_unicastPreqThreshold, and NS_LOG_FUNCTION.
|
private |
Get rf flag function.
Definition at line 1181 of file hwmp-protocol.cc.
References m_rfFlag.
Ptr< HwmpRtable > ns3::dot11s::HwmpProtocol::GetRoutingTable | ( | void | ) | const |
Get pointer to HWMP routing table.
Definition at line 1301 of file hwmp-protocol.cc.
References m_rtable.
|
static |
Get the type ID.
Definition at line 50 of file hwmp-protocol.cc.
References m_doFlag, m_dot11MeshHWMPactivePathTimeout, m_dot11MeshHWMPactiveRootTimeout, m_dot11MeshHWMPmaxPREQretries, m_dot11MeshHWMPnetDiameterTraversalTime, m_dot11MeshHWMPpathToRootInterval, m_dot11MeshHWMPperrMinInterval, m_dot11MeshHWMPpreqMinInterval, m_dot11MeshHWMPrannInterval, m_maxQueueSize, m_maxTtl, m_randomStart, m_rfFlag, m_routeChangeTraceSource, m_routeDiscoveryTimeCallback, m_unicastDataThreshold, m_unicastPerrThreshold, m_unicastPreqThreshold, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MicroSeconds(), ns3::Seconds(), and ns3::TypeId::SetParent().
|
private |
Get unicast PERR threshold function.
Definition at line 1218 of file hwmp-protocol.cc.
References m_unicastPerrThreshold.
|
private |
Passes a self-generated PERR to interface-plugin.
perr | the path error |
Definition at line 874 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().
bool ns3::dot11s::HwmpProtocol::Install | ( | Ptr< MeshPointDevice > | mp | ) |
Install HWMP on given mesh point.
mp | the MeshPointDevice |
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 774 of file hwmp-protocol.cc.
References ns3::dot11s::AirtimeLinkMetricCalculator::CalculateMetric(), ns3::Mac48Address::ConvertFrom(), ns3::WifiNetDevice::GetIfIndex(), ns3::WifiNetDevice::GetMac(), ns3::Object::GetObject(), first::interfaces, m_address, m_interfaces, ns3::MeshL2RoutingProtocol::m_mp, third::mac, ns3::MakeCallback(), and NS_LOG_FUNCTION.
|
private |
forms a path error information element when list of destination fails on a given interface
destinations | vector of failed destinations |
Definition at line 849 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().
|
private |
assignment operator
hwmp | the HWMP protocol to assign |
void ns3::dot11s::HwmpProtocol::PeerLinkStatus | ( | Mac48Address | meshPontAddress, |
Mac48Address | peerAddress, | ||
uint32_t | interface, | ||
bool | status | ||
) |
Peer link status function.
meshPontAddress | The MAC address of the mesh point |
peerAddress | The MAC address of the peer |
interface | The interface number |
status | The status of the peer link |
Definition at line 807 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().
|
private |
Signal the protocol that the proactive path is now available.
Definition at line 1057 of file hwmp-protocol.cc.
References ns3::Packet::AddPacketTag(), DequeueFirstPacket(), ns3::dot11s::HwmpProtocol::QueuedPacket::dst, ns3::Mac48Address::GetBroadcast(), ns3::Packet::GetSize(), ns3::dot11s::HwmpRtable::LookupProactive(), m_rtable, m_stats, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::dot11s::HwmpProtocol::QueuedPacket::pkt, ns3::dot11s::HwmpProtocol::QueuedPacket::protocol, ns3::Packet::RemovePacketTag(), ns3::dot11s::HwmpProtocol::QueuedPacket::reply, test-ns3::result, ns3::dot11s::HwmpTag::SetAddress(), ns3::dot11s::HwmpProtocol::QueuedPacket::src, ns3::dot11s::HwmpProtocol::Statistics::txBytes, and ns3::dot11s::HwmpProtocol::Statistics::txUnicast.
Referenced by ReceivePreq().
|
private |
Queue a packet.
packet | the packet to be queued |
Definition at line 985 of file hwmp-protocol.cc.
References m_maxQueueSize, m_rqueue, and NS_LOG_FUNCTION.
Referenced by ForwardUnicast().
|
private |
Signal the protocol that the reactive path toward a destination is now available.
dst | the destination |
Definition at line 1029 of file hwmp-protocol.cc.
References ns3::Packet::AddPacketTag(), DequeueFirstPacketByDst(), ns3::dot11s::HwmpProtocol::QueuedPacket::dst, ns3::Mac48Address::GetBroadcast(), ns3::Packet::GetSize(), ns3::dot11s::HwmpRtable::LookupReactive(), m_preqTimeouts, m_routeDiscoveryTimeCallback, m_rtable, m_stats, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, ns3::dot11s::HwmpProtocol::QueuedPacket::pkt, ns3::dot11s::HwmpProtocol::QueuedPacket::protocol, ns3::Packet::RemovePacketTag(), ns3::dot11s::HwmpProtocol::QueuedPacket::reply, test-ns3::result, ns3::dot11s::HwmpTag::SetAddress(), ns3::dot11s::HwmpProtocol::QueuedPacket::src, ns3::dot11s::HwmpProtocol::Statistics::txBytes, and ns3::dot11s::HwmpProtocol::Statistics::txUnicast.
Referenced by ReceivePrep(), and ReceivePreq().
|
private |
Handler for receiving Path Error.
destinations | the list of failed destinations |
from | the from address |
interface | the interface |
fromMp | the from MP address |
Definition at line 723 of file hwmp-protocol.cc.
References ForwardPathError(), GetAddress(), ns3::dot11s::HwmpRtable::LookupReactiveExpired(), m_rtable, MakePathError(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and test-ns3::result.
|
private |
Handler for receiving Path Reply.
prep | the IE prep |
from | the from address |
interface | the interface |
fromMp | the 'from MP' address |
metric | the metric |
Definition at line 621 of file hwmp-protocol.cc.
References ns3::dot11s::HwmpRtable::AddPrecursor(), ns3::dot11s::HwmpRtable::AddReactivePath(), ns3::Time::As(), ns3::dot11s::RouteChange::destination, GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::dot11s::IePrep::GetDestinationAddress(), ns3::dot11s::IePrep::GetDestinationSeqNumber(), ns3::dot11s::IePrep::GetLifetime(), ns3::MeshL2RoutingProtocol::GetMeshPoint(), ns3::dot11s::IePrep::GetMetric(), ns3::dot11s::IePrep::GetOriginatorAddress(), ns3::dot11s::IePrep::IncrementMetric(), ns3::dot11s::RouteChange::interface, ns3::dot11s::RouteChange::lifetime, ns3::dot11s::HwmpRtable::LookupReactive(), m_hwmpSeqnoMetricDatabase, m_interfaces, m_routeChangeTraceSource, m_rtable, ns3::dot11s::RouteChange::metric, ns3::MicroSeconds(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ReactivePathResolved(), test-ns3::result, ns3::dot11s::RouteChange::retransmitter, ns3::Simulator::Schedule(), ns3::dot11s::HwmpProtocolMac::SendPrep(), ns3::dot11s::RouteChange::seqnum, ns3::dot11s::RouteChange::type, and ns3::Time::US.
|
private |
Handler for receiving Path Request.
preq | the IE preq |
from | the from address |
interface | the interface |
fromMp | the 'from MP' address |
metric | the metric |
Definition at line 425 of file hwmp-protocol.cc.
References ns3::dot11s::HwmpRtable::AddPrecursor(), ns3::dot11s::HwmpRtable::AddProactivePath(), ns3::dot11s::HwmpRtable::AddReactivePath(), ns3::Time::As(), 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::MeshL2RoutingProtocol::GetMeshPoint(), ns3::dot11s::IePreq::GetMetric(), GetNextHwmpSeqno(), ns3::dot11s::IePreq::GetOriginatorAddress(), ns3::dot11s::IePreq::GetOriginatorSeqNumber(), ns3::dot11s::IePreq::IncrementMetric(), ns3::dot11s::RouteChange::interface, ns3::dot11s::IePreq::IsNeedNotPrep(), ns3::dot11s::RouteChange::lifetime, ns3::dot11s::HwmpRtable::LookupProactive(), ns3::dot11s::HwmpRtable::LookupReactive(), m_hwmpSeqnoMetricDatabase, m_interfaces, m_routeChangeTraceSource, m_rtable, ns3::dot11s::RouteChange::metric, ns3::dot11s::HwmpRtable::LookupResult::metric, ns3::MicroSeconds(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ProactivePathResolved(), ReactivePathResolved(), test-ns3::result, ns3::dot11s::RouteChange::retransmitter, ns3::dot11s::HwmpRtable::LookupResult::retransmitter, ns3::Simulator::Schedule(), SendPrep(), ns3::dot11s::HwmpProtocolMac::SendPreq(), ns3::dot11s::RouteChange::seqnum, ns3::dot11s::RouteChange::type, and ns3::Time::US.
|
virtual |
Clean HWMP packet tag from packet; only the packet parameter is used.
fromIface | the from interface |
source | the source address |
destination | the destination address |
packet | the packet to route |
protocolType | the protocol type |
Implements ns3::MeshL2RoutingProtocol.
Definition at line 329 of file hwmp-protocol.cc.
References NS_FATAL_ERROR, and ns3::Packet::RemovePacketTag().
void ns3::dot11s::HwmpProtocol::Report | ( | std::ostream & | os | ) | const |
Print statistics counters
os | the output stream |
Definition at line 1254 of file hwmp-protocol.cc.
References ns3::Time::GetSeconds(), m_address, m_doFlag, m_dot11MeshHWMPactivePathTimeout, m_dot11MeshHWMPactiveRootTimeout, m_dot11MeshHWMPmaxPREQretries, m_dot11MeshHWMPnetDiameterTraversalTime, m_dot11MeshHWMPpathToRootInterval, m_dot11MeshHWMPperrMinInterval, m_dot11MeshHWMPpreqMinInterval, m_dot11MeshHWMPrannInterval, m_interfaces, m_isRoot, m_maxQueueSize, m_maxTtl, m_rfFlag, m_stats, m_unicastDataThreshold, m_unicastPerrThreshold, m_unicastPreqThreshold, and ns3::dot11s::HwmpProtocol::Statistics::Print().
|
virtual |
Route request, inherited from MeshL2RoutingProtocol.
sourceIface | the source interface |
source | the source address |
destination | the destination address |
packet | the packet to route |
protocolType | the protocol type |
routeReply | the route reply |
Implements ns3::MeshL2RoutingProtocol.
Definition at line 245 of file hwmp-protocol.cc.
References ns3::Packet::AddPacketTag(), first::address, ns3::Packet::Copy(), ns3::dot11s::HwmpTag::DecrementTtl(), ns3::dot11s::HwmpProtocol::Statistics::droppedTtl, ForwardUnicast(), ns3::Mac48Address::GetBroadcast(), GetBroadcastReceivers(), ns3::MeshL2RoutingProtocol::GetMeshPoint(), ns3::Packet::GetSize(), ns3::dot11s::HwmpTag::GetTtl(), m_dataSeqno, m_interfaces, m_maxTtl, m_stats, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Packet::PeekPacketTag(), ns3::Packet::RemovePacketTag(), ns3::dot11s::HwmpTag::SetAddress(), ns3::dot11s::HwmpTag::SetSeqno(), ns3::dot11s::HwmpTag::SetTtl(), ns3::dot11s::HwmpProtocol::Statistics::txBroadcast, and ns3::dot11s::HwmpProtocol::Statistics::txBytes.
void ns3::dot11s::HwmpProtocol::ResetStats | ( | ) |
Reset Statistics:
Definition at line 1282 of file hwmp-protocol.cc.
References m_interfaces, m_stats, and NS_LOG_FUNCTION.
|
private |
Generates PREQ retry when retry timeout has expired and route is still unresolved.
dst | is the destination address |
numOfRetry | is the number of retries |
When PREQ retry has achieved the maximum level - retry mechanism should be canceled
Definition at line 1098 of file hwmp-protocol.cc.
References DequeueFirstPacketByDst(), ns3::dot11s::HwmpProtocol::QueuedPacket::dst, ns3::Mac48Address::GetBroadcast(), GetNextHwmpSeqno(), ns3::dot11s::HwmpRtable::LookupProactive(), ns3::dot11s::HwmpRtable::LookupReactive(), ns3::dot11s::HwmpRtable::LookupReactiveExpired(), m_dot11MeshHWMPmaxPREQretries, m_dot11MeshHWMPnetDiameterTraversalTime, m_interfaces, m_preqTimeouts, m_routeDiscoveryTimeCallback, m_rtable, m_stats, ns3::dot11s::HwmpRtable::MAX_METRIC, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, ns3::dot11s::HwmpProtocol::QueuedPacket::pkt, ns3::dot11s::HwmpProtocol::QueuedPacket::protocol, ns3::dot11s::HwmpProtocol::QueuedPacket::reply, test-ns3::result, ns3::Simulator::Schedule(), ns3::dot11s::HwmpRtable::LookupResult::seqnum, ns3::dot11s::HwmpProtocol::QueuedPacket::src, and ns3::dot11s::HwmpProtocol::Statistics::totalDropped.
Referenced by ShouldSendPreq().
|
private |
Send Path Reply.
src | the source address |
dst | the destination address |
retransmitter | the retransmitter address |
initMetric | the initial metric |
originatorDsn | the originator DSN |
destinationSN | the destination DSN |
lifetime | the lifetime |
interface | the interface |
Definition at line 749 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().
|
private |
Proactive Preq routines:
Definition at line 1155 of file hwmp-protocol.cc.
References ns3::dot11s::IePreq::AddDestinationAddressElement(), GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::Time::GetMicroSeconds(), GetNextHwmpSeqno(), GetNextPreqId(), m_dot11MeshHWMPactiveRootTimeout, m_dot11MeshHWMPpathToRootInterval, m_interfaces, m_maxTtl, m_proactivePreqTimer, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), 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().
Referenced by DoInitialize().
void ns3::dot11s::HwmpProtocol::SetNeighboursCallback | ( | Callback< std::vector< Mac48Address >, uint32_t > | cb | ) |
This callback is used to obtain active neighbours on a given interface.
cb | is a callback, which returns a list of addresses on given interface (uint32_t) |
Definition at line 819 of file hwmp-protocol.cc.
References m_neighboursCallback.
void ns3::dot11s::HwmpProtocol::SetRoot | ( | ) |
Unset the current node as root.
Definition at line 1142 of file hwmp-protocol.cc.
References m_address, m_isRoot, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
private |
checks when the last path discovery procedure was started for a given destination.
dst | is the destination address |
If the retry counter has not achieved the maximum level - preq should not be sent
Definition at line 1083 of file hwmp-protocol.cc.
References m_dot11MeshHWMPnetDiameterTraversalTime, m_preqTimeouts, ns3::Simulator::Now(), NS_LOG_FUNCTION, RetryPathDiscovery(), and ns3::Simulator::Schedule().
Referenced by ForwardUnicast().
void ns3::dot11s::HwmpProtocol::UnsetRoot | ( | ) |
Unset the current node as root.
Definition at line 1149 of file hwmp-protocol.cc.
References ns3::EventId::Cancel(), m_proactivePreqTimer, and NS_LOG_FUNCTION.
|
friend |
allow HwmpProtocolMac class friend access
Definition at line 170 of file hwmp-protocol.h.
|
private |
address
Definition at line 460 of file hwmp-protocol.h.
Referenced by GetAddress(), Install(), Report(), and SetRoot().
|
private |
Random variable for random start time.
coefficient
Definition at line 510 of file hwmp-protocol.h.
Referenced by HwmpProtocol(), AssignStreams(), and DoInitialize().
|
private |
|
private |
Destination only HWMP flag.
Definition at line 505 of file hwmp-protocol.h.
Referenced by GetDoFlag(), GetTypeId(), and Report().
|
private |
Lifetime of reactive routing information.
Definition at line 497 of file hwmp-protocol.h.
Referenced by GetActivePathLifetime(), GetTypeId(), and Report().
|
private |
Lifetime of proactive routing information.
Definition at line 496 of file hwmp-protocol.h.
Referenced by GetTypeId(), Report(), and SendProactivePreq().
|
private |
Maximum number of retries before we suppose the destination to be unreachable.
Definition at line 492 of file hwmp-protocol.h.
Referenced by GetTypeId(), Report(), and RetryPathDiscovery().
|
private |
Time we suppose the packet to go from one edge of the network to another.
Definition at line 493 of file hwmp-protocol.h.
Referenced by GetTypeId(), Report(), RetryPathDiscovery(), and ShouldSendPreq().
|
private |
Interval between two successive proactive PREQs.
Definition at line 498 of file hwmp-protocol.h.
Referenced by GetTypeId(), Report(), and SendProactivePreq().
|
private |
Minimal interval between to successive PREQs.
Definition at line 495 of file hwmp-protocol.h.
Referenced by GetPerrMinInterval(), GetTypeId(), and Report().
|
private |
Minimal interval between to successive PREQs.
Definition at line 494 of file hwmp-protocol.h.
Referenced by GetPreqMinInterval(), GetTypeId(), and Report().
|
private |
Lifetime of proactive routing information.
Definition at line 499 of file hwmp-protocol.h.
Referenced by GetTypeId(), and Report().
|
private |
|
private |
keeps HWMP seqno (first in pair) and HWMP metric (second in pair) for each address
Definition at line 469 of file hwmp-protocol.h.
Referenced by DoDispose(), ReceivePrep(), and ReceivePreq().
|
private |
interfaces
Definition at line 459 of file hwmp-protocol.h.
Referenced by DoDispose(), ForwardPathError(), ForwardUnicast(), InitiatePathError(), Install(), ReceivePrep(), ReceivePreq(), Report(), RequestRoute(), ResetStats(), RetryPathDiscovery(), SendPrep(), and SendProactivePreq().
|
private |
True if the node is a root.
Definition at line 500 of file hwmp-protocol.h.
Referenced by DoInitialize(), Report(), and SetRoot().
|
private |
keeps HWMP seqno (first in pair) and HWMP metric (second in pair) for each address
Definition at line 467 of file hwmp-protocol.h.
Referenced by DoDispose(), and DropDataFrame().
|
private |
Maximum number of packets we can store when resolving route.
Definition at line 491 of file hwmp-protocol.h.
Referenced by GetTypeId(), QueuePacket(), and Report().
|
private |
Initial value of Time To Live field.
Definition at line 501 of file hwmp-protocol.h.
Referenced by GetMaxTtl(), GetTypeId(), Report(), RequestRoute(), SendPrep(), and SendProactivePreq().
|
private |
neighbors callback
Definition at line 511 of file hwmp-protocol.h.
Referenced by GetBroadcastReceivers(), GetPreqReceivers(), and SetNeighboursCallback().
|
private |
|
private |
PREQ timeouts.
Definition at line 481 of file hwmp-protocol.h.
Referenced by DoDispose(), ReactivePathResolved(), RetryPathDiscovery(), and ShouldSendPreq().
|
private |
proactive PREQ timer
Definition at line 482 of file hwmp-protocol.h.
Referenced by DoDispose(), DoInitialize(), SendProactivePreq(), and UnsetRoot().
|
private |
Random start in Proactive PREQ propagation.
Definition at line 484 of file hwmp-protocol.h.
Referenced by DoInitialize(), and GetTypeId().
|
private |
Reply and forward flag.
Definition at line 506 of file hwmp-protocol.h.
Referenced by GetRfFlag(), GetTypeId(), and Report().
|
private |
Route change trace source.
Definition at line 329 of file hwmp-protocol.h.
Referenced by GetPerrReceivers(), GetTypeId(), MakePathError(), ReceivePrep(), and ReceivePreq().
|
private |
Route discovery time:
Definition at line 325 of file hwmp-protocol.h.
Referenced by GetTypeId(), ReactivePathResolved(), and RetryPathDiscovery().
|
private |
Definition at line 486 of file hwmp-protocol.h.
Referenced by DequeueFirstPacket(), DequeueFirstPacketByDst(), DoDispose(), and QueuePacket().
|
private |
Routing table.
Definition at line 473 of file hwmp-protocol.h.
Referenced by DoDispose(), ForwardUnicast(), GetPerrReceivers(), GetRoutingTable(), MakePathError(), PeerLinkStatus(), ProactivePathResolved(), ReactivePathResolved(), ReceivePerr(), ReceivePrep(), ReceivePreq(), and RetryPathDiscovery().
|
private |
statistics
Definition at line 457 of file hwmp-protocol.h.
Referenced by ForwardUnicast(), MakePathError(), ProactivePathResolved(), ReactivePathResolved(), Report(), RequestRoute(), ResetStats(), RetryPathDiscovery(), and SendPrep().
|
private |
Maximum number of broadcast receivers, when we send a broadcast as a chain of unicasts.
Definition at line 504 of file hwmp-protocol.h.
Referenced by GetBroadcastReceivers(), GetTypeId(), and Report().
|
private |
Maximum number of PERR receivers, when we send a PERR as a chain of unicasts.
Definition at line 502 of file hwmp-protocol.h.
Referenced by GetTypeId(), GetUnicastPerrThreshold(), and Report().
|
private |
Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts.
Definition at line 503 of file hwmp-protocol.h.
Referenced by GetPreqReceivers(), GetTypeId(), and Report().