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 = STRATEGY_NAME);
49 
50 public: // triggers
51  virtual void
52  afterReceiveInterest(const Face& inFace, const Interest& interest,
53  const shared_ptr<pit::Entry>& pitEntry) override;
54 
55  virtual void
56  beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
57  const Face& inFace, const Data& data) override;
58 
59  virtual void
60  afterReceiveNack(const Face& inFace, const lp::Nack& nack,
61  const shared_ptr<pit::Entry>& pitEntry) override;
62 
63 private:
64  void
65  forwardInterest(const Interest& interest,
66  const fib::Entry& fibEntry,
67  const shared_ptr<pit::Entry>& pitEntry,
68  Face& outFace,
69  bool wantNewNonce = false);
70 
71  Face*
72  getBestFaceForForwarding(const fib::Entry& fibEntry, const Interest& interest, const Face& inFace);
73 
74  void
75  onTimeout(const Name& interestName, face::FaceId faceId);
76 
77  void
78  sendNoRouteNack(const Face& inFace, const Interest& interest, const shared_ptr<pit::Entry>& pitEntry);
79 
80 public:
81  static const Name STRATEGY_NAME;
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.
AsfStrategy(Forwarder &forwarder, const Name &name=STRATEGY_NAME)
generalization of a network interface
Definition: face.hpp:67
represents a FIB entry
Definition: fib-entry.hpp:51
main class of NFD
Definition: forwarder.hpp:54
represents an Interest packet
Definition: interest.hpp:42
represents a Network Nack
Definition: nack.hpp:40
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
static const Name STRATEGY_NAME
Name abstraction to represent an absolute name.
Definition: name.hpp:46
represents a forwarding strategy
Definition: strategy.hpp:38
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:37
a retransmission suppression decision algorithm that suppresses retransmissions using exponential bac...
Adaptive SRTT-based Forwarding Strategy.