A Discrete-Event Network Simulator
API
dsr-rcache.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Yufei Cheng
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Yufei Cheng <yfcheng@ittc.ku.edu>
19  * Song Luan <lsuper@mail.ustc.edu.cn> (Implemented Link Cache using dijsktra algorithm to get the best route)
20  *
21  * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
22  * ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets
23  * Information and Telecommunication Technology Center (ITTC)
24  * and Department of Electrical Engineering and Computer Science
25  * The University of Kansas Lawrence, KS USA.
26  *
27  * Work supported in part by NSF FIND (Future Internet Design) Program
28  * under grant CNS-0626918 (Postmodern Internet Architecture),
29  * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
30  * US Department of Defense (DoD), and ITTC at The University of Kansas.
31  */
32 
33 #ifndef DSR_RCACHE_H
34 #define DSR_RCACHE_H
35 
36 #include <map>
37 #include <stdint.h>
38 #include <cassert>
39 #include <sys/types.h>
40 #include <iostream>
41 #include <vector>
42 
43 #include "ns3/simulator.h"
44 #include "ns3/timer.h"
45 #include "ns3/simple-ref-count.h"
46 #include "ns3/header.h"
47 #include "ns3/enum.h"
48 #include "ns3/ipv4-address.h"
49 #include "ns3/nstime.h"
50 #include "ns3/ipv4.h"
51 #include "ns3/ipv4-route.h"
52 #include "ns3/net-device.h"
53 #include "ns3/ipv4-l3-protocol.h"
54 #include "ns3/callback.h"
55 #include "ns3/wifi-mac-header.h"
56 #include "ns3/arp-cache.h"
57 #include "dsr-option-header.h"
58 
59 namespace ns3 {
60 class Time;
61 namespace dsr {
62 
86 struct Link
87 {
90 
97  {
98  if (ip1 < ip2)
99  {
100  m_low = ip1;
101  m_high = ip2;
102  }
103  else
104  {
105  m_low = ip2;
106  m_high = ip1;
107  }
108  }
114  bool operator < (Link const& L) const
115  {
116  if (m_low < L.m_low)
117  {
118  return true;
119  }
120  else if (m_low == L.m_low)
121  {
122  return (m_high < L.m_high);
123  }
124  else
125  {
126  return false;
127  }
128  }
130  void Print () const;
131 };
132 
133 
139 {
140 public:
145  DsrLinkStab (Time linkStab = Simulator::Now ());
149  virtual ~DsrLinkStab ();
150 
155  void SetLinkStability (Time linkStab)
156  {
157  m_linkStability = linkStab + Simulator::Now ();
158  }
164  {
165  return m_linkStability - Simulator::Now ();
166  }
167 
169  void Print () const;
170 
171 private:
177 };
178 
184 {
185 public:
191  DsrNodeStab (Time nodeStab = Simulator::Now ());
192  virtual ~DsrNodeStab ();
193 
198  void SetNodeStability (Time nodeStab)
199  {
200  m_nodeStability = nodeStab + Simulator::Now ();
201  }
207  {
208  return m_nodeStability - Simulator::Now ();
209  }
210 private:
212 };
213 
219 {
220 public:
221  typedef std::vector<Ipv4Address> IP_VECTOR;
222  typedef std::vector<Ipv4Address>::iterator Iterator;
223 
231  DsrRouteCacheEntry (IP_VECTOR const & ip = IP_VECTOR (), Ipv4Address dst = Ipv4Address (), Time exp = Simulator::Now ());
232  virtual ~DsrRouteCacheEntry ();
233 
236  void Invalidate (Time badLinkLifetime);
237 
238  // Fields
243  void SetUnidirectional (bool u)
244  {
245  m_blackListState = u;
246  }
251  bool IsUnidirectional () const
252  {
253  return m_blackListState;
254  }
260  {
261  m_blackListTimeout = t;
262  }
268  {
269  return m_blackListTimeout;
270  }
276  {
277  return m_dst;
278  }
284  {
285  m_dst = d;
286  }
291  IP_VECTOR GetVector () const
292  {
293  return m_path;
294  }
299  void SetVector (IP_VECTOR v)
300  {
301  m_path = v;
302  }
307  void SetExpireTime (Time exp)
308  {
309  m_expire = exp + Simulator::Now ();
310  }
316  {
317  return m_expire - Simulator::Now ();
318  }
319 
324  void Print (std::ostream & os) const;
330  bool operator== (DsrRouteCacheEntry const & o) const
331  {
332  if (m_path.size () != o.m_path.size ())
333  {
334  NS_ASSERT (false);
335  return false;
336  }
337  IP_VECTOR::const_iterator j = o.m_path.begin ();
338  for (IP_VECTOR::const_iterator i = m_path.begin (); i
339  != m_path.end (); i++, j++)
340  {
341  /*
342  * Verify if neither the entry are not 0 and they equal to each other
343  */
344  if (((*i) == 0) || ((*j) == 0))
345  {
346  return false;
347  }
348  else if (!((*i) == (*j)) )
349  {
350  return false;
351  }
352  else
353  {
354  return true;
355  }
356  }
357  return false;
358  }
359  // \}
360 
361 private:
364  IP_VECTOR m_path;
367  uint8_t m_reqCount;
372 };
378 class DsrRouteCache : public Object
379 {
380 public:
385  static TypeId GetTypeId ();
386 
387  DsrRouteCache ();
388  virtual ~DsrRouteCache ();
389 
394  void RemoveLastEntry (std::list<DsrRouteCacheEntry> & rtVector);
398  typedef std::list<DsrRouteCacheEntry::IP_VECTOR> routeVector;
399 
400  // Fields
405  bool GetSubRoute () const
406  {
407  return m_subRoute;
408  }
413  void SetSubRoute (bool subRoute)
414  {
415  m_subRoute = subRoute;
416  }
421  uint32_t GetMaxCacheLen () const
422  {
423  return m_maxCacheLen;
424  }
429  void SetMaxCacheLen (uint32_t len)
430  {
431  m_maxCacheLen = len;
432  }
438  {
439  return RouteCacheTimeout;
440  }
446  {
447  RouteCacheTimeout = t;
448  }
453  uint32_t GetMaxEntriesEachDst () const
454  {
455  return m_maxEntriesEachDst;
456  }
461  void SetMaxEntriesEachDst (uint32_t entries)
462  {
463  m_maxEntriesEachDst = entries;
464  }
470  {
471  return m_badLinkLifetime;
472  }
478  {
479  m_badLinkLifetime = t;
480  }
485  uint64_t GetStabilityDecrFactor () const
486  {
487  return m_stabilityDecrFactor;
488  }
493  void SetStabilityDecrFactor (uint64_t decrFactor)
494  {
495  m_stabilityDecrFactor = decrFactor;
496  }
501  uint64_t GetStabilityIncrFactor () const
502  {
503  return m_stabilityIncrFactor;
504  }
509  void SetStabilityIncrFactor (uint64_t incrFactor)
510  {
511  m_stabilityIncrFactor = incrFactor;
512  }
518  {
519  return m_initStability;
520  }
525  void SetInitStability (Time initStability)
526  {
527  m_initStability = initStability;
528  }
534  {
535  return m_minLifeTime;
536  }
541  void SetMinLifeTime (Time minLifeTime)
542  {
543  m_minLifeTime = minLifeTime;
544  }
550  {
551  return m_useExtends;
552  }
557  void SetUseExtends (Time useExtends)
558  {
559  m_useExtends = useExtends;
560  }
561 
567  bool UpdateRouteEntry (Ipv4Address dst);
573  bool AddRoute (DsrRouteCacheEntry & rt);
585  void PrintVector (std::vector<Ipv4Address>& vec);
590  void PrintRouteVector (std::list<DsrRouteCacheEntry> route);
597  bool FindSameRoute (DsrRouteCacheEntry & rt, std::list<DsrRouteCacheEntry> & rtVector);
603  bool DeleteRoute (Ipv4Address dst);
612  void DeleteAllRoutesIncludeLink (Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node);
614  void Clear ()
615  {
617  }
619  void Purge ();
622  void Print (std::ostream &os);
623 
624  //------------------------------------------------------------------------------------------
630  uint16_t CheckUniqueAckId (Ipv4Address nextHop);
635  uint16_t GetAckSize ();
636 
637  // --------------------------------------------------------------------------------------------
639  struct Neighbor
640  {
644  bool close;
645 
654  : m_neighborAddress (ip),
655  m_hardwareAddress (mac),
656  m_expireTime (t),
657  close (false)
658  {
659  }
660 
662  {
663  } // For Python bindings
664  };
676  bool IsNeighbor (Ipv4Address addr);
682  void UpdateNeighbor (std::vector<Ipv4Address> nodeList, Time expire);
689  void AddNeighbor (std::vector<Ipv4Address> nodeList, Ipv4Address ownAddress, Time expire);
693  void PurgeMac ();
697  void ScheduleTimer ();
701  void ClearMac ()
702  {
703  m_nb.clear ();
704  }
708  void AddArpCache (Ptr<ArpCache>);
712  void DelArpCache (Ptr<ArpCache>);
718  {
719  return m_txErrorCallback;
720  }
721 
725  {
726  m_handleLinkFailure = cb;
727  }
730  {
731  return m_handleLinkFailure;
732  }
733 
734 private:
741  uint32_t m_maxCacheLen;
744  /*
745  * Define the parameters for link cache type
746  */
752 
755  typedef std::list<DsrRouteCacheEntry> routeEntryVector;
756 
757  std::map<Ipv4Address, routeEntryVector> m_sortedRoutes;
758 
759  routeEntryVector m_routeEntryVector;
760 
762 
763  std::map<Ipv4Address, uint16_t> m_ackIdCache;
764 
766 
767  bool m_subRoute;
768 
772  #define MAXWEIGHT 0xFFFF;
773 
778  std::map<Ipv4Address, std::map<Ipv4Address, uint32_t> > m_netGraph;
779 
780  std::map<Ipv4Address, DsrRouteCacheEntry::IP_VECTOR> m_bestRoutesTable_link;
781  std::map<Link, DsrLinkStab> m_linkCache;
782  std::map<Ipv4Address, DsrNodeStab> m_nodeCache;
783 
795  bool IncStability (Ipv4Address node);
801  bool DecStability (Ipv4Address node);
802 
803 public:
809  void SetCacheType (std::string type);
814  bool IsLinkCache ();
828  void RebuildBestRouteTable (Ipv4Address source);
832  void PurgeLinkNode ();
844  void UpdateNetGraph ();
845  //---------------------------------------------------------------------------------------
850 
852 
854 
855  std::vector<Neighbor> m_nb;
856 
857  std::vector<Ptr<ArpCache> > m_arp;
858 
860 
865 
868  void ProcessTxError (WifiMacHeader const &hdr);
869 };
870 } // namespace dsr
871 } // namespace ns3
872 #endif /* DSR_RCACHE_H */
Time m_minLifeTime
minimum lifetime
Definition: dsr-rcache.h:750
void ProcessTxError(WifiMacHeader const &hdr)
Process layer 2 TX error notification.
Definition: dsr-rcache.cc:1242
Ipv4Address m_neighborAddress
neightbor address
Definition: dsr-rcache.h:641
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Ipv4Address GetDestination() const
Get destination address.
Definition: dsr-rcache.h:275
DsrRouteCacheEntry class for entries in the route cache.
Definition: dsr-rcache.h:218
Time m_nodeStability
the node stability
Definition: dsr-rcache.h:211
DSR route request queue Since DSR is an on demand routing we queue requests while looking for route...
Definition: dsr-rcache.h:378
void SetDestination(Ipv4Address d)
Set destination address.
Definition: dsr-rcache.h:283
uint16_t CheckUniqueAckId(Ipv4Address nextHop)
Check for duplicate ids and save new entries if the id is not present in the table.
Definition: dsr-rcache.cc:1051
void AddNeighbor(std::vector< Ipv4Address > nodeList, Ipv4Address ownAddress, Time expire)
Add to the neighbor list.
Definition: dsr-rcache.cc:1143
Callback template class.
Definition: callback.h:1176
void SetBlacklistTimeout(Time t)
Set blacklist timeout.
Definition: dsr-rcache.h:259
Time m_expireTime
route expire time
Definition: dsr-rcache.h:643
Time m_badLinkLifetime
The time for which the neighboring node is put into the blacklist.
Definition: dsr-rcache.h:743
Mac48Address m_hardwareAddress
neighbor MAC address
Definition: dsr-rcache.h:642
A simple Timer class.
Definition: timer.h:73
void SetNodeStability(Time nodeStab)
Set node stability.
Definition: dsr-rcache.h:198
std::vector< Ptr< ArpCache > > m_arp
list of ARP cached to be used for layer 2 notifications processing
Definition: dsr-rcache.h:857
void SetMinLifeTime(Time minLifeTime)
Set minimum lifetime.
Definition: dsr-rcache.h:541
void UpdateNetGraph()
Update the Net Graph for the link and node cache has changed.
Definition: dsr-rcache.cc:500
std::list< DsrRouteCacheEntry > routeEntryVector
Define the route cache data structure.
Definition: dsr-rcache.h:755
uint32_t m_maxEntriesEachDst
number of entries for each destination
Definition: dsr-rcache.h:761
bool m_blackListState
Indicate if this entry is in "blacklist".
Definition: dsr-rcache.h:368
virtual ~DsrNodeStab()
Definition: dsr-rcache.cc:86
void DeleteAllRoutesIncludeLink(Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node)
Delete all the routes which includes the link from next hop address that has just been notified as un...
Definition: dsr-rcache.cc:774
void Invalidate(Time badLinkLifetime)
Mark entry as "down" (i.e.
Definition: dsr-rcache.cc:122
uint64_t GetStabilityDecrFactor() const
Get stability decrease factor.
Definition: dsr-rcache.h:485
Timer m_ackTimer
RREP_ACK timer.
Definition: dsr-rcache.h:362
bool GetSubRoute() const
Get subroute indicator.
Definition: dsr-rcache.h:405
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
DsrNodeStab(Time nodeStab=Simulator::Now())
Constructor.
Definition: dsr-rcache.cc:81
IP_VECTOR GetVector() const
Get the IP vector.
Definition: dsr-rcache.h:291
IP_VECTOR m_path
brief The IP address constructed route
Definition: dsr-rcache.h:364
Callback< void, WifiMacHeader const & > GetTxErrorCallback() const
Get callback to ProcessTxError, this callback is trying to use the wifi mac tx error header to notify...
Definition: dsr-rcache.h:717
void SetCallback(Callback< void, Ipv4Address, uint8_t > cb)
Handle link failure callback.
Definition: dsr-rcache.h:724
std::vector< Neighbor > m_nb
vector of entries
Definition: dsr-rcache.h:855
void PrintRouteVector(std::list< DsrRouteCacheEntry > route)
Print all the route vector elements from the route list.
Definition: dsr-rcache.cc:953
Time GetCacheTimeout() const
Get cache timeout value.
Definition: dsr-rcache.h:437
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:719
Timer m_ntimer
Timer for neighbor's list. Schedule Purge().
Definition: dsr-rcache.h:853
Ptr< Ipv4 > m_ipv4
The Ipv4 layer 3.
Definition: dsr-rcache.h:371
void RebuildBestRouteTable(Ipv4Address source)
Rebuild the best route table.
Definition: dsr-rcache.cc:317
routeEntryVector m_routeEntryVector
Define the route vector.
Definition: dsr-rcache.h:759
uint16_t GetAckSize()
Get the ack table size.
Definition: dsr-rcache.cc:1073
void AddArpCache(Ptr< ArpCache >)
Add ARP cache to be used to allow layer 2 notifications processing.
Definition: dsr-rcache.cc:1213
bool IsLinkCache()
is link cached
Definition: dsr-rcache.cc:310
Time RouteCacheTimeout
The maximum period of time that dsr is allowed to for an unused route.
Definition: dsr-rcache.h:742
bool IsUnidirectional() const
Get unidirectional flag.
Definition: dsr-rcache.h:251
bool UpdateRouteEntry(Ipv4Address dst)
Update route cache entry if it has been recently used and successfully delivered the data packet...
Definition: dsr-rcache.cc:178
Time m_expire
Expire time for queue entry.
Definition: dsr-rcache.h:365
Time m_delay
This timeout deals with the passive ack.
Definition: dsr-rcache.h:859
bool m_isLinkCache
Check if the route is using path cache or link cache.
Definition: dsr-rcache.h:765
Time m_initStability
initial stability
Definition: dsr-rcache.h:749
std::map< Ipv4Address, DsrNodeStab > m_nodeCache
The data structure to store node info.
Definition: dsr-rcache.h:782
void Print(std::ostream &os) const
Print necessary fields.
Definition: dsr-rcache.cc:129
std::list< DsrRouteCacheEntry::IP_VECTOR > routeVector
Define the vector of route entries.
Definition: dsr-rcache.h:398
void Clear()
Delete all entries from routing table.
Definition: dsr-rcache.h:614
static TypeId GetTypeId()
Get the type ID.
Definition: dsr-rcache.cc:137
Time GetUseExtends() const
Get use extends.
Definition: dsr-rcache.h:549
void ClearMac()
Remove all entries.
Definition: dsr-rcache.h:701
Time GetNodeStability() const
Get node stability.
Definition: dsr-rcache.h:206
std::map< Link, DsrLinkStab > m_linkCache
The data structure to store link info.
Definition: dsr-rcache.h:781
bool IncStability(Ipv4Address node)
increase the stability of the node
Definition: dsr-rcache.cc:515
void ScheduleTimer()
Schedule m_ntimer.
Definition: dsr-rcache.cc:1206
Time GetExpireTime(Ipv4Address addr)
Return expire time for neighbor node with address addr, if exists, else return 0. ...
Definition: dsr-rcache.cc:1099
void SetStabilityIncrFactor(uint64_t incrFactor)
Set stability increase factor.
Definition: dsr-rcache.h:509
uint32_t m_stabilityDecrFactor
stability decrease factor
Definition: dsr-rcache.h:747
bool IsNeighbor(Ipv4Address addr)
Check that node with address addr is neighbor.
Definition: dsr-rcache.cc:1083
bool LookupRoute_Link(Ipv4Address id, DsrRouteCacheEntry &rt)
used by LookupRoute when LinkCache
Definition: dsr-rcache.cc:433
Mac48Address LookupMacAddress(Ipv4Address addr)
Find MAC address by IP using list of ARP caches.
Definition: dsr-rcache.cc:1225
Time GetBlacklistTimeout() const
Get blacklist timeout.
Definition: dsr-rcache.h:267
std::vector< Ipv4Address > IP_VECTOR
Define the vector to hold Ip address.
Definition: dsr-rcache.h:221
uint32_t m_maxCacheLen
The maximum number of packets that we allow a routing protocol to buffer.
Definition: dsr-rcache.h:741
std::map< Ipv4Address, std::map< Ipv4Address, uint32_t > > m_netGraph
Current network graph state for this node, double is weight, which is calculated by the node informat...
Definition: dsr-rcache.h:778
Time m_useExtends
use extend
Definition: dsr-rcache.h:751
tuple mac
Definition: third.py:92
void SetBadLinkLifetime(Time t)
Set bad link lifetime function.
Definition: dsr-rcache.h:477
bool LookupRoute(Ipv4Address id, DsrRouteCacheEntry &rt)
Lookup route cache entry with destination address dst.
Definition: dsr-rcache.cc:208
std::map< Ipv4Address, uint16_t > m_ackIdCache
The id cache to ensure all the ids are unique.
Definition: dsr-rcache.h:763
Time GetExpireTime() const
Get expire time.
Definition: dsr-rcache.h:315
void SetUnidirectional(bool u)
Set unidirectional flag.
Definition: dsr-rcache.h:243
DsrRouteCacheEntry::IP_VECTOR m_vector
The route vector to save the ip addresses for intermediate nodes.
Definition: dsr-rcache.h:740
bool AddRoute_Link(DsrRouteCacheEntry::IP_VECTOR nodelist, Ipv4Address node)
dd route link to cache
Definition: dsr-rcache.cc:562
Time GetMinLifeTime() const
Get minimum lifetime.
Definition: dsr-rcache.h:533
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ipv4InterfaceAddress m_iface
Output interface address.
Definition: dsr-rcache.h:366
Neighbor(Ipv4Address ip, Mac48Address mac, Time t)
Constructor.
Definition: dsr-rcache.h:653
bool FindSameRoute(DsrRouteCacheEntry &rt, std::list< DsrRouteCacheEntry > &rtVector)
Find the same route in the route cache.
Definition: dsr-rcache.cc:727
void SetSubRoute(bool subRoute)
Set subroute indicator.
Definition: dsr-rcache.h:413
void Purge()
Delete all outdated entries and invalidate valid entry if Lifetime is expired.
Definition: dsr-rcache.cc:965
Ipv4Address m_dst
The destination Ip address.
Definition: dsr-rcache.h:363
bool DeleteRoute(Ipv4Address dst)
Delete the route with certain destination address.
Definition: dsr-rcache.cc:760
std::vector< Ipv4Address >::iterator Iterator
Define the iterator.
Definition: dsr-rcache.h:222
Time m_blackListTimeout
Time for which the node is put into the blacklist.
Definition: dsr-rcache.h:369
an EUI-48 address
Definition: mac48-address.h:43
DsrRouteCache & operator=(DsrRouteCache const &)
assignment operator - defined but not implemented to avoid misuse.
void UpdateNeighbor(std::vector< Ipv4Address > nodeList, Time expire)
Update expire time for entry with address addr, if it exists, else add new entry. ...
Definition: dsr-rcache.cc:1115
void SetInitStability(Time initStability)
Set initial stability.
Definition: dsr-rcache.h:525
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:249
Ptr< Ipv4Route > m_ipv4Route
The Ipv4 route.
Definition: dsr-rcache.h:370
void PurgeLinkNode()
Purge from the cache if the stability time expired.
Definition: dsr-rcache.cc:465
Structure to manage neighbor state.
Definition: dsr-rcache.h:639
std::map< Ipv4Address, DsrRouteCacheEntry::IP_VECTOR > m_bestRoutesTable_link
for link route cache
Definition: dsr-rcache.h:780
void RemoveLastEntry(std::list< DsrRouteCacheEntry > &rtVector)
Remove the aged route cache entries when the route cache is full.
Definition: dsr-rcache.cc:170
std::map< Ipv4Address, routeEntryVector > m_sortedRoutes
Map the ipv4Address to route entry vector.
Definition: dsr-rcache.h:757
uint64_t GetStabilityIncrFactor() const
Get stability increase factor.
Definition: dsr-rcache.h:501
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
virtual ~DsrRouteCacheEntry()
Definition: dsr-rcache.cc:117
Callback< void, WifiMacHeader const & > m_txErrorCallback
TX error callback.
Definition: dsr-rcache.h:851
uint32_t GetMaxCacheLen() const
Get the max queue length.
Definition: dsr-rcache.h:421
void DelArpCache(Ptr< ArpCache >)
Don't use the provided ARP cache any more (interface is down)
Definition: dsr-rcache.cc:1219
a class to store IPv4 address information on an interface
void SetVector(IP_VECTOR v)
Sets the IP vector.
Definition: dsr-rcache.h:299
bool DecStability(Ipv4Address node)
decrease the stability of the node
Definition: dsr-rcache.cc:539
void PurgeMac()
Remove all expired mac entries.
Definition: dsr-rcache.cc:1180
void Print(std::ostream &os)
Print route cache.
Definition: dsr-rcache.cc:1032
void SetExpireTime(Time exp)
Set expire time.
Definition: dsr-rcache.h:307
Time GetBadLinkLifetime() const
Get bad link lifetime function.
Definition: dsr-rcache.h:469
uint32_t m_stabilityIncrFactor
stability increase factor
Definition: dsr-rcache.h:748
void SetCacheType(std::string type)
Dijsktra algorithm to get the best route from m_netGraph and update the m_bestRoutesTable_link when c...
Definition: dsr-rcache.cc:291
bool AddRoute(DsrRouteCacheEntry &rt)
Add route cache entry if it doesn't yet exist in route cache.
Definition: dsr-rcache.cc:657
DsrRouteCacheEntry(IP_VECTOR const &ip=IP_VECTOR(), Ipv4Address dst=Ipv4Address(), Time exp=Simulator::Now())
Constructor.
Definition: dsr-rcache.cc:106
uint32_t GetMaxEntriesEachDst() const
Get max entries for each destination.
Definition: dsr-rcache.h:453
A base class which provides memory management and object aggregation.
Definition: object.h:87
void SetUseExtends(Time useExtends)
Set use extends.
Definition: dsr-rcache.h:557
Callback< void, Ipv4Address, uint8_t > m_handleLinkFailure
The following code handles link-layer acks.
Definition: dsr-rcache.h:849
void UseExtends(DsrRouteCacheEntry::IP_VECTOR rt)
When a link from the Route Cache is used in routing a packet originated or salvaged by that node...
Definition: dsr-rcache.cc:611
void SetMaxCacheLen(uint32_t len)
Set the max queue length.
Definition: dsr-rcache.h:429
Callback< void, Ipv4Address, uint8_t > GetCallback() const
Handle link failure callback.
Definition: dsr-rcache.h:729
bool close
is route active
Definition: dsr-rcache.h:644
Time GetInitStability() const
Get initial stability.
Definition: dsr-rcache.h:517
DsrNodeStab class (DSR node stability)
Definition: dsr-rcache.h:183
a unique identifier for an interface.
Definition: type-id.h:58
void PrintVector(std::vector< Ipv4Address > &vec)
Print the route vector elements.
Definition: dsr-rcache.cc:932
void SetMaxEntriesEachDst(uint32_t entries)
Set max entries for each destination.
Definition: dsr-rcache.h:461
void SetStabilityDecrFactor(uint64_t decrFactor)
Set stability decrease factor.
Definition: dsr-rcache.h:493
uint8_t m_reqCount
Number of route requests.
Definition: dsr-rcache.h:367
Implements the IEEE 802.11 MAC header.
void SetCacheTimeout(Time t)
Set cache timeout value.
Definition: dsr-rcache.h:445
bool m_subRoute
Check if save the sub route entries or not.
Definition: dsr-rcache.h:767
bool operator==(DsrRouteCacheEntry const &o) const
Compare the route cache entry.
Definition: dsr-rcache.h:330