A Discrete-Event Network Simulator
API
ns3::aodv::RoutingProtocol Class Reference

AODV routing protocol. More...

#include "aodv-routing-protocol.h"

+ Inheritance diagram for ns3::aodv::RoutingProtocol:
+ Collaboration diagram for ns3::aodv::RoutingProtocol:

Public Member Functions

 RoutingProtocol ()
 constructor More...
 
virtual ~RoutingProtocol ()
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
virtual void DoDispose ()
 Destructor implementation. More...
 
bool GetBroadcastEnable () const
 Get broadcast enable flag. More...
 
bool GetDestinationOnlyFlag () const
 Get destination only flag. More...
 
bool GetGratuitousReplyFlag () const
 Get gratuitous reply flag. More...
 
bool GetHelloEnable () const
 Get hello enable flag. More...
 
uint32_t GetMaxQueueLen () const
 Get the maximum queue length. More...
 
Time GetMaxQueueTime () const
 Get maximum queue time. More...
 
virtual void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address)
 
virtual void NotifyInterfaceDown (uint32_t interface)
 
virtual void NotifyInterfaceUp (uint32_t interface)
 
virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address)
 
virtual void PrintRoutingTable (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
 Print the Routing Table entries. More...
 
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) More...
 
Ptr< Ipv4RouteRouteOutput (Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)
 Query routing cache for an existing route, for an outbound packet. More...
 
void SetBroadcastEnable (bool f)
 Set broadcast enable flag. More...
 
void SetDestinationOnlyFlag (bool f)
 Set destination only flag. More...
 
void SetGratuitousReplyFlag (bool f)
 Set gratuitous reply flag. More...
 
void SetHelloEnable (bool f)
 Set hello enable. More...
 
virtual void SetIpv4 (Ptr< Ipv4 > ipv4)
 
void SetMaxQueueLen (uint32_t len)
 Set the maximum queue length. More...
 
void SetMaxQueueTime (Time t)
 Set the maximum queue time. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= ([[maybe_unused]] const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Ipv4RoutingProtocol
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Static Public Attributes

static const uint32_t AODV_PORT = 654
 UDP Port for AODV control traffic. More...
 

Protected Member Functions

virtual void DoInitialize (void)
 Initialize() implementation. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Private Member Functions

void AckTimerExpire (Ipv4Address neighbor, Time blacklistTimeout)
 Mark link to neighbor node as unidirectional for blacklistTimeout. More...
 
void DeferredRouteOutput (Ptr< const Packet > p, const Ipv4Header &header, UnicastForwardCallback ucb, ErrorCallback ecb)
 Queue packet and send route request. More...
 
Ptr< SocketFindSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const
 Find unicast socket with local interface address iface. More...
 
Ptr< SocketFindSubnetBroadcastSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const
 Find subnet directed broadcast socket with local interface address iface. More...
 
bool Forwarding (Ptr< const Packet > p, const Ipv4Header &header, UnicastForwardCallback ucb, ErrorCallback ecb)
 If route exists and is valid, forward packet. More...
 
void HelloTimerExpire ()
 Schedule next send of hello message. More...
 
bool IsMyOwnAddress (Ipv4Address src)
 Test whether the provided address is assigned to an interface on this node. More...
 
Ptr< Ipv4RouteLoopbackRoute (const Ipv4Header &header, Ptr< NetDevice > oif) const
 Create loopback route for given header. More...
 
void NotifyTxError (WifiMacDropReason reason, Ptr< const WifiMacQueueItem > mpdu)
 Notify that an MPDU was dropped. More...
 
void ProcessHello (RrepHeader const &rrepHeader, Ipv4Address receiverIfaceAddr)
 Process hello message. More...
 
void RerrRateLimitTimerExpire ()
 Reset RERR count and schedule RERR rate limit timer with delay 1 sec. More...
 
void RouteRequestTimerExpire (Ipv4Address dst)
 Handle route discovery process. More...
 
void RreqRateLimitTimerExpire ()
 Reset RREQ count and schedule RREQ rate limit timer with delay 1 sec. More...
 
void ScheduleRreqRetry (Ipv4Address dst)
 Repeated attempts by a source node at route discovery for a single destination use the expanding ring search technique. More...
 
void SendTo (Ptr< Socket > socket, Ptr< Packet > packet, Ipv4Address destination)
 Send packet to destination scoket. More...
 
void Start ()
 Start protocol operation. More...
 
bool UpdateRouteLifeTime (Ipv4Address addr, Time lt)
 Set lifetime field in routing table entry to the maximum of existing lifetime and lt, if the entry exists. More...
 
void UpdateRouteToNeighbor (Ipv4Address sender, Ipv4Address receiver)
 Update neighbor record. More...
 
Receive control packets
void RecvAodv (Ptr< Socket > socket)
 Receive and process control packet. More...
 
void RecvRequest (Ptr< Packet > p, Ipv4Address receiver, Ipv4Address src)
 Receive RREQ. More...
 
void RecvReply (Ptr< Packet > p, Ipv4Address my, Ipv4Address src)
 Receive RREP. More...
 
void RecvReplyAck (Ipv4Address neighbor)
 Receive RREP_ACK. More...
 
void RecvError (Ptr< Packet > p, Ipv4Address src)
 Receive RERR. More...
 
Send
void SendPacketFromQueue (Ipv4Address dst, Ptr< Ipv4Route > route)
 Forward packet from route request queue. More...
 
void SendHello ()
 Send hello. More...
 
void SendRequest (Ipv4Address dst)
 Send RREQ. More...
 
void SendReply (RreqHeader const &rreqHeader, RoutingTableEntry const &toOrigin)
 Send RREP. More...
 
void SendReplyByIntermediateNode (RoutingTableEntry &toDst, RoutingTableEntry &toOrigin, bool gratRep)
 Send RREP by intermediate node. More...
 
void SendReplyAck (Ipv4Address neighbor)
 Send RREP_ACK. More...
 
void SendRerrWhenBreaksLinkToNextHop (Ipv4Address nextHop)
 Initiate RERR. More...
 
void SendRerrMessage (Ptr< Packet > packet, std::vector< Ipv4Address > precursors)
 Forward RERR. More...
 
void SendRerrWhenNoRouteToForward (Ipv4Address dst, uint32_t dstSeqNo, Ipv4Address origin)
 Send RERR message when no route to forward input packet. More...
 

Private Attributes

Time m_activeRouteTimeout
 Period of time during which the route is considered to be valid. More...
 
std::map< Ipv4Address, Timerm_addressReqTimer
 Map IP address + RREQ timer. More...
 
uint32_t m_allowedHelloLoss
 Number of hello messages which may be loss for valid link. More...
 
Time m_blackListTimeout
 Time for which the node is put into the blacklist. More...
 
Time m_deletePeriod
 DeletePeriod is intended to provide an upper bound on the time for which an upstream node A can have a neighbor B as an active next hop for destination D, while B has invalidated the route to D. More...
 
bool m_destinationOnly
 Indicates only the destination may respond to this RREQ. More...
 
DuplicatePacketDetection m_dpd
 Handle duplicated broadcast/multicast packets. More...
 
bool m_enableBroadcast
 Indicates whether a a broadcast data packets forwarding enable. More...
 
bool m_enableHello
 Indicates whether a hello messages enable. More...
 
bool m_gratuitousReply
 Indicates whether a gratuitous RREP should be unicast to the node originated route discovery. More...
 
Time m_helloInterval
 Every HelloInterval the node checks whether it has sent a broadcast within the last HelloInterval. More...
 
Timer m_htimer
 Hello timer. More...
 
Ptr< Ipv4m_ipv4
 IP protocol. More...
 
Time m_lastBcastTime
 Keep track of the last bcast time. More...
 
Ptr< NetDevicem_lo
 Loopback device used to defer RREQ until packet will be fully formed. More...
 
uint32_t m_maxQueueLen
 The maximum number of packets that we allow a routing protocol to buffer. More...
 
Time m_maxQueueTime
 The maximum period of time that a routing protocol is allowed to buffer a packet for. More...
 
Time m_myRouteTimeout
 Value of lifetime field in RREP generating by this node. More...
 
Neighbors m_nb
 Handle neighbors. More...
 
uint32_t m_netDiameter
 Net diameter measures the maximum possible number of hops between two nodes in the network. More...
 
Time m_netTraversalTime
 Estimate of the average net traversal time. More...
 
Time m_nextHopWait
 Period of our waiting for the neighbour's RREP_ACK. More...
 
Time m_nodeTraversalTime
 NodeTraversalTime is a conservative estimate of the average one hop traversal time for packets and should include queuing delays, interrupt processing times and transfer times. More...
 
Time m_pathDiscoveryTime
 Estimate of maximum time needed to find route in network. More...
 
RequestQueue m_queue
 A "drop-front" queue used by the routing layer to buffer packets to which it does not have a route. More...
 
uint32_t m_requestId
 Broadcast ID. More...
 
uint16_t m_rerrCount
 Number of RERRs used for RERR rate control. More...
 
uint16_t m_rerrRateLimit
 Maximum number of REER per second. More...
 
Timer m_rerrRateLimitTimer
 RERR rate limit timer. More...
 
RoutingTable m_routingTable
 Routing table. More...
 
uint16_t m_rreqCount
 Number of RREQs used for RREQ rate control. More...
 
IdCache m_rreqIdCache
 Handle duplicated RREQ. More...
 
uint16_t m_rreqRateLimit
 Maximum number of RREQ per second. More...
 
Timer m_rreqRateLimitTimer
 RREQ rate limit timer. More...
 
uint32_t m_rreqRetries
 Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route. More...
 
uint32_t m_seqNo
 Request sequence number. More...
 
std::map< Ptr< Socket >, Ipv4InterfaceAddressm_socketAddresses
 Raw unicast socket per each IP interface, map socket -> iface address (IP + mask) More...
 
std::map< Ptr< Socket >, Ipv4InterfaceAddressm_socketSubnetBroadcastAddresses
 Raw subnet directed broadcast socket per each IP interface, map socket -> iface address (IP + mask) More...
 
uint16_t m_timeoutBuffer
 Provide a buffer for the timeout. More...
 
uint16_t m_ttlIncrement
 TTL increment for each attempt using the expanding ring search for RREQ dissemination. More...
 
uint16_t m_ttlStart
 Initial TTL value for RREQ. More...
 
uint16_t m_ttlThreshold
 Maximum TTL value for expanding ring search, TTL = NetDiameter is used beyond this value. More...
 
Ptr< UniformRandomVariablem_uniformRandomVariable
 Provides uniform random variables. More...
 

Additional Inherited Members

- Public Types inherited from ns3::Ipv4RoutingProtocol
typedef Callback< void, Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrnoErrorCallback
 Callback for routing errors (e.g., no route found) More...
 
typedef Callback< void, Ptr< const Packet >, const Ipv4Header &, uint32_t > LocalDeliverCallback
 Callback for packets to be locally delivered. More...
 
typedef Callback< void, Ptr< Ipv4MulticastRoute >, Ptr< const Packet >, const Ipv4Header & > MulticastForwardCallback
 Callback for multicast packets to be forwarded. More...
 
typedef Callback< void, Ptr< Ipv4Route >, Ptr< const Packet >, const Ipv4Header & > UnicastForwardCallback
 Callback for unicast packets to be forwarded. More...
 

Detailed Description

AODV routing protocol.

Config Paths

ns3::aodv::RoutingProtocol is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/$ns3::aodv::RoutingProtocol"

Attributes

  • HelloInterval: HELLO messages emission interval.
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +1e+09ns
    • Flags: construct write read
  • TtlStart: Initial TTL value for RREQ.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 1
    • Flags: construct write read
  • TtlIncrement: TTL increment for each attempt using the expanding ring search for RREQ dissemination.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 2
    • Flags: construct write read
  • TtlThreshold: Maximum TTL value for expanding ring search, TTL = NetDiameter is used beyond this value.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 7
    • Flags: construct write read
  • TimeoutBuffer: Provide a buffer for the timeout.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 2
    • Flags: construct write read
  • RreqRetries: Maximum number of retransmissions of RREQ to discover a route
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 2
    • Flags: construct write read
  • RreqRateLimit: Maximum number of RREQ per second.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 10
    • Flags: construct write read
  • RerrRateLimit: Maximum number of RERR per second.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 10
    • Flags: construct write read
  • NodeTraversalTime: Conservative estimate of the average one hop traversal time for packets and should include queuing delays, interrupt processing times and transfer times.
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +4e+07ns
    • Flags: construct write read
  • NextHopWait: Period of our waiting for the neighbour's RREP_ACK = 10 ms + NodeTraversalTime
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +5e+07ns
    • Flags: construct write read
  • ActiveRouteTimeout: Period of time during which the route is considered to be valid
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +3e+09ns
    • Flags: construct write read
  • MyRouteTimeout: Value of lifetime field in RREP generating by this node = 2 * max(ActiveRouteTimeout, PathDiscoveryTime)
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +1.12e+10ns
    • Flags: construct write read
  • BlackListTimeout: Time for which the node is put into the blacklist = RreqRetries * NetTraversalTime
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +5.6e+09ns
    • Flags: construct write read
  • DeletePeriod: DeletePeriod is intended to provide an upper bound on the time for which an upstream node A can have a neighbor B as an active next hop for destination D, while B has invalidated the route to D. = 5 * max (HelloInterval, ActiveRouteTimeout)
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +1.5e+10ns
    • Flags: construct write read
  • NetDiameter: Net diameter measures the maximum possible number of hops between two nodes in the network
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 35
    • Flags: construct write read
  • NetTraversalTime: Estimate of the average net traversal time = 2 * NodeTraversalTime * NetDiameter
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +2.8e+09ns
    • Flags: construct write read
  • PathDiscoveryTime: Estimate of maximum time needed to find route in network = 2 * NetTraversalTime
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +5.6e+09ns
    • Flags: construct write read
  • MaxQueueLen: Maximum number of packets that we allow a routing protocol to buffer.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 64
    • Flags: construct write read
  • MaxQueueTime: Maximum time packets can be queued (in seconds)
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +3e+10ns
    • Flags: construct write read
  • AllowedHelloLoss: Number of hello messages which may be loss for valid link.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 2
    • Flags: construct write read
  • GratuitousReply: Indicates whether a gratuitous RREP should be unicast to the node originated route discovery.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • DestinationOnly: Indicates only the destination may respond to this RREQ.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: false
    • Flags: construct write read
  • EnableHello: Indicates whether a hello messages enable.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • EnableBroadcast: Indicates whether a broadcast data packets forwarding enable.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • UniformRv: Access to the underlying UniformRandomVariable

No TraceSources are defined for this type.
Size of this type is 800 bytes (on a 64-bit architecture).

Definition at line 55 of file aodv-routing-protocol.h.

Constructor & Destructor Documentation

◆ RoutingProtocol()

ns3::aodv::RoutingProtocol::RoutingProtocol ( )

constructor

Definition at line 141 of file aodv-routing-protocol.cc.

References m_nb, ns3::MakeCallback(), SendRerrWhenBreaksLinkToNextHop(), and ns3::aodv::Neighbors::SetCallback().

+ Here is the call graph for this function:

◆ ~RoutingProtocol()

ns3::aodv::RoutingProtocol::~RoutingProtocol ( )
virtual

Definition at line 316 of file aodv-routing-protocol.cc.

Member Function Documentation

◆ AckTimerExpire()

void ns3::aodv::RoutingProtocol::AckTimerExpire ( Ipv4Address  neighbor,
Time  blacklistTimeout 
)
private

Mark link to neighbor node as unidirectional for blacklistTimeout.

Parameters
neighborthe IP address of the neightbor node
blacklistTimeoutthe black list timeout time

Definition at line 1835 of file aodv-routing-protocol.cc.

References m_routingTable, ns3::aodv::RoutingTable::MarkLinkAsUnidirectional(), and NS_LOG_FUNCTION.

Referenced by SendReplyByIntermediateNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AssignStreams()

int64_t ns3::aodv::RoutingProtocol::AssignStreams ( int64_t  stream)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Definition at line 352 of file aodv-routing-protocol.cc.

References m_uniformRandomVariable, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

◆ DeferredRouteOutput()

void ns3::aodv::RoutingProtocol::DeferredRouteOutput ( Ptr< const Packet p,
const Ipv4Header header,
UnicastForwardCallback  ucb,
ErrorCallback  ecb 
)
private

Queue packet and send route request.

Parameters
pthe packet to route
headerthe IP header
ucbthe UnicastForwardCallback function
ecbthe ErrorCallback function

Definition at line 428 of file aodv-routing-protocol.cc.

References ns3::aodv::RequestQueue::Enqueue(), ns3::Ipv4Header::GetDestination(), ns3::aodv::RoutingTableEntry::GetFlag(), ns3::Ipv4Header::GetProtocol(), ns3::Packet::GetUid(), ns3::aodv::IN_SEARCH, ns3::aodv::RoutingTable::LookupRoute(), m_queue, m_routingTable, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, test-ns3::result, and SendRequest().

Referenced by RouteInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::aodv::RoutingProtocol::DoDispose ( void  )
virtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 321 of file aodv-routing-protocol.cc.

References ns3::Object::DoDispose(), m_ipv4, m_socketAddresses, and m_socketSubnetBroadcastAddresses.

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::aodv::RoutingProtocol::DoInitialize ( void  )
protectedvirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 2121 of file aodv-routing-protocol.cc.

References ns3::Object::DoInitialize(), ns3::UniformRandomVariable::GetInteger(), HelloTimerExpire(), m_enableHello, m_htimer, m_uniformRandomVariable, ns3::MilliSeconds(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Timer::Schedule(), ns3::Timer::SetFunction(), and startTime.

+ Here is the call graph for this function:

◆ FindSocketWithInterfaceAddress()

Ptr< Socket > ns3::aodv::RoutingProtocol::FindSocketWithInterfaceAddress ( Ipv4InterfaceAddress  iface) const
private

Find unicast socket with local interface address iface.

Parameters
ifacethe interface
Returns
the socket associated with the interface

Definition at line 2085 of file aodv-routing-protocol.cc.

References m_socketAddresses, and NS_LOG_FUNCTION.

Referenced by NotifyAddAddress(), NotifyInterfaceDown(), NotifyRemoveAddress(), RecvReply(), SendReply(), SendReplyAck(), SendReplyByIntermediateNode(), SendRerrMessage(), and SendRerrWhenNoRouteToForward().

+ Here is the caller graph for this function:

◆ FindSubnetBroadcastSocketWithInterfaceAddress()

Ptr< Socket > ns3::aodv::RoutingProtocol::FindSubnetBroadcastSocketWithInterfaceAddress ( Ipv4InterfaceAddress  iface) const
private

Find subnet directed broadcast socket with local interface address iface.

Parameters
ifacethe interface
Returns
the socket associated with the interface

Definition at line 2103 of file aodv-routing-protocol.cc.

References m_socketSubnetBroadcastAddresses, and NS_LOG_FUNCTION.

Referenced by NotifyInterfaceDown(), and NotifyRemoveAddress().

+ Here is the caller graph for this function:

◆ Forwarding()

bool ns3::aodv::RoutingProtocol::Forwarding ( Ptr< const Packet p,
const Ipv4Header header,
UnicastForwardCallback  ucb,
ErrorCallback  ecb 
)
private

◆ GetBroadcastEnable()

bool ns3::aodv::RoutingProtocol::GetBroadcastEnable ( ) const
inline

Get broadcast enable flag.

Returns
the broadcast enable flag

Definition at line 169 of file aodv-routing-protocol.h.

References m_enableBroadcast.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetDestinationOnlyFlag()

bool ns3::aodv::RoutingProtocol::GetDestinationOnlyFlag ( ) const
inline

Get destination only flag.

Returns
the destination only flag

Definition at line 113 of file aodv-routing-protocol.h.

References m_destinationOnly.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetGratuitousReplyFlag()

bool ns3::aodv::RoutingProtocol::GetGratuitousReplyFlag ( ) const
inline

Get gratuitous reply flag.

Returns
the gratuitous reply flag

Definition at line 129 of file aodv-routing-protocol.h.

References m_gratuitousReply.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetHelloEnable()

bool ns3::aodv::RoutingProtocol::GetHelloEnable ( ) const
inline

Get hello enable flag.

Returns
the enable hello flag

Definition at line 153 of file aodv-routing-protocol.h.

References m_enableHello.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetMaxQueueLen()

uint32_t ns3::aodv::RoutingProtocol::GetMaxQueueLen ( ) const
inline

Get the maximum queue length.

Returns
the maximum queue length

Definition at line 100 of file aodv-routing-protocol.h.

References m_maxQueueLen.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetMaxQueueTime()

Time ns3::aodv::RoutingProtocol::GetMaxQueueTime ( ) const
inline

Get maximum queue time.

Returns
the maximum queue time

Definition at line 87 of file aodv-routing-protocol.h.

References m_maxQueueTime.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetTypeId()

◆ HelloTimerExpire()

void ns3::aodv::RoutingProtocol::HelloTimerExpire ( )
private

Schedule next send of hello message.

Definition at line 1799 of file aodv-routing-protocol.cc.

References ns3::Timer::Cancel(), m_helloInterval, m_htimer, m_lastBcastTime, max, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Timer::Schedule(), ns3::Seconds(), and SendHello().

Referenced by DoInitialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsMyOwnAddress()

bool ns3::aodv::RoutingProtocol::IsMyOwnAddress ( Ipv4Address  src)
private

Test whether the provided address is assigned to an interface on this node.

Parameters
srcthe source IP address
Returns
true if the IP address is the node's IP address

Definition at line 903 of file aodv-routing-protocol.cc.

References ns3::Ipv4InterfaceAddress::GetLocal(), m_socketAddresses, and NS_LOG_FUNCTION.

Referenced by RecvReply(), RecvRequest(), and RouteInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoopbackRoute()

Ptr< Ipv4Route > ns3::aodv::RoutingProtocol::LoopbackRoute ( const Ipv4Header header,
Ptr< NetDevice oif 
) const
private

Create loopback route for given header.

Parameters
headerthe IP header
oifthe output interface net device
Returns
the route

Definition at line 919 of file aodv-routing-protocol.cc.

References ns3::Ipv4Header::GetDestination(), m_ipv4, m_lo, m_socketAddresses, NS_ASSERT, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by RouteOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyAddAddress()

void ns3::aodv::RoutingProtocol::NotifyAddAddress ( uint32_t  interface,
Ipv4InterfaceAddress  address 
)
virtual
Parameters
interfacethe index of the interface we are being notified about
addressa new address being added to an interface

Protocols are expected to implement this method to be notified whenever a new address is added to an interface. Typically used to add a 'network route' on an interface. Can be invoked on an up or down interface.

Implements ns3::Ipv4RoutingProtocol.

Definition at line 782 of file aodv-routing-protocol.cc.

References first::address, ns3::aodv::RoutingTable::AddRoute(), AODV_PORT, ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), ns3::Socket::CreateSocket(), FindSocketWithInterfaceAddress(), ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Simulator::GetMaximumSimulationTime(), ns3::UdpSocketFactory::GetTypeId(), m_ipv4, m_routingTable, m_socketAddresses, m_socketSubnetBroadcastAddresses, ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, RecvAodv(), ns3::Socket::SetAllowBroadcast(), ns3::Socket::SetIpRecvTtl(), and ns3::Socket::SetRecvCallback().

+ Here is the call graph for this function:

◆ NotifyInterfaceDown()

void ns3::aodv::RoutingProtocol::NotifyInterfaceDown ( uint32_t  interface)
virtual

◆ NotifyInterfaceUp()

◆ NotifyRemoveAddress()

void ns3::aodv::RoutingProtocol::NotifyRemoveAddress ( uint32_t  interface,
Ipv4InterfaceAddress  address 
)
virtual

◆ NotifyTxError()

void ns3::aodv::RoutingProtocol::NotifyTxError ( WifiMacDropReason  reason,
Ptr< const WifiMacQueueItem mpdu 
)
private

Notify that an MPDU was dropped.

Parameters
reasonthe reason why the MPDU was dropped
mpduthe dropped MPDU

Definition at line 733 of file aodv-routing-protocol.cc.

References ns3::aodv::Neighbors::GetTxErrorCallback(), and m_nb.

Referenced by NotifyInterfaceDown(), and NotifyInterfaceUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintRoutingTable()

void ns3::aodv::RoutingProtocol::PrintRoutingTable ( Ptr< OutputStreamWrapper stream,
Time::Unit  unit = Time::S 
) const
virtual

Print the Routing Table entries.

Parameters
streamThe ostream the Routing table is printed to
unitThe time unit to be used in the report

Implements ns3::Ipv4RoutingProtocol.

Definition at line 340 of file aodv-routing-protocol.cc.

References ns3::Time::As(), ns3::OutputStreamWrapper::GetStream(), m_ipv4, m_routingTable, ns3::Now(), and ns3::aodv::RoutingTable::Print().

+ Here is the call graph for this function:

◆ ProcessHello()

◆ RecvAodv()

◆ RecvError()

◆ RecvReply()

void ns3::aodv::RoutingProtocol::RecvReply ( Ptr< Packet p,
Ipv4Address  my,
Ipv4Address  src 
)
private

Receive RREP.

Parameters
ppacket
mydestination address
srcsender address

Definition at line 1514 of file aodv-routing-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), ns3::aodv::RoutingTable::AddRoute(), AODV_PORT, ns3::aodv::AODVTYPE_RREP, FindSocketWithInterfaceAddress(), ns3::aodv::RrepHeader::GetAckRequired(), ns3::aodv::RrepHeader::GetDst(), ns3::aodv::RrepHeader::GetDstSeqno(), ns3::aodv::RoutingTableEntry::GetFlag(), ns3::aodv::RoutingTableEntry::GetHop(), ns3::aodv::RrepHeader::GetHopCount(), ns3::aodv::RoutingTableEntry::GetInterface(), ns3::aodv::RrepHeader::GetLifeTime(), ns3::aodv::RoutingTableEntry::GetLifeTime(), ns3::aodv::RoutingTableEntry::GetNextHop(), ns3::aodv::RrepHeader::GetOrigin(), ns3::aodv::RoutingTableEntry::GetRoute(), ns3::aodv::RoutingTableEntry::GetSeqNo(), ns3::SocketIpTtlTag::GetTtl(), ns3::aodv::RoutingTableEntry::GetValidSeqNo(), ns3::aodv::IN_SEARCH, ns3::aodv::RoutingTableEntry::InsertPrecursor(), IsMyOwnAddress(), ns3::aodv::RoutingTable::LookupRoute(), ns3::aodv::RoutingTable::LookupValidRoute(), m_activeRouteTimeout, m_addressReqTimer, m_ipv4, m_routingTable, max, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ProcessHello(), ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), SendPacketFromQueue(), SendReplyAck(), ns3::Socket::SendTo(), ns3::aodv::RrepHeader::SetAckRequired(), ns3::aodv::RrepHeader::SetHopCount(), ns3::aodv::RoutingTableEntry::SetLifeTime(), ns3::SocketIpTtlTag::SetTtl(), ns3::aodv::RoutingTable::Update(), and ns3::aodv::VALID.

Referenced by RecvAodv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RecvReplyAck()

void ns3::aodv::RoutingProtocol::RecvReplyAck ( Ipv4Address  neighbor)
private

Receive RREP_ACK.

Parameters
neighborneighbor address

Definition at line 1650 of file aodv-routing-protocol.cc.

References ns3::Timer::Cancel(), ns3::aodv::RoutingTable::LookupRoute(), ns3::aodv::RoutingTableEntry::m_ackTimer, m_routingTable, NS_LOG_FUNCTION, ns3::aodv::RoutingTableEntry::SetFlag(), ns3::aodv::RoutingTable::Update(), and ns3::aodv::VALID.

Referenced by RecvAodv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RecvRequest()

void ns3::aodv::RoutingProtocol::RecvRequest ( Ptr< Packet p,
Ipv4Address  receiver,
Ipv4Address  src 
)
private

Receive RREQ.

Parameters
ppacket
receiverreceiver address
srcsender address

Definition at line 1227 of file aodv-routing-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), ns3::aodv::RoutingTable::AddRoute(), ns3::aodv::AODVTYPE_RREQ, ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::aodv::RreqHeader::GetDestinationOnly(), ns3::aodv::RreqHeader::GetDst(), ns3::aodv::RreqHeader::GetDstSeqno(), ns3::aodv::RoutingTableEntry::GetFlag(), ns3::aodv::RreqHeader::GetGratuitousRrep(), ns3::aodv::RreqHeader::GetHopCount(), ns3::aodv::RreqHeader::GetId(), ns3::UniformRandomVariable::GetInteger(), ns3::aodv::RoutingTableEntry::GetLifeTime(), ns3::Ipv4InterfaceAddress::GetMask(), ns3::aodv::RoutingTableEntry::GetNextHop(), ns3::Ipv4Mask::GetOnes(), ns3::aodv::RreqHeader::GetOrigin(), ns3::aodv::RreqHeader::GetOriginSeqno(), ns3::aodv::RoutingTableEntry::GetSeqNo(), ns3::SocketIpTtlTag::GetTtl(), ns3::aodv::RreqHeader::GetUnknownSeqno(), ns3::aodv::RoutingTableEntry::GetValidSeqNo(), ns3::aodv::IdCache::IsDuplicate(), IsMyOwnAddress(), ns3::aodv::RoutingTableEntry::IsUnidirectional(), ns3::aodv::RoutingTable::LookupRoute(), m_activeRouteTimeout, m_allowedHelloLoss, m_helloInterval, m_ipv4, m_lastBcastTime, m_nb, m_netTraversalTime, m_nodeTraversalTime, m_routingTable, m_rreqIdCache, m_socketAddresses, m_uniformRandomVariable, max, ns3::MilliSeconds(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), ns3::Simulator::Schedule(), SendReply(), SendReplyByIntermediateNode(), SendTo(), ns3::aodv::RreqHeader::SetDstSeqno(), ns3::aodv::RoutingTableEntry::SetFlag(), ns3::aodv::RoutingTableEntry::SetHop(), ns3::aodv::RreqHeader::SetHopCount(), ns3::aodv::RoutingTableEntry::SetInterface(), ns3::aodv::RoutingTableEntry::SetLifeTime(), ns3::aodv::RoutingTableEntry::SetNextHop(), ns3::aodv::RoutingTableEntry::SetOutputDevice(), ns3::aodv::RoutingTableEntry::SetSeqNo(), ns3::SocketIpTtlTag::SetTtl(), ns3::aodv::RreqHeader::SetUnknownSeqno(), ns3::aodv::RoutingTableEntry::SetValidSeqNo(), ns3::aodv::Neighbors::Update(), ns3::aodv::RoutingTable::Update(), and ns3::aodv::VALID.

Referenced by RecvAodv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RerrRateLimitTimerExpire()

void ns3::aodv::RoutingProtocol::RerrRateLimitTimerExpire ( )
private

Reset RERR count and schedule RERR rate limit timer with delay 1 sec.

Definition at line 1827 of file aodv-routing-protocol.cc.

References m_rerrCount, m_rerrRateLimitTimer, NS_LOG_FUNCTION, ns3::Timer::Schedule(), and ns3::Seconds().

Referenced by Start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RouteInput()

bool ns3::aodv::RoutingProtocol::RouteInput ( Ptr< const Packet p,
const Ipv4Header header,
Ptr< const NetDevice idev,
UnicastForwardCallback  ucb,
MulticastForwardCallback  mcb,
LocalDeliverCallback  lcb,
ErrorCallback  ecb 
)
virtual

Route an input packet (to be forwarded or locally delivered)

This lookup is used in the forwarding process. The packet is handed over to the Ipv4RoutingProtocol, and will get forwarded onward by one of the callbacks. The Linux equivalent is ip_route_input(). There are four valid outcomes, and a matching callbacks to handle each.

Parameters
preceived packet
headerinput parameter used to form a search key for a route
idevPointer to ingress network device
ucbCallback for the case in which the packet is to be forwarded as unicast
mcbCallback for the case in which the packet is to be forwarded as multicast
lcbCallback for the case in which the packet is to be locally delivered
ecbCallback to call if there is an error in forwarding
Returns
true if the Ipv4RoutingProtocol takes responsibility for forwarding or delivering the packet, false otherwise

Implements ns3::Ipv4RoutingProtocol.

Definition at line 450 of file aodv-routing-protocol.cc.

References AODV_PORT, ns3::Packet::Copy(), DeferredRouteOutput(), ns3::Socket::ERROR_NOROUTETOHOST, Forwarding(), ns3::NetDevice::GetAddress(), ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::Ipv4Header::GetDestination(), ns3::UdpHeader::GetDestinationPort(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::aodv::RoutingTableEntry::GetNextHop(), ns3::Ipv4Header::GetProtocol(), ns3::aodv::RoutingTableEntry::GetRoute(), ns3::Ipv4Header::GetSource(), ns3::Ipv4Header::GetTtl(), ns3::Packet::GetUid(), ns3::Ipv4Address::IsBroadcast(), ns3::aodv::DuplicatePacketDetection::IsDuplicate(), ns3::Ipv4Address::IsMulticast(), IsMyOwnAddress(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::aodv::RoutingTable::LookupRoute(), ns3::aodv::RoutingTable::LookupValidRoute(), m_activeRouteTimeout, m_dpd, m_enableBroadcast, m_ipv4, m_lo, m_nb, m_routingTable, m_socketAddresses, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::PeekHeader(), ns3::Packet::PeekPacketTag(), ns3::UdpL4Protocol::PROT_NUMBER, ns3::aodv::Neighbors::Update(), and UpdateRouteLifeTime().

+ Here is the call graph for this function:

◆ RouteOutput()

Ptr< Ipv4Route > ns3::aodv::RoutingProtocol::RouteOutput ( Ptr< Packet p,
const Ipv4Header header,
Ptr< NetDevice oif,
Socket::SocketErrno sockerr 
)
virtual

Query routing cache for an existing route, for an outbound packet.

This lookup is used by transport protocols. It does not cause any packet to be forwarded, and is synchronous. Can be used for multicast or unicast. The Linux equivalent is ip_route_output()

The header input parameter may have an uninitialized value for the source address, but the destination address should always be properly set by the caller.

Parameters
ppacket to be routed. Note that this method may modify the packet. Callers may also pass in a null pointer.
headerinput parameter (used to form key to search for the route)
oifOutput interface Netdevice. May be zero, or may be bound via socket options to a particular output interface.
sockerrOutput parameter; socket errno
Returns
a code that indicates what happened in the lookup

Implements ns3::Ipv4RoutingProtocol.

Definition at line 378 of file aodv-routing-protocol.cc.

References ns3::Packet::AddPacketTag(), ns3::Socket::ERROR_NOROUTETOHOST, ns3::Socket::ERROR_NOTERROR, ns3::Ipv4Header::GetDestination(), ns3::NetDevice::GetIfIndex(), ns3::aodv::RoutingTableEntry::GetRoute(), ns3::aodv::RoutingTable::LookupValidRoute(), LoopbackRoute(), m_activeRouteTimeout, m_ipv4, m_routingTable, m_socketAddresses, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::PeekPacketTag(), and UpdateRouteLifeTime().

+ Here is the call graph for this function:

◆ RouteRequestTimerExpire()

void ns3::aodv::RoutingProtocol::RouteRequestTimerExpire ( Ipv4Address  dst)
private

◆ RreqRateLimitTimerExpire()

void ns3::aodv::RoutingProtocol::RreqRateLimitTimerExpire ( )
private

Reset RREQ count and schedule RREQ rate limit timer with delay 1 sec.

Definition at line 1819 of file aodv-routing-protocol.cc.

References m_rreqCount, m_rreqRateLimitTimer, NS_LOG_FUNCTION, ns3::Timer::Schedule(), and ns3::Seconds().

Referenced by Start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ScheduleRreqRetry()

void ns3::aodv::RoutingProtocol::ScheduleRreqRetry ( Ipv4Address  dst)
private

Repeated attempts by a source node at route discovery for a single destination use the expanding ring search technique.

Parameters
dstthe destination IP address

Definition at line 1090 of file aodv-routing-protocol.cc.

References ns3::Time::As(), ns3::Timer::CANCEL_ON_DESTROY, ns3::aodv::RoutingTableEntry::GetHop(), ns3::aodv::RoutingTableEntry::GetRreqCnt(), ns3::aodv::RoutingTable::LookupRoute(), m_addressReqTimer, m_netDiameter, m_netTraversalTime, m_nodeTraversalTime, m_routingTable, m_timeoutBuffer, NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, NS_LOG_LOGIC, RouteRequestTimerExpire(), and ns3::Time::S.

Referenced by SendRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendHello()

◆ SendPacketFromQueue()

void ns3::aodv::RoutingProtocol::SendPacketFromQueue ( Ipv4Address  dst,
Ptr< Ipv4Route route 
)
private

◆ SendReply()

void ns3::aodv::RoutingProtocol::SendReply ( RreqHeader const &  rreqHeader,
RoutingTableEntry const &  toOrigin 
)
private

◆ SendReplyAck()

void ns3::aodv::RoutingProtocol::SendReplyAck ( Ipv4Address  neighbor)
private

Send RREP_ACK.

Parameters
neighborneighbor address

Definition at line 1495 of file aodv-routing-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), AODV_PORT, ns3::aodv::AODVTYPE_RREP_ACK, FindSocketWithInterfaceAddress(), ns3::aodv::RoutingTableEntry::GetInterface(), ns3::aodv::RoutingTable::LookupRoute(), m_routingTable, NS_ASSERT, NS_LOG_FUNCTION, ns3::Socket::SendTo(), and ns3::SocketIpTtlTag::SetTtl().

Referenced by RecvReply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendReplyByIntermediateNode()

◆ SendRequest()

void ns3::aodv::RoutingProtocol::SendRequest ( Ipv4Address  dst)
private

Send RREQ.

Parameters
dstdestination address

Definition at line 967 of file aodv-routing-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), ns3::aodv::RoutingTable::AddRoute(), ns3::aodv::AODVTYPE_RREQ, ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::Timer::GetDelayLeft(), ns3::aodv::RoutingTableEntry::GetFlag(), ns3::aodv::RoutingTableEntry::GetHop(), ns3::aodv::RreqHeader::GetId(), ns3::UniformRandomVariable::GetInteger(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Ipv4InterfaceAddress::GetMask(), ns3::Ipv4Mask::GetOnes(), ns3::aodv::RoutingTableEntry::GetSeqNo(), ns3::aodv::RoutingTableEntry::GetValidSeqNo(), ns3::aodv::IN_SEARCH, ns3::aodv::RoutingTableEntry::IncrementRreqCnt(), ns3::aodv::IdCache::IsDuplicate(), ns3::aodv::RoutingTable::LookupRoute(), m_destinationOnly, m_gratuitousReply, m_lastBcastTime, m_netDiameter, m_pathDiscoveryTime, m_requestId, m_routingTable, m_rreqCount, m_rreqIdCache, m_rreqRateLimit, m_rreqRateLimitTimer, m_seqNo, m_socketAddresses, m_ttlIncrement, m_ttlStart, m_ttlThreshold, m_uniformRandomVariable, ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ScheduleRreqRetry(), SendTo(), ns3::aodv::RreqHeader::SetDestinationOnly(), ns3::aodv::RreqHeader::SetDst(), ns3::aodv::RreqHeader::SetDstSeqno(), ns3::aodv::RoutingTableEntry::SetFlag(), ns3::aodv::RreqHeader::SetGratuitousRrep(), ns3::aodv::RoutingTableEntry::SetHop(), ns3::aodv::RreqHeader::SetId(), ns3::aodv::RoutingTableEntry::SetLifeTime(), ns3::aodv::RreqHeader::SetOrigin(), ns3::aodv::RreqHeader::SetOriginSeqno(), ns3::SocketIpTtlTag::SetTtl(), ns3::aodv::RreqHeader::SetUnknownSeqno(), and ns3::aodv::RoutingTable::Update().

Referenced by DeferredRouteOutput(), and RouteRequestTimerExpire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendRerrMessage()

◆ SendRerrWhenBreaksLinkToNextHop()

◆ SendRerrWhenNoRouteToForward()

void ns3::aodv::RoutingProtocol::SendRerrWhenNoRouteToForward ( Ipv4Address  dst,
uint32_t  dstSeqNo,
Ipv4Address  origin 
)
private

◆ SendTo()

void ns3::aodv::RoutingProtocol::SendTo ( Ptr< Socket socket,
Ptr< Packet packet,
Ipv4Address  destination 
)
private

Send packet to destination scoket.

Parameters
socket- destination node socket
packet- packet to send
destination- destination node IP address

Definition at line 1084 of file aodv-routing-protocol.cc.

References AODV_PORT, and ns3::Socket::SendTo().

Referenced by RecvRequest(), SendHello(), SendRequest(), and SendRerrMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetBroadcastEnable()

void ns3::aodv::RoutingProtocol::SetBroadcastEnable ( bool  f)
inline

Set broadcast enable flag.

Parameters
fenable broadcast flag

Definition at line 161 of file aodv-routing-protocol.h.

References f(), and m_enableBroadcast.

Referenced by GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDestinationOnlyFlag()

void ns3::aodv::RoutingProtocol::SetDestinationOnlyFlag ( bool  f)
inline

Set destination only flag.

Parameters
fthe destination only flag

Definition at line 121 of file aodv-routing-protocol.h.

References f(), and m_destinationOnly.

Referenced by GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetGratuitousReplyFlag()

void ns3::aodv::RoutingProtocol::SetGratuitousReplyFlag ( bool  f)
inline

Set gratuitous reply flag.

Parameters
fthe gratuitous reply flag

Definition at line 137 of file aodv-routing-protocol.h.

References f(), and m_gratuitousReply.

Referenced by GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetHelloEnable()

void ns3::aodv::RoutingProtocol::SetHelloEnable ( bool  f)
inline

Set hello enable.

Parameters
fthe hello enable flag

Definition at line 145 of file aodv-routing-protocol.h.

References f(), and m_enableHello.

Referenced by GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetIpv4()

void ns3::aodv::RoutingProtocol::SetIpv4 ( Ptr< Ipv4 ipv4)
virtual
Parameters
ipv4the ipv4 object this routing protocol is being associated with

Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol

Implements ns3::Ipv4RoutingProtocol.

Definition at line 648 of file aodv-routing-protocol.cc.

References ns3::aodv::RoutingTable::AddRoute(), ns3::Ipv4Address::GetLoopback(), ns3::Simulator::GetMaximumSimulationTime(), m_ipv4, m_lo, m_routingTable, NS_ASSERT, ns3::Simulator::ScheduleNow(), and Start().

+ Here is the call graph for this function:

◆ SetMaxQueueLen()

void ns3::aodv::RoutingProtocol::SetMaxQueueLen ( uint32_t  len)

Set the maximum queue length.

Parameters
lenthe maximum queue length

Definition at line 304 of file aodv-routing-protocol.cc.

References m_maxQueueLen, m_queue, and ns3::aodv::RequestQueue::SetMaxQueueLen().

Referenced by GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetMaxQueueTime()

void ns3::aodv::RoutingProtocol::SetMaxQueueTime ( Time  t)

Set the maximum queue time.

Parameters
tthe maximum queue time

Definition at line 310 of file aodv-routing-protocol.cc.

References m_maxQueueTime, m_queue, and ns3::aodv::RequestQueue::SetQueueTimeout().

Referenced by GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Start()

void ns3::aodv::RoutingProtocol::Start ( )
private

Start protocol operation.

Definition at line 360 of file aodv-routing-protocol.cc.

References m_enableHello, m_nb, m_rerrRateLimitTimer, m_rreqRateLimitTimer, NS_LOG_FUNCTION, RerrRateLimitTimerExpire(), RreqRateLimitTimerExpire(), ns3::Timer::Schedule(), ns3::aodv::Neighbors::ScheduleTimer(), ns3::Seconds(), and ns3::Timer::SetFunction().

Referenced by SetIpv4().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateRouteLifeTime()

bool ns3::aodv::RoutingProtocol::UpdateRouteLifeTime ( Ipv4Address  addr,
Time  lt 
)
private

Set lifetime field in routing table entry to the maximum of existing lifetime and lt, if the entry exists.

Parameters
addr- destination address
lt- proposed time for lifetime field in routing table entry for destination with address addr.
Returns
true if route to destination address addr exist

Definition at line 1177 of file aodv-routing-protocol.cc.

References ns3::aodv::RoutingTableEntry::GetFlag(), ns3::aodv::RoutingTableEntry::GetLifeTime(), ns3::aodv::RoutingTable::LookupRoute(), m_routingTable, max, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::aodv::RoutingTableEntry::SetLifeTime(), ns3::aodv::RoutingTableEntry::SetRreqCnt(), ns3::aodv::RoutingTable::Update(), and ns3::aodv::VALID.

Referenced by Forwarding(), RouteInput(), and RouteOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateRouteToNeighbor()

void ns3::aodv::RoutingProtocol::UpdateRouteToNeighbor ( Ipv4Address  sender,
Ipv4Address  receiver 
)
private

Update neighbor record.

Parameters
receiveris supposed to be my interface
senderis supposed to be IP address of my neighbor.

Definition at line 1196 of file aodv-routing-protocol.cc.

References ns3::aodv::RoutingTable::AddRoute(), ns3::aodv::RoutingTableEntry::GetHop(), ns3::aodv::RoutingTableEntry::GetLifeTime(), ns3::aodv::RoutingTableEntry::GetOutputDevice(), ns3::aodv::RoutingTableEntry::GetValidSeqNo(), ns3::aodv::RoutingTable::LookupRoute(), m_activeRouteTimeout, m_ipv4, m_routingTable, max, NS_LOG_FUNCTION, ns3::aodv::RoutingTableEntry::SetLifeTime(), and ns3::aodv::RoutingTable::Update().

Referenced by RecvAodv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ AODV_PORT

const uint32_t ns3::aodv::RoutingProtocol::AODV_PORT = 654
static

◆ m_activeRouteTimeout

Time ns3::aodv::RoutingProtocol::m_activeRouteTimeout
private

Period of time during which the route is considered to be valid.

Definition at line 203 of file aodv-routing-protocol.h.

Referenced by Forwarding(), GetTypeId(), RecvReply(), RecvRequest(), RouteInput(), RouteOutput(), and UpdateRouteToNeighbor().

◆ m_addressReqTimer

std::map<Ipv4Address, Timer> ns3::aodv::RoutingProtocol::m_addressReqTimer
private

Map IP address + RREQ timer.

Definition at line 441 of file aodv-routing-protocol.h.

Referenced by RecvReply(), RouteRequestTimerExpire(), and ScheduleRreqRetry().

◆ m_allowedHelloLoss

uint32_t ns3::aodv::RoutingProtocol::m_allowedHelloLoss
private

Number of hello messages which may be loss for valid link.

Definition at line 218 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), ProcessHello(), RecvRequest(), and SendHello().

◆ m_blackListTimeout

Time ns3::aodv::RoutingProtocol::m_blackListTimeout
private

Time for which the node is put into the blacklist.

Definition at line 225 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and SendReplyByIntermediateNode().

◆ m_deletePeriod

Time ns3::aodv::RoutingProtocol::m_deletePeriod
private

DeletePeriod is intended to provide an upper bound on the time for which an upstream node A can have a neighbor B as an active next hop for destination D, while B has invalidated the route to D.

Definition at line 223 of file aodv-routing-protocol.h.

Referenced by GetTypeId().

◆ m_destinationOnly

bool ns3::aodv::RoutingProtocol::m_destinationOnly
private

Indicates only the destination may respond to this RREQ.

Definition at line 228 of file aodv-routing-protocol.h.

Referenced by GetDestinationOnlyFlag(), SendRequest(), and SetDestinationOnlyFlag().

◆ m_dpd

DuplicatePacketDetection ns3::aodv::RoutingProtocol::m_dpd
private

Handle duplicated broadcast/multicast packets.

Definition at line 254 of file aodv-routing-protocol.h.

Referenced by RouteInput().

◆ m_enableBroadcast

bool ns3::aodv::RoutingProtocol::m_enableBroadcast
private

Indicates whether a a broadcast data packets forwarding enable.

Definition at line 231 of file aodv-routing-protocol.h.

Referenced by GetBroadcastEnable(), RouteInput(), and SetBroadcastEnable().

◆ m_enableHello

bool ns3::aodv::RoutingProtocol::m_enableHello
private

Indicates whether a hello messages enable.

Definition at line 230 of file aodv-routing-protocol.h.

Referenced by DoInitialize(), GetHelloEnable(), ProcessHello(), SetHelloEnable(), and Start().

◆ m_gratuitousReply

bool ns3::aodv::RoutingProtocol::m_gratuitousReply
private

Indicates whether a gratuitous RREP should be unicast to the node originated route discovery.

Definition at line 229 of file aodv-routing-protocol.h.

Referenced by GetGratuitousReplyFlag(), SendRequest(), and SetGratuitousReplyFlag().

◆ m_helloInterval

Time ns3::aodv::RoutingProtocol::m_helloInterval
private

Every HelloInterval the node checks whether it has sent a broadcast within the last HelloInterval.

If it has not, it MAY broadcast a Hello message

Definition at line 217 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), HelloTimerExpire(), ProcessHello(), RecvRequest(), and SendHello().

◆ m_htimer

Timer ns3::aodv::RoutingProtocol::m_htimer
private

Hello timer.

Definition at line 429 of file aodv-routing-protocol.h.

Referenced by DoInitialize(), HelloTimerExpire(), NotifyInterfaceDown(), and NotifyRemoveAddress().

◆ m_ipv4

◆ m_lastBcastTime

Time ns3::aodv::RoutingProtocol::m_lastBcastTime
private

Keep track of the last bcast time.

Definition at line 458 of file aodv-routing-protocol.h.

Referenced by HelloTimerExpire(), RecvRequest(), and SendRequest().

◆ m_lo

Ptr<NetDevice> ns3::aodv::RoutingProtocol::m_lo
private

Loopback device used to defer RREQ until packet will be fully formed.

Definition at line 241 of file aodv-routing-protocol.h.

Referenced by LoopbackRoute(), RouteInput(), and SetIpv4().

◆ m_maxQueueLen

uint32_t ns3::aodv::RoutingProtocol::m_maxQueueLen
private

The maximum number of packets that we allow a routing protocol to buffer.

Definition at line 226 of file aodv-routing-protocol.h.

Referenced by GetMaxQueueLen(), and SetMaxQueueLen().

◆ m_maxQueueTime

Time ns3::aodv::RoutingProtocol::m_maxQueueTime
private

The maximum period of time that a routing protocol is allowed to buffer a packet for.

Definition at line 227 of file aodv-routing-protocol.h.

Referenced by GetMaxQueueTime(), and SetMaxQueueTime().

◆ m_myRouteTimeout

Time ns3::aodv::RoutingProtocol::m_myRouteTimeout
private

Value of lifetime field in RREP generating by this node.

Definition at line 212 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and SendReply().

◆ m_nb

Neighbors ns3::aodv::RoutingProtocol::m_nb
private

◆ m_netDiameter

uint32_t ns3::aodv::RoutingProtocol::m_netDiameter
private

Net diameter measures the maximum possible number of hops between two nodes in the network.

Definition at line 204 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), RouteRequestTimerExpire(), ScheduleRreqRetry(), and SendRequest().

◆ m_netTraversalTime

Time ns3::aodv::RoutingProtocol::m_netTraversalTime
private

Estimate of the average net traversal time.

Definition at line 210 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), RecvRequest(), and ScheduleRreqRetry().

◆ m_nextHopWait

Time ns3::aodv::RoutingProtocol::m_nextHopWait
private

Period of our waiting for the neighbour's RREP_ACK.

Definition at line 224 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and SendReplyByIntermediateNode().

◆ m_nodeTraversalTime

Time ns3::aodv::RoutingProtocol::m_nodeTraversalTime
private

NodeTraversalTime is a conservative estimate of the average one hop traversal time for packets and should include queuing delays, interrupt processing times and transfer times.

Definition at line 209 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), RecvRequest(), and ScheduleRreqRetry().

◆ m_pathDiscoveryTime

Time ns3::aodv::RoutingProtocol::m_pathDiscoveryTime
private

Estimate of maximum time needed to find route in network.

Definition at line 211 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and SendRequest().

◆ m_queue

RequestQueue ns3::aodv::RoutingProtocol::m_queue
private

A "drop-front" queue used by the routing layer to buffer packets to which it does not have a route.

Definition at line 246 of file aodv-routing-protocol.h.

Referenced by DeferredRouteOutput(), RouteRequestTimerExpire(), SendPacketFromQueue(), SetMaxQueueLen(), and SetMaxQueueTime().

◆ m_requestId

uint32_t ns3::aodv::RoutingProtocol::m_requestId
private

Broadcast ID.

Definition at line 248 of file aodv-routing-protocol.h.

Referenced by SendRequest().

◆ m_rerrCount

uint16_t ns3::aodv::RoutingProtocol::m_rerrCount
private

Number of RERRs used for RERR rate control.

Definition at line 260 of file aodv-routing-protocol.h.

Referenced by RerrRateLimitTimerExpire(), SendRerrMessage(), and SendRerrWhenNoRouteToForward().

◆ m_rerrRateLimit

uint16_t ns3::aodv::RoutingProtocol::m_rerrRateLimit
private

Maximum number of REER per second.

Definition at line 202 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), SendRerrMessage(), and SendRerrWhenNoRouteToForward().

◆ m_rerrRateLimitTimer

Timer ns3::aodv::RoutingProtocol::m_rerrRateLimitTimer
private

RERR rate limit timer.

Definition at line 437 of file aodv-routing-protocol.h.

Referenced by RerrRateLimitTimerExpire(), SendRerrMessage(), SendRerrWhenNoRouteToForward(), and Start().

◆ m_routingTable

◆ m_rreqCount

uint16_t ns3::aodv::RoutingProtocol::m_rreqCount
private

Number of RREQs used for RREQ rate control.

Definition at line 258 of file aodv-routing-protocol.h.

Referenced by RreqRateLimitTimerExpire(), and SendRequest().

◆ m_rreqIdCache

IdCache ns3::aodv::RoutingProtocol::m_rreqIdCache
private

Handle duplicated RREQ.

Definition at line 252 of file aodv-routing-protocol.h.

Referenced by RecvRequest(), and SendRequest().

◆ m_rreqRateLimit

uint16_t ns3::aodv::RoutingProtocol::m_rreqRateLimit
private

Maximum number of RREQ per second.

Definition at line 201 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and SendRequest().

◆ m_rreqRateLimitTimer

Timer ns3::aodv::RoutingProtocol::m_rreqRateLimitTimer
private

RREQ rate limit timer.

Definition at line 433 of file aodv-routing-protocol.h.

Referenced by RreqRateLimitTimerExpire(), SendRequest(), and Start().

◆ m_rreqRetries

uint32_t ns3::aodv::RoutingProtocol::m_rreqRetries
private

Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route.

Definition at line 196 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and RouteRequestTimerExpire().

◆ m_seqNo

uint32_t ns3::aodv::RoutingProtocol::m_seqNo
private

Request sequence number.

Definition at line 250 of file aodv-routing-protocol.h.

Referenced by SendHello(), SendReply(), and SendRequest().

◆ m_socketAddresses

std::map< Ptr<Socket>, Ipv4InterfaceAddress > ns3::aodv::RoutingProtocol::m_socketAddresses
private

◆ m_socketSubnetBroadcastAddresses

std::map< Ptr<Socket>, Ipv4InterfaceAddress > ns3::aodv::RoutingProtocol::m_socketSubnetBroadcastAddresses
private

Raw subnet directed broadcast socket per each IP interface, map socket -> iface address (IP + mask)

Definition at line 239 of file aodv-routing-protocol.h.

Referenced by DoDispose(), FindSubnetBroadcastSocketWithInterfaceAddress(), NotifyAddAddress(), NotifyInterfaceDown(), NotifyInterfaceUp(), NotifyRemoveAddress(), and RecvAodv().

◆ m_timeoutBuffer

uint16_t ns3::aodv::RoutingProtocol::m_timeoutBuffer
private

Provide a buffer for the timeout.

Definition at line 200 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and ScheduleRreqRetry().

◆ m_ttlIncrement

uint16_t ns3::aodv::RoutingProtocol::m_ttlIncrement
private

TTL increment for each attempt using the expanding ring search for RREQ dissemination.

Definition at line 198 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and SendRequest().

◆ m_ttlStart

uint16_t ns3::aodv::RoutingProtocol::m_ttlStart
private

Initial TTL value for RREQ.

Definition at line 197 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and SendRequest().

◆ m_ttlThreshold

uint16_t ns3::aodv::RoutingProtocol::m_ttlThreshold
private

Maximum TTL value for expanding ring search, TTL = NetDiameter is used beyond this value.

Definition at line 199 of file aodv-routing-protocol.h.

Referenced by GetTypeId(), and SendRequest().

◆ m_uniformRandomVariable

Ptr<UniformRandomVariable> ns3::aodv::RoutingProtocol::m_uniformRandomVariable
private

Provides uniform random variables.

Definition at line 456 of file aodv-routing-protocol.h.

Referenced by AssignStreams(), DoInitialize(), GetTypeId(), RecvRequest(), SendHello(), SendRequest(), and SendRerrMessage().


The documentation for this class was generated from the following files: