DSDV routing protocol. More...
#include "dsdv-routing-protocol.h"
Public Member Functions | |
RoutingProtocol () | |
c-tor 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 | GetEnableBufferFlag () const |
bool | GetEnableRAFlag () const |
bool | GetWSTFlag () const |
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) 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) |
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. More... | |
void | SetEnableBufferFlag (bool f) |
void | SetEnableRAFlag (bool f) |
virtual void | SetIpv4 (Ptr< Ipv4 > ipv4) |
void | SetWSTFlag (bool f) |
![]() | |
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) More... | |
![]() | |
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 |
Implement the GetInstanceTypeId method defined in ObjectBase. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. 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... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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) |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Attributes | |
static const uint32_t | DSDV_PORT = 269 |
UDP Port for DSDV control traffic. More... | |
Private Member Functions | |
void | DeferredRouteOutput (Ptr< const Packet > p, const Ipv4Header &header, UnicastForwardCallback ucb, ErrorCallback ecb) |
Queue packet untill we find a route. More... | |
void | Drop (Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrno) |
Notify that packet is dropped for some reason. More... | |
Ptr< Socket > | FindSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const |
Find socket with local interface address iface. More... | |
Time | GetSettlingTime (Ipv4Address dst) |
Get settlingTime for a destination. More... | |
void | LookForQueuedPackets (void) |
Look for any queued packets to send them out. More... | |
Ptr< Ipv4Route > | LoopbackRoute (const Ipv4Header &header, Ptr< NetDevice > oif) const |
Create loopback route for given header. More... | |
void | MergeTriggerPeriodicUpdates () |
void | RecvDsdv (Ptr< Socket > socket) |
Receive and process dsdv control packet. More... | |
void | Send (Ptr< Ipv4Route >, Ptr< const Packet >, const Ipv4Header &) |
void | SendPacketFromQueue (Ipv4Address dst, Ptr< Ipv4Route > route) |
Send packet from queue. More... | |
void | SendPeriodicUpdate () |
Broadcasts the entire routing table for every PeriodicUpdateInterval. More... | |
void | SendTriggeredUpdate () |
Sends trigger update from a node. More... | |
void | Start () |
Start protocol operation. More... | |
Private Attributes | |
bool | EnableBuffering |
Flag that is used to enable or disable buffering. More... | |
bool | EnableRouteAggregation |
This is a flag to enable route aggregation. More... | |
bool | EnableWST |
Flag that is used to enable or disable Weighted Settling Time. More... | |
uint32_t | Holdtimes |
Holdtimes is the multiplicative factor of PeriodicUpdateInterval for which the node waits since the last update before flushing a route from the routing table. More... | |
RoutingTable | m_advRoutingTable |
Advertised Routing table for the node. More... | |
ErrorCallback | m_ecb |
Error callback for own packets. More... | |
Ptr< Ipv4 > | m_ipv4 |
IP protocol. More... | |
Ptr< NetDevice > | m_lo |
Loopback device used to defer route requests until a route is found. More... | |
Ipv4Address | m_mainAddress |
Nodes IP address. More... | |
uint32_t | m_maxQueuedPacketsPerDst |
The maximum number of packets that we allow per destination to buffer. 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_periodicUpdateInterval |
PeriodicUpdateInterval specifies the periodic time interval between which the a node broadcasts its entire routing table. More... | |
Timer | m_periodicUpdateTimer |
Timer to trigger periodic updates from a node. More... | |
PacketQueue | m_queue |
A "drop front on full" queue used by the routing layer to buffer packets to which it does not have a route. More... | |
Time | m_routeAggregationTime |
Parameter that holds the route aggregation time interval. More... | |
RoutingTable | m_routingTable |
Main Routing table for the node. More... | |
UnicastForwardCallback | m_scb |
Unicast callback for own packets. More... | |
Time | m_settlingTime |
SettlingTime specifies the time for which a node waits before propagating an update. More... | |
std::map< Ptr< Socket >, Ipv4InterfaceAddress > | m_socketAddresses |
Raw socket per each IP interface, map socket -> iface address (IP + mask) More... | |
Timer | m_triggeredExpireTimer |
Timer used by the trigger updates in case of Weighted Settling Time is used. More... | |
Ptr< UniformRandomVariable > | m_uniformRandomVariable |
Provides uniform random variables. More... | |
double | m_weightedFactor |
This is the wighted factor to determine the weighted settling time. More... | |
Additional Inherited Members | |
![]() | |
typedef Callback< void, Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrno > | ErrorCallback |
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... | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
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... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
DSDV routing protocol.
ns3::dsdv::RoutingProtocol is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 552 bytes (on a 64-bit architecture).
Definition at line 53 of file dsdv-routing-protocol.h.
ns3::dsdv::RoutingProtocol::RoutingProtocol | ( | ) |
|
virtual |
Definition at line 214 of file dsdv-routing-protocol.cc.
int64_t ns3::dsdv::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.
stream | first stream index to use |
Definition at line 198 of file dsdv-routing-protocol.cc.
References m_uniformRandomVariable, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
private |
Queue packet untill we find a route.
Definition at line 350 of file dsdv-routing-protocol.cc.
References ns3::dsdv::PacketQueue::Enqueue(), ns3::Packet::GetUid(), m_queue, NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by RouteInput().
|
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 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.
Definition at line 219 of file dsdv-routing-protocol.cc.
References ns3::Object::DoDispose(), m_ipv4, and m_socketAddresses.
|
private |
Notify that packet is dropped for some reason.
Definition at line 1101 of file dsdv-routing-protocol.cc.
References ns3::Ipv4Header::GetDestination(), ns3::Packet::GetUid(), m_mainAddress, and NS_LOG_DEBUG.
Referenced by Start().
|
private |
Find socket with local interface address iface.
Definition at line 1073 of file dsdv-routing-protocol.cc.
References m_socketAddresses.
Referenced by NotifyAddAddress(), NotifyInterfaceDown(), and NotifyRemoveAddress().
bool ns3::dsdv::RoutingProtocol::GetEnableBufferFlag | ( | ) | const |
Definition at line 172 of file dsdv-routing-protocol.cc.
References EnableBuffering.
Referenced by GetTypeId().
bool ns3::dsdv::RoutingProtocol::GetEnableRAFlag | ( | ) | const |
Definition at line 192 of file dsdv-routing-protocol.cc.
References EnableRouteAggregation.
Referenced by GetTypeId().
|
private |
Get settlingTime for a destination.
dst | - destination address |
Definition at line 1177 of file dsdv-routing-protocol.cc.
References EnableWST, ns3::dsdv::RoutingTableEntry::GetLifeTime(), ns3::Time::GetSeconds(), ns3::dsdv::RoutingTableEntry::GetSettlingTime(), ns3::dsdv::RoutingTable::LookupRoute(), m_routingTable, m_weightedFactor, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Seconds().
Referenced by RecvDsdv().
|
static |
Definition at line 109 of file dsdv-routing-protocol.cc.
References GetEnableBufferFlag(), GetEnableRAFlag(), GetWSTFlag(), Holdtimes, m_maxQueuedPacketsPerDst, m_maxQueueLen, m_maxQueueTime, m_periodicUpdateInterval, m_routeAggregationTime, m_settlingTime, m_weightedFactor, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeDoubleAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeUintegerAccessor(), ns3::Seconds(), SetEnableBufferFlag(), SetEnableRAFlag(), ns3::TypeId::SetParent(), and SetWSTFlag().
bool ns3::dsdv::RoutingProtocol::GetWSTFlag | ( | ) | const |
Definition at line 182 of file dsdv-routing-protocol.cc.
References EnableWST.
Referenced by GetTypeId().
|
private |
Look for any queued packets to send them out.
Definition at line 1110 of file dsdv-routing-protocol.cc.
References ns3::dsdv::PacketQueue::Find(), ns3::Ipv4Route::GetDestination(), ns3::dsdv::RoutingTableEntry::GetDestination(), ns3::dsdv::RoutingTableEntry::GetHop(), ns3::dsdv::RoutingTable::GetListOfAllRoutes(), ns3::dsdv::RoutingTableEntry::GetNextHop(), ns3::dsdv::RoutingTableEntry::GetRoute(), ns3::Ipv4Route::GetSource(), ns3::dsdv::RoutingTable::LookupRoute(), m_queue, m_routingTable, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and SendPacketFromQueue().
Referenced by RouteOutput().
|
private |
Create loopback route for given header.
Definition at line 500 of file dsdv-routing-protocol.cc.
References ns3::Ipv4Header::GetDestination(), ns3::Ipv4Route::GetSource(), m_ipv4, m_lo, m_socketAddresses, NS_ASSERT, NS_ASSERT_MSG, ns3::Ipv4Route::SetDestination(), ns3::Ipv4Route::SetGateway(), ns3::Ipv4Route::SetOutputDevice(), and ns3::Ipv4Route::SetSource().
Referenced by RouteOutput().
|
private |
Definition at line 1203 of file dsdv-routing-protocol.cc.
References ns3::dsdv::RoutingTable::AnyRunningEvent(), ns3::dsdv::RoutingTable::DeleteRoute(), ns3::dsdv::RoutingTableEntry::GetDestination(), ns3::dsdv::RoutingTableEntry::GetEntriesChanged(), ns3::dsdv::RoutingTable::GetListOfAllRoutes(), ns3::dsdv::RoutingTableEntry::GetSeqNo(), m_advRoutingTable, m_routingTable, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::dsdv::RoutingTableEntry::SetEntriesChanged(), ns3::dsdv::RoutingTableEntry::SetFlag(), ns3::dsdv::RoutingTable::Update(), and ns3::dsdv::VALID.
Referenced by SendPeriodicUpdate().
|
virtual |
interface | the index of the interface we are being notified about |
address | a 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 1016 of file dsdv-routing-protocol.cc.
References ns3::dsdv::RoutingTable::AddRoute(), ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), ns3::Socket::CreateSocket(), DSDV_PORT, FindSocketWithInterfaceAddress(), ns3::Ipv4Address::GetAny(), ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Simulator::GetMaximumSimulationTime(), ns3::UdpSocketFactory::GetTypeId(), m_ipv4, m_routingTable, m_socketAddresses, ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, RecvDsdv(), ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().
|
virtual |
interface | the 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.
Definition at line 997 of file dsdv-routing-protocol.cc.
References ns3::dsdv::RoutingTable::Clear(), ns3::Socket::Close(), ns3::dsdv::RoutingTable::DeleteAllRoutesFromInterface(), FindSocketWithInterfaceAddress(), m_advRoutingTable, m_ipv4, m_routingTable, m_socketAddresses, NS_ASSERT, and NS_LOG_LOGIC.
|
virtual |
interface | the 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.
Definition at line 965 of file dsdv-routing-protocol.cc.
References ns3::dsdv::RoutingTable::AddRoute(), ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), ns3::Socket::CreateSocket(), DSDV_PORT, ns3::Ipv4Address::GetAny(), ns3::Simulator::GetMaximumSimulationTime(), ns3::UdpSocketFactory::GetTypeId(), m_ipv4, m_mainAddress, m_routingTable, m_socketAddresses, ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, RecvDsdv(), ns3::Socket::SetAllowBroadcast(), ns3::ObjectBase::SetAttribute(), and ns3::Socket::SetRecvCallback().
|
virtual |
interface | the index of the interface we are being notified about |
address | a 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.
Definition at line 1049 of file dsdv-routing-protocol.cc.
References ns3::Socket::Bind(), ns3::Socket::CreateSocket(), DSDV_PORT, FindSocketWithInterfaceAddress(), ns3::Ipv4Address::GetAny(), ns3::UdpSocketFactory::GetTypeId(), m_ipv4, m_socketAddresses, ns3::MakeCallback(), NS_ASSERT, RecvDsdv(), ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().
|
virtual |
Print the Routing Table entries.
stream | the ostream the Routing table is printed to |
Implements ns3::Ipv4RoutingProtocol.
Definition at line 232 of file dsdv-routing-protocol.cc.
References ns3::Time::As(), ns3::OutputStreamWrapper::GetStream(), m_ipv4, m_routingTable, ns3::Now(), ns3::dsdv::RoutingTable::Print(), and ns3::Time::S.
Receive and process dsdv control packet.
Definition at line 548 of file dsdv-routing-protocol.cc.
References ns3::dsdv::RoutingTable::AddIpv4Event(), ns3::dsdv::RoutingTable::AddRoute(), ns3::dsdv::RoutingTable::AnyRunningEvent(), ns3::InetSocketAddress::ConvertFrom(), ns3::dsdv::RoutingTable::DeleteRoute(), EnableRouteAggregation, ns3::dsdv::RoutingTable::ForceDeleteIpv4Event(), ns3::Timer::GetDelayLeft(), ns3::dsdv::DsdvHeader::GetDst(), ns3::dsdv::DsdvHeader::GetDstSeqno(), ns3::dsdv::DsdvHeader::GetHopCount(), ns3::RandomVariableStream::GetInteger(), ns3::InetSocketAddress::GetIpv4(), ns3::dsdv::RoutingTable::GetListOfAllRoutes(), ns3::dsdv::RoutingTable::GetListOfDestinationWithNextHop(), ns3::Time::GetSeconds(), GetSettlingTime(), ns3::EventId::GetUid(), ns3::dsdv::RoutingTable::LookupRoute(), m_advRoutingTable, m_ipv4, m_mainAddress, m_periodicUpdateTimer, m_routeAggregationTime, m_routingTable, m_settlingTime, m_socketAddresses, m_uniformRandomVariable, ns3::MicroSeconds(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, packetSize, ns3::Socket::RecvFrom(), ns3::Simulator::Schedule(), SendTriggeredUpdate(), ns3::dsdv::RoutingTableEntry::SetFlag(), ns3::dsdv::RoutingTable::Update(), and ns3::dsdv::VALID.
Referenced by NotifyAddAddress(), NotifyInterfaceUp(), and NotifyRemoveAddress().
bool ns3::dsdv::RoutingProtocol::RouteInput | ( | Ptr< const Packet > | p, |
const Ipv4Header & | header, | ||
Ptr< const NetDevice > | idev, | ||
UnicastForwardCallback | ucb, | ||
MulticastForwardCallback | mcb, | ||
LocalDeliverCallback | lcb, | ||
ErrorCallback | ecb | ||
) |
Definition at line 366 of file dsdv-routing-protocol.cc.
References ns3::Packet::Copy(), DeferredRouteOutput(), EnableBuffering, ns3::Socket::ERROR_NOROUTETOHOST, ns3::NetDevice::GetAddress(), ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::dsdv::RoutingTableEntry::GetNextHop(), ns3::dsdv::RoutingTableEntry::GetRoute(), ns3::Ipv4Header::GetSource(), ns3::Ipv4Header::GetTtl(), ns3::Packet::GetUid(), ns3::Ipv4Address::IsBroadcast(), ns3::Ipv4Address::IsMulticast(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::dsdv::RoutingTable::LookupRoute(), m_ipv4, m_lo, m_mainAddress, m_routingTable, m_socketAddresses, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::Packet::PeekPacketTag().
|
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.
p | packet to be routed. Note that this method may modify the packet. Callers may also pass in a null pointer. |
header | input parameter (used to form key to search for the route) |
oif | Output interface Netdevice. May be zero, or may be bound via socket options to a particular output interface. |
sockerr | Output parameter; socket errno |
Implements ns3::Ipv4RoutingProtocol.
Definition at line 258 of file dsdv-routing-protocol.cc.
References ns3::Packet::AddPacketTag(), ns3::dsdv::RoutingTable::AddRoute(), EnableBuffering, ns3::Socket::ERROR_NOROUTETOHOST, ns3::Socket::ERROR_NOTERROR, ns3::Ipv4Route::GetDestination(), ns3::Ipv4Header::GetDestination(), ns3::RandomVariableStream::GetInteger(), ns3::Ipv4Route::GetOutputDevice(), ns3::dsdv::RoutingTableEntry::GetRoute(), ns3::Packet::GetSize(), ns3::Ipv4Route::GetSource(), ns3::Packet::GetUid(), LookForQueuedPackets(), ns3::dsdv::RoutingTable::LookupRoute(), LoopbackRoute(), m_advRoutingTable, m_ipv4, m_routingTable, m_socketAddresses, m_uniformRandomVariable, ns3::MicroSeconds(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::PeekPacketTag(), ns3::dsdv::RoutingTable::Purge(), ns3::Simulator::Schedule(), and SendTriggeredUpdate().
|
private |
Definition at line 1090 of file dsdv-routing-protocol.cc.
References ns3::Packet::Copy(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetProtocol(), ns3::Ipv4Route::GetSource(), m_ipv4, and NS_ASSERT.
Referenced by Start().
|
private |
Send packet from queue.
dst | - destination address to which we are sending the packet to |
route | - route identified for this packet |
Definition at line 1146 of file dsdv-routing-protocol.cc.
References ns3::dsdv::PacketQueue::Dequeue(), ns3::dsdv::PacketQueue::Find(), ns3::RandomVariableStream::GetInteger(), ns3::dsdv::QueueEntry::GetIpv4Header(), ns3::Ipv4Route::GetOutputDevice(), ns3::dsdv::QueueEntry::GetPacket(), ns3::dsdv::PacketQueue::GetSize(), ns3::Ipv4Route::GetSource(), ns3::Ipv4Header::GetTtl(), ns3::dsdv::QueueEntry::GetUnicastForwardCallback(), m_ipv4, m_mainAddress, m_queue, m_uniformRandomVariable, ns3::MilliSeconds(), NS_LOG_DEBUG, ns3::dsdv::DeferredRouteOutputTag::oif, ns3::Packet::RemovePacketTag(), ns3::Simulator::Schedule(), ns3::Ipv4Header::SetSource(), and ns3::Ipv4Header::SetTtl().
Referenced by LookForQueuedPackets().
|
private |
Broadcasts the entire routing table for every PeriodicUpdateInterval.
Definition at line 866 of file dsdv-routing-protocol.cc.
References ns3::Packet::AddHeader(), DSDV_PORT, ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::dsdv::DsdvHeader::GetDst(), ns3::dsdv::DsdvHeader::GetDstSeqno(), ns3::dsdv::DsdvHeader::GetHopCount(), ns3::RandomVariableStream::GetInteger(), ns3::dsdv::RoutingTable::GetListOfAllRoutes(), ns3::Ipv4InterfaceAddress::GetMask(), ns3::Ipv4Mask::GetOnes(), ns3::Packet::GetUid(), ns3::dsdv::RoutingTable::LookupRoute(), m_ipv4, m_mainAddress, m_periodicUpdateInterval, m_periodicUpdateTimer, m_routingTable, m_socketAddresses, m_uniformRandomVariable, MergeTriggerPeriodicUpdates(), ns3::MicroSeconds(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::dsdv::RoutingTable::Purge(), ns3::Timer::Schedule(), ns3::Socket::Send(), ns3::Socket::SendTo(), ns3::dsdv::DsdvHeader::SetDst(), ns3::dsdv::DsdvHeader::SetDstSeqno(), ns3::dsdv::DsdvHeader::SetHopCount(), ns3::dsdv::RoutingTableEntry::SetSeqNo(), and ns3::dsdv::RoutingTable::Update().
Referenced by Start().
|
private |
Sends trigger update from a node.
Definition at line 792 of file dsdv-routing-protocol.cc.
References ns3::Packet::AddHeader(), ns3::dsdv::RoutingTable::AnyRunningEvent(), ns3::dsdv::RoutingTable::DeleteIpv4Event(), ns3::dsdv::RoutingTable::DeleteRoute(), DSDV_PORT, ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::dsdv::DsdvHeader::GetDst(), ns3::dsdv::RoutingTable::GetEventId(), ns3::dsdv::RoutingTableEntry::GetHop(), ns3::dsdv::RoutingTable::GetListOfAllRoutes(), ns3::Ipv4InterfaceAddress::GetMask(), ns3::Ipv4Mask::GetOnes(), ns3::dsdv::RoutingTableEntry::GetSeqNo(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::dsdv::RoutingTable::LookupRoute(), m_advRoutingTable, m_ipv4, m_mainAddress, m_routingTable, m_socketAddresses, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Socket::SendTo(), ns3::dsdv::DsdvHeader::SetDst(), ns3::dsdv::DsdvHeader::SetDstSeqno(), ns3::dsdv::DsdvHeader::SetHopCount(), ns3::dsdv::RoutingTable::Update(), and ns3::dsdv::VALID.
Referenced by RecvDsdv(), and RouteOutput().
void ns3::dsdv::RoutingProtocol::SetEnableBufferFlag | ( | bool | f | ) |
Definition at line 167 of file dsdv-routing-protocol.cc.
References EnableBuffering, and f().
Referenced by GetTypeId().
void ns3::dsdv::RoutingProtocol::SetEnableRAFlag | ( | bool | f | ) |
Definition at line 187 of file dsdv-routing-protocol.cc.
References EnableRouteAggregation, and f().
Referenced by GetTypeId().
ipv4 | the ipv4 object this routing protocol is being associated with |
Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol
Implements ns3::Ipv4RoutingProtocol.
Definition at line 940 of file dsdv-routing-protocol.cc.
References ns3::dsdv::RoutingTable::AddRoute(), ns3::Ipv4Address::GetLoopback(), ns3::Simulator::GetMaximumSimulationTime(), ns3::dsdv::INVALID, m_ipv4, m_lo, m_routingTable, NS_ASSERT, ns3::Simulator::ScheduleNow(), ns3::dsdv::RoutingTableEntry::SetEntriesChanged(), ns3::dsdv::RoutingTableEntry::SetFlag(), and Start().
void ns3::dsdv::RoutingProtocol::SetWSTFlag | ( | bool | f | ) |
Definition at line 177 of file dsdv-routing-protocol.cc.
References EnableWST, and f().
Referenced by GetTypeId().
|
private |
Start protocol operation.
Definition at line 244 of file dsdv-routing-protocol.cc.
References Drop(), ns3::RandomVariableStream::GetInteger(), Holdtimes, m_advRoutingTable, m_ecb, m_maxQueuedPacketsPerDst, m_maxQueueLen, m_maxQueueTime, m_periodicUpdateInterval, m_periodicUpdateTimer, m_queue, m_routingTable, m_scb, m_uniformRandomVariable, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::Timer::Schedule(), Send(), SendPeriodicUpdate(), ns3::Timer::SetFunction(), ns3::dsdv::RoutingTable::Setholddowntime(), ns3::dsdv::PacketQueue::SetMaxPacketsPerDst(), ns3::dsdv::PacketQueue::SetMaxQueueLen(), and ns3::dsdv::PacketQueue::SetQueueTimeout().
Referenced by SetIpv4().
|
static |
UDP Port for DSDV control traffic.
Definition at line 58 of file dsdv-routing-protocol.h.
Referenced by NotifyAddAddress(), NotifyInterfaceUp(), NotifyRemoveAddress(), SendPeriodicUpdate(), and SendTriggeredUpdate().
|
private |
Flag that is used to enable or disable buffering.
Definition at line 130 of file dsdv-routing-protocol.h.
Referenced by GetEnableBufferFlag(), RouteInput(), RouteOutput(), and SetEnableBufferFlag().
|
private |
This is a flag to enable route aggregation.
Route aggregation will aggregate all routes for 'RouteAggregationTime' from the time an update is received by a node and sends them as a single update .
Definition at line 137 of file dsdv-routing-protocol.h.
Referenced by GetEnableRAFlag(), RecvDsdv(), and SetEnableRAFlag().
|
private |
Flag that is used to enable or disable Weighted Settling Time.
Definition at line 132 of file dsdv-routing-protocol.h.
Referenced by GetSettlingTime(), GetWSTFlag(), and SetWSTFlag().
|
private |
Holdtimes is the multiplicative factor of PeriodicUpdateInterval for which the node waits since the last update before flushing a route from the routing table.
If PeriodicUpdateInterval is 8s and Holdtimes is 3, the node waits for 24s since the last update to flush this route from its routing table.
Definition at line 102 of file dsdv-routing-protocol.h.
Referenced by GetTypeId(), and Start().
|
private |
Advertised Routing table for the node.
Definition at line 120 of file dsdv-routing-protocol.h.
Referenced by MergeTriggerPeriodicUpdates(), NotifyInterfaceDown(), RecvDsdv(), RouteOutput(), SendTriggeredUpdate(), and Start().
|
private |
Error callback for own packets.
Definition at line 143 of file dsdv-routing-protocol.h.
Referenced by Start().
IP protocol.
Definition at line 112 of file dsdv-routing-protocol.h.
Referenced by DoDispose(), LoopbackRoute(), NotifyAddAddress(), NotifyInterfaceDown(), NotifyInterfaceUp(), NotifyRemoveAddress(), PrintRoutingTable(), RecvDsdv(), RouteInput(), RouteOutput(), Send(), SendPacketFromQueue(), SendPeriodicUpdate(), SendTriggeredUpdate(), and SetIpv4().
Loopback device used to defer route requests until a route is found.
Definition at line 116 of file dsdv-routing-protocol.h.
Referenced by LoopbackRoute(), RouteInput(), and SetIpv4().
|
private |
Nodes IP address.
Definition at line 110 of file dsdv-routing-protocol.h.
Referenced by Drop(), NotifyInterfaceUp(), RecvDsdv(), RouteInput(), SendPacketFromQueue(), SendPeriodicUpdate(), and SendTriggeredUpdate().
|
private |
The maximum number of packets that we allow per destination to buffer.
Definition at line 124 of file dsdv-routing-protocol.h.
Referenced by GetTypeId(), and Start().
|
private |
The maximum number of packets that we allow a routing protocol to buffer.
Definition at line 122 of file dsdv-routing-protocol.h.
Referenced by GetTypeId(), and Start().
|
private |
The maximum period of time that a routing protocol is allowed to buffer a packet for.
Definition at line 126 of file dsdv-routing-protocol.h.
Referenced by GetTypeId(), and Start().
|
private |
PeriodicUpdateInterval specifies the periodic time interval between which the a node broadcasts its entire routing table.
Definition at line 105 of file dsdv-routing-protocol.h.
Referenced by GetTypeId(), SendPeriodicUpdate(), and Start().
|
private |
Timer to trigger periodic updates from a node.
Definition at line 196 of file dsdv-routing-protocol.h.
Referenced by RecvDsdv(), SendPeriodicUpdate(), and Start().
|
private |
A "drop front on full" queue used by the routing layer to buffer packets to which it does not have a route.
Definition at line 128 of file dsdv-routing-protocol.h.
Referenced by DeferredRouteOutput(), LookForQueuedPackets(), SendPacketFromQueue(), and Start().
|
private |
Parameter that holds the route aggregation time interval.
Definition at line 139 of file dsdv-routing-protocol.h.
Referenced by GetTypeId(), and RecvDsdv().
|
private |
Main Routing table for the node.
Definition at line 118 of file dsdv-routing-protocol.h.
Referenced by GetSettlingTime(), LookForQueuedPackets(), MergeTriggerPeriodicUpdates(), NotifyAddAddress(), NotifyInterfaceDown(), NotifyInterfaceUp(), PrintRoutingTable(), RecvDsdv(), RouteInput(), RouteOutput(), SendPeriodicUpdate(), SendTriggeredUpdate(), SetIpv4(), and Start().
|
private |
Unicast callback for own packets.
Definition at line 141 of file dsdv-routing-protocol.h.
Referenced by Start().
|
private |
SettlingTime specifies the time for which a node waits before propagating an update.
It waits for this time interval in hope of receiving an update with a better metric.
Definition at line 108 of file dsdv-routing-protocol.h.
Referenced by GetTypeId(), and RecvDsdv().
|
private |
Raw socket per each IP interface, map socket -> iface address (IP + mask)
Definition at line 114 of file dsdv-routing-protocol.h.
Referenced by DoDispose(), FindSocketWithInterfaceAddress(), LoopbackRoute(), NotifyAddAddress(), NotifyInterfaceDown(), NotifyInterfaceUp(), NotifyRemoveAddress(), RecvDsdv(), RouteInput(), RouteOutput(), SendPeriodicUpdate(), and SendTriggeredUpdate().
|
private |
Timer used by the trigger updates in case of Weighted Settling Time is used.
Definition at line 198 of file dsdv-routing-protocol.h.
|
private |
Provides uniform random variables.
Definition at line 201 of file dsdv-routing-protocol.h.
Referenced by AssignStreams(), RecvDsdv(), RouteOutput(), RoutingProtocol(), SendPacketFromQueue(), SendPeriodicUpdate(), and Start().
|
private |
This is the wighted factor to determine the weighted settling time.
Definition at line 134 of file dsdv-routing-protocol.h.
Referenced by GetSettlingTime(), and GetTypeId().