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
main class of NFD
Definition: forwarder.hpp:52
static const Name & getStrategyName()
represents a FIB entry
Definition: fib-entry.hpp:51
virtual void beforeSatisfyInterest(const shared_ptr< pit::Entry > &pitEntry, const Face &inFace, const Data &data) override
trigger before PIT entry is satisfied
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
a retransmission suppression decision algorithm that suppresses retransmissions using exponential bac...
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
Adaptive SRTT-based Forwarding Strategy.
AsfStrategy(Forwarder &forwarder, const Name &name=getStrategyName())
Helper class to retrieve and create strategy measurements.