DSR route request queue Since DSR is an on demand routing we queue requests while looking for route. More...
#include <dsr-rcache.h>
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 |
![]() | |
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) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
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< Neighbor > | m_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) |
RouteCache & | operator= (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, LinkStab > | m_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, NodeStab > | m_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 | |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
DSR route request queue Since DSR is an on demand routing we queue requests while looking for route.
This type is not accessible from the Config system.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Definition at line 302 of file dsr-rcache.h.
|
private |
Definition at line 558 of file dsr-rcache.h.
Definition at line 322 of file dsr-rcache.h.
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().
|
virtual |
Destructor.
Definition at line 160 of file dsr-rcache.cc.
References m_sortedRoutes, and NS_LOG_FUNCTION_NOARGS.
Definition at line 1183 of file dsr-rcache.cc.
References m_arp.
Referenced by ns3::dsr::DsrRouting::Start().
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().
bool ns3::dsr::RouteCache::AddRoute | ( | RouteCacheEntry & | rt | ) |
Add route cache entry if it doesn't yet exist in route cache
rt | route cache entry |
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().
bool ns3::dsr::RouteCache::AddRoute_Link | ( | RouteCacheEntry::IP_VECTOR | nodelist, |
Ipv4Address | node | ||
) |
Definition at line 554 of file dsr-rcache.cc.
References ns3::dsr::LinkStab::GetLinkStability(), ns3::Time::GetSeconds(), m_initStability, m_linkCache, m_minLifeTime, m_nodeCache, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::dsr::Link::Print(), ns3::dsr::LinkStab::Print(), PurgeLinkNode(), RebuildBestRouteTable(), ns3::dsr::LinkStab::SetLinkStability(), ns3::dsr::NodeStab::SetNodeStability(), and UpdateNetGraph().
Referenced by ns3::dsr::DsrRouting::AddRoute_Link().
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().
|
inline |
Definition at line 459 of file dsr-rcache.h.
References m_routeEntryVector.
|
inline |
Definition at line 512 of file dsr-rcache.h.
References m_nb.
|
private |
Definition at line 534 of file dsr-rcache.cc.
References m_initStability, m_nodeCache, m_stabilityDecrFactor, and NS_LOG_FUNCTION.
Referenced by DeleteAllRoutesIncludeLink().
Definition at line 1189 of file dsr-rcache.cc.
References m_arp.
Referenced by ns3::dsr::DsrRouting::DoDispose().
void ns3::dsr::RouteCache::DeleteAllRoutesIncludeLink | ( | Ipv4Address | errorSrc, |
Ipv4Address | unreachNode, | ||
Ipv4Address | node | ||
) |
Definition at line 759 of file dsr-rcache.cc.
References ns3::dsr::CompareRoutesExpire(), DecStability(), IsLinkCache(), m_linkCache, m_nodeCache, m_sortedRoutes, m_subRoute, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, Purge(), PurgeLinkNode(), RebuildBestRouteTable(), ns3::dsr::RouteCacheEntry::SetDestination(), ns3::dsr::RouteCacheEntry::SetExpireTime(), ns3::dsr::RouteCacheEntry::SetVector(), and UpdateNetGraph().
Referenced by ns3::dsr::DsrRouting::DeleteAllRoutesIncludeLink(), ns3::dsr::DsrRouting::NetworkScheduleTimerExpire(), and ns3::dsr::DsrRouting::SendRerrWhenBreaksLinkToNextHop().
bool ns3::dsr::RouteCache::DeleteRoute | ( | Ipv4Address | dst | ) |
Delete the route with certain destination address
dst | the 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().
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
rt | entry with destination address dst, if exists |
rtVector | the 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().
uint16_t ns3::dsr::RouteCache::GetAckSize | ( | ) |
Definition at line 1054 of file dsr-rcache.cc.
References m_ackIdCache.
|
inline |
Definition at line 363 of file dsr-rcache.h.
References m_badLinkLifetime.
|
inline |
Definition at line 347 of file dsr-rcache.h.
References RouteCacheTimeout.
|
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().
|
inline |
Definition at line 387 of file dsr-rcache.h.
References m_initStability.
|
inline |
Definition at line 339 of file dsr-rcache.h.
References m_maxCacheLen.
|
inline |
Definition at line 355 of file dsr-rcache.h.
References m_maxEntriesEachDst.
|
inline |
Definition at line 395 of file dsr-rcache.h.
References m_minLifeTime.
|
inline |
Definition at line 371 of file dsr-rcache.h.
References m_stabilityDecrFactor.
|
inline |
Definition at line 379 of file dsr-rcache.h.
References m_stabilityIncrFactor.
|
inline |
Definition at line 331 of file dsr-rcache.h.
References m_subRoute.
|
inline |
Definition at line 525 of file dsr-rcache.h.
References m_txErrorCallback.
Referenced by ns3::dsr::DsrRouting::DoDispose(), and ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 403 of file dsr-rcache.h.
References m_useExtends.
|
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().
bool ns3::dsr::RouteCache::IsEqual | ( | RouteCacheEntry | ca | ) |
bool ns3::dsr::RouteCache::IsLinkCache | ( | ) |
Definition at line 308 of file dsr-rcache.cc.
References m_isLinkCache, and NS_LOG_FUNCTION.
Referenced by ns3::dsr::DsrRouting::CheckSendBuffer(), DeleteAllRoutesIncludeLink(), ns3::dsr::DsrRouting::IsLinkCache(), LookupRoute(), 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(), and ns3::dsr::DsrRouting::SendUnreachError().
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().
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().
bool ns3::dsr::RouteCache::LookupRoute | ( | Ipv4Address | id, |
RouteCacheEntry & | rt | ||
) |
Lookup route cache entry with destination address dst
dst | destination address |
rt | entry with destination address dst, if exists |
Definition at line 206 of file dsr-rcache.cc.
References ns3::dsr::CompareRoutesExpire(), IsLinkCache(), LookupRoute_Link(), m_sortedRoutes, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, Purge(), ns3::dsr::RouteCacheEntry::SetDestination(), ns3::dsr::RouteCacheEntry::SetExpireTime(), and ns3::dsr::RouteCacheEntry::SetVector().
Referenced by ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::dsr::DsrCacheEntryTest::DoRun(), ns3::dsr::DsrRouting::LookupRoute(), ns3::dsr::DsrRouting::PacketNewRoute(), ns3::dsr::DsrRouting::RouteRequestTimerExpire(), ns3::dsr::DsrRouting::SalvagePacket(), ns3::dsr::DsrRouting::Send(), ns3::dsr::DsrRouting::SendErrorRequest(), ns3::dsr::DsrRouting::SendRerrWhenBreaksLinkToNextHop(), and ns3::dsr::DsrRouting::SendUnreachError().
|
private |
Definition at line 433 of file dsr-rcache.cc.
References ns3::dsr::RouteCacheEntry::GetVector(), m_bestRoutesTable_link, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, PrintVector(), RouteCacheTimeout, ns3::dsr::RouteCacheEntry::SetDestination(), ns3::dsr::RouteCacheEntry::SetExpireTime(), and ns3::dsr::RouteCacheEntry::SetVector().
Referenced by LookupRoute().
|
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().
void ns3::dsr::RouteCache::PrintRouteVector | ( | std::list< RouteCacheEntry > | route | ) |
Print all the route vector elements from the route list
route | the route list |
Definition at line 934 of file dsr-rcache.cc.
References NS_LOG_FUNCTION, NS_LOG_INFO, and PrintVector().
void ns3::dsr::RouteCache::PrintVector | ( | std::vector< Ipv4Address > & | vec | ) |
Print the route vector elements
vec | the 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().
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().
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().
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().
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().
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().
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().
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().
|
inline |
Definition at line 367 of file dsr-rcache.h.
References m_badLinkLifetime.
|
inline |
Definition at line 351 of file dsr-rcache.h.
References RouteCacheTimeout.
Referenced by ns3::dsr::DsrRouting::Start().
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().
|
inline |
Definition at line 531 of file dsr-rcache.h.
References m_handleLinkFailure.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 391 of file dsr-rcache.h.
References m_initStability.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 343 of file dsr-rcache.h.
References m_maxCacheLen.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 359 of file dsr-rcache.h.
References m_maxEntriesEachDst.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 399 of file dsr-rcache.h.
References m_minLifeTime.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 375 of file dsr-rcache.h.
References m_stabilityDecrFactor.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 383 of file dsr-rcache.h.
References m_stabilityIncrFactor.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 335 of file dsr-rcache.h.
References m_subRoute.
Referenced by ns3::dsr::DsrRouting::Start().
|
inline |
Definition at line 407 of file dsr-rcache.h.
References m_useExtends.
Referenced by ns3::dsr::DsrRouting::Start().
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().
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().
bool ns3::dsr::RouteCache::UpdateRouteEntry | ( | Ipv4Address | dst | ) |
Update route cache entry if it has been recently used and successfully delivered the data packet
dst | destination address of the route |
vec | the route vector |
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().
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().
|
private |
Definition at line 566 of file dsr-rcache.h.
Referenced by CheckUniqueAckId(), and GetAckSize().
Definition at line 630 of file dsr-rcache.h.
Referenced by AddArpCache(), DelArpCache(), and LookupMacAddress().
|
private |
Definition at line 546 of file dsr-rcache.h.
Referenced by GetBadLinkLifetime(), and SetBadLinkLifetime().
|
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().
|
private |
Definition at line 552 of file dsr-rcache.h.
Referenced by AddRoute_Link(), DecStability(), GetInitStability(), IncStability(), SetInitStability(), and UseExtends().
|
private |
Definition at line 568 of file dsr-rcache.h.
Referenced by IsLinkCache(), and SetCacheType().
Definition at line 584 of file dsr-rcache.h.
Referenced by AddRoute_Link(), DeleteAllRoutesIncludeLink(), PurgeLinkNode(), RebuildBestRouteTable(), UpdateNetGraph(), and UseExtends().
|
private |
Definition at line 544 of file dsr-rcache.h.
Referenced by GetMaxCacheLen(), and SetMaxCacheLen().
|
private |
Definition at line 564 of file dsr-rcache.h.
Referenced by AddRoute(), GetMaxEntriesEachDst(), and SetMaxEntriesEachDst().
|
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 |
Definition at line 628 of file dsr-rcache.h.
Referenced by AddNeighbor(), ClearMac(), GetExpireTime(), IsNeighbor(), ProcessTxError(), PurgeMac(), and UpdateNeighbor().
|
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().
|
private |
Definition at line 585 of file dsr-rcache.h.
Referenced by AddRoute_Link(), DecStability(), DeleteAllRoutesIncludeLink(), IncStability(), PurgeLinkNode(), and UseExtends().
Timer ns3::dsr::RouteCache::m_ntimer |
Definition at line 626 of file dsr-rcache.h.
Referenced by PurgeMac(), RouteCache(), and ScheduleTimer().
|
private |
Definition at line 562 of file dsr-rcache.h.
|
private |
Definition at line 560 of file dsr-rcache.h.
Referenced by AddRoute(), DeleteAllRoutesIncludeLink(), DeleteRoute(), FindSameRoute(), LookupRoute(), Purge(), UpdateRouteEntry(), and ~RouteCache().
|
private |
Definition at line 550 of file dsr-rcache.h.
Referenced by DecStability(), GetStabilityDecrFactor(), and SetStabilityDecrFactor().
|
private |
Definition at line 551 of file dsr-rcache.h.
Referenced by GetStabilityIncrFactor(), IncStability(), and SetStabilityIncrFactor().
|
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().
|
private |
Definition at line 554 of file dsr-rcache.h.
Referenced by GetUseExtends(), SetUseExtends(), and UseExtends().
|
private |
Definition at line 543 of file dsr-rcache.h.
|
private |
Definition at line 545 of file dsr-rcache.h.
Referenced by GetCacheTimeout(), LookupRoute_Link(), SetCacheTimeout(), and UpdateRouteEntry().