28 #define NS_LOG_APPEND_CONTEXT \
29 if (m_ipv4) { std::clog << "[node " << m_ipv4->GetObject<Node> ()->GetId () << "] "; }
33 #include "ns3/boolean.h"
34 #include "ns3/random-variable-stream.h"
35 #include "ns3/inet-socket-address.h"
36 #include "ns3/trace-source-accessor.h"
37 #include "ns3/udp-socket-factory.h"
38 #include "ns3/wifi-net-device.h"
39 #include "ns3/adhoc-wifi-mac.h"
40 #include "ns3/string.h"
41 #include "ns3/pointer.h"
91 return sizeof(int32_t);
106 os <<
"DeferredRouteOutputTag: output interface = " <<
m_oif;
122 ActiveRouteTimeout (Seconds (3)),
124 NodeTraversalTime (MilliSeconds (40)),
125 NetTraversalTime (
Time ((2 * NetDiameter) * NodeTraversalTime)),
126 PathDiscoveryTime (
Time (2 * NetTraversalTime)),
127 MyRouteTimeout (
Time (2 * std::max (PathDiscoveryTime, ActiveRouteTimeout))),
128 HelloInterval (Seconds (1)),
129 AllowedHelloLoss (2),
130 DeletePeriod (
Time (5 * std::max (ActiveRouteTimeout, HelloInterval))),
131 NextHopWait (NodeTraversalTime + MilliSeconds (10)),
132 BlackListTimeout (
Time (RreqRetries * NetTraversalTime)),
134 MaxQueueTime (Seconds (30)),
135 DestinationOnly (false),
136 GratuitousReply (true),
138 m_routingTable (DeletePeriod),
139 m_queue (MaxQueueLen, MaxQueueTime),
142 m_rreqIdCache (PathDiscoveryTime),
143 m_dpd (PathDiscoveryTime),
144 m_nb (HelloInterval),
147 m_htimer (
Timer::CANCEL_ON_DESTROY),
148 m_rreqRateLimitTimer (
Timer::CANCEL_ON_DESTROY),
149 m_rerrRateLimitTimer (
Timer::CANCEL_ON_DESTROY),
150 m_lastBcastTime (Seconds (0))
158 static TypeId tid =
TypeId (
"ns3::aodv::RoutingProtocol")
160 .AddConstructor<RoutingProtocol> ()
161 .AddAttribute (
"HelloInterval",
"HELLO messages emission interval.",
165 .AddAttribute (
"RreqRetries",
"Maximum number of retransmissions of RREQ to discover a route",
168 MakeUintegerChecker<uint32_t> ())
169 .AddAttribute (
"RreqRateLimit",
"Maximum number of RREQ per second.",
172 MakeUintegerChecker<uint32_t> ())
173 .AddAttribute (
"RerrRateLimit",
"Maximum number of RERR per second.",
176 MakeUintegerChecker<uint32_t> ())
177 .AddAttribute (
"NodeTraversalTime",
"Conservative estimate of the average one hop traversal time for packets and should include "
178 "queuing delays, interrupt processing times and transfer times.",
182 .AddAttribute (
"NextHopWait",
"Period of our waiting for the neighbour's RREP_ACK = 10 ms + NodeTraversalTime",
186 .AddAttribute (
"ActiveRouteTimeout",
"Period of time during which the route is considered to be valid",
190 .AddAttribute (
"MyRouteTimeout",
"Value of lifetime field in RREP generating by this node = 2 * max(ActiveRouteTimeout, PathDiscoveryTime)",
194 .AddAttribute (
"BlackListTimeout",
"Time for which the node is put into the blacklist = RreqRetries * NetTraversalTime",
198 .AddAttribute (
"DeletePeriod",
"DeletePeriod is intended to provide an upper bound on the time for which an upstream node A "
199 "can have a neighbor B as an active next hop for destination D, while B has invalidated the route to D."
200 " = 5 * max (HelloInterval, ActiveRouteTimeout)",
204 .AddAttribute (
"NetDiameter",
"Net diameter measures the maximum possible number of hops between two nodes in the network",
207 MakeUintegerChecker<uint32_t> ())
208 .AddAttribute (
"NetTraversalTime",
"Estimate of the average net traversal time = 2 * NodeTraversalTime * NetDiameter",
212 .AddAttribute (
"PathDiscoveryTime",
"Estimate of maximum time needed to find route in network = 2 * NetTraversalTime",
216 .AddAttribute (
"MaxQueueLen",
"Maximum number of packets that we allow a routing protocol to buffer.",
220 MakeUintegerChecker<uint32_t> ())
221 .AddAttribute (
"MaxQueueTime",
"Maximum time packets can be queued (in seconds)",
226 .AddAttribute (
"AllowedHelloLoss",
"Number of hello messages which may be loss for valid link.",
229 MakeUintegerChecker<uint16_t> ())
230 .AddAttribute (
"GratuitousReply",
"Indicates whether a gratuitous RREP should be unicast to the node originated route discovery.",
234 MakeBooleanChecker ())
235 .AddAttribute (
"DestinationOnly",
"Indicates only the destination may respond to this RREQ.",
239 MakeBooleanChecker ())
240 .AddAttribute (
"EnableHello",
"Indicates whether a hello messages enable.",
244 MakeBooleanChecker ())
245 .AddAttribute (
"EnableBroadcast",
"Indicates whether a broadcast data packets forwarding enable.",
249 MakeBooleanChecker ())
250 .AddAttribute (
"UniformRv",
251 "Access to the underlying UniformRandomVariable",
254 MakePointerChecker<UniformRandomVariable> ())
283 iter->first->Close ();
362 uint32_t iif = (oif ?
m_ipv4->GetInterfaceForDevice (oif) : -1);
386 if(!result || ((rt.GetFlag () !=
IN_SEARCH) && result))
409 int32_t iif =
m_ipv4->GetInterfaceForDevice (idev);
445 NS_LOG_DEBUG (
"Duplicated packet " << p->
GetUid () <<
" from " << origin <<
". Drop.");
450 if (lcb.
IsNull () ==
false)
453 lcb (p, header, iif);
458 NS_LOG_ERROR (
"Unable to deliver packet locally due to null callback " << p->
GetUid () <<
" from " << origin);
472 ucb (route, packet, header);
488 if (
m_ipv4->IsDestinationAddress (dst, iif))
497 if (lcb.
IsNull () ==
false)
500 lcb (p, header, iif);
504 NS_LOG_ERROR (
"Unable to deliver packet locally due to null callback " << p->
GetUid () <<
" from " << origin);
551 ucb (route, p, header);
564 NS_LOG_LOGIC (
"route not found to "<< dst <<
". Send RERR message.");
603 if (l3->GetNAddresses (i) > 1)
605 NS_LOG_WARN (
"AODV does not work with more then one address per each interface.");
654 mac->TraceDisconnectWithoutContext (
"TxErrHeader",
679 NS_LOG_FUNCTION (
this <<
" interface " << i <<
" address " << address);
683 if (l3->GetNAddresses (i) == 1)
713 NS_LOG_LOGIC (
"AODV does not work with more then one address per each interface. Ignore added address");
727 if (l3->GetNAddresses (i))
757 NS_LOG_LOGIC (
"Remove address not participating in AODV operation");
807 int32_t
interface =
m_ipv4->GetInterfaceForAddress (addr);
808 if (oif ==
m_ipv4->GetNetDevice (static_cast<uint32_t> (interface)))
941 NS_LOG_DEBUG (
"AODV node " <<
this <<
" received a AODV packet from " << sender <<
" to " << receiver);
948 NS_LOG_DEBUG (
"AODV message " << packet->
GetUid () <<
" with unknown type received: " << tHeader.
Get () <<
". Drop");
951 switch (tHeader.
Get ())
998 NS_LOG_FUNCTION (
this <<
"sender " << sender <<
" receiver " << receiver);
1004 m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
1018 m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
1044 uint32_t
id = rreqHeader.
GetId ();
1076 m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0), hop,
1104 NS_LOG_DEBUG (
"Neighbor:" << src <<
" not found in routing table. Creating an entry");
1107 m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
1124 <<
" ID " << rreqHeader.
GetId ()
1125 <<
" to destination " << rreqHeader.
GetDst ());
1132 NS_LOG_DEBUG (
"Send reply since I am the destination");
1212 packet->AddHeader (tHeader);
1227 if (toDst.
GetHop () == 1)
1258 packetToDst->AddHeader (type);
1313 m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0), hop,
1322 if (!toDst.GetValidSeqNo ())
1327 else if ((int32_t (rrepHeader.
GetDstSeqno ()) - int32_t (toDst.GetSeqNo ())) > 0)
1334 if ((rrepHeader.
GetDstSeqno () == toDst.GetSeqNo ()) && (toDst.GetFlag () !=
VALID))
1339 else if ((rrepHeader.
GetDstSeqno () == toDst.GetSeqNo ()) && (hop < toDst.GetHop ()))
1382 toDst.InsertPrecursor (toOrigin.
GetNextHop ());
1435 m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
1443 toNeighbor.SetValidSeqNo (
true);
1444 toNeighbor.SetFlag (
VALID);
1445 toNeighbor.SetOutputDevice (
m_ipv4->GetNetDevice (
m_ipv4->GetInterfaceForAddress (receiver)));
1446 toNeighbor.SetInterface (
m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0));
1461 std::map<Ipv4Address, uint32_t> dstWithNextHopSrc;
1462 std::map<Ipv4Address, uint32_t> unreachable;
1464 std::pair<Ipv4Address, uint32_t> un;
1467 for (std::map<Ipv4Address, uint32_t>::const_iterator i =
1468 dstWithNextHopSrc.begin (); i != dstWithNextHopSrc.end (); ++i)
1470 if (i->first == un.first)
1472 unreachable.insert (un);
1477 std::vector<Ipv4Address> precursors;
1478 for (std::map<Ipv4Address, uint32_t>::const_iterator i = unreachable.begin ();
1479 i != unreachable.end ();)
1488 rerrHeader.
Clear ();
1527 NS_LOG_LOGIC (
"route discovery to " << dst <<
" has been attempted RreqRetries (" <<
RreqRetries <<
") times");
1530 NS_LOG_DEBUG (
"Route not found. Drop all packets with dst " << dst);
1542 NS_LOG_DEBUG (
"Route down. Stop search. Drop packet with destination " << dst);
1611 packet->AddHeader (tHeader);
1640 NS_LOG_DEBUG (
"Output device doesn't match. Dropped.");
1647 ucb (route, p, header);
1656 std::vector<Ipv4Address> precursors;
1657 std::map<Ipv4Address, uint32_t> unreachable;
1665 for (std::map<Ipv4Address, uint32_t>::const_iterator i = unreachable.begin (); i
1666 != unreachable.end ();)
1676 rerrHeader.
Clear ();
1694 unreachable.insert (std::make_pair (nextHop, toNextHop.
GetSeqNo ()));
1711 <<
"; suppressing RERR");
1725 NS_LOG_LOGIC (
"Unicast RERR to the source of the data transmission");
1757 if (precursors.empty ())
1770 <<
"; suppressing RERR");
1774 if (precursors.size () == 1)
1789 std::vector<Ipv4InterfaceAddress> ifaces;
1791 for (std::vector<Ipv4Address>::const_iterator i = precursors.begin (); i != precursors.end (); ++i)
1794 std::find (ifaces.begin (), ifaces.end (), toPrecursor.
GetInterface ()) == ifaces.end ())
1800 for (std::vector<Ipv4InterfaceAddress>::const_iterator i = ifaces.begin (); i != ifaces.end (); ++i)
1804 NS_LOG_LOGIC (
"Broadcast RERR message from interface " << i->GetLocal ());
1813 destination = i->GetBroadcast ();
UnicastForwardCallback GetUnicastForwardCallback() const
uint32_t RemoveHeader(Header &header)
static TypeId GetTypeId(void)
void SendReplyAck(Ipv4Address neighbor)
Send RREP_ACK.
static Ipv4Mask GetOnes(void)
void InvalidateRoutesWithDst(std::map< Ipv4Address, uint32_t > const &unreachable)
keep track of time values and allow control of global simulation resolution
NS_OBJECT_ENSURE_REGISTERED(TypeHeader)
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
Ipv4Address GetIpv4(void) const
static Ipv4Address GetAny(void)
void SetOutputDevice(Ptr< NetDevice > dev)
RREP_ACK timer.
#define NS_LOG_FUNCTION(parameters)
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
uint16_t m_rreqCount
Number of RREQs used for RREQ rate control.
Ipv4Mask GetMask(void) const
Time MaxQueueTime
The maximum period of time that a routing protocol is allowed to buffer a packet for.
bool LookupRoute(Ipv4Address dst, RoutingTableEntry &rt)
void Clear()
Delete all entries from routing table.
void SendTo(Ptr< Socket > socket, Ptr< Packet > packet, Ipv4Address destination)
RoutingTable m_routingTable
Routing table.
Ipv4Header GetIpv4Header() const
Ipv4Address GetLocal(void) const
bool GetBroadcastEnable() const
hold variables of type string
virtual bool SetAllowBroadcast(bool allowBroadcast)=0
Configure whether broadcast datagram transmissions are allowed.
void SetDesinationOnlyFlag(bool f)
a class to represent an Ipv4 address mask
Tag used by AODV implementation.
void AddPacketTag(const Tag &tag) const
uint32_t MaxQueueLen
The maximum number of packets that we allow a routing protocol to buffer.
Ptr< Ipv4 > m_ipv4
IP protocol.
bool Update(RoutingTableEntry &rt)
Update routing table.
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream) const
Print the Routing Table entries.
uint64_t GetUid(void) const
Timer m_ackTimer
RREP_ACK timer.
void IncrementRreqCnt()
RREP_ACK timer.
bool Forwarding(Ptr< const Packet > p, const Ipv4Header &header, UnicastForwardCallback ucb, ErrorCallback ecb)
If route exists and valid, forward packet.
void SetMaxQueueLen(uint32_t len)
#define NS_ASSERT(condition)
void DelArpCache(Ptr< ArpCache >)
Don't use given ARP cache any more (interface is down)
void SendHello()
Send hello.
#define NS_LOG_COMPONENT_DEFINE(name)
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)
int64_t AssignStreams(int64_t stream)
void SetMaxQueueLen(uint32_t len)
Timer m_rreqRateLimitTimer
RREQ rate limit timer.
bool IsMulticast(void) const
virtual void DoDispose(void)
Ptr< NetDevice > GetOutputDevice() const
RREP_ACK timer.
Time NetTraversalTime
Estimate of the average net traversal time.
Neighbors m_nb
Handle neighbors.
void GetPrecursors(std::vector< Ipv4Address > &prec) const
void SetGratuitousReplyFlag(bool f)
TAG_BUFFER_INLINE uint32_t ReadU32(void)
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
void SetLifeTime(Time lt)
RREP_ACK timer.
uint32_t RreqRetries
Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route.
Time m_lastBcastTime
Keep track of the last bcast time.
RequestQueue m_queue
A "drop-front" queue used by the routing layer to buffer packets to which it does not have a route...
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue...
uint32_t m_seqNo
Request sequence number.
void SetInterface(int32_t oif)
void ScheduleRreqRetry(Ipv4Address dst)
Ptr< Socket > FindSocketWithInterfaceAddress(Ipv4InterfaceAddress iface) const
Find socket with local interface address iface.
a polymophic address class
bool IsRunning(void) const
Ptr< Ipv4Route > LoopbackRoute(const Ipv4Header &header, Ptr< NetDevice > oif) const
Create loopback route for given header.
void SetSource(Ipv4Address src)
void RecvAodv(Ptr< Socket > socket)
Receive and process control packet.
virtual void SetIpv4(Ptr< Ipv4 > ipv4)
Ptr< NetDevice > GetOutputDevice(void) const
bool InsertPrecursor(Ipv4Address id)
double GetSeconds(void) const
void Print(Ptr< OutputStreamWrapper > stream) const
Print routing table.
Time GetLifeTime() const
RREP_ACK timer.
bool DestinationOnly
Indicates only the destination may respond to this RREQ.
void SetRreqCnt(uint8_t n)
RREP_ACK timer.
void RecvReplyAck(Ipv4Address neighbor)
Receive RREP_ACK.
bool PeekPacketTag(Tag &tag) const
bool IsDuplicate(Ptr< const Packet > p, const Ipv4Header &header)
Check that the packet is duplicated. If not, save information about this packet.
void SendPacketFromQueue(Ipv4Address dst, Ptr< Ipv4Route > route)
Forward packet from route request queue.
void DeferredRouteOutput(Ptr< const Packet > p, const Ipv4Header &header, UnicastForwardCallback ucb, ErrorCallback ecb)
Queue packet and send route request.
bool IsMyOwnAddress(Ipv4Address src)
Check that packet is send from own interface.
bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)
Route an input packet (to be forwarded or locally delivered)
void RecvReply(Ptr< Packet > p, Ipv4Address my, Ipv4Address src)
Receive RREP.
void DeleteAllRoutesFromInterface(Ipv4InterfaceAddress iface)
Delete all route from interface with address iface.
void HelloTimerExpire()
Schedule next send of hello message.
hold objects of type ns3::Time
Ipv4Address GetNextHop() const
RREP_ACK timer.
void SetGateway(Ipv4Address gw)
bool UpdateRouteLifeTime(Ipv4Address addr, Time lt)
Hold an unsigned integer type.
void UpdateRouteToNeighbor(Ipv4Address sender, Ipv4Address receiver)
TAG_BUFFER_INLINE void WriteU32(uint32_t v)
bool GetDesinationOnlyFlag() const
bool IsBroadcast(void) const
void SetSeqNo(uint32_t sn)
RREP_ACK timer.
uint16_t RreqRateLimit
Maximum number of RREQ per second.
void SetValidSeqNo(bool s)
RREP_ACK timer.
int32_t m_oif
Positive if output device is fixed in RouteOutput.
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)
Hold together all Wifi-related objects.This class holds together ns3::WifiChannel, ns3::WifiPhy, ns3::WifiMac, and, ns3::WifiRemoteStationManager.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
static TypeId GetTypeId(void)
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read.
Time GetMaxQueueTime() const
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
void SendReplyByIntermediateNode(RoutingTableEntry &toDst, RoutingTableEntry &toOrigin, bool gratRep)
Ipv4Address GetSource(void) const
void AddArpCache(Ptr< ArpCache >)
Add ARP cache to be used to allow layer 2 notifications processing.
Ptr< const Packet > GetPacket() const
Ipv4InterfaceAddress GetInterface() const
RREP_ACK timer.
Callback< void, WifiMacHeader const & > GetTxErrorCallback() const
Get callback to ProcessTxError.
void SetDelay(const Time &delay)
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
#define NS_LOG_LOGIC(msg)
uint16_t m_rerrCount
Number of RERRs used for RERR rate control.
Ipv4Address GetGateway(void) const
void SetMaxQueueTime(Time t)
void GetListOfDestinationWithNextHop(Ipv4Address nextHop, std::map< Ipv4Address, uint32_t > &unreachable)
Lookup routing entries with next hop Address dst and not empty list of precursors.
bool GetHelloEnable() const
void SetInterface(Ipv4InterfaceAddress iface)
RREP_ACK timer.
Ptr< Packet > Copy(void) const
void SendRerrWhenNoRouteToForward(Ipv4Address dst, uint32_t dstSeqNo, Ipv4Address origin)
tag a set of bytes in a packet
void Clear()
Remove all entries.
void SendRerrWhenBreaksLinkToNextHop(Ipv4Address nextHop)
Initiate RERR.
Implement the Ipv4 layer.
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
static InetSocketAddress ConvertFrom(const Address &address)
void SetFlag(RouteFlags flag)
RREP_ACK timer.
bool GetGratuitousReplyFlag() const
uint16_t GetHop() const
RREP_ACK timer.
Time ActiveRouteTimeout
Period of time during which the route is considered to be valid.
void RecvRequest(Ptr< Packet > p, Ipv4Address receiver, Ipv4Address src)
Receive RREQ.
std::map< Ptr< Socket >, Ipv4InterfaceAddress > m_socketAddresses
Raw socket per each IP interface, map socket -> iface address (IP + mask)
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
uint32_t GetSerializedSize() const
void Update(Ipv4Address addr, Time expire)
Update expire time for entry with address addr, if it exists, else add new entry. ...
void SetOutputDevice(Ptr< NetDevice > outputDevice)
void ProcessHello(RrepHeader const &rrepHeader, Ipv4Address receiverIfaceAddr)
Process hello message.
static Ipv4Address GetLoopback(void)
virtual void NotifyInterfaceUp(uint32_t interface)
DuplicatePacketDetection m_dpd
Handle duplicated broadcast/multicast packets.
int32_t GetInterface() const
bool EnableBroadcast
Indicates whether a a broadcast data packets forwarding enable.
virtual void BindToNetDevice(Ptr< NetDevice > netdevice)
Bind a socket to specific device.
void RecvError(Ptr< Packet > p, Ipv4Address src)
Receive RERR from node with address src.
void RreqRateLimitTimerExpire()
Reset RREQ count and schedule RREQ rate limit timer with delay 1 sec.
#define NS_ASSERT_MSG(condition, message)
void Serialize(TagBuffer i) const
Time PathDiscoveryTime
Estimate of maximum time needed to find route in network.
Ipv4Address GetDestination(void) const
Time BlackListTimeout
Time for which the node is put into the blacklist.
void SetHop(uint16_t hop)
RREP_ACK timer.
Ipv4 addresses are stored in host order in this class.
Time NextHopWait
Period of our waiting for the neighbour's RREP_ACK.
Ipv4Address GetBroadcast(void) const
virtual void NotifyInterfaceDown(uint32_t interface)
virtual ~RoutingProtocol()
Time MyRouteTimeout
Value of lifetime field in RREP generating by this node.
a class to store IPv4 address information on an interface
uint32_t GetSeqNo() const
RREP_ACK timer.
void SetQueueTimeout(Time t)
bool AddRoute(RoutingTableEntry &r)
bool RemovePacketTag(Tag &tag)
#define NS_LOG_DEBUG(msg)
uint32_t AllowedHelloLoss
Number of hello messages which may be loss for valid link.
void SendRerrMessage(Ptr< Packet > packet, std::vector< Ipv4Address > precursors)
Forward RERR.
bool IsDuplicate(Ipv4Address addr, uint32_t id)
Check that entry (addr, id) exists in cache. Add entry, if it doesn't exist.
void SetCallback(Callback< void, Ipv4Address > cb)
void Print(std::ostream &os) const
void SendReply(RreqHeader const &rreqHeader, RoutingTableEntry const &toOrigin)
Send RREP.
Abstract base class for IPv4 routing protocols.
void SetNextHop(Ipv4Address nextHop)
RREP_ACK timer.
uint32_t NetDiameter
Net diameter measures the maximum possible number of hops between two nodes in the network...
Timer m_rerrRateLimitTimer
RERR rate limit timer.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. Both limits are inclusive.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
void AckTimerExpire(Ipv4Address neighbor, Time blacklistTimeout)
Mark link to neighbor node as unidirectional for blacklistTimeout.
std::map< Ipv4Address, Timer > m_addressReqTimer
Map IP address + RREQ timer.
Ptr< Ipv4Route > GetRoute() const
RREP_ACK timer.
bool GratuitousReply
Indicates whether a gratuitous RREP should be unicast to the node originated route discovery...
#define NS_LOG_ERROR(msg)
uint16_t RerrRateLimit
Maximum number of REER per second.
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables.
void SendRequest(Ipv4Address dst)
Send RREQ.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.
void RerrRateLimitTimerExpire()
Reset RERR count and schedule RERR rate limit timer with delay 1 sec.
virtual Ptr< Packet > RecvFrom(uint32_t maxSize, uint32_t flags, Address &fromAddress)=0
Read a single packet from the socket and retrieve the sender address.
DeferredRouteOutputTag(int32_t o=-1)
IdCache m_rreqIdCache
Handle duplicated RREQ.
void RouteRequestTimerExpire(Ipv4Address dst)
Handle route discovery process.
TypeId GetInstanceTypeId() const
void Start()
Start protocol operation.
void SetHelloEnable(bool f)
virtual int Close(void)=0
Close a socket.
bool LookupValidRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup route in VALID state.
Time GetDelayLeft(void) const
static TypeId GetTypeId()
void SetAttribute(std::string name, const AttributeValue &value)
bool IsUnidirectional() const
RREP_ACK timer.
void SetBroadcastEnable(bool f)
bool DeleteRoute(Ipv4Address dst)
void Purge()
Delete all outdated entries and invalidate valid entry if Lifetime is expired.
a unique identifier for an interface.
Timer m_htimer
Hello timer.
Ptr< NetDevice > m_lo
Loopback device used to defer RREQ until packet will be fully formed.
RouteFlags GetFlag() const
RREP_ACK timer.
void Deserialize(TagBuffer i)
uint32_t m_requestId
Broadcast ID.
Ipv4Address GetDestination() const
RREP_ACK timer.
TypeId SetParent(TypeId tid)
Ptr< Ipv4Route > RouteOutput(Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)
Query routing cache for an existing route, for an outbound packet.
uint8_t GetRreqCnt() const
RREP_ACK timer.
static Time GetMaximumSimulationTime(void)
std::ostream * GetStream(void)
uint32_t GetMaxQueueLen() const
void AddHeader(const Header &header)
void SetDestination(Ipv4Address dest)
void ScheduleTimer()
Schedule m_ntimer.
bool GetValidSeqNo() const
RREP_ACK timer.
static const uint32_t AODV_PORT
UDP Port for AODV control traffic.
bool EnableHello
Indicates whether a hello messages enable.