NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
access-strategy.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_FW_ACCESS_STRATEGY_HPP
27 #define NFD_DAEMON_FW_ACCESS_STRATEGY_HPP
28 
29 #include "strategy.hpp"
30 #include "rtt-estimator.hpp"
32 #include <unordered_set>
33 #include <unordered_map>
34 
35 namespace nfd {
36 namespace fw {
37 
49 class AccessStrategy : public Strategy
50 {
51 public:
52  explicit
53  AccessStrategy(Forwarder& forwarder, const Name& name = STRATEGY_NAME);
54 
55 public: // triggers
56  virtual void
57  afterReceiveInterest(const Face& inFace, const Interest& interest,
58  const shared_ptr<pit::Entry>& pitEntry) override;
59 
60  virtual void
61  beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
62  const Face& inFace, const Data& data) override;
63 
64 private: // StrategyInfo
67  class PitInfo : public StrategyInfo
68  {
69  public:
70  static constexpr int
71  getTypeId()
72  {
73  return 1010;
74  }
75 
76  public:
77  scheduler::ScopedEventId rtoTimer;
78  };
79 
82  class MtInfo : public StrategyInfo
83  {
84  public:
85  static constexpr int
86  getTypeId()
87  {
88  return 1011;
89  }
90 
91  MtInfo();
92 
93  public:
94  FaceId lastNexthop;
95  RttEstimator rtt;
96  };
97 
100  std::tuple<Name, MtInfo*>
101  findPrefixMeasurements(const pit::Entry& pitEntry);
102 
106  MtInfo*
107  addPrefixMeasurements(const Data& data);
108 
111  class FaceInfo
112  {
113  public:
114  FaceInfo();
115 
116  public:
117  RttEstimator rtt;
118  };
119 
120  typedef std::unordered_map<FaceId, FaceInfo> FaceInfoTable;
121 
122  void
123  removeFaceInfo(const Face& face);
124 
125 private: // forwarding procedures
126  void
127  afterReceiveNewInterest(const Face& inFace, const Interest& interest,
128  const shared_ptr<pit::Entry>& pitEntry);
129 
130  void
131  afterReceiveRetxInterest(const Face& inFace, const Interest& interest,
132  const shared_ptr<pit::Entry>& pitEntry);
133 
137  bool
138  sendToLastNexthop(const Face& inFace, const Interest& interest,
139  const shared_ptr<pit::Entry>& pitEntry, MtInfo& mi,
140  const fib::Entry& fibEntry);
141 
142  void
143  afterRtoTimeout(weak_ptr<pit::Entry> pitWeak, FaceId inFaceId, FaceId firstOutFaceId);
144 
149  int
150  multicast(const Face& inFace, const Interest& interest,
151  const shared_ptr<pit::Entry>& pitEntry, const fib::Entry& fibEntry,
152  FaceId exceptFace = face::INVALID_FACEID);
153 
154  void
155  updateMeasurements(const Face& inFace, const Data& data,
156  const RttEstimator::Duration& rtt);
157 
158 public:
159  static const Name STRATEGY_NAME;
160 
161 private:
162  FaceInfoTable m_fit;
163  RetxSuppressionFixed m_retxSuppression;
164  signal::ScopedConnection m_removeFaceInfoConn;
165 };
166 
167 } // namespace fw
168 } // namespace nfd
169 
170 #endif // NFD_DAEMON_FW_ACCESS_STRATEGY_HPP
time::microseconds Duration
a retransmission suppression decision algorithm that suppresses retransmissions within a fixed durati...
generalization of a network interface
Definition: face.hpp:67
represents a FIB entry
Definition: fib-entry.hpp:51
AccessStrategy(Forwarder &forwarder, const Name &name=STRATEGY_NAME)
main class of NFD
Definition: forwarder.hpp:54
represents an Interest packet
Definition: interest.hpp:42
static const Name STRATEGY_NAME
virtual void afterReceiveInterest(const Face &inFace, const Interest &interest, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Interest is received
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
an Interest table entry
Definition: pit-entry.hpp:57
disconnects a Connection automatically upon destruction
cancels an event automatically upon destruction
Definition: scheduler.hpp:57
Name abstraction to represent an absolute name.
Definition: name.hpp:46
represents a forwarding strategy
Definition: strategy.hpp:38
virtual void beforeSatisfyInterest(const shared_ptr< pit::Entry > &pitEntry, const Face &inFace, const Data &data) override
trigger before PIT entry is satisfied
implements the Mean-Deviation RTT estimator
Access Router Strategy version 1.
uint64_t FaceId
identifies a face
Definition: face.hpp:39
represents a Data packet
Definition: data.hpp:37
const FaceId INVALID_FACEID
indicates an invalid FaceId
Definition: face.hpp:42
contains arbitrary information forwarding strategy places on table entries