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/udp-l4-protocol.h" 
   39 #include "ns3/udp-header.h" 
   40 #include "ns3/wifi-net-device.h" 
   41 #include "ns3/adhoc-wifi-mac.h" 
   42 #include "ns3/string.h" 
   43 #include "ns3/pointer.h" 
   70     static TypeId tid = 
TypeId (
"ns3::aodv::DeferredRouteOutputTag")
 
   95     return sizeof(int32_t);
 
  110     os << 
"DeferredRouteOutputTag: output interface = " << 
m_oif;
 
  128   m_rreqRateLimit (10),
 
  129   m_rerrRateLimit (10),
 
  130   m_activeRouteTimeout (
Seconds (3)),
 
  133   m_netTraversalTime (
Time ((2 * m_netDiameter) * m_nodeTraversalTime)),
 
  134   m_pathDiscoveryTime ( 
Time (2 * m_netTraversalTime)),
 
  135   m_myRouteTimeout (
Time (2 * 
std::
max (m_pathDiscoveryTime, m_activeRouteTimeout))),
 
  137   m_allowedHelloLoss (2),
 
  138   m_deletePeriod (
Time (5 * 
std::
max (m_activeRouteTimeout, m_helloInterval))),
 
  139   m_nextHopWait (m_nodeTraversalTime + 
MilliSeconds (10)),
 
  140   m_blackListTimeout (
Time (m_rreqRetries * m_netTraversalTime)),
 
  143   m_destinationOnly (false),
 
  144   m_gratuitousReply (true),
 
  145   m_enableHello (false),
 
  146   m_routingTable (m_deletePeriod),
 
  147   m_queue (m_maxQueueLen, m_maxQueueTime),
 
  150   m_rreqIdCache (m_pathDiscoveryTime),
 
  151   m_dpd (m_pathDiscoveryTime),
 
  152   m_nb (m_helloInterval),
 
  155   m_htimer (
Timer::CANCEL_ON_DESTROY),
 
  156   m_rreqRateLimitTimer (
Timer::CANCEL_ON_DESTROY),
 
  157   m_rerrRateLimitTimer (
Timer::CANCEL_ON_DESTROY),
 
  166   static TypeId tid = 
TypeId (
"ns3::aodv::RoutingProtocol")
 
  168     .SetGroupName(
"Aodv")
 
  170     .AddAttribute (
"HelloInterval", 
"HELLO messages emission interval.",
 
  174     .AddAttribute (
"TtlStart", 
"Initial TTL value for RREQ.",
 
  177                    MakeUintegerChecker<uint16_t> ())
 
  178     .AddAttribute (
"TtlIncrement", 
"TTL increment for each attempt using the expanding ring search for RREQ dissemination.",
 
  181                    MakeUintegerChecker<uint16_t> ())
 
  182     .AddAttribute (
"TtlThreshold", 
"Maximum TTL value for expanding ring search, TTL = NetDiameter is used beyond this value.",
 
  185                    MakeUintegerChecker<uint16_t> ())
 
  186     .AddAttribute (
"TimeoutBuffer", 
"Provide a buffer for the timeout.",
 
  189                    MakeUintegerChecker<uint16_t> ())
 
  190     .AddAttribute (
"RreqRetries", 
"Maximum number of retransmissions of RREQ to discover a route",
 
  193                    MakeUintegerChecker<uint32_t> ())
 
  194     .AddAttribute (
"RreqRateLimit", 
"Maximum number of RREQ per second.",
 
  197                    MakeUintegerChecker<uint32_t> ())
 
  198     .AddAttribute (
"RerrRateLimit", 
"Maximum number of RERR per second.",
 
  201                    MakeUintegerChecker<uint32_t> ())
 
  202     .AddAttribute (
"NodeTraversalTime", 
"Conservative estimate of the average one hop traversal time for packets and should include " 
  203                    "queuing delays, interrupt processing times and transfer times.",
 
  207     .AddAttribute (
"NextHopWait", 
"Period of our waiting for the neighbour's RREP_ACK = 10 ms + NodeTraversalTime",
 
  211     .AddAttribute (
"ActiveRouteTimeout", 
"Period of time during which the route is considered to be valid",
 
  215     .AddAttribute (
"MyRouteTimeout", 
"Value of lifetime field in RREP generating by this node = 2 * max(ActiveRouteTimeout, PathDiscoveryTime)",
 
  219     .AddAttribute (
"BlackListTimeout", 
"Time for which the node is put into the blacklist = RreqRetries * NetTraversalTime",
 
  223     .AddAttribute (
"DeletePeriod", 
"DeletePeriod is intended to provide an upper bound on the time for which an upstream node A " 
  224                    "can have a neighbor B as an active next hop for destination D, while B has invalidated the route to D." 
  225                    " = 5 * max (HelloInterval, ActiveRouteTimeout)",
 
  229     .AddAttribute (
"NetDiameter", 
"Net diameter measures the maximum possible number of hops between two nodes in the network",
 
  232                    MakeUintegerChecker<uint32_t> ())
 
  233     .AddAttribute (
"NetTraversalTime", 
"Estimate of the average net traversal time = 2 * NodeTraversalTime * NetDiameter",
 
  237     .AddAttribute (
"PathDiscoveryTime", 
"Estimate of maximum time needed to find route in network = 2 * NetTraversalTime",
 
  241     .AddAttribute (
"MaxQueueLen", 
"Maximum number of packets that we allow a routing protocol to buffer.",
 
  245                    MakeUintegerChecker<uint32_t> ())
 
  246     .AddAttribute (
"MaxQueueTime", 
"Maximum time packets can be queued (in seconds)",
 
  251     .AddAttribute (
"AllowedHelloLoss", 
"Number of hello messages which may be loss for valid link.",
 
  254                    MakeUintegerChecker<uint16_t> ())
 
  255     .AddAttribute (
"GratuitousReply", 
"Indicates whether a gratuitous RREP should be unicast to the node originated route discovery.",
 
  260     .AddAttribute (
"DestinationOnly", 
"Indicates only the destination may respond to this RREQ.",
 
  265     .AddAttribute (
"EnableHello", 
"Indicates whether a hello messages enable.",
 
  270     .AddAttribute (
"EnableBroadcast", 
"Indicates whether a broadcast data packets forwarding enable.",
 
  275     .AddAttribute (
"UniformRv",
 
  276                    "Access to the underlying UniformRandomVariable",
 
  279                    MakePointerChecker<UniformRandomVariable> ())
 
  308       iter->first->Close ();
 
  314       iter->first->Close ();
 
  325                         << 
", Local time: " << GetObject<Node> ()->GetLocalTime ().As (
Time::S)
 
  326                         << 
", AODV Routing table" << std::endl;
 
  398   uint32_t iif = (oif ? 
m_ipv4->GetInterfaceForDevice (oif) : -1);
 
  422       if(!result || ((rt.GetFlag () != 
IN_SEARCH) && result))
 
  445   int32_t iif = 
m_ipv4->GetInterfaceForDevice (idev);
 
  481                 NS_LOG_DEBUG (
"Duplicated packet " << p->
GetUid () << 
" from " << origin << 
". Drop.");
 
  486             if (lcb.
IsNull () == 
false)
 
  489                 lcb (p, header, iif);
 
  494                 NS_LOG_ERROR (
"Unable to deliver packet locally due to null callback " << p->
GetUid () << 
" from " << origin);
 
  518                     ucb (route, packet, header);
 
  534   if (
m_ipv4->IsDestinationAddress (dst, iif))
 
  543       if (lcb.
IsNull () == 
false)
 
  546           lcb (p, header, iif);
 
  550           NS_LOG_ERROR (
"Unable to deliver packet locally due to null callback " << p->
GetUid () << 
" from " << origin);
 
  557   if (
m_ipv4->IsForwarding (iif) == 
false)
 
  559       NS_LOG_LOGIC (
"Forwarding disabled for this interface");
 
  605           ucb (route, p, header);
 
  618   NS_LOG_LOGIC (
"route not found to "<< dst << 
". Send RERR message.");
 
  651   if (l3->GetNAddresses (i) > 1)
 
  653       NS_LOG_WARN (
"AODV does not work with more then one address per each interface.");
 
  687   if (l3->GetInterface (i)->GetArpCache ())
 
  717           mac->TraceDisconnectWithoutContext (
"TxErrHeader",
 
  749   NS_LOG_FUNCTION (
this << 
" interface " << i << 
" address " << address);
 
  753   if (l3->GetNAddresses (i) == 1)
 
  793       NS_LOG_LOGIC (
"AODV does not work with more then one address per each interface. Ignore added address");
 
  811           unicastSocket->
Close ();
 
  816       if (l3->GetNAddresses (i))
 
  859       NS_LOG_LOGIC (
"Remove address not participating in AODV operation");
 
  909           int32_t 
interface = 
m_ipv4->GetInterfaceForAddress (addr);
 
  910           if (oif == 
m_ipv4->GetNetDevice (static_cast<uint32_t> (interface)))
 
 1082       NS_ASSERT_MSG (
false, 
"Received a packet from an unknown socket");
 
 1084   NS_LOG_DEBUG (
"AODV node " << 
this << 
" received a AODV packet from " << sender << 
" to " << receiver);
 
 1091       NS_LOG_DEBUG (
"AODV message " << packet->
GetUid () << 
" with unknown type received: " << tHeader.
Get () << 
". Drop");
 
 1094   switch (tHeader.
Get ())
 
 1141   NS_LOG_FUNCTION (
this << 
"sender " << sender << 
" receiver " << receiver);
 
 1147                                                m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
 
 1161                                                    m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
 
 1187   uint32_t 
id = rreqHeader.
GetId ();
 
 1219                                                m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),  hop,
 
 1247       NS_LOG_DEBUG (
"Neighbor:" << src << 
" not found in routing table. Creating an entry"); 
 
 1250                                               m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
 
 1269                          << 
" ID " << rreqHeader.
GetId ()
 
 1270                          << 
" to destination " << rreqHeader.
GetDst ());
 
 1277       NS_LOG_DEBUG (
"Send reply since I am the destination");
 
 1321       NS_LOG_DEBUG (
"TTL exceeded. Drop RREQ origin " << src << 
" destination " << dst );
 
 1368   packet->AddPacketTag (tag);
 
 1369   packet->AddHeader (rrepHeader);
 
 1371   packet->AddHeader (tHeader);
 
 1386   if (toDst.
GetHop () == 1)
 
 1420       packetToDst->AddPacketTag (gratTag);
 
 1421       packetToDst->AddHeader (gratRepHeader);
 
 1423       packetToDst->AddHeader (type);
 
 1481                                            m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0), hop,
 
 1490       if (!toDst.GetValidSeqNo ())
 
 1495       else if ((int32_t (rrepHeader.
GetDstSeqno ()) - int32_t (toDst.GetSeqNo ())) > 0)
 
 1502           if ((rrepHeader.
GetDstSeqno () == toDst.GetSeqNo ()) && (toDst.GetFlag () != 
VALID))
 
 1507           else if ((rrepHeader.
GetDstSeqno () == toDst.GetSeqNo ()) && (hop < toDst.GetHop ()))
 
 1550       toDst.InsertPrecursor (toOrigin.
GetNextHop ());
 
 1570       NS_LOG_DEBUG (
"TTL exceeded. Drop RREP destination " << dst << 
" origin " << rrepHeader.
GetOrigin ());
 
 1613                                                m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
 
 1621       toNeighbor.SetValidSeqNo (
true);
 
 1622       toNeighbor.SetFlag (
VALID);
 
 1623       toNeighbor.SetOutputDevice (
m_ipv4->GetNetDevice (
m_ipv4->GetInterfaceForAddress (receiver)));
 
 1624       toNeighbor.SetInterface (
m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0));
 
 1625       toNeighbor.SetHop (1);
 
 1626       toNeighbor.SetNextHop (rrepHeader.
GetDst ());
 
 1641   std::map<Ipv4Address, uint32_t> dstWithNextHopSrc;
 
 1642   std::map<Ipv4Address, uint32_t> unreachable;
 
 1644   std::pair<Ipv4Address, uint32_t> un;
 
 1647       for (std::map<Ipv4Address, uint32_t>::const_iterator i =
 
 1648            dstWithNextHopSrc.begin (); i != dstWithNextHopSrc.end (); ++i)
 
 1650         if (i->first == un.first)
 
 1652             unreachable.insert (un);
 
 1657   std::vector<Ipv4Address> precursors;
 
 1658   for (std::map<Ipv4Address, uint32_t>::const_iterator i = unreachable.begin ();
 
 1659        i != unreachable.end ();)
 
 1671           rerrHeader.
Clear ();
 
 1716       NS_LOG_DEBUG (
"Route not found. Drop all packets with dst " << dst);
 
 1728       NS_LOG_DEBUG (
"Route down. Stop search. Drop packet with destination " << dst);
 
 1797       packet->AddPacketTag (tag);
 
 1798       packet->AddHeader (helloHeader);
 
 1800       packet->AddHeader (tHeader);
 
 1829           NS_LOG_DEBUG (
"Output device doesn't match. Dropped.");
 
 1836       ucb (route, p, header);
 
 1845   std::vector<Ipv4Address> precursors;
 
 1846   std::map<Ipv4Address, uint32_t> unreachable;
 
 1854   for (std::map<Ipv4Address, uint32_t>::const_iterator i = unreachable.begin (); i
 
 1855        != unreachable.end ();)
 
 1868           rerrHeader.
Clear ();
 
 1889   unreachable.insert (std::make_pair (nextHop, toNextHop.
GetSeqNo ()));
 
 1906                                                 << 
"; suppressing RERR");
 
 1923       NS_LOG_LOGIC (
"Unicast RERR to the source of the data transmission");
 
 1955   if (precursors.empty ())
 
 1968                                                 << 
"; suppressing RERR");
 
 1972   if (precursors.size () == 1)
 
 1987   std::vector<Ipv4InterfaceAddress> ifaces;
 
 1989   for (std::vector<Ipv4Address>::const_iterator i = precursors.begin (); i != precursors.end (); ++i)
 
 1992           std::find (ifaces.begin (), ifaces.end (), toPrecursor.
GetInterface ()) == ifaces.end ())
 
 1998   for (std::vector<Ipv4InterfaceAddress>::const_iterator i = ifaces.begin (); i != ifaces.end (); ++i)
 
 2002       NS_LOG_LOGIC (
"Broadcast RERR message from interface " << i->GetLocal ());
 
 2060       NS_LOG_DEBUG (
"Starting at time " << startTime << 
"ms");
 
Time m_activeRouteTimeout
Period of time during which the route is considered to be valid. 
UnicastForwardCallback GetUnicastForwardCallback() const 
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer. 
static TypeId GetTypeId(void)
Get the type ID. 
void SendReplyAck(Ipv4Address neighbor)
Send RREP_ACK. 
Time m_netTraversalTime
Estimate of the average net traversal time. 
static Ipv4Mask GetOnes(void)
void InvalidateRoutesWithDst(std::map< Ipv4Address, uint32_t > const &unreachable)
Update routing entries with this destinations as follows: 
virtual void DoInitialize(void)
Initialize() implementation. 
Simulation virtual time values and global simulation resolution. 
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
Mark entry as unidirectional (e.g. 
Ipv4Address GetIpv4(void) const 
void SetOutputDevice(Ptr< NetDevice > dev)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
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. 
SocketErrno
Enumeration of the possible errors returned by a socket. 
AttributeValue implementation for Boolean. 
Ipv4Mask GetMask(void) const 
Get the network mask. 
bool m_enableBroadcast
Indicates whether a a broadcast data packets forwarding enable. 
bool LookupRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup routing table entry with destination address dst. 
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 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
Ipv4Address GetLocal(void) const 
Get the local address. 
bool GetBroadcastEnable() const 
Hold variables of type string. 
virtual bool SetAllowBroadcast(bool allowBroadcast)=0
Configure whether broadcast datagram transmissions are allowed. 
Time m_nodeTraversalTime
NodeTraversalTime is a conservative estimate of the average one hop traversal time for packets and sh...
void SetDesinationOnlyFlag(bool f)
a class to represent an Ipv4 address mask 
Time m_deletePeriod
DeletePeriod is intended to provide an upper bound on the time for which an upstream node A can have ...
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Tag used by AODV implementation. 
void AddPacketTag(const Tag &tag) const 
Add a packet tag. 
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 
Returns the packet's Uid. 
Timer m_ackTimer
RREP_ACK timer. 
uint32_t m_maxQueueLen
The maximum number of packets that we allow a routing protocol to buffer. 
bool Forwarding(Ptr< const Packet > p, const Ipv4Header &header, UnicastForwardCallback ucb, ErrorCallback ecb)
If route exists and valid, forward packet. 
bool IsNull(void) const 
Check for null implementation. 
Time m_helloInterval
Every HelloInterval the node checks whether it has sent a broadcast within the last HelloInterval...
void SetMaxQueueLen(uint32_t len)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void DelArpCache(Ptr< ArpCache >)
Don't use given ARP cache any more (interface is down) 
Time m_maxQueueTime
The maximum period of time that a routing protocol is allowed to buffer a packet for. 
void SendHello()
Send hello. 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit. 
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)
virtual void DoDispose()
Destructor implementation. 
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
void SetMaxQueueLen(uint32_t len)
Timer m_rreqRateLimitTimer
RREQ rate limit timer. 
bool IsMulticast(void) const 
uint16_t m_rreqRateLimit
Maximum number of RREQ per second. 
uint16_t m_ttlThreshold
Maximum TTL value for expanding ring search, TTL = NetDiameter is used beyond this value...
Ptr< NetDevice > GetOutputDevice() const 
Neighbors m_nb
Handle neighbors. 
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time. 
virtual void DoDispose(void)
Destructor implementation. 
void GetPrecursors(std::vector< Ipv4Address > &prec) const 
Inserts precursors in vector prec if they does not yet exist in vector. 
void SetGratuitousReplyFlag(bool f)
TAG_BUFFER_INLINE uint32_t ReadU32(void)
Time m_nextHopWait
Period of our waiting for the neighbour's RREP_ACK. 
void SetLifeTime(Time lt)
This class implements a tag that carries the socket-specific TTL of a packet to the IP layer...
uint16_t m_rerrRateLimit
Maximum number of REER per second. 
Time m_lastBcastTime
Keep track of the last bcast time. 
bool m_destinationOnly
Indicates only the destination may respond to this RREQ. 
uint32_t m_rreqRetries
Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route. 
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)
Repeated attempts by a source node at route discovery for a single destination use the expanding ring...
Ptr< Socket > FindSocketWithInterfaceAddress(Ipv4InterfaceAddress iface) const 
Find unicast socket with local interface address iface. 
a polymophic address class 
bool IsRunning(void) const 
bool m_gratuitousReply
Indicates whether a gratuitous RREP should be unicast to the node originated route discovery...
Ptr< Ipv4Route > LoopbackRoute(const Ipv4Header &header, Ptr< NetDevice > oif) const 
Create loopback route for given header. 
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. 
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)
Insert precursor in precursor list if it doesn't yet exist in the list. 
double GetSeconds(void) const 
Get an approximation of the time stored in this instance in the indicated unit. 
void Print(Ptr< OutputStreamWrapper > stream) const 
Print routing table. 
void SetRreqCnt(uint8_t n)
void RecvReplyAck(Ipv4Address neighbor)
Receive RREP_ACK. 
bool PeekPacketTag(Tag &tag) const 
Search a matching tag and call Tag::Deserialize if it is found. 
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. 
virtual uint32_t GetInteger(void)=0
Get the next random value as an integer drawn from the distribution. 
uint16_t m_ttlIncrement
TTL increment for each attempt using the expanding ring search for RREQ dissemination. 
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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) 
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay. 
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. 
uint32_t m_allowedHelloLoss
Number of hello messages which may be loss for valid link. 
void SetTtl(uint8_t ttl)
Set the tag's TTL. 
AttributeValue implementation for Time. 
void Schedule(void)
Schedule a new event using the currently-configured delay, function, and arguments. 
Ipv4Address GetNextHop() const 
void SetGateway(Ipv4Address gw)
bool UpdateRouteLifeTime(Ipv4Address addr, Time lt)
Set lifetime field in routing table entry to the maximum of existing lifetime and lt...
Hold an unsigned integer type. 
void UpdateRouteToNeighbor(Ipv4Address sender, Ipv4Address receiver)
Update neighbor record. 
TAG_BUFFER_INLINE void WriteU32(uint32_t v)
bool GetDesinationOnlyFlag() const 
bool IsBroadcast(void) const 
void SetSeqNo(uint32_t sn)
void SetValidSeqNo(bool s)
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. 
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. 
virtual void DoInitialize(void)
Initialize() implementation. 
Time GetMaxQueueTime() const 
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
void SendReplyByIntermediateNode(RoutingTableEntry &toDst, RoutingTableEntry &toOrigin, bool gratRep)
Send RREP by intermediate node. 
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 
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)
Use NS_LOG to output a message of level LOG_LOGIC. 
uint16_t m_rerrCount
Number of RERRs used for RERR rate control. 
Ipv4Address GetGateway(void) const 
static Ipv4Address GetBroadcast(void)
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)
Ptr< Packet > Copy(void) const 
performs a COW copy of the packet. 
uint32_t PeekHeader(Header &header) const 
Deserialize but does not remove the header from the internal buffer. 
void SendRerrWhenNoRouteToForward(Ipv4Address dst, uint32_t dstSeqNo, Ipv4Address origin)
Send RERR message when no route to forward input packet. 
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. 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
std::map< Ptr< Socket >, Ipv4InterfaceAddress > m_socketSubnetBroadcastAddresses
Raw subnet directed broadcast socket per each IP interface, map socket -> iface address (IP + mask) ...
static InetSocketAddress ConvertFrom(const Address &address)
Returns an InetSocketAddress which corresponds to the input Address. 
void SetFlag(RouteFlags flag)
bool GetGratuitousReplyFlag() const 
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< Socket > FindSubnetBroadcastSocketWithInterfaceAddress(Ipv4InterfaceAddress iface) const 
Find subnet directed broadcast socket with local interface address iface. 
void RecvRequest(Ptr< Packet > p, Ipv4Address receiver, Ipv4Address src)
Receive RREQ. 
uint32_t m_netDiameter
Net diameter measures the maximum possible number of hops between two nodes in the network...
std::map< Ptr< Socket >, Ipv4InterfaceAddress > m_socketAddresses
Raw unicast socket per each IP interface, map socket -> iface address (IP + mask) ...
uint16_t m_ttlStart
Initial TTL value for RREQ. 
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now. 
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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. ...
static Time Now(void)
Return the current simulation virtual time. 
void SetOutputDevice(Ptr< NetDevice > outputDevice)
Equivalent in Linux to dst_entry.dev. 
void ProcessHello(RrepHeader const &rrepHeader, Ipv4Address receiverIfaceAddr)
Process hello message. 
static Ipv4Address GetLoopback(void)
virtual void NotifyInterfaceUp(uint32_t interface)
bool m_enableHello
Indicates whether a hello messages enable. 
DuplicatePacketDetection m_dpd
Handle duplicated broadcast/multicast packets. 
int32_t GetInterface() const 
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. 
Time m_myRouteTimeout
Value of lifetime field in RREP generating by this node. 
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
void Serialize(TagBuffer i) const 
Ipv4Address GetDestination(void) const 
void SetHop(uint16_t hop)
Time m_pathDiscoveryTime
Estimate of maximum time needed to find route in network. 
Ipv4 addresses are stored in host order in this class. 
Ipv4Address GetBroadcast(void) const 
Get the broadcast address. 
virtual void NotifyInterfaceDown(uint32_t interface)
virtual ~RoutingProtocol()
TimeWithUnit As(const enum Unit unit) const 
Attach a unit to a Time, to facilitate output in a specific unit. 
a class to store IPv4 address information on an interface 
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN. 
uint32_t GetSeqNo() const 
void SetQueueTimeout(Time t)
bool AddRoute(RoutingTableEntry &r)
Add routing table entry if it doesn't yet exist in routing table. 
bool RemovePacketTag(Tag &tag)
Remove a packet tag. 
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG. 
Time Seconds(double value)
Construct a Time in the indicated unit. 
void Cancel(void)
Cancel the currently-running event if there is one. 
Time m_blackListTimeout
Time for which the node is put into the blacklist. 
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 SetIpRecvTtl(bool ipv4RecvTtl)
Tells a socket to pass information about IP_TTL up the stack. 
void SetCallback(Callback< void, Ipv4Address > cb)
Handle link failure callback. 
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)
Timer m_rerrRateLimitTimer
RERR rate limit timer. 
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 
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit. 
Time Now(void)
create an ns3::Time instance which contains the current simulation time. 
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR. 
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables. 
uint16_t m_timeoutBuffer
Provide a buffer for the timeout. 
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. 
uint8_t GetTtl(void) const 
Get the tag's TTL. 
DeferredRouteOutputTag(int32_t o=-1)
IdCache m_rreqIdCache
Handle duplicated RREQ. 
void RouteRequestTimerExpire(Ipv4Address dst)
Handle route discovery process. 
TypeId GetInstanceTypeId() const 
Get the most derived TypeId for this Object. 
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()
This policy cancels the event from the destructor of the Timer to verify that the event has already e...
bool IsUnidirectional() const 
void SetBroadcastEnable(bool f)
bool DeleteRoute(Ipv4Address dst)
Delete routing table entry with destination address dst, if it exists. 
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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. 
static const uint8_t PROT_NUMBER
protocol number (0x11) 
Ptr< NetDevice > m_lo
Loopback device used to defer RREQ until packet will be fully formed. 
RouteFlags GetFlag() const 
void Deserialize(TagBuffer i)
uint32_t m_requestId
Broadcast ID. 
Ipv4Address GetDestination() const 
TypeId SetParent(TypeId tid)
Set the parent TypeId. 
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 
static Time GetMaximumSimulationTime(void)
Get the maximum representable simulation time. 
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper. 
virtual Address GetAddress(void) const =0
uint32_t GetMaxQueueLen() const 
void AddHeader(const Header &header)
Add header to this packet. 
void SetDestination(Ipv4Address dest)
void ScheduleTimer()
Schedule m_ntimer. 
bool GetValidSeqNo() const 
static const uint32_t AODV_PORT
UDP Port for AODV control traffic.