A Discrete-Event Network Simulator
API
Public Member Functions | Public Attributes | Private Attributes | List of all members
ns3::aodv::RoutingTableEntry Class Reference

Routing table entry. More...

#include "aodv-rtable.h"

Public Member Functions

 RoutingTableEntry (Ptr< NetDevice > dev=0, Ipv4Address dst=Ipv4Address(), bool vSeqNo=false, uint32_t seqNo=0, Ipv4InterfaceAddress iface=Ipv4InterfaceAddress(), uint16_t hops=0, Ipv4Address nextHop=Ipv4Address(), Time lifetime=Simulator::Now())
 constructor More...
 
 ~RoutingTableEntry ()
 
Time GetBlacklistTimeout () const
 Get the blacklist timeout value. More...
 
Ipv4Address GetDestination () const
 Get destination address function. More...
 
RouteFlags GetFlag () const
 Get the route flags. More...
 
uint16_t GetHop () const
 Get the number of hops. More...
 
Ipv4InterfaceAddress GetInterface () const
 Get the Ipv4InterfaceAddress. More...
 
Time GetLifeTime () const
 Get the lifetime. More...
 
Ipv4Address GetNextHop () const
 Get next hop address. More...
 
Ptr< NetDeviceGetOutputDevice () const
 Get output device. More...
 
Ptr< Ipv4RouteGetRoute () const
 Get route function. More...
 
uint8_t GetRreqCnt () const
 Get the RREQ count. More...
 
uint32_t GetSeqNo () const
 Get the sequence number. More...
 
bool GetValidSeqNo () const
 Get the valid sequence number. More...
 
void IncrementRreqCnt ()
 Increment the RREQ count. More...
 
void Invalidate (Time badLinkLifetime)
 Mark entry as "down" (i.e. More...
 
bool IsUnidirectional () const
 Get the unidirectional flag. More...
 
bool operator== (Ipv4Address const dst) const
 Compare destination address. More...
 
void Print (Ptr< OutputStreamWrapper > stream) const
 Print packet to trace file. More...
 
void SetBlacklistTimeout (Time t)
 Set the blacklist timeout. More...
 
void SetFlag (RouteFlags flag)
 Set the route flags. More...
 
void SetHop (uint16_t hop)
 Set the number of hops. More...
 
void SetInterface (Ipv4InterfaceAddress iface)
 Set the Ipv4InterfaceAddress. More...
 
void SetLifeTime (Time lt)
 Set the lifetime. More...
 
void SetNextHop (Ipv4Address nextHop)
 Set next hop address. More...
 
void SetOutputDevice (Ptr< NetDevice > dev)
 Set output device. More...
 
void SetRoute (Ptr< Ipv4Route > r)
 Set route function. More...
 
void SetRreqCnt (uint8_t n)
 Set the RREQ count. More...
 
void SetSeqNo (uint32_t sn)
 Set the sequence number. More...
 
void SetUnidirectional (bool u)
 Set the unidirectional flag. More...
 
void SetValidSeqNo (bool s)
 Set the valid sequence number. More...
 
Precursors management
bool InsertPrecursor (Ipv4Address id)
 Insert precursor in precursor list if it doesn't yet exist in the list. More...
 
bool LookupPrecursor (Ipv4Address id)
 Lookup precursor by address. More...
 
bool DeletePrecursor (Ipv4Address id)
 Delete precursor. More...
 
void DeleteAllPrecursors ()
 Delete all precursors. More...
 
bool IsPrecursorListEmpty () const
 Check that precursor list is empty. More...
 
void GetPrecursors (std::vector< Ipv4Address > &prec) const
 Inserts precursors in output parameter prec if they do not yet exist in vector. More...
 

Public Attributes

Timer m_ackTimer
 RREP_ACK timer. More...
 

Private Attributes

bool m_blackListState
 Indicate if this entry is in "blacklist". More...
 
Time m_blackListTimeout
 Time for which the node is put into the blacklist. More...
 
RouteFlags m_flag
 Routing flags: valid, invalid or in search. More...
 
uint16_t m_hops
 Hop Count (number of hops needed to reach destination) More...
 
Ipv4InterfaceAddress m_iface
 Output interface address. More...
 
Ptr< Ipv4Routem_ipv4Route
 Ip route, include. More...
 
Time m_lifeTime
 Expiration or deletion time of the route Lifetime field in the routing table plays dual role: for an active route it is the expiration time, and for an invalid route it is the deletion time. More...
 
std::vector< Ipv4Addressm_precursorList
 List of precursors. More...
 
uint8_t m_reqCount
 Number of route requests. More...
 
Time m_routeRequestTimout
 When I can send another request. More...
 
uint32_t m_seqNo
 Destination Sequence Number, if m_validSeqNo = true. More...
 
bool m_validSeqNo
 Valid Destination Sequence Number flag. More...
 

Detailed Description

Routing table entry.

Definition at line 59 of file aodv-rtable.h.

Constructor & Destructor Documentation

◆ RoutingTableEntry()

ns3::aodv::RoutingTableEntry::RoutingTableEntry ( Ptr< NetDevice dev = 0,
Ipv4Address  dst = Ipv4Address (),
bool  vSeqNo = false,
uint32_t  seqNo = 0,
Ipv4InterfaceAddress  iface = Ipv4InterfaceAddress (),
uint16_t  hops = 0,
Ipv4Address  nextHop = Ipv4Address (),
Time  lifetime = Simulator::Now () 
)

constructor

Parameters
devthe device
dstthe destination IP address
vSeqNoverify sequence number flag
seqNothe sequence number
ifacethe interface
hopsthe number of hops
nextHopthe IP address of the next hop
lifetimethe lifetime of the entry

Definition at line 45 of file aodv-rtable.cc.

References ns3::Ipv4InterfaceAddress::GetLocal(), m_iface, m_ipv4Route, ns3::Ipv4Route::SetDestination(), ns3::Ipv4Route::SetGateway(), ns3::Ipv4Route::SetOutputDevice(), and ns3::Ipv4Route::SetSource().

◆ ~RoutingTableEntry()

ns3::aodv::RoutingTableEntry::~RoutingTableEntry ( )

Definition at line 65 of file aodv-rtable.cc.

Member Function Documentation

◆ DeleteAllPrecursors()

void ns3::aodv::RoutingTableEntry::DeleteAllPrecursors ( )

Delete all precursors.

Definition at line 121 of file aodv-rtable.cc.

References m_precursorList, and NS_LOG_FUNCTION.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun().

◆ DeletePrecursor()

bool ns3::aodv::RoutingTableEntry::DeletePrecursor ( Ipv4Address  id)

Delete precursor.

Parameters
idprecursor address
Returns
true on success

Definition at line 102 of file aodv-rtable.cc.

References m_precursorList, NS_LOG_FUNCTION, and NS_LOG_LOGIC().

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun().

◆ GetBlacklistTimeout()

Time ns3::aodv::RoutingTableEntry::GetBlacklistTimeout ( ) const
inline

Get the blacklist timeout value.

Returns
the blacklist timeout value

Definition at line 324 of file aodv-rtable.h.

References m_blackListTimeout.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun().

◆ GetDestination()

Ipv4Address ns3::aodv::RoutingTableEntry::GetDestination ( ) const
inline

◆ GetFlag()

RouteFlags ns3::aodv::RoutingTableEntry::GetFlag ( ) const
inline

◆ GetHop()

uint16_t ns3::aodv::RoutingTableEntry::GetHop ( ) const
inline

◆ GetInterface()

Ipv4InterfaceAddress ns3::aodv::RoutingTableEntry::GetInterface ( ) const
inline

◆ GetLifeTime()

Time ns3::aodv::RoutingTableEntry::GetLifeTime ( ) const
inline

◆ GetNextHop()

Ipv4Address ns3::aodv::RoutingTableEntry::GetNextHop ( ) const
inline

◆ GetOutputDevice()

Ptr<NetDevice> ns3::aodv::RoutingTableEntry::GetOutputDevice ( ) const
inline

Get output device.

Returns
the output device

Definition at line 173 of file aodv-rtable.h.

References ns3::Ipv4Route::GetOutputDevice(), and m_ipv4Route.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), and ns3::aodv::RoutingProtocol::UpdateRouteToNeighbor().

◆ GetPrecursors()

void ns3::aodv::RoutingTableEntry::GetPrecursors ( std::vector< Ipv4Address > &  prec) const

Inserts precursors in output parameter prec if they do not yet exist in vector.

Parameters
precvector of precursor addresses

Definition at line 134 of file aodv-rtable.cc.

References IsPrecursorListEmpty(), m_precursorList, and NS_LOG_FUNCTION.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), ns3::aodv::RoutingProtocol::RecvError(), and ns3::aodv::RoutingProtocol::SendRerrWhenBreaksLinkToNextHop().

◆ GetRoute()

Ptr<Ipv4Route> ns3::aodv::RoutingTableEntry::GetRoute ( ) const
inline

◆ GetRreqCnt()

uint8_t ns3::aodv::RoutingTableEntry::GetRreqCnt ( ) const
inline

Get the RREQ count.

Returns
the RREQ count

Definition at line 285 of file aodv-rtable.h.

References m_reqCount.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), ns3::aodv::RoutingProtocol::RouteRequestTimerExpire(), and ns3::aodv::RoutingProtocol::ScheduleRreqRetry().

◆ GetSeqNo()

uint32_t ns3::aodv::RoutingTableEntry::GetSeqNo ( ) const
inline

◆ GetValidSeqNo()

bool ns3::aodv::RoutingTableEntry::GetValidSeqNo ( ) const
inline

◆ IncrementRreqCnt()

void ns3::aodv::RoutingTableEntry::IncrementRreqCnt ( )
inline

Increment the RREQ count.

Definition at line 292 of file aodv-rtable.h.

References m_reqCount.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), and ns3::aodv::RoutingProtocol::SendRequest().

◆ InsertPrecursor()

bool ns3::aodv::RoutingTableEntry::InsertPrecursor ( Ipv4Address  id)

Insert precursor in precursor list if it doesn't yet exist in the list.

Parameters
idprecursor address
Returns
true on success

Definition at line 70 of file aodv-rtable.cc.

References LookupPrecursor(), m_precursorList, and NS_LOG_FUNCTION.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), ns3::aodv::AodvRtableTest::DoRun(), ns3::aodv::RoutingProtocol::RecvReply(), and ns3::aodv::RoutingProtocol::SendReplyByIntermediateNode().

◆ Invalidate()

void ns3::aodv::RoutingTableEntry::Invalidate ( Time  badLinkLifetime)

Mark entry as "down" (i.e.

disable it)

Parameters
badLinkLifetimeduration to keep entry marked as invalid

Definition at line 161 of file aodv-rtable.cc.

References ns3::Time::GetSeconds(), ns3::aodv::INVALID, m_flag, m_lifeTime, m_reqCount, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun().

◆ IsPrecursorListEmpty()

bool ns3::aodv::RoutingTableEntry::IsPrecursorListEmpty ( ) const

Check that precursor list is empty.

Returns
true if precursor list is empty

Definition at line 128 of file aodv-rtable.cc.

References m_precursorList.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), and GetPrecursors().

◆ IsUnidirectional()

bool ns3::aodv::RoutingTableEntry::IsUnidirectional ( ) const
inline

Get the unidirectional flag.

Returns
the unidirectional flag

Definition at line 308 of file aodv-rtable.h.

References m_blackListState.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), ns3::aodv::AodvRtableTest::DoRun(), and ns3::aodv::RoutingProtocol::RecvRequest().

◆ LookupPrecursor()

bool ns3::aodv::RoutingTableEntry::LookupPrecursor ( Ipv4Address  id)

Lookup precursor by address.

Parameters
idprecursor address
Returns
true on success

Definition at line 85 of file aodv-rtable.cc.

References m_precursorList, NS_LOG_FUNCTION, and NS_LOG_LOGIC().

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), and InsertPrecursor().

◆ operator==()

bool ns3::aodv::RoutingTableEntry::operator== ( Ipv4Address const  dst) const
inline

Compare destination address.

Parameters
dstIP address to compare
Returns
true if equal

Definition at line 336 of file aodv-rtable.h.

References ns3::Ipv4Route::GetDestination(), and m_ipv4Route.

◆ Print()

void ns3::aodv::RoutingTableEntry::Print ( Ptr< OutputStreamWrapper stream) const

◆ SetBlacklistTimeout()

void ns3::aodv::RoutingTableEntry::SetBlacklistTimeout ( Time  t)
inline

Set the blacklist timeout.

Parameters
tthe blacklist timeout value

Definition at line 316 of file aodv-rtable.h.

References m_blackListTimeout.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun().

◆ SetFlag()

void ns3::aodv::RoutingTableEntry::SetFlag ( RouteFlags  flag)
inline

◆ SetHop()

void ns3::aodv::RoutingTableEntry::SetHop ( uint16_t  hop)
inline

Set the number of hops.

Parameters
hopthe number of hops

Definition at line 229 of file aodv-rtable.h.

References m_hops.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), ns3::aodv::AodvRtableTest::DoRun(), ns3::aodv::RoutingProtocol::RecvRequest(), and ns3::aodv::RoutingProtocol::SendRequest().

◆ SetInterface()

void ns3::aodv::RoutingTableEntry::SetInterface ( Ipv4InterfaceAddress  iface)
inline

Set the Ipv4InterfaceAddress.

Parameters
ifaceThe Ipv4InterfaceAddress

Definition at line 189 of file aodv-rtable.h.

References m_iface.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), and ns3::aodv::RoutingProtocol::RecvRequest().

◆ SetLifeTime()

void ns3::aodv::RoutingTableEntry::SetLifeTime ( Time  lt)
inline

◆ SetNextHop()

void ns3::aodv::RoutingTableEntry::SetNextHop ( Ipv4Address  nextHop)
inline

Set next hop address.

Parameters
nextHopthe next hop IPv4 address

Definition at line 149 of file aodv-rtable.h.

References m_ipv4Route, and ns3::Ipv4Route::SetGateway().

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), and ns3::aodv::RoutingProtocol::RecvRequest().

◆ SetOutputDevice()

void ns3::aodv::RoutingTableEntry::SetOutputDevice ( Ptr< NetDevice dev)
inline

Set output device.

Parameters
devThe output device

Definition at line 165 of file aodv-rtable.h.

References m_ipv4Route, and ns3::Ipv4Route::SetOutputDevice().

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), and ns3::aodv::RoutingProtocol::RecvRequest().

◆ SetRoute()

void ns3::aodv::RoutingTableEntry::SetRoute ( Ptr< Ipv4Route r)
inline

Set route function.

Parameters
rthe IPv4 route

Definition at line 141 of file aodv-rtable.h.

References m_ipv4Route.

◆ SetRreqCnt()

void ns3::aodv::RoutingTableEntry::SetRreqCnt ( uint8_t  n)
inline

Set the RREQ count.

Parameters
nthe RREQ count

Definition at line 277 of file aodv-rtable.h.

References m_reqCount, and sample-rng-plot::n.

Referenced by ns3::aodv::RoutingTable::AddRoute(), ns3::aodv::AodvRtableEntryTest::DoRun(), and ns3::aodv::RoutingProtocol::UpdateRouteLifeTime().

◆ SetSeqNo()

void ns3::aodv::RoutingTableEntry::SetSeqNo ( uint32_t  sn)
inline

Set the sequence number.

Parameters
snthe sequence number

Definition at line 213 of file aodv-rtable.h.

References m_seqNo.

Referenced by ns3::aodv::RoutingProtocol::RecvRequest().

◆ SetUnidirectional()

void ns3::aodv::RoutingTableEntry::SetUnidirectional ( bool  u)
inline

Set the unidirectional flag.

Parameters
uthe uni directional flag

Definition at line 300 of file aodv-rtable.h.

References m_blackListState.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun().

◆ SetValidSeqNo()

void ns3::aodv::RoutingTableEntry::SetValidSeqNo ( bool  s)
inline

Set the valid sequence number.

Parameters
sthe sequence number

Definition at line 197 of file aodv-rtable.h.

References m_validSeqNo.

Referenced by ns3::aodv::AodvRtableEntryTest::DoRun(), and ns3::aodv::RoutingProtocol::RecvRequest().

Member Data Documentation

◆ m_ackTimer

Timer ns3::aodv::RoutingTableEntry::m_ackTimer

◆ m_blackListState

bool ns3::aodv::RoutingTableEntry::m_blackListState
private

Indicate if this entry is in "blacklist".

Definition at line 379 of file aodv-rtable.h.

Referenced by IsUnidirectional(), and SetUnidirectional().

◆ m_blackListTimeout

Time ns3::aodv::RoutingTableEntry::m_blackListTimeout
private

Time for which the node is put into the blacklist.

Definition at line 381 of file aodv-rtable.h.

Referenced by GetBlacklistTimeout(), and SetBlacklistTimeout().

◆ m_flag

RouteFlags ns3::aodv::RoutingTableEntry::m_flag
private

Routing flags: valid, invalid or in search.

Definition at line 370 of file aodv-rtable.h.

Referenced by GetFlag(), Invalidate(), Print(), and SetFlag().

◆ m_hops

uint16_t ns3::aodv::RoutingTableEntry::m_hops
private

Hop Count (number of hops needed to reach destination)

Definition at line 352 of file aodv-rtable.h.

Referenced by GetHop(), Print(), and SetHop().

◆ m_iface

Ipv4InterfaceAddress ns3::aodv::RoutingTableEntry::m_iface
private

Output interface address.

Definition at line 368 of file aodv-rtable.h.

Referenced by GetInterface(), Print(), RoutingTableEntry(), and SetInterface().

◆ m_ipv4Route

Ptr<Ipv4Route> ns3::aodv::RoutingTableEntry::m_ipv4Route
private

Ip route, include.

  • destination address
  • source address
  • next hop address (gateway)
  • output device

Definition at line 366 of file aodv-rtable.h.

Referenced by GetDestination(), GetNextHop(), GetOutputDevice(), GetRoute(), operator==(), Print(), RoutingTableEntry(), SetNextHop(), SetOutputDevice(), and SetRoute().

◆ m_lifeTime

Time ns3::aodv::RoutingTableEntry::m_lifeTime
private

Expiration or deletion time of the route Lifetime field in the routing table plays dual role: for an active route it is the expiration time, and for an invalid route it is the deletion time.

Definition at line 359 of file aodv-rtable.h.

Referenced by GetLifeTime(), Invalidate(), Print(), and SetLifeTime().

◆ m_precursorList

std::vector<Ipv4Address> ns3::aodv::RoutingTableEntry::m_precursorList
private

◆ m_reqCount

uint8_t ns3::aodv::RoutingTableEntry::m_reqCount
private

Number of route requests.

Definition at line 377 of file aodv-rtable.h.

Referenced by GetRreqCnt(), IncrementRreqCnt(), Invalidate(), and SetRreqCnt().

◆ m_routeRequestTimout

Time ns3::aodv::RoutingTableEntry::m_routeRequestTimout
private

When I can send another request.

Definition at line 375 of file aodv-rtable.h.

◆ m_seqNo

uint32_t ns3::aodv::RoutingTableEntry::m_seqNo
private

Destination Sequence Number, if m_validSeqNo = true.

Definition at line 350 of file aodv-rtable.h.

Referenced by GetSeqNo(), and SetSeqNo().

◆ m_validSeqNo

bool ns3::aodv::RoutingTableEntry::m_validSeqNo
private

Valid Destination Sequence Number flag.

Definition at line 348 of file aodv-rtable.h.

Referenced by GetValidSeqNo(), and SetValidSeqNo().


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