Hybrid wireless mesh protocol – a routing protocol of IEEE 802.11s draft. 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 |
struct | QueuedPacket |
Packet waiting its routing information. More... | |
struct | Statistics |
Public Member Functions | |
int64_t | AssignStreams (int64_t stream) |
void | DoDispose () |
bool | Install (Ptr< MeshPointDevice >) |
Install HWMP on given mesh point. More... | |
void | PeerLinkStatus (Mac48Address meshPontAddress, Mac48Address peerAddress, uint32_t interface, bool status) |
bool | RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, const Mac48Address destination, Ptr< Packet > packet, uint16_t &protocolType) |
Cleanup packet from all tags. | |
void | Report (std::ostream &) const |
Statistics: | |
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. | |
void | ResetStats () |
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 | |
Ptr< MeshPointDevice > | GetMeshPoint () const |
Each mesh protocol must be installed on the mesh point to work. | |
void | SetMeshPoint (Ptr< MeshPointDevice > mp) |
Set host mesh point, analog of SetNode (...) methods for upper layer protocols. | |
Public Member Functions inherited from ns3::Object | |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Initialize (void) |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
Public Member Functions inherited from ns3::ObjectBase | |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Static Public Member Functions inherited from ns3::MeshL2RoutingProtocol | |
static TypeId | GetTypeId () |
Never forget to support NS3 object model. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
static void | Cleanup (void) |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Private Types | |
typedef std::map< uint32_t, Ptr< HwmpProtocolMac > > | HwmpProtocolMacMap |
Private Member Functions | |
HwmpProtocol (const HwmpProtocol &) | |
virtual void | DoInitialize () |
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. | |
Mac48Address | GetAddress () |
HwmpProtocol & | operator= (const HwmpProtocol &) |
Interaction with HWMP MAC plugin | |
void | ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric) |
void | ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric) |
void | ReceivePerr (std::vector< FailedDestination >, Mac48Address from, uint32_t interface, Mac48Address fromMp) |
void | SendPrep (Mac48Address src, Mac48Address dst, Mac48Address retransmitter, uint32_t initMetric, uint32_t originatorDsn, uint32_t destinationSN, uint32_t lifetime, uint32_t interface) |
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. | |
void | InitiatePathError (PathError perr) |
Passes a self-generated PERR to interface-plugin. | |
std::vector< std::pair < uint32_t, Mac48Address > > | GetPerrReceivers (std::vector< FailedDestination > failedDest) |
std::vector< Mac48Address > | GetPreqReceivers (uint32_t interface) |
std::vector< Mac48Address > | GetBroadcastReceivers (uint32_t interface) |
bool | DropDataFrame (uint32_t seqno, Mac48Address source) |
MAC-plugin asks whether the frame can be dropped. Protocol automatically updates seqno. 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: | |
Methods needed by HwmpMacLugin to access protocol parameters: | |
bool | GetDoFlag () |
bool | GetRfFlag () |
Time | GetPreqMinInterval () |
Time | GetPerrMinInterval () |
uint8_t | GetMaxTtl () |
uint32_t | GetNextPreqId () |
uint32_t | GetNextHwmpSeqno () |
uint32_t | GetActivePathLifetime () |
uint8_t | GetUnicastPerrThreshold () |
Private Attributes | |
Mac48Address | m_address |
Ptr< UniformRandomVariable > | m_coefficient |
uint32_t | m_dataSeqno |
uint32_t | m_hwmpSeqno |
HwmpProtocolMacMap | m_interfaces |
Callback< std::vector < Mac48Address >, uint32_t > | m_neighboursCallback |
uint32_t | m_preqId |
TracedCallback< Time > | m_routeDiscoveryTimeCallback |
Route discovery time: | |
std::vector< QueuedPacket > | m_rqueue |
Ptr< HwmpRtable > | m_rtable |
Routing table. | |
Statistics: | |
Statistics | m_stats |
Sequence number filters | |
Data sequence number database | |
std::map< Mac48Address, uint32_t > | m_lastDataSeqno |
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 | |
Timers: | |
std::map< Mac48Address, PreqEvent > | m_preqTimeouts |
EventId | m_proactivePreqTimer |
Time | m_randomStart |
Random start in Proactive PREQ propagation. | |
HWMP-protocol parameters (attributes of GetTypeId) | |
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 |
Additional Inherited Members | |
Public Types inherited from ns3::MeshL2RoutingProtocol | |
typedef Callback< void, bool, Ptr< Packet >, Mac48Address, Mac48Address, uint16_t, uint32_t > | RouteReplyCallback |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
virtual void | NotifyNewAggregate (void) |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
virtual void | NotifyConstructionCompleted (void) |
Protected Attributes inherited from ns3::MeshL2RoutingProtocol | |
Ptr< MeshPointDevice > | m_mp |
Host mesh point. | |
Hybrid wireless mesh protocol – a routing protocol of IEEE 802.11s draft.
ns3::dot11s::HwmpProtocol is accessible through the following paths with Config::Set and Config::Connect:
Definition at line 47 of file hwmp-protocol.h.
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 1173 of file hwmp-protocol.cc.
References m_coefficient, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
virtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden 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 214 of file hwmp-protocol.cc.
References NS_LOG_FUNCTION_NOARGS.
|
privatevirtual |
This method is called only once by Object::Initialize. If the user calls Object::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 204 of file hwmp-protocol.cc.
|
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 743 of file hwmp-protocol.cc.
|
private |
Definition at line 1104 of file hwmp-protocol.cc.
|
private |
Definition at line 858 of file hwmp-protocol.cc.
References ns3::Mac48Address::GetBroadcast().
|
private |
Definition at line 816 of file hwmp-protocol.cc.
|
private |
Definition at line 843 of file hwmp-protocol.cc.
References ns3::Mac48Address::GetBroadcast().
bool ns3::dot11s::HwmpProtocol::Install | ( | Ptr< MeshPointDevice > | mp | ) |
Install HWMP on given mesh point.
Installing protocol cause installing its interface MAC plugins.
Also MP aggregates all installed protocols, HWMP protocol can be accessed via MeshPointDevice::GetObject<dot11s::HwmpProtocol>();
Definition at line 696 of file hwmp-protocol.cc.
References ns3::Mac48Address::ConvertFrom(), and ns3::MakeCallback().
|
private |
forms a path error information element when list of destination fails on a given interface
Definition at line 765 of file hwmp-protocol.cc.
References ns3::dot11s::HwmpProtocol::PathError::destinations, and ns3::dot11s::HwmpProtocol::PathError::receivers.
|
private |
Generates PREQ retry when retry timeout has expired and route is still unresolved.
When PREQ retry has achieved the maximum level - retry mechanism should be canceled
Definition at line 981 of file hwmp-protocol.cc.
References ns3::dot11s::HwmpProtocol::QueuedPacket::dst, ns3::Mac48Address::GetBroadcast(), ns3::dot11s::HwmpRtable::MAX_METRIC, ns3::Simulator::Now(), NS_ASSERT, ns3::dot11s::HwmpProtocol::QueuedPacket::pkt, ns3::dot11s::HwmpProtocol::QueuedPacket::protocol, ns3::dot11s::HwmpProtocol::QueuedPacket::reply, ns3::Simulator::Schedule(), and ns3::dot11s::HwmpProtocol::QueuedPacket::src.
Referenced by ShouldSendPreq().
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 738 of file hwmp-protocol.cc.
|
private |
checks when the last path discovery procedure was started for a given destination.
If the retry counter has not achieved the maximum level - preq should not be sent
Definition at line 967 of file hwmp-protocol.cc.
References ns3::Simulator::Now(), RetryPathDiscovery(), and ns3::Simulator::Schedule().
|
private |
Random variable for random start time
Definition at line 284 of file hwmp-protocol.h.
Referenced by AssignStreams().
|
private |
Definition at line 263 of file hwmp-protocol.h.