BREAKING: Change Name LSAs to propagate cost which are applied to remote routes
This is a stopgap change to address a lack of functionality in the NDN testbed.
Current restrictions:
-Cost must be set from NFD readvertisement
-Cost is applied after routing calculations but before FIB insertion; lowest cost
nexthop will be chosen but may not be the optimal path given this cost.
Further work will be required to move the application of cost as part of routing
and to make this functionality more easily accessible.
Refs #5349
Change-Id: I914dc5c2d5d3cb6bfa13f5730df0eae66d115c60
diff --git a/src/route/name-prefix-table.hpp b/src/route/name-prefix-table.hpp
index 5ac8345..8fca574 100644
--- a/src/route/name-prefix-table.hpp
+++ b/src/route/name-prefix-table.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, The University of Memphis,
+ * Copyright (c) 2014-2025, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -41,6 +41,7 @@
std::unordered_map<ndn::Name, std::shared_ptr<RoutingTablePoolEntry>>;
using NptEntryList = std::list<std::shared_ptr<NamePrefixTableEntry>>;
using const_iterator = NptEntryList::const_iterator;
+ using DestNameKey = std::tuple<ndn::Name, ndn::Name>;
NamePrefixTable(const ndn::Name& ownRouterName, Fib& fib, RoutingTable& routingTable,
AfterRoutingChange& afterRoutingChangeSignal,
@@ -48,6 +49,9 @@
~NamePrefixTable();
+ NexthopList
+ adjustNexthopCosts(const NexthopList& nhlist, const ndn::Name& nameToCheck, const ndn::Name& destRouterName);
+
/*! \brief Add, update, or remove Names according to the Lsdb update
\param lsa The LSA class pointer
\param updateType Update type from Lsdb (INSTALLED, UPDATED, REMOVED)
@@ -56,8 +60,8 @@
*/
void
updateFromLsdb(std::shared_ptr<Lsa> lsa, LsdbUpdate updateType,
- const std::list<ndn::Name>& namesToAdd,
- const std::list<ndn::Name>& namesToRemove);
+ const std::list<nlsr::PrefixInfo>& namesToAdd,
+ const std::list<nlsr::PrefixInfo>& namesToRemove);
/*! \brief Adds a destination to the specified name prefix.
\param name The name prefix
@@ -143,6 +147,7 @@
RoutingTable& m_routingTable;
ndn::signal::Connection m_afterRoutingChangeConnection;
ndn::signal::Connection m_afterLsdbModified;
+ std::map<std::tuple<ndn::Name, ndn::Name>, double> m_nexthopCost;
};
inline NamePrefixTable::const_iterator