NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
asf-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_ASF_STRATEGY_HPP
27 #define NFD_DAEMON_FW_ASF_STRATEGY_HPP
28 
29 #include "asf-measurements.hpp"
30 #include "asf-probing-module.hpp"
32 #include "fw/strategy.hpp"
33 
34 namespace nfd {
35 namespace fw {
36 namespace asf {
37 
44 class AsfStrategy : public Strategy
45 {
46 public:
47  explicit
48  AsfStrategy(Forwarder& forwarder, const Name& name = getStrategyName());
49 
50  static const Name&
52 
53 public: // triggers
54  virtual void
55  afterReceiveInterest(const Face& inFace, const Interest& interest,
56  const shared_ptr<pit::Entry>& pitEntry) override;
57 
58  virtual void
59  beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
60  const Face& inFace, const Data& data) override;
61 
62  virtual void
63  afterReceiveNack(const Face& inFace, const lp::Nack& nack,
64  const shared_ptr<pit::Entry>& pitEntry) override;
65 
66 private:
67  void
68  forwardInterest(const Interest& interest,
69  const fib::Entry& fibEntry,
70  const shared_ptr<pit::Entry>& pitEntry,
71  Face& outFace,
72  bool wantNewNonce = false);
73 
74  Face*
75  getBestFaceForForwarding(const fib::Entry& fibEntry, const Interest& interest, const Face& inFace);
76 
77  void
78  onTimeout(const Name& interestName, face::FaceId faceId);
79 
80  void
81  sendNoRouteNack(const Face& inFace, const Interest& interest, const shared_ptr<pit::Entry>& pitEntry);
82 
83 private:
84  AsfMeasurements m_measurements;
85  ProbingModule m_probing;
86 
87 private:
88  RetxSuppressionExponential m_retxSuppression;
89 
90  static const time::milliseconds RETX_SUPPRESSION_INITIAL;
91  static const time::milliseconds RETX_SUPPRESSION_MAX;
92 };
93 
94 } // namespace asf
95 
96 using asf::AsfStrategy;
97 
98 } // namespace fw
99 } // namespace nfd
100 
101 #endif // NFD_DAEMON_FW_ASF_STRATEGY_HPP
virtual void beforeSatisfyInterest(const shared_ptr< pit::Entry > &pitEntry, const Face &inFace, const Data &data) override
trigger before PIT entry is satisfied
Helper class to retrieve and create strategy measurements.
represents a FIB entry
Definition: fib-entry.hpp:51
boost::posix_time::time_duration milliseconds(long duration)
Definition: asio.hpp:117
static const Name & getStrategyName()
main class of NFD
Definition: forwarder.hpp:54
represents an Interest packet
Definition: interest.hpp:42
represents a Network Nack
Definition: nack.hpp:40
ndn Face
Definition: face-impl.hpp:41
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
Represents an absolute name.
Definition: name.hpp:42
represents a forwarding strategy
Definition: strategy.hpp:37
virtual void afterReceiveNack(const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Nack is received
virtual void afterReceiveInterest(const Face &inFace, const Interest &interest, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Interest is received
uint64_t FaceId
identifies a face
Definition: face.hpp:39
Represents a Data packet.
Definition: data.hpp:35
a retransmission suppression decision algorithm that suppresses retransmissions using exponential bac...
AsfStrategy(Forwarder &forwarder, const Name &name=getStrategyName())
Adaptive SRTT-based Forwarding Strategy.