maintain list of RreqTable entry More...
#include <dsr-rreq-table.h>
Classes | |
struct | IsExpired |
Check if the entry is expired or not. More... | |
Public Member Functions | |
RreqTable () | |
virtual | ~RreqTable () |
uint32_t | CheckUniqueRreqId (Ipv4Address dst) |
The following code generates new request id for each destination. More... | |
void | FindAndUpdate (Ipv4Address dst) |
Find the entry in the route request queue to see if already exists. More... | |
bool | FindSourceEntry (Ipv4Address src, Ipv4Address dst, uint16_t id) |
Find the source request entry in the route request queue, return false if not found. More... | |
BlackList * | FindUnidirectional (Ipv4Address neighbor) |
Verify if entry is unidirectional or not(e.g. More... | |
uint32_t | GetInitHopLimit () const |
Return the initial discovert hop limit. More... | |
uint32_t | GetRreqCnt (Ipv4Address dst) |
Get the request count number for one destination address. More... | |
uint32_t | GetRreqIdSize () const |
Return the maximum number of request source Ids in the request table. More... | |
uint32_t | GetRreqSize () |
Get the request id size. More... | |
uint32_t | GetRreqTableSize () const |
Return the maximum number of request entries in the request table. More... | |
uint32_t | GetUniqueRreqIdSize () const |
Return the maximum number of request Ids in the request table for a single destination. More... | |
void | Invalidate () |
set the unidirectional entry as QUESTIONABLE state More... | |
bool | MarkLinkAsUnidirectional (Ipv4Address neighbor, Time blacklistTimeout) |
Mark entry as unidirectional (e.g. More... | |
void | PurgeNeighbor () |
Remove all expired black list entries. More... | |
void | RemoveLeastExpire (std::map< Ipv4Address, RreqTableEntry > &rreqDstMap) |
Remove the least used entry. More... | |
void | RemoveRreqEntry (Ipv4Address dst) |
Remove route request entry for dst. More... | |
void | SetInitHopLimit (uint32_t hl) |
Set the initial discovert hop limit. More... | |
void | SetRreqIdSize (uint32_t id) |
Set the maximum number of request source Ids in the request table. More... | |
void | SetRreqTableSize (uint32_t rt) |
Set the maximum number of request entries in the request table. More... | |
void | SetUniqueRreqIdSize (uint32_t uid) |
Set the maximum number of request Ids in the request table for a single destination. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
Run the DoDispose methods of this object and all the objects aggregated to it. More... | |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Initialize (void) |
This method calls the virtual DoInitialize method on all the objects aggregated to this object. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
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... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
static void | Cleanup (void) |
Noop. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Attributes | |
std::vector< BlackList > | m_blackList |
The Black list. More... | |
uint32_t | m_initHopLimit |
The initial hop limit. More... | |
LinkStates | m_linkStates |
The state of the unidirectional link. More... | |
uint32_t | m_maxRreqId |
The unique request id for any destination. More... | |
uint32_t | m_requestIdSize |
The request source id size. More... | |
uint32_t | m_requestTableSize |
The request table size. More... | |
std::map< Ipv4Address, RreqTableEntry > | m_rreqDstMap |
The cache to save route request table entries indexed with destination address. More... | |
Time | m_rreqEntryExpire |
The source route entry expire time. More... | |
std::map< Ipv4Address, uint32_t > | m_rreqIdCache |
The id cache to ensure all the ids are unique, it is used when sending out route request. More... | |
std::list< ReceivedRreqEntry > | m_sourceRequests |
Map of entries. More... | |
std::map< Ipv4Address, std::list< ReceivedRreqEntry > > | m_sourceRreqMap |
The cache to ensure all the route request from unique source. More... | |
Time | MaxRequestPeriod |
The max request period among requests. More... | |
Time | NonpropRequestTimeout |
The non-propagaton request timeout. More... | |
Time | RequestPeriod |
The original request period. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
This method is called by Object::Dispose or by the object's destructor, whichever comes first. More... | |
virtual void | DoInitialize (void) |
This method is called only once by Object::Initialize. More... | |
virtual void | NotifyNewAggregate (void) |
This method is invoked whenever two sets of objects are aggregated together. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
virtual void | NotifyConstructionCompleted (void) |
This method is invoked once all member attributes have been initialized. More... | |
maintain list of RreqTable entry
Doxygen introspection did not find any typical Config paths.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Definition at line 199 of file dsr-rreq-table.h.
ns3::dsr::RreqTable::RreqTable | ( | ) |
Definition at line 54 of file dsr-rreq-table.cc.
|
virtual |
Definition at line 59 of file dsr-rreq-table.cc.
References NS_LOG_FUNCTION_NOARGS.
uint32_t ns3::dsr::RreqTable::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.
dst | IPv4 address of the destination |
Definition at line 158 of file dsr-rreq-table.cc.
References m_maxRreqId, m_rreqIdCache, NS_LOG_DEBUG, NS_LOG_INFO, and NS_LOG_LOGIC.
void ns3::dsr::RreqTable::FindAndUpdate | ( | Ipv4Address | dst | ) |
Find the entry in the route request queue to see if already exists.
Definition at line 85 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().
bool ns3::dsr::RreqTable::FindSourceEntry | ( | Ipv4Address | src, |
Ipv4Address | dst, | ||
uint16_t | id | ||
) |
Find the source request entry in the route request queue, return false if not found.
src | the source address we just received the source request |
dst | the destination address the request is targeted at |
id | the identification number for this request |
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 255 of file dsr-rreq-table.cc.
References m_requestIdSize, m_sourceRreqMap, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::dsr::ReceivedRreqEntry::SetDestination(), and ns3::dsr::ReceivedRreqEntry::SetIdentification().
BlackList * ns3::dsr::RreqTable::FindUnidirectional | ( | Ipv4Address | neighbor | ) |
Verify if entry is unidirectional or not(e.g.
add this neighbor to "blacklist" for blacklistTimeout period)
neighbor | neighbor address link to which assumed to be unidirectional |
Definition at line 211 of file dsr-rreq-table.cc.
References m_blackList, and PurgeNeighbor().
|
inline |
Return the initial discovert hop limit.
Definition at line 222 of file dsr-rreq-table.h.
References m_initHopLimit.
uint32_t ns3::dsr::RreqTable::GetRreqCnt | ( | Ipv4Address | dst | ) |
Get the request count number for one destination address.
Definition at line 135 of file dsr-rreq-table.cc.
References ns3::dsr::RreqTableEntry::m_reqNo, m_rreqDstMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
inline |
Return the maximum number of request source Ids in the request table.
Definition at line 262 of file dsr-rreq-table.h.
References m_requestIdSize.
uint32_t ns3::dsr::RreqTable::GetRreqSize | ( | ) |
Get the request id size.
Definition at line 190 of file dsr-rreq-table.cc.
References m_rreqIdCache.
|
inline |
Return the maximum number of request entries in the request table.
Definition at line 242 of file dsr-rreq-table.h.
References m_requestTableSize.
|
static |
Definition at line 45 of file dsr-rreq-table.cc.
References ns3::TypeId::SetParent().
|
inline |
Return the maximum number of request Ids in the request table for a single destination.
Definition at line 282 of file dsr-rreq-table.h.
References m_maxRreqId.
void ns3::dsr::RreqTable::Invalidate | ( | ) |
set the unidirectional entry as QUESTIONABLE state
Definition at line 201 of file dsr-rreq-table.cc.
References m_linkStates, and ns3::dsr::QUESTIONABLE.
bool ns3::dsr::RreqTable::MarkLinkAsUnidirectional | ( | Ipv4Address | neighbor, |
Time | blacklistTimeout | ||
) |
Mark entry as unidirectional (e.g.
add this neighbor to "blacklist" for blacklistTimeout period)
neighbor | - neighbor address link to which assumed to be unidirectional |
blacklistTimeout | - time for which the neighboring node is put into the blacklist |
Definition at line 226 of file dsr-rreq-table.cc.
References m_blackList, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, and PurgeNeighbor().
void ns3::dsr::RreqTable::PurgeNeighbor | ( | ) |
Remove all expired black list entries.
Definition at line 245 of file dsr-rreq-table.cc.
References m_blackList.
Referenced by FindUnidirectional(), and MarkLinkAsUnidirectional().
void ns3::dsr::RreqTable::RemoveLeastExpire | ( | std::map< Ipv4Address, RreqTableEntry > & | rreqDstMap | ) |
Remove the least used entry.
Definition at line 65 of file dsr-rreq-table.cc.
References ns3::dsr::RreqTableEntry::m_expire, and NS_LOG_FUNCTION.
Referenced by FindAndUpdate().
void ns3::dsr::RreqTable::RemoveRreqEntry | ( | Ipv4Address | dst | ) |
Remove route request entry for dst.
Definition at line 118 of file dsr-rreq-table.cc.
References m_rreqDstMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
inline |
Set the initial discovert hop limit.
hl | the initial discovert hop limit |
Definition at line 213 of file dsr-rreq-table.h.
References m_initHopLimit.
|
inline |
Set the maximum number of request source Ids in the request table.
id | the maximum number of request source Ids |
Definition at line 252 of file dsr-rreq-table.h.
References m_requestIdSize.
|
inline |
Set the maximum number of request entries in the request table.
rt | the maximum number of request entries |
Definition at line 232 of file dsr-rreq-table.h.
References m_requestTableSize.
|
inline |
Set the maximum number of request Ids in the request table for a single destination.
uid | the maximum number of request Ids |
Definition at line 272 of file dsr-rreq-table.h.
References m_maxRreqId.
|
private |
The Black list.
Definition at line 371 of file dsr-rreq-table.h.
Referenced by FindUnidirectional(), MarkLinkAsUnidirectional(), and PurgeNeighbor().
|
private |
The initial hop limit.
Definition at line 352 of file dsr-rreq-table.h.
Referenced by GetInitHopLimit(), and SetInitHopLimit().
|
private |
The state of the unidirectional link.
Definition at line 360 of file dsr-rreq-table.h.
Referenced by Invalidate().
|
private |
The unique request id for any destination.
Definition at line 358 of file dsr-rreq-table.h.
Referenced by CheckUniqueRreqId(), GetUniqueRreqIdSize(), and SetUniqueRreqIdSize().
|
private |
The request source id size.
Definition at line 356 of file dsr-rreq-table.h.
Referenced by FindSourceEntry(), GetRreqIdSize(), and SetRreqIdSize().
|
private |
The request table size.
Definition at line 354 of file dsr-rreq-table.h.
Referenced by FindAndUpdate(), GetRreqTableSize(), and SetRreqTableSize().
|
private |
The cache to save route request table entries indexed with destination address.
Definition at line 366 of file dsr-rreq-table.h.
Referenced by FindAndUpdate(), GetRreqCnt(), and RemoveRreqEntry().
|
private |
The source route entry expire time.
Definition at line 350 of file dsr-rreq-table.h.
|
private |
The id cache to ensure all the ids are unique, it is used when sending out route request.
Definition at line 364 of file dsr-rreq-table.h.
Referenced by CheckUniqueRreqId(), and GetRreqSize().
|
private |
Map of entries.
Definition at line 362 of file dsr-rreq-table.h.
|
private |
The cache to ensure all the route request from unique source.
Definition at line 368 of file dsr-rreq-table.h.
Referenced by FindSourceEntry().
|
private |
The max request period among requests.
Definition at line 344 of file dsr-rreq-table.h.
|
private |
The non-propagaton request timeout.
Definition at line 348 of file dsr-rreq-table.h.
|
private |
The original request period.
Definition at line 346 of file dsr-rreq-table.h.