blob: 79181a2c3702e40a2aba5ee424f498dd3a51380d [file] [log] [blame]
Vince Lehman8a4c29e2016-07-11 08:49:35 +00001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Ashlesh Gawande90015992017-07-11 17:25:48 -05002/*
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -04003 * Copyright (c) 2014-2022, Regents of the University of California,
Vince Lehman8a4c29e2016-07-11 08:49:35 +00004 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology,
9 * The University of Memphis.
10 *
11 * This file is part of NFD (Named Data Networking Forwarding Daemon).
12 * See AUTHORS.md for complete list of NFD authors and contributors.
13 *
14 * NFD is free software: you can redistribute it and/or modify it under the terms
15 * of the GNU General Public License as published by the Free Software Foundation,
16 * either version 3 of the License, or (at your option) any later version.
17 *
18 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20 * PURPOSE. See the GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along with
23 * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24 */
25
26#include "asf-strategy.hpp"
Ashlesh Gawande2a73f352016-12-01 15:37:03 +000027#include "algorithm.hpp"
Davide Pesavento2cae8ca2019-04-18 20:48:05 -040028#include "common/global.hpp"
29#include "common/logger.hpp"
Vince Lehman8a4c29e2016-07-11 08:49:35 +000030
31namespace nfd {
32namespace fw {
33namespace asf {
34
Davide Pesaventoa3148082018-04-12 18:21:54 -040035NFD_LOG_INIT(AsfStrategy);
Junxiao Shi037f4ab2016-12-13 04:27:06 +000036NFD_REGISTER_STRATEGY(AsfStrategy);
Vince Lehman8a4c29e2016-07-11 08:49:35 +000037
Vince Lehman8a4c29e2016-07-11 08:49:35 +000038AsfStrategy::AsfStrategy(Forwarder& forwarder, const Name& name)
Junxiao Shi18739c42016-12-22 08:03:00 +000039 : Strategy(forwarder)
Vince Lehman8a4c29e2016-07-11 08:49:35 +000040 , m_measurements(getMeasurements())
41 , m_probing(m_measurements)
Vince Lehman8a4c29e2016-07-11 08:49:35 +000042{
Junxiao Shi18739c42016-12-22 08:03:00 +000043 ParsedInstanceName parsed = parseInstanceName(name);
Junxiao Shi91f6ee02016-12-29 21:44:44 +000044 if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
Davide Pesavento19779d82019-02-14 13:40:04 -050045 NDN_THROW(std::invalid_argument(
Alexander Afanasyev0c63c632017-12-05 11:17:09 -050046 "AsfStrategy does not support version " + to_string(*parsed.version)));
Junxiao Shi91f6ee02016-12-29 21:44:44 +000047 }
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -040048
49 StrategyParameters params = parseParameters(parsed.parameters);
50 m_retxSuppression = RetxSuppressionExponential::construct(params);
51 auto probingInterval = params.getOrDefault<time::milliseconds::rep>("probing-interval",
52 m_probing.getProbingInterval().count());
53 m_probing.setProbingInterval(time::milliseconds(probingInterval));
54 m_nMaxTimeouts = params.getOrDefault<size_t>("max-timeouts", m_nMaxTimeouts);
55
Junxiao Shi18739c42016-12-22 08:03:00 +000056 this->setInstanceName(makeInstanceName(name, getStrategyName()));
Ashlesh Gawande92e4ea52017-07-19 11:38:12 -050057
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -040058 NDN_LOG_DEBUG(*m_retxSuppression);
Davide Pesaventoa6f637a2019-08-28 23:23:20 -040059 NFD_LOG_DEBUG("probing-interval=" << m_probing.getProbingInterval()
Saurab Dulalaf3ff5a2021-09-19 19:45:07 -040060 << " max-timeouts=" << m_nMaxTimeouts);
Vince Lehman8a4c29e2016-07-11 08:49:35 +000061}
62
Junxiao Shi037f4ab2016-12-13 04:27:06 +000063const Name&
64AsfStrategy::getStrategyName()
65{
Eric Newberry358414d2021-03-21 20:56:42 -070066 static const auto strategyName = Name("/localhost/nfd/strategy/asf").appendVersion(4);
Junxiao Shi037f4ab2016-12-13 04:27:06 +000067 return strategyName;
68}
69
Saurab Dulala6dec222019-04-01 00:15:10 -050070void
Davide Pesavento0498ce82021-06-14 02:02:21 -040071AsfStrategy::afterReceiveInterest(const Interest& interest, const FaceEndpoint& ingress,
Junxiao Shi15e98b02016-08-12 11:21:44 +000072 const shared_ptr<pit::Entry>& pitEntry)
Vince Lehman8a4c29e2016-07-11 08:49:35 +000073{
Saurab Dulal432be572021-01-26 12:09:29 -060074 const auto& fibEntry = this->lookupFib(*pitEntry);
Vince Lehman8a4c29e2016-07-11 08:49:35 +000075
Saurab Dulal432be572021-01-26 12:09:29 -060076 // Check if the interest is new and, if so, skip the retx suppression check
77 if (!hasPendingOutRecords(*pitEntry)) {
78 auto* faceToUse = getBestFaceForForwarding(interest, ingress.face, fibEntry, pitEntry);
79 if (faceToUse == nullptr) {
Davide Pesaventoa6f637a2019-08-28 23:23:20 -040080 NFD_LOG_DEBUG(interest << " new-interest from=" << ingress << " no-nexthop");
Teng Liangebc20f62020-06-23 16:55:20 -070081 sendNoRouteNack(ingress.face, pitEntry);
Saurab Dulala6dec222019-04-01 00:15:10 -050082 }
Davide Pesaventoa6f637a2019-08-28 23:23:20 -040083 else {
Saurab Dulal432be572021-01-26 12:09:29 -060084 NFD_LOG_DEBUG(interest << " new-interest from=" << ingress << " forward-to=" << faceToUse->getId());
85 forwardInterest(interest, *faceToUse, fibEntry, pitEntry);
86 sendProbe(interest, ingress, *faceToUse, fibEntry, pitEntry);
Saurab Dulala6dec222019-04-01 00:15:10 -050087 }
88 return;
89 }
90
Saurab Dulal432be572021-01-26 12:09:29 -060091 auto* faceToUse = getBestFaceForForwarding(interest, ingress.face, fibEntry, pitEntry, false);
Saurab Dulala6dec222019-04-01 00:15:10 -050092 if (faceToUse != nullptr) {
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -040093 auto suppressResult = m_retxSuppression->decidePerUpstream(*pitEntry, *faceToUse);
Saurab Dulal432be572021-01-26 12:09:29 -060094 if (suppressResult == RetxSuppressionResult::SUPPRESS) {
95 // Cannot be sent on this face, interest was received within the suppression window
96 NFD_LOG_DEBUG(interest << " retx-interest from=" << ingress
97 << " forward-to=" << faceToUse->getId() << " suppressed");
98 }
99 else {
100 // The retx arrived after the suppression period: forward it but don't probe, because
101 // probing was done earlier for this interest when it was newly received
102 NFD_LOG_DEBUG(interest << " retx-interest from=" << ingress << " forward-to=" << faceToUse->getId());
103 auto* outRecord = forwardInterest(interest, *faceToUse, fibEntry, pitEntry);
104 if (outRecord && suppressResult == RetxSuppressionResult::FORWARD) {
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -0400105 m_retxSuppression->incrementIntervalForOutRecord(*outRecord);
Saurab Dulal432be572021-01-26 12:09:29 -0600106 }
107 }
Saurab Dulala6dec222019-04-01 00:15:10 -0500108 return;
109 }
110
Saurab Dulal432be572021-01-26 12:09:29 -0600111 // If all eligible faces have been used (i.e., they all have a pending out-record),
112 // choose the nexthop with the earliest out-record
113 const auto& nexthops = fibEntry.getNextHops();
114 auto it = findEligibleNextHopWithEarliestOutRecord(ingress.face, interest, nexthops, pitEntry);
Saurab Dulala6dec222019-04-01 00:15:10 -0500115 if (it == nexthops.end()) {
Saurab Dulal432be572021-01-26 12:09:29 -0600116 NFD_LOG_DEBUG(interest << " retx-interest from=" << ingress << " no eligible nexthop");
117 return;
118 }
119 auto& outFace = it->getFace();
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -0400120 auto suppressResult = m_retxSuppression->decidePerUpstream(*pitEntry, outFace);
Saurab Dulal432be572021-01-26 12:09:29 -0600121 if (suppressResult == RetxSuppressionResult::SUPPRESS) {
122 NFD_LOG_DEBUG(interest << " retx-interest from=" << ingress
123 << " retry-to=" << outFace.getId() << " suppressed");
Saurab Dulala6dec222019-04-01 00:15:10 -0500124 }
125 else {
Saurab Dulal432be572021-01-26 12:09:29 -0600126 NFD_LOG_DEBUG(interest << " retx-interest from=" << ingress << " retry-to=" << outFace.getId());
127 // sendInterest() is used here instead of forwardInterest() because the measurements info
128 // were already attached to this face in the previous forwarding
Davide Pesavento0498ce82021-06-14 02:02:21 -0400129 auto* outRecord = sendInterest(interest, outFace, pitEntry);
Saurab Dulal432be572021-01-26 12:09:29 -0600130 if (outRecord && suppressResult == RetxSuppressionResult::FORWARD) {
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -0400131 m_retxSuppression->incrementIntervalForOutRecord(*outRecord);
Saurab Dulal432be572021-01-26 12:09:29 -0600132 }
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000133 }
134}
135
136void
Davide Pesavento0498ce82021-06-14 02:02:21 -0400137AsfStrategy::beforeSatisfyInterest(const Data& data, const FaceEndpoint& ingress,
138 const shared_ptr<pit::Entry>& pitEntry)
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000139{
Junxiao Shifc021862016-08-25 21:51:18 +0000140 NamespaceInfo* namespaceInfo = m_measurements.getNamespaceInfo(pitEntry->getName());
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000141 if (namespaceInfo == nullptr) {
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400142 NFD_LOG_DEBUG(pitEntry->getName() << " data from=" << ingress << " no-measurements");
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000143 return;
144 }
145
146 // Record the RTT between the Interest out to Data in
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400147 FaceInfo* faceInfo = namespaceInfo->getFaceInfo(ingress.face.getId());
Ashlesh Gawandecad76b62017-04-04 15:28:30 -0500148 if (faceInfo == nullptr) {
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400149 NFD_LOG_DEBUG(pitEntry->getName() << " data from=" << ingress << " no-face-info");
Ashlesh Gawandecad76b62017-04-04 15:28:30 -0500150 return;
151 }
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400152
Md Ashiqur Rahmanc88d2d42019-08-28 20:19:47 +0000153 auto outRecord = pitEntry->getOutRecord(ingress.face);
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400154 if (outRecord == pitEntry->out_end()) {
155 NFD_LOG_DEBUG(pitEntry->getName() << " data from=" << ingress << " no-out-record");
156 }
157 else {
158 faceInfo->recordRtt(time::steady_clock::now() - outRecord->getLastRenewed());
159 NFD_LOG_DEBUG(pitEntry->getName() << " data from=" << ingress
160 << " rtt=" << faceInfo->getLastRtt() << " srtt=" << faceInfo->getSrtt());
161 }
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000162
163 // Extend lifetime for measurements associated with Face
ashiqopuc7079482019-02-20 05:34:37 +0000164 namespaceInfo->extendFaceInfoLifetime(*faceInfo, ingress.face.getId());
Alex Lane9cec6992020-03-05 19:10:09 -0600165 // Extend PIT entry timer to allow slower probes to arrive
166 this->setExpiryTimer(pitEntry, 50_ms);
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400167 faceInfo->cancelTimeout(data.getName());
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000168}
169
170void
Davide Pesavento0498ce82021-06-14 02:02:21 -0400171AsfStrategy::afterReceiveNack(const lp::Nack& nack, const FaceEndpoint& ingress,
Junxiao Shi15e98b02016-08-12 11:21:44 +0000172 const shared_ptr<pit::Entry>& pitEntry)
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000173{
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400174 NFD_LOG_DEBUG(nack.getInterest() << " nack from=" << ingress << " reason=" << nack.getReason());
Alex Lane9cec6992020-03-05 19:10:09 -0600175 onTimeoutOrNack(pitEntry->getName(), ingress.face.getId(), true);
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000176}
177
Saurab Dulal432be572021-01-26 12:09:29 -0600178pit::OutRecord*
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400179AsfStrategy::forwardInterest(const Interest& interest, Face& outFace, const fib::Entry& fibEntry,
Saurab Dulal432be572021-01-26 12:09:29 -0600180 const shared_ptr<pit::Entry>& pitEntry)
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000181{
Saurab Dulal432be572021-01-26 12:09:29 -0600182 const auto& interestName = interest.getName();
Teng Liangebc20f62020-06-23 16:55:20 -0700183 auto faceId = outFace.getId();
184
Davide Pesavento0498ce82021-06-14 02:02:21 -0400185 auto* outRecord = sendInterest(interest, outFace, pitEntry);
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000186
Saurab Dulal432be572021-01-26 12:09:29 -0600187 FaceInfo& faceInfo = m_measurements.getOrCreateFaceInfo(fibEntry, interestName, faceId);
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000188
189 // Refresh measurements since Face is being used for forwarding
Saurab Dulal432be572021-01-26 12:09:29 -0600190 NamespaceInfo& namespaceInfo = m_measurements.getOrCreateNamespaceInfo(fibEntry, interestName);
Teng Liangebc20f62020-06-23 16:55:20 -0700191 namespaceInfo.extendFaceInfoLifetime(faceInfo, faceId);
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000192
193 if (!faceInfo.isTimeoutScheduled()) {
Saurab Dulal432be572021-01-26 12:09:29 -0600194 auto timeout = faceInfo.scheduleTimeout(interestName,
195 [this, name = interestName, faceId] {
196 onTimeoutOrNack(name, faceId, false);
197 });
Teng Liangebc20f62020-06-23 16:55:20 -0700198 NFD_LOG_TRACE("Scheduled timeout for " << fibEntry.getPrefix() << " to=" << faceId
Saurab Dulal432be572021-01-26 12:09:29 -0600199 << " in " << time::duration_cast<time::milliseconds>(timeout));
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000200 }
Saurab Dulal432be572021-01-26 12:09:29 -0600201
202 return outRecord;
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000203}
204
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400205void
206AsfStrategy::sendProbe(const Interest& interest, const FaceEndpoint& ingress, const Face& faceToUse,
207 const fib::Entry& fibEntry, const shared_ptr<pit::Entry>& pitEntry)
208{
Saurab Dulal432be572021-01-26 12:09:29 -0600209 if (!m_probing.isProbingNeeded(fibEntry, interest.getName()))
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400210 return;
211
212 Face* faceToProbe = m_probing.getFaceToProbe(ingress.face, interest, fibEntry, faceToUse);
213 if (faceToProbe == nullptr)
214 return;
215
Saurab Dulal432be572021-01-26 12:09:29 -0600216 Interest probeInterest(interest);
217 probeInterest.refreshNonce();
218 NFD_LOG_TRACE("Sending probe " << probeInterest << " to=" << faceToProbe->getId());
219 forwardInterest(probeInterest, *faceToProbe, fibEntry, pitEntry);
220
221 m_probing.afterForwardingProbe(fibEntry, interest.getName());
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400222}
223
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000224struct FaceStats
225{
Junxiao Shia6de4292016-07-12 02:08:10 +0000226 Face* face;
Ernest McCracken1402fa12019-06-09 00:36:28 -0700227 time::nanoseconds rtt;
228 time::nanoseconds srtt;
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000229 uint64_t cost;
230};
231
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400232struct FaceStatsCompare
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000233{
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400234 bool
235 operator()(const FaceStats& lhs, const FaceStats& rhs) const
236 {
237 time::nanoseconds lhsValue = getValueForSorting(lhs);
238 time::nanoseconds rhsValue = getValueForSorting(rhs);
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000239
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400240 // Sort by RTT and then by cost
241 return std::tie(lhsValue, lhs.cost) < std::tie(rhsValue, rhs.cost);
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000242 }
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400243
244private:
245 static time::nanoseconds
246 getValueForSorting(const FaceStats& stats)
247 {
248 // These values allow faces with no measurements to be ranked better than timeouts
249 // srtt < RTT_NO_MEASUREMENT < RTT_TIMEOUT
250 if (stats.rtt == FaceInfo::RTT_TIMEOUT) {
251 return time::nanoseconds::max();
252 }
253 else if (stats.rtt == FaceInfo::RTT_NO_MEASUREMENT) {
254 return time::nanoseconds::max() / 2;
255 }
256 else {
257 return stats.srtt;
258 }
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000259 }
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400260};
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000261
Junxiao Shia6de4292016-07-12 02:08:10 +0000262Face*
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400263AsfStrategy::getBestFaceForForwarding(const Interest& interest, const Face& inFace,
264 const fib::Entry& fibEntry, const shared_ptr<pit::Entry>& pitEntry,
Saurab Dulala6dec222019-04-01 00:15:10 -0500265 bool isInterestNew)
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000266{
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400267 std::set<FaceStats, FaceStatsCompare> rankedFaces;
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000268
Saurab Dulala6dec222019-04-01 00:15:10 -0500269 auto now = time::steady_clock::now();
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400270 for (const auto& nh : fibEntry.getNextHops()) {
271 if (!isNextHopEligible(inFace, interest, nh, pitEntry, !isInterestNew, now)) {
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000272 continue;
273 }
274
Saurab Dulal432be572021-01-26 12:09:29 -0600275 const FaceInfo* info = m_measurements.getFaceInfo(fibEntry, interest.getName(), nh.getFace().getId());
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000276 if (info == nullptr) {
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400277 rankedFaces.insert({&nh.getFace(), FaceInfo::RTT_NO_MEASUREMENT,
278 FaceInfo::RTT_NO_MEASUREMENT, nh.getCost()});
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000279 }
280 else {
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400281 rankedFaces.insert({&nh.getFace(), info->getLastRtt(), info->getSrtt(), nh.getCost()});
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000282 }
283 }
284
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400285 auto it = rankedFaces.begin();
286 return it != rankedFaces.end() ? it->face : nullptr;
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000287}
288
289void
Alex Lane9cec6992020-03-05 19:10:09 -0600290AsfStrategy::onTimeoutOrNack(const Name& interestName, FaceId faceId, bool isNack)
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000291{
Junxiao Shifc021862016-08-25 21:51:18 +0000292 NamespaceInfo* namespaceInfo = m_measurements.getNamespaceInfo(interestName);
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000293 if (namespaceInfo == nullptr) {
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400294 NFD_LOG_TRACE(interestName << " FibEntry has been removed since timeout scheduling");
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000295 return;
296 }
297
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400298 FaceInfo* fiPtr = namespaceInfo->getFaceInfo(faceId);
299 if (fiPtr == nullptr) {
300 NFD_LOG_TRACE(interestName << " FaceInfo id=" << faceId << " has been removed since timeout scheduling");
301 return;
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000302 }
303
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400304 auto& faceInfo = *fiPtr;
Saurab Dulalaf3ff5a2021-09-19 19:45:07 -0400305 size_t nTimeouts = faceInfo.getNTimeouts() + 1;
306 faceInfo.setNTimeouts(nTimeouts);
Ashlesh Gawande92e4ea52017-07-19 11:38:12 -0500307
Saurab Dulalaf3ff5a2021-09-19 19:45:07 -0400308 if (nTimeouts < m_nMaxTimeouts && !isNack) {
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400309 NFD_LOG_TRACE(interestName << " face=" << faceId << " timeout-count=" << nTimeouts << " ignoring");
Ashlesh Gawande92e4ea52017-07-19 11:38:12 -0500310 // Extend lifetime for measurements associated with Face
311 namespaceInfo->extendFaceInfoLifetime(faceInfo, faceId);
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400312 faceInfo.cancelTimeout(interestName);
Ashlesh Gawande92e4ea52017-07-19 11:38:12 -0500313 }
314 else {
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400315 NFD_LOG_TRACE(interestName << " face=" << faceId << " timeout-count=" << nTimeouts);
Ashlesh Gawande92e4ea52017-07-19 11:38:12 -0500316 faceInfo.recordTimeout(interestName);
317 }
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000318}
319
320void
Teng Liangebc20f62020-06-23 16:55:20 -0700321AsfStrategy::sendNoRouteNack(Face& face, const shared_ptr<pit::Entry>& pitEntry)
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000322{
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000323 lp::NackHeader nackHeader;
324 nackHeader.setReason(lp::NackReason::NO_ROUTE);
Davide Pesavento0498ce82021-06-14 02:02:21 -0400325 this->sendNack(nackHeader, face, pitEntry);
Davide Pesaventoa6f637a2019-08-28 23:23:20 -0400326 this->rejectPendingInterest(pitEntry);
Vince Lehman8a4c29e2016-07-11 08:49:35 +0000327}
328
329} // namespace asf
330} // namespace fw
331} // namespace nfd