|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
32 #ifndef DSR_RREQ_TABLE_H
33 #define DSR_RREQ_TABLE_H
35 #include "ns3/simulator.h"
36 #include "ns3/timer.h"
37 #include "ns3/ipv4-address.h"
38 #include "ns3/callback.h"
a unique identifier for an interface.
uint32_t GetRreqCnt(Ipv4Address dst)
Get the request count number for one destination address.
void SetIdentification(uint16_t i)
Set identification.
BlackList * FindUnidirectional(Ipv4Address neighbor)
Verify if entry is unidirectional or not(e.g.
Time m_expire
Expire time.
uint32_t GetRreqIdSize() const
Return the maximum number of request source Ids in the request table.
static TypeId GetTypeId()
Get the type ID.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
BlackList(Ipv4Address ip, Time t)
Construct a BlackList with the given parameters.
Time MaxRequestPeriod
The max request period among requests.
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.
std::vector< BlackList > m_blackList
The Black list.
uint32_t GetRreqSize()
Get the request id size.
std::list< DsrReceivedRreqEntry > m_sourceRequests
Map of entries.
void SetRreqTableSize(uint32_t rt)
Set the maximum number of request entries in the request table.
bool FindSourceEntry(Ipv4Address src, Ipv4Address dst, uint16_t id)
Find the source request entry in the route request queue, return false if not found.
Ipv4 addresses are stored in host order in this class.
uint32_t GetUniqueRreqIdSize() const
Return the maximum number of request Ids in the request table for a single destination.
Ipv4Address m_destination
IPv4 address of the destinaton.
maintain list of DsrRreqTable entry
The request entry for intermediate nodes to check if they have received this request or not This is u...
void SetRreqIdSize(uint32_t id)
Set the maximum number of request source Ids in the request table.
bool operator()(const struct BlackList &b) const
Check if the entry is expired.
Time RequestPeriod
The original request period.
Ipv4Address GetSource() const
Return IPv4 address of the source.
Time NonpropRequestTimeout
The non-propagaton request timeout.
Time m_expireTime
Expire time in the black list.
void Invalidate()
set the unidirectional entry as QUESTIONABLE state
uint32_t m_reqNo
Route request number.
std::map< Ipv4Address, std::list< DsrReceivedRreqEntry > > m_sourceRreqMap
The cache to ensure all the route request from unique source.
A base class which provides memory management and object aggregation.
void FindAndUpdate(Ipv4Address dst)
Find the entry in the route request queue to see if already exists.
uint32_t GetRreqTableSize() const
Return the maximum number of request entries in the request table.
The route request table entries.
LinkStates m_linkStates
The state of the unidirectional link.
Simulation virtual time values and global simulation resolution.
LinkStates m_linkStates
State of the link.
Time m_rreqEntryExpire
The source route entry expire time.
Check if the entry is expired or not.
uint16_t m_identification
Route request identification.
uint32_t GetInitHopLimit() const
Return the initial discovert hop limit.
Time GetExpireTime() const
Return the remaining time before the RREQ entry expires.
uint32_t CheckUniqueRreqId(Ipv4Address dst)
The following code generates new request id for each destination.
uint32_t m_maxRreqId
The unique request id for any destination.
uint32_t m_initHopLimit
The initial hop limit.
Ipv4Address m_neighborAddress
IPv4 address of the black-listed neighbor.
Ipv4Address GetDestination() const
Return IPv4 address of the destination.
std::map< Ipv4Address, RreqTableEntry > m_rreqDstMap
The cache to save route request table entries indexed with destination address.
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
Mark entry as unidirectional (e.g.
void SetDestination(Ipv4Address d)
Set IPv4 address of the destination.
@ QUESTIONABLE
QUESTIONABLE.
void SetInitHopLimit(uint32_t hl)
Set the initial discovert hop limit.
Time m_expire
Route request expire time.
uint32_t m_requestTableSize
The request table size.
bool operator==(DsrReceivedRreqEntry const &o) const
Compare send buffer entries (destination address and identification)
void PurgeNeighbor()
Remove all expired black list entries.
void SetUniqueRreqIdSize(uint32_t uid)
Set the maximum number of request Ids in the request table for a single destination.
Ipv4Address m_source
IPv4 address of the source.
DsrReceivedRreqEntry(Ipv4Address d=Ipv4Address(), uint16_t i=0)
Construct a DsrReceivedRreqEntry with the given parameters.
uint16_t GetIdentification() const
Return identification.
void SetSource(Ipv4Address s)
Set IPv4 address of the source.
void SetExpireTime(Time exp)
Set expire time for the RREQ entry.
void RemoveRreqEntry(Ipv4Address dst)
Remove route request entry for dst.
void RemoveLeastExpire()
Remove the least used entry.
uint32_t m_requestIdSize
The request source id size.