26 #include "ns3/simulator.h"
27 #include "ns3/packet.h"
28 #include "ns3/random-variable-stream.h"
29 #include "ns3/string.h"
30 #include "ns3/pointer.h"
31 #include "ns3/mesh-point-device.h"
32 #include "ns3/wifi-net-device.h"
33 #include "ns3/mesh-wifi-interface-mac.h"
34 #include "ns3/random-variable-stream.h"
38 #include "ns3/trace-source-accessor.h"
54 .SetGroupName (
"Mesh")
56 .AddAttribute (
"RandomStart",
57 "Random delay at first proactive PREQ",
63 .AddAttribute (
"MaxQueueSize",
64 "Maximum number of packets we can store when resolving route",
68 MakeUintegerChecker<uint16_t> (1)
70 .AddAttribute (
"Dot11MeshHWMPmaxPREQretries",
71 "Maximum number of retries before we suppose the destination to be unreachable",
75 MakeUintegerChecker<uint8_t> (1)
77 .AddAttribute (
"Dot11MeshHWMPnetDiameterTraversalTime",
78 "Time we suppose the packet to go from one edge of the network to another",
84 .AddAttribute (
"Dot11MeshHWMPpreqMinInterval",
85 "Minimal interval between to successive PREQs",
91 .AddAttribute (
"Dot11MeshHWMPperrMinInterval",
92 "Minimal interval between to successive PREQs",
97 .AddAttribute (
"Dot11MeshHWMPactiveRootTimeout",
98 "Lifetime of proactive routing information",
104 .AddAttribute (
"Dot11MeshHWMPactivePathTimeout",
105 "Lifetime of reactive routing information",
111 .AddAttribute (
"Dot11MeshHWMPpathToRootInterval",
112 "Interval between two successive proactive PREQs",
118 .AddAttribute (
"Dot11MeshHWMPrannInterval",
119 "Lifetime of proactive routing information",
125 .AddAttribute (
"MaxTtl",
126 "Initial value of Time To Live field",
130 MakeUintegerChecker<uint8_t> (2)
132 .AddAttribute (
"UnicastPerrThreshold",
133 "Maximum number of PERR receivers, when we send a PERR as a chain of unicasts",
137 MakeUintegerChecker<uint8_t> (1)
139 .AddAttribute (
"UnicastPreqThreshold",
140 "Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts",
144 MakeUintegerChecker<uint8_t> (1)
146 .AddAttribute (
"UnicastDataThreshold",
147 "Maximum number of broadcast receivers, when we send a broadcast as a chain of unicasts",
151 MakeUintegerChecker<uint8_t> (1)
153 .AddAttribute (
"DoFlag",
154 "Destination only HWMP flag",
160 .AddAttribute (
"RfFlag",
161 "Reply and forward flag",
167 .AddTraceSource (
"RouteDiscoveryTime",
168 "The time of route discovery procedure",
171 "ns3::Time::TracedCallback"
173 .AddTraceSource (
"RouteChange",
174 "Routing table changed",
176 "ns3::HwmpProtocol::RouteChangeTracedCallback"
188 m_maxQueueSize (255),
189 m_dot11MeshHWMPmaxPREQretries (3),
190 m_dot11MeshHWMPnetDiameterTraversalTime (
MicroSeconds (1024*100)),
191 m_dot11MeshHWMPpreqMinInterval (
MicroSeconds (1024*100)),
192 m_dot11MeshHWMPperrMinInterval (
MicroSeconds (1024*100)),
193 m_dot11MeshHWMPactiveRootTimeout (
MicroSeconds (1024*5000)),
194 m_dot11MeshHWMPactivePathTimeout (
MicroSeconds (1024*5000)),
195 m_dot11MeshHWMPpathToRootInterval (
MicroSeconds (1024*2000)),
199 m_unicastPerrThreshold (32),
200 m_unicastPreqThreshold (1),
201 m_unicastDataThreshold (1),
232 i->second.preqTimeout.Cancel ();
246 uint32_t sourceIface,
250 uint16_t protocolType,
254 NS_LOG_FUNCTION (
this << sourceIface << source << destination << constPacket << protocolType);
262 NS_FATAL_ERROR (
"HWMP tag has come with a packet from upper layer. This must not occur...");
275 NS_FATAL_ERROR (
"HWMP tag is supposed to be here at this point.");
290 std::vector<uint16_t> channels;
293 bool shouldSend =
true;
294 for (std::vector<uint16_t>::const_iterator chan = channels.begin (); chan != channels.end (); chan++)
296 if ((*chan) == plugin->second->GetChannelId ())
305 channels.push_back (plugin->second->GetChannelId ());
307 for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != receivers.end (); i++)
318 routeReply (
true, packetCopy, source, destination, protocolType, plugin->first);
324 return ForwardUnicast (sourceIface, source, destination, packet, protocolType, routeReply, tag.
GetTtl ());
335 NS_FATAL_ERROR (
"HWMP tag must exist when packet received from the network");
343 NS_LOG_FUNCTION (
this << sourceIface << source << destination << packet << protocolType << ttl);
359 routeReply (
true, packet, source, destination, protocolType,
result.ifIndex);
377 NS_LOG_DEBUG (
"Path error, lookup expired proactive path");
382 NS_LOG_DEBUG (
"Path error, initiate reactive path error");
394 uint32_t dst_seqno = 0;
397 dst_seqno =
result.seqnum;
402 i->second->RequestDestination (destination, originator_seqno, dst_seqno);
407 pkt.
dst = destination;
410 pkt.
reply = routeReply;
420 NS_LOG_DEBUG (
"Dropping packet from " << source <<
" to " << destination <<
" due to queue overflow");
432 bool freshInfo (
true);
442 if (i->second.second <= preq.
GetMetric ())
471 rChange.
type =
"Add Reactive";
496 rChange.
type =
"Add Reactive";
515 NS_ASSERT (((*i)->IsDo ()) && ((*i)->IsRf ()));
533 rChange.
type =
"Add Proactive";
558 if ((*i)->GetDestinationAddress () ==
GetAddress ())
579 uint32_t lifetime =
result.lifetime.GetMicroSeconds () / 1024;
580 if ((lifetime > 0) && ((int32_t)(
result.seqnum - (*i)->GetDestSeqNumber ()) >= 0))
583 (*i)->GetDestinationAddress (),
596 (*i)->SetFlags (
true,
false, (*i)->IsUsn ());
628 bool freshInfo (
true);
632 if ((int32_t)(i->second.first - sequence) > 0)
636 if (i->second.first == sequence)
665 rChange.
type =
"Add Reactive";
671 rChange.
seqnum = sequence;
696 rChange.
type =
"Add Reactive";
702 rChange.
seqnum = sequence;
728 std::vector<FailedDestination> retval;
730 for (
unsigned int i = 0; i < destinations.size (); i++)
734 (
result.retransmitter != from) ||
735 (
result.ifIndex != interface) ||
736 ((int32_t)(
result.seqnum - destinations[i].seqnum) > 0)
739 retval.push_back (destinations[i]);
742 if (retval.size () == 0)
754 uint32_t originatorDsn,
755 uint32_t destinationSN,
768 HwmpProtocolMacMap::const_iterator prep_sender =
m_interfaces.find (interface);
770 prep_sender->second->SendPrep (prep, retransmitter);
778 std::vector<Ptr<NetDevice> >
interfaces = mp->GetInterfaces ();
795 mac->InstallPlugin (hwmpMac);
800 mp->SetRoutingProtocol (
this);
802 mp->AggregateObject (
this);
809 NS_LOG_FUNCTION (
this << meshPointAddress << peerAddress << interface << status);
815 NS_LOG_DEBUG (destinations.size () <<
" failed destinations for peer address " << peerAddress);
829 NS_LOG_DEBUG (
"Dropping seqno " << seqno <<
"; from self");
832 std::map<Mac48Address, uint32_t,std::less<Mac48Address> >::const_iterator i =
m_lastDataSeqno.find (source);
839 if ((int32_t)(i->second - seqno) >= 0)
841 NS_LOG_DEBUG (
"Dropping seqno " << seqno <<
"; stale frame");
860 for (
unsigned int i = 0; i < destinations.size (); i++)
866 rChange.
type =
"Delete Reactive";
868 rChange.
seqnum = destinations[i].seqnum;
879 std::vector<Mac48Address> receivers_for_interface;
880 for (
unsigned int j = 0; j < perr.
receivers.size (); j++)
884 receivers_for_interface.push_back (perr.
receivers[j].second);
887 i->second->InitiatePerr (perr.
destinations, receivers_for_interface);
896 std::vector<Mac48Address> receivers_for_interface;
897 for (
unsigned int j = 0; j < perr.
receivers.size (); j++)
901 receivers_for_interface.push_back (perr.
receivers[j].second);
907 i->second->ForwardPerr (perr.
destinations, receivers_for_interface);
911 std::vector<std::pair<uint32_t, Mac48Address> >
916 for (
unsigned int i = 0; i < failedDest.size (); i++)
922 rChange.
type =
"Delete Reactive";
924 rChange.
seqnum = failedDest[i].seqnum;
929 rChangePro.
type =
"Delete Proactive";
930 rChangePro.
destination = failedDest[i].destination;
931 rChangePro.
seqnum = failedDest[i].seqnum;
933 for (
unsigned int j = 0; j < precursors.size (); j++)
935 retval.push_back (precursors[j]);
939 for (
unsigned int i = 0; i < retval.size (); i++)
941 for (
unsigned int j = i+1; j < retval.size (); j++)
945 retval.erase (retval.begin () + j);
951 std::vector<Mac48Address>
955 std::vector<Mac48Address> retval;
967 std::vector<Mac48Address>
971 std::vector<Mac48Address> retval;
1002 for (std::vector<QueuedPacket>::iterator i =
m_rqueue.begin (); i !=
m_rqueue.end (); i++)
1004 if ((*i).dst == dst)
1032 std::map<Mac48Address, PreqEvent>::iterator i =
m_preqTimeouts.find (dst);
1042 while (packet.
pkt != 0)
1064 while (packet.
pkt != 0)
1086 std::map<Mac48Address, PreqEvent>::const_iterator i =
m_preqTimeouts.find (dst);
1108 std::map<Mac48Address, PreqEvent>::iterator i =
m_preqTimeouts.find (dst);
1117 while (packet.
pkt != 0)
1123 std::map<Mac48Address, PreqEvent>::iterator i =
m_preqTimeouts.find (dst);
1134 i->second->RequestDestination (dst, originator_seqno, dst_seqno);
1171 i->second->SendPreq (preq);
1242 os <<
"<Statistics "
1243 "txUnicast=\"" << txUnicast <<
"\" "
1244 "txBroadcast=\"" << txBroadcast <<
"\" "
1245 "txBytes=\"" << txBytes <<
"\" "
1246 "droppedTtl=\"" << droppedTtl <<
"\" "
1247 "totalQueued=\"" << totalQueued <<
"\" "
1248 "totalDropped=\"" << totalDropped <<
"\" "
1249 "initiatedPreq=\"" << initiatedPreq <<
"\" "
1250 "initiatedPrep=\"" << initiatedPrep <<
"\" "
1251 "initiatedPerr=\"" << initiatedPerr <<
"\"/>" << std::endl;
1257 "address=\"" <<
m_address <<
"\"" << std::endl <<
1267 "isRoot=\"" <<
m_isRoot <<
"\"" << std::endl <<
1268 "maxTtl=\"" << (uint16_t)
m_maxTtl <<
"\"" << std::endl <<
1272 "doFlag=\"" <<
m_doFlag <<
"\"" << std::endl <<
1273 "rfFlag=\"" <<
m_rfFlag <<
"\">" << std::endl;
1277 plugin->second->Report (os);
1279 os <<
"</Hwmp>" << std::endl;
1288 plugin->second->ResetStats ();
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
static Mac48Address GetBroadcast(void)
static Mac48Address ConvertFrom(const Address &address)
Interface for L2 mesh routing protocol and mesh point communication.
Ptr< MeshPointDevice > GetMeshPoint() const
Each mesh protocol must be installed on the mesh point to work.
Ptr< MeshPointDevice > m_mp
Host mesh point.
Basic MAC of mesh point Wi-Fi interface.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now(void)
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
Hold together all Wifi-related objects.
Ptr< WifiMac > GetMac(void) const
uint32_t GetIfIndex(void) const override
uint32_t CalculateMetric(Mac48Address peerAddress, Ptr< MeshWifiInterfaceMac > mac)
Airtime link metric is defined in Section 13.9 of IEEE 802.11-2012 as:
Hybrid wireless mesh protocol – a mesh routing protocol defined in IEEE 802.11-2012 standard.
void SetRoot()
Unset the current node as root.
std::vector< Mac48Address > GetPreqReceivers(uint32_t interface)
Get PREQ receivers.
QueuedPacket DequeueFirstPacket()
Dequeue the first packet in the queue.
Ptr< HwmpRtable > m_rtable
Routing table.
uint8_t m_unicastDataThreshold
Maximum number of broadcast receivers, when we send a broadcast as a chain of unicasts.
void ReceivePrep(IePrep prep, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric)
Handler for receiving Path Reply.
void Report(std::ostream &os) const
Statistics:
uint32_t GetNextHwmpSeqno()
Get next HWMP sequence no function.
PathError MakePathError(std::vector< FailedDestination > destinations)
forms a path error information element when list of destination fails on a given interface
Time m_dot11MeshHWMPrannInterval
Lifetime of proactive routing information.
Time GetPerrMinInterval()
Get PERR minimum interval function.
uint8_t m_unicastPreqThreshold
Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts.
void UnsetRoot()
Unset the current node as root.
uint32_t m_dataSeqno
data sequence no
Time m_dot11MeshHWMPnetDiameterTraversalTime
Time we suppose the packet to go from one edge of the network to another.
Time m_dot11MeshHWMPactivePathTimeout
Lifetime of reactive routing information.
bool QueuePacket(QueuedPacket packet)
Queue a packet.
bool m_isRoot
True if the node is a root.
Statistics m_stats
statistics
uint32_t m_hwmpSeqno
HWMP sequence no.
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.
Time m_randomStart
Random start in Proactive PREQ propagation.
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.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
virtual void DoInitialize()
Initialize() implementation.
TracedCallback< Time > m_routeDiscoveryTimeCallback
Route discovery time:
static TypeId GetTypeId()
Get the type ID.
bool GetRfFlag()
Get rf flag function.
bool ShouldSendPreq(Mac48Address dst)
checks when the last path discovery procedure was started for a given destination.
void PeerLinkStatus(Mac48Address meshPontAddress, Mac48Address peerAddress, uint32_t interface, bool status)
Peer link status function.
void ReceivePerr(std::vector< FailedDestination > destinations, Mac48Address from, uint32_t interface, Mac48Address fromMp)
Handler for receiving Path Error.
std::map< Mac48Address, PreqEvent > m_preqTimeouts
PREQ timeouts.
Time m_dot11MeshHWMPperrMinInterval
Minimal interval between to successive PREQs.
bool m_rfFlag
Reply and forward flag.
bool GetDoFlag()
Get do flag function.
Time GetPreqMinInterval()
Get PREQ minimum interval function.
QueuedPacket DequeueFirstPacketByDst(Mac48Address dst)
Dequeue the first packet for a given destination.
EventId m_proactivePreqTimer
proactive PREQ timer
Ptr< UniformRandomVariable > m_coefficient
Random variable for random start time.
uint32_t GetNextPreqId()
Get next period function.
void InitiatePathError(PathError perr)
Passes a self-generated PERR to interface-plugin.
uint8_t GetUnicastPerrThreshold()
Get unicast PERR threshold function.
void SendProactivePreq()
Proactive Preq routines:
void ForwardPathError(PathError perr)
Forwards a received path error.
void DoDispose()
Destructor implementation.
Time m_dot11MeshHWMPpathToRootInterval
Interval between two successive proactive PREQs.
void RetryPathDiscovery(Mac48Address dst, uint8_t numOfRetry)
Generates PREQ retry when retry timeout has expired and route is still unresolved.
Mac48Address GetAddress()
bool m_doFlag
Destination only HWMP flag.
Mac48Address m_address
address
Time m_dot11MeshHWMPactiveRootTimeout
Lifetime of proactive routing information.
void ReceivePreq(IePreq preq, Mac48Address from, uint32_t interface, Mac48Address fromMp, uint32_t metric)
Handler for receiving Path Request.
Time m_dot11MeshHWMPpreqMinInterval
Minimal interval between to successive PREQs.
uint8_t GetMaxTtl()
Get maximum TTL function.
void ReactivePathResolved(Mac48Address dst)
Signal the protocol that the reactive path toward a destination is now available.
std::vector< Mac48Address > GetBroadcastReceivers(uint32_t interface)
Get broadcast receivers.
bool Install(Ptr< MeshPointDevice > mp)
Install HWMP on given mesh point.
uint32_t GetActivePathLifetime()
Get active path lifetime function.
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.
void ProactivePathResolved()
Signal the protocol that the proactive path is now available.
void SetNeighboursCallback(Callback< std::vector< Mac48Address >, uint32_t > cb)
This callback is used to obtain active neighbours on a given interface.
std::vector< QueuedPacket > m_rqueue
Packet Queue.
Callback< std::vector< Mac48Address >, uint32_t > m_neighboursCallback
neighbors callback
std::vector< std::pair< uint32_t, Mac48Address > > GetPerrReceivers(std::vector< FailedDestination > failedDest)
Get PERR receivers.
HwmpProtocolMacMap m_interfaces
interfaces
Ptr< HwmpRtable > GetRoutingTable(void) const
Get pointer to HWMP routing table.
uint16_t m_maxQueueSize
Maximum number of packets we can store when resolving route.
uint8_t m_maxTtl
Initial value of Time To Live field.
std::map< Mac48Address, uint32_t > m_lastDataSeqno
keeps HWMP seqno (first in pair) and HWMP metric (second in pair) for each address
void ResetStats()
Reset Statistics:
bool DropDataFrame(uint32_t seqno, Mac48Address source)
MAC-plugin asks whether the frame can be dropped.
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.
uint8_t m_unicastPerrThreshold
Maximum number of PERR receivers, when we send a PERR as a chain of unicasts.
uint32_t m_preqId
PREQ ID.
uint8_t m_dot11MeshHWMPmaxPREQretries
Maximum number of retries before we suppose the destination to be unreachable.
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
TracedCallback< struct RouteChange > m_routeChangeTraceSource
Route change trace source.
void SendPreq(IePreq preq)
Send PREQ function.
void SendPrep(IePrep prep, Mac48Address receiver)
Send PREP function.
void ForwardPerr(std::vector< HwmpProtocol::FailedDestination > destinations, std::vector< Mac48Address > receivers)
Forward a path error.
Routing table for HWMP – 802.11s routing protocol.
void DeleteReactivePath(Mac48Address destination)
Delete the reactive paths toward a destination.
static const uint32_t MAX_METRIC
Maximum (the best?) path metric.
LookupResult LookupReactive(Mac48Address destination)
Lookup path to destination.
LookupResult LookupReactiveExpired(Mac48Address destination)
Return all reactive paths, including expired.
PrecursorList GetPrecursors(Mac48Address destination)
Get the precursors list.
void DeleteProactivePath()
Delete all the proactive paths.
LookupResult LookupProactiveExpired()
Return all proactive paths, including expired.
std::vector< std::pair< uint32_t, Mac48Address > > PrecursorList
Path precursor = {MAC, interface ID}.
std::vector< HwmpProtocol::FailedDestination > GetUnreachableDestinations(Mac48Address peerAddress)
When peer link with a given MAC-address fails - it returns list of unreachable destination addresses.
LookupResult LookupProactive()
Find proactive path to tree root.
void AddPrecursor(Mac48Address destination, uint32_t precursorInterface, Mac48Address precursorAddress, Time lifetime)
Add a precursor.
void AddProactivePath(uint32_t metric, Mac48Address root, Mac48Address retransmitter, uint32_t interface, Time lifetime, uint32_t seqnum)
Add a proactive path.
void AddReactivePath(Mac48Address destination, Mac48Address retransmitter, uint32_t interface, uint32_t metric, Time lifetime, uint32_t seqnum)
Add a reactive path.
Hwmp tag implements interaction between HWMP protocol and MeshWifiMac.
void SetTtl(uint8_t ttl)
Set the TTL value.
void SetSeqno(uint32_t seqno)
Set sequence number.
uint8_t GetTtl()
Get the TTL value.
void SetAddress(Mac48Address retransmitter)
Set address.
void DecrementTtl()
Decrement TTL.
See 7.3.2.97 of 802.11s draft 2.07.
uint32_t GetMetric() const
Get metric function.
void SetTtl(uint8_t ttl)
Set TTL function.
void SetDestinationSeqNumber(uint32_t dest_seq_number)
Set destination sequence number function.
Mac48Address GetDestinationAddress() const
Get destination address function.
void SetHopcount(uint8_t hopcount)
Set hop count function.
void IncrementMetric(uint32_t metric)
Increment metric function.
uint32_t GetLifetime() const
Get lifetime function.
void SetOriginatorAddress(Mac48Address originator_address)
Set originator address function.
void SetMetric(uint32_t metric)
Set metric function.
void SetDestinationAddress(Mac48Address dest_address)
Set destination address function.
void SetLifetime(uint32_t lifetime)
Set lifetime function.
Mac48Address GetOriginatorAddress() const
Get originator address function.
void SetOriginatorSeqNumber(uint32_t originator_seq_number)
Set originator sequence number function.
uint32_t GetDestinationSeqNumber() const
Get destination sequence number function.
See 7.3.2.96 of 802.11s draft 2.07.
uint32_t GetOriginatorSeqNumber() const
Get originator sequence numnber value.
void DelDestinationAddressElement(Mac48Address dest_address)
Delete a destination address unit by destination.
void SetHopcount(uint8_t hopcount)
Set number of hops from originator to mesh STA transmitting this element.
uint8_t GetDestCount() const
Get destination count.
std::vector< Ptr< DestinationAddressUnit > > GetDestinationList()
Get all destinations, which are stored in PREQ:
void SetOriginatorSeqNumber(uint32_t originator_seq_number)
Set originator sequence number.
uint32_t GetMetric() const
Get metric value.
void SetTTL(uint8_t ttl)
Set remaining number of hops allowed for this element.
void SetOriginatorAddress(Mac48Address originator_address)
Set originator address value.
Mac48Address GetOriginatorAddress() const
Get originator address value.
void SetPreqID(uint32_t id)
Set path discovery id field.
void IncrementMetric(uint32_t metric)
Handle Metric:
uint32_t GetLifetime() const
Get lifetime value.
void AddDestinationAddressElement(bool doFlag, bool rfFlag, Mac48Address dest_address, uint32_t dest_seq_number)
Add a destination address unit: flags, destination and sequence number.
bool IsNeedNotPrep() const
Check whether Proactive PREP subfield to off.
void SetLifetime(uint32_t lifetime)
Set lifetime in TUs for the forwarding information to be considered valid.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Structure of path error: IePerr and list of receivers: interfaces and MAC address.
std::vector< FailedDestination > destinations
destination list: Mac48Address and sequence number
std::vector< std::pair< uint32_t, Mac48Address > > receivers
list of PathError receivers (in case of unicast PERR)
Packet waiting its routing information.
uint16_t protocol
protocol number
Mac48Address dst
dst address
RouteReplyCallback reply
how to reply
uint32_t inInterface
incoming device interface ID. (if packet has come from upper layers, this is Mesh point ID)
Mac48Address src
src address
Ptr< Packet > pkt
the packet
uint16_t totalDropped
total dropped
void Print(std::ostream &os) const
Print function.
uint16_t initiatedPrep
initiated PREP
uint16_t totalQueued
total queued
uint16_t txBroadcast
transmit broadcast
uint32_t txBytes
transmit bytes
uint16_t txUnicast
transmit unicast
uint16_t initiatedPerr
initiated PERR
uint16_t droppedTtl
dropped TTL
uint16_t initiatedPreq
initiated PREQ
Route lookup result, return type of LookupXXX methods.
uint32_t seqnum
sequence number
Mac48Address retransmitter
retransmitter
Structure to encapsulate route change information.
Time lifetime
lifetime of route
Mac48Address retransmitter
route source
uint32_t seqnum
sequence number of route
uint32_t metric
metric of route
Mac48Address destination
route destination
std::string type
type of change
uint32_t interface
interface index