A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::dsr::DsrRreqTable Class Reference

maintain list of DsrRreqTable entry More...

#include "dsr-rreq-table.h"

+ Inheritance diagram for ns3::dsr::DsrRreqTable:
+ Collaboration diagram for ns3::dsr::DsrRreqTable:

Classes

struct  IsExpired
 Check if the entry is expired or not. More...
 

Public Member Functions

 DsrRreqTable ()
 
 ~DsrRreqTable () override
 
uint32_t CheckUniqueRreqId (Ipv4Address dst)
 The following code generates new request id for each destination.
 
void FindAndUpdate (Ipv4Address dst)
 Find the entry in the route request queue to see if already exists.
 
bool FindSourceEntry (Ipv4Address src, Ipv4Address dst, uint16_t id)
 Find the source request entry in the route request queue, return false if not found.
 
BlackListFindUnidirectional (Ipv4Address neighbor)
 Verify if entry is unidirectional or not(e.g.
 
uint32_t GetInitHopLimit () const
 Return the initial discovert hop limit.
 
uint32_t GetRreqCnt (Ipv4Address dst)
 Get the request count number for one destination address.
 
uint32_t GetRreqIdSize () const
 Return the maximum number of request source Ids in the request table.
 
uint32_t GetRreqSize ()
 Get the request id size.
 
uint32_t GetRreqTableSize () const
 Return the maximum number of request entries in the request table.
 
uint32_t GetUniqueRreqIdSize () const
 Return the maximum number of request Ids in the request table for a single destination.
 
void Invalidate ()
 set the unidirectional entry as QUESTIONABLE state
 
bool MarkLinkAsUnidirectional (Ipv4Address neighbor, Time blacklistTimeout)
 Mark entry as unidirectional (e.g.
 
void PurgeNeighbor ()
 Remove all expired black list entries.
 
void RemoveLeastExpire ()
 Remove the least used entry.
 
void RemoveRreqEntry (Ipv4Address dst)
 Remove route request entry for dst.
 
void SetInitHopLimit (uint32_t hl)
 Set the initial discovert hop limit.
 
void SetRreqIdSize (uint32_t id)
 Set the maximum number of request source Ids in the request table.
 
void SetRreqTableSize (uint32_t rt)
 Set the maximum number of request entries in the request table.
 
void SetUniqueRreqIdSize (uint32_t uid)
 Set the maximum number of request Ids in the request table for a single destination.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Attributes

std::vector< BlackListm_blackList
 The Black list.
 
uint32_t m_initHopLimit
 The initial hop limit.
 
LinkStates m_linkStates
 The state of the unidirectional link.
 
uint32_t m_maxRreqId
 The unique request id for any destination.
 
uint32_t m_requestIdSize
 The request source id size.
 
uint32_t m_requestTableSize
 The request table size.
 
std::map< Ipv4Address, RreqTableEntrym_rreqDstMap
 The cache to save route request table entries indexed with destination address.
 
Time m_rreqEntryExpire
 The source route entry expire time.
 
std::map< Ipv4Address, uint32_tm_rreqIdCache
 The id cache to ensure all the ids are unique, it is used when sending out route request.
 
std::list< DsrReceivedRreqEntrym_sourceRequests
 Map of entries.
 
std::map< Ipv4Address, std::list< DsrReceivedRreqEntry > > m_sourceRreqMap
 The cache to ensure all the route request from unique source.
 
Time MaxRequestPeriod
 The max request period among requests.
 
Time NonpropRequestTimeout
 The non-propagation request timeout.
 
Time RequestPeriod
 The original request period.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

maintain list of DsrRreqTable entry

Definition at line 201 of file dsr-rreq-table.h.

Constructor & Destructor Documentation

◆ DsrRreqTable()

ns3::dsr::DsrRreqTable::DsrRreqTable ( )

Definition at line 47 of file dsr-rreq-table.cc.

◆ ~DsrRreqTable()

ns3::dsr::DsrRreqTable::~DsrRreqTable ( )
override

Definition at line 52 of file dsr-rreq-table.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ CheckUniqueRreqId()

uint32_t ns3::dsr::DsrRreqTable::CheckUniqueRreqId ( Ipv4Address dst)

The following code generates new request id for each destination.

Check for duplicate ids and save new entries if the id is not present in the table.

Parameters
dstIPv4 address of the destination
Returns
id

Definition at line 146 of file dsr-rreq-table.cc.

References m_maxRreqId, m_rreqIdCache, NS_LOG_DEBUG, NS_LOG_INFO, and NS_LOG_LOGIC.

◆ FindAndUpdate()

void ns3::dsr::DsrRreqTable::FindAndUpdate ( Ipv4Address dst)

Find the entry in the route request queue to see if already exists.

Parameters
dstDestination IP

Definition at line 77 of file dsr-rreq-table.cc.

References ns3::dsr::RreqTableEntry::m_expire, ns3::dsr::RreqTableEntry::m_reqNo, m_requestTableSize, m_rreqDstMap, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and RemoveLeastExpire().

+ Here is the call graph for this function:

◆ FindSourceEntry()

bool ns3::dsr::DsrRreqTable::FindSourceEntry ( Ipv4Address src,
Ipv4Address dst,
uint16_t id )

Find the source request entry in the route request queue, return false if not found.

Parameters
srcthe source address we just received the source request
dstthe destination address the request is targeted at
idthe identification number for this request
Returns
true if found, false otherwise

Clear the received source request entry

Check if we have found one duplication entry or not

if this entry is not found, we need to save the entry in the cache, and then return false for the check

Definition at line 240 of file dsr-rreq-table.cc.

References m_requestIdSize, m_sourceRreqMap, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::dsr::DsrReceivedRreqEntry::SetDestination(), and ns3::dsr::DsrReceivedRreqEntry::SetIdentification().

+ Here is the call graph for this function:

◆ FindUnidirectional()

BlackList * ns3::dsr::DsrRreqTable::FindUnidirectional ( Ipv4Address neighbor)

Verify if entry is unidirectional or not(e.g.

add this neighbor to "blacklist" for blacklistTimeout period)

Parameters
neighborneighbor address link to which assumed to be unidirectional
Returns
true on success

Definition at line 197 of file dsr-rreq-table.cc.

References m_blackList, and PurgeNeighbor().

+ Here is the call graph for this function:

◆ GetInitHopLimit()

uint32_t ns3::dsr::DsrRreqTable::GetInitHopLimit ( ) const
inline

Return the initial discovert hop limit.

Returns
the initial discovert hop limit

Definition at line 228 of file dsr-rreq-table.h.

References m_initHopLimit.

◆ GetRreqCnt()

uint32_t ns3::dsr::DsrRreqTable::GetRreqCnt ( Ipv4Address dst)

Get the request count number for one destination address.

Parameters
dstDestination IP
Returns
the route request counter

Definition at line 126 of file dsr-rreq-table.cc.

References ns3::dsr::RreqTableEntry::m_reqNo, m_rreqDstMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ GetRreqIdSize()

uint32_t ns3::dsr::DsrRreqTable::GetRreqIdSize ( ) const
inline

Return the maximum number of request source Ids in the request table.

Returns
the maximum number of request source Ids

Definition at line 272 of file dsr-rreq-table.h.

References m_requestIdSize.

◆ GetRreqSize()

uint32_t ns3::dsr::DsrRreqTable::GetRreqSize ( )

Get the request id size.

Returns
the request id size

Definition at line 176 of file dsr-rreq-table.cc.

References m_rreqIdCache.

◆ GetRreqTableSize()

uint32_t ns3::dsr::DsrRreqTable::GetRreqTableSize ( ) const
inline

Return the maximum number of request entries in the request table.

Returns
the maximum number of request entries

Definition at line 250 of file dsr-rreq-table.h.

References m_requestTableSize.

◆ GetTypeId()

TypeId ns3::dsr::DsrRreqTable::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 38 of file dsr-rreq-table.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ GetUniqueRreqIdSize()

uint32_t ns3::dsr::DsrRreqTable::GetUniqueRreqIdSize ( ) const
inline

Return the maximum number of request Ids in the request table for a single destination.

Returns
the maximum number of request Ids

Definition at line 294 of file dsr-rreq-table.h.

References m_maxRreqId.

◆ Invalidate()

void ns3::dsr::DsrRreqTable::Invalidate ( )

set the unidirectional entry as QUESTIONABLE state

Definition at line 187 of file dsr-rreq-table.cc.

References m_linkStates, and ns3::dsr::QUESTIONABLE.

◆ MarkLinkAsUnidirectional()

bool ns3::dsr::DsrRreqTable::MarkLinkAsUnidirectional ( Ipv4Address neighbor,
Time blacklistTimeout )

Mark entry as unidirectional (e.g.

add this neighbor to "blacklist" for blacklistTimeout period)

Parameters
neighborneighbor address link to which assumed to be unidirectional
blacklistTimeouttime for which the neighboring node is put into the blacklist
Returns
true on success

Definition at line 211 of file dsr-rreq-table.cc.

References m_blackList, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, and PurgeNeighbor().

+ Here is the call graph for this function:

◆ PurgeNeighbor()

void ns3::dsr::DsrRreqTable::PurgeNeighbor ( )

Remove all expired black list entries.

Definition at line 230 of file dsr-rreq-table.cc.

References m_blackList.

Referenced by FindUnidirectional(), and MarkLinkAsUnidirectional().

+ Here is the caller graph for this function:

◆ RemoveLeastExpire()

void ns3::dsr::DsrRreqTable::RemoveLeastExpire ( )

Remove the least used entry.

Definition at line 58 of file dsr-rreq-table.cc.

References ns3::dsr::RreqTableEntry::m_expire, m_rreqDstMap, NS_LOG_FUNCTION, and ns3::Seconds().

Referenced by FindAndUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveRreqEntry()

void ns3::dsr::DsrRreqTable::RemoveRreqEntry ( Ipv4Address dst)

Remove route request entry for dst.

Parameters
dstDestination IP

Definition at line 110 of file dsr-rreq-table.cc.

References m_rreqDstMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ SetInitHopLimit()

void ns3::dsr::DsrRreqTable::SetInitHopLimit ( uint32_t hl)
inline

Set the initial discovert hop limit.

Parameters
hlthe initial discovert hop limit

Definition at line 218 of file dsr-rreq-table.h.

References m_initHopLimit.

◆ SetRreqIdSize()

void ns3::dsr::DsrRreqTable::SetRreqIdSize ( uint32_t id)
inline

Set the maximum number of request source Ids in the request table.

Parameters
idthe maximum number of request source Ids

Definition at line 261 of file dsr-rreq-table.h.

References m_requestIdSize.

◆ SetRreqTableSize()

void ns3::dsr::DsrRreqTable::SetRreqTableSize ( uint32_t rt)
inline

Set the maximum number of request entries in the request table.

Parameters
rtthe maximum number of request entries

Definition at line 239 of file dsr-rreq-table.h.

References m_requestTableSize.

◆ SetUniqueRreqIdSize()

void ns3::dsr::DsrRreqTable::SetUniqueRreqIdSize ( uint32_t uid)
inline

Set the maximum number of request Ids in the request table for a single destination.

Parameters
uidthe maximum number of request Ids

Definition at line 283 of file dsr-rreq-table.h.

References m_maxRreqId.

Member Data Documentation

◆ m_blackList

std::vector<BlackList> ns3::dsr::DsrRreqTable::m_blackList
private

The Black list.

Definition at line 389 of file dsr-rreq-table.h.

Referenced by FindUnidirectional(), MarkLinkAsUnidirectional(), and PurgeNeighbor().

◆ m_initHopLimit

uint32_t ns3::dsr::DsrRreqTable::m_initHopLimit
private

The initial hop limit.

Definition at line 370 of file dsr-rreq-table.h.

Referenced by GetInitHopLimit(), and SetInitHopLimit().

◆ m_linkStates

LinkStates ns3::dsr::DsrRreqTable::m_linkStates
private

The state of the unidirectional link.

Definition at line 378 of file dsr-rreq-table.h.

Referenced by Invalidate().

◆ m_maxRreqId

uint32_t ns3::dsr::DsrRreqTable::m_maxRreqId
private

The unique request id for any destination.

Definition at line 376 of file dsr-rreq-table.h.

Referenced by CheckUniqueRreqId(), GetUniqueRreqIdSize(), and SetUniqueRreqIdSize().

◆ m_requestIdSize

uint32_t ns3::dsr::DsrRreqTable::m_requestIdSize
private

The request source id size.

Definition at line 374 of file dsr-rreq-table.h.

Referenced by FindSourceEntry(), GetRreqIdSize(), and SetRreqIdSize().

◆ m_requestTableSize

uint32_t ns3::dsr::DsrRreqTable::m_requestTableSize
private

The request table size.

Definition at line 372 of file dsr-rreq-table.h.

Referenced by FindAndUpdate(), GetRreqTableSize(), and SetRreqTableSize().

◆ m_rreqDstMap

std::map<Ipv4Address, RreqTableEntry> ns3::dsr::DsrRreqTable::m_rreqDstMap
private

The cache to save route request table entries indexed with destination address.

Definition at line 384 of file dsr-rreq-table.h.

Referenced by FindAndUpdate(), GetRreqCnt(), RemoveLeastExpire(), and RemoveRreqEntry().

◆ m_rreqEntryExpire

Time ns3::dsr::DsrRreqTable::m_rreqEntryExpire
private

The source route entry expire time.

Definition at line 368 of file dsr-rreq-table.h.

◆ m_rreqIdCache

std::map<Ipv4Address, uint32_t> ns3::dsr::DsrRreqTable::m_rreqIdCache
private

The id cache to ensure all the ids are unique, it is used when sending out route request.

Definition at line 382 of file dsr-rreq-table.h.

Referenced by CheckUniqueRreqId(), and GetRreqSize().

◆ m_sourceRequests

std::list<DsrReceivedRreqEntry> ns3::dsr::DsrRreqTable::m_sourceRequests
private

Map of entries.

Definition at line 380 of file dsr-rreq-table.h.

◆ m_sourceRreqMap

std::map<Ipv4Address, std::list<DsrReceivedRreqEntry> > ns3::dsr::DsrRreqTable::m_sourceRreqMap
private

The cache to ensure all the route request from unique source.

Definition at line 386 of file dsr-rreq-table.h.

Referenced by FindSourceEntry().

◆ MaxRequestPeriod

Time ns3::dsr::DsrRreqTable::MaxRequestPeriod
private

The max request period among requests.

Definition at line 362 of file dsr-rreq-table.h.

◆ NonpropRequestTimeout

Time ns3::dsr::DsrRreqTable::NonpropRequestTimeout
private

The non-propagation request timeout.

Definition at line 366 of file dsr-rreq-table.h.

◆ RequestPeriod

Time ns3::dsr::DsrRreqTable::RequestPeriod
private

The original request period.

Definition at line 364 of file dsr-rreq-table.h.


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