Skip to content

Commit

Permalink
fw: Add nack propagation to ASF
Browse files Browse the repository at this point in the history
This change implements the Best Route nack propagation algorithim
to ASF. Currently, this is not provided by ASF and can impact
the ability for consumers to retransmit packets.

Refs #5311

Change-Id: I45b643979c8726402b89028f07eaedd54c11b4c0
  • Loading branch information
awlane committed Feb 2, 2024
1 parent f56cf63 commit 9acba9c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions daemon/fw/asf-strategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ NFD_REGISTER_STRATEGY(AsfStrategy);

AsfStrategy::AsfStrategy(Forwarder& forwarder, const Name& name)
: Strategy(forwarder)
, ProcessNackTraits(this)
, m_measurements(getMeasurements())
, m_probing(m_measurements)
{
Expand Down Expand Up @@ -167,6 +168,7 @@ AsfStrategy::afterReceiveNack(const lp::Nack& nack, const FaceEndpoint& ingress,
{
NFD_LOG_NACK_FROM(nack, ingress, "");
onTimeoutOrNack(pitEntry->getName(), ingress.face.getId(), true);
this->processNack(nack, ingress.face, pitEntry);
}

pit::OutRecord*
Expand Down
7 changes: 5 additions & 2 deletions daemon/fw/asf-strategy.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -29,6 +29,7 @@
#include "strategy.hpp"
#include "asf-measurements.hpp"
#include "asf-probing-module.hpp"
#include "process-nack-traits.hpp"
#include "retx-suppression-exponential.hpp"

namespace nfd::fw {
Expand All @@ -42,7 +43,7 @@ namespace asf {
* with a Smart Forwarding Plane in NDN", NDN Technical Report NDN-0042, 2016.
* https://named-data.net/publications/techreports/ndn-0042-1-asf/
*/
class AsfStrategy : public Strategy
class AsfStrategy : public Strategy, public ProcessNackTraits<AsfStrategy>
{
public:
explicit
Expand Down Expand Up @@ -91,6 +92,8 @@ class AsfStrategy : public Strategy
std::unique_ptr<RetxSuppressionExponential> m_retxSuppression;
ProbingModule m_probing;
size_t m_nMaxTimeouts = 3;

friend ProcessNackTraits<AsfStrategy>;
};

} // namespace asf
Expand Down
2 changes: 2 additions & 0 deletions tests/daemon/fw/strategy-nack-return.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/

// Strategies implementing recommended Nack processing procedure, sorted alphabetically.
#include "fw/asf-strategy.hpp"
#include "fw/best-route-strategy.hpp"
#include "fw/random-strategy.hpp"

Expand Down Expand Up @@ -84,6 +85,7 @@ BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyNackReturn)

using Strategies = boost::mp11::mp_list<
AsfStrategy,
BestRouteStrategy,
RandomStrategy
>;
Expand Down
2 changes: 1 addition & 1 deletion tests/daemon/fw/strategy-scope-control.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct Test

using Tests = boost::mp11::mp_list<
Test<AccessStrategy, false, false, true>,
Test<AsfStrategy, true, false, true>,
Test<AsfStrategy, true, true, true>,
Test<BestRouteStrategy, true, true, true>,
Test<MulticastStrategy, false, false, false>,
Test<RandomStrategy, true, true, true>
Expand Down

0 comments on commit 9acba9c

Please sign in to comment.