ns-3
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:

List of all members.

Public Member Functions

 RoutingProtocol ()
 c-tor
virtual void DoDispose ()
From Ipv4RoutingProtocol
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.
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)
virtual void NotifyInterfaceUp (uint32_t interface)
virtual void NotifyInterfaceDown (uint32_t interface)
virtual void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address)
virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address)
virtual void SetIpv4 (Ptr< Ipv4 > ipv4)
virtual void PrintRoutingTable (Ptr< OutputStreamWrapper > stream) const
 Print the Routing Table entries.
Handle protocol parameters
Time GetMaxQueueTime () const
void SetMaxQueueTime (Time t)
uint32_t GetMaxQueueLen () const
void SetMaxQueueLen (uint32_t len)
bool GetDesinationOnlyFlag () const
void SetDesinationOnlyFlag (bool f)
bool GetGratuitousReplyFlag () const
void SetGratuitousReplyFlag (bool f)
void SetHelloEnable (bool f)
bool GetHelloEnable () const
void SetBroadcastEnable (bool f)
bool GetBroadcastEnable () const

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::aodv::RoutingProtocol.

Static Public Attributes

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

Additional Inherited Members

- Public Types inherited from ns3::Ipv4RoutingProtocol
typedef Callback< void, Ptr
< Ipv4Route >, Ptr< const
Packet >, const Ipv4Header & > 
UnicastForwardCallback
typedef Callback< void, Ptr
< Ipv4MulticastRoute >, Ptr
< const Packet >, const
Ipv4Header & > 
MulticastForwardCallback
typedef Callback< void, Ptr
< const Packet >, const
Ipv4Header &, uint32_t > 
LocalDeliverCallback
typedef Callback< void, Ptr
< const Packet >, const
Ipv4Header
&, Socket::SocketErrno > 
ErrorCallback

Detailed Description

AODV routing protocol.


Member Function Documentation

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

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

Subclasses are expected to implement their real destruction code in an overriden 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.

TypeId ns3::aodv::RoutingProtocol::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::aodv::RoutingProtocol.

Attributes defined for this type:

  • HelloInterval: HELLO messages emission interval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +1000000000.0ns
    • Flags: construct write read
  • RreqRetries: Maximum number of retransmissions of RREQ to discover a route
  • RreqRateLimit: Maximum number of RREQ per second.
  • RerrRateLimit: Maximum number of RERR per second.
  • 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: TimeValue
    • Underlying type: Time
    • Initial value: +40000000.0ns
    • Flags: construct write read
  • NextHopWait: Period of our waiting for the neighbour's RREP_ACK = 10 ms + NodeTraversalTime
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +50000000.0ns
    • Flags: construct write read
  • ActiveRouteTimeout: Period of time during which the route is considered to be valid
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +3000000000.0ns
    • Flags: construct write read
  • MyRouteTimeout: Value of lifetime field in RREP generating by this node = 2 * max(ActiveRouteTimeout, PathDiscoveryTime)
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +11199999999.0ns
    • Flags: construct write read
  • BlackListTimeout: Time for which the node is put into the blacklist = RreqRetries * NetTraversalTime
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +5599999999.0ns
    • 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: TimeValue
    • Underlying type: Time
    • Initial value: +15000000000.0ns
    • Flags: construct write read
  • TimeoutBuffer: Its purpose is to provide a buffer for the timeout so that if the RREP is delayed due to congestion, a timeout is less likely to occur while the RREP is still en route back to the source.
  • NetDiameter: Net diameter measures the maximum possible number of hops between two nodes in the network
  • NetTraversalTime: Estimate of the average net traversal time = 2 * NodeTraversalTime * NetDiameter
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +2799999999.0ns
    • Flags: construct write read
  • PathDiscoveryTime: Estimate of maximum time needed to find route in network = 2 * NetTraversalTime
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +5599999999.0ns
    • Flags: construct write read
  • MaxQueueLen: Maximum number of packets that we allow a routing protocol to buffer.
  • MaxQueueTime: Maximum time packets can be queued (in seconds)
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +30000000000.0ns
    • Flags: construct write read
  • AllowedHelloLoss: Number of hello messages which may be loss for valid link.
  • 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

No TraceSources defined for this type.

Reimplemented from ns3::Ipv4RoutingProtocol.

References ns3::MilliSeconds(), ns3::Seconds(), and ns3::TypeId::SetParent().

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.

References ns3::aodv::RoutingTable::AddRoute(), AODV_PORT, ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), ns3::Socket::CreateSocket(), ns3::Ipv4L3Protocol::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Ipv4::GetInterfaceForAddress(), ns3::Simulator::GetMaximumSimulationTime(), ns3::Ipv4L3Protocol::GetNAddresses(), ns3::Ipv4::GetNetDevice(), ns3::Ipv4L3Protocol::GetNetDevice(), ns3::Object::GetObject(), ns3::UdpSocketFactory::GetTypeId(), ns3::Ipv4L3Protocol::IsUp(), ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().

void ns3::aodv::RoutingProtocol::NotifyInterfaceDown ( uint32_t  interface)
virtual
void ns3::aodv::RoutingProtocol::NotifyRemoveAddress ( 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 removed from an interface. Typically used to remove the 'network route' of an interface. Can be invoked on an up or down interface.

Implements ns3::Ipv4RoutingProtocol.

References ns3::aodv::RoutingTable::AddRoute(), AODV_PORT, ns3::Socket::Bind(), ns3::Timer::Cancel(), ns3::aodv::Neighbors::Clear(), ns3::aodv::RoutingTable::Clear(), ns3::Socket::CreateSocket(), ns3::aodv::RoutingTable::DeleteAllRoutesFromInterface(), ns3::Ipv4L3Protocol::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Ipv4::GetInterfaceForAddress(), ns3::Simulator::GetMaximumSimulationTime(), ns3::Ipv4L3Protocol::GetNAddresses(), ns3::Ipv4::GetNetDevice(), ns3::Object::GetObject(), ns3::UdpSocketFactory::GetTypeId(), ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().

void ns3::aodv::RoutingProtocol::PrintRoutingTable ( Ptr< OutputStreamWrapper stream) const
virtual

Print the Routing Table entries.

Parameters:
streamthe ostream the Routing table is printed to

Implements ns3::Ipv4RoutingProtocol.

References ns3::Object::GetObject(), ns3::Time::GetSeconds(), ns3::Now(), and ns3::aodv::RoutingTable::Print().

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.

References ns3::Packet::Copy(), ns3::NetDevice::GetAddress(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4::GetInterfaceForAddress(), ns3::Ipv4::GetInterfaceForDevice(), ns3::Ipv4Header::GetSource(), ns3::Ipv4Header::GetTtl(), ns3::Packet::GetUid(), ns3::Ipv4Address::IsBroadcast(), ns3::Ipv4::IsDestinationAddress(), ns3::aodv::DuplicatePacketDetection::IsDuplicate(), ns3::Ipv4Address::IsMulticast(), ns3::aodv::RoutingTable::LookupRoute(), ns3::aodv::RoutingTable::LookupValidRoute(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::PeekPacketTag(), and ns3::aodv::Neighbors::Update().

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()

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.

References ns3::Packet::AddPacketTag(), ns3::Ipv4Route::GetDestination(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4Route::GetGateway(), ns3::NetDevice::GetIfIndex(), ns3::Ipv4::GetInterfaceForDevice(), ns3::Ipv4Route::GetOutputDevice(), ns3::Ipv4Route::GetSource(), ns3::aodv::RoutingTable::LookupValidRoute(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::Packet::PeekPacketTag().

void ns3::aodv::RoutingProtocol::SetIpv4 ( Ptr< Ipv4 ipv4)
virtual

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