|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
33 #ifndef DSDV_ROUTING_PROTOCOL_H
34 #define DSDV_ROUTING_PROTOCOL_H
40 #include "ns3/random-variable-stream.h"
41 #include "ns3/ipv4-routing-protocol.h"
42 #include "ns3/ipv4-interface.h"
43 #include "ns3/ipv4-l3-protocol.h"
44 #include "ns3/output-stream-wrapper.h"
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.
a unique identifier for an interface.
Ptr< Ipv4Route > LoopbackRoute(const Ipv4Header &header, Ptr< NetDevice > oif) const
Create loopback route for given header.
virtual void NotifyInterfaceUp(uint32_t interface)
Timer m_periodicUpdateTimer
Timer to trigger periodic updates from a node.
uint32_t m_maxQueuedPacketsPerDst
The maximum number of packets that we allow per destination to buffer.
static TypeId GetTypeId(void)
Get the type ID.
bool GetEnableBufferFlag() const
Get enable buffer flag.
Timer m_triggeredExpireTimer
Timer used by the trigger updates in case of Weighted Settling Time is used.
SocketErrno
Enumeration of the possible errors returned by a socket.
void RecvDsdv(Ptr< Socket > socket)
Receive and process dsdv control packet.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)
Ipv4Address m_mainAddress
Nodes IP address.
bool EnableWST
Flag that is used to enable or disable Weighted Settling Time.
Time m_settlingTime
SettlingTime specifies the time for which a node waits before propagating an update.
double m_weightedFactor
This is the wighted factor to determine the weighted settling time.
Time GetSettlingTime(Ipv4Address dst)
Get settlingTime for a destination.
virtual void DoDispose()
Destructor implementation.
Ipv4 addresses are stored in host order in this class.
void Drop(Ptr< const Packet >, const Ipv4Header &, Socket::SocketErrno)
Notify that packet is dropped for some reason.
uint32_t m_maxQueueLen
The maximum number of packets that we allow a routing protocol to buffer.
Time m_maxQueueTime
The maximum period of time that a routing protocol is allowed to buffer a packet for.
A simple virtual Timer class.
Callback< void, Ptr< Ipv4Route >, Ptr< const Packet >, const Ipv4Header & > UnicastForwardCallback
Callback for unicast packets to be forwarded.
Smart pointer class similar to boost::intrusive_ptr.
bool EnableRouteAggregation
This is a flag to enable route aggregation.
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print the Routing Table entries.
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables.
ErrorCallback m_ecb
Error callback for own packets.
a class to store IPv4 address information on an interface
The Routing table used by DSDV protocol.
void SetWSTFlag(bool f)
Set weighted settling time (WST) flag.
bool GetWSTFlag() const
Get weighted settling time (WST) flag.
virtual ~RoutingProtocol()
void Send(Ptr< Ipv4Route >, Ptr< const Packet >, const Ipv4Header &)
Send packet.
void DeferredRouteOutput(Ptr< const Packet > p, const Ipv4Header &header, UnicastForwardCallback ucb, ErrorCallback ecb)
Queue packet until we find a route.
void LookForQueuedPackets(void)
Look for any queued packets to send them out.
Time m_routeAggregationTime
Parameter that holds the route aggregation time interval.
Simulation virtual time values and global simulation resolution.
Time m_periodicUpdateInterval
PeriodicUpdateInterval specifies the periodic time interval between which the a node broadcasts its e...
void Start()
Start protocol operation.
uint32_t Holdtimes
Holdtimes is the multiplicative factor of PeriodicUpdateInterval for which the node waits since the l...
Ptr< Socket > FindSocketWithInterfaceAddress(Ipv4InterfaceAddress iface) const
Find socket with local interface address iface.
Abstract base class for IPv4 routing protocols.
virtual void NotifyInterfaceDown(uint32_t interface)
Ptr< Ipv4 > m_ipv4
IP protocol.
UnicastForwardCallback m_scb
Unicast callback for own packets.
void SendTriggeredUpdate()
Sends trigger update from a node.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)
Route input packet.
double f(double x, void *params)
PacketQueue m_queue
A "drop front on full" queue used by the routing layer to buffer packets to which it does not have a ...
void SendPeriodicUpdate()
Broadcasts the entire routing table for every PeriodicUpdateInterval.
void MergeTriggerPeriodicUpdates()
Merge periodic updates.
static const uint32_t DSDV_PORT
UDP Port for DSDV control traffic.
bool EnableBuffering
Flag that is used to enable or disable buffering.
bool GetEnableRAFlag() const
Get enable route aggregation (RA) flag.
void SendPacketFromQueue(Ipv4Address dst, Ptr< Ipv4Route > route)
Send packet from queue.
void SetEnableBufferFlag(bool f)
Set enable buffer flag.
Ptr< NetDevice > m_lo
Loopback device used to defer route requests until a route is found.
void SetEnableRAFlag(bool f)
Set enable route aggregation (RA) flag.
virtual void SetIpv4(Ptr< Ipv4 > ipv4)
Unit
The unit to use to interpret a number representing time.
RoutingTable m_routingTable
Main Routing table for the node.
std::map< Ptr< Socket >, Ipv4InterfaceAddress > m_socketAddresses
Raw socket per each IP interface, map socket -> iface address (IP + mask)
RoutingTable m_advRoutingTable
Advertised Routing table for the node.