|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
35 #include "ns3/inet-socket-address.h"
36 #include "ns3/trace-source-accessor.h"
37 #include "ns3/udp-socket-factory.h"
38 #include "ns3/boolean.h"
39 #include "ns3/double.h"
40 #include "ns3/uinteger.h"
77 static TypeId tid =
TypeId (
"ns3::dsdv::DeferredRouteOutputTag")
79 .SetGroupName (
"Dsdv")
94 return sizeof(int32_t);
112 os <<
"DeferredRouteOutputTag: output interface = " <<
oif;
119 static TypeId tid =
TypeId (
"ns3::dsdv::RoutingProtocol")
121 .SetGroupName (
"Dsdv")
123 .AddAttribute (
"PeriodicUpdateInterval",
"Periodic interval between exchange of full routing tables among nodes. ",
127 .AddAttribute (
"SettlingTime",
"Minimum time an update is to be stored in adv table before sending out"
128 "in case of change in metric (in seconds)",
132 .AddAttribute (
"MaxQueueLen",
"Maximum number of packets that we allow a routing protocol to buffer.",
135 MakeUintegerChecker<uint32_t> ())
136 .AddAttribute (
"MaxQueuedPacketsPerDst",
"Maximum number of packets that we allow per destination to buffer.",
139 MakeUintegerChecker<uint32_t> ())
140 .AddAttribute (
"MaxQueueTime",
"Maximum time packets can be queued (in seconds)",
144 .AddAttribute (
"EnableBuffering",
"Enables buffering of data packets if no route to destination is available",
149 .AddAttribute (
"EnableWST",
"Enables Weighted Settling Time for the updates before advertising",
154 .AddAttribute (
"Holdtimes",
"Times the forwarding Interval to purge the route.",
157 MakeUintegerChecker<uint32_t> ())
158 .AddAttribute (
"WeightedFactor",
"WeightedFactor for the settling time if Weighted Settling Time is enabled",
161 MakeDoubleChecker<double> ())
162 .AddAttribute (
"EnableRouteAggregation",
"Enables Weighted Settling Time for the updates before advertising",
167 .AddAttribute (
"RouteAggregationTime",
"Time to aggregate updates before sending them out (in seconds)",
215 m_advRoutingTable (),
217 m_periodicUpdateTimer (
Timer::CANCEL_ON_DESTROY)
233 iter->first->Close ();
243 <<
", Time: " <<
Now ().
As (unit)
244 <<
", Local time: " <<
m_ipv4->GetObject<
Node> ()->GetLocalTime ().As (unit)
245 <<
", DSDV Routing table" << std::endl;
284 std::map<Ipv4Address, RoutingTableEntry> removedAddresses;
289 <<
", Packet id: " << p->
GetUid () <<
", Destination address in Packet: " << dst);
292 for (std::map<Ipv4Address, RoutingTableEntry>::iterator rmItr = removedAddresses.begin ();
293 rmItr != removedAddresses.end (); ++rmItr)
295 rmItr->second.SetEntriesChanged (
true);
296 rmItr->second.SetSeqNo (rmItr->second.GetSeqNo () + 1);
299 if (!removedAddresses.empty ())
313 NS_LOG_DEBUG (
"A route exists from " << route->GetSource ()
314 <<
" to neighboring destination "
315 << route->GetDestination ());
316 if (oif != 0 && route->GetOutputDevice () != oif)
331 NS_LOG_DEBUG (
"A route exists from " << route->GetSource ()
332 <<
" to destination " << dst <<
" via "
334 if (oif != 0 && route->GetOutputDevice () != oif)
347 uint32_t iif = (oif ?
m_ipv4->GetInterfaceForDevice (oif) : -1);
360 UnicastForwardCallback ucb,
377 UnicastForwardCallback ucb,
394 int32_t iif =
m_ipv4->GetInterfaceForDevice (idev);
434 if (lcb.
IsNull () ==
false)
437 lcb (p, header, iif);
442 NS_LOG_ERROR (
"Unable to deliver packet locally due to null callback " << p->
GetUid () <<
" from " << origin);
452 ucb (route,packet,header);
464 if (
m_ipv4->IsDestinationAddress (dst, iif))
466 if (lcb.
IsNull () ==
false)
469 lcb (p, header, iif);
473 NS_LOG_ERROR (
"Unable to deliver packet locally due to null callback " << p->
GetUid () <<
" from " << origin);
480 if (
m_ipv4->IsForwarding (iif) ==
false)
482 NS_LOG_LOGIC (
"Forwarding disabled for this interface");
497 <<
" via nexthop neighbor " << toDst.
GetNextHop ());
498 ucb (route,p,header);
503 <<
" as there is no route to forward it.");
537 int32_t
interface =
m_ipv4->GetInterfaceForAddress (addr);
538 if (oif ==
m_ipv4->GetNetDevice (
static_cast<uint32_t
> (interface)))
540 rt->SetSource (addr);
547 rt->SetSource (j->second.GetLocal ());
551 rt->SetOutputDevice (
m_lo);
567 <<
" and packet id: " << packet->
GetUid ());
580 if (dsdvHeader.
GetDst () == interface.GetLocal ())
584 NS_LOG_DEBUG (
"Sent Dsdv update back to the same Destination, "
585 "with infinite metric. Time left to send fwd update: "
591 NS_LOG_DEBUG (
"Received update for my address. Discarding this.");
601 << sender <<
" to " << receiver <<
". Details are: Destination: " << dsdvHeader.
GetDst () <<
", Seq No: "
606 if (permanentTableVerifier ==
false)
615 m_ipv4->GetAddress (
m_ipv4->GetInterfaceForAddress (receiver), 0),
629 NS_LOG_DEBUG (
"Discarding this update as this route is not present in "
630 "main routing table and received with infinite metric");
638 std::map<Ipv4Address, RoutingTableEntry> allRoutes;
640 for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator i = allRoutes.begin (); i != allRoutes.end (); ++i)
642 NS_LOG_DEBUG (
"ADV table routes are:" << i->second.GetDestination ());
655 NS_LOG_DEBUG (
"Canceling the timer to update route with better seq number");
666 NS_LOG_DEBUG (
"Received update with better sequence number and changed metric.Waiting for WST");
670 <<
" as there is no event running for this route");
688 NS_LOG_DEBUG (
"Route with better sequence number and same metric received. Advertised without WST");
698 NS_LOG_DEBUG (
"Canceling any existing timer to update route with same sequence number "
699 "and better hop count");
710 <<
" as there is no current event running for this route");
736 NS_LOG_DEBUG (
"Received update with same seq number and "
737 "same/worst metric for, " << dsdvHeader.
GetDst () <<
". Discarding the update.");
747 NS_LOG_DEBUG (dsdvHeader.
GetDst () <<
" : Received update with old seq number. Discarding the update.");
752 NS_LOG_DEBUG (
"Route with infinite metric received for "
753 << dsdvHeader.
GetDst () <<
" from " << sender);
757 NS_LOG_DEBUG (
"Triggering an update for this unreachable route:");
758 std::map<Ipv4Address, RoutingTableEntry> dstsWithNextHopSrc;
764 for (std::map<Ipv4Address, RoutingTableEntry>::iterator i = dstsWithNextHopSrc.begin (); i
765 != dstsWithNextHopSrc.end (); ++i)
767 i->second.SetSeqNo (i->second.GetSeqNo () + 1);
768 i->second.SetEntriesChanged (
true);
780 " : Discard this link break update as it was received from a different neighbor "
781 "and I can reach the destination");
786 std::map<Ipv4Address, RoutingTableEntry> allRoutes;
803 std::map<Ipv4Address, RoutingTableEntry> allRoutes;
812 for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator i = allRoutes.begin (); i != allRoutes.end (); ++i)
814 NS_LOG_LOGIC (
"Destination: " << i->second.GetDestination ()
815 <<
" SeqNo:" << i->second.GetSeqNo () <<
" HopCount:"
816 << i->second.GetHop () + 1);
820 dsdvHeader.
SetDst (i->second.GetDestination ());
832 NS_LOG_DEBUG (
"Deleted this route from the advertised table");
838 NS_LOG_DEBUG (
"EventID " << event.GetUid () <<
" associated with "
839 << temp.
GetDestination () <<
" has not expired, waiting in adv table");
846 dsdvHeader.
SetDst (
m_ipv4->GetAddress (1, 0).GetLocal ());
849 NS_LOG_DEBUG (
"Adding my update as well to the packet");
864 <<
" with packet id : " << packet->
GetUid () <<
" and packet Size: " << packet->
GetSize ());
868 NS_LOG_FUNCTION (
"Update not sent as there are no updates to be triggered");
876 std::map<Ipv4Address, RoutingTableEntry> removedAddresses, allRoutes;
880 if (allRoutes.empty ())
891 for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator i = allRoutes.begin (); i != allRoutes.end (); ++i)
894 if (i->second.GetHop () == 0)
897 dsdvHeader.
SetDst (
m_ipv4->GetAddress (1,0).GetLocal ());
898 dsdvHeader.
SetDstSeqno (i->second.GetSeqNo () + 2);
907 dsdvHeader.
SetDst (i->second.GetDestination ());
912 NS_LOG_DEBUG (
"Forwarding the update for " << i->first);
916 <<
", LifeTime: " << i->second.GetLifeTime ().As (
Time::S));
918 for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator rmItr = removedAddresses.begin (); rmItr
919 != removedAddresses.end (); ++rmItr)
922 removedHeader.
SetDst (rmItr->second.GetDestination ());
923 removedHeader.
SetDstSeqno (rmItr->second.GetSeqNo () + 1);
924 removedHeader.
SetHopCount (rmItr->second.GetHop () + 1);
926 NS_LOG_DEBUG (
"Update for removed record is: Destination: " << removedHeader.
GetDst ()
930 socket->
Send (packet);
976 <<
" interface is up");
979 if (iface.GetLocal () ==
Ipv4Address (
"127.0.0.1"))
1065 if (l3->GetNAddresses (i))
1122 std::map<Ipv4Address, RoutingTableEntry> allRoutes;
1124 for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator i = allRoutes.begin (); i != allRoutes.end (); ++i)
1133 NS_LOG_LOGIC (
"A route exists from " << route->GetSource ()
1134 <<
" to neighboring destination "
1135 << route->GetDestination ());
1143 NS_LOG_LOGIC (
"A route exists from " << route->GetSource ()
1144 <<
" to destination " << route->GetDestination () <<
" via "
1165 if (tag.
oif != -1 && tag.
oif !=
m_ipv4->GetInterfaceForDevice (route->GetOutputDevice ()))
1167 NS_LOG_DEBUG (
"Output device doesn't match. Dropped.");
1175 ucb (route,p,header);
1204 return weightedTime;
1213 NS_LOG_FUNCTION (
"Merging advertised table changes with main table before sending out periodic update");
1214 std::map<Ipv4Address, RoutingTableEntry> allRoutes;
1216 if (allRoutes.size () > 0)
1218 for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator i = allRoutes.begin (); i != allRoutes.end (); ++i)
1234 NS_LOG_DEBUG (
"Event currently running. Cannot Merge Routing Tables");
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.
uint32_t GetSize()
Get the number of entries.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void NotifyInterfaceUp(uint32_t interface)
void SetSettlingTime(Time settlingTime)
Set settling time.
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.
virtual bool SetAllowBroadcast(bool allowBroadcast)=0
Configure whether broadcast datagram transmissions are allowed.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
bool DeleteRoute(Ipv4Address dst)
Delete routing table entry with destination address dst, if it exists.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
AttributeValue implementation for Boolean.
static TypeId GetTypeId(void)
Get the type ID.
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
bool GetEnableBufferFlag() const
Get enable buffer flag.
An identifier for simulation events.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void AddHeader(const Header &header)
Add header to this packet.
SocketErrno
Enumeration of the possible errors returned by a socket.
virtual Address GetAddress(void) const =0
void RecvDsdv(Ptr< Socket > socket)
Receive and process dsdv control packet.
void SetLifeTime(Time lifeTime)
Set lifetime.
Ipv4Address GetNextHop() const
Get next hop.
EventId GetEventId(Ipv4Address address)
Get the EcentId associated with that address.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)
bool AnyRunningEvent(Ipv4Address address)
Force delete an update waiting for settling time to complete as a better update to same destination w...
TAG_BUFFER_INLINE void WriteU32(uint32_t v)
bool IsNull(void) const
Check for null implementation.
void Clear()
Delete all entries from routing table.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ipv4Mask GetMask(void) const
Get the network mask.
void SetMaxPacketsPerDst(uint32_t len)
Set maximum packets per destination.
Ipv4Address m_mainAddress
Nodes IP address.
bool GetEntriesChanged() const
Get entries changed.
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.
bool AddIpv4Event(Ipv4Address address, EventId id)
Add an event for a destination address so that the update to for that destination is sent after the e...
Time GetSettlingTime(Ipv4Address dst)
Get settlingTime for a destination.
virtual void DoDispose()
Destructor implementation.
Ipv4 addresses are stored in host order in this class.
bool DeleteIpv4Event(Ipv4Address address)
Clear up the entry from the map after the event is completed.
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.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
void SetSeqNo(uint32_t sequenceNumber)
Set sequence number.
TAG_BUFFER_INLINE uint32_t ReadU32(void)
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
Time m_maxQueueTime
The maximum period of time that a routing protocol is allowed to buffer a packet for.
static InetSocketAddress ConvertFrom(const Address &address)
Returns an InetSocketAddress which corresponds to the input Address.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Time GetDelayLeft(void) const
A simple virtual Timer class.
Callback< void, Ptr< Ipv4Route >, Ptr< const Packet >, const Ipv4Header & > UnicastForwardCallback
Callback for unicast packets to be forwarded.
bool IsMulticast(void) const
void SetHop(uint32_t hopCount)
Set hop.
void SetQueueTimeout(Time t)
Set queue timeout.
bool EnableRouteAggregation
This is a flag to enable route aggregation.
void Setholddowntime(Time t)
Set hold down time (time until an invalid route may be deleted)
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print the Routing Table entries.
void SetRecvCallback(Callback< void, Ptr< Socket > > receivedData)
Notify application when new data is available to be read.
TypeId GetInstanceTypeId() const
Get the most derived TypeId for this Object.
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables.
ErrorCallback m_ecb
Error callback for own packets.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
tag a set of bytes in a packet
a polymophic address class
a class to store IPv4 address information on an interface
Ptr< Ipv4Route > GetRoute() const
Get route.
uint32_t GetUid(void) const
void Schedule(void)
Schedule a new event using the currently-configured delay, function, and arguments.
void DeleteAllRoutesFromInterface(Ipv4InterfaceAddress iface)
Delete all route from interface with address iface.
bool AddRoute(RoutingTableEntry &r)
Add routing table entry if it doesn't yet exist in routing table.
Ipv4Header GetIpv4Header() const
Get IP header.
void SetWSTFlag(bool f)
Set weighted settling time (WST) flag.
virtual Ptr< Packet > RecvFrom(uint32_t maxSize, uint32_t flags, Address &fromAddress)=0
Read a single packet from the socket and retrieve the sender address.
Ipv4Address GetIpv4(void) const
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
bool GetWSTFlag() const
Get weighted settling time (WST) flag.
virtual ~RoutingProtocol()
void GetListOfAllRoutes(std::map< Ipv4Address, RoutingTableEntry > &allRoutes)
Lookup list of all addresses in the routing table.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
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.
bool Update(RoutingTableEntry &rt)
Updating the routing Table with routing table entry rt.
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.
virtual int Close(void)=0
Close a socket.
Time m_periodicUpdateInterval
PeriodicUpdateInterval specifies the periodic time interval between which the a node broadcasts its e...
void Print(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
Print routing table.
void Start()
Start protocol operation.
Tag used by DSDV implementation.
bool IsBroadcast(void) const
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
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.
static Ipv4Address GetLoopback(void)
static Time GetMaximumSimulationTime(void)
Get the maximum representable simulation time.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
static TypeId GetTypeId(void)
Get the type ID.
Abstract base class for IPv4 routing protocols.
virtual void NotifyInterfaceDown(uint32_t interface)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
void GetListOfDestinationWithNextHop(Ipv4Address nxtHp, std::map< Ipv4Address, RoutingTableEntry > &dstList)
Lookup list of addresses for which nxtHp is the next Hop address.
Ptr< Ipv4 > m_ipv4
IP protocol.
Ipv4Address GetDestination() const
Get destination IP address.
static TypeId GetTypeId()
Get the type ID.
Time GetLifeTime() const
Get lifetime.
bool Dequeue(Ipv4Address dst, QueueEntry &entry)
Return first found (the earliest) entry for given destination.
UnicastForwardCallback m_scb
Unicast callback for own packets.
void SendTriggeredUpdate()
Sends trigger update from a node.
static Ipv4Address GetAny(void)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
int32_t oif
Positive if output device is fixed in RouteOutput.
void SetNextHop(Ipv4Address nextHop)
Set next hop.
static const uint32_t packetSize
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void SetMaxQueueLen(uint32_t len)
Set maximum queue length.
Ptr< const Packet > GetPacket() const
Get packet.
bool ForceDeleteIpv4Event(Ipv4Address address)
Force delete an update waiting for settling time to complete as a better update to same destination w...
Time Seconds(double value)
Construct a Time in the indicated unit.
Time GetSettlingTime() const
Get settling time.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
uint32_t GetSeqNo() const
Get sequence number.
bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)
Route input packet.
void Print(std::ostream &os) const
double f(double x, void *params)
Implement the IPv4 layer.
static Ipv4Mask GetOnes(void)
virtual void BindToNetDevice(Ptr< NetDevice > netdevice)
Bind a socket to specific device.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
AttributeValue implementation for Time.
PacketQueue m_queue
A "drop front on full" queue used by the routing layer to buffer packets to which it does not have a ...
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
a class to represent an Ipv4 address mask
void SendPeriodicUpdate()
Broadcasts the entire routing table for every PeriodicUpdateInterval.
void MergeTriggerPeriodicUpdates()
Merge periodic updates.
Ipv4Address GetLocal(void) const
Get the local address.
static const uint32_t DSDV_PORT
UDP Port for DSDV control traffic.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
uint32_t GetHop() const
Get hop.
Hold an unsigned integer type.
UnicastForwardCallback GetUnicastForwardCallback() const
Get unicast forward callback function.
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
bool EnableBuffering
Flag that is used to enable or disable buffering.
void SetFlag(RouteFlags flag)
Set route flags.
bool Enqueue(QueueEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
bool GetEnableRAFlag() const
Get enable route aggregation (RA) flag.
void SendPacketFromQueue(Ipv4Address dst, Ptr< Ipv4Route > route)
Send packet from queue.
void SetEntriesChanged(bool entriesChanged)
Set entries changed indicator.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
DeferredRouteOutputTag(int32_t o=-1)
Constructor.
Ipv4Address GetBroadcast(void) const
Get the broadcast address.
void SetEnableBufferFlag(bool f)
Set enable buffer flag.
virtual uint32_t GetIfIndex(void) const =0
void Purge(std::map< Ipv4Address, RoutingTableEntry > &removedAddresses)
Delete all outdated entries if Lifetime is expired.
virtual void DoDispose(void)
Destructor implementation.
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.
bool LookupRoute(Ipv4Address dst, RoutingTableEntry &rt)
Lookup routing table entry with destination address dst.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
virtual void SetIpv4(Ptr< Ipv4 > ipv4)
Unit
The unit to use to interpret a number representing time.
uint32_t GetSerializedSize() const
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
uint64_t GetUid(void) const
Returns the packet's Uid.
void Deserialize(TagBuffer i)
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
void Serialize(TagBuffer i) const
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.