31#include "ns3/mesh-point-device.h"
32#include "ns3/mesh-wifi-interface-mac.h"
33#include "ns3/packet.h"
34#include "ns3/pointer.h"
35#include "ns3/random-variable-stream.h"
36#include "ns3/simulator.h"
37#include "ns3/string.h"
38#include "ns3/trace-source-accessor.h"
39#include "ns3/wifi-net-device.h"
55 TypeId(
"ns3::dot11s::HwmpProtocol")
59 .AddAttribute(
"RandomStart",
60 "Random delay at first proactive PREQ",
64 .AddAttribute(
"MaxQueueSize",
65 "Maximum number of packets we can store when resolving route",
68 MakeUintegerChecker<uint16_t>(1))
70 "Dot11MeshHWMPmaxPREQretries",
71 "Maximum number of retries before we suppose the destination to be unreachable",
74 MakeUintegerChecker<uint8_t>(1))
76 "Dot11MeshHWMPnetDiameterTraversalTime",
77 "Time we suppose the packet to go from one edge of the network to another",
81 .AddAttribute(
"Dot11MeshHWMPpreqMinInterval",
82 "Minimal interval between to successive PREQs",
86 .AddAttribute(
"Dot11MeshHWMPperrMinInterval",
87 "Minimal interval between to successive PREQs",
91 .AddAttribute(
"Dot11MeshHWMPactiveRootTimeout",
92 "Lifetime of proactive routing information",
96 .AddAttribute(
"Dot11MeshHWMPactivePathTimeout",
97 "Lifetime of reactive routing information",
101 .AddAttribute(
"Dot11MeshHWMPpathToRootInterval",
102 "Interval between two successive proactive PREQs",
106 .AddAttribute(
"Dot11MeshHWMPrannInterval",
107 "Lifetime of proactive routing information",
111 .AddAttribute(
"MaxTtl",
112 "Initial value of Time To Live field",
115 MakeUintegerChecker<uint8_t>(2))
117 "UnicastPerrThreshold",
118 "Maximum number of PERR receivers, when we send a PERR as a chain of unicasts",
121 MakeUintegerChecker<uint8_t>(1))
123 "UnicastPreqThreshold",
124 "Maximum number of PREQ receivers, when we send a PREQ as a chain of unicasts",
127 MakeUintegerChecker<uint8_t>(1))
128 .AddAttribute(
"UnicastDataThreshold",
129 "Maximum number of broadcast receivers, when we send a broadcast as a "
133 MakeUintegerChecker<uint8_t>(1))
134 .AddAttribute(
"DoFlag",
135 "Destination only HWMP flag",
139 .AddAttribute(
"RfFlag",
140 "Reply and forward flag",
144 .AddTraceSource(
"RouteDiscoveryTime",
145 "The time of route discovery procedure",
147 "ns3::Time::TracedCallback")
148 .AddTraceSource(
"RouteChange",
149 "Routing table changed",
151 "ns3::HwmpProtocol::RouteChangeTracedCallback");
162 m_dot11MeshHWMPmaxPREQretries(3),
163 m_dot11MeshHWMPnetDiameterTraversalTime(
MicroSeconds(1024 * 100)),
164 m_dot11MeshHWMPpreqMinInterval(
MicroSeconds(1024 * 100)),
165 m_dot11MeshHWMPperrMinInterval(
MicroSeconds(1024 * 100)),
166 m_dot11MeshHWMPactiveRootTimeout(
MicroSeconds(1024 * 5000)),
167 m_dot11MeshHWMPactivePathTimeout(
MicroSeconds(1024 * 5000)),
168 m_dot11MeshHWMPpathToRootInterval(
MicroSeconds(1024 * 2000)),
172 m_unicastPerrThreshold(32),
173 m_unicastPreqThreshold(1),
174 m_unicastDataThreshold(1),
204 for (std::map<Mac48Address, PreqEvent>::iterator i =
m_preqTimeouts.begin();
208 i->second.preqTimeout.Cancel();
225 uint16_t protocolType,
228 NS_LOG_FUNCTION(
this << sourceIface << source << destination << constPacket << protocolType);
234 if (packet->PeekPacketTag(tag))
237 "HWMP tag has come with a packet from upper layer. This must not occur...");
248 if (!packet->RemovePacketTag(tag))
265 std::vector<uint16_t> channels;
266 for (HwmpProtocolMacMap::const_iterator plugin =
m_interfaces.begin();
270 bool shouldSend =
true;
271 for (std::vector<uint16_t>::const_iterator chan = channels.begin();
272 chan != channels.end();
275 if ((*chan) == plugin->second->GetChannelId())
284 channels.push_back(plugin->second->GetChannelId());
286 for (std::vector<Mac48Address>::const_iterator i = receivers.begin();
287 i != receivers.end();
297 packetCopy->AddPacketTag(tag);
298 NS_LOG_DEBUG(
"Sending route reply for broadcast; address " << address);
299 routeReply(
true, packetCopy, source, destination, protocolType, plugin->first);
321 uint16_t& protocolType)
324 if (!packet->RemovePacketTag(tag))
326 NS_FATAL_ERROR(
"HWMP tag must exist when packet received from the network");
336 uint16_t protocolType,
340 NS_LOG_FUNCTION(
this << sourceIface << source << destination << packet << protocolType << ttl);
343 NS_LOG_DEBUG(
"Requested src = " << source <<
", dst = " << destination <<
", I am "
353 packet->AddPacketTag(tag);
357 routeReply(
true, packet, source, destination, protocolType, result.
ifIndex);
375 NS_LOG_DEBUG(
"Path error, lookup expired proactive path");
380 NS_LOG_DEBUG(
"Path error, initiate reactive path error");
381 std::vector<FailedDestination> destinations =
396 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
421 <<
" due to queue overflow");
436 std::map<Mac48Address, std::pair<uint32_t, uint32_t>>::const_iterator i =
438 bool freshInfo(
true);
448 if (i->second.second <= preq.
GetMetric())
457 <<
", preq:" << preq);
473 rChange.
type =
"Add Reactive";
494 rChange.
type =
"Add Reactive";
505 i != destinations.end();
515 NS_ASSERT(((*i)->IsDo()) && ((*i)->IsRf()));
529 rChange.
type =
"Add Proactive";
552 if ((*i)->GetDestinationAddress() ==
GetAddress())
573 if ((lifetime > 0) && ((
int32_t)(result.
seqnum - (*i)->GetDestSeqNumber()) >= 0))
575 SendPrep((*i)->GetDestinationAddress(),
589 (*i)->SetFlags(
true,
false, (*i)->IsUsn());
609 NS_LOG_DEBUG(
"Forwarding PREQ from " << from <<
" with delay "
625 std::map<Mac48Address, std::pair<uint32_t, uint32_t>>::const_iterator i =
627 bool freshInfo(
true);
631 if ((
int32_t)(i->second.first - sequence) > 0)
635 if (i->second.first == sequence)
641 std::make_pair(sequence, prep.
GetMetric());
645 <<
", receiver was:" << from);
662 rChange.
type =
"Add Reactive";
668 rChange.
seqnum = sequence;
694 rChange.
type =
"Add Reactive";
700 rChange.
seqnum = sequence;
734 std::vector<FailedDestination> retval;
736 for (
unsigned int i = 0; i < destinations.size(); i++)
742 retval.push_back(destinations[i]);
771 HwmpProtocolMacMap::const_iterator prep_sender =
m_interfaces.find(interface);
773 prep_sender->second->SendPrep(prep, retransmitter);
782 std::vector<Ptr<NetDevice>> interfaces = mp->GetInterfaces();
783 for (std::vector<
Ptr<NetDevice>>::const_iterator i = interfaces.begin(); i != interfaces.end();
800 mac->InstallPlugin(hwmpMac);
803 mac->SetLinkMetricCallback(
806 mp->SetRoutingProtocol(
this);
808 mp->AggregateObject(
this);
819 NS_LOG_FUNCTION(
this << meshPointAddress << peerAddress << interface << status);
825 NS_LOG_DEBUG(destinations.size() <<
" failed destinations for peer address " << peerAddress);
841 NS_LOG_DEBUG(
"Dropping seqno " << seqno <<
"; from self");
844 std::map<Mac48Address, uint32_t, std::less<Mac48Address>>::const_iterator i =
852 if ((
int32_t)(i->second - seqno) >= 0)
854 NS_LOG_DEBUG(
"Dropping seqno " << seqno <<
"; stale frame");
874 for (
unsigned int i = 0; i < destinations.size(); i++)
880 rChange.
type =
"Delete Reactive";
882 rChange.
seqnum = destinations[i].seqnum;
894 std::vector<Mac48Address> receivers_for_interface;
895 for (
unsigned int j = 0; j < perr.
receivers.size(); j++)
899 receivers_for_interface.push_back(perr.
receivers[j].second);
902 i->second->InitiatePerr(perr.
destinations, receivers_for_interface);
912 std::vector<Mac48Address> receivers_for_interface;
913 for (
unsigned int j = 0; j < perr.
receivers.size(); j++)
917 receivers_for_interface.push_back(perr.
receivers[j].second);
926 receivers_for_interface);
927 i->second->ForwardPerr(perr.
destinations, receivers_for_interface);
931std::vector<std::pair<uint32_t, Mac48Address>>
936 for (
unsigned int i = 0; i < failedDest.size(); i++)
942 rChange.
type =
"Delete Reactive";
944 rChange.
seqnum = failedDest[i].seqnum;
949 rChangePro.
type =
"Delete Proactive";
950 rChangePro.
destination = failedDest[i].destination;
951 rChangePro.
seqnum = failedDest[i].seqnum;
953 for (
unsigned int j = 0; j < precursors.size(); j++)
955 retval.push_back(precursors[j]);
959 for (
unsigned int i = 0; i < retval.size(); i++)
961 for (
unsigned int j = i + 1; j < retval.size(); j++)
965 retval.erase(retval.begin() + j);
972std::vector<Mac48Address>
976 std::vector<Mac48Address> retval;
989std::vector<Mac48Address>
993 std::vector<Mac48Address> retval;
1023 retval.
pkt =
nullptr;
1024 for (std::vector<QueuedPacket>::iterator i =
m_rqueue.begin(); i !=
m_rqueue.end(); i++)
1026 if ((*i).dst == dst)
1041 retval.
pkt =
nullptr;
1054 std::map<Mac48Address, PreqEvent>::iterator i =
m_preqTimeouts.find(dst);
1109 std::map<Mac48Address, PreqEvent>::const_iterator i =
m_preqTimeouts.find(dst);
1135 std::map<Mac48Address, PreqEvent>::iterator i =
m_preqTimeouts.find(dst);
1155 std::map<Mac48Address, PreqEvent>::iterator i =
m_preqTimeouts.find(dst);
1166 i->second->RequestDestination(dst, originator_seqno, dst_seqno);
1209 i->second->SendPreq(preq);
1295 os <<
"<Statistics "
1321 << initiatedPerr <<
"\"/>" << std::endl;
1333 <<
"Dot11MeshHWMPnetDiameterTraversalTime=\""
1340 <<
"\"" << std::endl
1342 <<
"\"" << std::endl
1344 <<
"\"" << std::endl
1347 <<
"isRoot=\"" <<
m_isRoot <<
"\"" << std::endl
1348 <<
"maxTtl=\"" << (uint16_t)
m_maxTtl <<
"\"" << std::endl
1352 <<
"doFlag=\"" <<
m_doFlag <<
"\"" << std::endl
1353 <<
"rfFlag=\"" <<
m_rfFlag <<
"\">" << std::endl;
1355 for (HwmpProtocolMacMap::const_iterator plugin =
m_interfaces.begin();
1359 plugin->second->Report(os);
1361 os <<
"</Hwmp>" << std::endl;
1369 for (HwmpProtocolMacMap::const_iterator plugin =
m_interfaces.begin();
1373 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()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
static Mac48Address ConvertFrom(const Address &address)
static Mac48Address GetBroadcast()
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.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Smart pointer class similar to boost::intrusive_ptr.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now()
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated 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.
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.
void PeerLinkStatus(Mac48Address meshPointAddress, Mac48Address peerAddress, uint32_t interface, bool status)
Peer link status function.
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.
TracedCallback< RouteChange > m_routeChangeTraceSource
Route change trace source.
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.
Ptr< HwmpRtable > GetRoutingTable() const
Get pointer to HWMP routing table.
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.
uint8_t GetMaxTtl() const
Get maximum TTL function.
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.
bool GetDoFlag() const
Get do flag function.
TracedCallback< Time > m_routeDiscoveryTimeCallback
Route discovery time:
static TypeId GetTypeId()
Get the type ID.
bool ShouldSendPreq(Mac48Address dst)
checks when the last path discovery procedure was started for a given destination.
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 RequestRoute(uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, Ptr< const Packet > packet, uint16_t protocolType, RouteReplyCallback routeReply) override
Route request, inherited from MeshL2RoutingProtocol.
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.
void SendProactivePreq()
Proactive Preq routines:
void ForwardPathError(PathError perr)
Forwards a received path error.
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 RemoveRoutingStuff(uint32_t fromIface, const Mac48Address source, const Mac48Address destination, Ptr< Packet > packet, uint16_t &protocolType) override
Clean HWMP packet tag from packet; only the packet parameter is used.
bool m_doFlag
Destination only HWMP flag.
Mac48Address m_address
address
void DoInitialize() override
Initialize() implementation.
Time m_dot11MeshHWMPactiveRootTimeout
Lifetime of proactive routing information.
void DoDispose() override
Destructor implementation.
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 GetUnicastPerrThreshold() const
Get unicast PERR threshold 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 GetRfFlag() const
Get rf flag function.
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
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.
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
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() const
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 number 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 AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
#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.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), 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.
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
uint32_t ifIndex
IF index.
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