A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::dsr::RouteCache Class Reference

DSR route request queue Since DSR is an on demand routing we queue requests while looking for route. More...

#include <dsr-rcache.h>

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

Classes

struct  Neighbor

Public Types

typedef std::list
< RouteCacheEntry::IP_VECTOR
routeVector

Public Member Functions

 RouteCache ()
 Constructor.
virtual ~RouteCache ()
 Destructor.
void AddArpCache (Ptr< ArpCache >)
void AddNeighbor (std::vector< Ipv4Address > nodeList, Ipv4Address ownAddress, Time expire)
bool AddRoute (RouteCacheEntry &rt)
bool AddRoute_Link (RouteCacheEntry::IP_VECTOR nodelist, Ipv4Address node)
uint16_t CheckUniqueAckId (Ipv4Address nextHop)
void Clear ()
void ClearMac ()
void DelArpCache (Ptr< ArpCache >)
void DeleteAllRoutesIncludeLink (Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node)
bool DeleteRoute (Ipv4Address dst)
void DropPathWithDst (Ipv4Address dst)
bool FindSameRoute (RouteCacheEntry &rt, std::list< RouteCacheEntry > &rtVector)
uint16_t GetAckSize ()
Ipv4Address GetDestination (void) const
Time GetExpireTime (Ipv4Address addr)
Callback< void, WifiMacHeader
const & > 
GetTxErrorCallback () const
bool IsEqual (RouteCacheEntry ca)
bool IsLinkCache ()
bool IsNeighbor (Ipv4Address addr)
Mac48Address LookupMacAddress (Ipv4Address)
bool LookupRoute (Ipv4Address id, RouteCacheEntry &rt)
void Print (std::ostream &os)
void PrintRouteVector (std::list< RouteCacheEntry > route)
void PrintVector (std::vector< Ipv4Address > &vec)
void ProcessTxError (WifiMacHeader const &)
void Purge ()
void PurgeLinkNode ()
void PurgeMac ()
void RebuildBestRouteTable (Ipv4Address source)
 USE MAXWEIGHT TO REPRESENT MAX; USE BROADCAST ADDRESS TO REPRESENT NULL PRECEEDING ADDRESS.
void RemoveLastEntry (std::list< RouteCacheEntry > &rtVector)
void ScheduleTimer ()
void SetCacheType (std::string type)
 dijsktra algorithm to get the best route from m_netGraph and update the m_bestRoutesTable_link current graph information has changed
void UpdateNeighbor (std::vector< Ipv4Address > nodeList, Time expire)
void UpdateNetGraph ()
 Update the Net Graph for the link and node cache has changed.
bool UpdateRouteEntry (Ipv4Address dst)
void UseExtends (RouteCacheEntry::IP_VECTOR rt)
bool GetSubRoute () const
void SetSubRoute (bool subRoute)
uint32_t GetMaxCacheLen () const
void SetMaxCacheLen (uint32_t len)
Time GetCacheTimeout () const
void SetCacheTimeout (Time t)
uint32_t GetMaxEntriesEachDst () const
void SetMaxEntriesEachDst (uint32_t entries)
Time GetBadLinkLifetime () const
void SetBadLinkLifetime (Time t)
uint64_t GetStabilityDecrFactor () const
void SetStabilityDecrFactor (uint64_t decrFactor)
uint64_t GetStabilityIncrFactor () const
void SetStabilityIncrFactor (uint64_t incrFactor)
Time GetInitStability () const
void SetInitStability (Time initStability)
Time GetMinLifeTime () const
void SetMinLifeTime (Time minLifeTime)
Time GetUseExtends () const
void SetUseExtends (Time useExtends)
void SetCallback (Callback< void, Ipv4Address, uint8_t > cb)
Callback< void, Ipv4Address,
uint8_t > 
GetCallback () const
- Public Member Functions inherited from ns3::Object
 Object ()
virtual ~Object ()
void AggregateObject (Ptr< Object > other)
void Dispose (void)
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 Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
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 ()
 The Route Cache used by DSR.

Public Attributes

std::vector< Ptr< ArpCache > > m_arp
Time m_delay
Callback< void, Ipv4Address,
uint8_t > 
m_handleLinkFailure
std::vector< Neighborm_nb
Timer m_ntimer
Callback< void, WifiMacHeader
const & > 
m_txErrorCallback

Private Types

typedef std::list
< RouteCacheEntry
routeEntryVector

Private Member Functions

bool DecStability (Ipv4Address node)
bool IncStability (Ipv4Address node)
bool LookupRoute_Link (Ipv4Address id, RouteCacheEntry &rt)
RouteCacheoperator= (RouteCache const &)

Private Attributes

std::map< Ipv4Address, uint16_t > m_ackIdCache
Time m_badLinkLifetime
std::map< Ipv4Address,
RouteCacheEntry::IP_VECTOR
m_bestRoutesTable_link
Time m_initStability
bool m_isLinkCache
std::map< Link, LinkStabm_linkCache
uint32_t m_maxCacheLen
uint32_t m_maxEntriesEachDst
Time m_minLifeTime
std::map< Ipv4Address,
std::map< Ipv4Address,
uint32_t > > 
m_netGraph
std::map< Ipv4Address, NodeStabm_nodeCache
routeEntryVector m_routeEntryVector
std::map< Ipv4Address,
routeEntryVector
m_sortedRoutes
uint64_t m_stabilityDecrFactor
uint64_t m_stabilityIncrFactor
bool m_subRoute
Time m_useExtends
RouteCacheEntry::IP_VECTOR m_vector
Time RouteCacheTimeout

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
virtual void DoDispose (void)
virtual void DoStart (void)
virtual void NotifyNewAggregate (void)

Detailed Description

DSR route request queue Since DSR is an on demand routing we queue requests while looking for route.

Definition at line 302 of file dsr-rcache.h.

Member Typedef Documentation

Constructor & Destructor Documentation

ns3::dsr::RouteCache::RouteCache ( )

Constructor.

Definition at line 145 of file dsr-rcache.cc.

References m_delay, m_ntimer, m_txErrorCallback, ns3::MakeCallback(), ProcessTxError(), PurgeMac(), ns3::Timer::SetDelay(), and ns3::Timer::SetFunction().

+ Here is the call graph for this function:

ns3::dsr::RouteCache::~RouteCache ( )
virtual

Destructor.

Definition at line 160 of file dsr-rcache.cc.

References m_sortedRoutes, and NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

void ns3::dsr::RouteCache::AddArpCache ( Ptr< ArpCache a)

Definition at line 1183 of file dsr-rcache.cc.

References m_arp.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::AddNeighbor ( std::vector< Ipv4Address nodeList,
Ipv4Address  ownAddress,
Time  expire 
)

Definition at line 1124 of file dsr-rcache.cc.

References LookupMacAddress(), m_nb, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_LOGIC, and PurgeMac().

+ Here is the call graph for this function:

bool ns3::dsr::RouteCache::AddRoute ( RouteCacheEntry rt)

Add route cache entry if it doesn't yet exist in route cache

Parameters
rtroute cache entry
Returns
true in success

Save the new route cache along with the destination address in map

Drop the most aged packet when buffer reaches to max

Save the new route cache along with the destination address in map

Definition at line 642 of file dsr-rcache.cc.

References ns3::dsr::CompareRoutesExpire(), FindSameRoute(), ns3::dsr::RouteCacheEntry::GetDestination(), ns3::dsr::RouteCacheEntry::GetExpireTime(), ns3::dsr::RouteCacheEntry::GetVector(), m_maxEntriesEachDst, m_sortedRoutes, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, Purge(), and RemoveLastEntry().

Referenced by ns3::dsr::DsrRouting::AddRoute(), and ns3::dsr::DsrCacheEntryTest::DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint16_t ns3::dsr::RouteCache::CheckUniqueAckId ( Ipv4Address  nextHop)

This part of code maintains an Acknowledgment id cache for next hop and remove duplicate ids

Definition at line 1032 of file dsr-rcache.cc.

References m_ackIdCache, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::dsr::DsrRouting::AddAckReqHeader(), and ns3::dsr::DsrRouting::SalvagePacket().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::Clear ( void  )
inline

Definition at line 459 of file dsr-rcache.h.

References m_routeEntryVector.

void ns3::dsr::RouteCache::ClearMac ( )
inline

Definition at line 512 of file dsr-rcache.h.

References m_nb.

bool ns3::dsr::RouteCache::DecStability ( Ipv4Address  node)
private

Definition at line 534 of file dsr-rcache.cc.

References m_initStability, m_nodeCache, m_stabilityDecrFactor, and NS_LOG_FUNCTION.

Referenced by DeleteAllRoutesIncludeLink().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::DelArpCache ( Ptr< ArpCache a)

Definition at line 1189 of file dsr-rcache.cc.

References m_arp.

Referenced by ns3::dsr::DsrRouting::DoDispose().

+ Here is the caller graph for this function:

bool ns3::dsr::RouteCache::DeleteRoute ( Ipv4Address  dst)

Delete the route with certain destination address

Parameters
dstthe destination address of the routes that should be deleted

Definition at line 745 of file dsr-rcache.cc.

References m_sortedRoutes, NS_LOG_FUNCTION, NS_LOG_LOGIC, and Purge().

Referenced by ns3::dsr::DsrCacheEntryTest::DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::DropPathWithDst ( Ipv4Address  dst)
bool ns3::dsr::RouteCache::FindSameRoute ( RouteCacheEntry rt,
std::list< RouteCacheEntry > &  rtVector 
)

Find the same route in the route cache

Parameters
rtentry with destination address dst, if exists
rtVectorthe route vector

Definition at line 712 of file dsr-rcache.cc.

References ns3::dsr::CompareRoutesExpire(), ns3::dsr::RouteCacheEntry::GetDestination(), ns3::dsr::RouteCacheEntry::GetExpireTime(), ns3::Time::GetSeconds(), ns3::dsr::RouteCacheEntry::GetVector(), m_sortedRoutes, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by AddRoute().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint16_t ns3::dsr::RouteCache::GetAckSize ( )

Definition at line 1054 of file dsr-rcache.cc.

References m_ackIdCache.

Time ns3::dsr::RouteCache::GetBadLinkLifetime ( ) const
inline

Definition at line 363 of file dsr-rcache.h.

References m_badLinkLifetime.

Time ns3::dsr::RouteCache::GetCacheTimeout ( ) const
inline

Definition at line 347 of file dsr-rcache.h.

References RouteCacheTimeout.

Callback<void, Ipv4Address, uint8_t > ns3::dsr::RouteCache::GetCallback ( ) const
inline

Definition at line 535 of file dsr-rcache.h.

References m_handleLinkFailure.

Ipv4Address ns3::dsr::RouteCache::GetDestination ( void  ) const
Time ns3::dsr::RouteCache::GetExpireTime ( Ipv4Address  addr)

Definition at line 1080 of file dsr-rcache.cc.

References m_nb, ns3::Simulator::Now(), NS_LOG_FUNCTION, PurgeMac(), and ns3::Seconds().

+ Here is the call graph for this function:

Time ns3::dsr::RouteCache::GetInitStability ( ) const
inline

Definition at line 387 of file dsr-rcache.h.

References m_initStability.

uint32_t ns3::dsr::RouteCache::GetMaxCacheLen ( ) const
inline

Definition at line 339 of file dsr-rcache.h.

References m_maxCacheLen.

uint32_t ns3::dsr::RouteCache::GetMaxEntriesEachDst ( ) const
inline

Definition at line 355 of file dsr-rcache.h.

References m_maxEntriesEachDst.

Time ns3::dsr::RouteCache::GetMinLifeTime ( ) const
inline

Definition at line 395 of file dsr-rcache.h.

References m_minLifeTime.

uint64_t ns3::dsr::RouteCache::GetStabilityDecrFactor ( ) const
inline

Definition at line 371 of file dsr-rcache.h.

References m_stabilityDecrFactor.

uint64_t ns3::dsr::RouteCache::GetStabilityIncrFactor ( ) const
inline

Definition at line 379 of file dsr-rcache.h.

References m_stabilityIncrFactor.

bool ns3::dsr::RouteCache::GetSubRoute ( ) const
inline

Definition at line 331 of file dsr-rcache.h.

References m_subRoute.

Callback<void, WifiMacHeader const &> ns3::dsr::RouteCache::GetTxErrorCallback ( ) const
inline

Definition at line 525 of file dsr-rcache.h.

References m_txErrorCallback.

Referenced by ns3::dsr::DsrRouting::DoDispose(), and ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

Time ns3::dsr::RouteCache::GetUseExtends ( ) const
inline

Definition at line 403 of file dsr-rcache.h.

References m_useExtends.

bool ns3::dsr::RouteCache::IncStability ( Ipv4Address  node)
private

Definition at line 513 of file dsr-rcache.cc.

References ns3::Time::GetSeconds(), m_initStability, m_nodeCache, m_stabilityIncrFactor, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by UseExtends().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::RouteCache::IsEqual ( RouteCacheEntry  ca)
bool ns3::dsr::RouteCache::IsNeighbor ( Ipv4Address  addr)

This part maintains a neighbor list to handle unidirectional links and link-layer acks

Definition at line 1064 of file dsr-rcache.cc.

References m_nb, NS_LOG_FUNCTION, and PurgeMac().

+ Here is the call graph for this function:

Mac48Address ns3::dsr::RouteCache::LookupMacAddress ( Ipv4Address  addr)

Definition at line 1195 of file dsr-rcache.cc.

References ns3::Mac48Address::ConvertFrom(), ns3::ArpCache::Entry::GetMacAddress(), ns3::ArpCache::Entry::IsAlive(), ns3::ArpCache::Entry::IsExpired(), and m_arp.

Referenced by AddNeighbor(), and UpdateNeighbor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::RouteCache::LookupRoute_Link ( Ipv4Address  id,
RouteCacheEntry rt 
)
private
RouteCache& ns3::dsr::RouteCache::operator= ( RouteCache const &  )
private
void ns3::dsr::RouteCache::Print ( std::ostream &  os)

Definition at line 1013 of file dsr-rcache.cc.

References m_routeEntryVector, NS_LOG_FUNCTION, and Purge().

+ Here is the call graph for this function:

void ns3::dsr::RouteCache::PrintRouteVector ( std::list< RouteCacheEntry route)

Print all the route vector elements from the route list

Parameters
routethe route list

Definition at line 934 of file dsr-rcache.cc.

References NS_LOG_FUNCTION, NS_LOG_INFO, and PrintVector().

+ Here is the call graph for this function:

void ns3::dsr::RouteCache::PrintVector ( std::vector< Ipv4Address > &  vec)

Print the route vector elements

Parameters
vecthe route vector

Definition at line 913 of file dsr-rcache.cc.

References NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by LookupRoute_Link(), PrintRouteVector(), and RebuildBestRouteTable().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::ProcessTxError ( WifiMacHeader const &  hdr)

Definition at line 1212 of file dsr-rcache.cc.

References ns3::WifiMacHeader::GetAddr1(), m_nb, and PurgeMac().

Referenced by RouteCache().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::Purge ( )

Definition at line 946 of file dsr-rcache.cc.

References m_sortedRoutes, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Seconds().

Referenced by AddRoute(), DeleteAllRoutesIncludeLink(), DeleteRoute(), LookupRoute(), and Print().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::PurgeLinkNode ( )

Definition at line 463 of file dsr-rcache.cc.

References m_linkCache, m_nodeCache, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Seconds().

Referenced by AddRoute_Link(), and DeleteAllRoutesIncludeLink().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::PurgeMac ( )

Definition at line 1150 of file dsr-rcache.cc.

References ns3::Timer::Cancel(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_handleLinkFailure, m_nb, m_ntimer, NS_LOG_LOGIC, and ns3::Timer::Schedule().

Referenced by AddNeighbor(), GetExpireTime(), IsNeighbor(), ProcessTxError(), RouteCache(), and UpdateNeighbor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::RebuildBestRouteTable ( Ipv4Address  source)

USE MAXWEIGHT TO REPRESENT MAX; USE BROADCAST ADDRESS TO REPRESENT NULL PRECEEDING ADDRESS.

The followings are initialize-single-source

The followings are core of dijskra algorithm

The followings are for comparison

Selects the shortest-length route that has the longest expected lifetime (highest minimum timeout of any link in the route) For the computation overhead and complexity Here I just implement kind of greedy strategy to select link with the longest expected lifetime when there is two options

Reverse the route

Definition at line 315 of file dsr-rcache.cc.

References ns3::Ipv4Address::IsBroadcast(), m_bestRoutesTable_link, m_linkCache, m_netGraph, MAXWEIGHT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and PrintVector().

Referenced by AddRoute_Link(), and DeleteAllRoutesIncludeLink().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::RemoveLastEntry ( std::list< RouteCacheEntry > &  rtVector)

Definition at line 168 of file dsr-rcache.cc.

References NS_LOG_FUNCTION.

Referenced by AddRoute().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::ScheduleTimer ( )

Definition at line 1176 of file dsr-rcache.cc.

References ns3::Timer::Cancel(), m_ntimer, and ns3::Timer::Schedule().

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetBadLinkLifetime ( Time  t)
inline

Definition at line 367 of file dsr-rcache.h.

References m_badLinkLifetime.

void ns3::dsr::RouteCache::SetCacheTimeout ( Time  t)
inline

Definition at line 351 of file dsr-rcache.h.

References RouteCacheTimeout.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetCacheType ( std::string  type)

dijsktra algorithm to get the best route from m_netGraph and update the m_bestRoutesTable_link current graph information has changed

Definition at line 289 of file dsr-rcache.cc.

References m_isLinkCache, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetCallback ( Callback< void, Ipv4Address, uint8_t >  cb)
inline

Definition at line 531 of file dsr-rcache.h.

References m_handleLinkFailure.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetInitStability ( Time  initStability)
inline

Definition at line 391 of file dsr-rcache.h.

References m_initStability.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetMaxCacheLen ( uint32_t  len)
inline

Definition at line 343 of file dsr-rcache.h.

References m_maxCacheLen.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetMaxEntriesEachDst ( uint32_t  entries)
inline

Definition at line 359 of file dsr-rcache.h.

References m_maxEntriesEachDst.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetMinLifeTime ( Time  minLifeTime)
inline

Definition at line 399 of file dsr-rcache.h.

References m_minLifeTime.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetStabilityDecrFactor ( uint64_t  decrFactor)
inline

Definition at line 375 of file dsr-rcache.h.

References m_stabilityDecrFactor.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetStabilityIncrFactor ( uint64_t  incrFactor)
inline

Definition at line 383 of file dsr-rcache.h.

References m_stabilityIncrFactor.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetSubRoute ( bool  subRoute)
inline

Definition at line 335 of file dsr-rcache.h.

References m_subRoute.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::SetUseExtends ( Time  useExtends)
inline

Definition at line 407 of file dsr-rcache.h.

References m_useExtends.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::UpdateNeighbor ( std::vector< Ipv4Address nodeList,
Time  expire 
)

Definition at line 1096 of file dsr-rcache.cc.

References LookupMacAddress(), m_nb, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and PurgeMac().

+ Here is the call graph for this function:

void ns3::dsr::RouteCache::UpdateNetGraph ( )

Update the Net Graph for the link and node cache has changed.

Definition at line 499 of file dsr-rcache.cc.

References m_linkCache, m_netGraph, and NS_LOG_FUNCTION.

Referenced by AddRoute_Link(), and DeleteAllRoutesIncludeLink().

+ Here is the caller graph for this function:

bool ns3::dsr::RouteCache::UpdateRouteEntry ( Ipv4Address  dst)

Update route cache entry if it has been recently used and successfully delivered the data packet

Parameters
dstdestination address of the route
vecthe route vector
Returns
true in success

Definition at line 176 of file dsr-rcache.cc.

References ns3::dsr::CompareRoutesExpire(), m_sortedRoutes, NS_LOG_DEBUG, NS_LOG_FUNCTION, RouteCacheTimeout, and ns3::dsr::RouteCacheEntry::SetExpireTime().

Referenced by ns3::dsr::DsrRouting::UpdateRouteEntry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::RouteCache::UseExtends ( RouteCacheEntry::IP_VECTOR  rt)

When a link from the Route Cache is used in routing a packet originated or salvaged by that node, the stability metric for each of the two endpoint nodes of that link is incremented by the amount of time since that link was last used. When a link is used in a route chosen for a packet originated or salvaged by this node, the link's lifetime is set to be at least UseExtends into the future

Definition at line 600 of file dsr-rcache.cc.

References IncStability(), m_initStability, m_linkCache, m_nodeCache, m_useExtends, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::dsr::DsrRouting::PacketNewRoute(), ns3::dsr::DsrRouting::RouteRequestTimerExpire(), ns3::dsr::DsrRouting::SalvagePacket(), ns3::dsr::DsrRouting::Send(), ns3::dsr::DsrRouting::SendErrorRequest(), ns3::dsr::DsrRouting::SendPacketFromBuffer(), ns3::dsr::DsrRouting::SendRerrWhenBreaksLinkToNextHop(), ns3::dsr::DsrRouting::SendUnreachError(), and ns3::dsr::DsrRouting::UseExtends().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::map<Ipv4Address, uint16_t> ns3::dsr::RouteCache::m_ackIdCache
private

Definition at line 566 of file dsr-rcache.h.

Referenced by CheckUniqueAckId(), and GetAckSize().

std::vector<Ptr<ArpCache> > ns3::dsr::RouteCache::m_arp

Definition at line 630 of file dsr-rcache.h.

Referenced by AddArpCache(), DelArpCache(), and LookupMacAddress().

Time ns3::dsr::RouteCache::m_badLinkLifetime
private

Definition at line 546 of file dsr-rcache.h.

Referenced by GetBadLinkLifetime(), and SetBadLinkLifetime().

std::map<Ipv4Address, RouteCacheEntry::IP_VECTOR> ns3::dsr::RouteCache::m_bestRoutesTable_link
private

Definition at line 583 of file dsr-rcache.h.

Referenced by LookupRoute_Link(), and RebuildBestRouteTable().

Time ns3::dsr::RouteCache::m_delay

Definition at line 632 of file dsr-rcache.h.

Referenced by RouteCache().

Callback<void, Ipv4Address, uint8_t > ns3::dsr::RouteCache::m_handleLinkFailure

The following code handles link-layer acks

Definition at line 622 of file dsr-rcache.h.

Referenced by GetCallback(), PurgeMac(), and SetCallback().

Time ns3::dsr::RouteCache::m_initStability
private
bool ns3::dsr::RouteCache::m_isLinkCache
private

Definition at line 568 of file dsr-rcache.h.

Referenced by IsLinkCache(), and SetCacheType().

std::map<Link, LinkStab> ns3::dsr::RouteCache::m_linkCache
private
uint32_t ns3::dsr::RouteCache::m_maxCacheLen
private

Definition at line 544 of file dsr-rcache.h.

Referenced by GetMaxCacheLen(), and SetMaxCacheLen().

uint32_t ns3::dsr::RouteCache::m_maxEntriesEachDst
private

Definition at line 564 of file dsr-rcache.h.

Referenced by AddRoute(), GetMaxEntriesEachDst(), and SetMaxEntriesEachDst().

Time ns3::dsr::RouteCache::m_minLifeTime
private

Definition at line 553 of file dsr-rcache.h.

Referenced by AddRoute_Link(), GetMinLifeTime(), and SetMinLifeTime().

std::vector<Neighbor> ns3::dsr::RouteCache::m_nb
std::map<Ipv4Address, std::map<Ipv4Address, uint32_t> > ns3::dsr::RouteCache::m_netGraph
private

Current network graph state for this node, double is weight, which is calculated by the node information and link information, any time some changes of link cache and node cache change the weight and then recompute the best choice for each node

Definition at line 581 of file dsr-rcache.h.

Referenced by RebuildBestRouteTable(), and UpdateNetGraph().

std::map<Ipv4Address, NodeStab> ns3::dsr::RouteCache::m_nodeCache
private
Timer ns3::dsr::RouteCache::m_ntimer

Definition at line 626 of file dsr-rcache.h.

Referenced by PurgeMac(), RouteCache(), and ScheduleTimer().

routeEntryVector ns3::dsr::RouteCache::m_routeEntryVector
private

Definition at line 562 of file dsr-rcache.h.

Referenced by Clear(), and Print().

std::map<Ipv4Address, routeEntryVector> ns3::dsr::RouteCache::m_sortedRoutes
private
uint64_t ns3::dsr::RouteCache::m_stabilityDecrFactor
private

Definition at line 550 of file dsr-rcache.h.

Referenced by DecStability(), GetStabilityDecrFactor(), and SetStabilityDecrFactor().

uint64_t ns3::dsr::RouteCache::m_stabilityIncrFactor
private

Definition at line 551 of file dsr-rcache.h.

Referenced by GetStabilityIncrFactor(), IncStability(), and SetStabilityIncrFactor().

bool ns3::dsr::RouteCache::m_subRoute
private

Definition at line 570 of file dsr-rcache.h.

Referenced by DeleteAllRoutesIncludeLink(), GetSubRoute(), and SetSubRoute().

Callback<void, WifiMacHeader const &> ns3::dsr::RouteCache::m_txErrorCallback

Definition at line 624 of file dsr-rcache.h.

Referenced by GetTxErrorCallback(), and RouteCache().

Time ns3::dsr::RouteCache::m_useExtends
private

Definition at line 554 of file dsr-rcache.h.

Referenced by GetUseExtends(), SetUseExtends(), and UseExtends().

RouteCacheEntry::IP_VECTOR ns3::dsr::RouteCache::m_vector
private

Definition at line 543 of file dsr-rcache.h.

Time ns3::dsr::RouteCache::RouteCacheTimeout
private

Definition at line 545 of file dsr-rcache.h.

Referenced by GetCacheTimeout(), LookupRoute_Link(), SetCacheTimeout(), and UpdateRouteEntry().


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