NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
retx-suppression-fixed.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
retx-suppression-fixed.hpp
"
27
28
namespace
nfd
{
29
namespace
fw {
30
31
const
time::milliseconds
RetxSuppressionFixed::DEFAULT_MIN_RETX_INTERVAL
(100);
32
33
RetxSuppressionFixed::RetxSuppressionFixed
(
const
time::milliseconds& minRetxInterval)
34
: m_minRetxInterval(minRetxInterval)
35
{
36
BOOST_ASSERT(minRetxInterval > time::milliseconds::zero());
37
}
38
39
RetxSuppression::Result
40
RetxSuppressionFixed::decide
(
const
Face& inFace,
const
Interest
& interest,
41
pit::Entry
& pitEntry)
const
42
{
43
bool
isNewPitEntry = !pitEntry.
hasUnexpiredOutRecords
();
44
if
(isNewPitEntry) {
45
return
NEW
;
46
}
47
48
time::steady_clock::TimePoint
lastOutgoing = this->
getLastOutgoing
(pitEntry);
49
time::steady_clock::TimePoint
now =
time::steady_clock::now
();
50
time::steady_clock::Duration
sinceLastOutgoing = now - lastOutgoing;
51
bool
shouldSuppress = sinceLastOutgoing < m_minRetxInterval;
52
return
shouldSuppress ?
SUPPRESS
:
FORWARD
;
53
}
54
55
}
// namespace fw
56
}
// namespace nfd
ndn::time::steady_clock::TimePoint
time_point TimePoint
Definition:
time.hpp:108
nfd::fw::RetxSuppressionFixed::DEFAULT_MIN_RETX_INTERVAL
static const time::milliseconds DEFAULT_MIN_RETX_INTERVAL
Definition:
retx-suppression-fixed.hpp:51
nfd::fw::RetxSuppressionFixed::decide
virtual Result decide(const Face &inFace, const Interest &interest, pit::Entry &pitEntry) const 1
determines whether Interest is a retransmission, and if so, whether it shall be forwarded or suppress...
Definition:
retx-suppression-fixed.cpp:40
ndn::time::steady_clock::now
static time_point now() noexcept
Definition:
time.cpp:79
retx-suppression-fixed.hpp
nfd::fw::RetxSuppression::SUPPRESS
Interest is retransmission and should be suppressed.
Definition:
retx-suppression.hpp:50
ndn::Interest
represents an Interest packet
Definition:
interest.hpp:45
nfd::fw::RetxSuppression::NEW
Interest is new (not a retransmission)
Definition:
retx-suppression.hpp:42
nfd::fw::RetxSuppression::getLastOutgoing
time::steady_clock::TimePoint getLastOutgoing(const pit::Entry &pitEntry) const
Definition:
retx-suppression.cpp:32
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::pit::Entry
represents a PIT entry
Definition:
pit-entry.hpp:69
nfd::pit::Entry::hasUnexpiredOutRecords
bool hasUnexpiredOutRecords() const
Definition:
pit-entry.cpp:199
nfd::fw::RetxSuppression::FORWARD
Interest is retransmission and should be forwarded.
Definition:
retx-suppression.hpp:46
ndn::time::steady_clock::Duration
duration Duration
Definition:
time.hpp:109
nfd::fw::RetxSuppressionFixed::RetxSuppressionFixed
RetxSuppressionFixed(const time::milliseconds &minRetxInterval=DEFAULT_MIN_RETX_INTERVAL)
Definition:
retx-suppression-fixed.cpp:33
nfd::fw::RetxSuppression::Result
Result
Definition:
retx-suppression.hpp:39
ndnSIM
NFD
daemon
fw
retx-suppression-fixed.cpp
Generated on Sat Nov 12 2016 16:02:54 for ndnSIM by
1.8.12