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/arp-cache.h"
56 #include "dsr-option-header.h"
57 
58 namespace ns3 {
59 
60 class Time;
61 class WifiMacHeader;
62 
63 namespace dsr {
64 
88 struct Link
89 {
92 
99  {
100  if (ip1 < ip2)
101  {
102  m_low = ip1;
103  m_high = ip2;
104  }
105  else
106  {
107  m_low = ip2;
108  m_high = ip1;
109  }
110  }
116  bool operator < (Link const& L) const
117  {
118  if (m_low < L.m_low)
119  {
120  return true;
121  }
122  else if (m_low == L.m_low)
123  {
124  return (m_high < L.m_high);
125  }
126  else
127  {
128  return false;
129  }
130  }
132  void Print () const;
133 };
134 
135 
141 {
142 public:
147  DsrLinkStab (Time linkStab = Simulator::Now ());
151  virtual ~DsrLinkStab ();
152 
157  void SetLinkStability (Time linkStab)
158  {
159  m_linkStability = linkStab + Simulator::Now ();
160  }
166  {
167  return m_linkStability - Simulator::Now ();
168  }
169 
171  void Print () const;
172 
173 private:
179 };
180 
186 {
187 public:
193  DsrNodeStab (Time nodeStab = Simulator::Now ());
194  virtual ~DsrNodeStab ();
195 
200  void SetNodeStability (Time nodeStab)
201  {
202  m_nodeStability = nodeStab + Simulator::Now ();
203  }
209  {
210  return m_nodeStability - Simulator::Now ();
211  }
212 private:
214 };
215 
221 {
222 public:
223  typedef std::vector<Ipv4Address> IP_VECTOR;
224  typedef std::vector<Ipv4Address>::iterator Iterator;
225 
233  DsrRouteCacheEntry (IP_VECTOR const & ip = IP_VECTOR (), Ipv4Address dst = Ipv4Address (), Time exp = Simulator::Now ());
234  virtual ~DsrRouteCacheEntry ();
235 
238  void Invalidate (Time badLinkLifetime);
239 
240  // Fields
245  void SetUnidirectional (bool u)
246  {
247  m_blackListState = u;
248  }
253  bool IsUnidirectional () const
254  {
255  return m_blackListState;
256  }
262  {
263  m_blackListTimeout = t;
264  }
270  {
271  return m_blackListTimeout;
272  }
278  {
279  return m_dst;
280  }
286  {
287  m_dst = d;
288  }
294  {
295  return m_path;
296  }
302  {
303  m_path = v;
304  }
309  void SetExpireTime (Time exp)
310  {
311  m_expire = exp + Simulator::Now ();
312  }
318  {
319  return m_expire - Simulator::Now ();
320  }
321 
326  void Print (std::ostream & os) const;
332  bool operator== (DsrRouteCacheEntry const & o) const
333  {
334  if (m_path.size () != o.m_path.size ())
335  {
336  NS_ASSERT (false);
337  return false;
338  }
339  IP_VECTOR::const_iterator j = o.m_path.begin ();
340  for (IP_VECTOR::const_iterator i = m_path.begin (); i
341  != m_path.end (); i++, j++)
342  {
343  /*
344  * Verify if neither the entry are not 0 and they equal to each other
345  */
346  if (((*i) == 0) || ((*j) == 0))
347  {
348  return false;
349  }
350  else if (!((*i) == (*j)) )
351  {
352  return false;
353  }
354  else
355  {
356  return true;
357  }
358  }
359  return false;
360  }
361  // \}
362 
363 private:
369  uint8_t m_reqCount;
374 };
380 class DsrRouteCache : public Object
381 {
382 public:
387  static TypeId GetTypeId ();
388 
389  DsrRouteCache ();
390  virtual ~DsrRouteCache ();
391 
396  void RemoveLastEntry (std::list<DsrRouteCacheEntry> & rtVector);
400  typedef std::list<DsrRouteCacheEntry::IP_VECTOR> routeVector;
401 
402  // Fields
407  bool GetSubRoute () const
408  {
409  return m_subRoute;
410  }
415  void SetSubRoute (bool subRoute)
416  {
417  m_subRoute = subRoute;
418  }
423  uint32_t GetMaxCacheLen () const
424  {
425  return m_maxCacheLen;
426  }
431  void SetMaxCacheLen (uint32_t len)
432  {
433  m_maxCacheLen = len;
434  }
440  {
441  return RouteCacheTimeout;
442  }
448  {
449  RouteCacheTimeout = t;
450  }
455  uint32_t GetMaxEntriesEachDst () const
456  {
457  return m_maxEntriesEachDst;
458  }
463  void SetMaxEntriesEachDst (uint32_t entries)
464  {
465  m_maxEntriesEachDst = entries;
466  }
472  {
473  return m_badLinkLifetime;
474  }
480  {
481  m_badLinkLifetime = t;
482  }
487  uint64_t GetStabilityDecrFactor () const
488  {
489  return m_stabilityDecrFactor;
490  }
495  void SetStabilityDecrFactor (uint64_t decrFactor)
496  {
497  m_stabilityDecrFactor = decrFactor;
498  }
503  uint64_t GetStabilityIncrFactor () const
504  {
505  return m_stabilityIncrFactor;
506  }
511  void SetStabilityIncrFactor (uint64_t incrFactor)
512  {
513  m_stabilityIncrFactor = incrFactor;
514  }
520  {
521  return m_initStability;
522  }
527  void SetInitStability (Time initStability)
528  {
529  m_initStability = initStability;
530  }
536  {
537  return m_minLifeTime;
538  }
543  void SetMinLifeTime (Time minLifeTime)
544  {
545  m_minLifeTime = minLifeTime;
546  }
552  {
553  return m_useExtends;
554  }
559  void SetUseExtends (Time useExtends)
560  {
561  m_useExtends = useExtends;
562  }
563 
569  bool UpdateRouteEntry (Ipv4Address dst);
575  bool AddRoute (DsrRouteCacheEntry & rt);
587  void PrintVector (std::vector<Ipv4Address>& vec);
592  void PrintRouteVector (std::list<DsrRouteCacheEntry> route);
599  bool FindSameRoute (DsrRouteCacheEntry & rt, std::list<DsrRouteCacheEntry> & rtVector);
605  bool DeleteRoute (Ipv4Address dst);
614  void DeleteAllRoutesIncludeLink (Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node);
616  void Clear ()
617  {
619  }
621  void Purge ();
624  void Print (std::ostream &os);
625 
626  //------------------------------------------------------------------------------------------
632  uint16_t CheckUniqueAckId (Ipv4Address nextHop);
637  uint16_t GetAckSize ();
638 
639  // --------------------------------------------------------------------------------------------
641  struct Neighbor
642  {
646  bool close;
647 
656  : m_neighborAddress (ip),
658  m_expireTime (t),
659  close (false)
660  {
661  }
662 
664  {
665  } // For Python bindings
666  };
678  bool IsNeighbor (Ipv4Address addr);
684  void UpdateNeighbor (std::vector<Ipv4Address> nodeList, Time expire);
691  void AddNeighbor (std::vector<Ipv4Address> nodeList, Ipv4Address ownAddress, Time expire);
695  void PurgeMac ();
699  void ScheduleTimer ();
703  void ClearMac ()
704  {
705  m_nb.clear ();
706  }
710  void AddArpCache (Ptr<ArpCache>);
714  void DelArpCache (Ptr<ArpCache>);
720  {
721  return m_txErrorCallback;
722  }
723 
727  {
728  m_handleLinkFailure = cb;
729  }
732  {
733  return m_handleLinkFailure;
734  }
735 
736 private:
743  uint32_t m_maxCacheLen;
746  /*
747  * Define the parameters for link cache type
748  */
754 
757  typedef std::list<DsrRouteCacheEntry> routeEntryVector;
758 
759  std::map<Ipv4Address, routeEntryVector> m_sortedRoutes;
760 
762 
764 
765  std::map<Ipv4Address, uint16_t> m_ackIdCache;
766 
768 
769  bool m_subRoute;
770 
774  #define MAXWEIGHT 0xFFFF;
775 
780  std::map<Ipv4Address, std::map<Ipv4Address, uint32_t> > m_netGraph;
781 
782  std::map<Ipv4Address, DsrRouteCacheEntry::IP_VECTOR> m_bestRoutesTable_link;
783  std::map<Link, DsrLinkStab> m_linkCache;
784  std::map<Ipv4Address, DsrNodeStab> m_nodeCache;
785 
797  bool IncStability (Ipv4Address node);
803  bool DecStability (Ipv4Address node);
804 
805 public:
811  void SetCacheType (std::string type);
816  bool IsLinkCache ();
830  void RebuildBestRouteTable (Ipv4Address source);
834  void PurgeLinkNode ();
846  void UpdateNetGraph ();
847  //---------------------------------------------------------------------------------------
852 
854 
856 
857  std::vector<Neighbor> m_nb;
858 
859  std::vector<Ptr<ArpCache> > m_arp;
860 
862 
867 
870  void ProcessTxError (WifiMacHeader const &hdr);
871 };
872 } // namespace dsr
873 } // namespace ns3
874 #endif /* DSR_RCACHE_H */
Time m_minLifeTime
minimum lifetime
Definition: dsr-rcache.h:752
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:643
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
DsrRouteCacheEntry class for entries in the route cache.
Definition: dsr-rcache.h:220
Time m_nodeStability
the node stability
Definition: dsr-rcache.h:213
DSR route request queue Since DSR is an on demand routing we queue requests while looking for route...
Definition: dsr-rcache.h:380
Time GetNodeStability() const
Get node stability.
Definition: dsr-rcache.h:208
void SetDestination(Ipv4Address d)
Set destination address.
Definition: dsr-rcache.h:285
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
uint32_t GetMaxCacheLen() const
Get the max queue length.
Definition: dsr-rcache.h:423
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:261
Time m_expireTime
route expire time
Definition: dsr-rcache.h:645
Time m_badLinkLifetime
The time for which the neighboring node is put into the blacklist.
Definition: dsr-rcache.h:745
Mac48Address m_hardwareAddress
neighbor MAC address
Definition: dsr-rcache.h:644
A simple Timer class.
Definition: timer.h:73
void SetNodeStability(Time nodeStab)
Set node stability.
Definition: dsr-rcache.h:200
std::vector< Ptr< ArpCache > > m_arp
list of ARP cached to be used for layer 2 notifications processing
Definition: dsr-rcache.h:859
void SetMinLifeTime(Time minLifeTime)
Set minimum lifetime.
Definition: dsr-rcache.h:543
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:757
uint32_t m_maxEntriesEachDst
number of entries for each destination
Definition: dsr-rcache.h:763
bool m_blackListState
Indicate if this entry is in "blacklist".
Definition: dsr-rcache.h:370
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
Timer m_ackTimer
RREP_ACK timer.
Definition: dsr-rcache.h:364
#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 m_path
brief The IP address constructed route
Definition: dsr-rcache.h:366
void SetCallback(Callback< void, Ipv4Address, uint8_t > cb)
Handle link failure callback.
Definition: dsr-rcache.h:726
std::vector< Neighbor > m_nb
vector of entries
Definition: dsr-rcache.h:857
void PrintRouteVector(std::list< DsrRouteCacheEntry > route)
Print all the route vector elements from the route list.
Definition: dsr-rcache.cc:953
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:740
Timer m_ntimer
Timer for neighbor&#39;s list. Schedule Purge().
Definition: dsr-rcache.h:855
Ptr< Ipv4 > m_ipv4
The Ipv4 layer 3.
Definition: dsr-rcache.h:373
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:761
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
uint32_t GetMaxEntriesEachDst() const
Get max entries for each destination.
Definition: dsr-rcache.h:455
Time RouteCacheTimeout
The maximum period of time that dsr is allowed to for an unused route.
Definition: dsr-rcache.h:744
Time GetUseExtends() const
Get use extends.
Definition: dsr-rcache.h:551
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:719
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:367
Time m_delay
This timeout deals with the passive ack.
Definition: dsr-rcache.h:861
bool m_isLinkCache
Check if the route is using path cache or link cache.
Definition: dsr-rcache.h:767
Time m_initStability
initial stability
Definition: dsr-rcache.h:751
std::map< Ipv4Address, DsrNodeStab > m_nodeCache
The data structure to store node info.
Definition: dsr-rcache.h:784
IP_VECTOR GetVector() const
Get the IP vector.
Definition: dsr-rcache.h:293
std::list< DsrRouteCacheEntry::IP_VECTOR > routeVector
Define the vector of route entries.
Definition: dsr-rcache.h:400
void Clear()
Delete all entries from routing table.
Definition: dsr-rcache.h:616
static TypeId GetTypeId()
Get the type ID.
Definition: dsr-rcache.cc:137
Ipv4Address GetDestination() const
Get destination address.
Definition: dsr-rcache.h:277
void ClearMac()
Remove all entries.
Definition: dsr-rcache.h:703
std::map< Link, DsrLinkStab > m_linkCache
The data structure to store link info.
Definition: dsr-rcache.h:783
bool IncStability(Ipv4Address node)
increase the stability of the node
Definition: dsr-rcache.cc:515
bool GetSubRoute() const
Get subroute indicator.
Definition: dsr-rcache.h:407
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
mac
Definition: third.py:92
void SetStabilityIncrFactor(uint64_t incrFactor)
Set stability increase factor.
Definition: dsr-rcache.h:511
uint32_t m_stabilityDecrFactor
stability decrease factor
Definition: dsr-rcache.h:749
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
std::vector< Ipv4Address > IP_VECTOR
Define the vector to hold Ip address.
Definition: dsr-rcache.h:223
uint32_t m_maxCacheLen
The maximum number of packets that we allow a routing protocol to buffer.
Definition: dsr-rcache.h:743
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:780
Time m_useExtends
use extend
Definition: dsr-rcache.h:753
void SetBadLinkLifetime(Time t)
Set bad link lifetime function.
Definition: dsr-rcache.h:479
bool LookupRoute(Ipv4Address id, DsrRouteCacheEntry &rt)
Lookup route cache entry with destination address dst.
Definition: dsr-rcache.cc:208
Time GetExpireTime() const
Get expire time.
Definition: dsr-rcache.h:317
std::map< Ipv4Address, uint16_t > m_ackIdCache
The id cache to ensure all the ids are unique.
Definition: dsr-rcache.h:765
void SetUnidirectional(bool u)
Set unidirectional flag.
Definition: dsr-rcache.h:245
uint64_t GetStabilityIncrFactor() const
Get stability increase factor.
Definition: dsr-rcache.h:503
DsrRouteCacheEntry::IP_VECTOR m_vector
The route vector to save the ip addresses for intermediate nodes.
Definition: dsr-rcache.h:742
bool AddRoute_Link(DsrRouteCacheEntry::IP_VECTOR nodelist, Ipv4Address node)
dd route link to cache
Definition: dsr-rcache.cc:562
Time GetInitStability() const
Get initial stability.
Definition: dsr-rcache.h:519
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ipv4InterfaceAddress m_iface
Output interface address.
Definition: dsr-rcache.h:368
Neighbor(Ipv4Address ip, Mac48Address mac, Time t)
Constructor.
Definition: dsr-rcache.h:655
uint64_t GetStabilityDecrFactor() const
Get stability decrease factor.
Definition: dsr-rcache.h:487
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:415
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:365
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:224
Time m_blackListTimeout
Time for which the node is put into the blacklist.
Definition: dsr-rcache.h:371
Time GetMinLifeTime() const
Get minimum lifetime.
Definition: dsr-rcache.h:535
void Print(std::ostream &os) const
Print necessary fields.
Definition: dsr-rcache.cc:129
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:527
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:372
Callback< void, Ipv4Address, uint8_t > GetCallback() const
Handle link failure callback.
Definition: dsr-rcache.h:731
Time GetBadLinkLifetime() const
Get bad link lifetime function.
Definition: dsr-rcache.h:471
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:641
std::map< Ipv4Address, DsrRouteCacheEntry::IP_VECTOR > m_bestRoutesTable_link
for link route cache
Definition: dsr-rcache.h:782
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:759
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:853
void DelArpCache(Ptr< ArpCache >)
Don&#39;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
Time GetBlacklistTimeout() const
Get blacklist timeout.
Definition: dsr-rcache.h:269
void SetVector(IP_VECTOR v)
Sets the IP vector.
Definition: dsr-rcache.h:301
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:309
uint32_t m_stabilityIncrFactor
stability increase factor
Definition: dsr-rcache.h:750
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&#39;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
bool IsUnidirectional() const
Get unidirectional flag.
Definition: dsr-rcache.h:253
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:559
Callback< void, Ipv4Address, uint8_t > m_handleLinkFailure
The following code handles link-layer acks.
Definition: dsr-rcache.h:851
Time GetCacheTimeout() const
Get cache timeout value.
Definition: dsr-rcache.h:439
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:431
bool operator==(DsrRouteCacheEntry const &o) const
Compare the route cache entry.
Definition: dsr-rcache.h:332
bool close
is route active
Definition: dsr-rcache.h:646
DsrNodeStab class (DSR node stability)
Definition: dsr-rcache.h:185
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:463
void SetStabilityDecrFactor(uint64_t decrFactor)
Set stability decrease factor.
Definition: dsr-rcache.h:495
uint8_t m_reqCount
Number of route requests.
Definition: dsr-rcache.h:369
Implements the IEEE 802.11 MAC header.
void SetCacheTimeout(Time t)
Set cache timeout value.
Definition: dsr-rcache.h:447
bool m_subRoute
Check if save the sub route entries or not.
Definition: dsr-rcache.h:769