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 {
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 
392  // Delete assignment operator to avoid misuse
394 
399  void RemoveLastEntry (std::list<DsrRouteCacheEntry> & rtVector);
403  typedef std::list<DsrRouteCacheEntry::IP_VECTOR> routeVector;
404 
405  // Fields
410  bool GetSubRoute () const
411  {
412  return m_subRoute;
413  }
418  void SetSubRoute (bool subRoute)
419  {
420  m_subRoute = subRoute;
421  }
426  uint32_t GetMaxCacheLen () const
427  {
428  return m_maxCacheLen;
429  }
434  void SetMaxCacheLen (uint32_t len)
435  {
436  m_maxCacheLen = len;
437  }
443  {
444  return RouteCacheTimeout;
445  }
451  {
452  RouteCacheTimeout = t;
453  }
458  uint32_t GetMaxEntriesEachDst () const
459  {
460  return m_maxEntriesEachDst;
461  }
466  void SetMaxEntriesEachDst (uint32_t entries)
467  {
468  m_maxEntriesEachDst = entries;
469  }
475  {
476  return m_badLinkLifetime;
477  }
483  {
484  m_badLinkLifetime = t;
485  }
490  uint64_t GetStabilityDecrFactor () const
491  {
492  return m_stabilityDecrFactor;
493  }
498  void SetStabilityDecrFactor (uint64_t decrFactor)
499  {
500  m_stabilityDecrFactor = decrFactor;
501  }
506  uint64_t GetStabilityIncrFactor () const
507  {
508  return m_stabilityIncrFactor;
509  }
514  void SetStabilityIncrFactor (uint64_t incrFactor)
515  {
516  m_stabilityIncrFactor = incrFactor;
517  }
523  {
524  return m_initStability;
525  }
530  void SetInitStability (Time initStability)
531  {
532  m_initStability = initStability;
533  }
539  {
540  return m_minLifeTime;
541  }
546  void SetMinLifeTime (Time minLifeTime)
547  {
548  m_minLifeTime = minLifeTime;
549  }
555  {
556  return m_useExtends;
557  }
562  void SetUseExtends (Time useExtends)
563  {
564  m_useExtends = useExtends;
565  }
566 
572  bool UpdateRouteEntry (Ipv4Address dst);
578  bool AddRoute (DsrRouteCacheEntry & rt);
590  void PrintVector (std::vector<Ipv4Address>& vec);
595  void PrintRouteVector (std::list<DsrRouteCacheEntry> route);
602  bool FindSameRoute (DsrRouteCacheEntry & rt, std::list<DsrRouteCacheEntry> & rtVector);
608  bool DeleteRoute (Ipv4Address dst);
617  void DeleteAllRoutesIncludeLink (Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node);
619  void Clear ()
620  {
622  }
624  void Purge ();
627  void Print (std::ostream &os);
628 
629  //------------------------------------------------------------------------------------------
635  uint16_t CheckUniqueAckId (Ipv4Address nextHop);
640  uint16_t GetAckSize ();
641 
642  // --------------------------------------------------------------------------------------------
644  struct Neighbor
645  {
649  bool close;
650 
659  : m_neighborAddress (ip),
661  m_expireTime (t),
662  close (false)
663  {
664  }
665 
667  {
668  } // For Python bindings
669  };
681  bool IsNeighbor (Ipv4Address addr);
687  void UpdateNeighbor (std::vector<Ipv4Address> nodeList, Time expire);
694  void AddNeighbor (std::vector<Ipv4Address> nodeList, Ipv4Address ownAddress, Time expire);
698  void PurgeMac ();
702  void ScheduleTimer ();
706  void ClearMac ()
707  {
708  m_nb.clear ();
709  }
714  void AddArpCache (Ptr<ArpCache> a);
719  void DelArpCache (Ptr<ArpCache>);
726  {
727  return m_txErrorCallback;
728  }
729 
735  {
736  m_handleLinkFailure = cb;
737  }
743  {
744  return m_handleLinkFailure;
745  }
746 
747 private:
749  uint32_t m_maxCacheLen;
752  /*
753  * Define the parameters for link cache type
754  */
763  typedef std::list<DsrRouteCacheEntry> routeEntryVector;
764 
765  std::map<Ipv4Address, routeEntryVector> m_sortedRoutes;
766 
768 
770 
771  std::map<Ipv4Address, uint16_t> m_ackIdCache;
772 
774 
775  bool m_subRoute;
780  #define MAXWEIGHT 0xFFFF;
786  std::map<Ipv4Address, std::map<Ipv4Address, uint32_t> > m_netGraph;
787 
788  std::map<Ipv4Address, DsrRouteCacheEntry::IP_VECTOR> m_bestRoutesTable_link;
789  std::map<Link, DsrLinkStab> m_linkCache;
790  std::map<Ipv4Address, DsrNodeStab> m_nodeCache;
803  bool IncStability (Ipv4Address node);
809  bool DecStability (Ipv4Address node);
810 
811 public:
817  void SetCacheType (std::string type);
822  bool IsLinkCache ();
836  void RebuildBestRouteTable (Ipv4Address source);
840  void PurgeLinkNode ();
852  void UpdateNetGraph ();
853  //---------------------------------------------------------------------------------------
858 
860 
862 
863  std::vector<Neighbor> m_nb;
864 
865  std::vector<Ptr<ArpCache> > m_arp;
866 
868 
873 
876  void ProcessTxError (WifiMacHeader const &hdr);
877 };
878 } // namespace dsr
879 } // namespace ns3
880 #endif /* DSR_RCACHE_H */
Callback template class.
Definition: callback.h:1279
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
a class to store IPv4 address information on an interface
an EUI-48 address
Definition: mac48-address.h:44
A base class which provides memory management and object aggregation.
Definition: object.h:88
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
A simple virtual Timer class.
Definition: timer.h:74
a unique identifier for an interface.
Definition: type-id.h:59
Implements the IEEE 802.11 MAC header.
DsrNodeStab class (DSR node stability)
Definition: dsr-rcache.h:186
Time GetNodeStability() const
Get node stability.
Definition: dsr-rcache.h:208
Time m_nodeStability
the node stability
Definition: dsr-rcache.h:213
void SetNodeStability(Time nodeStab)
Set node stability.
Definition: dsr-rcache.h:200
virtual ~DsrNodeStab()
Definition: dsr-rcache.cc:86
DsrNodeStab(Time nodeStab=Simulator::Now())
Constructor.
Definition: dsr-rcache.cc:81
DsrRouteCacheEntry class for entries in the route cache.
Definition: dsr-rcache.h:221
IP_VECTOR GetVector() const
Get the IP vector.
Definition: dsr-rcache.h:293
void SetDestination(Ipv4Address d)
Set destination address.
Definition: dsr-rcache.h:285
bool operator==(DsrRouteCacheEntry const &o) const
Compare the route cache entry.
Definition: dsr-rcache.h:332
Time m_expire
Expire time for queue entry.
Definition: dsr-rcache.h:367
DsrRouteCacheEntry(IP_VECTOR const &ip=IP_VECTOR(), Ipv4Address dst=Ipv4Address(), Time exp=Simulator::Now())
Constructor.
Definition: dsr-rcache.cc:106
IP_VECTOR m_path
brief The IP address constructed route
Definition: dsr-rcache.h:366
Ipv4Address m_dst
The destination Ip address.
Definition: dsr-rcache.h:365
Ptr< Ipv4Route > m_ipv4Route
The Ipv4 route.
Definition: dsr-rcache.h:372
Time GetBlacklistTimeout() const
Get blacklist timeout.
Definition: dsr-rcache.h:269
std::vector< Ipv4Address >::iterator Iterator
Define the iterator.
Definition: dsr-rcache.h:224
uint8_t m_reqCount
Number of route requests.
Definition: dsr-rcache.h:369
Timer m_ackTimer
RREP_ACK timer.
Definition: dsr-rcache.h:364
Ptr< Ipv4 > m_ipv4
The Ipv4 layer 3.
Definition: dsr-rcache.h:373
Ipv4Address GetDestination() const
Get destination address.
Definition: dsr-rcache.h:277
void SetBlacklistTimeout(Time t)
Set blacklist timeout.
Definition: dsr-rcache.h:261
Ipv4InterfaceAddress m_iface
Output interface address.
Definition: dsr-rcache.h:368
virtual ~DsrRouteCacheEntry()
Definition: dsr-rcache.cc:117
Time m_blackListTimeout
Time for which the node is put into the blacklist.
Definition: dsr-rcache.h:371
bool IsUnidirectional() const
Get unidirectional flag.
Definition: dsr-rcache.h:253
void Invalidate(Time badLinkLifetime)
Mark entry as "down" (i.e.
Definition: dsr-rcache.cc:122
void Print(std::ostream &os) const
Print necessary fields.
Definition: dsr-rcache.cc:129
void SetUnidirectional(bool u)
Set unidirectional flag.
Definition: dsr-rcache.h:245
std::vector< Ipv4Address > IP_VECTOR
Define the vector to hold Ip address.
Definition: dsr-rcache.h:223
bool m_blackListState
Indicate if this entry is in "blacklist".
Definition: dsr-rcache.h:370
Time GetExpireTime() const
Get expire time.
Definition: dsr-rcache.h:317
void SetExpireTime(Time exp)
Set expire time.
Definition: dsr-rcache.h:309
void SetVector(IP_VECTOR v)
Sets the IP vector.
Definition: dsr-rcache.h:301
DSR route request queue Since DSR is an on demand routing we queue requests while looking for route.
Definition: dsr-rcache.h:381
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:786
uint32_t m_stabilityDecrFactor
stability decrease factor
Definition: dsr-rcache.h:755
void ProcessTxError(WifiMacHeader const &hdr)
Process layer 2 TX error notification.
Definition: dsr-rcache.cc:1242
std::list< DsrRouteCacheEntry::IP_VECTOR > routeVector
Define the vector of route entries.
Definition: dsr-rcache.h:403
static TypeId GetTypeId()
Get the type ID.
Definition: dsr-rcache.cc:137
void SetBadLinkLifetime(Time t)
Set bad link lifetime function.
Definition: dsr-rcache.h:482
void PurgeLinkNode()
Purge from the cache if the stability time expired.
Definition: dsr-rcache.cc:465
std::map< Link, DsrLinkStab > m_linkCache
The data structure to store link info.
Definition: dsr-rcache.h:789
void ScheduleTimer()
Schedule m_ntimer.
Definition: dsr-rcache.cc:1206
void SetInitStability(Time initStability)
Set initial stability.
Definition: dsr-rcache.h:530
void RebuildBestRouteTable(Ipv4Address source)
Rebuild the best route table.
Definition: dsr-rcache.cc:317
Callback< void, Ipv4Address, uint8_t > GetCallback() const
Handle link failure callback.
Definition: dsr-rcache.h:742
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
std::list< DsrRouteCacheEntry > routeEntryVector
Define the route cache data structure.
Definition: dsr-rcache.h:763
void SetStabilityDecrFactor(uint64_t decrFactor)
Set stability decrease factor.
Definition: dsr-rcache.h:498
uint64_t GetStabilityDecrFactor() const
Get stability decrease factor.
Definition: dsr-rcache.h:490
routeEntryVector m_routeEntryVector
Define the route vector.
Definition: dsr-rcache.h:767
void AddArpCache(Ptr< ArpCache > a)
Add ARP cache to be used to allow layer 2 notifications processing.
Definition: dsr-rcache.cc:1213
std::map< Ipv4Address, DsrNodeStab > m_nodeCache
The data structure to store node info.
Definition: dsr-rcache.h:790
void Purge()
Delete all outdated entries and invalidate valid entry if Lifetime is expired.
Definition: dsr-rcache.cc:965
Time m_initStability
initial stability
Definition: dsr-rcache.h:757
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
bool IsLinkCache()
is link cached
Definition: dsr-rcache.cc:310
Time GetBadLinkLifetime() const
Get bad link lifetime function.
Definition: dsr-rcache.h:474
DsrRouteCache & operator=(DsrRouteCache const &)=delete
void SetMinLifeTime(Time minLifeTime)
Set minimum lifetime.
Definition: dsr-rcache.h:546
uint32_t GetMaxEntriesEachDst() const
Get max entries for each destination.
Definition: dsr-rcache.h:458
uint32_t m_stabilityIncrFactor
stability increase factor
Definition: dsr-rcache.h:756
Time GetInitStability() const
Get initial stability.
Definition: dsr-rcache.h:522
Time GetCacheTimeout() const
Get cache timeout value.
Definition: dsr-rcache.h:442
uint64_t GetStabilityIncrFactor() const
Get stability increase factor.
Definition: dsr-rcache.h:506
void SetMaxCacheLen(uint32_t len)
Set the max queue length.
Definition: dsr-rcache.h:434
bool LookupRoute(Ipv4Address id, DsrRouteCacheEntry &rt)
Lookup route cache entry with destination address dst.
Definition: dsr-rcache.cc:208
bool GetSubRoute() const
Get subroute indicator.
Definition: dsr-rcache.h:410
uint16_t GetAckSize()
Get the ack table size.
Definition: dsr-rcache.cc:1073
std::map< Ipv4Address, uint16_t > m_ackIdCache
The id cache to ensure all the ids are unique.
Definition: dsr-rcache.h:771
Time RouteCacheTimeout
The maximum period of time that dsr is allowed to for an unused route.
Definition: dsr-rcache.h:750
void SetMaxEntriesEachDst(uint32_t entries)
Set max entries for each destination.
Definition: dsr-rcache.h:466
bool AddRoute_Link(DsrRouteCacheEntry::IP_VECTOR nodelist, Ipv4Address node)
dd route link to cache
Definition: dsr-rcache.cc:562
Callback< void, WifiMacHeader const & > m_txErrorCallback
TX error callback.
Definition: dsr-rcache.h:859
Time m_badLinkLifetime
The time for which the neighboring node is put into the blacklist.
Definition: dsr-rcache.h:751
uint32_t m_maxCacheLen
The maximum number of packets that we allow a routing protocol to buffer.
Definition: dsr-rcache.h:749
std::vector< Ptr< ArpCache > > m_arp
list of ARP cached to be used for layer 2 notifications processing
Definition: dsr-rcache.h:865
Mac48Address LookupMacAddress(Ipv4Address addr)
Find MAC address by IP using list of ARP caches.
Definition: dsr-rcache.cc:1225
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 PurgeMac()
Remove all expired mac entries.
Definition: dsr-rcache.cc:1180
bool FindSameRoute(DsrRouteCacheEntry &rt, std::list< DsrRouteCacheEntry > &rtVector)
Find the same route in the route cache.
Definition: dsr-rcache.cc:727
void Clear()
Delete all entries from routing table.
Definition: dsr-rcache.h:619
std::map< Ipv4Address, routeEntryVector > m_sortedRoutes
Map the ipv4Address to route entry vector.
Definition: dsr-rcache.h:765
Time GetMinLifeTime() const
Get minimum lifetime.
Definition: dsr-rcache.h:538
DsrRouteCacheEntry::IP_VECTOR m_vector
The route vector to save the ip addresses for intermediate nodes.
Definition: dsr-rcache.h:748
void ClearMac()
Remove all entries.
Definition: dsr-rcache.h:706
void SetUseExtends(Time useExtends)
Set use extends.
Definition: dsr-rcache.h:562
Time GetUseExtends() const
Get use extends.
Definition: dsr-rcache.h:554
void PrintVector(std::vector< Ipv4Address > &vec)
Print the route vector elements.
Definition: dsr-rcache.cc:932
bool m_isLinkCache
Check if the route is using path cache or link cache.
Definition: dsr-rcache.h:773
Time m_delay
This timeout deals with the passive ack.
Definition: dsr-rcache.h:867
bool DeleteRoute(Ipv4Address dst)
Delete the route with certain destination address.
Definition: dsr-rcache.cc:760
bool IncStability(Ipv4Address node)
increase the stability of the node
Definition: dsr-rcache.cc:515
void PrintRouteVector(std::list< DsrRouteCacheEntry > route)
Print all the route vector elements from the route list.
Definition: dsr-rcache.cc:953
uint32_t m_maxEntriesEachDst
number of entries for each destination
Definition: dsr-rcache.h:769
Time GetExpireTime(Ipv4Address addr)
Return expire time for neighbor node with address addr, if exists, else return 0.
Definition: dsr-rcache.cc:1099
Time m_useExtends
use extend
Definition: dsr-rcache.h:759
std::vector< Neighbor > m_nb
vector of entries
Definition: dsr-rcache.h:863
uint32_t GetMaxCacheLen() const
Get the max queue length.
Definition: dsr-rcache.h:426
Time m_minLifeTime
minimum lifetime
Definition: dsr-rcache.h:758
void DelArpCache(Ptr< ArpCache >)
Don't use the provided ARP cache any more (interface is down)
Definition: dsr-rcache.cc:1219
void SetSubRoute(bool subRoute)
Set subroute indicator.
Definition: dsr-rcache.h:418
void Print(std::ostream &os)
Print route cache.
Definition: dsr-rcache.cc:1032
void SetCacheTimeout(Time t)
Set cache timeout value.
Definition: dsr-rcache.h:450
Callback< void, Ipv4Address, uint8_t > m_handleLinkFailure
The following code handles link-layer acks.
Definition: dsr-rcache.h:857
bool LookupRoute_Link(Ipv4Address id, DsrRouteCacheEntry &rt)
used by LookupRoute when LinkCache
Definition: dsr-rcache.cc:433
void SetStabilityIncrFactor(uint64_t incrFactor)
Set stability increase factor.
Definition: dsr-rcache.h:514
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
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:725
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 RemoveLastEntry(std::list< DsrRouteCacheEntry > &rtVector)
Remove the aged route cache entries when the route cache is full.
Definition: dsr-rcache.cc:170
void SetCallback(Callback< void, Ipv4Address, uint8_t > cb)
Handle link failure callback.
Definition: dsr-rcache.h:734
Timer m_ntimer
Timer for neighbor's list. Schedule Purge().
Definition: dsr-rcache.h:861
bool m_subRoute
Check if save the sub route entries or not.
Definition: dsr-rcache.h:775
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
bool IsNeighbor(Ipv4Address addr)
Check that node with address addr is neighbor.
Definition: dsr-rcache.cc:1083
std::map< Ipv4Address, DsrRouteCacheEntry::IP_VECTOR > m_bestRoutesTable_link
for link route cache
Definition: dsr-rcache.h:788
bool DecStability(Ipv4Address node)
decrease the stability of the node
Definition: dsr-rcache.cc:539
void UpdateNetGraph()
Update the Net Graph for the link and node cache has changed.
Definition: dsr-rcache.cc:500
bool AddRoute(DsrRouteCacheEntry &rt)
Add route cache entry if it doesn't yet exist in route cache.
Definition: dsr-rcache.cc:657
void AddNeighbor(std::vector< Ipv4Address > nodeList, Ipv4Address ownAddress, Time expire)
Add to the neighbor list.
Definition: dsr-rcache.cc:1143
#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
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:793
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mac
Definition: third.py:99
Structure to manage neighbor state.
Definition: dsr-rcache.h:645
Mac48Address m_hardwareAddress
neighbor MAC address
Definition: dsr-rcache.h:647
Neighbor(Ipv4Address ip, Mac48Address mac, Time t)
Constructor.
Definition: dsr-rcache.h:658
Ipv4Address m_neighborAddress
neightbor address
Definition: dsr-rcache.h:646
Time m_expireTime
route expire time
Definition: dsr-rcache.h:648