ns-3
ns3::dsdv::RoutingProtocol Class Reference

DSDV routing protocol. More...

#include <dsdv-routing-protocol.h>

Inheritance diagram for ns3::dsdv::RoutingProtocol:
Collaboration diagram for ns3::dsdv::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)
virtual void PrintRoutingTable (Ptr< OutputStreamWrapper > stream) const
 Print the Routing Table entries.
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)
Methods to handle protocol parameters
void SetEnableBufferFlag (bool f)
bool GetEnableBufferFlag () const
void SetWSTFlag (bool f)
bool GetWSTFlag () const
void SetEnableRAFlag (bool f)
bool GetEnableRAFlag () const
- Public Member Functions inherited from ns3::Ipv4RoutingProtocol
virtual bool RouteInput (Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)=0
 Route an input packet (to be forwarded or locally delivered)
- Public Member Functions inherited from ns3::Object
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Dispose (void)
void AggregateObject (Ptr< Object > other)
AggregateIterator GetAggregateIterator (void) const
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const
- Public Member Functions inherited from ns3::ObjectBase
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

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

Static Public Attributes

static const uint32_t DSDV_PORT = 269
 UDP Port for DSDV 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

DSDV routing protocol.


Member Function Documentation

void ns3::dsdv::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::dsdv::RoutingProtocol::GetTypeId ( void  )
static

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

Attributes defined for this type:

  • PeriodicUpdateInterval: Periodic interval between exchange of full routing tables among nodes.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +15000000000.0ns
    • Flags: construct write read
  • SettlingTime: Minimum time an update is to be stored in adv table before sending outin case of change in metric (in seconds)
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +5000000000.0ns
    • Flags: construct write read
  • MaxQueueLen: Maximum number of packets that we allow a routing protocol to buffer.
  • MaxQueuedPacketsPerDst: Maximum number of packets that we allow per destination 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
  • EnableBuffering: Enables buffering of data packets if no route to destination is available
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • EnableWST: Enables Weighted Settling Time for the updates before advertising
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • Holdtimes: Times the forwarding Interval to purge the route.
  • WeightedFactor: WeightedFactor for the settling time if Weighted Settling Time is enabled
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.875
    • Flags: construct write read
  • EnableRouteAggregation: Enables Weighted Settling Time for the updates before advertising
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: false
    • Flags: construct write read
  • RouteAggregationTime: Time to aggregate updates before sending them out (in seconds)
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +1000000000.0ns
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::Ipv4RoutingProtocol.

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

void ns3::dsdv::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::dsdv::RoutingTable::AddRoute(), ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), ns3::Socket::CreateSocket(), DSDV_PORT, ns3::Ipv4L3Protocol::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Ipv4::GetInterfaceForAddress(), ns3::Simulator::GetMaximumSimulationTime(), ns3::Ipv4::GetNetDevice(), ns3::Ipv4L3Protocol::GetNetDevice(), ns3::Object::GetObject(), ns3::UdpSocketFactory::GetTypeId(), ns3::Ipv4L3Protocol::IsUp(), ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().

void ns3::dsdv::RoutingProtocol::NotifyInterfaceDown ( uint32_t  interface)
virtual
Parameters:
interfacethe index of the interface we are being notified about

Protocols are expected to implement this method to be notified of the state change of an interface in a node.

Implements ns3::Ipv4RoutingProtocol.

References ns3::dsdv::RoutingTable::Clear(), ns3::Socket::Close(), ns3::dsdv::RoutingTable::DeleteAllRoutesFromInterface(), ns3::Ipv4::GetAddress(), ns3::Ipv4L3Protocol::GetNetDevice(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_LOGIC.

void ns3::dsdv::RoutingProtocol::NotifyInterfaceUp ( uint32_t  interface)
virtual
void ns3::dsdv::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::Socket::Bind(), ns3::Socket::CreateSocket(), DSDV_PORT, ns3::Ipv4L3Protocol::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Ipv4L3Protocol::GetNAddresses(), ns3::Object::GetObject(), ns3::UdpSocketFactory::GetTypeId(), ns3::MakeCallback(), NS_ASSERT, ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().

void ns3::dsdv::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::dsdv::RoutingTable::Print().

Ptr< Ipv4Route > ns3::dsdv::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::dsdv::RoutingTable::AddRoute(), ns3::Ipv4Route::GetDestination(), ns3::Ipv4Header::GetDestination(), ns3::NetDevice::GetIfIndex(), ns3::Ipv4::GetInterfaceForDevice(), ns3::Ipv4Route::GetOutputDevice(), ns3::Packet::GetSize(), ns3::Ipv4Route::GetSource(), ns3::Packet::GetUid(), ns3::dsdv::RoutingTable::LookupRoute(), ns3::MicroSeconds(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::PeekPacketTag(), ns3::dsdv::RoutingTable::Purge(), and ns3::Simulator::Schedule().

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

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